From c172538a31e4c3eab5f7b12c49f04f65568b4b62 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 29 Mar 2022 14:04:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=83=E7=B4=A0=E5=BA=93=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/components/table/MsTable.vue | 13 ++++++++++++- .../components/common/select-tree/SelectTree.vue | 13 +++++++++++++ frontend/src/business/components/xpack | 2 +- frontend/src/store/index.js | 3 ++- frontend/src/store/mutations.js | 1 + 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/common/components/table/MsTable.vue b/frontend/src/business/components/common/components/table/MsTable.vue index 0c59e86b04..1d4584c587 100644 --- a/frontend/src/business/components/common/components/table/MsTable.vue +++ b/frontend/src/business/components/common/components/table/MsTable.vue @@ -6,7 +6,7 @@ v-loading="tableIsLoading" :data="data" :default-sort="defaultSort" - :class="{'ms-select-all-fixed': showSelectAll}" + :class="{'ms-select-all-fixed': showSelectAll, 'row-click': rowClickStyle}" :height="screenHeight" :row-key="rowKey" :row-class-name="tableRowClassName" @@ -244,6 +244,13 @@ export default { return true; } }, + // 添加鼠标移入小手样式 + rowClickStyle: { + type: Boolean, + default() { + return false; + } + }, tableIsLoading:{ type:Boolean, default() { @@ -558,4 +565,8 @@ export default { background-color: #ffffff !important; } +.row-click { + cursor:pointer; +} + diff --git a/frontend/src/business/components/common/select-tree/SelectTree.vue b/frontend/src/business/components/common/select-tree/SelectTree.vue index 2c7f83183c..fc75af5da3 100644 --- a/frontend/src/business/components/common/select-tree/SelectTree.vue +++ b/frontend/src/business/components/common/select-tree/SelectTree.vue @@ -156,6 +156,7 @@ export default { filterText: "", loading: false, checkedId: [], + selectNodeIds: [] }; }, computed: { @@ -270,6 +271,17 @@ export default { }); this.returnDatas = t; } + this.selectNodeIds = []; + this.getChildNodeId(data, this.selectNodeIds); + }, + getChildNodeId(rootNode, nodeIds) { + //递归获取所有子节点ID + nodeIds.push(rootNode.id); + if (rootNode.children) { + for (let i = 0; i < rootNode.children.length; i++) { + this.getChildNodeId(rootNode.children[i], nodeIds); + } + } }, //单选:清空选中 clean() { @@ -341,6 +353,7 @@ export default { //下拉框关闭执行 popoverHide() { this.$emit('getValue', this.returnDataKeys, this.returnDatas ? this.returnDatas : {}); + this.$emit('setSelectNodeIds', this.selectNodeIds); }, // 多选,清空所有勾选 clearSelectedNodes() { diff --git a/frontend/src/business/components/xpack b/frontend/src/business/components/xpack index dee87cd69a..b265d60017 160000 --- a/frontend/src/business/components/xpack +++ b/frontend/src/business/components/xpack @@ -1 +1 @@ -Subproject commit dee87cd69aaeaca312e5211f40a3f539dc8b040a +Subproject commit b265d6001752dd21b2d25fec113292bf34f5c99d diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 467ee2152a..923c0d5229 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -41,7 +41,8 @@ const state = { selectCommand: {}, //按照type分组的指令 groupedCmd: {}, - librarySelectElement: {} + librarySelectElement: {}, + uiElementLibraryModuleIds: null, } const store = new Vuex.Store({ diff --git a/frontend/src/store/mutations.js b/frontend/src/store/mutations.js index efb548713e..d29f5bb9ad 100644 --- a/frontend/src/store/mutations.js +++ b/frontend/src/store/mutations.js @@ -25,6 +25,7 @@ const mutations = { setCurrentScenario: (state, value) => state.currentScenario = value, setScenarioDefinition: (state, value) => state.scenarioDefinition = value, setGroupedCmd: (state, value) => state.groupedCmd = value, + setUiElementLibraryModuleIds: (state, value) => state.uiElementLibraryModuleIds = value, } export default mutations;