Browse Source

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

lifanagju_citu 7 tháng trước cách đây
mục cha
commit
ab3836c6a5

+ 49 - 0
package-lock.json

@@ -13,6 +13,7 @@
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^5.1.10",
         "axios": "^1.6.8",
+        "crypto-js": "^4.2.0",
         "echarts": "^5.4.3",
         "element-plus": "^2.8.0",
         "html2canvas": "^1.4.1",
@@ -28,6 +29,7 @@
         "roboto-fontface": "*",
         "v-clipboard": "^3.0.0-next.1",
         "vue": "^3.4.0",
+        "vue-clipboard3": "^2.0.0",
         "vue-i18n": "9",
         "vue-picture-cropper": "^0.7.0",
         "vue-router": "^4.3.0",
@@ -2021,6 +2023,17 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/clipboard": {
+      "version": "2.0.11",
+      "resolved": "https://registry.npmmirror.com/clipboard/-/clipboard-2.0.11.tgz",
+      "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==",
+      "license": "MIT",
+      "dependencies": {
+        "good-listener": "^1.2.2",
+        "select": "^1.1.2",
+        "tiny-emitter": "^2.0.0"
+      }
+    },
     "node_modules/cliui": {
       "version": "6.0.0",
       "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
@@ -2540,6 +2553,12 @@
         "node": ">=0.4.0"
       }
     },
+    "node_modules/delegate": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmmirror.com/delegate/-/delegate-3.2.0.tgz",
+      "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==",
+      "license": "MIT"
+    },
     "node_modules/dijkstrajs": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
@@ -3700,6 +3719,15 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/good-listener": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmmirror.com/good-listener/-/good-listener-1.2.2.tgz",
+      "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==",
+      "license": "MIT",
+      "dependencies": {
+        "delegate": "^3.1.2"
+      }
+    },
     "node_modules/gopd": {
       "version": "1.0.1",
       "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.0.1.tgz",
@@ -6275,6 +6303,12 @@
       "dev": true,
       "license": "MIT"
     },
+    "node_modules/select": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/select/-/select-1.1.2.tgz",
+      "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==",
+      "license": "MIT"
+    },
     "node_modules/semver": {
       "version": "7.6.0",
       "resolved": "https://registry.npmmirror.com/semver/-/semver-7.6.0.tgz",
@@ -7159,6 +7193,12 @@
       "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
       "dev": true
     },
+    "node_modules/tiny-emitter": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
+      "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
+      "license": "MIT"
+    },
     "node_modules/tiny-warning": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/tiny-warning/-/tiny-warning-1.0.3.tgz",
@@ -8004,6 +8044,15 @@
         }
       }
     },
+    "node_modules/vue-clipboard3": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/vue-clipboard3/-/vue-clipboard3-2.0.0.tgz",
+      "integrity": "sha512-Q9S7dzWGax7LN5iiSPcu/K1GGm2gcBBlYwmMsUc5/16N6w90cbKow3FnPmPs95sungns4yvd9/+JhbAznECS2A==",
+      "license": "MIT",
+      "dependencies": {
+        "clipboard": "^2.0.6"
+      }
+    },
     "node_modules/vue-demi": {
       "version": "0.14.7",
       "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.7.tgz",

+ 4 - 3
package.json

@@ -9,11 +9,12 @@
     "format": "prettier --write src/"
   },
   "dependencies": {
-    "@wangeditor/editor": "^5.1.23",
-    "@wangeditor/editor-for-vue": "^5.1.10",
     "@mdi/font": "7.0.96",
     "@vuepic/vue-datepicker": "^8.7.0",
+    "@wangeditor/editor": "^5.1.23",
+    "@wangeditor/editor-for-vue": "^5.1.10",
     "axios": "^1.6.8",
+    "crypto-js": "^4.2.0",
     "echarts": "^5.4.3",
     "element-plus": "^2.8.0",
     "html2canvas": "^1.4.1",
@@ -25,11 +26,11 @@
     "pinia-plugin-persistedstate": "^3.2.1",
     "pnpm": "^9.1.0",
     "qrcode": "^1.5.4",
-    "crypto-js": "^4.2.0",
     "qs": "^6.12.1",
     "roboto-fontface": "*",
     "v-clipboard": "^3.0.0-next.1",
     "vue": "^3.4.0",
+    "vue-clipboard3": "^2.0.0",
     "vue-i18n": "9",
     "vue-picture-cropper": "^0.7.0",
     "vue-router": "^4.3.0",

+ 1 - 1
src/store/user.js

@@ -64,7 +64,7 @@ export const useUserStore = defineStore('user',
             updateEventList(true) // 获取规则配置跟踪列表
             await this.getUserInfos()
             this.getUserBaseInfos()
-            resolve()
+            resolve(res)
           }).catch(err => { reject(err) })
         })
       },

