This commit is contained in:
闫晓茹 2024-07-05 16:09:12 +08:00
parent e42487b600
commit bfe88ebe28
5 changed files with 387 additions and 189 deletions

View File

@ -1,9 +1,9 @@
import request from '@/utils/request' import request from '@/utils/request'
// 标签 // 标签
export function labelFieldList() { export function labelFieldList(taskPartitionDictId) {
return request({ return request({
url: '/manage/labelfieldinfo/labelFieldList', url: `/manage/labelfieldinfo/labelFieldList?taskPartitionDictId=${taskPartitionDictId}`,
method: 'get', method: 'get',
}) })
} }

View File

@ -427,8 +427,11 @@
<wangeditor <wangeditor
style="width: 100%" style="width: 100%"
:nodeContent="form.nodeContent" :nodeContent="form.nodeContent"
:taskPartitionDictId="taskPartitionDictId"
:taskSubdivision="form.taskSubdivision"
:specialDiseaseNodeId="form.specialDiseaseNodeId"
@on-nodeContent="onNodeContent" @on-nodeContent="onNodeContent"
v-if=" v-show="
form.taskSubdivisiontemplateType != 'QUESTIONNAIRE' && form.taskSubdivisiontemplateType != 'QUESTIONNAIRE' &&
form.taskSubdivisiontemplateType != 'PROPAGANDA' && form.taskSubdivisiontemplateType != 'PROPAGANDA' &&
form.taskSubdivisiontemplateType != 'SCRIPT' form.taskSubdivisiontemplateType != 'SCRIPT'

View File

