From b0f0c550633efdbd1cf2f89f29ef5efb09ba4cbd Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 8 Jun 2020 13:41:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=98=AF=E9=80=89=E6=8B=A9=E9=BB=98=E8=AE=A4=E7=9A=84=E8=B5=84?= =?UTF-8?q?=E4=BA=A7=E5=92=8C=E8=8A=82=E7=82=B9=20feat:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96protocols=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AutoDataZTree/index.vue | 3 +- .../ListTable/TableAction/LeftSide.vue | 11 ++- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + src/styles/element-ui.scss | 12 +++ src/views/assets/Asset/AssetCreateUpdate.vue | 12 ++- src/views/assets/Asset/AssetList.vue | 5 +- .../Asset/components/Protocols}/index.vue | 74 ++++++++++++++++--- .../AssetPermissionCreateUpdate.vue | 12 ++- .../AssetPermission/AssetPermissionList.vue | 4 + 10 files changed, 114 insertions(+), 21 deletions(-) rename src/{components/CustomInput => views/assets/Asset/components/Protocols}/index.vue (57%) diff --git a/src/components/AutoDataZTree/index.vue b/src/components/AutoDataZTree/index.vue index 0041f7557..705757002 100644 --- a/src/components/AutoDataZTree/index.vue +++ b/src/components/AutoDataZTree/index.vue @@ -73,7 +73,6 @@ export default { } }, mounted() { - }, methods: { editTreeNode: function() { @@ -96,9 +95,11 @@ export default { if (treeNode.meta.type === 'node') { this.currentNode = treeNode this.currentNodeId = treeNode.meta.node.id + this.$route.query['node'] = this.currentNodeId this.$emit('urlChange', `${this.setting.url}?node_id=${treeNode.meta.node.id}&show_current_asset=null`) } else if (treeNode.meta.type === 'asset') { this.$emit('urlChange', `${this.setting.url}?asset_id=${treeNode.meta.asset.id}&show_current_asset=null`) + this.$route.query['asset'] = treeNode.meta.asset.id } }, removeTreeNode: function() { diff --git a/src/components/ListTable/TableAction/LeftSide.vue b/src/components/ListTable/TableAction/LeftSide.vue index 2a642680e..e393c70d3 100644 --- a/src/components/ListTable/TableAction/LeftSide.vue +++ b/src/components/ListTable/TableAction/LeftSide.vue @@ -24,7 +24,7 @@ export default { default: '' }, createRoute: { - type: String, + type: [String, Object], default: function() { return this.$route.name.replace('List', 'Create') } @@ -112,8 +112,13 @@ export default { }, methods: { handleCreate() { - const routeName = this.createRoute - this.$router.push({ name: routeName }) + let route = {} + if (typeof this.createRoute === 'string') { + route.name = this.createRoute + } else { + route = this.createRoute + } + this.$router.push(route) this.$log.debug('handle create') }, defaultBulkDeleteCallback({ selectedRows, reloadTable }) { diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 272201818..aead3e565 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -152,6 +152,7 @@ "DateLastMonth": "最近一月", "DateLast3Months": "最近三月", "MFAConfirm": "MFA 认证", + "SelectPlaceholder": "请选择", "Yes": "是", "No": "否", "Remove":"删除", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index d87e3c1e9..469f53832 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -151,6 +151,7 @@ "DateLastMonth": "Last month", "DateLast3Months": "Last 3 months", "MFAConfirm": "MFA Confirm", + "SelectPlaceholder": "Select", "Yes": "Yes", "Remove":"Remove", "No": "No", diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 557b35ef8..d929830dc 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -11,6 +11,10 @@ $--color-info: #23c6c8; $--color-warning: #f8ac59; $--color-danger: #ed5565; +$--color-text-primary: #303133; +/// color|1|Font Color|2 +$--color-text-regular: #606266; + .el-upload { input[type="file"] { display: none !important; @@ -434,3 +438,11 @@ a { .el-alert .el-alert__description { margin: 1px 0 0; } + +.el-input-group__prepend div.el-select .el-input__inner { + color: $--color-text-primary; +} + +.el-input-group__prepend div.el-select .el-input__inner:hover { + color: $--color-text-primary; +} diff --git a/src/views/assets/Asset/AssetCreateUpdate.vue b/src/views/assets/Asset/AssetCreateUpdate.vue index 1c54dfd0b..2a307d375 100644 --- a/src/views/assets/Asset/AssetCreateUpdate.vue +++ b/src/views/assets/Asset/AssetCreateUpdate.vue @@ -4,17 +4,23 @@