mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 11:26:45 +08:00
二维码积分
This commit is contained in:
@@ -178,6 +178,7 @@ export const exportHomeWork = (obj) => http.get('/admin/student/exportHomeWork',
|
|||||||
export const exportHomeWorkTemplate = (obj) => http.get('/admin/student/exportHomeWorkTemplate', { params: obj })
|
export const exportHomeWorkTemplate = (obj) => http.get('/admin/student/exportHomeWorkTemplate', { params: obj })
|
||||||
//签到
|
//签到
|
||||||
export const attendanceSign = (obj) => http.post('/stu/task/attendance/sign', obj)
|
export const attendanceSign = (obj) => http.post('/stu/task/attendance/sign', obj)
|
||||||
|
export const attendanceSignAll = (obj) => http.post('/stu/task/all/sign', obj)
|
||||||
//请假
|
//请假
|
||||||
export const attendanceLeave = (obj) => http.post('/stu/task/attendance/leave', obj)
|
export const attendanceLeave = (obj) => http.post('/stu/task/attendance/leave', obj)
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="downloadCode" style="">
|
<div class="downloadCode" style="">
|
||||||
<div class="qrm_body">
|
<div class="qrm_body">
|
||||||
<div>
|
<div class="qrm_body_info">
|
||||||
<div class="codename" v-if="courseName">项目:{{ courseName }}</div>
|
<div class="codename" v-if="courseName">项目:{{ courseName }}</div>
|
||||||
<div class="codename">课程:{{ name }}</div>
|
<div class="codename">开课:{{ name }}</div>
|
||||||
<div class="codename" v-if="createName">讲师:{{ createName }}</div>
|
<div class="codename" v-if="createName">讲师:{{ createName }}</div>
|
||||||
</div>
|
</div>
|
||||||
<QrcodeVue :value="url" :size="size" style="width: 200px; height: 200px"></QrcodeVue>
|
<QrcodeVue :value="url" :size="size" style="width: 200px; height: 200px"></QrcodeVue>
|
||||||
@@ -168,7 +168,10 @@ function copyUrl() {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
.qrm_body_info{
|
||||||
|
width: 100%;
|
||||||
|
margin-left: 278px;
|
||||||
|
}
|
||||||
.codename {
|
.codename {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@@ -178,6 +181,10 @@ function copyUrl() {
|
|||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,8 +145,12 @@
|
|||||||
@change="timeChange"
|
@change="timeChange"
|
||||||
:placeholder="' 开始时间'"
|
:placeholder="' 开始时间'"
|
||||||
:disabled="editBeginClass"
|
:disabled="editBeginClass"
|
||||||
|
@blur="onBlurStart"
|
||||||
|
@focus="onFocusStart"
|
||||||
|
@select="onDateSelect"
|
||||||
/>
|
/>
|
||||||
<span style="margin: 0 10px;">至</span>
|
|
||||||
|
<span style="margin: 0 10px;">至</span>
|
||||||
<!-- 第二个日期选择器,用于结束时间 -->
|
<!-- 第二个日期选择器,用于结束时间 -->
|
||||||
<a-date-picker
|
<a-date-picker
|
||||||
style="width: 41%; height: 40px; border-radius: 8px"
|
style="width: 41%; height: 40px; border-radius: 8px"
|
||||||
@@ -157,11 +161,14 @@
|
|||||||
@change="timeChangeEnd"
|
@change="timeChangeEnd"
|
||||||
:placeholder="' 结束时间'"
|
:placeholder="' 结束时间'"
|
||||||
:disabled="editBeginClass"
|
:disabled="editBeginClass"
|
||||||
|
@focus="onFocusEnd"
|
||||||
|
@blur="onBlurEnd"
|
||||||
|
@select="onDateEnd"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cstm_items">
|
<div class="cstm_items" style="align-items: baseline;">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
<div class="sign">
|
<div class="sign">
|
||||||
<img
|
<img
|
||||||
@@ -171,12 +178,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<span style="margin-right: 3px">授课教师</span>
|
<span style="margin-right: 3px">授课教师</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="select" style="width: 74.5%">
|
<div class="teacher_input select" style="display: flex; flex-wrap: wrap;width: 74.5%">
|
||||||
<ProjectManager
|
<div v-for="(item, index) in formData.offteachers"
|
||||||
v-model:value="formData.teacherId"
|
:key="index" style="display: flex;margin-bottom: 10px;width: 100%;">
|
||||||
v-model:name="formData.teacher"
|
<ProjectManager
|
||||||
:disabled="editBeginClass"
|
v-model:value="item.teacherId"
|
||||||
></ProjectManager>
|
v-model:name="item.teacherName"
|
||||||
|
:disabled="editBeginClass"
|
||||||
|
></ProjectManager>
|
||||||
|
<a-input-number :min="0" :max="100" @change="inputWeightChange(index)" v-model:value="item.weight" placeholder="%"/>
|
||||||
|
<span style="margin-top: 10px;width: 34px;">权重</span>
|
||||||
|
<div style="display: flex;">
|
||||||
|
<a-button shape="circle" class="btn-circle btn-add" @click="inputAdd">+</a-button>
|
||||||
|
<a-button shape="circle" class="btn-circle" @click="inputRemove(index)" :disabled="formData.offteachers.length == 1">-</a-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cstm_items">
|
<div class="cstm_items">
|
||||||
@@ -398,7 +415,7 @@ import {Form, message} from "ant-design-vue";
|
|||||||
import FJUpload from "@/components/common/FJUpload";
|
import FJUpload from "@/components/common/FJUpload";
|
||||||
import CheckBox from "@/components/common/CheckBox";
|
import CheckBox from "@/components/common/CheckBox";
|
||||||
import RangePicker from "@/components/common/RangePicker";
|
import RangePicker from "@/components/common/RangePicker";
|
||||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
import ProjectManager from "@/components/project/ProjectManagerNewTeacher";
|
||||||
import AddHomework from "@/components/drawers/CommonHomework.vue";
|
import AddHomework from "@/components/drawers/CommonHomework.vue";
|
||||||
import AddTest from "@/components/drawers/CommonTest.vue";
|
import AddTest from "@/components/drawers/CommonTest.vue";
|
||||||
import NameInput from "@/components/project/NameInput";
|
import NameInput from "@/components/project/NameInput";
|
||||||
@@ -410,7 +427,7 @@ import {request,useRowsPageNoInit} from "@/api/request";
|
|||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
import {useResetRef} from "@/utils/useCommon";
|
import {useResetRef} from "@/utils/useCommon";
|
||||||
import { validateName } from "@/api/index1";
|
import { validateName } from "@/api/index1";
|
||||||
|
import moment from 'moment';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
});
|
});
|
||||||
@@ -446,6 +463,19 @@ const columns = ref([
|
|||||||
key: "teacher",
|
key: "teacher",
|
||||||
width: "20%",
|
width: "20%",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
customRender: ({ record }) => {
|
||||||
|
const teachers = record.offteachers;
|
||||||
|
return teachers.map((teacher, index) => {
|
||||||
|
// 如果需要显示为列表形式
|
||||||
|
return (
|
||||||
|
<div key={index}>
|
||||||
|
{teacher.teacherName}
|
||||||
|
{index !== teachers.length - 1 && ', '}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "学员数",
|
title: "学员数",
|
||||||
@@ -484,6 +514,13 @@ const params = ref({
|
|||||||
taskId: "",
|
taskId: "",
|
||||||
createBeginTime: '',
|
createBeginTime: '',
|
||||||
createEndTime: '',
|
createEndTime: '',
|
||||||
|
offteachers:[
|
||||||
|
{
|
||||||
|
teacherId: '',
|
||||||
|
teacherName: '',
|
||||||
|
weight: '',
|
||||||
|
}
|
||||||
|
]
|
||||||
});
|
});
|
||||||
const validated = ref(0);
|
const validated = ref(0);
|
||||||
const dateTime = ref([]);
|
const dateTime = ref([]);
|
||||||
@@ -493,7 +530,7 @@ const formData = useResetRef({
|
|||||||
name: "",
|
name: "",
|
||||||
address: "",
|
address: "",
|
||||||
teacherId: "",
|
teacherId: "",
|
||||||
teacher: "",
|
// teacher: "",
|
||||||
beforeValue: "",
|
beforeValue: "",
|
||||||
afterStartValue: "",
|
afterStartValue: "",
|
||||||
applyFlag: 0,
|
applyFlag: 0,
|
||||||
@@ -510,6 +547,13 @@ const formData = useResetRef({
|
|||||||
offcourseId: "",
|
offcourseId: "",
|
||||||
draftTaskId: "",
|
draftTaskId: "",
|
||||||
taskId: "",
|
taskId: "",
|
||||||
|
offteachers: [
|
||||||
|
{
|
||||||
|
teacherId: "",
|
||||||
|
teacherName: "",
|
||||||
|
weight:''
|
||||||
|
}
|
||||||
|
],
|
||||||
});
|
});
|
||||||
const formDataRule = {
|
const formDataRule = {
|
||||||
name: [
|
name: [
|
||||||
@@ -530,35 +574,102 @@ const formDataRule = {
|
|||||||
message: "请选择结束时间",
|
message: "请选择结束时间",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
teacher: [
|
offteachers: [
|
||||||
{
|
{
|
||||||
required: true,
|
validator: (rule, value, callback) => {
|
||||||
message: "请选择教师",
|
if (!value.every(item => item.teacherName)) {
|
||||||
|
callback(new Error('请选择教师'));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
message: '请选择教师',
|
||||||
|
fields: {
|
||||||
|
teacherName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择教师",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
teacherId: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: "请选择教师",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// duration: [
|
|
||||||
// {
|
|
||||||
// required: true,
|
|
||||||
// message: "请输入持续时间",
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
const { validate } = Form.useForm(formData, formDataRule);
|
const { validate } = Form.useForm(formData, formDataRule);
|
||||||
const durationText = computed(() => dateTime.value?.length?dayjs(dateTime.value[1]).diff(dayjs(dateTime.value[0]),'minute'):'请输入持续时间');
|
const durationText = computed(() => dateTime.value?.length?dayjs(dateTime.value[1]).diff(dayjs(dateTime.value[0]),'minute'):'请输入持续时间');
|
||||||
function timeChange(time, timeStr) {
|
|
||||||
|
function inputAdd() {
|
||||||
|
formData.value.offteachers.push({
|
||||||
|
teacherId: "",
|
||||||
|
teacherName: "",
|
||||||
|
weight: '',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function inputRemove(index) {
|
||||||
|
dialog({
|
||||||
|
content: "确定删除此授课教师吗?",
|
||||||
|
ok: async () => {
|
||||||
|
formData.value.offteachers.splice(index, 1);
|
||||||
|
message.success("删除成功");
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const totalWeightSum = ref(0)
|
||||||
|
function inputWeightChange(index) {
|
||||||
|
let totalWeight = 0
|
||||||
|
formData.value.offteachers.forEach(item => {
|
||||||
|
totalWeight += Number(item.weight);
|
||||||
|
});
|
||||||
|
if (totalWeight > 100) {
|
||||||
|
formData.value.offteachers[index].weight -= totalWeight - 100;
|
||||||
|
totalWeight = 100;
|
||||||
|
}
|
||||||
|
totalWeightSum.value = totalWeight
|
||||||
|
}
|
||||||
|
function timeChange(timeStr) {
|
||||||
|
console.log(timeStr,'timeStr')
|
||||||
formData.value.beginTime = timeStr;
|
formData.value.beginTime = timeStr;
|
||||||
// formData.value.duration = durationText.value
|
// formData.value.duration = durationText.value
|
||||||
// formData.value.duration || (formData.value.duration = dayjs(timeStr[1]).diff(dayjs(timeStr[0]),'minute'))
|
// formData.value.duration || (formData.value.duration = dayjs(timeStr[1]).diff(dayjs(timeStr[0]),'minute'))
|
||||||
}
|
}
|
||||||
function timeChangeEnd(time,timeStr){
|
function onDateSelect(date) {
|
||||||
|
const month = String(date.$M+1).padStart(2, '0')
|
||||||
|
const day = String(date.$D).padStart(2, '0')
|
||||||
|
dateTime.value[0]=date.$y+'-'+month+'-'+day+' '+date.$H+':'+date.$m
|
||||||
|
}
|
||||||
|
function onBlurStart(){
|
||||||
|
onFocusStart()
|
||||||
|
console.log(dateTime.value[0],'dateTime')
|
||||||
|
}
|
||||||
|
function onFocusStart(){
|
||||||
|
if(!dateTime.value[0]){
|
||||||
|
let now=new Date()
|
||||||
|
let start=new Date(now.setFullYear(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0))
|
||||||
|
dateTime.value = [
|
||||||
|
moment(start).format('YYYY-MM-DD HH:mm'),
|
||||||
|
dateTime.value[1]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function timeChangeEnd(timeStr){
|
||||||
formData.value.endTime = timeStr;
|
formData.value.endTime = timeStr;
|
||||||
}
|
}
|
||||||
|
function onDateEnd(date) {
|
||||||
|
const month = String(date.$M+1).padStart(2, '0')
|
||||||
|
const day = String(date.$D).padStart(2, '0')
|
||||||
|
dateTime.value[1]=date.$y+'-'+month+'-'+day+' '+date.$H+':'+date.$m
|
||||||
|
}
|
||||||
|
function onFocusEnd(){
|
||||||
|
if(!dateTime.value[1]){
|
||||||
|
let now=new Date()
|
||||||
|
let start=new Date()
|
||||||
|
let end=new Date(now.setFullYear(now.getFullYear()))
|
||||||
|
dateTime.value = [
|
||||||
|
dateTime.value[0],
|
||||||
|
moment(end).format('YYYY-MM-DD HH:mm')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
function search() {
|
function search() {
|
||||||
tableRef.value.fetch();
|
tableRef.value.fetch();
|
||||||
}
|
}
|
||||||
@@ -597,6 +708,13 @@ const createNewCourse = () => {
|
|||||||
dateTime.value = [];
|
dateTime.value = [];
|
||||||
validated.value = 0;
|
validated.value = 0;
|
||||||
onceName.value = "";
|
onceName.value = "";
|
||||||
|
formData.value.offteachers = [
|
||||||
|
{
|
||||||
|
teacherId: "",
|
||||||
|
teacherName: "",
|
||||||
|
weight: '',
|
||||||
|
},
|
||||||
|
];
|
||||||
offCourseNewVisiable.value = true;
|
offCourseNewVisiable.value = true;
|
||||||
};
|
};
|
||||||
const handleCancelStu = () => offCourseNewVisiable.value = false;
|
const handleCancelStu = () => offCourseNewVisiable.value = false;
|
||||||
@@ -622,18 +740,26 @@ const del = (id,record) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
async function coursePlanConfirm() {
|
async function coursePlanConfirm() {
|
||||||
if(editBeginClass.value){
|
console.log({ ...formData.value },'{ ...formData.value }')
|
||||||
message.info('讲师费已进入审批阶段,无法编辑')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if(dateTime.value.length<2){
|
|
||||||
message.info('请选择开始时间和结束时间')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
await validate().catch(({ errorFields }) => {
|
await validate().catch(({ errorFields }) => {
|
||||||
message.warning(errorFields[0].errors.join());
|
message.warning(errorFields[0].errors.join());
|
||||||
throw Error("数据校验不通过");
|
throw Error("数据校验不通过");
|
||||||
});
|
});
|
||||||
|
if(dateTime.value.length<2){
|
||||||
|
message.info('请选择开始时间和结束时间')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(formData.value.offteachers.length==1&& totalWeightSum.value!=100){
|
||||||
|
message.error('单名教师您设置的权重应该是100%')
|
||||||
|
return
|
||||||
|
}else if(formData.value.offteachers.length>1&& totalWeightSum.value!=100){
|
||||||
|
message.error('多名教师权重合计值为100%')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(editBeginClass.value){
|
||||||
|
message.info('讲师费已进入审批阶段,无法编辑')
|
||||||
|
return
|
||||||
|
}
|
||||||
const offName = await validateName({
|
const offName = await validateName({
|
||||||
name: formData.value.name,
|
name: formData.value.name,
|
||||||
type: 5,
|
type: 5,
|
||||||
@@ -652,6 +778,8 @@ async function coursePlanConfirm() {
|
|||||||
// TODO 当点击选择了是否评估按钮 点击保存的时候没有选择评估 则是否需要评估重置为 0 不需要
|
// TODO 当点击选择了是否评估按钮 点击保存的时候没有选择评估 则是否需要评估重置为 0 不需要
|
||||||
formData.value.evalFlag = formData.value.assessmentName ? 1 : 0;
|
formData.value.evalFlag = formData.value.assessmentName ? 1 : 0;
|
||||||
formData.value.duration = formData.value.duration ? formData.value.duration : durationText.value
|
formData.value.duration = formData.value.duration ? formData.value.duration : durationText.value
|
||||||
|
formData.value.beginTime = dateTime.value[0]
|
||||||
|
formData.value.endTime = dateTime.value[1]
|
||||||
await request(COURSE_PLAN_EDIT, { ...formData.value });
|
await request(COURSE_PLAN_EDIT, { ...formData.value });
|
||||||
handleCancelStu();
|
handleCancelStu();
|
||||||
tableRef.value.fetch();
|
tableRef.value.fetch();
|
||||||
@@ -666,6 +794,7 @@ function planEdit(record) {
|
|||||||
}
|
}
|
||||||
onceName.value = record.name;
|
onceName.value = record.name;
|
||||||
formData.value = { ...record };
|
formData.value = { ...record };
|
||||||
|
console.log({ ...record },'{ ...record }')
|
||||||
validated.value = 0;
|
validated.value = 0;
|
||||||
formData.value.homeWorkId && request(WORK_DETAIL(formData.value.homeWorkId), {}).then(res => formData.value.workInfo = res.data);
|
formData.value.homeWorkId && request(WORK_DETAIL(formData.value.homeWorkId), {}).then(res => formData.value.workInfo = res.data);
|
||||||
formData.value.testId && request(EXAM_DETAIL(formData.value.testId), {}).then(res => formData.value.examInfo = res.data);
|
formData.value.testId && request(EXAM_DETAIL(formData.value.testId), {}).then(res => formData.value.examInfo = res.data);
|
||||||
@@ -1161,7 +1290,28 @@ defineExpose({ openDrawer });
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 23px;
|
margin-bottom: 23px;
|
||||||
|
.teacher_input{
|
||||||
|
.ant-input-number{
|
||||||
|
width: 15%;
|
||||||
|
height: 40px !important;
|
||||||
|
border-radius: 8px !important;
|
||||||
|
border: 1px solid #C7CBD2 !important;
|
||||||
|
margin: 0 10px 0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn-add{
|
||||||
|
margin: 0 10px 0 10px;
|
||||||
|
}
|
||||||
|
.btn-circle{
|
||||||
|
text-align: center;
|
||||||
|
line-height: 100%;
|
||||||
|
margin-top: 5px;
|
||||||
|
span{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
font-size: 33px;
|
||||||
|
}
|
||||||
|
}
|
||||||
.signbox {
|
.signbox {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btnss" style="margin-top: 20px" v-if="checkPer(permissions,createId) && data?.length">
|
<div class="btnss" style="margin-top: 20px;flex-wrap: wrap;" v-if="checkPer(permissions,createId) && data?.length">
|
||||||
<div
|
<div
|
||||||
class="btn btn1"
|
class="btn btn1"
|
||||||
style="margin-right: 20px"
|
style="margin-right: 20px"
|
||||||
@@ -130,6 +130,9 @@
|
|||||||
<div class="btn btn1" @click="batchSign" style="margin-right: 20px">
|
<div class="btn btn1" @click="batchSign" style="margin-right: 20px">
|
||||||
<div class="wz">批量签到</div>
|
<div class="wz">批量签到</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="btn btn1" @click="batchSignAll" style="margin-right: 20px">
|
||||||
|
<div class="wz">全部签到</div>
|
||||||
|
</div>
|
||||||
<div class="btn btn1" @click="exportTaskStu" style="margin-right: 20px" :class="{ 'notClick': courseSelectRows.length > 0 }">
|
<div class="btn btn1" @click="exportTaskStu" style="margin-right: 20px" :class="{ 'notClick': courseSelectRows.length > 0 }">
|
||||||
<div class="img2"></div>
|
<div class="img2"></div>
|
||||||
<div class="wz">导出签到数据</div>
|
<div class="wz">导出签到数据</div>
|
||||||
@@ -183,6 +186,11 @@ const signOptions = ref([
|
|||||||
value: 0,
|
value: 0,
|
||||||
label: "请假",
|
label: "请假",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
value: 0,
|
||||||
|
label: "未签到",
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
@@ -365,7 +373,19 @@ const batchSign = () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const batchSignAll = () => {
|
||||||
|
dialog({
|
||||||
|
content: "确定全部签到吗?",
|
||||||
|
ok: async () => {
|
||||||
|
message.success("全部签到成功");
|
||||||
|
tableRef.value.toLoading();
|
||||||
|
await api.attendanceSignAll({
|
||||||
|
courseId: offcoursePlanId.value
|
||||||
|
});
|
||||||
|
tableRef.value.fetch();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
function stuSign(text) {
|
function stuSign(text) {
|
||||||
text.record.signStatus = !text.record.signStatus;
|
text.record.signStatus = !text.record.signStatus;
|
||||||
text.record.leaveStatus = !text.record.signStatus;
|
text.record.leaveStatus = !text.record.signStatus;
|
||||||
@@ -739,7 +759,7 @@ const change = (e) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
.img1 {
|
.img1 {
|
||||||
width: 19px;
|
width: 19px;
|
||||||
height: 19px;
|
height: 19px;
|
||||||
|
|||||||
@@ -46,16 +46,19 @@ const id = computed(() => {
|
|||||||
|
|
||||||
const emit = defineEmits({});
|
const emit = defineEmits({});
|
||||||
const secondItem = store.state.project_level.find((e, index) => index === 1);
|
const secondItem = store.state.project_level.find((e, index) => index === 1);
|
||||||
const options = computed(() =>
|
const options = computed(() =>{
|
||||||
store.state.project_level
|
const projectLevels = store.state.project_level.slice();
|
||||||
.sort((a, b) => parseInt(b.value) - parseInt(a.value))
|
const lastItem = projectLevels.pop();
|
||||||
.filter((e) => e != secondItem)
|
projectLevels.unshift(lastItem);
|
||||||
.concat(secondItem)
|
if (projectLevels.length >= 3) {
|
||||||
.map((e) => ({
|
const thirdItem = projectLevels.splice(1, 1)[0];
|
||||||
|
projectLevels.splice(2, 0, thirdItem);
|
||||||
|
}
|
||||||
|
return projectLevels.map((e) => ({
|
||||||
value: parseInt(e.value),
|
value: parseInt(e.value),
|
||||||
label: e.name,
|
label: e.name,
|
||||||
}))
|
}));
|
||||||
);
|
});
|
||||||
|
|
||||||
function change(key) {
|
function change(key) {
|
||||||
emit("update:value", key);
|
emit("update:value", key);
|
||||||
|
|||||||
121
src/components/project/ProjectManagerNewTeacher.vue
Normal file
121
src/components/project/ProjectManagerNewTeacher.vue
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<a-select
|
||||||
|
:getPopupContainer="
|
||||||
|
(triggerNode) => {
|
||||||
|
return triggerNode.parentNode || document.body;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
v-model:value="managerArray"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:filterOption="false"
|
||||||
|
:options="isOpen?options:selectOptions"
|
||||||
|
allowClear
|
||||||
|
showSearch
|
||||||
|
:mode="mode"
|
||||||
|
:disabled="disabled"
|
||||||
|
@popupScroll="memberScroll"
|
||||||
|
@search="searchMember"
|
||||||
|
:open="isOpen"
|
||||||
|
@change="change"
|
||||||
|
@blur="blur"
|
||||||
|
:show-arrow="false"
|
||||||
|
style="width: 60%"
|
||||||
|
>
|
||||||
|
<template v-if="loading" #notFoundContent>
|
||||||
|
<a-spin size="small"/>
|
||||||
|
</template>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import {computed, defineEmits, defineProps, onMounted, ref, watch} from "vue";
|
||||||
|
import {useThrottlePage} from "@/api/request";
|
||||||
|
import {USER_LIST} from "@/api/apis";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
disabled: Boolean,
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: "请输入搜索关键字",
|
||||||
|
},
|
||||||
|
mode: String
|
||||||
|
})
|
||||||
|
|
||||||
|
const selectOptions = ref([])
|
||||||
|
|
||||||
|
const managerArray = computed(() => props.mode === 'select' ? props.value : (props.value ? props.value.split(',') : []))
|
||||||
|
|
||||||
|
const emit = defineEmits({})
|
||||||
|
|
||||||
|
const isOpen = ref(false)
|
||||||
|
|
||||||
|
const memberParam = ref({keyword: '', pageNo:1, pageSize: 20})
|
||||||
|
|
||||||
|
const {data: userList, loading} = useThrottlePage(USER_LIST, memberParam.value, false)
|
||||||
|
|
||||||
|
const options = computed(() => userList.value.filter(e => !(props.value + '').includes(e.id)).map(e => ({
|
||||||
|
label: e.realName + e.userNo,
|
||||||
|
value: e.id,
|
||||||
|
...e,
|
||||||
|
audienceList: null
|
||||||
|
})))
|
||||||
|
|
||||||
|
watch(props, init)
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
//第一次进来 编辑赋值
|
||||||
|
if (props.value && (props.value + '') !== selectOptions.value.map(e => e.value).join(',')) {
|
||||||
|
selectOptions.value = (props.value + '').split(',').map((e, i) => ({label: props.name.split(',')[i], value: e}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
console.log('onMounted')
|
||||||
|
init()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const memberScroll = ({target: {scrollHeight, scrollTop, clientHeight}}) => {
|
||||||
|
scrollHeight === (clientHeight + scrollTop) && memberParam.value.pageNo++
|
||||||
|
};
|
||||||
|
|
||||||
|
//搜索学员
|
||||||
|
const searchMember = (keyword) => {
|
||||||
|
console.log('searchMember', keyword)
|
||||||
|
loading.value = true
|
||||||
|
isOpen.value = true
|
||||||
|
userList.value = []
|
||||||
|
memberParam.value.pageNo = 1
|
||||||
|
memberParam.value.keyword = keyword
|
||||||
|
console.log('searchMember', memberParam.value)
|
||||||
|
};
|
||||||
|
|
||||||
|
function blur() {
|
||||||
|
isOpen.value = false
|
||||||
|
memberParam.value.keyword = ''
|
||||||
|
memberParam.value.pageNo = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function change(e, l) {
|
||||||
|
memberParam.value.keyword = ''
|
||||||
|
memberParam.value.pageNo = 1
|
||||||
|
isOpen.value = false
|
||||||
|
Array.isArray(l) && (selectOptions.value = l)
|
||||||
|
Array.isArray(selectOptions.value) && emit('onChange', e, l, selectOptions.value.find(e => e.departId)?.departId, selectOptions.value.find(e => e.departId)?.departName, selectOptions.value.find(e => e.departId)?.orgName)
|
||||||
|
if (Array.isArray(l)) {
|
||||||
|
emit('update:name', l.map(t => t.label).join(','))
|
||||||
|
emit('update:value', l.map(t => t.value).join(','))
|
||||||
|
} else {
|
||||||
|
emit('update:name', l?.label)
|
||||||
|
emit('update:value', l?.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -2431,7 +2431,7 @@ export default {
|
|||||||
qrCode({
|
qrCode({
|
||||||
title: "【签到】二维码",
|
title: "【签到】二维码",
|
||||||
courseName: courseName,
|
courseName: courseName,
|
||||||
name: name,
|
name: name+'课程签到',
|
||||||
createName:createName,
|
createName:createName,
|
||||||
url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${id}&taskType=${2}&type=${3}`,
|
url: `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}/admin/student/studentSign?taskId=${id}&taskType=${2}&type=${3}`,
|
||||||
});
|
});
|
||||||
@@ -2465,7 +2465,7 @@ export default {
|
|||||||
qrCode({
|
qrCode({
|
||||||
title: "【评估】二维码",
|
title: "【评估】二维码",
|
||||||
courseName: courseName,
|
courseName: courseName,
|
||||||
name: name,
|
name: name+'课程评估',
|
||||||
createName:createName,
|
createName:createName,
|
||||||
url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${id}&type=3&infoId=${id}&courseId=${assessmentId}&chapterOrStageId=0`,
|
url: `${location.protocol}//${location.host}/student-h5/investigatpage?id=${id}&type=3&infoId=${id}&courseId=${assessmentId}&chapterOrStageId=0`,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user