mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
二维码积分
This commit is contained in:
@@ -615,6 +615,44 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="operations">
|
||||
<div class="operations_dropdown">
|
||||
<a-dropdown :getPopupContainer='triggerNode=> triggerNode.parentNode' v-if="item.assessmentIds.length > 0" :trigger="['click']" v-model:visible="visibleEwmpg[item.id]">
|
||||
<a class="ant-dropdown-link" @click="qrcodeAssement(item)">
|
||||
评估二维码
|
||||
<DownOutlined />
|
||||
</a>
|
||||
<template #overlay>
|
||||
<a-menu @click="handleMenuClickpg">
|
||||
<template v-for="(item, index) in qrCodeItemspg" :key="item.courseName+'+'+item.createName+'+'+item.assessmentId+'+'+item.name+'+'+item.id">
|
||||
<a-menu-item>
|
||||
<div>
|
||||
<p>{{ item.name }}</p>
|
||||
</div>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<div class="operations_dropdown">
|
||||
<a-dropdown :getPopupContainer='(triggerNode) => triggerNode.parentNode' v-if="item.type == 2" :trigger="['click']" v-model:visible="visibleEwm[item.id]">
|
||||
<a class="ant-dropdown-link" @click="qrcodeVisible(item)">
|
||||
签到二维码
|
||||
<DownOutlined />
|
||||
</a>
|
||||
<template #overlay v-if="qrCodeItems.length>0">
|
||||
<a-menu @click="handleMenuClick">
|
||||
<template v-for="(item, index) in qrCodeItems" :key="item.courseName+'+'+item.createName+'+'+item.name+'+'+item.id">
|
||||
<a-menu-item>
|
||||
<div>
|
||||
<p>{{ item.name }}</p>
|
||||
</div>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<div
|
||||
class="operation"
|
||||
style="cursor: pointer"
|
||||
@@ -645,22 +683,6 @@
|
||||
>
|
||||
二维码
|
||||
</div>
|
||||
<div
|
||||
class="operation"
|
||||
style="cursor: pointer"
|
||||
@click="qrcodeVisible(item)"
|
||||
v-if="item.type == 2"
|
||||
>
|
||||
签到二维码
|
||||
</div>
|
||||
<div
|
||||
class="operation"
|
||||
style="cursor: pointer"
|
||||
@click="qrcodeAssement(item)"
|
||||
v-if="item.type == 2"
|
||||
>
|
||||
评估二维码
|
||||
</div>
|
||||
<div
|
||||
class="operation"
|
||||
style="cursor: pointer; margin-right: 10px"
|
||||
@@ -2287,7 +2309,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="jsx">
|
||||
import { reactive, toRefs, onMounted, watch, computed } from "vue";
|
||||
import { reactive, toRefs, onMounted, watch, computed,ref } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import { useRouter } from "vue-router";
|
||||
import TimeManage from "../../components/drawers/TimeManage";
|
||||
@@ -2343,8 +2365,6 @@ import ChangeGroupModal from "@/components/student/ChangeGroupModal.vue";
|
||||
import { checkPer,fixDoublePer } from "@/utils/utils";
|
||||
import ImpoterGroupLeader from "@/components/drawers/project/ImpoterGroupLeader.vue";
|
||||
import qrCode from "@/utils/qrCode";
|
||||
import {COURSE_PLAN_LIST} from "@/api/apis";
|
||||
import {useRequest} from "@/api/request";
|
||||
export default {
|
||||
name: "taskPage",
|
||||
components: {
|
||||
@@ -2381,36 +2401,74 @@ export default {
|
||||
ImpoterGroupLeader,
|
||||
},
|
||||
setup() {
|
||||
const qrCodeItems = ref([]);
|
||||
const visibleEwm = ref({});
|
||||
const qrcodeVisible = async (item)=>{
|
||||
console.log(item,'item')
|
||||
if(qrCodeItems.value.length!=0){
|
||||
qrCodeItems.value = []
|
||||
}
|
||||
visibleEwm.value[item.id] = !visibleEwm.value[item.id];
|
||||
const planParams = {
|
||||
type: 1,
|
||||
offcourseId: item.courseId,
|
||||
taskId: item.id
|
||||
taskId: item.id,
|
||||
};
|
||||
courseData(planParams).then((res)=>{
|
||||
qrCode({
|
||||
title: "【签到】二维码",
|
||||
name: res.data.data[0].name + '课程签到',
|
||||
url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${res.data.data[0].id}&taskType=${2}&type=${3}`,
|
||||
});
|
||||
await courseData(planParams).then((res)=>{
|
||||
qrCodeItems.value = res.data.data.map((dataItem) => ({
|
||||
...dataItem,
|
||||
courseName: item.name,
|
||||
}));
|
||||
if(qrCodeItems.value.length==0){
|
||||
message.info("暂无签到二维码")
|
||||
}
|
||||
})
|
||||
}
|
||||
const qrcodeAssement = async (item)=>{
|
||||
const planParams = {
|
||||
type: 1,
|
||||
offcourseId: item.courseId,
|
||||
taskId: item.id
|
||||
};
|
||||
courseData(planParams).then((res)=>{
|
||||
const assessment = res.data.data[0];
|
||||
console.log(assessment,'assessment')
|
||||
qrCode({
|
||||
title: "【评估】二维码",
|
||||
name: res.data.data[0].name + '课程评估',
|
||||
url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${res.data.data[0].id}&type=3&infoId=${res.data.data[0].id}&courseId=${res.data.data[0].assessmentId}&chapterOrStageId=0`,
|
||||
function handleMenuClick({key}) {
|
||||
const courseName = key.split("+")[0]
|
||||
const createName = key.split("+")[1]
|
||||
const name = key.split("+")[2]
|
||||
const id = key.split("+")[3]
|
||||
qrCode({
|
||||
title: "【签到】二维码",
|
||||
courseName: courseName,
|
||||
name: name,
|
||||
createName:createName,
|
||||
url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${id}&taskType=${2}&type=${3}`,
|
||||
});
|
||||
}
|
||||
const qrCodeItemspg = ref([]);
|
||||
const visibleEwmpg = ref({});
|
||||
const qrcodeAssement = async (item)=>{
|
||||
if(qrCodeItemspg.value.length!=0){
|
||||
qrCodeItemspg.value = []
|
||||
}
|
||||
visibleEwmpg.value[item.id] = !visibleEwmpg.value[item.id];
|
||||
const planParams = {
|
||||
type: 1,
|
||||
offcourseId: item.courseId,
|
||||
taskId: item.id,
|
||||
};
|
||||
await courseData(planParams).then((res)=>{
|
||||
const qrCodeItemspgItem = res.data.data.map((dataItem) => ({
|
||||
...dataItem,
|
||||
courseName: item.name, // 将 item 的 name 添加到每项数据中
|
||||
}));
|
||||
qrCodeItemspg.value = qrCodeItemspgItem.filter(item => item.assessmentId !== null);
|
||||
})
|
||||
}
|
||||
function handleMenuClickpg({key}) {
|
||||
const courseName = key.split("+")[0]
|
||||
const createName = key.split("+")[1]
|
||||
const assessmentId = key.split("+")[2]
|
||||
const name = key.split("+")[3]
|
||||
const id = key.split("+")[4]
|
||||
qrCode({
|
||||
title: "【评估】二维码",
|
||||
courseName: courseName,
|
||||
name: name,
|
||||
createName:createName,
|
||||
url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${id}&type=3&infoId=${id}&courseId=${assessmentId}&chapterOrStageId=0`,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
const store = useStore();
|
||||
@@ -5092,6 +5150,14 @@ export default {
|
||||
handleChangeGroupLeader,
|
||||
qrcodeVisible,
|
||||
qrcodeAssement,
|
||||
|
||||
handleMenuClick,
|
||||
qrCodeItems,
|
||||
visibleEwm,
|
||||
qrCodeItemspg,
|
||||
visibleEwmpg,
|
||||
handleMenuClickpg
|
||||
|
||||
|
||||
|
||||
};
|
||||
@@ -6611,9 +6677,11 @@ export default {
|
||||
|
||||
.operations {
|
||||
display: flex;
|
||||
width: 240px;
|
||||
|
||||
width: 340px;
|
||||
//flex-grow: 1;
|
||||
.operations_dropdown{
|
||||
padding: 10px;text-align: center;position: relative;margin-left: auto;margin-right: 10px;
|
||||
}
|
||||
.operation {
|
||||
color: #4ea6ff;
|
||||
font-size: 14px;
|
||||
|
||||
Reference in New Issue
Block a user