闪电 2 dagen geleden
bovenliggende
commit
5688673287
1 gewijzigde bestanden met toevoegingen van 16 en 17 verwijderingen
  1. 16 17
      apps/web-ele/src/views/system/taskDesign/taskTemplate/taskTemplate-data.tsx

+ 16 - 17
apps/web-ele/src/views/system/taskDesign/taskTemplate/taskTemplate-data.tsx

@@ -24,12 +24,9 @@ const DICT_KEYS = {
24 24
 export let positionsOptions = [] as any[];
25 25
 // @ts-ignore:任务负责人
26 26
 export let PersoninchargeOptions = [] as any[];
27
-// @ts-ignore:任务排斥
28
-export let TaskExclusionOptions = [] as any[];
29 27
 
30 28
 const getPositionsList = async () => {
31 29
   const { rows } = await getPostList({});
32
-  console.log('执行岗位', rows);
33 30
 
34 31
   positionsOptions = rows.map((item: any) => ({
35 32
     label: item.postName,
@@ -55,15 +52,6 @@ const deptTreefn = async () => {
55 52
   }));
56 53
 };
57 54
 deptTreefn();
58
-const TaskExclusionOptionsfn = async () => {
59
-  const res = await querybaseApilist({});
60
-  // console.log('排斥任务',res);
61
-  TaskExclusionOptions = res.rows.map((item: any) => ({
62
-    label: item.taskName,
63
-    value: item.id,
64
-  }));
65
-};
66
-TaskExclusionOptionsfn();
67 55
 // 获取任务类型字典选项
68 56
 const getTaskTypeOptions = () => getDictOptions(DICT_KEYS.TASK_TYPE);
69 57
 // 获取表单类型字典选项
@@ -197,9 +185,7 @@ export const queryFormSchema: FormSchemaGetter = () => [
197 185
       return {
198 186
         allowClear: true,
199 187
         placeholder: '请选择表单类型',
200
-        options: getFormTypeOptions()?.filter(
201
-          (item: any) => item?.value !== 'form',
202
-        ),
188
+        options: getFormTypeOptions(),
203 189
         clearable: true,
204 190
       };
205 191
     },
@@ -1148,12 +1134,25 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
1148 1134
     formItemClass: 'col-span-2 items-baseline',
1149 1135
   },
1150 1136
   {
1151
-    component: 'Select',
1137
+    component: 'ApiSelect',
1152 1138
     fieldName: 'repel',
1153 1139
     label: '任务排斥',
1154 1140
     componentProps: {
1155 1141
       placeholder: '请选择任务排斥',
1156
-      options: TaskExclusionOptions,
1142
+      api: async () => {
1143
+        const resp = await querybaseApilist({
1144
+          pageSize: 10_000,
1145
+        });
1146
+        const data = resp?.rows || [];
1147
+        return Array.isArray(data)
1148
+          ? data.map((item: any) => ({
1149
+              label: item.taskName,
1150
+              value: item.id,
1151
+            }))
1152
+          : [];
1153
+      },
1154
+      labelField: 'label',
1155
+      valueField: 'value',
1157 1156
       clearable: true,
1158 1157
     },
1159 1158
     formItemClass: 'col-span-2 items-baseline',