YangYuGang
2025-03-11 bfdfeb40c7ba97511584a30477acf5ad801398ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { FormSchema } from '/@/components/Table';
import { useGlobSetting } from '/@/hooks/setting';
 
const globSetting = useGlobSetting();
export const accountFormSchema: FormSchema[] = [
  {
    field: 'dept',
    label: '',
    component: 'TreeSelect',
    componentProps: {
      fieldNames: {
        label: 'deptName',
        key: 'id',
        value: 'deptCode',
      },
      placeholder: '请选择工厂', //globSetting.useOrg == 'Y' ? '请选择据点' : '请选择工厂',
      getPopupContainer: () => document.body,
    },
    rules: [
      {
        required: true,
        // @ts-ignore
        validator: async (rule, value) => {
          if (!value) {
            /* eslint-disable-next-line */
            return Promise.reject('请选择据点');
          }
          return Promise.resolve();
        },
        trigger: 'change',
      },
    ],
  },
];