resolver-egretimp-plus 0.1.78 → 0.1.80

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.78",
3
+ "version": "0.1.80",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -53,6 +53,7 @@ export default {
53
53
  return ret
54
54
  })
55
55
  useConfigLoad(props.config)
56
+ const configsSet = inject('_configsSet')
56
57
  const ruleExecuter = inject('_ruleExecuter')
57
58
  const dialogReq = inject('_dialogReq', {})
58
59
  const requestTraceId = inject('requestTraceId')
@@ -231,14 +232,17 @@ export default {
231
232
  definePrivatelyProp(config, 'dynamicMapComp', dynamicMapComp)
232
233
 
233
234
  // 如果已经有dynamicHireRelat值的时候,就不需要再进行以下赋值了
234
- if (config?.dynamicHireRelat_bak && props.mode !== 'operate') {
235
+ if (
236
+ config?.dynamicHireRelat_bak && !configsSet?.has(config)
237
+ // && props.mode !== 'operate'
238
+ ) {
235
239
  definePrivatelyProp(config, 'dynamicHireRelat', `${config.dynamicHireRelat_bak}__@__${props.mode}__`)
236
240
  } else {
237
241
  const dynamicHireRelat = parent?.dynamicHireRelat ? `${parent?.dynamicHireRelat}${hasOwn(config, 'rowIndex') ? `[${config.rowIndex}]` : ''}->${(config.metaCode || '')}` : config.metaCode
238
242
  definePrivatelyProp(config, 'dynamicHireRelat', dynamicHireRelat)
239
243
  config.dynamicHireRelat_bak = dynamicHireRelat
240
244
  }
241
-
245
+ configsSet?.add(config) // 搜集所有的config
242
246
  config.dynamicHireRelat && (dynamicMapComp[config.dynamicHireRelat] = config)
243
247
  return config
244
248
  })
@@ -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,
@@ -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 || [])])
package/src/index.jsx CHANGED
@@ -183,6 +183,7 @@ export default {
183
183
  },
184
184
  emits: ['update:modelValue', 'rootStoreChange'],
185
185
  setup(props, { emit, attrs, expose }) {
186
+ const configsSet = new Set()
186
187
  const dynamicMapComp = reactive({})
187
188
  const instance = getCurrentInstance()
188
189
  const ruleExecuter = null
@@ -310,6 +311,7 @@ export default {
310
311
  toExecuteLoadServices()
311
312
  })
312
313
 
314
+ provide('_configsSet', configsSet)
313
315
  provide('_builtPolyfillReq', props.builtPolyfillReq)
314
316
  provide('_loadModuleCache', props.loadModuleCache)
315
317
  provide('_ruleExecuter', ruleExecuter)
@@ -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
  }
@@ -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