Xiao_123 пре 7 месеци
родитељ
комит
c667075af9
2 измењених фајлова са 7 додато и 13 уклоњено
  1. 0 9
      src/hooks/web/useDictionaries.js
  2. 7 4
      src/views/menduner/system/job/index.vue

+ 0 - 9
src/hooks/web/useDictionaries.js

@@ -5,15 +5,6 @@ import { dictApi } from '@/api/menduner/common/useDictionaries'
 // }
 
 const setDict = (type, val, cacheTime = 7200) => {
-  if (type === 'areaTreeData') {
-    const obj = val.find(e => e.name === '中国')
-    val = obj?.children ? obj.children.map(e =>{
-      // 市辖区直接显示区
-      const municipality = e.children && e.children.length && e.children[0].name === '市辖区'
-      if (municipality && e.children[0].children?.length) e.children = e.children[0].children
-      return e
-    }) : []
-  }
   localStorage.setItem(type, JSON.stringify({
     data: val,
     expire: Date.now() + cacheTime * 1000

+ 7 - 4
src/views/menduner/system/job/index.vue

@@ -174,7 +174,6 @@
 <script setup lang="ts">
 import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
 import { dateFormatter } from '@/utils/formatTime'
-import download from '@/utils/download'
 import { JobAdvertisedApi, JobAdvertisedVO } from '@/api/menduner/system/job'
 import JobAdvertisedForm from './JobAdvertisedForm.vue'
 import { dealDictArrayData } from '@/utils/transform/position'
@@ -184,7 +183,6 @@ import { getDict } from '@/hooks/web/useDictionaries'
 defineOptions({ name: 'JobAdvertised' })
 
 const message = useMessage() // 消息弹窗
-const { t } = useI18n() // 国际化
 
 const loading = ref(true) // 列表的加载中
 const list = ref<JobAdvertisedVO[]>([]) // 列表的数据
@@ -205,14 +203,19 @@ const queryParams = reactive({
   hire: true
 })
 const queryFormRef = ref() // 搜索的表单
-const exportLoading = ref(false) // 导出的加载中
 
 // 职位类型、地区树状列表
 const areaTreeData = ref([])
 const positionTreeData = ref([])
 const getDictData = async () => {
   const { data } = await getDict('areaTreeData', {}, 'areaTreeData')
-  areaTreeData.value = data && data.length ? data : []
+  const obj = data.find(e => e.name === '中国')
+  areaTreeData.value = obj?.children ? obj.children.map(e =>{
+    // 市辖区直接显示区
+    const municipality = e.children && e.children.length && e.children[0].name === '市辖区'
+    if (municipality && e.children[0].children?.length) e.children = e.children[0].children
+    return e
+  }) : []
 
   const { data: position } = await getDict('positionTreeData', {}, 'positionTreeData')
   positionTreeData.value = position && position.length ? position : []