From d6f9df277e436fa56fbd61a20575582c2acee1b0 Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 17 Dec 2020 13:22:07 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=92=8CBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AutoDataForm/index.vue | 6 +++--- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + .../PersonalInformationImprovement.vue | 8 ++++++++ src/views/applications/DatabaseApp/DatabaseAppList.vue | 1 + .../applications/KubernetesApp/KubernetesAppList.vue | 1 + src/views/applications/RemoteApp/RemoteAppList.vue | 1 + src/views/assets/AdminUser/AdminUserList.vue | 1 + src/views/assets/CommandFilter/CommandFilterList.vue | 1 + src/views/assets/Label/LabelList.vue | 1 + src/views/assets/Platform/PlatformList.vue | 1 + src/views/assets/SystemUser/SystemUserList.vue | 1 + .../ApplicationPermission/ApplicationPermissionList.vue | 5 +++++ 13 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/AutoDataForm/index.vue b/src/components/AutoDataForm/index.vue index 5448b7577..a720ce06b 100644 --- a/src/components/AutoDataForm/index.vue +++ b/src/components/AutoDataForm/index.vue @@ -199,9 +199,9 @@ export default { error += `${parseInt(key) + 1}.${str[key][0]} ` }) } - if (field.attrs.error === error) { - error += '.' - } + // if (field.attrs.error === error) { + // error += '.' + // } field.attrs.error = error } } diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index ae2898669..201c5f15b 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -198,6 +198,7 @@ "BadRoleErrorMsg": "请求错误,无该操作权限", "BadConflictErrorMsg": "正在刷新中,请稍后再试", "Basic": "基本", + "PleaseAgreeToTheTerms": "请同意条款", "BasicInfo": "基本信息", "Cancel": "取消", "Close": "关闭", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index fd43cc90e..9c17731ae 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -190,6 +190,7 @@ "actionsTips":"Clipboard's copy and paste control only support RDP/VNC protocol.", "Active": "Active", "Add": "Add", + "PleaseAgreeToTheTerms": "Please agree to the terms", "PushSelected":"Push selected", "UpdateAssetDetail": "Update more detail", "AddSuccessMsg": "Add success", diff --git a/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue b/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue index 2e484758a..2aa5fc905 100644 --- a/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue +++ b/src/userviews/users/UserFirstLogin/PersonalInformationImprovement/PersonalInformationImprovement.vue @@ -9,6 +9,7 @@ :clean-form-value="cleanFormValue" :get-method="getMethod" :on-perform-success="onPerformSuccess" + :perform-submit="performSubmit" /> @@ -88,6 +89,13 @@ export default { getMethod() { return 'put' }, + performSubmit(validValues) { + if (!validValues.terms) { + this.$message.error(this.$t('common.PleaseAgreeToTheTerms')) + return Promise.reject() + } + return this.$axios['put'](this.url, validValues) + }, onPerformSuccess() { this.$message.success(this.$t('common.updateSuccessMsg')) setTimeout(() => this.$router.push({ name: 'UserGuide' }), 100) diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index 2aec06d24..b71d90871 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -37,6 +37,7 @@ export default { actions: { prop: '', formatterArgs: { + hasClone: true, performDelete: function({ row, col, cellValue, reload }) { this.$axios.delete( `/api/v1/applications/applications/${row.id}/` diff --git a/src/views/applications/KubernetesApp/KubernetesAppList.vue b/src/views/applications/KubernetesApp/KubernetesAppList.vue index 54cb0b11a..159d4c18a 100644 --- a/src/views/applications/KubernetesApp/KubernetesAppList.vue +++ b/src/views/applications/KubernetesApp/KubernetesAppList.vue @@ -29,6 +29,7 @@ export default { actions: { prop: '', formatterArgs: { + hasClone: true, performDelete: function({ row, col, cellValue, reload }) { this.$axios.delete( `/api/v1/applications/applications/${row.id}/` diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue index 24df27a58..f200de486 100644 --- a/src/views/applications/RemoteApp/RemoteAppList.vue +++ b/src/views/applications/RemoteApp/RemoteAppList.vue @@ -34,6 +34,7 @@ export default { }, actions: { formatterArgs: { + hasClone: true, onUpdate: ({ row }) => { vm.$router.push({ name: 'RemoteAppUpdate', params: { id: row.id }, query: { type: row.type }}) }, diff --git a/src/views/assets/AdminUser/AdminUserList.vue b/src/views/assets/AdminUser/AdminUserList.vue index 9846f1d01..29570e7b5 100644 --- a/src/views/assets/AdminUser/AdminUserList.vue +++ b/src/views/assets/AdminUser/AdminUserList.vue @@ -49,6 +49,7 @@ export default { formatter: ActionsFormatter, width: '200px', formatterArgs: { + hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/admin-users/${id}/` diff --git a/src/views/assets/CommandFilter/CommandFilterList.vue b/src/views/assets/CommandFilter/CommandFilterList.vue index 4bfa4ad9f..0ff903ded 100644 --- a/src/views/assets/CommandFilter/CommandFilterList.vue +++ b/src/views/assets/CommandFilter/CommandFilterList.vue @@ -57,6 +57,7 @@ export default { formatter: ActionsFormatter, width: '200px', formatterArgs: { + hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/cmd-filters/${id}/` diff --git a/src/views/assets/Label/LabelList.vue b/src/views/assets/Label/LabelList.vue index b3795400c..95f850c7f 100644 --- a/src/views/assets/Label/LabelList.vue +++ b/src/views/assets/Label/LabelList.vue @@ -39,6 +39,7 @@ export default { label: this.$t('assets.Action'), width: '200px', formatterArgs: { + hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/labels/${id}/` diff --git a/src/views/assets/Platform/PlatformList.vue b/src/views/assets/Platform/PlatformList.vue index ed78e5341..e62f9d6fa 100644 --- a/src/views/assets/Platform/PlatformList.vue +++ b/src/views/assets/Platform/PlatformList.vue @@ -44,6 +44,7 @@ export default { formatter: ActionsFormatter, width: '200px', formatterArgs: { + hasClone: true, canDelete: (row, vaule) => { return !row.internal }, diff --git a/src/views/assets/SystemUser/SystemUserList.vue b/src/views/assets/SystemUser/SystemUserList.vue index 47be04442..67faee0ce 100644 --- a/src/views/assets/SystemUser/SystemUserList.vue +++ b/src/views/assets/SystemUser/SystemUserList.vue @@ -60,6 +60,7 @@ export default { label: this.$t('common.Action'), updateRoute: 'SystemUserUpdate', formatterArgs: { + hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/system-users/${id}/` diff --git a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue index d3f6b6e3b..be3352809 100644 --- a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue +++ b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue @@ -72,6 +72,11 @@ export default { activeTab: 'RemoteAppPermissionRemoteApp' } } + }, + actions: { + formatterArgs: { + hasClone: true + } } } }, From 73bb854ebbd3df4325f820701ed5bf0b5af011d2 Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 17 Dec 2020 14:53:04 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=A7=BB=E9=99=A4,=20=E5=8E=BB=E9=99=A4=E7=AE=80=E5=8D=95?= =?UTF-8?q?=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/applications/DatabaseApp/DatabaseAppList.vue | 1 - src/views/applications/KubernetesApp/KubernetesAppList.vue | 1 - src/views/applications/RemoteApp/RemoteAppList.vue | 1 - src/views/assets/AdminUser/AdminUserList.vue | 1 - src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue | 1 + src/views/assets/CommandFilter/CommandFilterList.vue | 1 - src/views/assets/Label/LabelList.vue | 1 - src/views/assets/Platform/PlatformList.vue | 2 +- src/views/assets/SystemUser/SystemUserList.vue | 1 - .../ApplicationPermission/ApplicationPermissionList.vue | 5 ----- 10 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/views/applications/DatabaseApp/DatabaseAppList.vue b/src/views/applications/DatabaseApp/DatabaseAppList.vue index b71d90871..2aec06d24 100644 --- a/src/views/applications/DatabaseApp/DatabaseAppList.vue +++ b/src/views/applications/DatabaseApp/DatabaseAppList.vue @@ -37,7 +37,6 @@ export default { actions: { prop: '', formatterArgs: { - hasClone: true, performDelete: function({ row, col, cellValue, reload }) { this.$axios.delete( `/api/v1/applications/applications/${row.id}/` diff --git a/src/views/applications/KubernetesApp/KubernetesAppList.vue b/src/views/applications/KubernetesApp/KubernetesAppList.vue index 159d4c18a..54cb0b11a 100644 --- a/src/views/applications/KubernetesApp/KubernetesAppList.vue +++ b/src/views/applications/KubernetesApp/KubernetesAppList.vue @@ -29,7 +29,6 @@ export default { actions: { prop: '', formatterArgs: { - hasClone: true, performDelete: function({ row, col, cellValue, reload }) { this.$axios.delete( `/api/v1/applications/applications/${row.id}/` diff --git a/src/views/applications/RemoteApp/RemoteAppList.vue b/src/views/applications/RemoteApp/RemoteAppList.vue index f200de486..24df27a58 100644 --- a/src/views/applications/RemoteApp/RemoteAppList.vue +++ b/src/views/applications/RemoteApp/RemoteAppList.vue @@ -34,7 +34,6 @@ export default { }, actions: { formatterArgs: { - hasClone: true, onUpdate: ({ row }) => { vm.$router.push({ name: 'RemoteAppUpdate', params: { id: row.id }, query: { type: row.type }}) }, diff --git a/src/views/assets/AdminUser/AdminUserList.vue b/src/views/assets/AdminUser/AdminUserList.vue index 29570e7b5..9846f1d01 100644 --- a/src/views/assets/AdminUser/AdminUserList.vue +++ b/src/views/assets/AdminUser/AdminUserList.vue @@ -49,7 +49,6 @@ export default { formatter: ActionsFormatter, width: '200px', formatterArgs: { - hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/admin-users/${id}/` diff --git a/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue b/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue index 39b593a61..08172dc1e 100644 --- a/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue +++ b/src/views/assets/CommandFilter/CommandFilterDetail/Rules.vue @@ -48,6 +48,7 @@ export default { }, headerActions: { hasSearch: true, + hasBulkDelete: false, createRoute: { name: 'CommandFilterRulesCreate', query: { diff --git a/src/views/assets/CommandFilter/CommandFilterList.vue b/src/views/assets/CommandFilter/CommandFilterList.vue index 0ff903ded..4bfa4ad9f 100644 --- a/src/views/assets/CommandFilter/CommandFilterList.vue +++ b/src/views/assets/CommandFilter/CommandFilterList.vue @@ -57,7 +57,6 @@ export default { formatter: ActionsFormatter, width: '200px', formatterArgs: { - hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/cmd-filters/${id}/` diff --git a/src/views/assets/Label/LabelList.vue b/src/views/assets/Label/LabelList.vue index 95f850c7f..b3795400c 100644 --- a/src/views/assets/Label/LabelList.vue +++ b/src/views/assets/Label/LabelList.vue @@ -39,7 +39,6 @@ export default { label: this.$t('assets.Action'), width: '200px', formatterArgs: { - hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/labels/${id}/` diff --git a/src/views/assets/Platform/PlatformList.vue b/src/views/assets/Platform/PlatformList.vue index e62f9d6fa..32839527b 100644 --- a/src/views/assets/Platform/PlatformList.vue +++ b/src/views/assets/Platform/PlatformList.vue @@ -44,7 +44,6 @@ export default { formatter: ActionsFormatter, width: '200px', formatterArgs: { - hasClone: true, canDelete: (row, vaule) => { return !row.internal }, @@ -67,6 +66,7 @@ export default { hasRefresh: false, hasSearch: false, hasMoreActions: false, + hasBulkDelete: false, createRoute: 'PlatformCreate' } } diff --git a/src/views/assets/SystemUser/SystemUserList.vue b/src/views/assets/SystemUser/SystemUserList.vue index 67faee0ce..47be04442 100644 --- a/src/views/assets/SystemUser/SystemUserList.vue +++ b/src/views/assets/SystemUser/SystemUserList.vue @@ -60,7 +60,6 @@ export default { label: this.$t('common.Action'), updateRoute: 'SystemUserUpdate', formatterArgs: { - hasClone: true, performDelete: ({ row, col }) => { const id = row.id const url = `/api/v1/assets/system-users/${id}/` diff --git a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue index be3352809..d3f6b6e3b 100644 --- a/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue +++ b/src/views/perms/ApplicationPermission/ApplicationPermissionList.vue @@ -72,11 +72,6 @@ export default { activeTab: 'RemoteAppPermissionRemoteApp' } } - }, - actions: { - formatterArgs: { - hasClone: true - } } } }, From c083f6c4a4f082d746f9e036304268213361b94d Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 17 Dec 2020 14:35:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix(clone):=20=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=B8=8Bclone=E4=B8=A2=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ListTable/index.vue | 4 -- src/views/assets/AdminUser/AdminUserList.vue | 47 ++-------------- .../assets/SystemUser/SystemUserList.vue | 56 +++---------------- 3 files changed, 14 insertions(+), 93 deletions(-) diff --git a/src/components/ListTable/index.vue b/src/components/ListTable/index.vue index 354b5dd6e..f7b2e4c98 100644 --- a/src/components/ListTable/index.vue +++ b/src/components/ListTable/index.vue @@ -81,10 +81,6 @@ export default { deep: true } }, - mounted() { - this.$log.debug(this.headerActions) - this.$log.debug(this.iTableConfig) - }, methods: { handleSelectionChange(val) { this.selectedRows = val diff --git a/src/views/assets/AdminUser/AdminUserList.vue b/src/views/assets/AdminUser/AdminUserList.vue index 9846f1d01..adf1bed4f 100644 --- a/src/views/assets/AdminUser/AdminUserList.vue +++ b/src/views/assets/AdminUser/AdminUserList.vue @@ -4,7 +4,6 @@