Просмотр исходного кода

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 1 год назад
Родитель
Сommit
b883e5cdd4

+ 1 - 7
.env.development

@@ -3,10 +3,7 @@ NODE_ENV = 'development'
 VITE_APP_TITLE = 门墩儿直聘
 
 # 请求路径
-VITE_BASE_URL = 'http://menduner.citupro.com:7878/'
-
-# 接口地址
-VITE_API_URL = '/admin-api'
+VITE_BASE_URL = 'http://menduner.citupro.com:7878'
 
 VITE_TENANTCODE = '155'
 
@@ -25,9 +22,6 @@ VITE_BASE_PATH = '/'
 # 输出路径
 VITE_OUT_DIR = 'dist'
 
-# 商城H5会员端域名
-VITE_MALL_H5_DOMAIN = 'http://mall.yudao.iocoder.cn'
-
 # 验证码的开关
 VITE_APP_CAPTCHA_ENABLE = false
 

+ 29 - 0
.env.local

@@ -0,0 +1,29 @@
+NODE_ENV = 'local'
+
+VITE_APP_TITLE = 门墩儿直聘
+
+# 请求路径
+VITE_BASE_URL = 'http://192.168.3.80'
+
+VITE_TENANTCODE = '155'
+
+# 是否删除debugger
+VITE_DROP_DEBUGGER = false
+
+# 是否删除console.log
+VITE_DROP_CONSOLE = false
+
+# 是否sourcemap
+VITE_SOURCEMAP = true
+
+# 打包路径
+VITE_BASE_PATH = '/'
+
+# 输出路径
+VITE_OUT_DIR = 'dist'
+
+# 验证码的开关
+VITE_APP_CAPTCHA_ENABLE = false
+
+#租户开关
+VITE_APP_TENANT_ENABLE = true

+ 0 - 4
.gitignore

@@ -3,10 +3,6 @@ node_modules
 /dist
 /.history/
 
-# local env files
-.env.local
-.env.*.local
-
 # Log files
 npm-debug.log*
 yarn-debug.log*

+ 1 - 1
package.json