@ -46,6 +46,8 @@ export default {
name: "specialDiseaseNode", name: "specialDiseaseNode",
data() { data() {
return { return {
specialDiseaseNodeId: '',
taskPartitionDictId: '',
lookNodeContent: false, lookNodeContent: false,
lookquestionname: false, lookquestionname: false,
lookquestionlist: false,//问卷 lookquestionlist: false,//问卷
@ -148,7 +150,10 @@ export default {
// this.optiononditionOperator(); // this.optiononditionOperator();
this.optiononditionOperators(); this.optiononditionOperators();
}, },
beforeDestroy() { }, beforeDestroy() {
console.log(111111111)
localStorage.removeItem('wangeditorlist')
},
watch: { watch: {
"form.phoneMessageRemind": { "form.phoneMessageRemind": {
handler(newValue, oldValue) { handler(newValue, oldValue) {
@ -376,6 +381,7 @@ export default {
"routeNodeName" "routeNodeName"
); );
this.form = this.lists[0].list[0]; this.form = this.lists[0].list[0];
// 宣教模板回显 // 宣教模板回显
if (this.form.templateType == "PROPAGANDA" && this.form.templateId) { if (this.form.templateType == "PROPAGANDA" && this.form.templateId) {
getPropaganda(this.form.templateId).then((response) => { getPropaganda(this.form.templateId).then((response) => {
@ -607,11 +613,23 @@ export default {
}, },
//wangeditor传值 //wangeditor传值
onNodeContent(item) { 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) { if (item.nodeContent) {
// console.log(555)
this.form.nodeContent = item.nodeContent; this.form.nodeContent = item.nodeContent;
console.log(this.form.nodeContent, 'this.form.nodeContentthis.form.nodeContentthis.form.nodeContent')
var abc = new RegExp("<br>", "g"); var abc = new RegExp("<br>", "g");
var bbb = this.form.nodeContent.replace(abc, ""); var bbb = this.form.nodeContent.replace(abc, "");
this.form.nodeContent = bbb; this.form.nodeContent = bbb;
} }
}, },
//小程序传值 //小程序传值
@ -736,7 +754,15 @@ export default {
// !e.taskStatus // !e.taskStatus
// ); // );
// return // return
specialDiseaseNode(this.itemlist).then((res) => { 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(); this.info();
loading.close(); loading.close();
this.$modal.msgSuccess("暂存成功!"); this.$modal.msgSuccess("暂存成功!");
@ -762,8 +788,7 @@ export default {
this.formview = item.formview this.formview = item.formview
}, },
onemit() {
bottomclickevent(uitem, index, uindex) {
if ( if (
this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" && this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" &&
this.form.taskSubdivisiontemplateType != "PROPAGANDA" && this.form.taskSubdivisiontemplateType != "PROPAGANDA" &&
@ -771,30 +796,31 @@ export default {
) { ) {
this.$refs.wangeditor.emit(); 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() { handleStep() {
this.active = 2; this.active = 2;
}, },
@ -807,6 +833,7 @@ export default {
}, },
//任务类型 //任务类型
changeTaskType(code, taskSubdivision) { changeTaskType(code, taskSubdivision) {
this.taskPartitionDictId = ''
let id = this.selectTaskTypeList?.find((e) => e.taskTypeCode == code)?.id; let id = this.selectTaskTypeList?.find((e) => e.taskTypeCode == code)?.id;
this.form.taskTypeName = this.selectTaskTypeList?.find( this.form.taskTypeName = this.selectTaskTypeList?.find(
(e) => e.taskTypeCode == code (e) => e.taskTypeCode == code
@ -825,42 +852,67 @@ export default {
}, },
//点击任务细分 //点击任务细分
changetaskSubdivision(code, type) { changetaskSubdivision(code, type) {
this.form.taskSubdivisionName = this.taskPartitionList?.find( if (
(e) => e.taskPartitionCode == code this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" &&
)?.taskPartitionName; this.form.taskSubdivisiontemplateType != "PROPAGANDA" &&
let id = this.taskPartitionList?.find( this.form.taskSubdivisiontemplateType != "SCRIPT"
(e) => e.taskPartitionCode == code ) {
)?.id; 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( if (
(e) => e.taskPartitionCode == code this.form.taskSubdivisiontemplateType == "SCRIPT" ||
)?.secondClassifyDescribe; this.form.taskSubdivisiontemplateType == "PROPAGANDA" ||
this.form.executionTime = this.taskPartitionList?.find( this.form.taskSubdivisiontemplateType == "QUESTIONNAIRE"
(e) => e.taskPartitionCode == code ) {
)?.executionTime; this.form.nodeContent = `<p></p>`;
taskStatusDictList(id).then((res) => { }
this.taskStatusDictList = res.data; if (!type) {
}); this.form.templateId = "";
this.taskPartitionList.forEach((el) => { this.form.templateName = "";
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 = `<p></p>`;
} }
if (!type) { let wangeditorlist = []
this.form.templateId = ""; if (localStorage.getItem('wangeditorlist')) {
this.form.templateName = ""; wangeditorlist = JSON.parse(localStorage.getItem('wangeditorlist'))
this.form.nodeContent = '<p></p>'
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() { addlist() {
// this.taskPartitionDictId = ''
list(this.parentDictCode).then((res) => { list(this.parentDictCode).then((res) => {
// this.parentDictCodelist = res.rows; // this.parentDictCodelist = res.rows;
res.rows.forEach((e) => { res.rows.forEach((e) => {
@ -898,6 +950,8 @@ export default {
}, },
// 添加节点 // 添加节点
additem(item) { additem(item) {
// this.taskPartitionDictId = ''
item.list.push({ item.list.push({
nodeContent: "<p></p>", nodeContent: "<p></p>",
templateId: "", templateId: "",

View File

@ -1,18 +1,42 @@
<template> <template>
<div style="border: 1px solid #ccc"> <div style="border: 1px solid #ccc">
<Toolbar style="border-bottom: 1px solid #ccc" :editor="editor" :defaultConfig="toolbarConfig" :mode="mode" /> <Toolbar
<Editor style="height: 500px; overflow-y: hidden" v-model="html" :defaultConfig="editorConfig" :mode="mode" style="border-bottom: 1px solid #ccc"
@onChange="onChange" @onCreated="onCreated" @onFocus="handleFocus" /> :editor="editor"
<el-dialog title="添加画像标签字段" :visible.sync="labelshow" width="40%" :before-close="beforeClose" :defaultConfig="toolbarConfig"
class="category-cascader-panel"> :mode="mode"
<el-cascader-panel :key="isResouceShow" :options="labeloptions" @change="panelchange" v-if="labelshow" />
ref="cascaderAddaddlist" v-model="selectedOptions" :props="{ <Editor
value: 'value', style="height: 500px; overflow-y: hidden"
label: 'label', v-model="html"
children: 'children', :defaultConfig="editorConfig"
checkStrictly: false, :mode="mode"
multiple: true, @onChange="onChange"
}"></el-cascader-panel> @onCreated="onCreated"
@onFocus="handleFocus"
/>
<el-dialog
title="添加画像标签字段"
:visible.sync="labelshow"
width="40%"
:before-close="beforeClose"
class="category-cascader-panel"
>
<el-cascader-panel
:key="isResouceShow"
:options="labeloptions"
@change="panelchange"
v-if="labelshow"
ref="cascaderAddaddlist"
v-model="selectedOptions"
:props="{
value: 'value',
label: 'label',
children: 'children',
checkStrictly: false,
multiple: true,
}"
></el-cascader-panel>
<div> <div>
<div style="margin: 20px 0">结果预览:</div> <div style="margin: 20px 0">结果预览:</div>
<div v-for="(item, index) of addlist" :key="index"> <div v-for="(item, index) of addlist" :key="index">
@ -23,15 +47,25 @@
<el-button @click="labelclick" type="primary">确定</el-button> <el-button @click="labelclick" type="primary">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="添加知识库字段" :visible.sync="fieldshow" width="50%" :before-close="beforeClose" <el-dialog
class="category-cascader-panel"> title="添加知识库字段"
<el-cascader-panel :options="fieldoptions" @change="handleChange($event)" :props="{ :visible.sync="fieldshow"
value: 'termCode', width="50%"
label: 'termContent', :before-close="beforeClose"
children: 'children', class="category-cascader-panel"
checkStrictly: false, >
multiple: true, <el-cascader-panel
}" ref="cascaderAddr"> :options="fieldoptions"
@change="handleChange($event)"
:props="{
value: 'termCode',
label: 'termContent',
children: 'children',
checkStrictly: false,
multiple: true,
}"
ref="cascaderAddr"
>
</el-cascader-panel> </el-cascader-panel>
<div style="margin: 20px 0">结果预览:</div> <div style="margin: 20px 0">结果预览:</div>
@ -70,7 +104,7 @@ import { getToken } from "@/utils/auth";
var that; var that;
export default { export default {
props: ["nodeContent"], props: ["nodeContent", "taskPartitionDictId", "taskSubdivision","specialDiseaseNodeId"],
components: { Editor, Toolbar }, components: { Editor, Toolbar },
name: "wangEditor", name: "wangEditor",
data() { data() {
@ -82,7 +116,6 @@ export default {
children: "children", children: "children",
multiple: true, multiple: true,
}, },
isResouceShow: 1, isResouceShow: 1,
searchForm: {}, searchForm: {},
labeloptions: [], labeloptions: [],
@ -182,7 +215,7 @@ export default {
return res; return res;
}, },
emit() { emit() {
this.$emit("on-nodeContent", { nodeContent: this.html }); this.$emit("on-nodeContent", { nodeContent: this.html,taskSubdivision:this.taskSubdivision,specialDiseaseNodeId:this.specialDiseaseNodeId });
}, },
panelchange(value) { panelchange(value) {
this.addlist = []; this.addlist = [];
@ -194,7 +227,7 @@ export default {
label: el.label + "-" + ele.label, label: el.label + "-" + ele.label,
fileName: el.label, fileName: el.label,
fileSpan: ele.label, fileSpan: ele.label,
fieldMark: ele.termCode fieldMark: ele.termCode,
}); });
} }
}); });
@ -210,27 +243,24 @@ export default {
this.editor.deleteBackward(); this.editor.deleteBackward();
} }
this.addlist.forEach((e) => { this.addlist.forEach((e) => {
const resume = { // JS const resume = {
type: 'attachment', // JS
link: '', type: "attachment",
link: "",
fileName: e.fileName, fileName: e.fileName,
fileSpan: e.fileSpan, fileSpan: e.fileSpan,
fieldMark: e.fieldMark, fieldMark: e.fieldMark,
children: [{ text: '' }], // void children children: [{ text: "" }], // void children
} };
this.editor.insertNode(resume); this.editor.insertNode(resume);
}); });
// this.addlist = [
// {
// fileName: "",
// // fieldMark: "",
// fileSpan: "",
// },
// ];
this.editor.focus();
++this.isResouceShow; ++this.isResouceShow;
this.selectedOptions = [] this.selectedOptions = [];
this.addlist = [] this.addlist = [];
setTimeout(() => {
this.editor.focus();
}, 30);
}, 100); }, 100);
}, },
fieldclick() { fieldclick() {
@ -284,14 +314,18 @@ export default {
// console.log("focus", editor); // console.log("focus", editor);
}, },
info() { info() {
labelFieldList("PORTRAIT_LABEL_FIELD").then((res) => { labelFieldList(this.taskPartitionDictId).then((res) => {
console.log(res, "res");
// res.data.data.forEach((e) => { // res.data.data.forEach((e) => {
// e.labelFieldContentList.forEach((el) => { // e.labelFieldContentList.forEach((el) => {
// el.labelFieldId = el.labelFieldContentId; // el.labelFieldId = el.labelFieldContentId;
// el.fieldName = el.contentName; // el.fieldName = el.contentName;
// }); // });
// }); // });
this.labeloptions = res; if(res){
this.labeloptions = res;
}
}); });
bankLevel("3").then((res) => { bankLevel("3").then((res) => {
@ -318,10 +352,28 @@ export default {
}, },
watch: { watch: {
nodeContent(newValue, oldValue) { nodeContent(newValue, oldValue) {
console.log(newValue,'newValue')
this.html = newValue; this.html = newValue;
}, },
taskSubdivision(newvalue, oldvalue) {
this.taskSubdivision = newvalue;
},
specialDiseaseNodeId(newvalue,oldvalue){
console.log(newvalue, "specialDiseaseNodeId");
this.specialDiseaseNodeId = newvalue;
},
taskPartitionDictId(newValue, oldValue) {
console.log(newValue, "taskPartitionDictId");
this.labeloptions = [];
this.taskPartitionDictId = newValue;
this.info();
},
}, },
mounted() { mounted() {
this.info();
if (this.nodeContent) { if (this.nodeContent) {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
@ -342,7 +394,6 @@ export default {
}, },
created() { created() {
that = this; that = this;
this.info();
}, },
}; };
class MyButtonMenu { class MyButtonMenu {
@ -353,6 +404,7 @@ class MyButtonMenu {
this.iconSvg = this.iconSvg =
'<svg t="1711951668796" class="icon" viewBox="0 0 1119 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4490" xmlns:xlink="http://www.w3.org/1999/xlink" width="218.5546875" height="200"><path d="M25.415082 562.922053a25.1989 25.1989 0 0 1-17.745705-43.299519L542.347456 7.392772A25.110172 25.110172 0 1 1 577.040308 43.682738L42.894601 555.9125a25.110172 25.110172 0 0 1-17.479519 7.009553z" p-id="4491"></path><path d="M1094.061411 562.922053a25.110172 25.110172 0 0 1-17.745704-7.009553L542.347456 43.682738A25.110172 25.110172 0 1 1 577.040308 7.392772l534.323165 512.229762a25.1989 25.1989 0 0 1-17.745704 43.299519zM559.738247 1023.955458a380.467906 380.467906 0 0 1-380.024264-380.112992 25.1989 25.1989 0 0 1 50.309073 0 330.070105 330.070105 0 0 0 329.715191 329.80392 25.1989 25.1989 0 1 1 0 50.309072z" p-id="4492"></path><path d="M1009.769315 799.472295H618.3878a25.1989 25.1989 0 0 1 0-50.309072h391.381515a25.1989 25.1989 0 0 1 0 50.309072z" fill="#231815" p-id="4493"></path><path d="M814.122922 996.005974a25.1989 25.1989 0 0 1-25.198901-25.198901V579.869201a25.1989 25.1989 0 1 1 50.309073 0v390.937872a25.1989 25.1989 0 0 1-25.110172 25.198901z" fill="#231815" p-id="4494"></path></svg>'; '<svg t="1711951668796" class="icon" viewBox="0 0 1119 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4490" xmlns:xlink="http://www.w3.org/1999/xlink" width="218.5546875" height="200"><path d="M25.415082 562.922053a25.1989 25.1989 0 0 1-17.745705-43.299519L542.347456 7.392772A25.110172 25.110172 0 1 1 577.040308 43.682738L42.894601 555.9125a25.110172 25.110172 0 0 1-17.479519 7.009553z" p-id="4491"></path><path d="M1094.061411 562.922053a25.110172 25.110172 0 0 1-17.745704-7.009553L542.347456 43.682738A25.110172 25.110172 0 1 1 577.040308 7.392772l534.323165 512.229762a25.1989 25.1989 0 0 1-17.745704 43.299519zM559.738247 1023.955458a380.467906 380.467906 0 0 1-380.024264-380.112992 25.1989 25.1989 0 0 1 50.309073 0 330.070105 330.070105 0 0 0 329.715191 329.80392 25.1989 25.1989 0 1 1 0 50.309072z" p-id="4492"></path><path d="M1009.769315 799.472295H618.3878a25.1989 25.1989 0 0 1 0-50.309072h391.381515a25.1989 25.1989 0 0 1 0 50.309072z" fill="#231815" p-id="4493"></path><path d="M814.122922 996.005974a25.1989 25.1989 0 0 1-25.198901-25.198901V579.869201a25.1989 25.1989 0 1 1 50.309073 0v390.937872a25.1989 25.1989 0 0 1-25.110172 25.198901z" fill="#231815" p-id="4494"></path></svg>';
this.tag = "button"; this.tag = "button";
this.showModal = true; this.showModal = true;
} }
// false // false
@ -369,7 +421,12 @@ class MyButtonMenu {
} }
// //
exec(editor, value) { exec(editor, value) {
this.vueInstance.labelshow = true; console.log(that.taskPartitionDictId, "that.taskPartitionDictId");
if (that.taskPartitionDictId) {
this.vueInstance.labelshow = true;
} else {
that.$message.error(`请先选择任务细分`);
}
} }
} }
class MyButtonMenutwo { class MyButtonMenutwo {
@ -423,7 +480,7 @@ function withAttachment(editor) {
const newEditor = editor; const newEditor = editor;
newEditor.isInline = (elem) => { newEditor.isInline = (elem) => {
const type = DomEditor.getNodeType(elem); const type = DomEditor.getNodeType(elem);
if (type === "attachment") return true; // type: attachment inline if (type === "attachment") return false; // type: attachment inline
if (type === "attachmenttwo") return true; // type: attachment inline if (type === "attachmenttwo") return true; // type: attachment inline
return isInline(elem); return isInline(elem);
}; };
@ -501,7 +558,7 @@ function renderAttachment(elem, children, editor) {
background: "#E5F5F2", background: "#E5F5F2",
padding: "5px 10px" /* 其他... */, padding: "5px 10px" /* 其他... */,
}, // style }, // style
on: { click() { } /* 其他... */ }, on: { click() {} /* 其他... */ },
}, },
// img // img
[fileSpan, iconVnode] [fileSpan, iconVnode]
@ -517,7 +574,7 @@ function renderAttachment(elem, children, editor) {
background: "#009A82", background: "#009A82",
padding: "5px 10px" /* 其他... */, padding: "5px 10px" /* 其他... */,
}, // style }, // style
on: { click() { } /* 其他... */ }, on: { click() {} /* 其他... */ },
}, },
// img // img
[fileName, nameiconVnode] [fileName, nameiconVnode]
@ -531,7 +588,7 @@ function renderAttachment(elem, children, editor) {
props: { contentEditable: false, class: "text" }, // HTML props: { contentEditable: false, class: "text" }, // HTML
style: {}, // style style: {}, // style
on: { on: {
click() { } /* 其他... */, click() {} /* 其他... */,
}, },
}, },
// //
@ -605,7 +662,7 @@ function renderAttachmenttwo(elem, children, editor) {
background: "#E5F5F2", background: "#E5F5F2",
padding: "5px 10px" /* 其他... */, padding: "5px 10px" /* 其他... */,
}, // style }, // style
on: { click() { } /* 其他... */ }, on: { click() {} /* 其他... */ },
}, },
// img // img
[fileSpan, iconVnode] [fileSpan, iconVnode]
@ -621,7 +678,7 @@ function renderAttachmenttwo(elem, children, editor) {
background: "#436AE9", background: "#436AE9",
padding: "5px 10px" /* 其他... */, padding: "5px 10px" /* 其他... */,
}, // style }, // style
on: { click() { } /* 其他... */ }, on: { click() {} /* 其他... */ },
}, },
// img // img
[fileName, nameiconVnode] [fileName, nameiconVnode]
@ -635,7 +692,7 @@ function renderAttachmenttwo(elem, children, editor) {
props: { contentEditable: false, class: "text" }, // HTML props: { contentEditable: false, class: "text" }, // HTML
style: {}, // style style: {}, // style
on: { on: {
click() { } /* 其他... */, click() {} /* 其他... */,
}, },
}, },
// //
@ -767,10 +824,8 @@ Boot.registerModule(parseHtmlConfmodule);
<style lang="scss"> <style lang="scss">
.category-cascader-panel { .category-cascader-panel {
.el-cascader-panel { .el-cascader-panel {
// background-color: red !important; // background-color: red !important;
.el-scrollbar:first-child { .el-scrollbar:first-child {
// li[aria-haspopup="true"] { // li[aria-haspopup="true"] {
.el-checkbox { .el-checkbox {
display: none !important; display: none !important;

View File

@ -243,6 +243,9 @@
<wangeditor <wangeditor
style="width: 100%" style="width: 100%"
:nodeContent="form.nodeContent" :nodeContent="form.nodeContent"
:taskPartitionDictId="taskPartitionDictId"
:taskSubdivision="form.taskSubdivision"
:specialDiseaseNodeId="form.specialDiseaseNodeId"
@on-nodeContent="onNodeContent" @on-nodeContent="onNodeContent"
v-show=" v-show="
form.taskSubdivisiontemplateType != 'QUESTIONNAIRE' && form.taskSubdivisiontemplateType != 'QUESTIONNAIRE' &&
@ -251,6 +254,7 @@
" "
ref="wangeditor" ref="wangeditor"
/> />
<div <div
class="card" class="card"
v-show="form.taskSubdivisiontemplateType != 'SCRIPT'" v-show="form.taskSubdivisiontemplateType != 'SCRIPT'"
@ -698,6 +702,8 @@ export default {
taskPartitionList: [], taskPartitionList: [],
parentDictCode: "", parentDictCode: "",
parentDictCodelist: [], parentDictCodelist: [],
taskPartitionDictId: '',
}; };
}, },
created() { created() {
@ -705,7 +711,10 @@ export default {
this.infolistword(); this.infolistword();
this.infolistMESSAGE(); this.infolistMESSAGE();
}, },
beforeDestroy() {}, beforeDestroy() {
console.log(111111111)
localStorage.removeItem('wangeditorlist')
},
watch: { watch: {
"form.phoneMessageRemind": { "form.phoneMessageRemind": {
handler(newValue, oldValue) { handler(newValue, oldValue) {
@ -846,15 +855,13 @@ export default {
getPropaganda(this.form.templateId).then((response) => { getPropaganda(this.form.templateId).then((response) => {
this.formview = response.data; this.formview = response.data;
}); });
} else if ( } else
this.form.templateType == "QUESTIONNAIRE" || if ( this.form.templateId&&this.form.templateType == "QUESTIONNAIRE" || this.form.templateType == "SCRIPT" ) {
(this.form.templateType == "SCRIPT" && this.form.templateId) //
) { questionname(this.form.templateId).then((res) => {
// this.lookitemnew = res.data;
questionname(this.form.templateId).then((res) => { });
this.lookitemnew = res.data; }
});
}
if (this.form.taskType) { if (this.form.taskType) {
this.changeTaskType(this.form.taskType, this.form.taskSubdivision); this.changeTaskType(this.form.taskType, this.form.taskSubdivision);
} }
@ -930,11 +937,25 @@ export default {
}, },
//wangeditor //wangeditor
onNodeContent(item) { onNodeContent(item) {
this.form.nodeContent = item.nodeContent; console.log(item, 'items')
// this.html += `<div>${this.add}</div>`; let wangeditorlist = []
var abc = new RegExp("<br>", "g"); if (localStorage.getItem('wangeditorlist')) {
var bbb = this.form.nodeContent.replace(abc, ""); wangeditorlist = JSON.parse(localStorage.getItem('wangeditorlist'))
this.form.nodeContent = bbb; 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("<br>", "g");
var bbb = this.form.nodeContent.replace(abc, "");
this.form.nodeContent = bbb;
}
}, },
// //
miniProgramtemplate(item) { miniProgramtemplate(item) {
@ -1025,6 +1046,13 @@ export default {
// ); // );
// return // return
specialDiseaseNode(this.updata).then((res) => { specialDiseaseNode(this.updata).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(); this.info();
loading.close(); loading.close();
this.$modal.msgSuccess("暂存成功!"); this.$modal.msgSuccess("暂存成功!");
@ -1051,43 +1079,75 @@ export default {
this.form.routeNodeDay = Number(this.lists[this.listindex].routeNodeDay); this.form.routeNodeDay = Number(this.lists[this.listindex].routeNodeDay);
this.dialogVisible = true; this.dialogVisible = true;
}, },
// // editor
bottomclickevent(uitem, index, uindex) { onemit() {
// this.phoneNodeContent = "";
// this.lookitemnew = "";
if ( if (
this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" && this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" &&
this.form.taskSubdivisiontemplateType != "PROPAGANDA" this.form.taskSubdivisiontemplateType != "PROPAGANDA" &&
this.form.taskSubdivisiontemplateType != "SCRIPT"
) { ) {
this.$refs.wangeditor.emit(); this.$refs.wangeditor.emit();
} }
setTimeout(() => {
this.form = uitem;
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;
}, 150);
}, },
//
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.
},
// bottomclickevent(uitem, index, uindex) {
// // this.phoneNodeContent = "";
// // this.lookitemnew = "";
// if (
// this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" &&
// this.form.taskSubdivisiontemplateType != "PROPAGANDA"
// ) {
// this.$refs.wangeditor.emit();
// }
// setTimeout(() => {
// this.form = uitem;
// 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;
// }, 150);
// },
handleStep() { handleStep() {
this.active = 2; this.active = 2;
}, },
@ -1100,6 +1160,8 @@ export default {
}, },
// //
changeTaskType(code, taskSubdivision) { changeTaskType(code, taskSubdivision) {
this.taskPartitionDictId = ''
let id = this.selectTaskTypeList?.find((e) => e.taskTypeCode == code)?.id; let id = this.selectTaskTypeList?.find((e) => e.taskTypeCode == code)?.id;
this.form.taskTypeName = this.selectTaskTypeList?.find( this.form.taskTypeName = this.selectTaskTypeList?.find(
(e) => e.taskTypeCode == code (e) => e.taskTypeCode == code
@ -1118,38 +1180,62 @@ export default {
}, },
// //
changetaskSubdivision(code, type) { changetaskSubdivision(code, type) {
this.form.taskSubdivisionName = this.taskPartitionList?.find( if (
(e) => e.taskPartitionCode == code this.form.taskSubdivisiontemplateType != "QUESTIONNAIRE" &&
)?.taskPartitionName; this.form.taskSubdivisiontemplateType != "PROPAGANDA" &&
let id = this.taskPartitionList?.find( this.form.taskSubdivisiontemplateType != "SCRIPT"
(e) => e.taskPartitionCode == code ) {
)?.id; this.$refs.wangeditor.emit();
this.form.secondClassifyDescribe = this.taskPartitionList?.find( }
(e) => e.taskPartitionCode == code // console.log(code,'code')
)?.secondClassifyDescribe; setTimeout(() => {
this.form.executionTime = this.taskPartitionList?.find( this.form.taskSubdivisionName = this.taskPartitionList?.find(
(e) => e.taskPartitionCode == code (e) => e.taskPartitionCode == code
)?.executionTime; )?.taskPartitionName;
taskStatusDictList(id).then((res) => { let id = this.taskPartitionList?.find(
this.taskStatusDictList = res.data; (e) => e.taskPartitionCode == code
}); )?.id;
this.taskPartitionList.forEach((el) => { console.log(id, 'id')
if (code == el.taskPartitionCode) { this.taskPartitionDictId = id
this.form.executionTime = el.executionTime; this.form.secondClassifyDescribe = this.taskPartitionList?.find(
this.form.taskSubdivisiontemplateType = el.templateType; (e) => e.taskPartitionCode == code
if ( )?.secondClassifyDescribe;
this.form.taskSubdivisiontemplateType == "SCRIPT" || this.form.executionTime = this.taskPartitionList?.find(
this.form.taskSubdivisiontemplateType == "PROPAGANDA" || (e) => e.taskPartitionCode == code
this.form.taskSubdivisiontemplateType == "QUESTIONNAIRE" )?.executionTime;
) { taskStatusDictList(id).then((res) => {
this.form.nodeContent = `<p></p>`; 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 = `<p></p>`;
}
if (!type) {
this.form.templateId = "";
this.form.templateName = "";
}
} }
if (!type) { let wangeditorlist = []
this.form.templateId = ""; if (localStorage.getItem('wangeditorlist')) {
this.form.templateName = ""; wangeditorlist = JSON.parse(localStorage.getItem('wangeditorlist'))
this.form.nodeContent = '<p></p>'
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() { addlist() {
list(this.parentDictCode).then((res) => { list(this.parentDictCode).then((res) => {