Преглед изворни кода

Merge remote-tracking branch 'origin/master'

yewc пре 1 година
родитељ
комит
3581d837c2

+ 4 - 5
client/src/store/modules/tagsView.ts

@@ -71,7 +71,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
   // 更新某tag
   const updateVisitedView = (view: RouteLocationNormalizedLoaded): void => {
     for (let v of unref(visitedViews)) {
-      if (v.path === view.path) {
+      if (isSameRouteTag(v, view)) {
         v = Object.assign(v, view)
         break
       }
@@ -87,7 +87,7 @@ export const useTagsViewStore = defineStore('tagsView', () => {
   // 删除tag
   const delVisitedView = (view: RouteLocationNormalizedLoaded): void => {
     for (const [i, v] of unref(visitedViews).entries()) {
-      if (v.path === view.path) {
+      if (isSameRouteTag(v, view)) {
         visitedViews.value.splice(i, 1)
         break
       }
@@ -121,9 +121,8 @@ export const useTagsViewStore = defineStore('tagsView', () => {
     view: RouteLocationNormalizedLoaded,
     type: 'other' | 'left' | 'right'
   ): void => {
-    const index = findIndex<RouteLocationNormalizedLoaded>(
-      unref(visitedViews),
-      (v) => v.path === view.path
+    const index = findIndex<RouteLocationNormalizedLoaded>(unref(visitedViews), (v) =>
+      isSameRouteTag(v, view)
     )
     visitedViews.value = visitedViews.value.filter((v, i) => {
       return (

+ 8 - 11
client/src/views/OaSystem/personnelManagement/zpxqspPage/index.vue

@@ -10,22 +10,22 @@
         <DeptSelect v-model="queryParams.deptId" />
       </div>
 
-      <div class="form" v-if="(postDict?.length ?? 0) !== 0">
+      <div class="form">
         <span class="formSpan">申请岗位:</span>
         <el-select v-model="queryParams.post" placeholder="请选择岗位" clearable>
           <el-option
-            v-for="{ label, value } in postDict"
+            v-for="{ label, value } in getIntDictOptions('post_type')"
             :key="value"
             :label="label"
             :value="value"
           />
         </el-select>
       </div>
-      <div class="form" v-if="(recruitType?.length ?? 0) !== 0">
+      <div class="form">
         <span class="formSpan">所属类别:</span>
         <el-select v-model="queryParams.post" placeholder="请选择类别" clearable>
           <el-option
-            v-for="{ label, value } in recruitType"
+            v-for="{ label, value } in getIntDictOptions('RECRUIT_TYPE')"
             :key="value"
             :label="label"
             :value="value"
@@ -56,17 +56,17 @@
         <el-table-column show-overflow-tooltip align="center" prop="deptName" label="部门" />
         <el-table-column align="center" label="岗位">
           <template #default="scope">
-            <span>{{ getDictName(scope.row.post, postDict) }}</span>
+            <span>{{ getDictLabel('post_type', scope.row.post) }}</span>
           </template>
         </el-table-column>
         <el-table-column align="center" label="所属类别">
           <template #default="scope">
-            <span>{{ getDictName(scope.row.type, recruitType) }}</span>
+            <span>{{ getDictLabel('RECRUIT_TYPE', scope.row.post) }}</span>
           </template>
         </el-table-column>
         <el-table-column align="center" label="能力等级">
           <template #default="scope">
-            <span>{{ getDictName(scope.row.abilityLevel, abilityLevel) }}</span>
+            <span>{{ getDictLabel('ABILITY_LEVEL', scope.row.abilityLevel) }}</span>
           </template>
         </el-table-column>
         <el-table-column show-overflow-tooltip align="center" prop="jobRequest" label="任职要求" />
@@ -132,16 +132,13 @@ import { Recruit, RecruitListDTO } from '@/interface/demand'
 import { useMutation, useQuery } from '@tanstack/vue-query'
 import { deleteRecruit, getRecruitList, updateRecruit } from '@/service/demand'
 import DeptSelect from '@/components/DeptSelect/index.vue'
-import { useDict, getDictName } from '@/hooks/web/useDict'
+import { getIntDictOptions, getDictLabel } from '@/utils/dict'
 
 const infoList = [
   { label: '需求总数', value: 'requireSum' },
   { label: '招聘总数', value: 'recruitSum' }
 ]
 defineOptions({ name: 'TravelCost' })
-const [postDict] = useDict('post_type') //职位
-const [recruitType] = useDict('RECRUIT_TYPE') // 需求类别
-const [abilityLevel] = useDict('ABILITY_LEVEL') //能力等级
 
 const pageParams = ref({
   pageNo: 1,