|
|
@ -353,6 +353,7 @@ |
|
|
|
import quill from "@/components/quill"; |
|
|
|
import quill from "@/components/quill"; |
|
|
|
import MyTree from "@/components/myTree/src/tree"; |
|
|
|
import MyTree from "@/components/myTree/src/tree"; |
|
|
|
import {deepCopy} from "@/utils/deepCopy"; |
|
|
|
import {deepCopy} from "@/utils/deepCopy"; |
|
|
|
|
|
|
|
import { mapState } from 'vuex' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
components: {quill, MyTree}, |
|
|
|
components: {quill, MyTree}, |
|
|
@ -401,6 +402,11 @@ export default { |
|
|
|
loading:true, |
|
|
|
loading:true, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
|
|
...mapState({ |
|
|
|
|
|
|
|
treeDataStore: state => state.treeDataStore |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.$route.query.token && this.$store.commit("setParam", { |
|
|
|
this.$route.query.token && this.$store.commit("setParam", { |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
|
token: atob(decodeURI(this.$route.query.token)) |
|
|
@ -671,15 +677,23 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
getTreeData() { // 获取树结构数据 |
|
|
|
getTreeData() { // 获取树结构数据 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.treeDataStore.length) { |
|
|
|
|
|
|
|
const tmp = [...this.treeDataStore] |
|
|
|
|
|
|
|
this.treeData = this.toTreeId(tmp, this.treeDataStore[0].parentId); |
|
|
|
|
|
|
|
if (this.$route.query.lcId) { |
|
|
|
|
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
|
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
this.$get(this.api.getLcRecord).then(res => { |
|
|
|
this.$get(this.api.getLcRecord).then(res => { |
|
|
|
if (res.status == 200 && res.list.length>0) { |
|
|
|
if (res.status == 200 && res.list.length>0) { |
|
|
|
if (res.list.length>0) { |
|
|
|
if (res.list.length>0) { |
|
|
|
|
|
|
|
this.$store.commit('setTreeDataStore', { treeDataStore: res.list}) |
|
|
|
this.treeData = this.toTreeId(res.list, res.list[0].parentId); |
|
|
|
this.treeData = this.toTreeId(res.list, res.list[0].parentId); |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
if (this.$route.query.lcId) { |
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
this.lcId = this.$route.query.lcId; |
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
this.getInfoData(this.$route.query.lcId); |
|
|
|
} else { |
|
|
|
|
|
|
|
this.loading = false |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -688,6 +702,26 @@ export default { |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
// console.log(err); |
|
|
|
// console.log(err); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// this.$get(this.api.getLcRecord).then(res => { |
|
|
|
|
|
|
|
// if (res.status == 200 && res.list.length>0) { |
|
|
|
|
|
|
|
// if (res.list.length>0) { |
|
|
|
|
|
|
|
// this.treeData = this.toTreeId(res.list, res.list[0].parentId); |
|
|
|
|
|
|
|
// if (this.$route.query.lcId) { |
|
|
|
|
|
|
|
// this.lcId = this.$route.query.lcId; |
|
|
|
|
|
|
|
// this.getInfoData(this.$route.query.lcId); |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// this.loading = false |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// this.$message.warning(res.message); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }).catch(err => { |
|
|
|
|
|
|
|
// // console.log(err); |
|
|
|
|
|
|
|
// }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
toTreeId(data, parentId) { // id重新串连成(父+子+孙),已便达到树节点需要的key唯一性,且后面提交数据,需要传这个id串到后台 |
|
|
|
toTreeId(data, parentId) { // id重新串连成(父+子+孙),已便达到树节点需要的key唯一性,且后面提交数据,需要传这个id串到后台 |
|
|
|
let result = []; |
|
|
|
let result = []; |
|
|
@ -840,7 +874,10 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
addSuffix(treeData) |
|
|
|
addSuffix(treeData) |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.tree.setCheckedKeys([]) |
|
|
|
this.$refs.tree.setCheckedKeys([]) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
addRule() { // 新增规则 |
|
|
|
addRule() { // 新增规则 |
|
|
|
this.changeArr.splice(0, this.changeArr.length) |
|
|
|
this.changeArr.splice(0, this.changeArr.length) |
|
|
|