From 0847c5e398603ac92065056a40799f713313c076 Mon Sep 17 00:00:00 2001 From: mch <1332099529@qq.com> Date: Thu, 29 Jun 2023 16:21:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitGrouping/unitGroupCategory.vue | 95 ++++++-- .../unitGrouping/unitGroupingTable.vue | 216 +++++++++++++++--- 2 files changed, 255 insertions(+), 56 deletions(-) diff --git a/src/components/unitGrouping/unitGroupCategory.vue b/src/components/unitGrouping/unitGroupCategory.vue index fbc77ae..0a2d5d4 100644 --- a/src/components/unitGrouping/unitGroupCategory.vue +++ b/src/components/unitGrouping/unitGroupCategory.vue @@ -2,7 +2,12 @@
项目类别 - +
- - - + + +
-
- 全添加 -
添加
- 移去
-
- 全移去 -
- - - - - + + + + +
@@ -102,7 +110,7 @@ - + 取 消 @@ -119,17 +127,58 @@ import { getapi } from "@/api/api"; export default { data() { return { + selecteddata: [], //已选数据 + unselecteddata: [], //未选数据 + unselecteddata: [], //右边勾选中 options: [], value: "", dialogVisible: false, copyGroupdialogVisible: false, packagelist: [], + tabledata: [], }; }, created() { this.getitemtype(); + this.getportfolioitems(); }, methods: { + selecteditems(val) { + this.temporaryselection = val; + console.log(val); + }, + // 移去按钮 + removedata() { + if (this.unselecteddata.length == 0) { + this.$message.warning("请选择操作的数据"); + } else { + let count = this.unselecteddata.length - 1; + for (var i = count; i >= 0; i--) { + this.tabledata.splice(i, 1); + this.selecteddata.push(this.unselecteddata[i]); + } + // this.selecteddata = this.unselecteddata; + } + }, + // 左侧未选 + handleSelectionChange(val) { + // this.selecteddata = val; + this.unselecteddata = val; + console.log(this.unselecteddata); + }, + //获取所有组合项目 + getportfolioitems() { + getapi("/api/app/asbitem/in-filter?Filter").then((res) => { + this.tabledata = res.data.items; + }); + }, + //项目类别选择 + getprojectgroups(v) { + getapi(`/api/app/asbitem/in-item-type/${v}`).then((res) => { + this.tabledata = res.data; + console.log(res); + }); + }, //复制分组弹框 copygroup() { this.copyGroupdialogVisible = true; diff --git a/src/components/unitGrouping/unitGroupingTable.vue b/src/components/unitGrouping/unitGroupingTable.vue index ffd4546..8eb8329 100644 --- a/src/components/unitGrouping/unitGroupingTable.vue +++ b/src/components/unitGrouping/unitGroupingTable.vue @@ -1,13 +1,39 @@