|
@@ -18,7 +18,7 @@
|
|
|
import { useAsyncState } from '@vueuse/core'
|
|
|
import { queryTenantListPaging, deleteTenantById } from '@/service/modules/tenants'
|
|
|
import { reactive, h, ref } from 'vue'
|
|
|
-import { NButton, NPopconfirm } from 'naive-ui'
|
|
|
+import { NButton, NPopconfirm, NSpace, NTooltip } from 'naive-ui'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
import { DeleteOutlined, EditOutlined } from '@vicons/antd'
|
|
|
|
|
@@ -35,7 +35,7 @@ export function useTable() {
|
|
|
deleteTenantById(row.id).then(() => {
|
|
|
getTableData({
|
|
|
pageSize: variables.pageSize,
|
|
|
- pageNo: variables.page,
|
|
|
+ pageNo: (variables.tableData.length === 1 && variables.page > 1) ? variables.page - 1 : variables.page,
|
|
|
searchVal: variables.searchVal
|
|
|
})
|
|
|
})
|
|
@@ -48,7 +48,7 @@ export function useTable() {
|
|
|
key: 'num',
|
|
|
},
|
|
|
{
|
|
|
- title: t('security.tenant.tenantCode'),
|
|
|
+ title: t('security.tenant.tenant_code'),
|
|
|
key: 'tenantCode',
|
|
|
},
|
|
|
{
|
|
@@ -56,58 +56,67 @@ export function useTable() {
|
|
|
key: 'description',
|
|
|
},
|
|
|
{
|
|
|
- title: t('security.tenant.queueName'),
|
|
|
+ title: t('security.tenant.queue_name'),
|
|
|
key: 'queueName',
|
|
|
},
|
|
|
{
|
|
|
- title: t('security.tenant.createTime'),
|
|
|
+ title: t('security.tenant.create_time'),
|
|
|
key: 'createTime',
|
|
|
},
|
|
|
{
|
|
|
- title: t('security.tenant.updateTime'),
|
|
|
+ title: t('security.tenant.update_time'),
|
|
|
key: 'updateTime',
|
|
|
},
|
|
|
{
|
|
|
title: t('security.tenant.actions'),
|
|
|
key: 'actions',
|
|
|
render(row: any) {
|
|
|
- return h('div', null, [
|
|
|
- h(
|
|
|
- NButton,
|
|
|
- {
|
|
|
- circle: true,
|
|
|
- type: 'info',
|
|
|
- size: 'small',
|
|
|
- onClick: () => {
|
|
|
- handleEdit(row)
|
|
|
+ return h(NSpace, null, {
|
|
|
+ default: () => [
|
|
|
+ h(
|
|
|
+ NTooltip, {}, {
|
|
|
+ trigger: () => h(NButton,
|
|
|
+ {
|
|
|
+ circle: true,
|
|
|
+ type: 'info',
|
|
|
+ size: 'small',
|
|
|
+ onClick: () => {
|
|
|
+ handleEdit(row)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: () => h(EditOutlined)
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ default: () => t('security.tenant.edit')
|
|
|
}
|
|
|
- },
|
|
|
- {
|
|
|
- icon: () => h(EditOutlined)
|
|
|
- }
|
|
|
- ),
|
|
|
- h(
|
|
|
- NPopconfirm,
|
|
|
- {
|
|
|
- onPositiveClick: () => { handleDelete(row) }
|
|
|
- },
|
|
|
- {
|
|
|
- trigger: () => h(
|
|
|
- NButton,
|
|
|
- {
|
|
|
- circle: true,
|
|
|
- type: 'error',
|
|
|
- size: 'small',
|
|
|
- style: {'margin-left': '5px'},
|
|
|
- },
|
|
|
- {
|
|
|
- icon: () => h(DeleteOutlined),
|
|
|
- }
|
|
|
- ),
|
|
|
- default: () => {return t('security.tenant.delete_confirm')}
|
|
|
- }
|
|
|
- )
|
|
|
- ])
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ NPopconfirm,
|
|
|
+ {
|
|
|
+ onPositiveClick: () => { handleDelete(row) }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ trigger: () => h(
|
|
|
+ NTooltip, {}, {
|
|
|
+ trigger: () => h(NButton,
|
|
|
+ {
|
|
|
+ circle: true,
|
|
|
+ type: 'error',
|
|
|
+ size: 'small',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ icon: () => h(DeleteOutlined)
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ default: () => t('security.tenant.delete')
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ default: () => t('security.tenant.delete_confirm')
|
|
|
+ }
|
|
|
+ )
|
|
|
+ ]
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
]
|