chenxiaochao vor 2 Wochen
Ursprung
Commit
6a5ea941e0

+ 1 - 1
apps/web-ele/src/components/knowledgemain/index.vue

@@ -37,7 +37,7 @@ const chapterData = ref([]) as any;
37 37
 const chapterDataloading = ref(false);
38 38
 const centerloading = ref(false);
39 39
 const isEdit = ref(false);
40
-const ChapterId = ref(null);
40
+const ChapterId = ref(null) as any;
41 41
 const KnowledgeDetails = ref({}) as any;
42 42
 // 查询章节数据
43 43
 const chapterDatafn = async ({ initContentId }: any) => {

+ 3 - 3
apps/web-ele/src/views/knowledge/type/create.vue

@@ -513,7 +513,7 @@ const closeForm = () => {
513 513
   .icon-list {
514 514
     display: flex;
515 515
     flex-wrap: wrap;
516
-    gap: 16px;
516
+    gap: 6px;
517 517
   }
518 518
 
519 519
   .icon-item {
@@ -521,8 +521,8 @@ const closeForm = () => {
521 521
     flex-direction: column;
522 522
     align-items: center;
523 523
     justify-content: center;
524
-    width: 80px;
525
-    height: 80px;
524
+    width: 50px;
525
+    height: 50px;
526 526
     cursor: pointer;
527 527
     border: 2px solid transparent;
528 528
     border-radius: 6px;

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

@@ -205,6 +205,8 @@ const queryGasStationListfn = async () => {
205 205
   // mainloing.value = true;
206 206
   try {
207 207
     const res = await queryGasStationList({});
208
+    console.log('油站列表', res);
209
+
208 210
     gasstationlist.value = res || [];
209 211
   } catch (error) {
210 212
     console.log(error);
@@ -263,9 +265,16 @@ const handleCreateVisitorTask = async (formData: any) => {
263 265
   }
264 266
 };
265 267
 onMounted(() => {
268
+  console.log('个人信息', userStore.userInfo);
269
+
266 270
   queryGasStationListfn().then(() => {
267
-    if (userStore.userInfo?.stations?.length) {
271
+    if (userStore.userInfo?.stations?.length > 0) {
268 272
       searchParams.value.station = `${userStore.userInfo?.userId}-${userStore.userInfo?.stations[0]?.id}`;
273
+    } else {
274
+      searchParams.value.station =
275
+        gasstationlist.value[0]?.userId +
276
+        '-' +
277
+        gasstationlist.value[0]?.stationId;
269 278
     }
270 279
 
271 280
     queryCurrentViewData(
@@ -533,7 +542,7 @@ const createWorkOrderDrawerEvent = () => {
533 542
               <ElOption
534 543
                 v-for="item in gasstationlist"
535 544
                 :key="`${item.userId}-${item.stationId}`"
536
-                :label="`${item.nickName}-${item.postName}${item.stationName ? `-${item.stationName}` : ''}`"
545
+                :label="`${item.nickName}${item.postName ? `-${item.postName}` : ''}${userStore.userInfo?.stations?.length > 0 && item.stationName ? `-${item.stationName}` : ''}`"
537 546
                 :value="`${item.userId}-${item.stationId || 0}`"
538 547
               />
539 548
             </ElSelect>

+ 6 - 0
apps/web-ele/src/views/schedule/work/class/component/addandedit.vue

@@ -334,6 +334,7 @@ const calculateDuration = (startTime: string, endTime: string): number => {
334 334
               <el-table-column
335 335
                 prop="firstStartTime"
336 336
                 label="上班时间"
337
+                width="150"
337 338
                 align="center"
338 339
               >
339 340
                 <template #default="scope">
@@ -350,6 +351,7 @@ const calculateDuration = (startTime: string, endTime: string): number => {
350 351
               <el-table-column
351 352
                 prop="firstEndTime"
352 353
                 label="下班时间"
354
+                width="150"
353 355
                 align="center"
354 356
               >
355 357
                 <template #default="scope">
@@ -376,6 +378,7 @@ const calculateDuration = (startTime: string, endTime: string): number => {
376 378
               <el-table-column
377 379
                 prop="firstWorkContent"
378 380
                 label="上班内容"
381
+                width="150"
379 382
                 align="center"
380 383
               >
381 384
                 <template #default="scope">
@@ -397,6 +400,7 @@ const calculateDuration = (startTime: string, endTime: string): number => {
397 400
             <el-table-column label="第二次" align="center">
398 401
               <el-table-column
399 402
                 prop="secondStartTime"
403
+                width="150"
400 404
                 label="上班时间"
401 405
                 align="center"
402 406
               >
@@ -413,6 +417,7 @@ const calculateDuration = (startTime: string, endTime: string): number => {
413 417
               </el-table-column>
414 418
               <el-table-column
415 419
                 prop="secondEndTime"
420
+                width="150"
416 421
                 label="下班时间"
417 422
                 align="center"
418 423
               >
@@ -439,6 +444,7 @@ const calculateDuration = (startTime: string, endTime: string): number => {
439 444
               </el-table-column>
440 445
               <el-table-column
441 446
                 prop="secondWorkContent"
447
+                width="150"
442 448
                 label="上班内容"
443 449
                 align="center"
444 450
               >

+ 12 - 3
apps/web-ele/src/views/schedule/work/class/index.vue

@@ -146,10 +146,13 @@ const handleViewClick = (data: any) => {
146 146
 watch(
147 147
   () => router.currentRoute.value.path,
148 148
   (newPath, oldPath) => {
149
-    if (newPath === '/schedule/work/class' && oldPath === '/schedule/work/class/addandedit') {
149
+    if (
150
+      newPath === '/schedule/work/class' &&
151
+      oldPath === '/schedule/work/class/addandedit'
152
+    ) {
150 153
       BasicTableApi.reload();
151 154
     }
152
-  }
155
+  },
153 156
 );
154 157
 </script>
155 158
 <template>
@@ -157,7 +160,13 @@ watch(
157 160
     <BasicTable table-title="如每月8日后需调整上月数据,请联系系统管理员">
158 161
       <template #toolbar-tools>
159 162
         <el-space>
160
-          <el-button type="primary" @click="handleAddClick"> 开班 </el-button>
163
+          <el-button
164
+            type="primary"
165
+            @click="handleAddClick"
166
+            v-access:code="['work:class:openaclass']"
167
+          >
168
+            开班
169
+          </el-button>
161 170
         </el-space>
162 171
       </template>
163 172
       <template #action="{ row }">

+ 18 - 3
apps/web-ele/src/views/schedule/work/classes/index.vue

@@ -166,7 +166,11 @@ const deletebtn = async (row: any) => {
166 166
           />
167 167
         </div>
168 168
         <div>
169
-          <el-button type="primary" @click="handleAddClick">添加</el-button
169
+          <el-button
170
+            type="primary"
171
+            @click="handleAddClick"
172
+            v-access:code="['work:classes:add']"
173
+            >添加</el-button
170 174
           ><el-button type="primary" @click="handleSearchClick">搜索</el-button
171 175
           ><el-button type="primary" @click="handleResetClick">重置</el-button>
172 176
         </div>
@@ -174,10 +178,21 @@ const deletebtn = async (row: any) => {
174 178
     </template>
175 179
     <BasicTable>
176 180
       <template #action="{ row }">
177
-        <el-button size="small" type="primary" plain @click="editbtn(row)"
181
+        <el-button
182
+          size="small"
183
+          type="primary"
184
+          plain
185
+          @click="editbtn(row)"
186
+          v-access:code="['work:classes:edit']"
178 187
           >编辑</el-button
179 188
         >
180
-        <el-button size="small" plain @click="deletebtn(row)">删除</el-button>
189
+        <el-button
190
+          size="small"
191
+          plain
192
+          @click="deletebtn(row)"
193
+          v-access:code="['work:classes:remove']"
194
+          >删除</el-button
195
+        >
181 196
       </template>
182 197
       <template #isCommon="{ row }">
183 198
         {{ row.isCommon == '0' ? '否' : '是' }}

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

@@ -114,6 +114,7 @@ async function handleView(row: any) {
114 114
         level: String(res.level),
115 115
         repel: Number(res.repel),
116 116
         isCycleEnd: res?.isCycleEnd === 1 ? [true] : [],
117
+        standardGuidelineName: `${res?.knowledgeCategoryDetails.name || ''}/${res?.knowledgeContentDetails.title || ''}`,
117 118
       })
118 119
       .open();
119 120
   } catch (error) {
@@ -142,6 +143,7 @@ async function handleEdit(row: any) {
142 143
         level: String(res.level),
143 144
         repel: Number(res.repel),
144 145
         isCycleEnd: res?.isCycleEnd === 1 ? [true] : [],
146
+        standardGuidelineName: `${res?.knowledgeCategoryDetails.name || ''}/${res?.knowledgeContentDetails.title || ''}`,
145 147
       })
146 148
       .open();
147 149
   } catch (error) {
@@ -185,7 +187,7 @@ const handleConfirm = async (data: any) => {
185 187
   console.log('提交数据', data);
186 188
   drawerApi.drawerLoading(true);
187 189
   try {
188
-    data.standardGuideline = '14,17';
190
+    // data.standardGuideline = '14,17';
189 191
     data.files = data?.attachment
190 192
       ?.map((item: any) => item.response.data.fileName)
191 193
       .join(',');
@@ -195,6 +197,9 @@ const handleConfirm = async (data: any) => {
195 197
     if (Array.isArray(data.isCycleEnd)) {
196 198
       data.isCycleEnd = data.isCycleEnd[0] === true ? 1 : 0;
197 199
     }
200
+    if (!data.taskLeader) {
201
+      data.taskLeader = null;
202
+    }
198 203
     // 根据是否包含 id 来决定调用新增接口还是编辑接口
199 204
     if (data.id) {
200 205
       // 编辑操作

+ 43 - 18
apps/web-ele/src/views/system/taskDesign/taskTemplate/taskTemplate-data.tsx

@@ -3,7 +3,7 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
3 3
 import { ElButton } from 'element-plus';
4 4
 import { getPopupContainer } from '@vben/utils';
5 5
 // @ts-ignore
6
-import {useVbenModal } from '@vben/common-ui';
6
+import { useVbenModal } from '@vben/common-ui';
7 7
 import { ElMessage } from 'element-plus';
8 8
 
9 9
 // import type { SelectProps } from '#/adapter/form';
@@ -70,10 +70,13 @@ TaskExclusionOptionsfn();
70 70
 const getTaskTypeOptions = () => getDictOptions(DICT_KEYS.TASK_TYPE);
71 71
 // 获取表单类型字典选项
72 72
 const getFormTypeOptions = () => getDictOptions(DICT_KEYS.FORM_TYPE);
73
+// console.log('表单类型',getFormTypeOptions());
74
+// console.log('过滤表单类型',getFormTypeOptions()?.filter((item: any) => item?.value !== 'form'));
75
+
73 76
 // 获取任务频率字典选项
74 77
 export const getTaskFrequencyOptions = () =>
75 78
   getDictOptions(DICT_KEYS.TASK_FREQUENCY);
76
-console.log('任务频率', getTaskFrequencyOptions());
79
+// console.log('任务频率', getTaskFrequencyOptions());
77 80
 
78 81
 // 通用Select组件配置函数
79 82
 const createSearchSelectConfig = (options: any[], placeholder: string) => ({
@@ -192,11 +195,13 @@ export const queryFormSchema: FormSchemaGetter = () => [
192 195
     component: 'Select',
193 196
     fieldName: 'formType',
194 197
     label: '表单类型',
195
-    componentProps: {
196
-      allowClear: true,
197
-      placeholder: '请选择表单类型',
198
-      options: getFormTypeOptions(),
199
-      clearable: true,
198
+    componentProps: () => {
199
+      return {
200
+        allowClear: true,
201
+        placeholder: '请选择表单类型',
202
+        options: getFormTypeOptions()?.filter((item: any) => item?.value !== 'form'),
203
+        clearable: true,
204
+      };
200 205
     },
201 206
   },
202 207
 
@@ -447,7 +452,7 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
447 452
     componentProps: (data: any) => {
448 453
       return {
449 454
         placeholder: '请选择表单类型',
450
-        options: getFormTypeOptions(),
455
+        options: getFormTypeOptions().filter((item: any) => item.value !== 'form'),
451 456
         clearable: true,
452 457
         disabled: data.isUpdate,
453 458
       };
@@ -1166,9 +1171,29 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
1166 1171
     slot: 'description',
1167 1172
     formItemClass: 'col-span-2 items-baseline',
1168 1173
   },
1174
+  //知识库
1175
+    {
1176
+    component: 'Input',
1177
+    dependencies: {
1178
+      show: () => false,
1179
+      triggerFields: [''],
1180
+    },
1181
+    fieldName: 'knowledge',
1182
+    formItemClass: 'col-span-2 items-baseline',
1183
+  },
1184
+  //知识库类别
1185
+  {
1186
+    component: 'Input',
1187
+    dependencies: {
1188
+      show: () => false,
1189
+      triggerFields: [''],
1190
+    },
1191
+    fieldName: 'knowledgeCategory',
1192
+    formItemClass: 'col-span-2 items-baseline',
1193
+  },
1169 1194
   {
1170
-    component: 'InputTag',
1171
-    fieldName: 'standardGuideline',
1195
+    component: 'Input',
1196
+    fieldName: 'standardGuidelineName',
1172 1197
     label: '标准指引',
1173 1198
     componentProps: {
1174 1199
       placeholder: '请选择标准指引',
@@ -1178,14 +1203,14 @@ export const drawerFormSchema: FormSchemaGetter = (props?: any) => [
1178 1203
       return {
1179 1204
         suffix: () => {
1180 1205
           return (
1181
-              <ElButton
1182
-                onClick={() => {
1183
-                  props?.quoteModalApi?.open();
1184
-                }}
1185
-                type="primary"
1186
-              >
1187
-                选择
1188
-              </ElButton>
1206
+            <ElButton
1207
+              onClick={() => {
1208
+                props?.quoteModalApi?.open();
1209
+              }}
1210
+              type="primary"
1211
+            >
1212
+              选择
1213
+            </ElButton>
1189 1214
           );
1190 1215
         },
1191 1216
       };

+ 22 - 9
apps/web-ele/src/views/system/taskDesign/taskTemplate/taskTemplate-drawer.vue

@@ -19,6 +19,7 @@ const accessStore = useAccessStore();
19 19
 const isUpdateRef = ref<boolean>(false);
20 20
 const isViewRef = ref<boolean>(false);
21 21
 const isCopyRef = ref<boolean>(false);
22
+const knowledgeRef: any = ref(null);
22 23
 
23 24
 // 附件列表 - 添加类型定义
24 25
 const attachments = ref<any[]>([]);
@@ -43,18 +44,30 @@ interface DrawerData {
43 44
   attachment?: any[];
44 45
   [key: string]: any;
45 46
 }
46
-const [QuoteModal, quoteModalApi] = useVbenModal({
47
-  title: '引用试题',
48
-  showCancelBtn: false,
49
-  class: 'quote-modal',
50
-  // onConfirm:()=>{
51
-  // }
52
-});
53 47
 const radio1 = ref('0');
54 48
 const dialogVisible = ref(false);
55 49
 const selectedIcon = ref('');
56 50
 const taskFrequency = ref('');
57 51
 const isWebmaster = ref(false);
52
+const selectedCategoryInfo = ref({});
53
+const [QuoteModal, quoteModalApi] = useVbenModal({
54
+  title: '引用试题',
55
+  showCancelBtn: false,
56
+  class: 'quote-modal',
57
+  onConfirm: () => {
58
+    const result = knowledgeRef.value.confirmSelection();
59
+    if (result) {
60
+      selectedCategoryInfo.value = result;
61
+      if (result) {
62
+        formApi.setFieldValue('knowledge', result.contentId);
63
+        formApi.setFieldValue('knowledgeCategory', result.categoryId);
64
+        formApi.setFieldValue('standardGuidelineName', result.contentNamePath);
65
+      }
66
+      quoteModalApi.close();
67
+      console.log(selectedCategoryInfo.value);
68
+    }
69
+  },
70
+});
58 71
 
59 72
 // // 处理taskFrequency变化的函数
60 73
 const formOptions = computed(() => {
@@ -249,7 +262,6 @@ const [Drawer, drawerApi] = useVbenDrawer({
249 262
         delete formData.endTimeDay;
250 263
         delete formData.endTimeHour;
251 264
       }
252
-
253 265
       // 添加附件数据
254 266
       if (attachments.value.length > 0) {
255 267
         formData.attachment = attachments.value;
@@ -297,6 +309,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
297 309
       });
298 310
     }
299 311
     selectedIcon.value = '';
312
+    selectedCategoryInfo.value = {};
300 313
   },
301 314
 });
302 315
 
@@ -565,7 +578,7 @@ const selectIcon = (val: any, item: any) => {
565 578
       </template>
566 579
     </Form>
567 580
   </Drawer>
568
-  <QuoteModal><knowledgemain /></QuoteModal>
581
+  <QuoteModal><knowledgemain ref="knowledgeRef" /></QuoteModal>
569 582
 </template>
570 583
 
571 584
 <style scoped>