From 4c5c20a7c03539104df74072b1b8a81b51c19ab8 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期四, 14 九月 2023 10:42:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/components/view/Technicalindex.vue | 136 ++++++++++++++++++++++++++++++--------------- 1 files changed, 90 insertions(+), 46 deletions(-) diff --git a/src/components/view/Technicalindex.vue b/src/components/view/Technicalindex.vue index 03d8f56..a5016bb 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() { @@ -372,7 +413,8 @@ "Content-Type": "application/json" } }).then(res => { - this.selectAllright() + /* this.selectAllright() */ + this.$parent.removeAllTab() }) }, submitUpData() { //纭畾 @@ -385,8 +427,9 @@ this.$axios.post(this.$api.url.delTechBy, { id: this.upData.id }).then(res => { - this.selectAllright() + /* this.selectAllright() */ this.$message.success('鍒犻櫎瀹屾垚') + this.$parent.removeAllTab() }) }, deleteRow(index, rows) { @@ -400,7 +443,8 @@ this.$axios.post(this.$api.url.delAllTechskill, { ids: this.delete }).then(res => { - this.selectAllright() + /* this.selectAllright() */ + this.$parent.removeAllTab() }) }, dels() { @@ -693,4 +737,4 @@ height: 30px; border-radius: 2px; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3