diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index b46543cb0..9390b1adc 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 73401cc90..010970494 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..3cfc71eca 100644 --- a/src/layout/components/GenericUpdateFormDialog/index.vue +++ b/src/layout/components/GenericUpdateFormDialog/index.vue @@ -8,9 +8,27 @@ :show-cancel="false" :show-confirm="false" > - + + + + {{ selectPropertiesLabel }} + + + + + {{ value.label }} + + + + + + + + + @@ -39,6 +57,9 @@ export default { }, data: function() { return { + internalKey: 0, + selectPropertiesLabel: this.$t('common.SelectProperties'), + checkedFields: [], iFormSetting: {} } }, @@ -47,6 +68,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 +118,13 @@ export default { } - 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 } } } 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 + } } }