# Conflicts:
#	package-lock.json
This commit is contained in:
dongruihua
2023-02-23 09:15:04 +08:00
22 changed files with 264 additions and 466 deletions

View File

@@ -16,6 +16,7 @@
"@wangeditor/editor-for-vue": "^5.1.12",
"ant-design-vue": "^3.2.12",
"axios": "^1.1.3",
"babel-eslint": "^10.1.0",
"core-js": "^3.8.3",
"dayjs": "^1.11.6",
"echarts": "^5.4.1",

View File

@@ -26,7 +26,7 @@
</div>
<div class="endtime" style="margin-left: 64px">签到时间{{beginTime}}</div>
<!-- <div class="endtime" style="margin-left: 40px">签退时间{{endTime}}</div> -->
<div class="endtime" style="margin-left: 40px">签退时间{{endTime}}</div>
</div>
<div class="search">

View File

@@ -293,7 +293,7 @@ const disabledDate = (current) => {
};
const disabledRangeTime = () => ({
disabledHours: () => range(0, 24).splice(4, 20),
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(30, 60),
disabledSeconds: () => [55, 56],
});

View File

@@ -153,7 +153,7 @@ const disabledDate = (current) => {
};
const disabledRangeTime = () => ({
disabledHours: () => range(0, 24).splice(4, 20),
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(30, 60),
disabledSeconds: () => [55, 56],
});

View File

@@ -452,7 +452,7 @@ const disabledDate = (current) => {
};
const disabledRangeTime = () => ({
disabledHours: () => range(0, 24).splice(4, 20),
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(30, 60),
disabledSeconds: () => [55, 56],
});

View File

