mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-08 18:36:46 +08:00
二维码积分
This commit is contained in:
@@ -21,8 +21,11 @@
|
||||
</div>
|
||||
<div class="downloadCode" style="">
|
||||
<div class="qrm_body">
|
||||
<div class="codename">
|
||||
{{ codeInfo.name ? codeInfo.name : "" }}
|
||||
<div v-if="codeInfo.name" class="codename">
|
||||
开课:{{ codeInfo.name ? codeInfo.name : "" }}
|
||||
</div>
|
||||
<div v-if="codeInfo.teacherName" class="codename">
|
||||
讲师:{{ codeInfo.teacherName ? codeInfo.teacherName : "" }}
|
||||
</div>
|
||||
<qrcode-vue
|
||||
:value="codeInfo.url.startsWith('/')?(`${domain+codeInfo.url}&t=10`):`${codeInfo.url}&t=10`"
|
||||
@@ -163,6 +166,7 @@ export default {
|
||||
title: "",
|
||||
name: "",
|
||||
url: "",
|
||||
teacherName: "",
|
||||
};
|
||||
state.codeInfo = Object.assign(obj, props.codeInfo);
|
||||
console.log("codeInfo22222", state.codeInfo, props.index, props.type);
|
||||
|
||||
@@ -18,7 +18,11 @@
|
||||
</div>
|
||||
<div class="downloadCode" style="">
|
||||
<div class="qrm_body">
|
||||
<div class="codename">{{ name }}</div>
|
||||
<div>
|
||||
<div class="codename" v-if="courseName">项目:{{ courseName }}</div>
|
||||
<div class="codename">课程:{{ name }}</div>
|
||||
<div class="codename" v-if="createName">讲师:{{ createName }}</div>
|
||||
</div>
|
||||
<QrcodeVue :value="url" :size="size" style="width: 200px; height: 200px"></QrcodeVue>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,6 +69,8 @@ const props = defineProps({
|
||||
default: 800
|
||||
},
|
||||
name: String,
|
||||
createName: String,
|
||||
courseName: String,
|
||||
title: {
|
||||
type: String,
|
||||
default: "二维码"
|
||||
@@ -168,9 +174,10 @@ function copyUrl() {
|
||||
font-weight: 400;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 5px;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,14 +115,14 @@
|
||||
:infoType="type"
|
||||
@finash="submitCall"
|
||||
>
|
||||
<a-button :class="{ 'notClick': courseSelectRows.length > 0 }" :disabled="courseSelectRows.length>0" class="cus-btn" style="background: #4ea6ff; color: #fff">
|
||||
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff">
|
||||
<template #icon><img style="margin-right: 10px" src="../../../assets/images/courseManage/add0.png"/>
|
||||
</template>
|
||||
添加学员
|
||||
</a-button>
|
||||
</CommonStudent>
|
||||
<CommonImport @change="change" title="导入学员" :template-url="stuTemplateUrl" :data="{ targetId: offcoursePlanId, type:3 }" :url="`/admin/student/importStudent`" name="uploadFile">
|
||||
<div class="btn btn1" style="margin-right: 20px;margin-left: 20px" :class="{ 'notClick': courseSelectRows.length > 0 }">
|
||||
<div class="btn btn1" style="margin-right: 20px;margin-left: 20px">
|
||||
<div class="img1"></div>
|
||||
<div class="wz">导入学员</div>
|
||||
</div>
|
||||
@@ -456,14 +456,14 @@ const change = (e) => {
|
||||
|
||||
<style lang="scss">
|
||||
.notClick{
|
||||
cursor: pointer;
|
||||
pointer-events: none;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
border: 1px solid #3b3c3c !important;
|
||||
border-radius: 8px;
|
||||
color: #fff !important;
|
||||
background-color: #3b3c3c !important;
|
||||
// cursor: pointer;
|
||||
// pointer-events: none;
|
||||
// width: 100px;
|
||||
// height: 40px;
|
||||
// border: 1px solid #3b3c3c !important;
|
||||
// border-radius: 8px;
|
||||
// color: #fff !important;
|
||||
// background-color: #3b3c3c !important;
|
||||
}
|
||||
|
||||
.me {
|
||||
@@ -836,7 +836,15 @@ const change = (e) => {
|
||||
|
||||
.tableBox {
|
||||
// margin-bottom: 80px;
|
||||
|
||||
.ant-select-dropdown{
|
||||
display: inline-block;
|
||||
}
|
||||
.ant-select-selection-item{
|
||||
margin-left: 3px;
|
||||
}
|
||||
.ant-pagination-options-size-changer.ant-select{
|
||||
width: 84px;
|
||||
}
|
||||
.classify {
|
||||
// margin-left: 11px !important;
|
||||
// padding-left: 9px !important;
|
||||
|
||||
@@ -164,6 +164,22 @@
|
||||
</a-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name name2">
|
||||
<div class="namebox">
|
||||
<div class="inname">积分排行榜</div>
|
||||
</div>
|
||||
<div class="in ggysxz">
|
||||
<a-checkbox v-model:checked="rankFlag">
|
||||
<span style="
|
||||
width: 100%;
|
||||
color: rgba(109, 117, 132, 1);
|
||||
font-size: 14px;
|
||||
">
|
||||
是否展示积分
|
||||
</span>
|
||||
</a-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name name2">
|
||||
<div class="namebox">
|
||||
<div class="inname" style="margin-top: 13px">项目说明</div>
|
||||
@@ -285,6 +301,7 @@ export default {
|
||||
},
|
||||
classifyList5: [],
|
||||
courseSyncFlag: true,
|
||||
rankFlag:false,
|
||||
auditDescription: "",
|
||||
ptojectType: "",
|
||||
changeCondition: false,
|
||||
@@ -340,6 +357,7 @@ export default {
|
||||
state.projectInfo.endTime,
|
||||
];
|
||||
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
|
||||
state.rankFlag = !!state.projectInfo.rankFlag;
|
||||
if (Number(state.projectInfo.status) === -5) {
|
||||
let obj = {
|
||||
project_id: state.projectInfo.id,
|
||||
@@ -479,6 +497,7 @@ export default {
|
||||
}
|
||||
state.projectInfo.type = 3;
|
||||
state.projectInfo.courseSyncFlag = state.courseSyncFlag ? 1 : 0;
|
||||
state.projectInfo.rankFlag = state.rankFlag ? 1 : 0;
|
||||
api.createProject(state.projectInfo).then((res) => {
|
||||
state.loading = false;
|
||||
message.destroy();
|
||||
|
||||
@@ -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();
|
||||
@@ -5093,6 +5151,14 @@ export default {
|
||||
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