mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-19 07:46:46 +08:00
feat:合并
This commit is contained in:
@@ -220,15 +220,6 @@
|
|||||||
></span>
|
></span>
|
||||||
<router-link to="/ReadingClubManage">业务支援读书会管理</router-link>
|
<router-link to="/ReadingClubManage">业务支援读书会管理</router-link>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
<a-menu-item key="sub6-3">
|
|
||||||
<span
|
|
||||||
:class="{
|
|
||||||
circleActive: selectedKeys[0] === 'sub6-3',
|
|
||||||
circle: selectedKeys[0]!=='sub6-3',
|
|
||||||
}"
|
|
||||||
></span>
|
|
||||||
<router-link to="/AudienceManage">受众管理</router-link>
|
|
||||||
</a-menu-item>
|
|
||||||
<a-menu-item key="sub6-4">
|
<a-menu-item key="sub6-4">
|
||||||
<span
|
<span
|
||||||
:class="{
|
:class="{
|
||||||
@@ -240,6 +231,27 @@
|
|||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-sub-menu>
|
</a-sub-menu>
|
||||||
|
|
||||||
|
<a-sub-menu key="sub7">
|
||||||
|
<template #icon>
|
||||||
|
<div class="imgBox">
|
||||||
|
<img
|
||||||
|
style="width: 22px; height: 22px"
|
||||||
|
src="../assets/images/navleft/review.png"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #title>受众管理</template>
|
||||||
|
<a-menu-item key="sub7-1">
|
||||||
|
<span
|
||||||
|
:class="{
|
||||||
|
circleActive: selectedKeys[0] === 'sub6-7',
|
||||||
|
circle: selectedKeys[0]!=='sub6-7',
|
||||||
|
}"
|
||||||
|
></span>
|
||||||
|
<router-link to="/AudienceManage">受众管理</router-link>
|
||||||
|
</a-menu-item>
|
||||||
|
</a-sub-menu>
|
||||||
|
|
||||||
<a-menu-item key="sub5" v-if="checkMenu('systemManage')">
|
<a-menu-item key="sub5" v-if="checkMenu('systemManage')">
|
||||||
<div class="imgBox">
|
<div class="imgBox">
|
||||||
<img style="width: 16px; height: 16px" src="../assets/images/navleft/system.png"/>
|
<img style="width: 16px; height: 16px" src="../assets/images/navleft/system.png"/>
|
||||||
|
|||||||
@@ -2,47 +2,68 @@
|
|||||||
<div @click="openDrawer">
|
<div @click="openDrawer">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<a-drawer :visible="visible" class="drawerStyle addevalDrawer" width="800" title="添加测评" placement="right">
|
<a-drawer
|
||||||
|
:visible="visible"
|
||||||
|
class="drawerStyle addevalDrawer"
|
||||||
|
width="800"
|
||||||
|
title="添加测评"
|
||||||
|
placement="right"
|
||||||
|
>
|
||||||
<div class="drawerMain">
|
<div class="drawerMain">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}测评</div>
|
<div class="headerTitle">
|
||||||
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
|
{{ taskIndex >= 0 ? "编辑" : "添加" }}测评
|
||||||
@click="closeDrawer"/>
|
</div>
|
||||||
|
<img
|
||||||
|
style="width: 29px; height: 29px; cursor: pointer"
|
||||||
|
src="../../assets/images/basicinfo/close.png"
|
||||||
|
@click="closeDrawer"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentMain">
|
<div class="contentMain">
|
||||||
<div class="main_left">
|
<div class="main_left">
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
<div class="sign">
|
<div class="sign">
|
||||||
<img src="@/assets/images/coursewareManage/asterisk.png" alt=""/>
|
<img
|
||||||
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span style="margin-right: 3px">测评名称:</span>
|
<span style="margin-right: 3px">测评名称:</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<a-input v-model:value="formData.evaluationName" style="width: 400px; height: 40px; border-radius: 8px;"
|
<a-input
|
||||||
|
v-model:value="formData.evaluationName"
|
||||||
|
style="width: 400px; height: 40px; border-radius: 8px"
|
||||||
placeholder="请输入测评名称"
|
placeholder="请输入测评名称"
|
||||||
show-count
|
show-count
|
||||||
:maxlength="20"/>
|
:maxlength="20"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main_item">
|
<div class="main_item">
|
||||||
<div class="signbox">
|
<div class="signbox">
|
||||||
<div class="sign">
|
<div class="sign">
|
||||||
<img src="@/assets/images/coursewareManage/asterisk.png" alt=""/>
|
<img
|
||||||
|
src="@/assets/images/coursewareManage/asterisk.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span style="margin-right: 3px">选择测评:</span>
|
<span style="margin-right: 3px">选择测评:</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="btnbox">
|
<div class="btnbox">
|
||||||
<EvList v-model:evaluationTypeName="formData.evaluationTypeName" v-model:evaluationTypeId="formData.evaluationTypeId">
|
<EvList
|
||||||
<button class="checkEval">
|
v-model:evaluationTypeName="formData.evaluationTypeName"
|
||||||
选择测评
|
v-model:evaluationTypeId="formData.evaluationTypeId"
|
||||||
</button>
|
|
||||||
</EvList>
|
|
||||||
<div v-if="formData.evaluationTypeName" style="margin-left:20px">
|
|
||||||
<a-tag closable @close="delTag" color="processing">
|
|
||||||
<span style="font-size: 14px; line-height: 33px"
|
|
||||||
>{{ formData.evaluationTypeName }}</span
|
|
||||||
>
|
>
|
||||||
|
<button class="checkEval">选择测评</button>
|
||||||
|
</EvList>
|
||||||
|
<div v-if="formData.evaluationTypeName" style="margin-left: 20px">
|
||||||
|
<a-tag closable @close="delTag" color="processing">
|
||||||
|
<span style="font-size: 14px; line-height: 33px">{{
|
||||||
|
formData.evaluationTypeName
|
||||||
|
}}</span>
|
||||||
</a-tag>
|
</a-tag>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,11 +77,13 @@
|
|||||||
:show-time="{ format: 'HH:mm' }"
|
:show-time="{ format: 'HH:mm' }"
|
||||||
:disabled-date="disabledDate"
|
:disabled-date="disabledDate"
|
||||||
:disabled-time="disabledRangeTime"
|
:disabled-time="disabledRangeTime"
|
||||||
style="width: 400px; height: 40px; border-radius: 8px;" v-model:value="dateTime"
|
style="width: 400px; height: 40px; border-radius: 8px"
|
||||||
|
v-model:value="dateTime"
|
||||||
format="YYYY-MM-DD HH:mm"
|
format="YYYY-MM-DD HH:mm"
|
||||||
valueFormat="YYYY-MM-DD HH:mm"
|
valueFormat="YYYY-MM-DD HH:mm"
|
||||||
@change="timeChange"
|
@change="timeChange"
|
||||||
:placeholder="[' 开始时间', ' 结束时间']"/>
|
:placeholder="[' 开始时间', ' 结束时间']"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="main_item2">
|
<div class="main_item2">
|
||||||
@@ -68,10 +91,15 @@
|
|||||||
<span style="margin-right: 3px">测评说明:</span>
|
<span style="margin-right: 3px">测评说明:</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="textarea">
|
<div class="textarea">
|
||||||
<a-textarea show-count :maxlength="200" v-model:value="formData.evaluationExplain"
|
<a-textarea
|
||||||
|
show-count
|
||||||
|
:maxlength="200"
|
||||||
|
v-model:value="formData.evaluationExplain"
|
||||||
placeholder="请输入测评说明"
|
placeholder="请输入测评说明"
|
||||||
style="width:400px;" allowClear :rows="6"/>
|
style="width: 400px"
|
||||||
|
allowClear
|
||||||
|
:rows="6"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -84,55 +112,55 @@
|
|||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {defineEmits, defineProps, ref} from "vue";
|
import { defineEmits, defineProps, ref } from "vue";
|
||||||
import EvList from "./EvList.vue";
|
import EvList from "./EvList.vue";
|
||||||
import {Form, message} from "ant-design-vue";
|
import { Form, message } from "ant-design-vue";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: Number,
|
type: Number,
|
||||||
taskList: []
|
taskList: [],
|
||||||
})
|
});
|
||||||
const visible = ref(false)
|
const visible = ref(false);
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
evaluationName: '',
|
evaluationName: "",
|
||||||
evaluationTypeId: '',
|
evaluationTypeId: "",
|
||||||
evaluationTypeName: '',
|
evaluationTypeName: "",
|
||||||
evaluationExplain: '',
|
evaluationExplain: "",
|
||||||
evaluationStartTime: '',
|
evaluationStartTime: "",
|
||||||
evaluationEndTime: '',
|
evaluationEndTime: "",
|
||||||
})
|
});
|
||||||
const emit = defineEmits({})
|
const emit = defineEmits({});
|
||||||
const taskIndex = ref(-1);
|
const taskIndex = ref(-1);
|
||||||
const dateTime = ref([]);
|
const dateTime = ref([]);
|
||||||
const rulesRef = ref({
|
const rulesRef = ref({
|
||||||
evaluationName: [
|
evaluationName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入测评名称',
|
message: "请输入测评名称",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
evaluationTypeId: [
|
evaluationTypeId: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择测评',
|
message: "请选择测评",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
evaluationTypeName: [
|
evaluationTypeName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择测评',
|
message: "请选择测评",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const {resetFields, validate} = Form.useForm(formData, rulesRef);
|
const { resetFields, validate } = Form.useForm(formData, rulesRef);
|
||||||
|
|
||||||
const closeDrawer = () => {
|
const closeDrawer = () => {
|
||||||
visible.value = false
|
visible.value = false;
|
||||||
taskIndex.value = -1
|
taskIndex.value = -1;
|
||||||
dateTime.value = []
|
dateTime.value = [];
|
||||||
resetFields()
|
resetFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
const range = (start, end) => {
|
const range = (start, end) => {
|
||||||
@@ -144,12 +172,12 @@ const range = (start, end) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function timeChange(time, timeStr) {
|
function timeChange(time, timeStr) {
|
||||||
formData.value.evaluationStartTime = timeStr[0]
|
formData.value.evaluationStartTime = timeStr[0];
|
||||||
formData.value.evaluationEndTime = timeStr[1]
|
formData.value.evaluationEndTime = timeStr[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
const disabledDate = (current) => {
|
const disabledDate = (current) => {
|
||||||
return current && current < dayjs().startOf('day');
|
return current && current < dayjs().startOf("day");
|
||||||
};
|
};
|
||||||
|
|
||||||
const disabledRangeTime = () => ({
|
const disabledRangeTime = () => ({
|
||||||
@@ -159,38 +187,51 @@ const disabledRangeTime = () => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function delTag() {
|
function delTag() {
|
||||||
formData.value.evaluationTypeId = ''
|
formData.value.evaluationTypeId = "";
|
||||||
formData.value.evaluationTypeName = ''
|
formData.value.evaluationTypeName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function confirm() {
|
async function confirm() {
|
||||||
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 (taskIndex.value === -1) {
|
if (taskIndex.value === -1) {
|
||||||
const list = props.taskList
|
const list = props.taskList;
|
||||||
list.push({name: formData.value.evaluationName,duration:dayjs(formData.value.evaluationEndTime).diff(formData.value.evaluationStartTime,'minutes'), type: props.type, info: {...formData.value}})
|
list.push({
|
||||||
|
name: formData.value.evaluationName,
|
||||||
|
duration: dayjs(formData.value.evaluationEndTime).diff(
|
||||||
|
formData.value.evaluationStartTime,
|
||||||
|
"minutes"
|
||||||
|
),
|
||||||
|
type: props.type,
|
||||||
|
info: { ...formData.value },
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
const data = props.taskList[taskIndex.value]
|
const data = props.taskList[taskIndex.value];
|
||||||
data.name = formData.value.evaluationName
|
data.name = formData.value.evaluationName;
|
||||||
data.info = formData.value
|
data.info = formData.value;
|
||||||
data.duration = dayjs(formData.value.evaluationEndTime).diff(formData.value.evaluationStartTime,'minutes')
|
data.duration = dayjs(formData.value.evaluationEndTime).diff(
|
||||||
|
formData.value.evaluationStartTime,
|
||||||
|
"minutes"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
emit('update:taskList', [...props.taskList])
|
emit("update:taskList", [...props.taskList]);
|
||||||
closeDrawer()
|
closeDrawer();
|
||||||
}
|
}
|
||||||
|
|
||||||
function openDrawer(i, row) {
|
function openDrawer(i, row) {
|
||||||
row && (formData.value = {...row.info});
|
row && (formData.value = { ...row.info });
|
||||||
row && (dateTime.value = [dayjs(row.info.evaluationStartTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.evaluationEndTime, "YYYY-MM-DD HH:mm")]);
|
row &&
|
||||||
(i >= 0) && (taskIndex.value = i)
|
(dateTime.value = [
|
||||||
visible.value = true
|
dayjs(row.info.evaluationStartTime, "YYYY-MM-DD HH:mm"),
|
||||||
|
dayjs(row.info.evaluationEndTime, "YYYY-MM-DD HH:mm"),
|
||||||
|
]);
|
||||||
|
i >= 0 && (taskIndex.value = i);
|
||||||
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({openDrawer})
|
defineExpose({ openDrawer });
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.ant-table-striped :deep(.table-striped) td {
|
.ant-table-striped :deep(.table-striped) td {
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
<span
|
<span
|
||||||
style="border: 1px solid rgba(0, 0, 0, 0.25);width: 120px;height: 38px; border-radius: 10px;text-align: center;line-height: 38px;">
|
style="border: 1px solid rgba(0, 0, 0, 0.25);width: 120px;height: 38px; border-radius: 10px;text-align: center;line-height: 38px;">
|
||||||
{{
|
{{
|
||||||
routerInfo.routerInfo.unlockMode == 1 ? '自由学习模式' : routerInfo.routerInfo.unlockMode == 2 || routerInfo.routerInfo.unlockMode == 3 ? '闯关模式' : ''
|
routerInfo.routerInfo.unlockMode == 1 ? "自由学习模式" : routerInfo.routerInfo.unlockMode == 2 || routerInfo.routerInfo.unlockMode == 3 ? "闯关模式" : ""
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
<unlock-mode :routerInfo="routerInfo.routerInfo" :types="types">
|
<unlock-mode :routerInfo="routerInfo.routerInfo" :types="types">
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
left: -25px;"></div>
|
left: -25px;"></div>
|
||||||
<a-checkbox :id="element.id" v-model:checked="element.checked"></a-checkbox>
|
<a-checkbox :id="element.id" v-model:checked="element.checked"></a-checkbox>
|
||||||
<div style="margin-top: 2px; margin-left: 8px">
|
<div style="margin-top: 2px; margin-left: 8px">
|
||||||
{{ TASK_TYPE[element.type]?.name || '' }}
|
{{ TASK_TYPE[element.type]?.name || "" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -374,48 +374,47 @@ import {ROUTER_DETAIL_MODIFY} from "@/api/apis";
|
|||||||
import {request} from "@/api/request";
|
import {request} from "@/api/request";
|
||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
|
|
||||||
const {query: {routerId}} = useRoute();
|
const { query: { routerId } } = useRoute();
|
||||||
const modal = ref(false)
|
const modal = ref(false);
|
||||||
const ischapterEdit = ref(false)
|
const ischapterEdit = ref(false);
|
||||||
const visiblene = ref(false)
|
const visiblene = ref(false);
|
||||||
const cancleLoading = ref(false)
|
const cancleLoading = ref(false);
|
||||||
const confirmLoading = ref(false)
|
const confirmLoading = ref(false);
|
||||||
const moveChapterIndex = ref('')
|
const moveChapterIndex = ref("");
|
||||||
const activeIndex = ref(0)
|
const activeIndex = ref(0);
|
||||||
const types = 1 // 1 路径图 2 项目
|
const types = 1; // 1 路径图 2 项目
|
||||||
|
|
||||||
const courseRef = ref({})
|
|
||||||
const formValue = ref({draftTaskList: []})
|
|
||||||
const routerInfo = ref({chapterList: [{name: '关卡一', draftTaskList: []}], routerInfo: {}})
|
|
||||||
|
|
||||||
|
const courseRef = ref({});
|
||||||
|
const formValue = ref({ draftTaskList: [] });
|
||||||
|
const routerInfo = ref({ chapterList: [{ name: "关卡一", draftTaskList: [] }], routerInfo: {} });
|
||||||
|
|
||||||
const selectAll = computed(() => {
|
const selectAll = computed(() => {
|
||||||
const selectedNum = routerInfo.value.chapterList[activeIndex.value].draftTaskList.filter(t => t.checked).length
|
const selectedNum = routerInfo.value.chapterList[activeIndex.value].draftTaskList.filter(t => t.checked).length;
|
||||||
if (!selectedNum) {
|
if (!selectedNum) {
|
||||||
return 0
|
return 0;
|
||||||
}
|
}
|
||||||
if (selectedNum === routerInfo.value.chapterList[activeIndex.value].draftTaskList.length) {
|
if (selectedNum === routerInfo.value.chapterList[activeIndex.value].draftTaskList.length) {
|
||||||
return 1
|
return 1;
|
||||||
}
|
}
|
||||||
return 2
|
return 2;
|
||||||
})
|
});
|
||||||
|
|
||||||
watch(() => routerInfo.value.chapterList, () => {
|
watch(() => routerInfo.value.chapterList, () => {
|
||||||
routerInfo.value.chapterList.forEach((t, i) => {
|
routerInfo.value.chapterList.forEach((t, i) => {
|
||||||
t.sort = i;
|
t.sort = i;
|
||||||
t.draftTaskList?.forEach((s, j) => {
|
t.draftTaskList?.forEach((s, j) => {
|
||||||
s.sort = j
|
s.sort = j;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}, {deep: true})
|
}, { deep: true });
|
||||||
|
|
||||||
const showModal = (e,type) => {
|
const showModal = (e, type) => {
|
||||||
ischapterEdit.value = (type === "edit");
|
ischapterEdit.value = (type === "edit");
|
||||||
console.log(ischapterEdit.value)
|
console.log(ischapterEdit.value);
|
||||||
if(type == 'edit'){
|
if (type == "edit") {
|
||||||
console.log("关卡信息:" + e.name);
|
console.log("关卡信息:" + e.name);
|
||||||
formValue.value = e;//回传修改的信息
|
formValue.value = e;//回传修改的信息
|
||||||
}else{
|
} else {
|
||||||
//关卡信息初始化
|
//关卡信息初始化
|
||||||
formValue.value = {};
|
formValue.value = {};
|
||||||
}
|
}
|
||||||
@@ -430,26 +429,30 @@ const editChapter = () => {
|
|||||||
if (!formValue.value.name) {
|
if (!formValue.value.name) {
|
||||||
return message.warning("请输入关卡名称");
|
return message.warning("请输入关卡名称");
|
||||||
}
|
}
|
||||||
if(ischapterEdit.value){
|
if (ischapterEdit.value) {
|
||||||
routerInfo.value.chapterList = [{...formValue.value, draftTaskList: []}];
|
routerInfo.value.chapterList = [{ ...formValue.value, draftTaskList: [] }];
|
||||||
|
} else {
|
||||||
|
routerInfo.value.chapterList.push({ ...formValue.value, draftTaskList: [] });
|
||||||
}
|
}
|
||||||
else{
|
formValue.value = { draftTaskList: [] };
|
||||||
routerInfo.value.chapterList.push({...formValue.value, draftTaskList: []})
|
closeModal();
|
||||||
}
|
|
||||||
formValue.value = {draftTaskList: []}
|
|
||||||
closeModal()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//删除关卡
|
//删除关卡
|
||||||
const deleteChapter = () => {
|
const deleteChapter = () => {
|
||||||
dialog({
|
dialog({
|
||||||
content: '确定要删除关卡吗?',
|
content: "确定要删除关卡吗?",
|
||||||
ok: () => {
|
ok: () => {
|
||||||
if (routerInfo.value.chapterList.length === 1) {
|
if (routerInfo.value.chapterList.length === 1) {
|
||||||
message.warning("至少保留一个关卡");
|
message.warning("至少保留一个关卡");
|
||||||
return
|
return;
|
||||||
|
}
|
||||||
|
if (routerInfo.value.chapterList[activeIndex.value].id) {
|
||||||
|
routerInfo.value.chapterList[activeIndex.value].deleted = true;
|
||||||
|
routerInfo.value.chapterList[activeIndex.value].draftTaskList?.forEach((t, i) => t.id ? (t.deleted = true) : routerInfo.value.chapterList[activeIndex.value].draftTaskList.splice(i, 1));
|
||||||
|
} else {
|
||||||
|
routerInfo.value.chapterList.splice(activeIndex.value, 1);
|
||||||
}
|
}
|
||||||
routerInfo.value.chapterList[activeIndex.value].id ? (routerInfo.value.chapterList[activeIndex.value].deleted = true) : routerInfo.value.chapterList.splice(activeIndex.value, 1);
|
|
||||||
activeIndex.value && (activeIndex.value = activeIndex.value - 1);
|
activeIndex.value && (activeIndex.value = activeIndex.value - 1);
|
||||||
message.info("删除关卡成功");
|
message.info("删除关卡成功");
|
||||||
},
|
},
|
||||||
@@ -458,8 +461,8 @@ const deleteChapter = () => {
|
|||||||
|
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
await GetRouterDraftDetail(routerId).then((res) => {
|
await GetRouterDraftDetail(routerId).then((res) => {
|
||||||
routerInfo.value = res.data.data
|
routerInfo.value = res.data.data;
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
@@ -467,19 +470,19 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const changebgc = (index) => {
|
const changebgc = (index) => {
|
||||||
activeIndex.value = index
|
activeIndex.value = index;
|
||||||
};
|
};
|
||||||
|
|
||||||
const subdeleteAll = () => {
|
const subdeleteAll = () => {
|
||||||
if (!routerInfo.value?.chapterList[activeIndex.value]?.draftTaskList?.filter(t => t.checked)?.length) {
|
if (!routerInfo.value?.chapterList[activeIndex.value]?.draftTaskList?.filter(t => t.checked)?.length) {
|
||||||
message.warning("请选择要删除的任务!");
|
message.warning("请选择要删除的任务!");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
dialog({
|
dialog({
|
||||||
content: '确定要删除所选任务吗?',
|
content: "确定要删除所选任务吗?",
|
||||||
ok: () => {
|
ok: () => {
|
||||||
for (let i = 0; i < routerInfo.value.chapterList[activeIndex.value].draftTaskList.length; i++) {
|
for (let i = 0; i < routerInfo.value.chapterList[activeIndex.value].draftTaskList.length; i++) {
|
||||||
const t = routerInfo.value.chapterList[activeIndex.value].draftTaskList[i]
|
const t = routerInfo.value.chapterList[activeIndex.value].draftTaskList[i];
|
||||||
if (t.checked) {
|
if (t.checked) {
|
||||||
if (t.id) {
|
if (t.id) {
|
||||||
t.checked = false;
|
t.checked = false;
|
||||||
@@ -497,10 +500,10 @@ const subdeleteAll = () => {
|
|||||||
//全选任务或全不选任务
|
//全选任务或全不选任务
|
||||||
const selectRowAll = () => {
|
const selectRowAll = () => {
|
||||||
if (selectAll.value === 1) {
|
if (selectAll.value === 1) {
|
||||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList.forEach(t => t.checked = false)
|
routerInfo.value.chapterList[activeIndex.value].draftTaskList.forEach(t => t.checked = false);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList.forEach(t => t.checked = true)
|
routerInfo.value.chapterList[activeIndex.value].draftTaskList.forEach(t => t.checked = true);
|
||||||
};
|
};
|
||||||
//移动任务到关卡
|
//移动任务到关卡
|
||||||
const moveTask = () => {
|
const moveTask = () => {
|
||||||
@@ -513,15 +516,15 @@ const moveTask = () => {
|
|||||||
};
|
};
|
||||||
//编辑的按钮
|
//编辑的按钮
|
||||||
const editTaskForType = (ele, index) => {
|
const editTaskForType = (ele, index) => {
|
||||||
courseRef.value['el' + ele.type].openDrawer(index, ele)
|
courseRef.value["el" + ele.type].openDrawer(index, ele);
|
||||||
};
|
};
|
||||||
|
|
||||||
function deleteTask(element, index) {
|
function deleteTask(element, index) {
|
||||||
dialog({
|
dialog({
|
||||||
content: '确定要删除此任务吗?',
|
content: "确定要删除此任务吗?",
|
||||||
ok: () => {
|
ok: () => {
|
||||||
message.success("删除成功");
|
message.success("删除成功");
|
||||||
routerInfo.value.chapterList[activeIndex.value].draftTaskList[index].id ? (element.deleted = true) : routerInfo.value.chapterList[activeIndex.value].draftTaskList.splice(index, 1)
|
routerInfo.value.chapterList[activeIndex.value].draftTaskList[index].id ? (element.deleted = true) : routerInfo.value.chapterList[activeIndex.value].draftTaskList.splice(index, 1);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -529,51 +532,51 @@ function deleteTask(element, index) {
|
|||||||
const showChangeModal = () => {
|
const showChangeModal = () => {
|
||||||
if (routerInfo.value?.chapterList?.length <= 1) {
|
if (routerInfo.value?.chapterList?.length <= 1) {
|
||||||
message.warning("请添加关卡!");
|
message.warning("请添加关卡!");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (!routerInfo.value?.chapterList[activeIndex.value]?.draftTaskList?.filter(t => t.checked)?.length) {
|
if (!routerInfo.value?.chapterList[activeIndex.value]?.draftTaskList?.filter(t => t.checked)?.length) {
|
||||||
message.warning("请选择要移动的任务!");
|
message.warning("请选择要移动的任务!");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
visiblene.value = true
|
visiblene.value = true;
|
||||||
};
|
};
|
||||||
const closeChangeModal = () => {
|
const closeChangeModal = () => {
|
||||||
visiblene.value = false
|
visiblene.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
//暂存
|
//暂存
|
||||||
const temporaryStorage = async () => {
|
const temporaryStorage = async () => {
|
||||||
confirmLoading.value = true
|
confirmLoading.value = true;
|
||||||
await request(ROUTER_DETAIL_MODIFY, routerInfo.value)
|
await request(ROUTER_DETAIL_MODIFY, routerInfo.value);
|
||||||
await getDetail()
|
await getDetail();
|
||||||
message.success("暂存成功");
|
message.success("暂存成功");
|
||||||
confirmLoading.value = false
|
confirmLoading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const submitStorage = async () => {
|
const submitStorage = async () => {
|
||||||
if (routerInfo.value.routerInfo.status === 1) {
|
if (routerInfo.value.routerInfo.status === 1) {
|
||||||
dialog({
|
dialog({
|
||||||
content: '该路径图已经发布,修改后如未点击暂存当前操作未保存数据将丢失,确认保存?',
|
content: "该路径图已经发布,修改后如未点击暂存当前操作未保存数据将丢失,确认保存?",
|
||||||
ok: async () => {
|
ok: async () => {
|
||||||
confirmLoading.value = true
|
confirmLoading.value = true;
|
||||||
await releaseRouter(routerId)
|
await releaseRouter(routerId);
|
||||||
message.success("关卡和任务数据已保存");
|
message.success("关卡和任务数据已保存");
|
||||||
confirmLoading.value = false
|
confirmLoading.value = false;
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
confirmLoading.value = true
|
confirmLoading.value = true;
|
||||||
await request(ROUTER_DETAIL_MODIFY, routerInfo.value)
|
await request(ROUTER_DETAIL_MODIFY, routerInfo.value);
|
||||||
message.success("关卡和任务数据已保存")
|
message.success("关卡和任务数据已保存");
|
||||||
confirmLoading.value = false
|
confirmLoading.value = false;
|
||||||
};
|
};
|
||||||
//取消
|
//取消
|
||||||
const cancelStorage = async () => {
|
const cancelStorage = async () => {
|
||||||
cancleLoading.value = true
|
cancleLoading.value = true;
|
||||||
await getDetail()
|
await getDetail();
|
||||||
message.success("取消成功");
|
message.success("取消成功");
|
||||||
cancleLoading.value = false
|
cancleLoading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -541,7 +541,12 @@ const deleteStage = () => {
|
|||||||
content: projectInfo.value.stageList.length === 1 ? "当前为最后一个阶段,删除后任务将被移出,为无阶段模式,确认删除阶段吗?" : '确认删除此阶段吗?',
|
content: projectInfo.value.stageList.length === 1 ? "当前为最后一个阶段,删除后任务将被移出,为无阶段模式,确认删除阶段吗?" : '确认删除此阶段吗?',
|
||||||
ok: () => {
|
ok: () => {
|
||||||
message.success("删除成功");
|
message.success("删除成功");
|
||||||
projectInfo.value.stageList[activeIndex.value].id ? (projectInfo.value.stageList[activeIndex.value].deleted = true) : projectInfo.value.stageList.splice(activeIndex.value, 1)
|
if (projectInfo.value.stageList[activeIndex.value].id) {
|
||||||
|
projectInfo.value.stageList[activeIndex.value].deleted = true
|
||||||
|
projectInfo.value.stageList[activeIndex.value].taskDraftDtoList?.forEach((t, i) => t.id ? (t.deleted = true) : projectInfo.value.stageList[activeIndex.value].taskDraftDtoList.splice(i, 1));
|
||||||
|
} else {
|
||||||
|
projectInfo.value.stageList.splice(activeIndex.value, 1)
|
||||||
|
}
|
||||||
activeIndex.value && (activeIndex.value = activeIndex.value - 1);
|
activeIndex.value && (activeIndex.value = activeIndex.value - 1);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3925,6 +3925,7 @@ export default {
|
|||||||
};
|
};
|
||||||
//创建小组
|
//创建小组
|
||||||
const createGroup = async () => {
|
const createGroup = async () => {
|
||||||
|
debugger
|
||||||
console.log("state.groupPageList" + state.groupPageList);
|
console.log("state.groupPageList" + state.groupPageList);
|
||||||
const id = state.groupInfo.id;
|
const id = state.groupInfo.id;
|
||||||
const d = state.groupPageList
|
const d = state.groupPageList
|
||||||
|
|||||||
Reference in New Issue
Block a user