mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 03:16:44 +08:00
学习模式替换接口
This commit is contained in:
@@ -120,7 +120,7 @@
|
|||||||
<div class="onerow">
|
<div class="onerow">
|
||||||
<div class="taskmain">任务列表</div>
|
<div class="taskmain">任务列表</div>
|
||||||
<div class="taskmain_switch">
|
<div class="taskmain_switch">
|
||||||
<span class="taskmain_switch_text" :style="{color: projectInfo?.projectInfo?.unlockMode == 1 ? '#4ea6ff' : '#ffb64e'}">{{projectInfo?.projectInfo?.unlockMode == 1 ?'自由学习模式':'顺序学习模式'}}</span>
|
<span class="taskmain_switch_text" :style="{color: switchList ? '#4ea6ff' : '#ffb64e'}">{{switchList ?'自由学习模式':'顺序学习模式'}}</span>
|
||||||
<a-switch v-model:checked="switchList" />
|
<a-switch v-model:checked="switchList" />
|
||||||
</div>
|
</div>
|
||||||
<button class="btn" @click="showChangeModal">
|
<button class="btn" @click="showChangeModal">
|
||||||
@@ -458,13 +458,14 @@ watch(() => projectInfo.value.stageList, () => {
|
|||||||
|
|
||||||
function changeStageIndex(index) {
|
function changeStageIndex(index) {
|
||||||
activeIndex.value = index
|
activeIndex.value = index
|
||||||
|
projectInfo.value?.stageList[activeIndex.value]?.studyModel == 1 ? switchList.value = false : switchList.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取任务列表
|
//获取任务列表
|
||||||
const getTask = async () => {
|
const getTask = async () => {
|
||||||
await api.getDraftTask({projectId: route.query.projectId}).then((res) => {
|
await api.getDraftTask({projectId: route.query.projectId}).then((res) => {
|
||||||
projectInfo.value = res.data.data
|
projectInfo.value = res.data.data
|
||||||
projectInfo.value.projectInfo.unlockMode == 1 ? switchList.value = true : switchList.value = false
|
projectInfo.value?.stageList[activeIndex.value]?.studyModel == 1 ? switchList.value = false : switchList.value = true
|
||||||
console.log("获取任务列表:" + JSON.stringify(projectInfo.value) )
|
console.log("获取任务列表:" + JSON.stringify(projectInfo.value) )
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -474,8 +475,8 @@ const editTaskForType = (ele, index) => {
|
|||||||
};
|
};
|
||||||
const switchList = ref(false)
|
const switchList = ref(false)
|
||||||
watch(()=>switchList.value,(newVal)=>{
|
watch(()=>switchList.value,(newVal)=>{
|
||||||
newVal ? projectInfo.value.projectInfo.unlockMode = 1 : projectInfo.value.projectInfo.unlockMode = 2
|
newVal ? projectInfo.value.stageList[activeIndex.value].studyModel = 0 : projectInfo.value.stageList[activeIndex.value].studyModel = 1
|
||||||
editProjectModel(projectInfo.value.projectInfo)
|
request(PROJECT_DETAIL_MODIFY, projectInfo.value)
|
||||||
})
|
})
|
||||||
const showChangeModal = () => {
|
const showChangeModal = () => {
|
||||||
if (projectInfo.value?.stageList?.length <= 1) {
|
if (projectInfo.value?.stageList?.length <= 1) {
|
||||||
@@ -559,6 +560,7 @@ function editStage() {
|
|||||||
stage.value = false
|
stage.value = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
formValue.value.studyModel = 0
|
||||||
//替换 默认阶段
|
//替换 默认阶段
|
||||||
if (projectInfo.value.stageList.length === 1 && projectInfo.value.stageList[0].id === '0') {
|
if (projectInfo.value.stageList.length === 1 && projectInfo.value.stageList[0].id === '0') {
|
||||||
formValue.value.taskDraftDtoList = [...projectInfo.value.stageList[0].taskDraftDtoList]
|
formValue.value.taskDraftDtoList = [...projectInfo.value.stageList[0].taskDraftDtoList]
|
||||||
|
|||||||
Reference in New Issue
Block a user