From 27dd70096d181051200ec5febf11c99d1940f835 Mon Sep 17 00:00:00 2001 From: zouyu <2723363702@qq.com> Date: 星期三, 13 九月 2023 16:52:18 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before --- src/components/view/Technicalindex.vue | 127 ++++++++++++++++++++++++++++-------------- 1 files changed, 84 insertions(+), 43 deletions(-) diff --git a/src/components/view/Technicalindex.vue b/src/components/view/Technicalindex.vue index 03d8f56..96f7f9f 100644 --- a/src/components/view/Technicalindex.vue +++ b/src/components/view/Technicalindex.vue @@ -281,51 +281,92 @@ export default { data() { return { - search: { - type: 0, - technology: null, - }, - // handleClose:[], - checkTreeNode: { - id: '', - }, - higherlevel: [], - value: {}, - options: [], - process: [], - filterNode: [], - list: [], - form: { - father: '', - work: '', - name: '', - unit: '', - project: '', - }, - children: [], - modifyevent: false, - dialogVisible: false, - tableData: [], - typeselect: 0, - upData: {}, - upDia: false, - craftapi: [], - edit: { - techFather: '', - techName: '', - father: '', - name: '', - unit: '', - id: '' - } - } - }, - mounted() { + search:{ + type:0, + technology:null, + }, + // handleClose:[], + checkTreeNode :{ + id:'', + }, + higherlevel:[], + value:{}, + options:[], + process:[], + filterNode:[], + list: [], + form:{ + father:'', + work:'', + name:'', + unit:'', + project:'', + }, + children:[], + modifyevent:false, + dialogVisible:false, + tableData: [], + typeselect:0, + upData:{}, + upDia:false, + craftapi:[], + edit:{ + techFather:'', + techName:'', + father:'', + name:'', + unit:'', + id:'', + + }, + isAllSelect:false, + } + + }, + mounted() { this.selectAllleft() this.selectAllright() }, - methods: { - handleClose() { + methods:{ + // 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 + // 鍏ㄩ��/鍙栨秷閫夋搷浣� + selectAll(val) { + this.isAllSelect = !this.isAllSelect; + let data = this.tableData; + this.toggleSelect(data, this.isAllSelect, "all"); + }, + //閫夋嫨鏌愯 + selectTr(selection, row) { + console.log(selection,row); + this.$set(row, "isChecked", !row.isChecked); + this.$nextTick(() => { + this.isAllSelect = row.isChecked; + this.toggleSelect(row, row.isChecked, "tr"); + }); + }, + //閫掑綊瀛愮骇 + toggleSelect(data, flag, type) { + if (type === "all") { + console.log('222'); + if (data.length > 0) { + data.forEach((item) => { + this.toggleSelection(item, flag); + if (item.children && item.children.length > 0) { + this.toggleSelect(item.children, flag, type); + } + }); + } + } else { + if (data.children && data.children.length > 0) { + data.children.forEach((item) => { + item.isChecked = !item.isChecked; + this.$refs.multipleTable.toggleRowSelection(item, flag); + this.toggleSelect(item, flag, type); + }); + } + } + }, + handleClose(){ }, selectDataList() { @@ -693,4 +734,4 @@ height: 30px; border-radius: 2px; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3