|
|
@@ -8,6 +8,7 @@ import type { SystemModel } from '#/api';
|
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
|
|
|
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
|
+import { listOrganizationsMethod } from '#/api';
|
|
|
|
|
|
import { useUserSearchFormSchema, useUserTableColumns } from './data';
|
|
|
import Form from './modules/form.vue';
|
|
|
@@ -26,139 +27,42 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|
|
columns: useUserTableColumns(onActionClick),
|
|
|
height: 'auto',
|
|
|
keepSource: true,
|
|
|
- // proxyConfig: {
|
|
|
- // ajax: {
|
|
|
- // query({ page }, formValues) {
|
|
|
- // return listOrganizationsMethod(
|
|
|
- // page.currentPage,
|
|
|
- // page.pageSize,
|
|
|
- // formValues,
|
|
|
- // );
|
|
|
- // },
|
|
|
- // },
|
|
|
- // },
|
|
|
- // rowConfig: {
|
|
|
- // keyField: 'id',
|
|
|
- // },
|
|
|
-
|
|
|
proxyConfig: {
|
|
|
ajax: {
|
|
|
- query() {
|
|
|
- return Promise.resolve({
|
|
|
- Data: {
|
|
|
- TotalRecordCount: 3,
|
|
|
-
|
|
|
- Items: [
|
|
|
- {
|
|
|
- pid: '1',
|
|
|
- name: '六只五常院区',
|
|
|
- code: 'lz0003',
|
|
|
- parentinstitutionSelsourceName: '杭州六只医院',
|
|
|
- createUser: '张三',
|
|
|
- createTime: '2025-10-26 11:23:21',
|
|
|
- type: '院区',
|
|
|
- creditCode: '123456789',
|
|
|
- medicineCenter: '煎药中心1',
|
|
|
- remark: '备注1',
|
|
|
- },
|
|
|
- {
|
|
|
- pid: '2',
|
|
|
- name: '杭州卫健委',
|
|
|
- code: 'hz9876',
|
|
|
- parentinstitutionSelsourceName: '',
|
|
|
- createUser: '张三',
|
|
|
- createTime: '2025-10-26 11:23:21',
|
|
|
- type: '管理部门',
|
|
|
- creditCode: '987654321',
|
|
|
- medicineCenter: '煎药中心2',
|
|
|
- remark: '备注2',
|
|
|
- },
|
|
|
- {
|
|
|
- pid: '3',
|
|
|
- name: '同仁堂',
|
|
|
- code: 'trt0001',
|
|
|
- parentinstitutionSelsourceName: '杭州卫健委',
|
|
|
- createUser: '张三',
|
|
|
- createTime: '2025-10-26 11:23:21',
|
|
|
- type: '医疗机构',
|
|
|
- creditCode: '555555555',
|
|
|
- medicineCenter: '煎药中心3',
|
|
|
- remark: '无',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
-
|
|
|
- ResultCode: 0,
|
|
|
- });
|
|
|
+ query({ page }, formValues) {
|
|
|
+ return listOrganizationsMethod(
|
|
|
+ page.currentPage,
|
|
|
+ page.pageSize,
|
|
|
+ formValues,
|
|
|
+ );
|
|
|
},
|
|
|
},
|
|
|
-
|
|
|
- response: {
|
|
|
- result: 'Data.Items',
|
|
|
- total: 'Data.TotalRecordCount',
|
|
|
- },
|
|
|
},
|
|
|
-
|
|
|
rowConfig: {
|
|
|
- keyField: 'pid',
|
|
|
+ keyField: 'id',
|
|
|
},
|
|
|
- } as VxeTableGridOptions<SystemModel.User>,
|
|
|
+ } as VxeTableGridOptions<SystemModel.Organization>,
|
|
|
});
|
|
|
-// 表格的操作 删除和修改功能
|
|
|
-function onActionClick(e: OnActionClickParams<SystemModel.User>) {
|
|
|
- switch (e.code) {
|
|
|
- case 'delete': {
|
|
|
- onDeleteHandle(e.row);
|
|
|
- break;
|
|
|
- }
|
|
|
- case 'edit': {
|
|
|
- onEditHandle(e.row);
|
|
|
- break;
|
|
|
- }
|
|
|
+
|
|
|
+function onActionClick(e: OnActionClickParams<SystemModel.Organization>) {
|
|
|
+ if (e.code === 'edit') {
|
|
|
+ onEditHandle(e.row);
|
|
|
}
|
|
|
}
|
|
|
-// 刷新
|
|
|
+
|
|
|
function onRefresh() {
|
|
|
gridApi.query();
|
|
|
}
|
|
|
|
|
|
-// 修改
|
|
|
-function onEditHandle(row?: SystemModel.User) {
|
|
|
- // console.log('row', row);
|
|
|
+function onEditHandle(row?: SystemModel.Organization) {
|
|
|
formModalApi.setData(row ?? {}).open();
|
|
|
}
|
|
|
-
|
|
|
-// 删除
|
|
|
-async function onDeleteHandle(row: SystemModel.Organization) {
|
|
|
- console.log('delete', row);
|
|
|
- // const hideLoading = message.loading({
|
|
|
- // content: $t('ui.actionMessage.deleting', [row.name]),
|
|
|
- // duration: 0,
|
|
|
- // key: 'action_process_msg',
|
|
|
- // });
|
|
|
- // try {
|
|
|
- // await deleteOrganizationMethod(row);
|
|
|
- // message.success({
|
|
|
- // content: $t('ui.actionMessage.deleteSuccess', [row.name]),
|
|
|
- // key: 'action_process_msg',
|
|
|
- // });
|
|
|
- // // 删除之后重新刷新页面
|
|
|
- // onRefresh();
|
|
|
- // } finally {
|
|
|
- // hideLoading();
|
|
|
- // }
|
|
|
-}
|
|
|
</script>
|
|
|
<template>
|
|
|
<Page auto-content-height>
|
|
|
<FormModal @success="onRefresh" />
|
|
|
<Grid>
|
|
|
- <template #toolbar-tools>
|
|
|
- <!-- <Button type="primary" @click="onEditHandle()">
|
|
|
- <Plus class="size-5" />
|
|
|
- {{ $t('ui.actionTitle.create', [$t('system.organization._')]) }}
|
|
|
- </Button> -->
|
|
|
- </template>
|
|
|
+ <template #toolbar-tools></template>
|
|
|
</Grid>
|
|
|
</Page>
|
|
|
</template>
|