流程类型判分规则加载慢问题解决

master
yujialong 9 months ago
parent 03ce15ee99
commit 96320065ac
  1. 7
      package-lock.json
  2. 1
      package.json
  3. 2
      src/utils/http.js
  4. 69
      src/views/Transaction.vue

7
package-lock.json generated

@ -7142,10 +7142,9 @@
}
},
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==",
"dev": true
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.defaultsdeep": {
"version": "4.6.1",

@ -13,6 +13,7 @@
"core-js": "^3.6.5",
"element-ui": "^2.14.0",
"lib-flexible": "^0.3.2",
"lodash": "^4.17.21",
"mavon-editor": "^2.10.4",
"postcss-px2rem": "^0.3.0",
"postcss-pxtorem": "^5.1.1",

@ -18,7 +18,7 @@ if(isKd){
host = 'http://124.71.12.62:9000'; // 巢湖版
} else if (dev) {
host = 'http://121.37.12.51';
// host = 'http://192.168.31.217:9000';
host = 'http://192.168.31.217:9000';
}
}

@ -488,7 +488,7 @@ import quill from "@/components/quill";
import MyTree from "@/components/myTree/src/tree";
import { deepCopy } from "@/utils/deepCopy";
import { mapState } from 'vuex'
import _ from 'lodash'
export default {
components: { quill, MyTree },
data () {
@ -554,7 +554,7 @@ export default {
SelectedObj: [],
counts: 0,
loading: true,
moneys: [100, 50, 20, 10, 5, 1, 0.5, 0.1]
moneys: [100, 50, 20, 10, 5, 1, 0.5, 0.1],
};
},
computed: {
@ -568,6 +568,7 @@ export default {
localStorage.setItem('token', atob(decodeURI(token)))
localStorage.setItem('referrer', atob(decodeURI(referrer)))
}
if (this.isSt) {
this.leftSymbols = [
{
@ -626,38 +627,25 @@ export default {
this.tableData.forEach(async (item, index) => {
item.i = index
//
//let lists = JSON.parse(JSON.stringify(this.treeData))
// let lists = this.treeData
if (item.operationIds) {
let list = JSON.parse(JSON.stringify(this.treeData))
let list = _.cloneDeep(this.treeData)
item.operationIData = []
let findOut = null
let testObj = {}
for (let i = 0; i < list.length; i++) {
const id = item.operationIds.split(',')
if (list[i].id == id[0]) {
findOut = this.filterRule(id, list, testObj)
}
}
item.operationIData.push(testObj.children[0])
}
// id,
if (item.isSubject && item.type && item.type != 4 && item.emptyOne) {
// await this.getSubjectData(item.emptyOne, index);
let result = {}
let serial = 0
this.handleRule(item.operationIds.split(','), list, result, serial)
item.operationIData.push(result.children[0])
}
});
this.setIndex()
this.$nextTick(() => {
this.loading = false
})
console.log("🚀 ~ file: Transaction.vue:646 ~ this.tableData.forEach ~ this.tableData:", this.treeData)
} else {
this.$message.warning(res.message);
this.loading = false
}
}).catch(err => {
this.loading = false
// console.log(err);
});
},
//
@ -685,11 +673,12 @@ export default {
handleSelectionChange (val) {
this.multipleSelection = val
},
filterRule (id, obj = [], needObj) {
let first = id.shift()
let tmp = obj.find(item => item.id == first)
needObj.children = obj.filter(item => item.id == first)
if (tmp) return this.filterRule(id, tmp.children, needObj.children.length ? needObj.children[0] : [])
handleRule (id, list, result, serial) {
const curId = id[serial]
const cur = list.find(e => e.id == curId)
result.children = cur ? [cur] : []
++serial
cur && cur.children && this.handleRule(id, cur.children, result.children[0], serial)
},
//1.+-
scrollToDepTree (deptCode) {
@ -721,17 +710,13 @@ export default {
this.getSubjectData(item.subjectId, index);
}
if (item.operationIds) {
let list = JSON.parse(JSON.stringify(this.treeData))
let list = _.cloneDeep(this.treeData)
item.operationIData = []
let testObj = {}
let findOut = null
for (let i = 0; i < list.length; i++) {
let id = item.operationIds.split(',')
if (list[i].id == id[0]) {
findOut = this.filterRule(id, list, testObj)
}
}
testObj.children && item.operationIData.push(testObj.children[0])
let result = {}
let serial = 0
this.handleRule(item.operationIds.split(','), list, result, serial)
result.children && item.operationIData.push(result.children[0])
}
});
this.setIndex()
@ -891,7 +876,6 @@ export default {
this.$set(this.tableData, index, item);
}
}).catch(err => {
// console.log(err);
});
}
},
@ -956,7 +940,6 @@ export default {
const name = this.isSt ? 'recordChildren' : 'children'
let result = [];
data.forEach(item => {
// console.log("🚀 ~ file: Transaction.vue:866 ~ toTreeId ~ name:", item[name])
item.label = item.name
if (item.isNode === 0) {
item.showCheckbox = false;
@ -986,9 +969,7 @@ export default {
} else {
this.isNameRepeat = true;
}
}).catch(err => {
// console.log(err);
});
}).catch(err => { });
}
},
saveAll () { //
@ -1078,9 +1059,7 @@ export default {
} else {
this.$message.warning(res.message);
}
}).catch(err => {
// console.log(err);
});
}).catch(err => { });
} else if (this.isEdit) { //
this.$post(this.api.updateJudgmentPoint, this.formData).then(res => {
if (res.status === 200) {
@ -1089,9 +1068,7 @@ export default {
} else {
this.$message.warning(res.message);
}
}).catch(err => {
// console.log(err);
});
}).catch(err => { });
}
},
//

Loading…
Cancel
Save