|
@@ -24,7 +24,7 @@
|
|
|
<div class="moduleList wrap">
|
|
|
<redTipword v-if="!edit" title="检查项" :isedit="edit" />
|
|
|
<div v-for="(item, index) in data.templates" :key="item.parentTemplateId" class="item">
|
|
|
- <div v-if="item.type === 1">
|
|
|
+ <div v-if="item.type === 1" style="width: 690px">
|
|
|
<p :id="`s${item.parentTemplateId}`" class="title">
|
|
|
<el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item)">{{ item.name }}</el-checkbox>
|
|
|
<span v-else>{{ item.name }}</span>
|
|
@@ -39,7 +39,7 @@
|
|
|
@onChangeModuleName="(val, subIdx) => onChangeModuleName(val, subIdx, index)"
|
|
|
/>
|
|
|
</div>
|
|
|
- <div v-else>
|
|
|
+ <div v-else style="width: 690px">
|
|
|
<p :id="`s${item.parentTemplateId}`" class="title">
|
|
|
<el-checkbox v-if="!edit" v-model="item.isCheck" :label="item.name" @change="updateCheckItemHandle(item)">{{ item.name }}</el-checkbox>
|
|
|
<span v-else>{{ item.name }}</span>
|
|
@@ -225,7 +225,6 @@ export default {
|
|
|
* type: 是添加还是删除
|
|
|
**/
|
|
|
// const tem = this.data.templates
|
|
|
- console.log(this.data, id, subIdx, value, type)
|
|
|
this.data.templates.map(t => {
|
|
|
if (t.parentTemplateId === id) {
|
|
|
if (type === 'del') {
|
|
@@ -385,13 +384,17 @@ export default {
|
|
|
// 修改checklist绑定模版列表
|
|
|
updateSelectedTemHandle(checkedIds) {
|
|
|
const selectedBizTemplateIds = []
|
|
|
- const templates = []
|
|
|
+ const tems = []
|
|
|
+ const { templates } = this.data
|
|
|
+ // 循环都有哪些tem被选择了
|
|
|
+ console.log(templates, this.temList, checkedIds)
|
|
|
checkedIds.map(checkedId => {
|
|
|
- this.temList.map(t => {
|
|
|
- if (t.id === checkedId) {
|
|
|
- selectedBizTemplateIds.push(t.id)
|
|
|
- const { content, isCheck, name, onlineModule, type, id: parentTemplateId } = t
|
|
|
- templates.push({
|
|
|
+ // 先循环是否有存过模板数据
|
|
|
+ this.temList.map(g => {
|
|
|
+ if (g.id === checkedId) {
|
|
|
+ selectedBizTemplateIds.push(g.id)
|
|
|
+ const { content, isCheck, name, onlineModule, type, id: parentTemplateId } = g
|
|
|
+ tems.push({
|
|
|
content,
|
|
|
isCheck,
|
|
|
name,
|
|
@@ -403,7 +406,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- this.data = { ...this.data, templates, selectedBizTemplateIds }
|
|
|
+ tems.map((h, index) => templates.map(j => {
|
|
|
+ if (h.parentTemplateId === j.parentTemplateId) {
|
|
|
+ console.log(h, j)
|
|
|
+ tems[index] = { ...j }
|
|
|
+ }
|
|
|
+ }))
|
|
|
+ console.log(tems)
|
|
|
+ this.data = { ...this.data, templates: tems, selectedBizTemplateIds }
|
|
|
},
|
|
|
|
|
|
// 锚点
|