+ render: row => {
+ if (row.tenantId === '000000') return null;
+ const editBtn = () => {
+ if (!hasAuth('system:tenant:edit')) {
+ return null;
+ }
+ return (
edit(row.id!)}>
{$t('common.edit')}
+ );
+ };
+ const syncBtn = () => {
+ if (!hasAuth('system:tenant:edit')) {
+ return null;
+ }
+ return (
handleDelete(row.id!)}>
{{
default: () => `确认同步[${row.companyName}]的套餐吗?`,
@@ -108,6 +126,13 @@ const {
)
}}
+ );
+ };
+ const deleteBtn = () => {
+ if (!hasAuth('system:tenant:delete')) {
+ return null;
+ }
+ return (
handleDelete(row.id!)}>
{{
default: () => $t('common.confirmDelete'),
@@ -118,8 +143,16 @@ const {
)
}}
+ );
+ };
+ return (
+
+ {editBtn()}
+ {syncBtn()}
+ {deleteBtn()}
- ) : null
+ );
+ }
}
]
});
@@ -144,6 +177,10 @@ async function handleDelete(id: CommonType.IdType) {
async function edit(id: CommonType.IdType) {
handleEdit('id', id);
}
+
+async function handleExport() {
+ download('/system/tenant/export', searchParams, '租户列表.xlsx');
+}
@@ -155,8 +192,12 @@ async function edit(id: CommonType.IdType) {
v-model:columns="columnChecks"
:disabled-delete="checkedRowKeys.length === 0"
:loading="loading"
+ :show-add="hasAuth('system:tenant:add')"
+ :show-delete="hasAuth('system:tenant:delete')"
+ :show-export="hasAuth('system:tenant:export')"
@add="handleAdd"
@delete="handleBatchDelete"
+ @export="handleExport"
@refresh="getData"
/>