闪电 3 周之前
父節點
當前提交
52de656d19

+ 7 - 2
apps/web-ele/src/api/system/user/user.ts

12
 import { requestClient } from '#/api/request';
12
 import { requestClient } from '#/api/request';
13
 
13
 
14
 enum Api {
14
 enum Api {
15
-  allUserList = '/system/user/stationList',
15
+  allUserList = '/system/user/allList',
16
   baseUser = '/system/user',
16
   baseUser = '/system/user',
17
   downLoadTemplate = '/system/user/importTemplate',
17
   downLoadTemplate = '/system/user/importTemplate',
18
   exportUser = '/system/user/export',
18
   exportUser = '/system/user/export',
19
   menuList = '/system/user/list',
19
   menuList = '/system/user/list',
20
   modifyPwd = '/system/user/resetPwd',
20
   modifyPwd = '/system/user/resetPwd',
21
+  stationUserList = '/system/user/stationList',
21
   updateAvatar = '/system/user/profile/avatar',
22
   updateAvatar = '/system/user/profile/avatar',
22
   updateProfilePwd = '/system/user/profile/updatePwd',
23
   updateProfilePwd = '/system/user/profile/updatePwd',
23
   updateUser = '/system/user/changeStatus',
24
   updateUser = '/system/user/changeStatus',
36
 }
37
 }
37
 
38
 
38
 export function getAllUserList(params?: any) {
39
 export function getAllUserList(params?: any) {
39
-  return requestClient.get<BaseResult<User[]>>(Api.allUserList, {
40
+  return requestClient.get<BaseResult<User[]>>(Api.stationUserList, {
40
     params,
41
     params,
41
   });
42
   });
42
 }
43
 }
43
 
44
 
45
+export function getList(params?: any) {
46
+  return requestClient.get<BaseResult<User[]>>(Api.allUserList, { params });
47
+}
48
+
44
 // 用户列表接口
49
 // 用户列表接口
