---初始化后台管理web页面项目

This commit is contained in:
2025-08-20 14:39:30 +08:00
parent ad49711a7e
commit 87545a8baf
2057 changed files with 282864 additions and 213 deletions

View File

@ -0,0 +1,93 @@
<template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<DeptTree class="w-1/3 xl:w-1/4" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-2/3 xl:w-3/4">
<template #toolbar>
<a-button type="primary" v-auth="'member:sync'" @click="handleSync">同步</a-button>
</template>
</BasicTable>
</PageWrapper>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { BasicTable, useTable, FormSchema, BasicColumn } from '/@/components/Table';
import { getMemberList, updateSyncUser } from '/@/api/system/wechat';
import { PageWrapper } from '/@/components/Page';
import DeptTree from '/@/views/system/user/components/DeptTree.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMessage } from '/@/hooks/web/useMessage';
const { t } = useI18n();
const searchFormSchema: FormSchema[] = [
{
field: 'keyword',
label: '关键字',
component: 'Input',
componentProps: {
placeholder: '请输入姓名/账号/电话',
},
},
];
const columns: BasicColumn[] = [
{
title: t('姓名'),
dataIndex: 'name',
sorter: true,
align: 'left',
},
{
title: t('账号'),
dataIndex: 'userName',
sorter: true,
align: 'left',
},
{
title: '组织',
dataIndex: 'departmentName',
sorter: true,
align: 'left',
},
];
const { notification } = useMessage();
const selectDeptId = ref('');
const [registerTable, { reload }] = useTable({
title: '企业成员列表',
api: getMemberList,
rowKey: 'id',
columns,
formConfig: {
rowProps: {
gutter: 16,
},
schemas: searchFormSchema,
showResetButton: false,
},
beforeFetch: (params) => {
//发送请求默认新增 左边树结构所选机构id
return { ...params, departmentId: selectDeptId.value };
},
useSearchForm: true,
showTableSetting: true,
striped: false,
tableSetting: {
size: false,
setting: false,
},
});
async function handleSync() {
await updateSyncUser(selectDeptId.value);
notification.success({
message: '提示',
description: '同步成功',
});
reload();
}
function handleSelect(deptId = '') {
selectDeptId.value = deptId;
reload();
}
</script>