chenxiaochao 3 tygodni temu
rodzic
commit
05565e42a3

+ 12 - 8
apps/web-ele/src/api/system/tasksettings/checktheform.ts

@@ -10,11 +10,10 @@ enum Api {
10 10
   editSubItemApi = '/inspectionSubItem/item', // 编辑子项
11 11
   deleteSubItemApi = '/inspectionSubItem/item', // 删除子项
12 12
   addTagApi = '/inspectionTag/tag', // 新增标签
13
-  querytagbaseApi = '/inspectionTag/tag/list', // 查询标签列表    
14
-  addinspectionItemApi = '/inspectionItem/item', // 新增检查项              
13
+  querytagbaseApi = '/inspectionTag/tag/list', // 查询标签列表
14
+  addinspectionItemApi = '/inspectionItem/item', // 新增检查项
15 15
   queryinspectionItemApi = '/inspectionItem/item/list', // 查询检查项列表
16 16
   saveApi = '/inspectionMain/main/save', // 保存检查
17
-
18 17
 }
19 18
 
20 19
 // 查询检查表单列表
@@ -59,14 +58,14 @@ export function querysubItembaseApilist(params?: any) {
59 58
 }
60 59
 //编辑子项
61 60
 export function editSubItemApi(post: any) {
62
-  return requestClient.put(Api.editSubItemApi, post,);
61
+  return requestClient.put(Api.editSubItemApi, post);
63 62
 }
64 63
 //删除子项
65 64
 export function deleteSubItemApi(ids: any) {
66 65
   return requestClient.delete(`${Api.deleteSubItemApi}/${ids}`, {
67 66
     successMessageMode: 'message',
68 67
   });
69
-}     
68
+}
70 69
 // 查询标签列表
71 70
 export function querytagbaseApilist(params?: any) {
72 71
   return requestClient.get(Api.querytagbaseApi, { params });
@@ -88,7 +87,7 @@ export function deleteTagApi(ids: any) {
88 87
   return requestClient.delete(`${Api.addTagApi}/${ids}`, {
89 88
     successMessageMode: 'message',
90 89
   });
91
-} 
90
+}
92 91
 // 新增检查项
