wzyyy 3 лет назад
Родитель
Сommit
7794b71d22
2 измененных файлов с 52 добавлено и 4 удалено
  1. 4 4
      config/proxy.ts
  2. 48 0
      src/pages/system/Apply/Save/index.tsx

+ 4 - 4
config/proxy.ts

@@ -15,10 +15,10 @@ export default {
       // target: 'http://120.79.18.123:8844/',
       // ws: 'ws://120.79.18.123:8844/',
       // 测试环境
-      // target: 'http://120.77.179.54:8844/',
-      // ws: 'ws://120.77.179.54:8844/',
-      target: 'http://192.168.32.65:8850/',
-      ws: 'ws://192.168.32.65:8850/',
+      target: 'http://120.77.179.54:8844/',
+      ws: 'ws://120.77.179.54:8844/',
+      // target: 'http://192.168.32.65:8850/',
+      // ws: 'ws://192.168.32.65:8850/',
       //v2环境
       // ws: 'ws://47.109.52.230:8844',
       // target: 'http://47.109.52.230:8844',

+ 48 - 0
src/pages/system/Apply/Save/index.tsx

@@ -1159,6 +1159,54 @@ const Save = () => {
                   ),
                 },
               },
+              'apiServer.orgIdList': {
+                title: '组织',
+                'x-decorator': 'FormItem',
+                'x-component': 'TreeSelect',
+                'x-component-props': {
+                  multiple: true,
+                  showArrow: true,
+                  placeholder: '请选择组织',
+                  showCheckedStrategy: ATreeSelect.SHOW_ALL,
+                  filterOption: (input: string, option: any) =>
+                    option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0,
+                  fieldNames: {
+                    label: 'name',
+                    value: 'id',
+                  },
+                  treeNodeFilterProp: 'name',
+                },
+                'x-decorator-props': {
+                  gridSpan: 2,
+                  layout: 'vertical',
+                  labelAlign: 'left',
+                  addonAfter: (
+                    <PermissionButton
+                      type="link"
+                      style={{ padding: 0 }}
+                      isPermission={deptPermission.add}
+                      onClick={() => {
+                        const tab: any = window.open(`${origin}/#/system/department?save=true`);
+                        tab!.onTabSaveSuccess = (value: any) => {
+                          form.setFieldState('orgIdList', async (state) => {
+                            state.dataSource = await getOrg().then((resp) =>
+                              resp.result?.map((item: Record<string, unknown>) => ({
+                                ...item,
+                                label: item.name,
+                                value: item.id,
+                              })),
+                            );
+                            state.value = [...(state.value || []), value.id];
+                          });
+                        };
+                      }}
+                    >
+                      <PlusOutlined />
+                    </PermissionButton>
+                  ),
+                },
+                'x-reactions': ['{{useAsyncData(getOrg)}}'],
+              },
               apiServerThird: {
                 type: 'void',
                 'x-reactions': {