已在列表中的判分后面加上已导入标识

master
yujialong 3 years ago
parent 861861215a
commit caa1edffd9
  1. 30
      src/views/Transaction.vue

@ -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
}) })
this.$refs.tree.setCheckedKeys([]); //
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)
}
})
}
addSuffix(treeData)
this.$refs.tree.setCheckedKeys([])
}, },
addRule() { // addRule() { //
this.changeArr.splice(0, this.changeArr.length) this.changeArr.splice(0, this.changeArr.length)

Loading…
Cancel
Save