闪电 преди 3 седмици
родител
ревизия
52de656d19

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

@@ -12,12 +12,13 @@ import { commonExport, ContentTypeEnum } from '#/api/helper';
12 12
 import { requestClient } from '#/api/request';
13 13
 
14 14
 enum Api {
15
-  allUserList = '/system/user/stationList',
15
+  allUserList = '/system/user/allList',
16 16
   baseUser = '/system/user',
17 17
   downLoadTemplate = '/system/user/importTemplate',
18 18
   exportUser = '/system/user/export',
19 19
   menuList = '/system/user/list',
20 20
   modifyPwd = '/system/user/resetPwd',
21
+  stationUserList = '/system/user/stationList',
21 22
   updateAvatar = '/system/user/profile/avatar',
22 23
   updateProfilePwd = '/system/user/profile/updatePwd',
23 24
   updateUser = '/system/user/changeStatus',
@@ -36,11 +37,15 @@ export function getStationUserCount(stationId: number) {
36 37
 }
37 38
 
38 39
 export function getAllUserList(params?: any) {
39
-  return requestClient.get<BaseResult<User[]>>(Api.allUserList, {
40
+  return requestClient.get<BaseResult<User[]>>(Api.stationUserList, {
40 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 50
 export function getUserList(params?: any) {
46 51
   return requestClient.get<BaseResult<User[]>>(Api.menuList, { params });

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

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

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

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

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

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

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

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

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

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

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

@@ -8,7 +8,7 @@ import { useVbenDrawer, useVbenForm } from '@vben/common-ui';
8 8
 
9 9
 // @ts-ignore
10 10
 // 这里需要替换为实际的API,如果没有可以先注释
11
-import { handleAttendanceMeeting, handleJoinEmergency } from '#/api/task';
11
+import { handleJoinEmergency } from '#/api/task';
12 12
 
13 13
 // @ts-ignore
14 14
 import { drawerFormSchema } from './config-data';
@@ -78,13 +78,14 @@ const [Drawer, drawerApi] = useVbenDrawer({
78 78
       };
79 79
 
80 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 91
       emit('reload');

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

@@ -249,12 +249,43 @@ const oneSelf = computed(() => {
249 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 258
 const init = async () => {
253 259
   const res = await getTaskDetail(taskId.value);
254 260
   taskInfo.value = res;
255 261
   if (!taskInfo.value.status) {
256 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 290
   taskOther.value.taskTypeName = taskInfo.value?.formTypeName || '-';
260 291
 
@@ -587,35 +618,17 @@ onMounted(async () => {
587 618
           </div>
588 619
         </div>
589 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 623
           </ElButton>
601 624
           <ElButton
602 625
             type="primary"
603
-            v-if="
604
-              oneSelf && [1].includes(taskInfo.status) && taskInfo.isLicensable
605
-            "
626
+            v-if="buttons.transfer"
606 627
             @click="handleTransferTask"
607 628
           >
608 629
             转交任务
609 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 633
           </ElButton>
621 634
         </div>
@@ -674,7 +687,7 @@ onMounted(async () => {
674 687
             </ElDescriptionsItem>
675 688
 
676 689
             <ElDescriptionsItem label="任务描述:" :span="4">
677
-              {{ taskInfo.description || '-' }}
690
+              <div v-html="taskInfo.description"></div>
678 691
             </ElDescriptionsItem>
679 692
             <ElDescriptionsItem
680 693
               v-if="

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

@@ -6,6 +6,7 @@ interface BasicUserInfo {
6 6
    * 头像
7 7
    */
8 8
   avatar: string;
9
+  post?: any;
9 10
   /**
10 11
    * 用户昵称
11 12
    */