From 422dcdc6bea7d2ab393cff090f4e4a8c4659d6d1 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 12 Jul 2022 18:13:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E9=80=89=E4=BC=98=E5=8C=96,=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E5=85=A8=E9=80=89=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apps/develop/AppDeployCustom/AiLibTable.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue b/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue index e3596f2d..73dd804b 100644 --- a/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue +++ b/project/oms/apps/develop/AppDeployCustom/AiLibTable.vue @@ -10,8 +10,11 @@ + :size.sync="page.size" border @getList="getTableData" tableSize="mini"> + @@ -37,6 +40,7 @@ export default { default: () => [ {prop: 'label', label: "应用名称"}, {prop: 'project', label: "项目/框架"}, + {prop: 'category', label: "分类"}, {prop: 'name', label: "模块名"}, ] }, @@ -49,6 +53,7 @@ export default { page: {total: 0, current: 1, size: 10}, search: {}, tableData: [], + selectAll: false } }, computed: { @@ -75,6 +80,7 @@ export default { if (res?.data) { const list = res.data.records || res.data || [] list.map(e => { + e.category = e.libPath.replace(/^\/[^\/]+\/([^\/]+)\/.+/, '$1') if (/\/project\//.test(e.libPath)) { e.project = e.libPath.replace(/.*project\/([^\/]+)\/.+/, '$1') } else if (/\/core\//.test(e.libPath)) { @@ -99,6 +105,14 @@ export default { } else { this.$emit("change", row.checked ? row[nodeKey] : '') } + }, + handleCheckAll(v) { + const {nodeKey} = this + let selected = this.tableData.map(e => { + e.checked = v + return e + }).filter(e => e.checked)?.map(e => e[nodeKey]) || [] + this.$emit("change", selected) } }, created() {