|
|
@ -360,7 +360,7 @@ export default { |
|
|
|
treeData: [], // 树结构数据 |
|
|
|
treeData: [], // 树结构数据 |
|
|
|
defaultProps: { |
|
|
|
defaultProps: { |
|
|
|
children: "children", |
|
|
|
children: "children", |
|
|
|
label: "name" |
|
|
|
label: "label" |
|
|
|
}, // 树结构配置项 |
|
|
|
}, // 树结构配置项 |
|
|
|
defaultProp: { |
|
|
|
defaultProp: { |
|
|
|
children: "children", |
|
|
|
children: "children", |
|
|
@ -685,6 +685,7 @@ export default { |
|
|
|
toTreeId(data, parentId) { // id重新串连成(父+子+孙),已便达到树节点需要的key唯一性,且后面提交数据,需要传这个id串到后台 |
|
|
|
toTreeId(data, parentId) { // id重新串连成(父+子+孙),已便达到树节点需要的key唯一性,且后面提交数据,需要传这个id串到后台 |
|
|
|
let result = []; |
|
|
|
let result = []; |
|
|
|
data.forEach(item => { |
|
|
|
data.forEach(item => { |
|
|
|
|
|
|
|
item.label = item.name |
|
|
|
if (item.isNode === 0) { |
|
|
|
if (item.isNode === 0) { |
|
|
|
item.showCheckbox = false; |
|
|
|
item.showCheckbox = false; |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -812,13 +813,30 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 新增判分点 |
|
|
|
addRules(){ |
|
|
|
addRules(){ |
|
|
|
this.configVisible = true; |
|
|
|
this.configVisible = TextTrackCue |
|
|
|
let operationIds = [] |
|
|
|
const ids = [] |
|
|
|
this.tableData.map((e, i) => { |
|
|
|
const treeData = this.treeData |
|
|
|
e.operationIds && operationIds.push(e.operationIds) |
|
|
|
const list = this.tableData |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
e.operationIds && ids.push(e.operationIds) // 获取列表中已有的判分id |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// 列表中已有的判分,在新增判分树形里判分名后面加上已导入三个字 |
|
|
|
|
|
|
|
const addSuffix = data => { |
|
|
|
|
|
|
|
data.map(e => { |
|
|
|
|
|
|
|
// 如果已存在,并且名称后面没加上标识 |
|
|
|
|
|
|
|
if (ids.includes(e.operationIds) && !e.label.endsWith('(已导入)')) { |
|
|
|
|
|
|
|
e.label += '(已导入)' |
|
|
|
|
|
|
|
} else if (!ids.includes(e.operationIds) && e.label.endsWith('(已导入)')) { // 删除了的,要把标识去掉 |
|
|
|
|
|
|
|
e.label = e.label.replace('(已导入)', '') |
|
|
|
|
|
|
|
} else if (e.children && e.children.length) { // 未找到,并且有子级,则递归 |
|
|
|
|
|
|
|
addSuffix(e.children) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$refs.tree.setCheckedKeys([]); |
|
|
|
} |
|
|
|
|
|
|
|
addSuffix(treeData) |
|
|
|
|
|
|
|
this.$refs.tree.setCheckedKeys([]) |
|
|
|
}, |
|
|
|
}, |
|
|
|
addRule() { // 新增规则 |
|
|
|
addRule() { // 新增规则 |
|
|
|
this.changeArr.splice(0, this.changeArr.length) |
|
|
|
this.changeArr.splice(0, this.changeArr.length) |
|
|
|