+ 9 - 6
src/views/login/index.vue

@@ -18,7 +18,7 @@
             <v-tabs v-model="tab1" align-tabs="center" color="primary" class="mb-10">
               <v-tab :value="1">企业邮箱登录</v-tab>
             </v-tabs>
-            <passwordFrom ref="passRef" placeholder="请输入企业邮箱" :validEmail="true" @handleEnter="handleLogin"></passwordFrom>
+            <passwordFrom ref="entPassRef" placeholder="请输入企业邮箱" :validEmail="true" @handleEnter="handleLogin"></passwordFrom>
           </div>
           <!-- 个人登录 -->
           <div v-show="!isEnterpriseLogin" class="login-tab">
@@ -111,6 +111,7 @@ const handleChangeLogin = () => {
 // 验证码登录
 const phoneRef = ref()
 const passRef = ref()
+const entPassRef = ref()
 const loginLoading = ref(false)
 const userStore = useUserStore()
 
@@ -125,9 +126,9 @@ const handleCheckEnterprise = async () => {
 }
 
 const handleLogin = async () => {
-  const { valid } = tab.value === 1 ? await phoneRef.value.phoneForm.validate() : await passRef.value.passwordForm.validate()
+  const { valid } = isEnterpriseLogin.value ? await entPassRef.value.passwordForm.validate() : tab.value === 1 ? await phoneRef.value.phoneForm.validate() : await passRef.value.passwordForm.validate()
   if (!valid) return
-  if (tab.value === 2 && !captchaVerification) {
+  if (!captchaVerification) {
     getCode() // 验证码组件
     return
   }
@@ -135,8 +136,10 @@ const handleLogin = async () => {
   loginLoading.value = true
   try {
     let params, api = {}
-    if (tab.value === 1) { params = { ...phoneRef.value.loginData }; api = 'handleSmsLogin'}
-    else { params = { ...passRef.value.loginData, captchaVerification }; api = 'handlePasswordLogin'}
+    // if (tab.value === 1) { params = { ...phoneRef.value.loginData }; api = 'handleSmsLogin'}
+    // else { params = { ...passRef.value.loginData, captchaVerification }; api = 'handlePasswordLogin'}
+    if (isEnterpriseLogin.value) { params = { ...entPassRef.value.loginData, captchaVerification }; api = 'handlePasswordLogin'}
+    else { params = tab.value === 1 ? { ...phoneRef.value.loginData, captchaVerification } : { ...passRef.value.loginData, captchaVerification }; api = tab.value === 1 ? 'handleSmsLogin' : 'handlePasswordLogin'}
     
     // 邮箱为企业招聘, 手机号为个人求职
     if (isEnterpriseLogin.value) {
@@ -164,7 +167,7 @@ const handleLogin = async () => {
     Confirm('系统提示',  `${text},去注册?`, {
       cancelCallback: true
     }).then(() => {
-      localStorage.setItem('loginAccount', tab.value === 1 ? phoneRef.value.loginData.phone : passRef.value.loginData.phone)
+      localStorage.setItem('loginAccount', isEnterpriseLogin.value ? entPassRef.value.loginData.phone : tab.value === 1 ? phoneRef.value.loginData.phone : passRef.value.loginData.phone)
       router.push(err.code === 1100016002 ? '/register/person?type=noLoginToRegister' : '/register/company?type=noLoginToRegister')
     })
   } finally {

+ 6 - 1
src/views/recruit/enterprise/search/retrieval/index.vue

@@ -154,7 +154,12 @@ const handleConfirm = () => {
   const positionIds = position.value.map(k => k.id)
   queryParams.value.positionIds = positionIds || []
   query.value.pageNo = 1
-  if (!checkValue(queryParams.value)) return Snackbar.warning('至少选择一个条件进行搜索')
+  if (!checkValue(queryParams.value)) {
+    Snackbar.warning('至少选择一个条件进行搜索')
+    items.value = []
+    total.value = 0
+    return
+  }
   getData()
 }
 

+ 14 - 9
src/views/recruit/enterprise/systemManagement/groupAccount/components/link.vue

@@ -7,7 +7,7 @@
         <span v-if="code">{{ shareUrlTxt }}</span>
         <span v-else class="color-666">点击刷新生成邀请链接</span>
       </div>
-      <!-- <v-btn color="primary" class="mr-3" @click="copy()">{{ $t('common.copy') }}</v-btn> -->
+      <v-btn color="primary" class="mr-3" @click="copy()">{{ $t('common.copy') }}</v-btn>
       <v-btn color="green" variant="outlined" @click="refresh()">{{ $t('common.refresh') }}</v-btn>
     </div>
     <div class="mt-5 color-777">请复制链接进行分享,链接{{ day }}天内有效</div>
@@ -23,6 +23,9 @@ import {
 } from '@/api/recruit/enterprise/enterpriseInvite.js'
 import { computed, ref } from 'vue'
 defineOptions({name: 'groupAccount-component-invite'})
+import clipboard3 from 'vue-clipboard3'
+const { toClipboard } = clipboard3()
+
 const props = defineProps({
   inviteType: {
     type: [Number, String],
@@ -78,14 +81,16 @@ const refresh = async () => {
   }
 }
 
-// const copy = async () => {
-//   try {
-//     await navigator.clipboard.writeText(shareUrlTxt.value)
-//     Snackbar.success('复制成功')
-//   } catch (err) {
-//     Snackbar.error('复制失败,请手动复制。')
-//   }
-// }
+const copy = async () => {
+  try {
+    // await navigator.clipboard.writeText(shareUrlTxt.value)
+    console.log(shareUrlTxt.value, 'shareUrlTxt.value')
+    await toClipboard(shareUrlTxt.value)
+    Snackbar.success('复制成功')
+  } catch (err) {
+    Snackbar.error('复制失败,请手动复制。')
+  }
+}
 
 </script>
 <style lang="scss" scoped>

+ 17 - 16
src/views/recruit/enterprise/systemManagement/groupAccount/components/record.vue

@@ -55,12 +55,13 @@ const getData = async () => {
   try {
     const info = JSON.parse(localStorage.getItem('entBaseInfo')) || null
     const { list, total: number } = await enterpriseInviteRecordPage(query.value)
-    const invitedNames = await Promise.all(list.map(async () => getInvited()))
-    tableData.value = list.map((e, index) => {
+    // const invitedNames = await Promise.all(list.map(async () => getInvited()))
+    tableData.value = list.map(e => {
       const showInfo = {
         currentAccountEnterpriseAnotherName: info?.enterpriseAnotherName || '--',
         currentAccountUserName: info?.name || '--',
-        invited: invitedNames[index] || '--', // 使用预先获取的invited名称
+        // invited: invitedNames[index] || '--', // 使用预先获取的invited名称
+        invited: e?.enterpriseUser?.enterpriseName || '--', // 使用预先获取的invited名称
         time: e.createTime ? timesTampChange(e.createTime) : '--',
       }
       return { showInfo, ...e }
@@ -72,19 +73,19 @@ const getData = async () => {
   }
 }
 
-const getInvited = async (val) => {
-  try {
-    if (val) {
-      const api = props.inviteType - 0 ? enterpriseInviteRecordPage: enterpriseInviteRecordPage
-      const { data } = await api(query.value)
-      return data.name
-    } else {
-      return '-占位-'
-    }
-  } catch (error) {
-    console.log('error', error)
-  }
-}
+// const getInvited = async (val) => {
+//   try {
+//     if (val) {
+//       const api = props.inviteType - 0 ? enterpriseInviteRecordPage: enterpriseInviteRecordPage
+//       const { data } = await api(query.value)
+//       return data.name
+//     } else {
+//       return '-占位-'
+//     }
+//   } catch (error) {
+//     console.log('error', error)
+//   }
+// }
 getData()
 
 const handleChangePage = (index) => {

+ 12 - 3
src/views/recruit/enterprise/systemManagement/groupAccount/index.vue

@@ -10,7 +10,6 @@
           activatable
           color="primary"
           item-value="id"
-          item-title="anotherName"
           open-all
           open-strategy="single"
           density="compact"
@@ -18,7 +17,10 @@
           @update:opened="handleClick"
         >
           <template v-slot:title="{ item }">
-            <div style="font-size: 15px;">{{ item.anotherName }}</div>
+            <div class="treeTitle font-size-15">
+              {{ item.anotherName || item.name }}
+              <v-tooltip activator="parent" location="end">{{ item.anotherName || item.name }}</v-tooltip>
+            </div>
           </template>
         </v-treeview>
       </v-col>
@@ -123,7 +125,7 @@ const tableData = ref([])
 const treeData = ref([])
 const headers = [
   { title: t('login.username'), key: 'name', sortable: false },
-  { title: t('enterprise.userManagement.affiliatedEnterprise'), key: 'enterpriseAnotherName', sortable: false },
+  { title: t('enterprise.userManagement.affiliatedEnterprise'), key: 'enterpriseAnotherName', sortable: false, value: item => item.enterpriseAnotherName || item.enterpriseName },
   { title: t('enterprise.userManagement.post'), key: 'postName', sortable: false },
   { title: t('enterprise.userManagement.phone'), key: 'phone', sortable: false },
   { title: t('enterprise.userManagement.email'), key: 'email', sortable: false },
@@ -357,4 +359,11 @@ const handleSubmit = async () => {
     border-radius: 50%;
   }
 }
+.treeTitle {
+  width: 100%;
+  max-width: 100%;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+}
 </style>

+ 10 - 14
src/views/recruit/enterprise/systemManagement/groupAccount/inviteConfirm.vue

@@ -22,6 +22,7 @@
           <v-btn :loading="loginLoading" color="warning" class="white--text mt-5" min-width="350" @click="handleLogin" :style="{'width': isMobile ? '100%' : '350px' }">
             {{ $t('common.confirmJoin') }}
           </v-btn>
+          <div class="font-size-15 text-end color-666 mt-2">提示:未注册的手机号,加入自动注册账号</div>
           <!-- <div class="color-999 mt-2" style="font-size: 13px;">注:确认即代表加入该企业</div> -->
         </template>
       </div>
@@ -48,12 +49,9 @@ import simplePageForm from './components/simplePageForm.vue'
 import { useRoute } from 'vue-router'; const route = useRoute()
 import { enterpriseInviteRecordConsent, getEnterpriseInfoByCode } from '@/api/recruit/enterprise/enterpriseInvite.js'
 import Snackbar from '@/plugins/snackbar'
-import { getToken, setToken, setRefreshToken } from '@/utils/auth'
-import {
-  smsLogin,
-  getBaseInfo,
-  logout
-} from '@/api/common'
+import { getToken } from '@/utils/auth'
+import { getBaseInfo, logout } from '@/api/common'
+import { useUserStore } from '@/store/user'
 import { savePersonSimpleInfo } from '@/api/recruit/personal/shareJob'
 
 
@@ -78,21 +76,19 @@ const handleLogin = async () => {
   loginLoading.value = true
   try {
     const params = { ...phoneRef.value.loginData, autoRegister: true } // 只能验证码登录
-    //
     // 如果用户登录后点击关闭填写简易人才信息,再次点击登录仅弹出填写,不再调用登录
     if (copyLoginData === (params.phone + params.code.toString()) && userId) {
       getUserBaseInfos(userId)
       return
     }
-    const res = await smsLogin(params)
+    const data = await useUserStore().handleSmsLogin(params)
     copyLoginData = params.phone + params.code.toString()
-    setToken(res.accessToken)
-    setRefreshToken(res.refreshToken)
-    userId = res.userId
-    getUserBaseInfos(res.userId)
+    userId = data.userId
+    getUserBaseInfos(data.userId)
   } catch (error) {
     const msg = error?.msg || error
     Snackbar.error(msg)
+    logoutFun()
   } finally {
     loginLoading.value = false
   }
@@ -104,7 +100,6 @@ const getUserBaseInfos = async (userId) => {
   loginLoading.value = true
   try {
     const data = await getBaseInfo({ userId })
-    console.log('data', data)
     if (!data) {
       showSimpleInput.value = true; Snackbar.warning('请先完善个人基本信息')
       return 
@@ -134,7 +129,7 @@ const join = async () => {
   } catch (error) {
     Snackbar.error('加入失败! ' + error)
   } finally {
-    logoutFun()
+    if (isMobile.value) logoutFun() // 网页打开保留登录状态
     loginLoading.value = false
   }
 }
@@ -161,6 +156,7 @@ const simpleInfoSubmit = async () => {
     if (!obj) return
     await savePersonSimpleInfo(obj)
     join()
+    if (!isMobile.value) await useUserStore().getUserBaseInfos() // 网页打开需更新用户信息
     showSimpleInput.value = false
   } catch (error) {
     console.error('error', error)

+ 4 - 3
src/views/recruit/personal/home/index.vue

@@ -126,12 +126,13 @@ const adClick = () => {
     &::after {  
       content: "";  
       position: absolute;  
-      right: -50px;
+      // right: -50px;
       top: 50%;
+      margin-left: 3px;
       transform: translateY(-50%);
-      border-width: 25px;
+      border-width: 10px; // 12px
       border-style: solid; 
-      border-color: transparent transparent transparent #00897B;
+      border-color: transparent transparent transparent orange;
     }
   }
   &-title {