From bfe88ebe283522a4eb8f62b742bab61143d29ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Fri, 5 Jul 2024 16:09:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/wangEditor.js | 4 +- .../system/ManageNodeInformation/index.vue | 5 +- .../system/ManageNodeInformation/indexjs.js | 166 +++++++----- src/views/system/components/wangEditor.vue | 163 ++++++++---- src/views/system/specialDiseaseNode/index.vue | 238 ++++++++++++------ 5 files changed, 387 insertions(+), 189 deletions(-) diff --git a/src/api/system/wangEditor.js b/src/api/system/wangEditor.js index 5dd0a1e..8ffe352 100644 --- a/src/api/system/wangEditor.js +++ b/src/api/system/wangEditor.js @@ -1,9 +1,9 @@ import request from '@/utils/request' // 标签 -export function labelFieldList() { +export function labelFieldList(taskPartitionDictId) { return request({ - url: '/manage/labelfieldinfo/labelFieldList', + url: `/manage/labelfieldinfo/labelFieldList?taskPartitionDictId=${taskPartitionDictId}`, method: 'get', }) } diff --git a/src/views/system/ManageNodeInformation/index.vue b/src/views/system/ManageNodeInformation/index.vue index 00c44e1..320f202 100644 --- a/src/views/system/ManageNodeInformation/index.vue +++ b/src/views/system/ManageNodeInformation/index.vue @@ -427,8 +427,11 @@ { @@ -607,11 +613,23 @@ export default { }, //wangeditor传值 onNodeContent(item) { + console.log(item, 'items') + let wangeditorlist = [] + if (localStorage.getItem('wangeditorlist')) { + wangeditorlist = JSON.parse(localStorage.getItem('wangeditorlist')) + wangeditorlist = wangeditorlist.filter(e => e.taskSubdivision != item.taskSubdivision && e.specialDiseaseNodeId != item.specialDiseaseNodeId) + } + wangeditorlist.push(item) + // console.log(wangeditorlist, 'wangeditorlist') + localStorage.setItem('wangeditorlist', JSON.stringify(wangeditorlist)) if (item.nodeContent) { + // console.log(555) this.form.nodeContent = item.nodeContent; + console.log(this.form.nodeContent, 'this.form.nodeContentthis.form.nodeContentthis.form.nodeContent') var abc = new RegExp("
", "g"); var bbb = this.form.nodeContent.replace(abc, ""); this.form.nodeContent = bbb; + } }, //小程序传值 @@ -736,7 +754,15 @@ export default { // !e.taskStatus // ); // return + specialDiseaseNode(this.itemlist).then((res) => { + let wangeditorlist = [] + if (localStorage.getItem('wangeditorlist')) { + wangeditorlist = JSON.parse(localStorage.getItem('wangeditorlist')) + wangeditorlist = wangeditorlist.filter(e => e.specialDiseaseNodeId == this.form.specialDiseaseNodeId) + console.log(wangeditorlist,'wangeditorlist') + localStorage.setItem('wangeditorlist', JSON.stringify(wangeditorlist)) + } this.info(); loading.close(); this.$modal.msgSuccess("暂存成功!"); @@ -762,8 +788,7 @@ export default { this.formview = item.formview }, - - bottomclickevent(uitem, index, uindex) { + onemit() { if ( this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" && this.form.taskSubdivisiontemplateType != "PROPAGANDA" && @@ -771,30 +796,31 @@ export default { ) { this.$refs.wangeditor.emit(); } - setTimeout(() => { - this.form = uitem; - this.$forceUpdate() - if (this.form.templateType == "PROPAGANDA" && this.form.templateId) { - getPropaganda(this.form.templateId).then((response) => { - this.formview = response.data; - - }); - } else if (this.form.templateType == "QUESTIONNAIRE" && this.form.templateId) { - - questionname(this.form.templateId).then((res) => { - this.lookitemnew = res.data; - }); - } else if (this.form.templateType == 'SCRIPT' && this.form.flowScheme) { - this.phoneNodeContent = this.form.flowScheme - } - this.taskPartitionList = []; - if (this.form.taskType) { - this.changeTaskType(this.form.taskType, this.form.taskSubdivision); - } - this.listindex = index; - this.itemindex = uindex; - }, 300); }, + // 点击 + async bottomclickevent(uitem, index, uindex) { + await this.onemit() + this.listindex = index; + this.itemindex = uindex; + if (uitem.templateType == "PROPAGANDA" && uitem.templateId) { + getPropaganda(uitem.templateId).then((response) => { + this.formview = response.data; + }); + } else if (uitem.templateType == "QUESTIONNAIRE" && uitem.templateId) { + questionname(uitem.templateId).then((res) => { + this.lookitemnew = res.data; + }); + } else if (uitem.templateType == 'SCRIPT' && uitem.flowScheme) { + this.phoneNodeContent = uitem.flowScheme + } + this.taskPartitionList = []; + if (uitem.taskType) { + this.changeTaskType(uitem.taskType, uitem.taskSubdivision); + } + this.form = uitem; + // this.form. + }, + handleStep() { this.active = 2; }, @@ -807,6 +833,7 @@ export default { }, //任务类型 changeTaskType(code, taskSubdivision) { + this.taskPartitionDictId = '' let id = this.selectTaskTypeList?.find((e) => e.taskTypeCode == code)?.id; this.form.taskTypeName = this.selectTaskTypeList?.find( (e) => e.taskTypeCode == code @@ -825,42 +852,67 @@ export default { }, //点击任务细分 changetaskSubdivision(code, type) { - this.form.taskSubdivisionName = this.taskPartitionList?.find( - (e) => e.taskPartitionCode == code - )?.taskPartitionName; - let id = this.taskPartitionList?.find( - (e) => e.taskPartitionCode == code - )?.id; + if ( + this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" && + this.form.taskSubdivisiontemplateType != "PROPAGANDA" && + this.form.taskSubdivisiontemplateType != "SCRIPT" + ) { + this.$refs.wangeditor.emit(); + } + // console.log(code,'code') + setTimeout(() => { + this.form.taskSubdivisionName = this.taskPartitionList?.find( + (e) => e.taskPartitionCode == code + )?.taskPartitionName; + let id = this.taskPartitionList?.find( + (e) => e.taskPartitionCode == code + )?.id; + console.log(id, 'id') + taskStatusDictList(id).then((res) => { + this.taskStatusDictList = res.data; + }); + this.taskPartitionDictId = id + this.form.secondClassifyDescribe = this.taskPartitionList?.find( + (e) => e.taskPartitionCode == code + )?.secondClassifyDescribe; + this.form.executionTime = this.taskPartitionList?.find( + (e) => e.taskPartitionCode == code + )?.executionTime; + + this.taskPartitionList.forEach((el) => { + if (code == el.taskPartitionCode) { + this.form.executionTime = el.executionTime; + this.form.taskSubdivisiontemplateType = el.templateType; - this.form.secondClassifyDescribe = this.taskPartitionList?.find( - (e) => e.taskPartitionCode == code - )?.secondClassifyDescribe; - this.form.executionTime = this.taskPartitionList?.find( - (e) => e.taskPartitionCode == code - )?.executionTime; - taskStatusDictList(id).then((res) => { - this.taskStatusDictList = res.data; - }); - this.taskPartitionList.forEach((el) => { - if (code == el.taskPartitionCode) { - this.form.executionTime = el.executionTime; - this.form.taskSubdivisiontemplateType = el.templateType; - if ( - this.form.taskSubdivisiontemplateType == "SCRIPT" || - this.form.taskSubdivisiontemplateType == "PROPAGANDA" || - this.form.taskSubdivisiontemplateType == "QUESTIONNAIRE" - ) { - this.form.nodeContent = `