@@ -20,6 +20,7 @@
<div style="display: flex; flex-direction: row; padding-top: 0px; margin-top: 20px; margin-left: 32px;">
<div>
<button
:disabled="taskIndex >= 0"
style="width: 100px; cursor: pointer;"
@click="changeOuter(1)"
:class="formData.examType === 1 ? 'outer' : 'notOuter'"
@@ -27,6 +28,7 @@
系统考试
</button>
<button
:disabled="taskIndex >= 0"
style="width: 100px; cursor: pointer;"
@click="changeOuter(2)"
:class="formData.examType === 2 ? 'outer' : 'notOuter'"
@@ -54,6 +56,7 @@
style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入考试名称"
:maxlength="20"
:disabled="taskIndex >= 0"
/>
</div>
</div>
@@ -68,14 +71,14 @@
</div>
<span style="margin-right: 3px">选择试卷</span>
</div>
<s-test v-model:id="formData.examinationTestId" v-model:name="formData.examinationTestName">
<s-test v-model:id="formData.examinationPaperId" v-model:name="formData.examinationTestName">
<div class="btnbox">
<button class="xkbtn" style="margin:0">
{{ formData.examinationTestId ? "重选" : "选择" }}试卷
<button class="xkbtn" style="margin:0" :disabled="taskIndex >= 0">
{{ formData.examinationPaperId ? "重选" : "选择" }}试卷
</button>
</div>
</s-test>
<div v-if="formData.examinationTestId">
<div v-if="formData.examinationPaperId">
<a-tag closable color="processing" @close="delTag" :closeIcon="true">
<span style="font-size: 14px; line-height: 33px">{{ formData.examinationTestName }}</span>
</a-tag>
@@ -117,6 +120,7 @@
</div>
<div class="select">
<a-input-number
:disabled="taskIndex >= 0"
:min="0"
:max="300"
:precision="0"
@@ -138,6 +142,7 @@
</div>
<div class="btnbox">
<a-input
:disabled="taskIndex >= 0"
v-model:value="formData.passLine"
type="number"
style="width: 400px; height: 40px; border-radius: 8px"
@@ -152,6 +157,7 @@
</div>
<div class="textarea">
<a-textarea
:disabled="taskIndex >= 0"
v-model:value="formData.examinationExplain"
placeholder="请输入考试说明"
allow-clear
@@ -170,6 +176,7 @@
<div class="timerbox">
<span>允许重复考试</span>
<a-input-number
:disabled="taskIndex >= 0"
:min="-1"
:max="300"
:precision="0"
@@ -194,6 +201,7 @@
</div>
<div class="btnbox">
<a-radio-group
:disabled="taskIndex >= 0"
style="margin-right: 12px"
v-model:value="formData.showAnswers"
>
@@ -208,6 +216,7 @@
</div>
<div class="btnbox">
<a-radio-group
:disabled="taskIndex >= 0"
style="margin-right: 12px"
v-model:value="formData.showAnalysis"
>
@@ -222,6 +231,7 @@
</div>
<div class="btnbox">
<a-radio-group
:disabled="taskIndex >= 0"
style="margin-right: 12px"
v-model:value="formData.scoringModel"
>
@@ -238,6 +248,7 @@
</div>
<div class="btnbox">
<a-radio-group
:disabled="taskIndex >= 0"
style="margin-right: 12px"
v-model:value="formData.questionArrangement"
>
@@ -328,7 +339,7 @@ const props = defineProps({
const visible = ref(false)
const initValue = {
examinationName: '',
examinationTestId: '',
examinationPaperId: '',
examinationStartTime: '',
examinationEndTime: '',
examinationDuration: '',
@@ -349,7 +360,7 @@ const innerRule = {
message: '请输入考试名称',
},
],
examinationTestId: [
examinationPaperId: [
{
required: true,
message: '请输入选择试卷',
@@ -451,7 +462,7 @@ function openDrawer(i, row) {
}
const delTag = () => {
formData.value.examinationTestId = '';
formData.value.examinationPaperId = '';
formData.value.examinationTestName = '';
}

View File

@@ -22,8 +22,8 @@
<img src="../../assets/images/studentimg/character.png" />
</div>
<div class="stumation">
<div class="stuname">{{pro.routerInfo.name}}</div>
<div class="stugangw">{{pro.routerInfo.organizationName?pro.routerInfo.organizationName:"" + '-' + pro.routerInfo.jobName?pro.routerInfo.jobName:""}}</div>
<div class="stuname">{{pro==null?"":pro.routerInfo.name}}</div>
<div class="stugangw">{{pro==null?"":pro.routerInfo.organizationName?pro.routerInfo.organizationName:"" + '-' + pro==null?"":pro.routerInfo.jobName?pro.routerInfo.jobName:""}}</div>
</div>
<div class="sortbox">
<div class="sortname">进度排名</div>
@@ -43,8 +43,8 @@
<div class="sortbox" style="margin-left: 34px">
<div class="sortname">完成必修</div>
<div class="sortnub">
<span class="nub1">{{pro.currentReqCnt}}</span>
<span class="total">/{{pro.totalReqCnt}}</span>
<span class="nub1">{{pro==null?"":pro.currentReqCnt}}</span>
<span class="total">/{{pro==null?"":pro.totalReqCnt}}</span>
</div>
</div>
<a-divider
@@ -57,18 +57,18 @@
<div class="sortbox" style="margin-left: 34px">
<div class="sortname">已修证书</div>
<div class="sortnub">
<span class="nub1">{{pro.routerInfo.certCnt?pro.routerInfo.certCnt:0}}</span>
<span class="nub1">{{pro==null?"":pro.routerInfo.certCnt?pro.routerInfo.certCnt:0}}</span>
</div>
</div>
</div>
<div class="secondrow">
<div class="rowleft">{{ pro.name }}</div>
<!-- <div class="secondrow">
<div class="rowleft">{{ pro.name }}</div> -->
<!-- <div class="rowbox" @click="showProMess">
<div class="shuom">说明</div>
<div><img src="../../assets/images/studentimg/chak.png" /></div>
</div> -->
</div>
<div v-for="(item) in pro.chapterList" class="mainbox"
<!-- </div> -->
<!-- <div v-for="(item) in pro.chapterList" class="mainbox"
style="margin-top: 15px; height: 56px"
:key="item.chapterId">
<div class="rowtitle" @click="changeDown">
@@ -99,7 +99,7 @@
</div>
</div>
</div>
</div>
</div> -->
<div class="mainbox">
<a-collapse v-model:activeKey="stageListActive">
@@ -115,7 +115,7 @@
<div></div>
</template>
<a-collapse-panel
v-for="value in pro.chapterList"
v-for="value in pro==null?[]:pro.chapterList"
:key="value.chapterId"
:header="value.chapterName"
@@ -169,7 +169,7 @@
: item.type === 12
? require('../../assets/images/leveladd/tou.png')
: item.type === 13
? require('../../assets/images/leveladd/diao.png')
? require('../../assets/images/leveladd/xiangmu.png')
: null
"
/>
@@ -266,8 +266,8 @@ export default {
const getStuProgress = () => {
state.loading = true
let obj = {
routerId:props.routerId,
studentId:props.studentId
routerId:props.routerId==null?props.studentId:props.routerId
// routerId:props.studentId
}
stuProgress(obj).then(res => {
console.log("查询当前学员进度信息success",res)
@@ -296,6 +296,7 @@ export default {
"测评",
"评估",
"投票",
"项目",
];
return typeRules[type];
}

View File

@@ -225,6 +225,7 @@ export default {
},
},
setup(props, ctx) {
debugger
const state = reactive({
fileType: ["xls", "xlsx"],
importHomeWork:

View File

@@ -8,7 +8,7 @@
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">组员名单1</div>
<div class="headerTitle">组员名单</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@@ -498,7 +498,7 @@ export default {
let obj = {
projectGroupId: props.chooseGroupId,
projectId: props.projectId,
studentIds: state.selectedRows,
ids: state.selectedRows,
};
console.log("删除小组学员obj", obj);
delGroupStudent(obj)

View File

@@ -110,6 +110,8 @@
? require('../../assets/images/leveladd/tou.png')
: item.course === '评估'
? require('../../assets/images/leveladd/diao.png')
: item.course === '项目'
? require('../../assets/images/leveladd/xiangmu.png')
: null
" />
</div>

View File

@@ -348,8 +348,8 @@ export default {
currentStageId: props.datasource.stageId,
type: 1,
pid: props.datasource.projectId,
taskId: props.datasource.projectTaskId,
taskType: props.datasource.type,
taskId: props.datasource.id,
taskType: props.datasource.type,
status: state.projectName,
studentName: state.name,
});
@@ -360,8 +360,8 @@ export default {
currentStageId: props.datasource.stageId,
type: 1,
pid: props.datasource.projectId,
taskId: props.datasource.projectTaskId,
taskType: props.datasource.type,
taskId: props.datasource.id,
taskType: props.datasource.type,
status: state.projectName,
studentName: state.name,
})
@@ -409,9 +409,9 @@ export default {
// 处理在线课字段和表格中字段保持一致
let obj = {
studentUserNo: res.data.data.studyDetailList[i].studentCode,
studentName: res.data.data.studyDetailList[i].studentName,
studentDepartName: res.data.data.studyDetailList[i].studentDepartName,
studentJobName: res.data.data.studyDetailList[i].studentJobName,
studentName: res.data.data.studyDetailList[i].studentName,
studentDepartName: res.data.data.studyDetailList[i].studentDepartName,
studentJobName: res.data.data.studyDetailList[i].studentJobName,
lastStudyTime: res.data.data.studyDetailList[i].finishedTime,
finishStatus: res.data.data.studyDetailList[i].status?res.data.data.studyDetailList[i].status:0
}
@@ -709,4 +709,4 @@ export default {
}
}
</style>

View File

@@ -61,7 +61,7 @@
<div class="wz">催促考试</div>
</div>-->
<div class="btn btn2" @click="exportData">
<div class="img2"></div>
<div class="img2"></div>
<div class="wz">导出数据</div>
</div>
<!-- <div class="btn btn2" @click="showEScoreModal">
@@ -333,18 +333,39 @@ export default {
ellipsis: true,
className: "h",
customRender: (text) => {
return (
<div class="racona">
<a
onClick={()=>{
state.studentKid = text.record.studentKid;
state.datasource = text.record;
state.CAvisible = true;
}}>
查看答卷
</a>
debugger
console.log("text"+text.record)
if (text.record.finishStatus===1 || text.record.finishStatus===2) {
return (
<div class="racona">
<a-button
type="link"
onClick={()=>{
state.studentKid = text.record.studentKid;
state.datasource = text.record;
state.CAvisible = true;
}}>
查看答卷
</a-button>
</div>
);
}else {
return (
<div class="racona">
<a-button
type="link"
disabled
onClick={()=>{
state.studentKid = text.record.studentKid;
state.datasource = text.record;
state.CAvisible = true;
}}>
查看答卷
</a-button>
</div>
);
}
},
},
],
@@ -409,7 +430,7 @@ export default {
state.loadingData = false;
})
}
// 搜索
function searchTableData() {
state.currentPage = 1;
@@ -419,7 +440,7 @@ export default {
// 重置
function reseatTableData() {
state.loadingData = true;
state.currentPage = 1;
state.currentPage = 1;
state.name = '';
state.projectName = undefined;
getData();

View File

@@ -100,24 +100,29 @@ const selectGroup = (e, v) => {
};
//确认换组
const changeGroup = (item) => {
debugger
console.log("换组", selectGroupId.value, item);
let obj = {
groupId: selectGroupId.value,
groupName: selectGroupName.value,
studentId: props.checkgroupStuId,
};
console.log("换组obj", obj);
api
.changeGroupByStudentId(obj)
.then((res) => {
console.log("换组成功", res);
if (res.data.code === 200) {
message.success("换组成功");
}
})
.catch((err) => {
console.log("换组失败", err);
});
props.checkgroupStuId.forEach(stu => {
let obj = {
groupId: selectGroupId.value,
groupName: selectGroupName.value,
studentId: stu,
};
console.log("换组obj", obj);
api
.changeGroupByStudentId(obj)
.then((res) => {
console.log("换组成功", res);
if (res.data.code === 200) {
message.success("换组成功");
closeChangeModal();
}
})
.catch((err) => {
console.log("换组失败", err);
});
})
};
</script>
@@ -240,4 +245,4 @@ const changeGroup = (item) => {
}
}
}
</style>
</style>

View File

@@ -897,14 +897,16 @@ const submitAuth = () => {
};
function handleStageOk() {
// 判断添加人数是否已超过限制人数
if (props.groupMemberCount < selectsData.value.projectMemberList.length + props.groupMemberNumber) {
return message.warning("添加小组学员超过最大值");
}
// 对选中的人员进行判断是否已经分组了
let haveGroupNum = selectsData.value.projectMemberList.filter(item => item.groupId !== null);
if (haveGroupNum.length > 0) {
message.warning("部分学员已经有小组,再次添加会被添加到当前小组.");
// 判断添加人数是否已超过限制人数 限制 = 本次添加的人 + 原有的人
if(props.type === 1){
if (props.groupMemberCount < selectsData.value.studentList.length + props.groupMemberNumber) {
return message.warning("添加小组学员超过最大值");
}
// 对选中的人员进行判断是否已经分组了
let haveGroupNum = selectsData.value.projectMemberList.filter(item => item.groupId !== null);
if (haveGroupNum.length > 0) {
message.warning("部分学员已经有小组,再次添加会被添加到当前小组.");
}
}
stageVisible.value = false;
visiable.value = false;

View File

@@ -233,7 +233,8 @@
>
<a-button
v-if="checkPer(permissions)"
@click="del(record.id)"
:disabled="record.isLeader === '1' "
@click="del(record.id,record)"
type="link"
danger
>删除</a-button
@@ -254,8 +255,8 @@
<!-- 换组弹窗 -->
<ChangeGroupModal
v-model:changegroupV="checkgroupParam.changegroupV"
:groupList="checkgroupParam.checkgroupList"
:checkgroupStuId="checkgroupParam.checkgroupStuId"
:groupList="groupList"
:checkgroupStuId="stuSelectKeys"
/>
<!-- 批量调整关卡弹窗 -->
<!-- 取消学员弹窗 -->
@@ -393,6 +394,10 @@ const props = defineProps({
type: Boolean,
default: null,
},
groupList: {
type: Array,
default: () => [],
}
});
const topFlagList = ref([
{
@@ -532,6 +537,7 @@ const tableData = ref({
loading: false,
});
const stuRowSelection = computed(() => ({
columnWidth: 20,
selectedRowKeys: stuSelectKeys.value,
@@ -541,6 +547,8 @@ const stuRowSelection = computed(() => ({
//显示学员换组弹窗
function showChangeGroupModal() {
const d = props.groupList
console.log("d"+d)
// debugger
checkgroupParam.value.changegroupV = true;
}
@@ -608,6 +616,8 @@ function getStuList() {
});
}
function reset() {
tableParam.value.studentName = "";
tableParam.value.groupName = ""; //学员小组
@@ -622,11 +632,20 @@ function bathDel() {
message.destroy();
return message.warning("请先选中学员");
}
// 判断选择的人员中是否有小组长
let arr = [...tableData.value.list].filter(x => [...stuSelectKeys.value].some(id => id === x.id)).filter(item => item.isLeader === '1');
if (arr.length > 0) {
return message.warning("选择人员中:"+arr[0].studentName + "是小组长,请勿删除!");
}
tableData.value.loading = true;
delStudentList({ ids: stuSelectKeys.value }).then(() => getStuList());
}
function del(id) {
function del(id,row) {
if (row.isLeader === '1') {
return message.warning(""+row.name + "是小组长,请勿删除!");
}
Modal.confirm({
title: () => "确定删除?",
icon: () => createVNode(ExclamationCircleOutlined),

View File

@@ -54,7 +54,6 @@
<a-range-picker
:show-time="{ format: 'HH:mm' }"
:disabled-date="disabledDate"
:disabled-time="disabledRangeTime"
format="YYYY-MM-DD HH:mm"
style="width: 424px"
v-model:value="dateTime"
@@ -74,16 +73,14 @@
<span>创建投票题干</span>
</div>
<div class="btnbox">
<CreateVote v-model:options="formData.voteStemDtoList" :list="formData.voteStemDtoList">
<CreateVote v-model:options="formData.voteStemDtoList">
<button class="xkbtn">
{{ formData.voteStemDtoList.length ? "编辑" : "创建" }}投票题干
</button>
</CreateVote>
<div v-if="formData.voteStemDtoList.length">
<a-tag closable color="processing" @close="handleDel">
<span style="font-size: 14px; line-height: 33px">
删除投票题干
</span>
<span style="font-size: 14px; line-height: 33px">删除投票题干</span>
</a-tag>
</div>
</div>
@@ -168,14 +165,6 @@ const closeDrawer = () => {
resetFields()
};
const range = (start, end) => {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
};
function timeChange(time, timeStr) {
formData.value.voteStartTime = timeStr[0]
formData.value.voteEndTime = timeStr[1]
@@ -185,13 +174,6 @@ const disabledDate = (current) => {
return current && current < dayjs().startOf('day');
};
const disabledRangeTime = () => ({
disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(30, 60),
disabledSeconds: () => [55, 56],
});
async function confirm() {
await validate().catch(({errorFields}) => {
message.warning(errorFields[0].errors.join());
@@ -223,133 +205,6 @@ function handleDel() {
defineExpose({openDrawer})
// 限制文件格式上传
// const beforeUpload = (file) => {
// if (file.type.indexOf("sheet") == -1) {
// message.destroy();
// message.error("请上传正确的文件格式");
//
// state.fileList = [];
// return false;
// }
//
// const formData = new FormData();
// formData.append("uploadFile", file);
// baseVoteupload(formData).then((res) => {
// if (res.data.code === 200) {
// state.basevote = res.data.data;
// }
// });
// return false;
// };
//
// //删除题干信息接口
// const dleVoteStem = () => {
// api.deleteVoteStem({voteStemId: state.voteId}).then(() => {
// message.success("删除题干信息成功");
// });
// };
//
// //根据投票id获取投票信息
// const queryVoteInfo = () => {
// api.queryVoteDetailById(props.EditVoteId)
// .then((res) => {
// state.inputV1 = res.data.data.voteName;
// state.textV1 = res.data.data.voteExplain;
// state.baseVote = res.data.data.baseVote;
// state.ascriptionId = res.data.data.ascriptionId;
// state.voteId = res.data.data.id;
// state.time = [
// dayjs(res.data.data.voteStartTime, "YYYY-MM-DD HH:mm"),
// dayjs(res.data.data.voteEndTime, "YYYY-MM-DD HH:mm"),
// ];
// })
// };
// const updateToTask = (res) => {
// console.log("props.isLevel=====", props.isLevel);
// if (props.isLevel == 1) {
// if (!props.isactive) {
// message.destroy();
// return message.warning("请先选中关卡");
// }
// RouterEditTask({
// chapterId: props.isactive,
// courseId: res.data.data.id,
// name: res.data.data.voteName,
// routerId: props.routerId,
// routerTaskId: props.routerTaskId || 0,
// type: 12,
// id: props.taskIdDraft
// }).then(() => {
// ctx.emit("changeData", false);
// state.addLoading = false;
// })
// } else if (props.isLevel == 2) {
// apiTask.addTask({
// courseId: res.data.data.id,
// name: res.data.data.voteName,
// projectId: props.projectId,
// projectTaskId: props.projectTaskId || 0,
// stageId: props.chooseStageId || 0,
// type: 12,
// id: props.taskIdDraft
// })
// .then(() => {
// ctx.emit("changeData", false);
// })
// } else if (props.isLevel == 3) {
// addTempTask({
// courseId: res.data.data.id,
// name: res.data.data.voteName,
// projectTemplateId: props.projectTemplateId,
// projectTaskId: props.projectTaskId || 0,
// stageId: props.chooseStageId || 0,
// type: 12,
// id: props.taskIdDraft
// })
// .then(() => {
// ctx.emit("changeData", false);
// //message.success(`${props.edit ? "编辑" : "新增"}阶段任务成功`);
// })
// }
// };
// //修改投票信息接口
// const updateVoteInfo = () => {
//
// if (state.time) {
// state.startTime = dayjs(state.time[0]).format("YYYY-MM-DD HH:mm:ss");
// state.endTime = dayjs(state.time[1]).format("YYYY-MM-DD HH:mm:ss");
// }
// let obj = {
// voteName: state.inputV1,
// voteStartTime: dayjs(state.time[0]).format("YYYY-MM-DD HH:mm:ss"),
// voteEndTime: dayjs(state.time[1]).format("YYYY-MM-DD HH:mm:ss"),
// id: state.voteId,
// voteExplain: state.textV1,
// };
// api.editVote(obj).then(async (res) => {
// await updateToTask(res);
// closeDrawer();
// message.destroy();
// message.success(props.edit ? "修改投票信息成功" : "添加投票信息成功");
// })
// };
// const queryStem = () => {
// state.addStemVisible = true;
// };
// const closeStem = () => {
// state.addStemVisible = false;
// };
// const handlelog = (e) => {
// state.ballotId = null;
// console.log(e);
// };
//
// function downloadTemplate() {
// window.open("/manageApi/投票基础数据模版.xlsx");
// }
</script>
<style lang="scss">
.ConfirmModal {

View File

@@ -34,37 +34,37 @@
</div>
</div>
</div>
<div v-for="(_, index) in formData.list" :key="index">
<VoteQuestion v-model:item="formData[index]" :index="index" @del="itemDel"/>
<div v-for="(item, index) in formData" :key="index+Math.random()">
<VoteQuestion v-if="!item.deleted" :item="item" :index="index" @del="itemDel"/>
</div>
<div class="footer">
<div class="btn">
<a-button
type="primary"
ghost
style="
width: 100px;
height: 40px;
border-radius: 8px;
"
@click="closeDrawer"
>
取消
</a-button>
<a-button
type="primary"
style="
margin-left: 14px;
width: 100px;
height: 40px;
border-radius: 8px;
background-color: #4ea6ff;
"
@click="confirm"
>
保存
</a-button>
<a-button
type="primary"
ghost
style="
width: 100px;
height: 40px;
margin-left: 14px;
border-radius: 8px;
"
@click="closeDrawer"
>
取消
</a-button>
</div>
</div>
</div>
@@ -73,64 +73,58 @@
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import VoteQuestion from "./VoteQuestion.vue";
import {message} from "ant-design-vue";
const prop = defineProps({
options: [],
list: []
const props = defineProps({
options: []
})
const emit = defineEmits({})
const formData = ref({list: [{}]})
const initData = ref({list: [{}]})
console.log(prop.options.length);
const emit = defineEmits({})
const formData = ref(props.options && props.options.length ? [...props.options] : [{
voteStemName: '',
optionDetailList: []
}])
const visible = ref(false)
function openDrawer() {
if (prop.options.length > 0) {
for(let i in initData.value) {
console.log(formData.value[i])
if (initData.value[i].valueSingle != formData.value[i].valueSingle) {
console.log('不等于')
formData.value[i].valueSingle = initData.value[i].valueSingle
}
}
watch(() => props.options.length, () => {
formData.value = props.options && props.options.length ? [...props.options] : [{
voteStemName: '',
optionDetailList: []
}]
})
}else {
formData.value.list = []
setTimeout(() =>{
formData.value.list = [{}]
}, 100)
}
function openDrawer() {
visible.value = true
}
watch(formData.value, () => {
console.log('111',formData.value)
})
const closeDrawer = () => {
console.log('formData',formData.value)
// formData.value = JSON.parse(JSON.stringify(initData.value));
visible.value = false
formData.value = props.options && props.options.length ? [...props.options] : [{
voteStemName: '',
optionDetailList: []
}]
};
async function confirm() {
console.log('confirm');
initData.value = JSON.parse(JSON.stringify(formData.value));
emit('update:options', formData.value.list)
// closeDrawer()
console.log(formData.value)
if (formData.value.some(t => !t.voteStemName && !t.deleted)) {
message.warning('请输入题干名称')
return
}
visible.value = false
emit('update:options', formData.value)
}
function handleAdd() {
formData.value.list.push({})
formData.value.push({
voteStemName: '',
optionDetailList: []
})
}
function itemDel(i) {
formData.value.list.splice(i, 1)
formData.value[i].deleted = true
}
</script>

View File

@@ -15,7 +15,7 @@
</div>
<div class="in">
<a-input
v-model:value="formData.valueSingle"
v-model:value="formData.voteStemName"
placeholder="请输入题干名称"
show-count
:maxlength="20"
@@ -23,13 +23,9 @@
/>
</div>
</div>
<VoteQuestionItem
:key="index"
v-for="(_, index) in formData.optionDetailList"
v-model:item="formData.optionDetailList[index]"
:index="index"
@del="delItem"
/>
<div v-for="(item, index) in formData.optionDetailList" :key="index+Math.random()">
<VoteQuestionItem v-if="!item.deleted" :item="item" :index="index" @del="delItem"/>
</div>
<div class="name">
<div class="in" style="margin-left: 85px; margin-bottom: 20px">
<a-button
@@ -57,13 +53,12 @@ const props = defineProps({
item: {}
})
const emit = defineEmits({})
const emit = defineEmits(['del'])
const formData = ref({optionDetailList: []})
const formData = ref(props.item)
watch(formData.value, () => {
console.log(formData.value)
emit('update:item', formData.value)
watch(props, () => {
formData.value = props.item
})
function handleSingleAdd() {
@@ -71,61 +66,13 @@ function handleSingleAdd() {
}
function delItem(i) {
formData.value.optionDetailList.splice(i, 1)
formData.value.optionDetailList[i].deleted = true
}
function handleDel() {
emit("del", props.index);
}
// const handleTypesDel = () => {
// emit("del", {id: curItem.value.id, curItem: curItem.value});
// };
//
// const handleSingleAdd = () => {
// curItem.value.optionDetailList.push({
// id: curItem.value.optionDetailList.length + 1,
// inputVal: "",
// imgVal: "",
// });
// };
// const imgSrc = ({id, src}) => {
// curItem.value.optionDetailList.forEach((item) => {
// if (item.id === id) {
// item.imgVal = src;
// }
// });
// };
// const delImg = ({id}) => {
// curItem.value.optionDetailList.forEach((item) => {
// if (item.id === id) {
// item.imgVal = "";
// }
// });
// };
// const del = ({id, optionId}) => {
// if (optionId) {
// api.deleteVoteStemOption(optionId).then((res) => {
// if (res.data.code === 200) {
// virtualDel(id);
// }
// });
// } else {
// virtualDel(id);
// }
// };
// const virtualDel = (id) => {
// // 前端删除
// curItem.value.optionDetailList.forEach((item, index) => {
// if (item.id === id) {
// curItem.value.optionDetailList.splice(index, 1);
// }
// });
// curItem.value.optionDetailList.map((item, index) => {
// item.id = index + 1;
// });
// };
</script>
<style lang="scss">
.researchadd {

View File

@@ -8,7 +8,7 @@
</div>
<div class="in">
<a-input
v-model:value="formData.name"
v-model:value="formData.optionName"
show-count
:maxlength="30"
style="border-radius: 8px"
@@ -22,12 +22,11 @@
v-show="!formData.imgVal"
class="in uploadBtn"
:show-upload-list="false"
:before-upload="beforeUpload"
>
<div class="addimg">+添加图片{{ index }}</div>
</a-upload>
<div v-show="formData.imgVal" class="picture" style="position: relative">
<img class="pictureimg" :src="formData.imgVal"/>
<div v-show="formData.optionPictureAddress" class="picture" style="position: relative">
<img class="pictureimg" :src="formData.optionPictureAddress"/>
<div class="picturename" v-show="hasImgName">{{ hasImgName }}</div>
<img
style="
@@ -46,19 +45,15 @@
</div>
</template>
<script setup>
import {defineEmits, defineProps, ref, watch} from "vue";
import {defineEmits, defineProps, ref} from "vue";
const props = defineProps({
item: {},
index: Number
})
const emit = defineEmits({})
const emit = defineEmits(['del'])
const formData = ref({})
watch(formData.value, () => {
emit('update:item', formData.value)
})
const formData = ref(props.item)
function handleDel() {
emit('del', props.index)

View File

@@ -59,7 +59,7 @@
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">封面图</div>
<div class="inname">封面图2</div>
</div>
<div class="in select" style="flex: 1; display: flex">
<div
@@ -324,12 +324,25 @@
<div class="topc">封面图</div>
</div>
<div class="imagesBox">
<div
<!-- <div
@click="() => (projectInfo.picUrl = src.value)"
v-for="item in projectPic"
:key="item.code"
class="learnBgItem"
>
> -->
<div
@click="chooseImg2(item)"
v-for="item in projectPic"
:key="item.code"
class="learnBgItem"
:style="{
border:
pathBgId === item.code
? '2px solid rgba(78, 166, 255, 1)'
: '1px solid #ccc',
'background-image': 'url(' + item.value.split(',')[0] + ')',
}"
>
<!-- <img class="im" :src="item.source" /> -->
</div>
</div>

View File

@@ -712,6 +712,7 @@
:columns="stuColumns"
:stage="stage"
:visable="tabFlag"
:groupList="groupList"
>
<template #extension="{ data: { record } }">
<a-button @click="showStudent(record)" type="link"
@@ -747,7 +748,7 @@
</div>
</div>
<div class="second2" v-if="checkPer(permissions)">
<div class="btn1" @click="showModal2(1, null)">
<div class="btn1" @click="showModal2()">
<img src="../../assets/images/courseManage/add0.png" />
<span class="btn1text">创建小组</span>
</div>
@@ -769,7 +770,7 @@
<div class="groupmain">
<div
class="groupbox"
v-for="item in groupList"
v-for="item in groupPageList"
:key="item.projectGroupId"
>
<div style="width: 90%">
@@ -781,12 +782,12 @@
>. . .</span
>
<div class="moreItems" v-if="checkPer(permissions)">
<div class="sammo" @click="showModal2(2, item)">
<div class="sammo" @click="showModal2(item)">
编辑
</div>
<div
class="sammo"
@click="deleteGroupBtn(item.projectGroupId)"
@click="deleteGroupBtn(item.id)"
>
删除
</div>
@@ -796,13 +797,13 @@
<div class="leader">组长:{{ item.leaderName }}</div>
<div class="grocenter">
<div class="leader1">进度</div>
<a-progress :percent="item.completeRatio" />
<a-progress :percent="(item.completeRatio || 0) * 100" />
</div>
<div
class="grofooter"
@click="
showMemberList(
item.projectGroupId,
item.id,
item.groupName,
item.groupMemberCount
)
@@ -1645,7 +1646,7 @@
>
<div class="headerLeft" style="margin-left: 32px">
<span class="headerLeftText" style="font-size: 16px">{{
stuMemberClassify === 1 ? "创建小组" : "编辑小组"
!groupInfo?.id ? "创建小组" : "编辑小组"
}}</span>
</div>
<div style="cursor: pointer; margin-right: 32px" @click="closeModal2">
@@ -1666,7 +1667,7 @@
<div class="inname">小组名称:</div>
<div class="in">
<a-input
v-model:value="valueaddg"
v-model:value="groupInfo.groupName"
placeholder="请输入小组名称"
style="border-radius: 8px; height: 40px"
:maxlength="100"
@@ -1688,7 +1689,7 @@
:max="300"
:precision="0"
style="width: 395px; height: 40px; border-radius: 8px"
v-model:value="groupNumber"
v-model:value="groupInfo.groupMemberCount"
></a-input-number>
</div>
</div>
@@ -1702,14 +1703,9 @@
<div class="inname">小组长:</div>
<div class="in">
<ProjectManager
v-model:value="stuGroupId"
v-model:name="stuGroupName"
v-model:value="groupInfo.leaderId"
v-model:name="groupInfo.leaderName"
></ProjectManager>
<!-- <a-input
v-model:value="valueaddm"
placeholder="请输入小组长"
style="border-radius: 8px; height: 40px"
/> -->
</div>
</div>
<div class="pubtn">
@@ -2389,6 +2385,8 @@ export default {
inputValue3: 5,
valueaddm: "", //创建小组输入小组长
valueaddg: "", //创建小组输入名称
groupInfo: {leaderName:'',leaderId:''}, //创建小组
groupPageList: [], //小组列表
groupNumber: 0, //组员人数
valuestun: "", //学员管理姓名
valuegood: "",
@@ -3019,42 +3017,30 @@ export default {
console.log("点击换组", record.studentId);
state.checkgroupStuId = record.studentId;
};
const showModal2 = (classify, item) => {
state.stuMemberClassify = classify;
state.projectGroupId =
item && item.projectGroupId ? item.projectGroupId : null;
const showModal2 = (item) => {
state.stugroup = true;
console.log("item", item);
if (item) {
state.valueaddg = item.groupName;
state.groupNumber = item.groupMemberCount;
state.stuGroupName = item.leaderName;
state.stuGroupId = item.leaderId;
}
console.log("编辑小组item", item);
state.groupInfo = item || {};
};
const closeModal2 = () => {
state.stugroup = false;
state.valueaddg = null;
state.groupNumber = 0;
state.stuGroupName = null;
state.stuGroupId = null;
state.projectGroupId = null;
state.stuMemberClassify = null;
state.groupInfo = {};
};
//点击确定创建小组
const createG = () => {
if (
state.stuGroupName == "" ||
state.valueaddg == "" ||
state.groupNumber == null
) {
message.destroy();
return message.warning("请输入必填项");
} else {
createGroup();
closeModal2();
if(!state.groupInfo.groupName){
return message.warning("请输入小组名称");
}
if(!state.groupInfo.leaderId){
return message.warning("请选择小组长");
}
if(!state.groupInfo.leaderName){
return message.warning("请选择小组长");
}
if(!state.groupInfo.groupMemberCount){
return message.warning("请输入组员数量");
}
createGroup();
closeModal2();
};
const showFaceIn = () => {
state.TaskFaceImpStuvisible = true;
@@ -3468,7 +3454,7 @@ export default {
<a-select-option value="删除" label="删除">
<div
onClick={() => {
// console.log("点击了111", text);
{/* console.log("点击了111", text); */}
showDeleteOne(text.record.studentId);
}}
>
@@ -3684,12 +3670,12 @@ export default {
data.map((value) => {
let obj = {
projectId: value.projectId, //项目id
projectGroupId: value.projectGroupId, //小组id
projectGroupId: value.id, //小组id
groupName: value.groupName, //小组名称
leaderId: value.leaderId, //组长id
leaderName: value.leaderName, //组长名称
groupMemberCount: value.groupMemberCount, //组员人数
source: value.source == 1 ? "指定添加" : "随机分组",
groupMemberCount: value.groupMemberCount, //组员人数 == 1 ? "指定添加" : "随机分组",
source: value.source ,
completeTaskCnt: value.completeTaskCnt, //完成任务数
totalTaskCnt: value.totalTaskCnt, //累计任务数
completeRatio: value.completeRatio ? value.completeRatio : 0, //完成比例
@@ -3854,78 +3840,22 @@ export default {
pageSize: 10,
projectId: state.projectId,
};
getGroupList(objf)
.then((res) => {
console.log(res.data.data.rows, "获取小组列表成功");
if (res.data.code === 200) {
let arr = res.data.data.rows;
setGroupList(arr);
}
// let leng = res.data.data.rows.length;
// if (leng > 0) {
// }
})
.catch((err) => {
console.log(err, "获取列表失败");
});
getGroupList(objf).then((res) => {state.groupPageList = res.data.data.rows})
};
//删除小组
const deleteGroupBtn = (projectGroupId) => {
deleteGroup({
projectGroupId: projectGroupId,
}).then((res) => {
console.log("删除小组成功", res);
deleteGroup({projectGroupId}).then(() => {
message.success("删除小组成功");
getGroup();
});
};
//创建小组
const createGroup = () => {
//新建
if (state.stuMemberClassify === 1) {
let obj = {
groupName: state.valueaddg,
groupMemberCount: state.groupNumber,
leaderId: state.stuGroupId,
leaderName: state.stuGroupName,
// projectGroupId: 0,
projectId: state.projectId,
};
console.log("小组创建obj", obj);
editGroup(obj)
.then((res) => {
console.log("小组创建成功", res);
message.success("小组创建成功");
getGroup();
getStu();
})
.catch((err) => {
console.log("小组创建失败", err);
message.warning("小组创建失败");
});
}
//编辑
if (state.stuMemberClassify === 2) {
let obj = {
groupName: state.valueaddg,
groupMemberCount: state.groupNumber,
leaderId: state.stuGroupId,
leaderName: state.stuGroupName,
projectGroupId: state.projectGroupId,
projectId: state.projectId,
};
console.log("编辑小组obj", obj);
editGroup(obj)
.then((res) => {
console.log("小组编辑成功", res);
message.success("小组编辑成功");
getGroup();
})
.catch((err) => {
console.log("小组编辑失败", err);
message.warning("小组编辑失败");
});
}
const createGroup = async () => {
const id = state.groupInfo.id
await editGroup({...state.groupInfo,projectId:state.projectId})
message.success(id?'小组编辑成功':"小组创建成功");
getGroup();
getStu();
};
//搜索小组重置
const resetGroupName = () => {
@@ -7497,4 +7427,4 @@ export default {
}
}
}
</style>
</style>

View File

@@ -15,7 +15,8 @@ module.exports = defineConfig({
port: 8070,
proxy: {
"/manageApi": {
target: 'http:' + process.env.VUE_APP_PROXY_URL,
// target: 'http:' + process.env.VUE_APP_PROXY_URL,
target: 'http://localhost:30001',
changeOrigin: true, //表示是否改变原域名
pathRewrite: {
// "^/manageApi": "",