93 92
 export function addinspectionItemApi(post: any) {
94 93
   return requestClient.post(Api.addinspectionItemApi, post, {
@@ -97,7 +96,7 @@ export function addinspectionItemApi(post: any) {
97 96
 }
98 97
 // 查询检查项列表
99 98
 export function queryinspectionItemApilist(params?: any) {
100
-  return requestClient.get(Api.queryinspectionItemApi,  {params} );
99
+  return requestClient.get(Api.queryinspectionItemApi, { params });
101 100
 }
102 101
 // 编辑检查项
103 102
 export function editinspectionItemApi(post: any) {
@@ -110,13 +109,18 @@ export function deleteinspectionItemApi(ids: any) {
110 109
   return requestClient.delete(`${Api.addinspectionItemApi}/${ids}`, {
111 110
     successMessageMode: 'message',
112 111
   });
113
-}  
112
+}
114 113
 //检查项列表
115 114
 export function saveApi(post: any) {
116 115
   return requestClient.post(Api.saveApi, post, {
117 116
     successMessageMode: 'message',
118 117
   });
119 118
 }
119
+// 获取检查项详情
120
+export function queryinspectionItemDetailApi(id: number) {
121
+  return requestClient.get(`${Api.addinspectionItemApi}/${id}`);
122
+}
123
+
120 124
 //油站执行人下拉框
121 125
 // export function stationoperatorapi(params?: any) {
122 126
 //   return requestClient.get(Api.stationoperatorapi, params);

+ 69 - 92
apps/web-ele/src/app.vue

@@ -1,8 +1,6 @@
1 1
 <script lang="ts" setup>
2 2
 import { onMounted, onUnmounted, ref } from 'vue';
3
-
4
-// @ts-ignore
5
-import { useVbenModal } from '@vben/common-ui';
3
+import { useRouter } from 'vue-router';
6 4
 import { useElementPlusDesignTokens } from '@vben/hooks';
7 5
 
8 6
 import { ElConfigProvider } from 'element-plus';
@@ -12,105 +10,91 @@ import { elementLocale } from '#/locales';
12 10
 defineOptions({ name: 'App' });
13 11
 
14 12
 useElementPlusDesignTokens();
13
+const router = useRouter();
15 14
 
16
-const [AIModal, AIModalApi] = useVbenModal({
17
-  title: 'AI Assistant',
18
-  showCancelBtn: false,
19
-});
20
-const handleAIModal = (e: MouseEvent) => {
21
-  // 如果是拖动操作,不触发点击事件
22
-  if (shouldPreventClick.value) {
23
-    shouldPreventClick.value = false;
15
+const handleAIModal = () => {
16
+  if (hasDragged.value) {
17
+    hasDragged.value = false;
24 18
     return;
25 19
   }
26
-  AIModalApi.open();
20
+  router.push('/aiAnalysis/home');
27 21
 };
28 22
 
29
-// 拖动相关状态
23
+const aiIconRef = ref<HTMLElement | null>(null);
30 24
 const isDragging = ref(false);
25
+const hasDragged = ref(false);
31 26
 const startX = ref(0);
32 27
 const startY = ref(0);
33
-const position = ref({ x: 0, y: 0 });
34
-const aiIconRef = ref<HTMLElement | null>(null);
35
-const shouldPreventClick = ref(false);
36
-const moveThreshold = 5; // 拖动阈值,超过此值不触发点击
28
+const startLeft = ref(0);
29
+const startTop = ref(0);
30
+
31
+// 鼠标按下事件处理函数
32
+const handleMouseDown = (e: MouseEvent) => {
33
+  if (!aiIconRef.value) return;
34
+  hasDragged.value = false;
35
+  // 阻止默认行为,防止文本选择等
36
+  e.preventDefault();
37
+
38
+  // 开始拖拽
39
+  isDragging.value = true;
40
+
41
+  // 记录初始位置
42
+  startX.value = e.clientX;
43
+  startY.value = e.clientY;
44
+
45
+  // 记录元素初始位置
46
+  const rect = aiIconRef.value.getBoundingClientRect();
47
+  startLeft.value = rect.left;
48
+  startTop.value = rect.top;
49
+};
37 50
 
38
-// 初始化位置
39
-onMounted(() => {
40
-  // 默认位置:右下角
41
-  if (aiIconRef.value) {
42
-    const rect = aiIconRef.value.getBoundingClientRect();
43
-    position.value = {
44
-      x: window.innerWidth - rect.width - 30,
45
-      y: window.innerHeight - rect.height - 30,
46
-    };
47
-  }
48
-});
51
+// 鼠标移动事件处理函数
52
+const handleMouseMove = (e: MouseEvent) => {
53
+  if (!isDragging.value || !aiIconRef.value) return;
49 54
 
50
-// 鼠标按下事件
51
-const onMouseDown = (e: MouseEvent) => {
52
-  if (
53
-    e.target === aiIconRef.value ||
54
-    aiIconRef.value?.contains(e.target as Node)
55
-  ) {
56
-    isDragging.value = true;
57
-    startX.value = e.clientX;
58
-    startY.value = e.clientY;
59
-    shouldPreventClick.value = false;
60
-  }
61
-};
55
+  // 标记为已拖拽
56
+  hasDragged.value = true;
62 57
 
63
-// 鼠标移动事件
64
-const onMouseMove = (e: MouseEvent) => {
65
-  if (isDragging.value) {
66
-    // 计算移动距离
67
-    const deltaX = e.clientX - startX.value;
68
-    const deltaY = e.clientY - startY.value;
69
-
70
-    // 如果移动距离超过阈值,标记为拖动操作
71
-    if (Math.abs(deltaX) > moveThreshold || Math.abs(deltaY) > moveThreshold) {
72
-      shouldPreventClick.value = true;
73
-    }
74
-
75
-    // 更新位置
76
-    position.value = {
77
-      x: position.value.x + deltaX,
78
-      y: position.value.y + deltaY,
79
-    };
80
-
81
-    // 更新起始位置,用于下一次移动计算
82
-    startX.value = e.clientX;
83
-    startY.value = e.clientY;
84
-
85
-    // 限制在窗口范围内
86
-    if (aiIconRef.value) {
87
-      const rect = aiIconRef.value.getBoundingClientRect();
88
-      position.value.x = Math.max(
89
-        0,
90
-        Math.min(position.value.x, window.innerWidth - rect.width),
91
-      );
92
-      position.value.y = Math.max(
93
-        0,
94
-        Math.min(position.value.y, window.innerHeight - rect.height),
95
-      );
96
-    }
97
-  }
58
+  // 计算偏移量
59
+  const offsetX = e.clientX - startX.value;
60
+  const offsetY = e.clientY - startY.value;
61
+
62
+  // 计算新位置
63
+  let newLeft = startLeft.value + offsetX;
64
+  let newTop = startTop.value + offsetY;
65
+
66
+  // 限制在视口内
67
+  const viewportWidth = window.innerWidth;
68
+  const viewportHeight = window.innerHeight;
69
+  const iconWidth = aiIconRef.value.offsetWidth;
70
+  const iconHeight = aiIconRef.value.offsetHeight;
71
+
72
+  newLeft = Math.max(0, Math.min(newLeft, viewportWidth - iconWidth));
73
+  newTop = Math.max(0, Math.min(newTop, viewportHeight - iconHeight));
74
+
75
+  // 更新位置
76
+  aiIconRef.value.style.left = `${newLeft}px`;
77
+  aiIconRef.value.style.top = `${newTop}px`;
78
+  aiIconRef.value.style.bottom = 'auto';
79
+  aiIconRef.value.style.right = 'auto';
98 80
 };
99 81
 
100
-// 鼠标释放事件
101
-const onMouseUp = () => {
82
+// 鼠标释放事件处理函数
83
+const handleMouseUp = () => {
102 84
   isDragging.value = false;
103 85
 };
104 86
 
105
-// 添加和移除全局事件监听器
87
+// 生命周期钩子
106 88
 onMounted(() => {
107
-  document.addEventListener('mousemove', onMouseMove);
108
-  document.addEventListener('mouseup', onMouseUp);
89
+  // 添加全局鼠标事件监听器
90
+  document.addEventListener('mousemove', handleMouseMove);
91
+  document.addEventListener('mouseup', handleMouseUp);
109 92
 });
110 93
 
111 94
 onUnmounted(() => {
112
-  document.removeEventListener('mousemove', onMouseMove);
113
-  document.removeEventListener('mouseup', onMouseUp);
95
+  // 移除全局鼠标事件监听器
96
+  document.removeEventListener('mousemove', handleMouseMove);
97
+  document.removeEventListener('mouseup', handleMouseUp);
114 98
 });
115 99
 </script>
116 100
 
@@ -121,21 +105,18 @@ onUnmounted(() => {
121 105
       ref="aiIconRef"
122 106
       class="ai-icon"
123 107
       @click="handleAIModal"
124
-      @mousedown="onMouseDown"
125
-      :style="{
126
-        left: `${position.x}px`,
127
-        top: `${position.y}px`,
128
-      }"
108
+      @mousedown="handleMouseDown"
129 109
     >
130 110
       <img src="/AIimgs.gif" alt="AI Assistant" />
131 111
     </div>
132
-    <AIModal />
133 112
   </ElConfigProvider>
134 113
 </template>
135 114
 
136 115
 <style scoped lang="scss">
137 116
 .ai-icon {
138 117
   position: fixed;
118
+  bottom: 20px;
119
+  right: 20px;
139 120
   z-index: 9999;
140 121
   width: 100px;
141 122
   height: 100px;
@@ -146,10 +127,6 @@ onUnmounted(() => {
146 127
   justify-content: center;
147 128
   cursor: pointer;
148 129
   user-select: none;
149
-  /* 拖动时的光标样式 */
150
-  &:active {
151
-    cursor: grabbing;
152
-  }
153 130
 }
154 131
 
155 132
 .ai-icon img {

+ 1 - 1
apps/web-ele/src/views/schedule/view/index.vue

@@ -525,7 +525,7 @@ const createWorkOrderDrawerEvent = () => {
525 525
               <ElOption
526 526
                 v-for="item in gasstationlist"
527 527
                 :key="`${item.userId}-${item.stationId}`"
528
-                :label="`${item.nickName}-${item.postName}-${item.stationName}`"
528
+                :label="`${item.nickName}-${item.postName}${item.stationName ? '-' + item.stationName : ''}`"
529 529
                 :value="`${item.userId}-${item.stationId}`"
530 530
               />
531 531
             </ElSelect>

+ 9 - 8
apps/web-ele/src/views/schedule/work/class/config-data.tsx

@@ -1,25 +1,26 @@
1 1
 import type { FormSchemaGetter } from '#/adapter/form';
2 2
 import type { VxeGridProps } from '#/adapter/vxe-table';
3
-import { selectAllSysStationAreaList } from '#/api/system/infoEntry/stationInfo/stationInfo';
3
+// import { selectAllSysStationAreaList } from '#/api/system/infoEntry/stationInfo/stationInfo';
4 4
 // import { queryGasStationList } from '#/api/schedule/index';
5 5
 import { queryrclassesApilist } from '#/api/schedule/work/classes';
6 6
 import { useUserStore } from '@vben/stores';
7 7
 const userStore = useUserStore();
8
-const getstationId = userStore.userInfo?.stations?.[0]?.id;
9
-
10 8
 export const querySchema: FormSchemaGetter = () => {
11 9
   return [
12 10
     {
13
-      component: 'ApiSelect',
11
+      component: 'Select',
14 12
       componentProps: {
15
-        api: selectAllSysStationAreaList,
16
-        labelField: 'stationName',
17
-        valueField: 'id',
13
+        options: (userStore.userInfo?.stations || []).map((item: any) => {
14
+          return {
15
+            label: item.stationName,
16
+            value: item.id,
17
+          };
18
+        }),
18 19
         placeholder: '请选择油站',
19 20
         clearable: true,
20 21
       },
21 22
       fieldName: 'stationName',
22
-      defaultValue: getstationId,
23
+      defaultValue: userStore.userInfo?.stations?.[0]?.id,
23 24
       label: '油站',
24 25
     },
25 26
     {

+ 88 - 47
apps/web-ele/src/views/system/taskDesign/formDesign/index.vue

@@ -39,6 +39,7 @@ import {
39 39
   querysubItembaseApilist,
40 40
   querytagbaseApilist,
41 41
   saveApi,
42
+  queryinspectionItemDetailApi,
42 43
 } from '#/api/system/tasksettings/checktheform';
43 44
 import TinymceEditor from '#/components/tinymce/src/editor.vue';
44 45
 import { getUploadAction } from '#/components/upload/config';
@@ -107,6 +108,18 @@ const init = async () => {
107 108
   await taglistfn();
108 109
 };
109 110
 
111
+const queryinspectionItemDetail = async (id: number) => {
112
+  try {
113
+    const res = await queryinspectionItemDetailApi(id);
114
+    console.log('检查项详情', res);
115
+    // if (res) {
116
+    //   editForm = res;
117
+    // }
118
+  } catch (error) {
119
+    console.error('查询检查项详情失败:', error);
120
+  }
121
+};
122
+
110 123
 // 检测 id 变化
111 124
 watch(
112 125
   () => route.query.id,
@@ -184,7 +197,7 @@ const editForm = reactive({
184 197
   // exampleImagelist: [],
185 198
   // 富文本内容
186 199
   checkDescription: '',
187
-});
200
+}) as any;
188 201
 
189 202
 // 表单验证规则
190 203
 const editFormRules = reactive({
@@ -276,35 +289,21 @@ async function deleteSubItem(subItem: SubItem) {
276 289
 function addCheckItem() {
277 290
   editType.value = 'addcheck';
278 291
   editDrawerVisible.value = true;
279
-  editForm.id = '';
280
-  editForm.name = '';
281 292
   // 关联子项
282 293
   editForm.subItemId = selectedSubItemId.value || '';
283
-  // 检查项名称
284
-  editForm.itemName = '';
285
-  editForm.isRandom = '';
286
-  // 标签
287
-  editForm.tag = [];
288
-  // 输入项
289
-  editForm.hasInput = '';
290
-  editForm.inputContent = '';
291
-  // 拍照
292
-  ishasPhoto.value = false;
293
-  editForm.hasPhoto = '';
294
-  editForm.photoPrompt = '';
295
-  // 检查结果
296
-  editForm.checkResult = '';
297
-  editForm.limitScore = '';
298
-  // 示例图
299
-  editForm.exampleImage = '';
300
-  // editForm.exampleImagelist = [];
301
-  // 富文本内容
302
-  editForm.checkDescription = '';
303 294
 }
304 295
 
305 296
 // 编辑检查项
306
-function editCheckItem(checkItem: any) {
307
-  console.log(checkItem);
297
+async function editCheckItem(checkItem: any) {
298
+  // console.log(checkItem);
299
+  // const aa = "http://192.168.1.33:19000/smart-steward-bucket/comment/20260206/ca63ff81.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=root%2F20260206%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260206T100201Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=99e33fd4c65189bc90e60ca65dad1149f316847d69325484dc6850129427c5d4"
300
+  // console.log(aa.split('?')[0].split('/').slice(-3).join('/'));
301
+  
302
+  try {
303
+    await queryinspectionItemDetail(checkItem.id);
304
+  } catch (error) {
305
+    console.error('查询检查项详情失败:', error);
306
+  }
308 307
   ishasPhoto.value = checkItem?.hasPhoto == '2';
309 308
 
310 309
   editType.value = 'check';
@@ -322,20 +321,26 @@ function editCheckItem(checkItem: any) {
322 321
   editForm.photoPrompt = checkItem?.photoPrompt || '';
323 322
   editForm.checkResult = String(checkItem?.checkResult) || '';
324 323
   editForm.limitScore = checkItem?.limitScore || '';
325
-  // fileList.value = checkItem?.exampleImagelist|| [];
326
-  // fileList.value = checkItem?.exampleImage
327
-  //   .split(',')
328
-  //   .map((item: any, index: number) => {
324
+  // fileList.value = checkItem?.exampleImageUrl.map(
325
+  //   (item: any, index: number) => {
329 326
   //     return {
330
-  //       name: item,
327
+  //       name: item.split('?')[0].split('/').slice(-3).join('/'),
331 328
   //       response: {
332
-  //         fileName: item,
333
-  //         url: item,
329
+  //         code: 200,
330
+  //         data: {
331
+  //           fileName: item.split('?')[0].split('/').slice(-3).join('/'),
332
+  //           url: item,
333
+  //         },
334
+  //         msg: '操作成功',
334 335
   //       },
336
+  //       url: item,
335 337
   //       status: 'success',
336 338
   //       uid: index + Math.random().toString(36).substring(2),
337 339
   //     };
338
-  //   });
340
+  //   },
341
+  // );
342
+  // console.log(fileList.value);
343
+  
339 344
   editForm.checkDescription = checkItem?.checkDescription || '';
340 345
 }
341 346
 
@@ -347,7 +352,7 @@ function saveEdit() {
347 352
       switch (editType.value) {
348 353
         case 'addcheck': {
349 354
           // console.log(editForm);
350
-          // console.log(fileList.value);
355
+          console.log(fileList.value);
351 356
           // 新增检查项
352 357
           try {
353 358
             await addinspectionItemApi({
@@ -433,7 +438,7 @@ function saveEdit() {
433 438
         case 'sub': {
434 439
           // 编辑子项
435 440
           const index = subItems.value.findIndex(
436
-            (item) => item.id === editForm.id,
441
+            (item: any) => item.id === editForm.id,
437 442
           );
438 443
           if (index !== -1) {
439 444
             try {
@@ -528,10 +533,10 @@ async function onDrop(
528 533
 
529 534
     // 找到被拖拽元素和目标元素的索引(确保id类型一致)
530 535
     const draggedIndex = items.findIndex(
531
-      (item) => String(item.id) === String(itemId),
536
+      (item: any) => String(item.id) === String(itemId),
532 537
     );
533 538
     const targetIndex = items.findIndex(
534
-      (item) => String(item.id) === String(targetItem.id),
539
+      (item: any) => String(item.id) === String(targetItem.id),
535 540
     );
536 541
 
537 542
     if (draggedIndex === -1 || targetIndex === -1) {
@@ -548,7 +553,7 @@ async function onDrop(
548 553
     items.splice(targetIndex, 0, draggedItem);
549 554
 
550 555
     // 更新所有元素的order属性
551
-    items.forEach((item, index) => {
556
+    items.forEach((item: any, index: any) => {
552 557
       item.order = index + 1;
553 558
     });
554 559
 
@@ -558,7 +563,7 @@ async function onDrop(
558 563
       '到',
559 564
       targetItem.id,
560 565
       '新顺序:',
561
-      items.map((item) => ({
566
+      items.map((item: any) => ({
562 567
         id: item.id,
563 568
         name: item.name,
564 569
         order: item.order,
@@ -567,7 +572,7 @@ async function onDrop(
567 572
 
568 573
     // 保存排序结果到后端(只处理子项)
569 574
     if (type === 'sub') {
570
-      const updatePromises = items.map(async (item) => {
575
+      const updatePromises = items.map(async (item: any) => {
571 576
         try {
572 577
           await editSubItemApi({
573 578
             id: item.id,
@@ -582,7 +587,7 @@ async function onDrop(
582 587
       await Promise.all(updatePromises);
583 588
       await querysubItemlist();
584 589
     } else {
585
-      checkItems.value = items.map((item) => {
590
+      checkItems.value = items.map((item: any) => {
586 591
         return {
587 592
           ...item,
588 593
           sortOrder: item.order,
@@ -601,12 +606,13 @@ const fileList = ref([]) as any;
601 606
 const dialogImageUrl = ref('');
602 607
 const dialogVisible = ref(false);
603 608
 
604
-const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
609
+const handleRemove = (uploadFile: any, uploadFiles: any) => {
605 610
   console.log(uploadFile, uploadFiles);
606 611
 };
607 612
 
608
-const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
609
-  dialogImageUrl.value = uploadFile.url!;
613
+const handlePictureCardPreview = (uploadFile: any) => {
614
+  console.log(uploadFile);
615
+  dialogImageUrl.value = uploadFile.url;
610 616
   dialogVisible.value = true;
611 617
 };
612 618
 // 抽屉打开后处理函数
@@ -618,6 +624,39 @@ function handleDrawerOpen() {
618 624
     drawerContent.scrollTop = 0;
619 625
   }
620 626
 }
627
+const closeEditDrawer = () => {
628
+  console.log('关闭了');
629
+  editForm.id = '';
630
+  editForm.name = '';
631
+  // 关联子项
632
+  editForm.subItemId = '';
633
+  // 检查项名称
634
+  editForm.itemName = '';
635
+  editForm.isRandom = '';
636
+  // 标签
637
+  editForm.tag = [];
638
+  // 输入项
639
+  editForm.hasInput = '';
640
+  editForm.inputContent = '';
641
+  // 拍照
642
+  ishasPhoto.value = false;
643
+  editForm.hasPhoto = '';
644
+  editForm.photoPrompt = '';
645
+  // 检查结果
646
+  editForm.checkResult = '';
647
+  editForm.limitScore = '';
648
+  // 示例图
649
+  editForm.exampleImage = '';
650
+  // editForm.exampleImagelist = [];
651
+  // 富文本内容
652
+  editForm.checkDescription = '';
653
+  fileList.value = [];
654
+};
655
+
656
+const handleUpload = ()=>{
657
+  console.log(fileList.value);
658
+  
659
+}
621 660
 </script>
622 661
 
623 662
 <template>
@@ -801,8 +840,9 @@ function handleDrawerOpen() {
801 840
                 ? '新增检查项'
802 841
                 : ''
803 842
       "
804
-      size="600px"
843
+      size="700px"
805 844
       direction="rtl"
845
+      @close="closeEditDrawer"
806 846
     >
807 847
       <ElForm
808 848
         ref="editFormRef"
@@ -941,7 +981,7 @@ function handleDrawerOpen() {
941 981
             <el-checkbox
942 982
               v-model="ishasPhoto"
943 983
               @change="
944
-                (val) => {
984
+                (val: any) => {
945 985
                   val === true ? (editForm.hasPhoto = '1') : '';
946 986
                 }
947 987
               "
@@ -984,7 +1024,7 @@ function handleDrawerOpen() {
984 1024
           v-if="editType === 'addcheck' || editType === 'check'"
985 1025
           label="示例图"
986 1026
         >
987
-          <el-icon style="font-size: 16px"><QuestionFilled /></el-icon>
1027
+          <!-- <el-icon style="font-size: 16px;"><QuestionFilled /></el-icon> -->
988 1028
 
989 1029
           <el-upload
990 1030
             v-model:file-list="fileList"
@@ -994,6 +1034,7 @@ function handleDrawerOpen() {
994 1034
             list-type="picture-card"
995 1035
             :on-preview="handlePictureCardPreview"
996 1036
             :on-remove="handleRemove"
1037
+            :on-success="handleUpload"
997 1038
             :disabled="fileList.length >= 3"
998 1039
           >
999 1040
             <template #default>

+ 0 - 1
apps/web-ele/src/views/system/taskDesign/taskTemplate/index.vue

@@ -125,7 +125,6 @@ async function handleView(row: any) {
125 125
 async function handleEdit(row: any) {
126 126
   try {
127 127
     const res = await xiangqigApi(row.id);
128
-    console.log(res);
129 128
     drawerApi
130 129
       .setData({
131 130
         ...res,

+ 24 - 9
apps/web-ele/src/views/system/taskDesign/taskTemplate/taskTemplate-data.tsx

@@ -318,6 +318,15 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
318 318
   },
319 319
   {
320 320
     component: 'Input',
321
+    dependencies: {
322
+      show: () => false,
323
+      triggerFields: [''],
324
+    },
325
+    fieldName: 'isUpdate',
326
+    formItemClass: 'col-span-2 items-baseline',
327
+  },
328
+  {
329
+    component: 'Input',
321 330
     fieldName: 'executePosition',
322 331
     dependencies: {
323 332
       show: () => false,
@@ -378,10 +387,13 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
378 387
     component: 'Select',
379 388
     fieldName: 'taskType',
380 389
     label: '任务类型',
381
-    componentProps: {
382
-      placeholder: '请选择任务类型',
383
-      options: getTaskTypeOptions(),
384
-      clearable: true,
390
+    componentProps: (data: any) => {
391
+      return {
392
+        placeholder: '请选择任务类型',
393
+        options: getTaskTypeOptions(),
394
+        clearable: true,
395
+        disabled: data.isUpdate,
396
+      };
385 397
     },
386 398
     rules: 'required',
387 399
     formItemClass: 'col-span-2 items-baseline',
@@ -429,10 +441,13 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
429 441
     component: 'Select',
430 442
     fieldName: 'formType',
431 443
     label: '表单类型',
432
-    componentProps: {
433
-      placeholder: '请选择表单类型',
434
-      options: getFormTypeOptions(),
435
-      clearable: true,
444
+    componentProps: (data: any) => {
445
+      return {
446
+        placeholder: '请选择表单类型',
447
+        options: getFormTypeOptions(),
448
+        clearable: true,
449
+        disabled: data.isUpdate,
450
+      };
436 451
     },
437 452
     rules: 'required',
438 453
     formItemClass: 'col-span-2 items-baseline',
@@ -668,7 +683,7 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
668 683
     fieldName: 'endTimeHour',
669 684
     label: '时',
670 685
     dependencies: {
671
-      disabled: (values) =>
686
+      disabled: (values: any) =>
672 687
         Array.isArray(values.endoftheperiod) &&
673 688
         values.endoftheperiod.length > 0,
674 689
       triggerFields: ['endoftheperiod'],

+ 3 - 1
apps/web-ele/src/views/system/taskDesign/taskTemplate/taskTemplate-drawer.vue

@@ -28,7 +28,7 @@ const isCopyRef = ref<boolean>(false);
28 28
 const attachments = ref<any[]>([]);
29 29
 const selectAllSysStationList = ref([]) as any;
30 30
 onMounted(async () => {
31
-  const res = await selectAllSysStation();
31
+  const res = await selectAllSysStation({});
32 32
   selectAllSysStationList.value = res || [];
33 33
   if (selectAllSysStationList.value.length > 0) {
34 34
     selectAllSysStationList.value.forEach((item: any) => {
@@ -318,6 +318,8 @@ const [Drawer, drawerApi] = useVbenDrawer({
318 318
         const formValues = await formApi.getValues();
319 319
         taskFrequency.value = formValues.taskFrequency || '';
320 320
       } else {
321
+        // 新增模式,设置isUpdate为false
322
+        await formApi.setValues({ isUpdate: false });
321 323
         const formValues = await formApi.getValues();
322 324
         taskFrequency.value = formValues.taskFrequency || '';
323 325
       }