45
 export function getUserList(params?: any) {
50
 export function getUserList(params?: any) {
46
   return requestClient.get<BaseResult<User[]>>(Api.menuList, { params });
51
   return requestClient.get<BaseResult<User[]>>(Api.menuList, { params });

+ 1 - 1
apps/web-ele/src/api/task/index.ts

8
   groupLogBase = '/formTeamShiftLog/log/handle',
8
   groupLogBase = '/formTeamShiftLog/log/handle',
9
   gunCheckHeightHandle = '/formGunSelfCheck/check/height/handle',
9
   gunCheckHeightHandle = '/formGunSelfCheck/check/height/handle',
10
   handleGunCheck = '/formGunSelfCheck/check/handle',
10
   handleGunCheck = '/formGunSelfCheck/check/handle',
11
-  joinEmergencyHandle = '/formEmergencyDrillParticipation/participation/handle',
11
+  joinEmergencyHandle = '/formParticipationRecord/record/handle',
12
   marketingSurveyHandle = '/formCompetitorMarketingSurvey/survey/handle',
12
   marketingSurveyHandle = '/formCompetitorMarketingSurvey/survey/handle',
13
   meetingBase = '/formMeetingRecords/records/handle',
13
   meetingBase = '/formMeetingRecords/records/handle',
14
   operationalWeeklyReportHandle = '/formOperationalWeeklyReport/report/handle',
14
   operationalWeeklyReportHandle = '/formOperationalWeeklyReport/report/handle',

+ 6 - 6
apps/web-ele/src/components/selectUsers/src/index.vue

25
 // API导入 - 按模块分组
25
 // API导入 - 按模块分组
26
 // 用户相关API
26
 // 用户相关API
27
 // @ts-ignore
27
 // @ts-ignore
28
-import { getAllUserList, selectUserList } from '#/api/system/user/user';
28
+import { getList, selectUserList } from '#/api/system/user/user';
29
 
29
 
30
 // 定义组件属性
30
 // 定义组件属性
31
 interface Props {
31
 interface Props {
244
       params = { ...params, ...props.userParams };
244
       params = { ...params, ...props.userParams };
245
     }
245
     }
246
 
246
 
247
-    const res: any = await getAllUserList(params);
247
+    const res: any = await getList(params);
248
     allUserList.value = res || [];
248
     allUserList.value = res || [];
249
   } catch (error_) {
249
   } catch (error_) {
250
     error.value = '加载用户列表失败';
250
     error.value = '加载用户列表失败';
287
       const existingIndex = newSelectedItems.findIndex((item) => {
287
       const existingIndex = newSelectedItems.findIndex((item) => {
288
         return item.id === user.userId && item.type === 'user';
288
         return item.id === user.userId && item.type === 'user';
289
       });
289
       });
290
-      
290
+
291
       if (existingIndex === -1) {
291
       if (existingIndex === -1) {
292
         newSelectedItems.push({
292
         newSelectedItems.push({
293
           id: user.userId,
293
           id: user.userId,
310
         const existingIndex = newSelectedItems.findIndex((item) => {
310
         const existingIndex = newSelectedItems.findIndex((item) => {
311
           return item.id === postId && item.type === 'post';
311
           return item.id === postId && item.type === 'post';
312
         });
312
         });
313
-        
313
+
314
         if (existingIndex === -1) {
314
         if (existingIndex === -1) {
315
           newSelectedItems.push({
315
           newSelectedItems.push({
316
             id: postId,
316
             id: postId,
332
         const existingIndex = newSelectedItems.findIndex((item) => {
332
         const existingIndex = newSelectedItems.findIndex((item) => {
333
           return item.id === roleId && item.type === 'role';
333
           return item.id === roleId && item.type === 'role';
334
         });
334
         });
335
-        
335
+
336
         if (existingIndex === -1) {
336
         if (existingIndex === -1) {
337
           newSelectedItems.push({
337
           newSelectedItems.push({
338
             id: roleId,
338
             id: roleId,
354
         const existingIndex = newSelectedItems.findIndex((item) => {
354
         const existingIndex = newSelectedItems.findIndex((item) => {
355
           return item.id === stationId && item.type === 'station';
355
           return item.id === stationId && item.type === 'station';
356
         });
356
         });
357
-        
357
+
358
         if (existingIndex === -1) {
358
         if (existingIndex === -1) {
359
           newSelectedItems.push({
359
           newSelectedItems.push({
360
             id: stationId,
360
             id: stationId,

+ 5 - 6
apps/web-ele/src/store/auth.ts

41
         // 获取用户信息并存储到 accessStore 中
41
         // 获取用户信息并存储到 accessStore 中
42
         userInfo = await fetchUserInfo();
42
         userInfo = await fetchUserInfo();
43
         userStore.setUserInfo(userInfo);
43
         userStore.setUserInfo(userInfo);
44
-        console.log(userInfo);
45
-        
44
+
46
         /**
45
         /**
47
          * 在这里设置权限
46
          * 在这里设置权限
48
          */
47
          */
49
-        console.log(userInfo.buttons);
50
         accessStore.setAccessCodes(userInfo.buttons);
48
         accessStore.setAccessCodes(userInfo.buttons);
51
         if (accessStore.loginExpired) {
49
         if (accessStore.loginExpired) {
52
           accessStore.setLoginExpired(false);
50
           accessStore.setLoginExpired(false);
95
         userInfo = await fetchUserInfo();
93
         userInfo = await fetchUserInfo();
96
         userStore.setUserInfo(userInfo);
94
         userStore.setUserInfo(userInfo);
97
         console.log(userInfo);
95
         console.log(userInfo);
98
-        
96
+
99
         /**
97
         /**
100
          * 在这里设置权限
98
          * 在这里设置权限
101
          */
99
          */
152
     if (!backUserInfo) {
150
     if (!backUserInfo) {
153
       throw new Error('获取用户信息失败.');
151
       throw new Error('获取用户信息失败.');
154
     }
152
     }
155
-    const { buttons = [], roles = [], user } = backUserInfo;
153
+    const { buttons = [], roles = [], user = {} } = backUserInfo;
156
     /**
154
     /**
157
      * 从后台user -> vben user转换
155
      * 从后台user -> vben user转换
158
      */
156
      */
164
       userId: user.userId.toString(),
162
       userId: user.userId.toString(),
165
       username: user.userName,
163
       username: user.userName,
166
       phoneNumber: user.phonenumber,
164
       phoneNumber: user.phonenumber,
165
+      post: user.post,
167
       // @ts-ignore
166
       // @ts-ignore
168
       stations: user.stations || [],
167
       stations: user.stations || [],
169
     };
168
     };
170
     console.log(userInfo);
169
     console.log(userInfo);
171
-    
170
+
172
     userStore.setUserInfo(userInfo);
171
     userStore.setUserInfo(userInfo);
173
     return userInfo;
172
     return userInfo;
174
   }
173
   }

+ 4 - 0
apps/web-ele/src/views/examManage/paperManage/index.vue

232
   width: 800,
232
   width: 800,
233
   height: 600,
233
   height: 600,
234
   showCancelBtn: false,
234
   showCancelBtn: false,
235
+  onConfirm: () => {
236
+    // 预览试卷
237
+    previewModalApi.close();
238
+  },
235
 });
239
 });
236
 
240
 
237
 const previewExam = (row: any) => {
241
 const previewExam = (row: any) => {

+ 2 - 3
apps/web-ele/src/views/oilstation/gasgun/gasgun-data.tsx

116
     rules: 'required',
116
     rules: 'required',
117
   },
117
   },
118
   {
118
   {
119
-    component: 'Select',
119
+    component: 'Input',
120
     fieldName: 'gunNo',
120
     fieldName: 'gunNo',
121
     label: '油枪编号',
121
     label: '油枪编号',
122
     componentProps: {
122
     componentProps: {
123
-      placeholder: '请选择油枪编号',
124
-      options: getDictOptions('oil_gun'),
123
+      placeholder: '请输入油枪编号',
125
     },
124
     },
126
     rules: 'required',
125
     rules: 'required',
127
   },
126
   },

+ 9 - 8
apps/web-ele/src/views/schedule/detail/drawer/joinEmergency/index.vue

8
 
8
 
9
 // @ts-ignore
9
 // @ts-ignore
10
 // 这里需要替换为实际的API,如果没有可以先注释
10
 // 这里需要替换为实际的API,如果没有可以先注释
11
-import { handleAttendanceMeeting, handleJoinEmergency } from '#/api/task';
11
+import { handleJoinEmergency } from '#/api/task';
12
 
12
 
13
 // @ts-ignore
13
 // @ts-ignore
14
 import { drawerFormSchema } from './config-data';
14
 import { drawerFormSchema } from './config-data';
78
       };
78
       };
79
 
79
 
80
       // 调用API提交数据
80
       // 调用API提交数据
81
-      if (taskParams.value.subFormType === 'participate_emergency_wy') {
82
-        await handleJoinEmergency(params);
83
-      } else if (
84
-        taskParams.value.subFormType === 'participate_oil_station_meeting'
85
-      ) {
86
-        await handleAttendanceMeeting(params);
87
-      }
81
+      // if (taskParams.value.subFormType === 'participate_emergency_wy') {
82
+      //   await handleJoinEmergency(params);
83
+      // } else if (
84
+      //   taskParams.value.subFormType === 'participate_oil_station_meeting'
85
+      // ) {
86
+      //   await handleAttendanceMeeting(params);
87
+      // }
88
+      await handleJoinEmergency(params);
88
 
89
 
89
       // 触发刷新事件
90
       // 触发刷新事件
90
       emit('reload');
91
       emit('reload');

+ 35 - 22
apps/web-ele/src/views/schedule/detail/index.vue

249
   return taskInfo.value.executorId === Number(userStore.userInfo?.userId);
249
   return taskInfo.value.executorId === Number(userStore.userInfo?.userId);
250
 });
250
 });
251
 
251
 
252
+const buttons = ref({
253
+  deal: false,
254
+  transfer: false,
255
+  close: false,
256
+});
257
+
252
 const init = async () => {
258
 const init = async () => {
253
   const res = await getTaskDetail(taskId.value);
259
   const res = await getTaskDetail(taskId.value);
254
   taskInfo.value = res;
260
   taskInfo.value = res;
255
   if (!taskInfo.value.status) {
261
   if (!taskInfo.value.status) {
256
     taskInfo.value.status = 0;
262
     taskInfo.value.status = 0;
257
   }
263
   }
264
+  if (taskInfo.value.status === 1) {
265
+    const userId = Number(userStore.userInfo?.userId);
266
+    const isExecutor = taskInfo.value.executorId === userId;
267
+    const isCreator = userStore?.userInfo?.username === taskInfo.value.createBy;
268
+    const isHeadquarters = userStore?.userInfo?.post?.type === '"headquarters"';
269
+    const isMobileTask = mobileTaskTypes.includes(taskInfo.value.formType);
270
+
271
+    if (isExecutor && !isMobileTask) {
272
+      buttons.value.deal = true;
273
+    }
274
+
275
+    if (isCreator || isHeadquarters || isExecutor) {
276
+      if (taskInfo.value.executorId !== userId) {
277
+        buttons.value.close = true;
278
+      }
279
+
280
+      if (taskInfo.value.taskTemplate?.isMust === 0) {
281
+        buttons.value.close = true;
282
+      }
283
+
284
+      if (taskInfo.value.authStatus === 0 && taskInfo.value.isLicensable) {
285
+        buttons.value.transfer = true;
286
+      }
287
+    }
288
+  }
258
 
289
 
259
   taskOther.value.taskTypeName = taskInfo.value?.formTypeName || '-';
290
   taskOther.value.taskTypeName = taskInfo.value?.formTypeName || '-';
260
 
291
 
587
           </div>
618
           </div>
588
         </div>
619
         </div>
589
         <div class="flex items-center space-x-4">
620
         <div class="flex items-center space-x-4">
590
-          <ElButton
591
-            v-if="
592
-              oneSelf &&
593
-              [1].includes(taskInfo.status) &&
594
-              !mobileTaskTypes.includes(taskInfo.formType)
595
-            "
596
-            type="danger"
597
-            @click="dealEvent"
598
-          >
621
+          <ElButton v-if="buttons.deal" type="primary" @click="dealEvent">
599
             处理任务
622
             处理任务
600
           </ElButton>
623
           </ElButton>
601
           <ElButton
624
           <ElButton
602
             type="primary"
625
             type="primary"
603
-            v-if="
604
-              oneSelf && [1].includes(taskInfo.status) && taskInfo.isLicensable
605
-            "
626
+            v-if="buttons.transfer"
606
             @click="handleTransferTask"
627
             @click="handleTransferTask"
607
           >
628
           >
608
             转交任务
629
             转交任务
609
           </ElButton>
630
           </ElButton>
610
-          <ElButton
611
-            v-if="
612
-              oneSelf &&
613
-              [1].includes(taskInfo.status) &&
614
-              (taskInfo.level < 2 || !taskInfo.taskTemplate?.isMust)
615
-            "
616
-            type="danger"
617
-            @click="handleCloseTask"
618
-          >
631
+          <ElButton v-if="buttons.close" type="danger" @click="handleCloseTask">
619
             关闭任务
632
             关闭任务
620
           </ElButton>
633
           </ElButton>
621
         </div>
634
         </div>
674
             </ElDescriptionsItem>
687
             </ElDescriptionsItem>
675
 
688
 
676
             <ElDescriptionsItem label="任务描述:" :span="4">
689
             <ElDescriptionsItem label="任务描述:" :span="4">
677
-              {{ taskInfo.description || '-' }}
690
+              <div v-html="taskInfo.description"></div>
678
             </ElDescriptionsItem>
691
             </ElDescriptionsItem>
679
             <ElDescriptionsItem
692
             <ElDescriptionsItem
680
               v-if="
693
               v-if="

+ 1 - 0
packages/stores/src/modules/user.ts

6
    * 头像
6
    * 头像
7
    */
7
    */
8
   avatar: string;
8
   avatar: string;
9
+  post?: any;
9
   /**
10
   /**
10
    * 用户昵称
11
    * 用户昵称
11
    */
12
    */