From 80f4149de14da3cf09ed67202f6f326b3ebe2b15 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 11 Jun 2020 18:27:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[Update]=20=E6=89=B9=E9=87=8F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=A1=A8=E5=8D=95=E6=B7=BB=E5=8A=A0fields=E9=80=89?= =?UTF-8?q?=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + .../GenericUpdateFormDialog/index.vue | 40 +++++++++++++++++-- src/views/users/User/UserList.vue | 16 ++++++-- 4 files changed, 51 insertions(+), 7 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index baadde8de..f022efafe 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -155,6 +155,7 @@ "ReLogin": "重新登录" }, "common": { + "SelectProperties": "选择属性", "CrontabHelpTips": "eg:每周日 03:05 执行 <5 3 * * 0>
提示: 使用5位 Linux crontab 表达式 <分 时 日 月 星期> (在线工具
注意: 如果同时设置了定期执行和周期执行,优先使用定期执行", "BadRequestErrorMsg": "请求错误,请检查填写内容", "MFARequireForSecurity": "为了安全请输入MFA", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 9456b78bd..9f49f1a86 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -154,6 +154,7 @@ "ReLogin": "Re-Login" }, "common": { + "SelectProperties": "Select properties", "CrontabHelpTips": "eg: Every Sunday 03:05 run <5 3 * * 0>
Tips:Using 5 digits linux crontab expressions (Online tools)
Note:If both Regularly perform and Cycle perform are set,give priority to Regularly perform", "BadRequestErrorMsg" : "Bad request, please check again", "DateLast24Hours": "Last 24 hours", diff --git a/src/layout/components/GenericUpdateFormDialog/index.vue b/src/layout/components/GenericUpdateFormDialog/index.vue index 69dd7a186..f721fb023 100644 --- a/src/layout/components/GenericUpdateFormDialog/index.vue +++ b/src/layout/components/GenericUpdateFormDialog/index.vue @@ -8,9 +8,25 @@ :show-cancel="false" :show-confirm="false" > - + + + + + + + {{ value.label }} + + + + + + + + + @@ -39,6 +55,9 @@ export default { }, data: function() { return { + internalKey: 0, + selectPropertiesLabel: this.$t('common.SelectProperties'), + checkedFields: [], iFormSetting: {} } }, @@ -47,6 +66,16 @@ export default { this.iFormSetting = Object.assign({}, this.formSetting, defaultFormSetting) }, methods: { + handleCheckedFieldsChange(values) { + for (const field of Object.keys(this.iFormSetting.fieldsMeta)) { + if (values.indexOf(field) === -1) { + this.iFormSetting.fieldsMeta[field].hidden = () => true + } else { + this.iFormSetting.fieldsMeta[field].hidden = () => false + } + } + this.internalKey++ + }, getDefaultFormSetting() { const vm = this return { @@ -87,6 +116,9 @@ export default { } - diff --git a/src/views/users/User/UserList.vue b/src/views/users/User/UserList.vue index 00f2d8357..ff08b216e 100644 --- a/src/views/users/User/UserList.vue +++ b/src/views/users/User/UserList.vue @@ -113,13 +113,13 @@ export default { date_expired: '2099-12-31 00:00:00 +0800' }, fields: [ - [this.$t('users.Account'), ['groups']], - [this.$t('users.Secure'), ['date_expired']], - [this.$t('common.Other'), ['comment']] + 'groups', 'date_expired', 'comment' ], url: '/api/v1/users/users/', fieldsMeta: { groups: { + label: this.$t('users.UserGroups'), + hidden: () => false, el: { multiple: true, ajax: { @@ -127,6 +127,16 @@ export default { }, value: [] } + }, + date_expired: { + label: this.$t('common.dateExpired'), + hidden: () => false + + }, + comment: { + label: this.$t('common.Comment'), + hidden: () => false + } } } From 0054abe7068a90dc1a4979e57acdeb4b733033d4 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 11 Jun 2020 18:32:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[Update]=20=E8=B5=84=E4=BA=A7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9B=B4=E6=96=B0bulkUpdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/Asset/AssetList.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/views/assets/Asset/AssetList.vue b/src/views/assets/Asset/AssetList.vue index f3686e199..9fff958c9 100644 --- a/src/views/assets/Asset/AssetList.vue +++ b/src/views/assets/Asset/AssetList.vue @@ -279,13 +279,12 @@ export default { platform: 'Linux' }, fields: [ - [this.$t('assets.Basic'), ['platform', 'domain']], - [this.$t('assets.Auth'), ['admin_user']], - [this.$t('assets.Label'), ['labels']], - [this.$t('assets.Other'), ['comment']] + 'platform', 'domain', 'admin_user', 'labels', 'comment' ], fieldsMeta: { platform: { + label: this.$t('assets.Platform'), + hidden: () => false, el: { multiple: false, ajax: { @@ -297,6 +296,8 @@ export default { } }, domain: { + label: this.$t('assets.Domain'), + hidden: () => false, el: { multiple: false, ajax: { @@ -305,6 +306,8 @@ export default { } }, admin_user: { + label: this.$t('assets.AdminUser'), + hidden: () => false, el: { multiple: false, ajax: { @@ -316,11 +319,17 @@ export default { } }, labels: { + label: this.$t('assets.Label'), + hidden: () => false, el: { ajax: { url: '/api/v1/assets/labels/' } } + }, + comment: { + label: this.$t('common.Comment'), + hidden: () => false } } } From b3b9ff8c824054eb0ed8e4fb63be25ed326978a0 Mon Sep 17 00:00:00 2001 From: Bai Date: Thu, 11 Jun 2020 18:44:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=9B=B4=E6=96=B0=E8=A1=A8=E5=8D=95=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/GenericUpdateFormDialog/index.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/layout/components/GenericUpdateFormDialog/index.vue b/src/layout/components/GenericUpdateFormDialog/index.vue index f721fb023..3cfc71eca 100644 --- a/src/layout/components/GenericUpdateFormDialog/index.vue +++ b/src/layout/components/GenericUpdateFormDialog/index.vue @@ -10,7 +10,9 @@ > - +
+ +
@@ -18,7 +20,7 @@
- + @@ -117,8 +119,12 @@ export default {