`; + if ( + this.form.taskSubdivisiontemplateType == "SCRIPT" || + this.form.taskSubdivisiontemplateType == "PROPAGANDA" || + this.form.taskSubdivisiontemplateType == "QUESTIONNAIRE" + ) { + this.form.nodeContent = `

`; + } + if (!type) { + this.form.templateId = ""; + this.form.templateName = ""; + } } - if (!type) { - this.form.templateId = ""; - this.form.templateName = ""; + let wangeditorlist = [] + if (localStorage.getItem('wangeditorlist')) { + wangeditorlist = JSON.parse(localStorage.getItem('wangeditorlist')) + this.form.nodeContent = '

' + this.form.nodeContent = wangeditorlist.find(e => e.taskSubdivision == this.form.taskSubdivision && e.specialDiseaseNodeId == this.form.specialDiseaseNodeId)?.nodeContent + console.log(this.form.nodeContent, 'this.form.nodeContent8858585') } - } - }); + }); + + }, 500); + + + console.log(this.form) }, // 添加管理路径节点 addlist() { + // this.taskPartitionDictId = '' list(this.parentDictCode).then((res) => { // this.parentDictCodelist = res.rows; res.rows.forEach((e) => { @@ -898,6 +950,8 @@ export default { }, // 添加节点 additem(item) { + // this.taskPartitionDictId = '' + item.list.push({ nodeContent: "

", templateId: "", diff --git a/src/views/system/components/wangEditor.vue b/src/views/system/components/wangEditor.vue index 9d57624..05b43ad 100644 --- a/src/views/system/components/wangEditor.vue +++ b/src/views/system/components/wangEditor.vue @@ -1,18 +1,42 @@