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

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

@ -360,7 +360,7 @@ export default {
treeData: [], //
defaultProps: {
children: "children",
label: "name"
label: "label"
}, //
defaultProp: {
children: "children",
@ -685,6 +685,7 @@ export default {
toTreeId(data, parentId) { // id++,便key,id
let result = [];
data.forEach(item => {
item.label = item.name
if (item.isNode === 0) {
item.showCheckbox = false;
} else {
@ -812,13 +813,30 @@ export default {
});
}
},
//
addRules(){
this.configVisible = true;
let operationIds = []
this.tableData.map((e, i) => {
e.operationIds && operationIds.push(e.operationIds)
this.configVisible = TextTrackCue
const ids = []
const treeData = this.treeData
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() { //
this.changeArr.splice(0, this.changeArr.length)

Loading…
Cancel
Save