|
|
@@ -10,11 +10,11 @@ import {
|
|
|
fetchGetUserList
|
|
|
} from '@/service/api/government/user-list';
|
|
|
import { fetchGetAllChannelList } from '@/service/api/goods/store-goods';
|
|
|
+import { useAuth } from '@/hooks/business/auth';
|
|
|
import { useTable } from '@/components/zt/Table/hooks/useTable';
|
|
|
import { useModalFrom } from '@/components/zt/ModalForm/hooks/useModalForm';
|
|
|
import { useModal } from '@/components/zt/Modal/hooks/useModal';
|
|
|
import SVGIcon from '@/components/custom/svg-icon.vue';
|
|
|
-
|
|
|
const importTemplateRef = useTemplateRef('importTemplateRef');
|
|
|
const columns: NaiveUI.TableColumn<Api.government.userList>[] = [
|
|
|
{
|
|
|
@@ -62,6 +62,7 @@ const columns: NaiveUI.TableColumn<Api.government.userList>[] = [
|
|
|
uncheckedValue={0}
|
|
|
checkedValue={1}
|
|
|
value={row.status}
|
|
|
+ disabled={!useAuth().hasAuth('user:list:statusbtn')}
|
|
|
onUpdate:value={val => {
|
|
|
row.status = val;
|
|
|
fetchEditUser(row);
|
|
|
@@ -104,7 +105,7 @@ const [registerTable, { refresh, setTableLoading }] = useTable({
|
|
|
tableConfig: {
|
|
|
keyField: 'userId',
|
|
|
title: '员工列表',
|
|
|
- showAddButton: true
|
|
|
+ showAddButton: useAuth().hasAuth('user:list:add')
|
|
|
}
|
|
|
});
|
|
|
const [registerModalTable] = useTable({
|
|
|
@@ -116,7 +117,6 @@ const [registerModalTable] = useTable({
|
|
|
minHeight: 400
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
const failColumns: NaiveUI.TableColumn<Api.government.importRecordList>[] = [
|
|
|
{
|
|
|
key: 'index',
|
|
|
@@ -285,8 +285,17 @@ async function handleSubmitImport(file: File) {
|
|
|
<LayoutTable>
|
|
|
<ZTable :columns="columns" :api="fetchGetUserList" @register="registerTable" @add="openModal">
|
|
|
<template #op="{ row }">
|
|
|
- <NButton size="small" ghost type="primary" :disabled="Boolean(row.available)" @click="edit(row)">编辑</NButton>
|
|
|
- <NPopconfirm @positive-click="handleDelete(row)">
|
|
|
+ <NButton
|
|
|
+ v-if="useAuth().hasAuth('user:list:edit')"
|
|
|
+ size="small"
|
|
|
+ ghost
|
|
|
+ type="primary"
|
|
|
+ :disabled="Boolean(row.available)"
|
|
|
+ @click="edit(row)"
|
|
|
+ >
|
|
|
+ 编辑
|
|
|
+ </NButton>
|
|
|
+ <NPopconfirm v-if="useAuth().hasAuth('user:list:del')" @positive-click="handleDelete(row)">
|
|
|
<template #trigger>
|
|
|
<NButton size="small" type="error" ghost :disabled="Boolean(row.available)">删除</NButton>
|
|
|
</template>
|
|
|
@@ -295,8 +304,10 @@ async function handleSubmitImport(file: File) {
|
|
|
</template>
|
|
|
<template #prefix>
|
|
|
<NSpace>
|
|
|
- <NButton size="small" @click="openImportModal">导入员工</NButton>
|
|
|
- <NButton size="small" @click="openModalFail">导入记录</NButton>
|
|
|
+ <NButton v-if="useAuth().hasAuth('user:list:export')" size="small" @click="openImportModal">导入员工</NButton>
|
|
|
+ <NButton v-if="useAuth().hasAuth('user:list:exportRecord')" size="small" @click="openModalFail">
|
|
|
+ 导入记录
|
|
|
+ </NButton>
|
|
|
</NSpace>
|
|
|
</template>
|
|
|
</ZTable>
|