resolver-egretimp-plus 0.1.79 → 0.1.84

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": "resolver-egretimp-plus",
3
- "version": "0.1.79",
3
+ "version": "0.1.84",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -78,13 +78,14 @@ export const getFeiShuTokensApi = async (params) => {
78
78
 
79
79
  // https://cmitry.feishu.cn/docs/doccnCtL96HOryMUErjXBMBrn4c#
80
80
  // 选人选部门Select组件(原生js版本)
81
- const token = ''
81
+ let token = ''
82
82
  export const useSelEmployeeJs = () => {
83
83
  const getToken = async () => {
84
84
  if (token) {
85
85
  return token
86
86
  }
87
87
  let { data: { result } } = await getFeiShuTokensApi({ "busiType": "CONSULTING_HELP" })
88
+ token = result
88
89
  return result
89
90
  }
90
91
 
@@ -109,10 +110,19 @@ export const useSelEmployeeJs = () => {
109
110
  }
110
111
  return loadAllResource(urls)
111
112
  }
113
+ const loadScriptDepartment = async () => {
114
+ const urls = []
115
+ if (!window._DIC_COMMON_JS_) {
116
+ const url = `https://ncoa${isLocal ? '-uat' : ''}.cmitry.com/components/lib/call.min.js?ver=${getDateTime()}`
117
+ urls.push({ type: 'js', url, id: 'callJs' })
118
+ }
119
+ return loadAllResource(urls)
120
+ }
112
121
  const initSelUser = (params) => {
113
122
  return window.init_selUser(params)
114
123
  }
115
124
  return {
125
+ loadScriptDepartment,
116
126
  getToken,
117
127
  loadStyle,
118
128
  loadScript,
@@ -71,7 +71,7 @@ const getColumns = (filterKey) => {
71
71
  value: option.columnValue
72
72
  }))?.filter(item => {
73
73
  if (filterKey) {
74
- return item.label?.includes(filterKey)
74
+ return `${item.label || ''}`.toLocaleLowerCase()?.includes(`${filterKey}`.toLocaleLowerCase())
75
75
  } else {
76
76
  return true
77
77
  }
@@ -1,15 +1,22 @@
1
1
  <template>
2
2
  <div class="select-employees">
3
+ <!-- <el-input @focus="showSelUserDialog">
4
+ <template #suffix>
5
+ <el-icon style="cursor: pointer;" @click="showSelUserDialog"><SearchIcon /></el-icon>
6
+ </template>
7
+ </el-input> -->
3
8
  <div :id="metaCode" :style="styleObj" class="xm-select-user" :class="[props.disabled ? 'is-disabled' : '']"></div>
4
9
  <div v-if="props.disabled" class="disable-employees"></div>
5
10
  </div>
6
11
  </template>
7
12
  <script setup>
8
- import { onMounted, inject, watch, defineProps, computed, defineEmits, nextTick } from 'vue';
13
+ import { onMounted, inject, watch, defineProps, computed, defineEmits, nextTick, resolveComponent } from 'vue';
9
14
  import { useSelEmployeeJs } from '../helper/dock.js'
10
- import { commonPropsType } from '../../utils/index.js'
15
+ import { commonPropsType, debounce } from '../../utils/index.js'
11
16
  import { useFormItem } from 'element-plus'
12
17
 
18
+ // const SearchIcon = resolveComponent('Search')
19
+ // console.log('SearchIcon==:', SearchIcon)
13
20
  const { formItem: elFormItem } = useFormItem()
14
21
  const emit = defineEmits(['change'])
15
22
  const props = defineProps({
@@ -22,6 +29,10 @@ const props = defineProps({
22
29
  type: String,
23
30
  default: 'user'
24
31
  },
32
+ isFrame: {
33
+ type: [String, Number],
34
+ default: '0'
35
+ },
25
36
  placeholder: {
26
37
  type: String,
27
38
  default: ''
@@ -109,6 +120,24 @@ const initSelEmployee = async () => {
109
120
  })
110
121
  }
111
122
 
123
+ const showSelUserDialog = debounce(async function () {
124
+ let feiShuTokens = ''
125
+ const { getToken, loadScriptDepartment } = useSelEmployeeJs()
126
+ let ret = await Promise.all([getToken(), loadScriptDepartment()])
127
+ if (ret && ret.length) {
128
+ feiShuTokens = ret[0]
129
+ if (!feiShuTokens) return
130
+ }
131
+ _DIC_COMMON_JS_.showSelUserDialog({
132
+ token: feiShuTokens,
133
+ }, {
134
+ needCompleteData: false,
135
+ chooseType: 'all'
136
+ })?.then((res) => {
137
+ debugger
138
+ })
139
+ }, 200)
140
+
112
141
  function seelp(time) {
113
142
  return new Promise((resolve) => {
114
143
  setTimeout(() => {
@@ -137,7 +137,13 @@ export default {
137
137
  if (b[item.prop] === '' || b[item.prop] === undefined || b[item.prop] === null) {
138
138
  return item.order === 'descending' ? -1 : 1
139
139
  }
140
- return (a[item.prop] > b[item.prop] ? (item.order === 'descending' ? -1 : 1) : a[item.prop] === b[item.prop] ? 0 : (item.order === 'descending' ? 1 : -1))
140
+ let aVal = a[item.prop]
141
+ let bVal = b[item.prop]
142
+ if (!Number.isNaN(+(a[item.prop])) && !Number.isNaN(+(b[item.prop]))) {
143
+ aVal = +(a[item.prop])
144
+ bVal = +(b[item.prop])
145
+ }
146
+ return (aVal > bVal ? (item.order === 'descending' ? -1 : 1) : aVal === bVal ? 0 : (item.order === 'descending' ? 1 : -1))
141
147
  })
142
148
  return ret
143
149
  }, [...(normalTableData.value || [])])
@@ -1,8 +1,9 @@
1
1
 
2
- import { intersectionWith, isEqual, mergeWith, unionWith, isArray, cloneDeep } from 'lodash-es'
2
+ import { intersectionWith, isEqual, mergeWith, unionWith, isArray, cloneDeep, debounce } from 'lodash-es'
3
3
  import { isDate } from './is'
4
4
  import { isRef } from 'vue'
5
5
  export {
6
+ debounce,
6
7
  cloneDeep,
7
8
  unionWith
8
9
  }
@@ -557,7 +557,7 @@ export function generateLayoutPolyfill(config, disabled, isH5) {
557
557
  })
558
558
  }
559
559
  props.class = {
560
- [normalCapitalizeComponent(config.metaType)]: true,
560
+ [normalCapitalizeComponent(config.renderby || config.metaType)]: true,
561
561
  }
562
562
  if (isElCol) {
563
563
  props.class['is-card'] = config?.needWrap == '1', // 这个样式主要用于折叠上面,控制被卡片包裹的时候,下边距是16,没有被包裹的时候,是12
@@ -9,6 +9,9 @@ export const RESULT_CODE = {
9
9
  }
10
10
  export function resultToast(result = {}, messageInstance, {messageCb, service, compConfig, noSuccessIip = false, resultCodeKey = 'resultCode'} = {}) {
11
11
  let ret = false
12
+ if (result?.baseResponse) {
13
+ result = result?.baseResponse
14
+ }
12
15
  let cbKey = ''
13
16
  const resultMessage = result?.resultMessage || ''
14
17