address-book-shell 0.0.42 → 0.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "address-book-shell",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "private": false,
5
5
  "author": "houdajian@163.com",
6
6
  "main": "lib/address-book-shell.umd.js",
@@ -89,6 +89,7 @@ import {
89
89
  searchMyfriendList,
90
90
  } from '@/api/address-list-api'
91
91
  // import incomingData from '../../../config'
92
+ import { LEADER_DEPT_IP } from '../constants'
92
93
  export default {
93
94
  inject: ['loginUserinfo'],
94
95
  props: {
@@ -367,10 +368,12 @@ export default {
367
368
  // 遍历数据并设置禁用状态
368
369
  this.table.tableDataList.forEach((item) => {
369
370
  let shouldDisable = false
370
-
371
371
  // 检查是否禁用领导
372
- if (this.disableLeaderSelection && (item.depid === 'D1' || item.depId === 'D1')) {
373
- shouldDisable = true
372
+ if (this.disableLeaderSelection) {
373
+ const deptIds = [item.depId, item.depid, item.xOrgID].filter(Boolean)
374
+ if (deptIds.some(deptId => LEADER_DEPT_IP.includes(deptId))) {
375
+ shouldDisable = true
376
+ }
374
377
  }
375
378
 
376
379
  // 检查是否在禁用列表中
@@ -36,7 +36,9 @@ export const GUIDE_BG_LIST = [
36
36
  'https://files.95579.com.cn/6/20240103/3323734/leiR0Lg1.png',
37
37
  ]
38
38
 
39
- export const LEADER_DEPT_IP = ['D1'] // 领导的部门ip,勾选领导需要权限
39
+ // D1 公司领导
40
+ // XE245 党委领导
41
+ export const LEADER_DEPT_IP = ['D1','XE245'] // 领导的部门ip,勾选领导需要权限
40
42
 
41
43
  export const LIST_TYPE_CONFIG = {
42
44
  '2': { type: '部门', placeholder: '输入部门进行搜索' },
@@ -752,7 +752,7 @@ export default {
752
752
  // 添加人员
753
753
  addSelectionItem(item) {
754
754
  const disable = getDisableLeaderSelect(item, this.disableLeaderSelection)
755
- if (disable) return // 权限不够,禁止选择领导
755
+ if (disable) return // 禁止选择
756
756
  if (this.selectDisabled && this.selectDisabledlist.length) {
757
757
  let has = false
758
758
  has = this.selectDisabledlist.some((it) => {
@@ -1059,7 +1059,7 @@ export default {
1059
1059
  handleSelect(item) {
1060
1060
  // if (item.hrId) {
1061
1061
  const disable = getDisableLeaderSelect(item, this.disableLeaderSelection)
1062
- if (disable) return // 权限不够,禁止选择领导
1062
+ if (disable) return //禁止选择
1063
1063
  this.searchInput.isRefineSearch = true
1064
1064
  const repeatChecked = this.repeatChecked(item)
1065
1065
  if (repeatChecked) {
@@ -1158,7 +1158,7 @@ export default {
1158
1158
  selectType(data) {
1159
1159
  // this.sType = data
1160
1160
  const disable = getDisableLeaderSelect(data, this.disableLeaderSelection)
1161
- if (disable) return // 权限不够,禁止选择领导
1161
+ if (disable) return // 禁止选择
1162
1162
  this.currentTypeNum = data
1163
1163
  this.initSearch()
1164
1164
  this.initPlaceholder()
@@ -119,7 +119,7 @@ import {
119
119
  * @returns
120
120
  */
121
121
  export const getDisableLeaderSelect = (data, disableLeaderSelection) => {
122
- if (!disableLeaderSelection) return false
123
- if (!data || typeof data !== 'object') return false
124
- return data.disable || LEADER_DEPT_IP.includes(data.depId) || LEADER_DEPT_IP.includes(data.depid)
122
+ if (!disableLeaderSelection || !data || typeof data !== 'object') return false
123
+ const deptIds = [data.depId, data.depid, data.xOrgID].filter(Boolean)
124
+ return data.disable || deptIds.some(deptId => LEADER_DEPT_IP.includes(deptId))
125
125
  }