feat: separate workbench admin features
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
</n-space>
|
||||
<BasicTable
|
||||
ref="actionRef"
|
||||
:columns="columns"
|
||||
:columns="visibleColumns"
|
||||
:request="loadDataTable"
|
||||
:row-key="(row) => row.tenantId + '-' + row.id"
|
||||
:actionColumn="actionColumn"
|
||||
@@ -60,6 +60,10 @@
|
||||
tenantSchema.ifShow = () => isPlatformAdmin.value;
|
||||
}
|
||||
|
||||
const visibleColumns = computed(() =>
|
||||
isPlatformAdmin.value ? columns : columns.filter((column) => column.key !== 'location')
|
||||
);
|
||||
|
||||
const actionColumn = reactive({
|
||||
width: 220,
|
||||
title: '操作',
|
||||
@@ -92,7 +96,7 @@
|
||||
});
|
||||
},
|
||||
});
|
||||
const scrollX = computed(() => adaTableScrollX(columns, actionColumn.width));
|
||||
const scrollX = computed(() => adaTableScrollX(visibleColumns.value, actionColumn.width));
|
||||
|
||||
const [register, { setFieldsValue }] = useForm({
|
||||
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<n-descriptions-item label="引用数">{{ formValue.linkCount }}</n-descriptions-item>
|
||||
<n-descriptions-item label="创建时间">{{ formValue.createdAt }}</n-descriptions-item>
|
||||
<n-descriptions-item label="更新时间">{{ formValue.updatedAt }}</n-descriptions-item>
|
||||
<n-descriptions-item label="文件位置" :span="2">
|
||||
<n-descriptions-item v-if="isPlatformAdmin" label="文件位置" :span="2">
|
||||
{{ formValue.location || '-' }}
|
||||
</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
@@ -38,6 +38,7 @@
|
||||
import { computed, ref } from 'vue';
|
||||
import { useDictStore } from '@/store/modules/dict';
|
||||
import { useProjectSettingStore } from '@/store/modules/projectSetting';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { BasicTable } from '@/components/Table';
|
||||
import { adaModalWidth } from '@/utils/hotgo';
|
||||
import { linkColumns, newState, State } from './model';
|
||||
@@ -45,6 +46,8 @@
|
||||
|
||||
const dict = useDictStore();
|
||||
const settingStore = useProjectSettingStore();
|
||||
const userStore = useUserStore();
|
||||
const isPlatformAdmin = computed(() => userStore.isCompanyDept);
|
||||
const showModal = ref(false);
|
||||
const loading = ref(false);
|
||||
const formValue = ref<State>(newState(null));
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
const actionColumn = reactive({
|
||||
width: 240,
|
||||
width: 440,
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
fixed: 'right',
|
||||
|
||||
Reference in New Issue
Block a user