From baa9f3f7b57412ce118875bf8ea2ffbce7456148 Mon Sep 17 00:00:00 2001 From: Bai Date: Tue, 9 Jun 2020 14:47:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[Update]=20=E7=A7=BB=E5=8A=A8rMenu=E4=BB=8E?= =?UTF-8?q?TreeTable=E5=88=B0AssetList=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AutoDataZTree/index.vue | 116 ------------ .../DataZTree/components/ZTree/index.vue | 1 - src/components/TreeTable/index.vue | 29 +-- src/views/assets/Asset/AssetList.vue | 169 ++++++++++++++++-- 4 files changed, 158 insertions(+), 157 deletions(-) diff --git a/src/components/AutoDataZTree/index.vue b/src/components/AutoDataZTree/index.vue index 5b5224ced..ba7bd0b69 100644 --- a/src/components/AutoDataZTree/index.vue +++ b/src/components/AutoDataZTree/index.vue @@ -10,31 +10,6 @@
  • {{ this.$t('tree.DeleteNode') }}
  • -
  • -
  • - {{ this.$t('tree.AddAssetToNode') }} -
  • -
  • - {{ this.$t('tree.moveAssetToNode') }} -
  • -
  • -
  • - {{ this.$t('tree.updateNodeAssetHardwareInfo') }} -
  • -
  • - {{ this.$t('tree.testNodeAssetConnectivity') }} -
  • -
  • -
  • - {{ this.$t('tree.showAssetOnlyCurrentNode') }} -
  • -
  • - {{ this.$t('tree.showAssetAllChildrenNode') }} -
  • -
  • -
  • - {{ this.$t('tree.showNodeInfo') }} -
  • @@ -97,20 +72,7 @@ export default { return this.$refs.dataztree.rMenu } }, - mounted() { - this.decorateRMenu() - }, methods: { - decorateRMenu() { - const show_current_asset = this.$cookie.get('show_current_asset') || '0' - if (show_current_asset === '1') { - $('#m_show_asset_all_children_node').css('color', '#606266') - $('#m_show_asset_only_current_node').css('color', 'green') - } else { - $('#m_show_asset_all_children_node').css('color', 'green') - $('#m_show_asset_only_current_node').css('color', '#606266') - } - }, editTreeNode: function() { this.hideRMenu() const currentNode = this.zTree.getSelectedNodes()[0] @@ -154,77 +116,6 @@ export default { this.$message.error(this.$t('common.deleteErrorMsg' + ' ' + error)) }) }, - addAssetToNode: function() { - - }, - moveAssetToNode: function() { - - }, - updateNodeAssetHardwareInfo: function() { - this.hideRMenu() - const currentNode = this.zTree.getSelectedNodes()[0] - if (!currentNode) { - return - } - this.$axios.post( - `/api/v1/assets/nodes/${currentNode.meta.node.id}/tasks/`, - { 'action': 'refresh' } - ).then((res) => { - window.open(`/core/ops/celery/task/${res.task}/log/`, '_blank', 'toolbar=yes, width=900, height=600') - }).catch(error => { - this.$message.error(this.$t('common.updateErrorMsg' + ' ' + error)) - }) - }, - testNodeAssetConnectivity: function() { - this.hideRMenu() - const currentNode = this.zTree.getSelectedNodes()[0] - if (!currentNode) { - return - } - this.$axios.post( - `/api/v1/assets/nodes/${currentNode.meta.node.id}/tasks/`, - { 'action': 'test' } - ).then((res) => { - window.open(`/core/ops/celery/task/${res.task}/log/`, '_blank', 'toolbar=yes, width=900, height=600') - }).catch(error => { - this.$message.error(this.$t('common.updateErrorMsg' + ' ' + error)) - }) - }, - showAssetOnlyCurrentNode: function(event) { - console.log(1, event) - this.hideRMenu() - const currentNode = this.zTree.getSelectedNodes()[0] - if (!currentNode) { - return - } - this.$cookie.set('show_current_asset', '1', 1) - this.decorateRMenu() - this.$emit('urlChange', `${this.setting.url}?node_id=${currentNode.meta.node.id}&show_current_asset=1`) - }, - showAssetAllChildrenNode: function() { - this.hideRMenu() - const currentNode = this.zTree.getSelectedNodes()[0] - if (!currentNode) { - return - } - this.$cookie.set('show_current_asset', '0', 1) - this.decorateRMenu() - this.$emit('urlChange', `${this.setting.url}?node_id=${currentNode.meta.node.id}&show_current_asset=0`) - }, - showNodeInfo: function() { - this.hideRMenu() - const currentNode = this.zTree.getSelectedNodes()[0] - if (!currentNode) { - return - } - this.$axios.get( - `/api/v1/assets/nodes/${currentNode.meta.node.id}/` - ).then(res => { - this.$emit('showNodeInfoDialog', res) - }).catch(error => { - this.$message.error(this.$t('common.getErrorMsg' + ' ' + error)) - }) - }, onRename: function(event, treeId, treeNode, isCancel) { const url = `${this.treeSetting.nodeUrl}${this.currentNodeId}/` if (isCancel) { @@ -368,11 +259,4 @@ export default { .rmenu:hover{ background-color: #f5f7fa; } - - .divider{ - margin: 1px 0; - list-style: none outside none; - background-color: #e5e5e5; - height: 1px - } diff --git a/src/components/DataZTree/components/ZTree/index.vue b/src/components/DataZTree/components/ZTree/index.vue index 5b7413336..78ca979d2 100644 --- a/src/components/DataZTree/components/ZTree/index.vue +++ b/src/components/DataZTree/components/ZTree/index.vue @@ -11,7 +11,6 @@
    diff --git a/src/components/TreeTable/index.vue b/src/components/TreeTable/index.vue index 2e137bd9f..54c2ab41f 100644 --- a/src/components/TreeTable/index.vue +++ b/src/components/TreeTable/index.vue @@ -8,7 +8,6 @@ :setting="treeSetting" class="auto-data-ztree" @urlChange="handleUrlChange" - @showNodeInfoDialog="showNodeInfoDialog" >
    @@ -27,12 +26,6 @@
    - - -
    -
    {{ item.value }}
    -
    -
    @@ -70,11 +63,7 @@ export default { return { iTableConfig: this.tableConfig, iShowTree: this.showTree, - componentKey: 0, - nodeInfoDialog: { - show: false, - items: [] - } + componentKey: 0 } }, watch: { @@ -93,15 +82,6 @@ export default { }, getSelectedNodes: function() { return this.$refs.AutoDataZTree.getSelectedNodes() - }, - showNodeInfoDialog(node) { - this.nodeInfoDialog.show = true - this.nodeInfoDialog.items = [ - { key: 'id', label: 'ID', value: node.id }, - { key: 'name', label: this.$t('assets.Name'), value: node.name }, - { key: 'fullName', label: this.$t('assets.FullName'), value: node.full_value }, - { key: 'key', label: this.$t('assets.Key'), value: node.key } - ] } } } @@ -131,11 +111,4 @@ export default { overflow: auto; /*border-right: solid 1px red;*/ } - - .el-row { - margin-bottom: 20px; - &:last-child { - margin-bottom: 0; - } - } diff --git a/src/views/assets/Asset/AssetList.vue b/src/views/assets/Asset/AssetList.vue index 84cab2bf8..e98317233 100644 --- a/src/views/assets/Asset/AssetList.vue +++ b/src/views/assets/Asset/AssetList.vue @@ -1,20 +1,53 @@ - From 2f92e9284a96e82646b14499a3a1778807ee492b Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 9 Jun 2020 16:34:18 +0800 Subject: [PATCH 2/3] gateway name display --- src/views/assets/Domain/DomainDetail/GatewayList.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/assets/Domain/DomainDetail/GatewayList.vue b/src/views/assets/Domain/DomainDetail/GatewayList.vue index 73d272df4..f0e1088e0 100644 --- a/src/views/assets/Domain/DomainDetail/GatewayList.vue +++ b/src/views/assets/Domain/DomainDetail/GatewayList.vue @@ -4,7 +4,7 @@