From 2ec41dd246a62276d89feffefe2e4b7cf767acad Mon Sep 17 00:00:00 2001 From: shizhongming Date: Thu, 11 Apr 2024 17:43:31 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E7=B3=BB=E7=BB=9F=E6=A8=A1=E5=9D=97-?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=AE=A1=E7=90=86):=20=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=B7=BB=E5=8A=A0=E7=A7=9F=E6=88=B7=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/SysTenant/SysTenantSelect.vue | 46 +++++++++++++++++++ src/modules/smart-system/components/index.ts | 1 + .../exception/SysExceptionListView.config.ts | 23 +++++++++- .../views/exception/SysExceptionListView.vue | 9 +++- .../views/exception/lang/en_US.ts | 1 + .../views/exception/lang/zh_CN.ts | 1 + 6 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 src/modules/smart-system/components/SysTenant/SysTenantSelect.vue create mode 100644 src/modules/smart-system/components/index.ts diff --git a/src/modules/smart-system/components/SysTenant/SysTenantSelect.vue b/src/modules/smart-system/components/SysTenant/SysTenantSelect.vue new file mode 100644 index 000000000..d1106ca36 --- /dev/null +++ b/src/modules/smart-system/components/SysTenant/SysTenantSelect.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/modules/smart-system/components/index.ts b/src/modules/smart-system/components/index.ts new file mode 100644 index 000000000..caeb99f43 --- /dev/null +++ b/src/modules/smart-system/components/index.ts @@ -0,0 +1 @@ +export { default as SysTenantSelect } from './SysTenant/SysTenantSelect.vue'; diff --git a/src/modules/smart-system/views/exception/SysExceptionListView.config.ts b/src/modules/smart-system/views/exception/SysExceptionListView.config.ts index ce0ec2b6c..8858ac4cd 100644 --- a/src/modules/smart-system/views/exception/SysExceptionListView.config.ts +++ b/src/modules/smart-system/views/exception/SysExceptionListView.config.ts @@ -1,5 +1,6 @@ import type { SmartColumn, SmartSearchFormSchema } from '@/components/SmartTable'; import { tableBooleanColumnClass } from '@/components/SmartTable'; +import { Ref, unref } from 'vue'; export const getTableColumns = (): SmartColumn[] => { return [ @@ -41,6 +42,14 @@ export const getTableColumns = (): SmartColumn[] => { title: '{system.views.exception.title.operateUser}', width: 120, }, + { + field: 'tenantId', + title: '{system.views.exception.title.tenant}', + width: 120, + formatter({ row }) { + return row.tenant?.tenantShortName || row.tenant?.tenantName; + }, + }, { field: 'createTime', sortable: true, @@ -110,7 +119,10 @@ const getYesNoOptions = (t: Function) => { ]; }; -export const getSearchFormSchemas = (t: Function): SmartSearchFormSchema[] => { +export const getSearchFormSchemas = ( + t: Function, + getIsPlatformTenant: Ref, +): SmartSearchFormSchema[] => { return [ { label: t('system.views.exception.title.exceptionMessage'), @@ -159,5 +171,14 @@ export const getSearchFormSchemas = (t: Function): SmartSearchFormSchema[] => { style: { width: '150px' }, }, }, + { + label: t('system.views.exception.title.tenant'), + field: 'tenantId', + slot: 'search-tenantId', + searchSymbol: '=', + ifShow() { + return unref(getIsPlatformTenant); + }, + }, ]; }; diff --git a/src/modules/smart-system/views/exception/SysExceptionListView.vue b/src/modules/smart-system/views/exception/SysExceptionListView.vue index f8f7075ab..d94b18dff 100644 --- a/src/modules/smart-system/views/exception/SysExceptionListView.vue +++ b/src/modules/smart-system/views/exception/SysExceptionListView.vue @@ -4,6 +4,9 @@ + @@ -26,9 +29,13 @@ import ExceptionDetailModal from './components/ExceptionDetailModal.vue'; import { createConfirm, successMessage, warnMessage } from '@/utils/message/SystemNotice'; import { ref, unref } from 'vue'; + import { SysTenantSelect } from '@/modules/smart-system/components'; + import { storeToRefs } from 'pinia'; + import { useUserStore } from '@/store/modules/user'; const { t } = useI18n(); const { getTableSize } = useSizeSetting(); + const { getIsPlatformTenant } = storeToRefs(useUserStore()); const getTableActions = (row): ActionItem[] => { return [ @@ -90,7 +97,7 @@ searchFormConfig: { layout: 'inline', searchWithSymbol: true, - schemas: getSearchFormSchemas(t), + schemas: getSearchFormSchemas(t, getIsPlatformTenant), colon: true, actionColOptions: { span: undefined, diff --git a/src/modules/smart-system/views/exception/lang/en_US.ts b/src/modules/smart-system/views/exception/lang/en_US.ts index a12d707cb..1432f5dcb 100644 --- a/src/modules/smart-system/views/exception/lang/en_US.ts +++ b/src/modules/smart-system/views/exception/lang/en_US.ts @@ -20,6 +20,7 @@ export default { resolvedTime: 'Resolved time', showStackTrace: 'Show stackTrace', stackTrace: 'Stack trace', + tenant: 'Tenant', }, validate: { resolvedMessage: 'Please enter processing information', diff --git a/src/modules/smart-system/views/exception/lang/zh_CN.ts b/src/modules/smart-system/views/exception/lang/zh_CN.ts index 87dbd2c3e..3504be2d9 100644 --- a/src/modules/smart-system/views/exception/lang/zh_CN.ts +++ b/src/modules/smart-system/views/exception/lang/zh_CN.ts @@ -20,6 +20,7 @@ export default { resolvedTime: '处理时间', showStackTrace: '查看堆栈信息', stackTrace: '堆栈信息', + tenant: '租户', }, validate: { resolvedMessage: '请输入处理信息',