|
@@ -4,6 +4,7 @@ import type { VbenFormSchema } from '#/adapter/form';
|
|
|
import type { OnActionClickFn } from '#/adapter/vxe-table';
|
|
import type { OnActionClickFn } from '#/adapter/vxe-table';
|
|
|
import type { SystemModel } from '#/api/method/system';
|
|
import type { SystemModel } from '#/api/method/system';
|
|
|
|
|
|
|
|
|
|
+import { listDeptTypeDictMethod } from '#/api';
|
|
|
import { listOrganizationsMethodAll } from '#/api/method/system';
|
|
import { listOrganizationsMethodAll } from '#/api/method/system';
|
|
|
import { $t } from '#/locales';
|
|
import { $t } from '#/locales';
|
|
|
|
|
|
|
@@ -15,20 +16,15 @@ export function useUserSearchFormSchema(): VbenFormSchema[] {
|
|
|
label: $t('system.organization.name'),
|
|
label: $t('system.organization.name'),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- component: 'Select',
|
|
|
|
|
- fieldName: 'status',
|
|
|
|
|
|
|
+ component: 'ApiSelect',
|
|
|
|
|
+ fieldName: 'deptType',
|
|
|
label: $t('system.organization.type'),
|
|
label: $t('system.organization.type'),
|
|
|
componentProps: {
|
|
componentProps: {
|
|
|
- options: [
|
|
|
|
|
- {
|
|
|
|
|
- label: '院区',
|
|
|
|
|
- value: 1,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- label: '管理部门',
|
|
|
|
|
- value: 0,
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ allowClear: true,
|
|
|
|
|
+ api: listDeptTypeDictMethod,
|
|
|
|
|
+ class: 'w-full',
|
|
|
|
|
+ labelField: 'dictName',
|
|
|
|
|
+ valueField: 'dictValue',
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
@@ -86,14 +82,15 @@ export function useUserTableColumns<T = SystemModel.Organization>(
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- // cellRender: {
|
|
|
|
|
- // attrs: {
|
|
|
|
|
- // nameField: 'name',
|
|
|
|
|
- // nameTitle: $t('system.user._'),
|
|
|
|
|
- // onClick: onActionClick,
|
|
|
|
|
- // },
|
|
|
|
|
- // name: 'CellOperation',
|
|
|
|
|
- // },
|
|
|
|
|
|
|
+ cellRender: {
|
|
|
|
|
+ attrs: {
|
|
|
|
|
+ nameField: 'name',
|
|
|
|
|
+ nameTitle: $t('system.organization._'),
|
|
|
|
|
+ onClick: onActionClick,
|
|
|
|
|
+ options: ['edit'],
|
|
|
|
|
+ },
|
|
|
|
|
+ name: 'CellOperation',
|
|
|
|
|
+ },
|
|
|
field: 'operation',
|
|
field: 'operation',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
title: $t('table.column.operation'),
|
|
title: $t('table.column.operation'),
|
|
@@ -122,63 +119,36 @@ export function useUserFormSchema(
|
|
|
rules: 'required',
|
|
rules: 'required',
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- component: 'Input',
|
|
|
|
|
|
|
+ component: 'Select',
|
|
|
componentProps: {
|
|
componentProps: {
|
|
|
- placeholder: $t('system.organization.type'),
|
|
|
|
|
|
|
+ allowClear: true,
|
|
|
|
|
+ class: 'w-full',
|
|
|
|
|
+ options: [
|
|
|
|
|
+ { label: '院区', value: 1 },
|
|
|
|
|
+ { label: '管理部门', value: 2 },
|
|
|
|
|
+ { label: '医疗机构', value: 3 },
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
- fieldName: 'type',
|
|
|
|
|
|
|
+ fieldName: 'deptType',
|
|
|
label: $t('system.organization.type'),
|
|
label: $t('system.organization.type'),
|
|
|
rules: 'required',
|
|
rules: 'required',
|
|
|
},
|
|
},
|
|
|
- // {
|
|
|
|
|
- // component: 'ApiSelect',
|
|
|
|
|
- // componentProps: {
|
|
|
|
|
- // allowClear: true,
|
|
|
|
|
- // api: listOrganizationsMethodAll,
|
|
|
|
|
- // class: 'w-full',
|
|
|
|
|
- // labelField: 'name',
|
|
|
|
|
- // valueField: 'pid',
|
|
|
|
|
- // childrenField: 'children',
|
|
|
|
|
- // afterFetch: (res: SystemModel.Organization[]) => {
|
|
|
|
|
- // if (!current) return res;
|
|
|
|
|
- // return Array.isArray(res)
|
|
|
|
|
- // ? res.filter(
|
|
|
|
|
- // (item) => item.pid !== current.id && item.name !== current.name,
|
|
|
|
|
- // )
|
|
|
|
|
- // : res;
|
|
|
|
|
- // },
|
|
|
|
|
- // },
|
|
|
|
|
- // fieldName: 'parentInstitutionId',
|
|
|
|
|
- // label: $t('system.organization.superior'),
|
|
|
|
|
- // },
|
|
|
|
|
{
|
|
{
|
|
|
- component: 'Select',
|
|
|
|
|
-
|
|
|
|
|
|
|
+ component: 'ApiSelect',
|
|
|
componentProps: {
|
|
componentProps: {
|
|
|
allowClear: true,
|
|
allowClear: true,
|
|
|
-
|
|
|
|
|
|
|
+ api: listOrganizationsMethodAll,
|
|
|
class: 'w-full',
|
|
class: 'w-full',
|
|
|
-
|
|
|
|
|
- options: [
|
|
|
|
|
- {
|
|
|
|
|
- label: '测试1上级机构',
|
|
|
|
|
- value: '1',
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- label: '测试2上级机构',
|
|
|
|
|
- value: '2',
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- label: '测试3上级机构',
|
|
|
|
|
- value: '3',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ labelField: 'name',
|
|
|
|
|
+ valueField: 'id',
|
|
|
|
|
+ afterFetch: (res: SystemModel.Organization[]) => {
|
|
|
|
|
+ if (!current) return res;
|
|
|
|
|
+ return Array.isArray(res)
|
|
|
|
|
+ ? res.filter((item) => item.id !== current.id)
|
|
|
|
|
+ : res;
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
fieldName: 'parentInstitutionId',
|
|
fieldName: 'parentInstitutionId',
|
|
|
-
|
|
|
|
|
label: $t('system.organization.superior'),
|
|
label: $t('system.organization.superior'),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -207,7 +177,6 @@ export function useUserFormSchema(
|
|
|
},
|
|
},
|
|
|
fieldName: 'remark',
|
|
fieldName: 'remark',
|
|
|
label: $t('system.organization.remark'),
|
|
label: $t('system.organization.remark'),
|
|
|
- rules: 'required',
|
|
|
|
|
},
|
|
},
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|