@@ -2,7 +2,7 @@
   "name": "vuetify-project",
   "version": "0.0.0",
   "scripts": {
-    "dev": "vite --mode local-dev --host 0.0.0.0",
+    "dev": "vite --mode local --host 0.0.0.0",
     "build:dev": "vite build --mode development",
     "preview": "vite preview",
     "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore",

+ 1 - 4
src/api/position.js

@@ -44,10 +44,7 @@ export const getSimilarPosition = async (params) => {
 export const getJobAdvertisedSearch = async (params) => {
   return await request.get({
     url: '/app-api/menduner/system/job/advertised/search',
-    params,
-    headers: {
-      'CaChe-Control': 'no-store'
-    }
+    params
   })
 }
 

+ 3 - 2
src/config/axios/index.js

@@ -5,7 +5,7 @@ import { config } from './config'
 const { default_headers } = config
 
 const request = (option) => {
-  const { url, method, params, data, headersType, responseType, headers, ...config } = option
+  const { url, method, params, data, headersType, responseType, ...config } = option
   return service({
     url: url,
     method,
@@ -14,7 +14,8 @@ const request = (option) => {
     ...config,
     responseType: responseType,
     headers: {
-      ...headers,
+      'If-None-Match': false,
+      'Cache-Control': 'no-store', // 全局设置不使用缓存
       'Content-Type': headersType || default_headers
     }
   })

+ 36 - 10
src/views/recruit/position/components/areaCascader/index.vue

@@ -31,8 +31,10 @@
 // import recursive from './recursive'
 import { getDict } from '@/hooks/web/useDictionaries'
 import { reactive, ref } from 'vue'
+import { useRoute } from 'vue-router'
 defineOptions({ name:'common-components-areaTree'})
-const emits = defineEmits('input')
+const emits = defineEmits('checkedInput')
+const route = useRoute()
 
 const props = defineProps({
   // items: Object,
@@ -57,18 +59,40 @@ const show = ref(false)
 getDict('areaTreeData', {}, 'areaTreeData').then(({ data }) => {
   const arr = data?.length && data || []
   treeList.value = [arr]
-  show.value = true
   
-  // 默认展开
-  if (props.defaultOpen > 0) {
-    for (let index = 0; index < props.defaultOpen; index++) {
-      if (treeList.value?.length && treeList.value[index]?.length && treeList.value[index][0]) {
-        const stopExpand = (index + 1) === props.defaultOpen
-        handleNext(treeList.value[index][0], index, stopExpand)
+  if (route?.query && Object.keys(route?.query).length && route?.query.level1) {
+    // 刷新回显
+    console.log('route?.query', route?.query)
+    Object.keys(route?.query).forEach(key => {
+      console.log('key', key)
+      if(key.includes('level')) {
+        const levelIndex = key.split('level')[1] - 1
+        if (levelIndex !== -1 && treeList.value[levelIndex]?.length) {
+          if (route.query[key]) {
+            const arr = route.query[key].split('_')
+            if (arr?.length) {
+              arr.forEach(idItem => {
+                const dataItem = treeList.value[levelIndex].find(findItem => findItem.id === (idItem - 0))
+                if (dataItem) handleNext(dataItem, levelIndex)
+              })
+            }
+          }
+        }
+
+      }
+    })
+  } else {
+    // 默认展开
+    if (props.defaultOpen > 0) {
+      for (let index = 0; index < props.defaultOpen; index++) {
+        if (treeList.value?.length && treeList.value[index]?.length && treeList.value[index][0]) {
+          const stopExpand = (index + 1) === props.defaultOpen
+          handleNext(treeList.value[index][0], index, stopExpand)
+        }
       }
     }
-    emits('input', idChecked)
   }
+  show.value = true
 })
 
 // 设置选中ids
@@ -91,6 +115,7 @@ const getIdChecked = (item, levelIndex) => {
 // 展开下一级
 const handleNext = (item, index, stopExpand) => { // stopExpand:不展开下级
   getIdChecked(item, index)
+  emits('checkedInput', idChecked)
   if (!stopExpand &&item.children && item.children.length) {
     treeList.value[index + 1] = item.children
     treeList.value.splice(index + 2, treeList.value.length)
@@ -104,7 +129,8 @@ const calcAct = (id, levelIndex) => {
   if (!id) return false
   if (Array.isArray(idChecked) && Array.isArray(idChecked[levelIndex])) {
     const index = idChecked[levelIndex].findIndex(itemToCheck => itemToCheck=== id)
-    return index !== -1 ? true : false; // 如果找到返回索引,否则返回 false
+    const bool = index !== -1
+    return bool ? true : false; // 如果找到返回索引,否则返回 false
   }
   else return false
 }

+ 1 - 0
src/views/recruit/position/components/areaCascader/recursive.vue

@@ -1,3 +1,4 @@
+<!-- 已废弃 -->
 <template>
   <div v-for="(list, levelIndex) in treeList" :key="`select${levelIndex}`">
     <div v-if="levelIndex < props.defaultOpen">

+ 9 - 6
src/views/recruit/position/components/cityFilter.vue

@@ -5,7 +5,7 @@
       </v-tabs>
       <v-window v-model="tab" class="mt-3">
         <v-window-item :value="1">
-          <areaTree @input="inputChange"></areaTree>
+          <areaTree @checkedInput="checkedInputChange"></areaTree>
         </v-window-item>
       </v-window>
     </div>
@@ -15,12 +15,15 @@ import areaTree from './areaCascader'
 import { ref } from 'vue'
 
 defineOptions({name: 'retrieval-components-cityFilter'})
-const emits = defineEmits('input')
-const tab = ref(1)
-const inputChange = (idChecked) => {
-  console.log('idChecked', idChecked)
-  emits('input', idChecked)
+const emits = defineEmits('updateCheckedInput')
+
+const checkedInputChange = (idChecked) => {
+  if (idChecked?.length) {
+    emits('updateCheckedInput', idChecked)
+  }
 }
+
+const tab = ref(1)
 const tabClick = () => {
 }
 </script>

+ 14 - 3
src/views/recruit/position/index.vue

@@ -6,7 +6,7 @@
       <div class="stickyBox my-3">
         <headSearch></headSearch>
       </div>
-      <cityFilter class="mx-5 mb-3"></cityFilter>
+      <cityFilter class="mx-5 mb-3" @updateCheckedInput="checkedInputChange"></cityFilter>
       <conditionFilter class="mx-5 mb-3"></conditionFilter>
     </v-card>
     <div class="d-flex mt-3">
@@ -36,9 +36,10 @@ import CtPagination from '@/components/CtPagination'
 // import { dealDictData } from '@/views/recruit/position/components/dict'
 import { ref } from 'vue'
 
-import { useRoute } from 'vue-router'
+import { useRoute, useRouter } from 'vue-router'
 defineOptions({name: 'retrieval-position-page'})
-const route = useRoute()
+// const route = useRoute()
+const route = useRoute(); const router = useRouter()
 console.log('to:/recruit/position-> query', route.query)
 
 const pageInfo = { pageNo: 1, pageSize: 20}
@@ -117,4 +118,14 @@ const handleChangePage = (index) => {
   getPositionList()
 }
 
+const checkedInputChange = (idChecked) => {
+  console.log('str11111111111', idChecked)
+  
+  let str = ref('')
+  idChecked.forEach((_e, index) => {
+    if (_e?.length) str.value += `${index ? '&' : '' }level${index+1}=${_e.join('_')}`
+  })
+  if (str.value) router.push(`${route.path}?${str.value}`)
+}
+
 </script>