mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-25 02:32:54 +08:00
Merge branch 'dongwu-develop' into develop
This commit is contained in:
@@ -33,7 +33,7 @@ import {USER_PERMISSION} from "@/api/ThirdApi";
|
||||
|
||||
const store = useStore();
|
||||
const isLogin = ref(false);
|
||||
console.log("版本2.3.3------------");
|
||||
console.log("版本2.3.4------------");
|
||||
|
||||
// 监听关闭浏览器
|
||||
let time1 = ref(0);
|
||||
|
||||
@@ -60,7 +60,7 @@ const rulesRef = ref({
|
||||
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
|
||||
const selectIds = computed(()=>props.chapterList.flatMap(t=>props.infoType===1?t.taskDraftDtoList:t.draftTaskList)?.filter(s=>s?.type==props.type).map(t=>t.courseId).join(',') || '')
|
||||
const selectIds = computed(()=>props.chapterList.flatMap(t=>props.infoType===1?t.taskDraftDtoList:props.infoType===2?t.draftTaskList:t.taskTemplateList)?.filter(s=>s?.type==props.type).map(t=>t.courseId).join(',') || '')
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<!-- eslint-disable vue/no-use-v-if-with-v-for -->
|
||||
<template>
|
||||
<a-drawer :visible="Seevisible" class="drawerStyle seestu" placement="right" width="70%">
|
||||
<a-drawer :visible="Seevisible" class="drawerStyle seestu" placement="right" width="70%" :zIndex="1005">
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">查看</div>
|
||||
@@ -193,14 +193,14 @@ export default {
|
||||
};
|
||||
|
||||
const getStuRank = () => {
|
||||
projectStudentRank({projectId: props.projectId, studentId: props.checkStuId}).then(res => state.rank = res.data.data)
|
||||
props.projectId && props.checkStuId && projectStudentRank({projectId: props.projectId, studentId: props.checkStuId}).then(res => state.rank = res.data.data)
|
||||
}
|
||||
const showProMess = () => {
|
||||
state.Provisible = true;
|
||||
};
|
||||
const check = () => {
|
||||
state.loading = true
|
||||
projectStudentProcess({projectId: props.projectId, userId: props.checkStuId}).then((res) => {
|
||||
props.projectId && props.checkStuId && projectStudentProcess({projectId: props.projectId, userId: props.checkStuId}).then((res) => {
|
||||
state.loading = false
|
||||
state.info = res.data.data;
|
||||
})
|
||||
|
||||
@@ -112,27 +112,26 @@
|
||||
</div>-->
|
||||
</div>
|
||||
</a-drawer>
|
||||
<!-- 学员查看抽屉 -->
|
||||
<check-stu
|
||||
v-model:CheckStuvisible="CheckStuvisible"
|
||||
v-model:routerId="routerId"
|
||||
v-model:studentId="studentId"
|
||||
/>
|
||||
<see-stu
|
||||
v-model:Seevisible="CheckStuvisible"
|
||||
:checkStuId="studentId"
|
||||
:projectId="datasource.courseId"
|
||||
:certificateNum="datasource.certCount"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { toRefs, reactive, onMounted, onUnmounted } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
// import * as api from "../../../api/index";
|
||||
import SeeStu from "@/components/drawers/SeeStu";
|
||||
import * as api from "../../../api/indexTaskManage";
|
||||
import CheckStu from "../CheckStu";
|
||||
import {checkPer} from "@/utils/utils";
|
||||
import { batchSendMessage } from "@/api/index1";
|
||||
|
||||
export default {
|
||||
name: "RouterProjectManage",
|
||||
components:{
|
||||
CheckStu,
|
||||
SeeStu,
|
||||
},
|
||||
props: {
|
||||
createId: {
|
||||
@@ -203,8 +202,6 @@
|
||||
CVvisible:false, //查看投票抽屉
|
||||
voteID: "",
|
||||
courseID: "",
|
||||
|
||||
|
||||
routerId: '',
|
||||
studentId: '',
|
||||
CheckStuvisible: false,
|
||||
|
||||
@@ -688,9 +688,12 @@ watch(visiable, () => {
|
||||
audienceName.value.keyword = "";
|
||||
|
||||
if (!visiable.value) {
|
||||
auditTableRef.value && auditTableRef.value.resetSelected() && auditTableRef.value.reset({ keyword: "" }) && auditTableRef.value.clear();
|
||||
stuTableRef.value && stuTableRef.value.resetSelected() && stuTableRef.value.reset({ keyword: "", departId: null }) && stuTableRef.value.clear();
|
||||
projectStuTableRef.value && projectStuTableRef.value.resetSelected() && projectStuTableRef.value.reset() && projectStuTableRef.value.clear();
|
||||
auditTableRef.value && auditTableRef.value.resetSelected() && auditTableRef.value.clear();
|
||||
auditTableRef.value && auditTableRef.value.reset({ keyword: "" });
|
||||
stuTableRef.value && stuTableRef.value.resetSelected() && stuTableRef.value.clear();
|
||||
stuTableRef.value && stuTableRef.value.reset({ keyword: "", departId: null });
|
||||
projectStuTableRef.value && projectStuTableRef.value.resetSelected() && projectStuTableRef.value.clear();
|
||||
projectStuTableRef.value && projectStuTableRef.value.reset();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -597,9 +597,7 @@ const cancelStorage = async () => {
|
||||
};
|
||||
|
||||
// 开课按钮
|
||||
const openCourse = (ele) => {
|
||||
coursePlanRef.value.openDrawer(ele);
|
||||
};
|
||||
const openCourse = (ele) => coursePlanRef.value.openDrawer(ele);
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ConfirmModal {
|
||||
|
||||
@@ -927,7 +927,7 @@ export default defineComponent({
|
||||
const value = ref("");
|
||||
const textnum = "150";
|
||||
const routered = useRouter();
|
||||
const {query: {projectTemplateId,projectId}} = useRoute();
|
||||
const {query: {projectTemplateId:projectId}} = useRoute();
|
||||
const changeopclo = () => {
|
||||
state.projectInfo.noticeFlag = state.checked ? 1 : 0;
|
||||
api
|
||||
@@ -1398,7 +1398,7 @@ export default defineComponent({
|
||||
return {
|
||||
...toRefs(state),
|
||||
value,
|
||||
projectTemplateId,
|
||||
projectId,
|
||||
textnum,
|
||||
changeopclo,
|
||||
changecheck2,
|
||||
|
||||
@@ -533,6 +533,7 @@ const showModal = () => {
|
||||
};
|
||||
const editModal = () => {
|
||||
formValue.value = projectInfo.value.stageList[activeIndex.value]
|
||||
formValue.value.edit = true
|
||||
stage.value = true
|
||||
};
|
||||
|
||||
@@ -542,7 +543,7 @@ function editStage() {
|
||||
message.warning("请输入阶段名称!");
|
||||
return
|
||||
}
|
||||
if(formValue.value.id){
|
||||
if(formValue.value.edit){
|
||||
stage.value = false
|
||||
return
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<img src="../../assets/images/projectadd/right.png" style="margin-left: 10px; cursor: pointer"
|
||||
@click="showCancel" v-show="projectInfo.stageList[0].id != '0'" />
|
||||
</div>
|
||||
<div class="btn btn3" @click="showModal({}, 'add')" style="margin-left: 19px">
|
||||
<div class="btn btn3" @click="showModal()" style="margin-left: 19px">
|
||||
<div class="search"></div>
|
||||
<div class="btnText">添加阶段</div>
|
||||
</div>
|
||||
@@ -33,10 +33,10 @@
|
||||
<span style="font-size: 12px; color: #ffffff">说明</span>
|
||||
</div>
|
||||
</a-popover>
|
||||
<div class="imgIcon" @click="showModal(element, 'edit')"></div>
|
||||
<div class="imgIcon" @click="editModal()"></div>
|
||||
</div>
|
||||
<div class="boxs_right">
|
||||
<div class="imgIcon" @click="showDeleteStage(index)"></div>
|
||||
<div class="imgIcon" @click="deleteStage()"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="items2">
|
||||
@@ -98,7 +98,8 @@
|
||||
<div class="mid">
|
||||
<div class="item" v-for="(value, key) in TASK_TYPE" :key="key">
|
||||
<div v-if="key != 13">
|
||||
<component :is="value.component" :ref="el => courseRef['el' + key] = el" :type="key" :infoType="1" :id="projectInfo.projectTemplateInfo?.id"
|
||||
<component :is="value.component" :ref="el => courseRef['el' + key] = el" :type="key" :infoType="3" :id="projectInfo.projectTemplateInfo?.id"
|
||||
:chapter-list="projectInfo.stageList"
|
||||
v-model:task-list="projectInfo.stageList[activeIndex].taskTemplateList">
|
||||
<div class="itcon">
|
||||
<div class="img">
|
||||
@@ -317,8 +318,8 @@
|
||||
<div class="namebox">
|
||||
<div class="inname">阶段说明:</div>
|
||||
</div>
|
||||
<div class="intext" style="margin-left: 14px">
|
||||
<a-textarea v-model:value="formValue.remark" style="height: 88px" show-count :maxlength="100"
|
||||
<div class="intext" style="margin-left: 14px;width:384px">
|
||||
<a-textarea v-model:value="formValue.remark" style="height: 88px;width:384px" show-count :maxlength="100"
|
||||
placeholder="请输入阶段说明" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -357,7 +358,7 @@
|
||||
</a-modal>
|
||||
</div>
|
||||
<!-- 确认添加阶段弹窗 -->
|
||||
<a-modal v-model:visible="confirmModal" :footer="null" wrapClassName="ConfirmModal" centered="true">
|
||||
<a-modal v-model:visible="confirmModal" :footer="null" wrapClassName="ConfirmModal" :centered="true">
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
<div class="del_main">
|
||||
@@ -381,7 +382,7 @@
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 确认取消阶段弹窗 -->
|
||||
<a-modal v-model:visible="cancelModal" :footer="null" wrapClassName="ConfirmModal" centered="true">
|
||||
<a-modal v-model:visible="cancelModal" :footer="null" wrapClassName="ConfirmModal" :centered="true">
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
<div class="del_main">
|
||||
@@ -482,68 +483,35 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
<!-- 是否删除阶段弹窗 -->
|
||||
<a-modal v-model:visible="deleteStageModal" :footer="null" :closable="cC" wrapClassName="ConfirmModal"
|
||||
centered="true">
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
<div class="del_main">
|
||||
<div class="header">
|
||||
<div class="icon"></div>
|
||||
<span>提示</span>
|
||||
<!-- <div class="close_exit" @click="closeDeleteStage"></div> -->
|
||||
</div>
|
||||
<div class="body">
|
||||
<span style="width:320px;display:flex;justify-content:center;align-items:center;">{{
|
||||
projectInfo.stageList?.length === 1 ? "当前为最后一个阶段,删除后任务将被移出,为无阶段模式,确认删除阶段吗?" : "您确定要删除此阶段"
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="del_btnbox">
|
||||
<div class="del_btn btn2" @click="closeDeleteStage" style="margin-right: 32px;">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<div class="del_btn btn2" @click="deleteStage">
|
||||
<div class="btnText">确定</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, onUnmounted, ref, watch, } from "vue";
|
||||
import { computed, onMounted, ref, watch, } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import * as api from "../../api/indexTemplate";
|
||||
import * as api from "@/api/indexTemplate";
|
||||
import Draggable from "vuedraggable";
|
||||
import { useRoute } from "vue-router";
|
||||
import { TASK_TYPE } from "@/utils/const";
|
||||
import { request } from "@/api/request";
|
||||
import { PROJECT_TEMPLATE_DETAIL_MODIFY } from "@/api/apis";
|
||||
import dialog from "@/utils/dialog";
|
||||
|
||||
const route = useRoute();
|
||||
const courseRef = ref({})
|
||||
const visiblene = ref(false);
|
||||
const deAll = ref(false);
|
||||
const deleteModal = ref(false);
|
||||
const confirmModal = ref(false);
|
||||
const stage = ref(false);
|
||||
const ischapterEdit = ref(false);//修改阶段标志
|
||||
const cancelModal = ref(false);
|
||||
const deleteStageModal = ref(false);
|
||||
const templateLoading = ref(false);
|
||||
const cancleLoading = ref(false);
|
||||
const projectInfo = ref({
|
||||
stageList: [{
|
||||
"id": "0",
|
||||
taskTemplateList: [{
|
||||
}]
|
||||
taskTemplateList: [{}]
|
||||
}],
|
||||
projectTemplateInfo: {
|
||||
|
||||
}
|
||||
projectTemplateInfo: {}
|
||||
});
|
||||
const activeIndex = ref(0);
|
||||
const moveChapterIndex = ref(0);
|
||||
@@ -579,7 +547,7 @@ function changeStageIndex(index) {
|
||||
const getTask = async () => {
|
||||
await api.templateEditDetail(route.query.projectId).then((res) => {
|
||||
projectInfo.value = res.data.data
|
||||
if (projectInfo.value.stageList.length == 0) {
|
||||
if (projectInfo.value.stageList.length === 0) {
|
||||
projectInfo.value.stageList = [{
|
||||
"id": "0",
|
||||
taskTemplateList: []
|
||||
@@ -635,94 +603,80 @@ const closeModal = () => {
|
||||
stage.value = false
|
||||
};
|
||||
//显示添加阶段弹窗
|
||||
const showModal = (e, type) => {
|
||||
ischapterEdit.value = (type === "edit");
|
||||
console.log(ischapterEdit.value)
|
||||
if (type == 'edit') {
|
||||
console.log("阶段信息:" + e.name);
|
||||
formValue.value = e;//回传修改的信息
|
||||
} else {
|
||||
formValue.value = {};
|
||||
}
|
||||
const showModal = () => {
|
||||
formValue.value = {taskTemplateList: []}
|
||||
stage.value = true
|
||||
};
|
||||
const editModal = () => {
|
||||
formValue.value = projectInfo.value.stageList[activeIndex.value]
|
||||
formValue.value.edit = true
|
||||
stage.value = true
|
||||
};
|
||||
|
||||
//添加阶段
|
||||
function editStage() {
|
||||
if (!formValue.value.name) {
|
||||
message.warning("请输入阶段名称!");
|
||||
return
|
||||
}
|
||||
//是否修改阶段2023-02-27add
|
||||
if (ischapterEdit.value) {//修改
|
||||
projectInfo.value.stageList[activeIndex.value] = formValue.value;
|
||||
} else {//添加
|
||||
projectInfo.value.stageList.push({ ...formValue.value })
|
||||
if(formValue.value.edit){
|
||||
stage.value = false
|
||||
return
|
||||
}
|
||||
//替换 默认阶段
|
||||
if (projectInfo.value.stageList.length === 1 && projectInfo.value.stageList[0].id === '0') {
|
||||
formValue.value.taskTemplateList = [...projectInfo.value.stageList[0].taskTemplateList]
|
||||
console.log("修改后的阶段信息:" + JSON.stringify(projectInfo.value.stageList[activeIndex.value]))
|
||||
projectInfo.value.stageList.push({...formValue.value})
|
||||
projectInfo.value.stageList.splice(0, 1)
|
||||
} else {
|
||||
projectInfo.value.stageList.push({...formValue.value})
|
||||
activeIndex.value = activeIndex.value + 1
|
||||
console.log("activeIndex.value:" + activeIndex.value);
|
||||
}
|
||||
formValue.value = { taskTemplateList: [] }
|
||||
console.log(projectInfo.value.stageList);
|
||||
formValue.value = {taskTemplateList: []}
|
||||
stage.value = false
|
||||
}
|
||||
|
||||
//打开删除阶段弹窗
|
||||
const showDeleteStage = (index) => {
|
||||
deleteStageModal.value = true;
|
||||
deleteIndex.value = index;
|
||||
};
|
||||
//关闭删除阶段弹窗
|
||||
const closeDeleteStage = () => {
|
||||
deleteStageModal.value = false;
|
||||
};
|
||||
//删除阶段
|
||||
const deleteStage = () => {
|
||||
console.log("删除阶段前的数据:" + JSON.stringify(projectInfo.value));
|
||||
if (projectInfo.value.stageList.length === 1) {
|
||||
projectInfo.value.stageList = [{ id: '0', stageId: '0', name: '', remark: '', taskTemplateList: [] }];
|
||||
deleteStageModal.value = false;
|
||||
return
|
||||
}
|
||||
projectInfo.value.stageList[activeIndex.value].deleted = true;
|
||||
console.log("删除阶段后的数据:" + JSON.stringify(projectInfo.value));
|
||||
activeIndex.value = activeIndex.value - 1;
|
||||
deleteStageModal.value = false;
|
||||
dialog({
|
||||
content: projectInfo.value.stageList.length === 1 ? "当前为最后一个阶段,删除后任务将被移出,为无阶段模式,确认删除阶段吗?" : '确认删除此阶段吗?',
|
||||
ok: () => {
|
||||
message.success("删除成功");
|
||||
if (projectInfo.value.stageList[activeIndex.value].id) {
|
||||
projectInfo.value.stageList[activeIndex.value].deleted = true
|
||||
projectInfo.value.stageList[activeIndex.value].taskTemplateList?.forEach((t, i) => t.id ? (t.deleted = true) : projectInfo.value.stageList[activeIndex.value].taskTemplateList.splice(i, 1));
|
||||
} else {
|
||||
projectInfo.value.stageList.splice(activeIndex.value, 1)
|
||||
}
|
||||
activeIndex.value && (activeIndex.value = activeIndex.value - 1);
|
||||
},
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
document.getElementsByTagName("main")[0].style.background = "rgb(245, 247, 250,1)";
|
||||
document.getElementsByTagName("main")[0].style.boxShadow = "none";
|
||||
getTask();
|
||||
});
|
||||
onMounted(getTask);
|
||||
const showCancel = () => cancelModal.value = true;
|
||||
const closeCancel = () => cancelModal.value = false;
|
||||
|
||||
onUnmounted(() => {
|
||||
document.getElementsByTagName("main")[0].style.background = "#ffffff";
|
||||
document.getElementsByTagName("main")[0].style.boxShadow = "0px 1px 35px 0px rgba(118, 136, 166, 0.07)";
|
||||
});
|
||||
const closeConfirm = () => {
|
||||
confirmModal.value = false;
|
||||
};
|
||||
const showCancel = () => {
|
||||
cancelModal.value = true;
|
||||
};
|
||||
const closeCancel = () => {
|
||||
cancelModal.value = false;
|
||||
};
|
||||
const showDelete = (index) => {
|
||||
deleteModal.value = true;
|
||||
deleteIndex.value = index
|
||||
};
|
||||
const closeDelete = () => {
|
||||
deleteModal.value = false;
|
||||
};
|
||||
const closeDelete = () => deleteModal.value = false;
|
||||
|
||||
// 删除所有阶段
|
||||
const removeAllLevel = () => {
|
||||
|
||||
dialog({
|
||||
content: '确定要删除所有阶段吗?',
|
||||
ok: () => {
|
||||
message.success("删除成功");
|
||||
projectInfo.value.stageList.forEach((t, i) => {
|
||||
if (t.id) {
|
||||
t.checked = false;
|
||||
t.deleted = true;
|
||||
} else {
|
||||
projectInfo.value.stageList.splice(i, 1)
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
};
|
||||
//全选任务或全不选任务
|
||||
const selectRowAll = () => {
|
||||
|
||||
Reference in New Issue
Block a user