resolver-egretimp-plus 0.0.71 → 0.0.73

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.0.71",
3
+ "version": "0.0.73",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -47,6 +47,10 @@ const props = defineProps({
47
47
  // primaryKeys
48
48
  default: () => ({})
49
49
  },
50
+ dialogProps: {
51
+ type: Object,
52
+ default: () => ({})
53
+ },
50
54
  rootStoreChange: Function
51
55
  })
52
56
  const formData = ref({})
@@ -2,7 +2,7 @@ import { isArray, isHasVal } from "../../utils/is"
2
2
  import { DATA_VALID_RULE_EXECUTE } from "../../api/builtIn"
3
3
  import { getRelateConfigKeys } from "../../rules/ruleUtils"
4
4
  import { RESULT_CODE, resultToast } from "../../utils/respone"
5
- import { unionWith } from "../../utils/index"
5
+ import { parseExtendAttr, unionWith } from "../../utils/index"
6
6
 
7
7
  export async function dispatchClickEvents ({serviceList = [], requestTraceId, axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance}) {
8
8
  const dynamicMapCompKeys = Object.keys(dynamicMapComp)
@@ -25,21 +25,27 @@ export async function dispatchClickEvent(service, { dynamicMapComp, requestTrace
25
25
  }
26
26
  }
27
27
  const url = service.serviceCode
28
- const httpMethod = service.httpMethod
29
- const ret = await (axiosInstance && axiosInstance({
28
+ const httpMethod = service.httpMethod || "post"
29
+ const reqResult = {
30
+ requestTraceId,
31
+ pmHandleBusinessIdentity: {
32
+ busiIdentityId: service.busiIdentityId,
33
+ pageMetaId: service.pageMetaId,
34
+ tenantId: service.tenantId,
35
+ mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
36
+ },
37
+ ...reqData
38
+ }
39
+ const reqConfig = {
30
40
  url,
31
- method: httpMethod || "post",
32
- data: {
33
- requestTraceId,
34
- pmHandleBusinessIdentity: {
35
- busiIdentityId: service.busiIdentityId,
36
- pageMetaId: service.pageMetaId,
37
- tenantId: service.tenantId,
38
- mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
39
- },
40
- ...reqData
41
- }
42
- }))
41
+ method: httpMethod,
42
+ data: reqResult
43
+ }
44
+ if (httpMethod.toLocaleLowerCase() === 'get') {
45
+ reqConfig.params = reqResult
46
+ delete reqConfig.data
47
+ }
48
+ const ret = await (axiosInstance && axiosInstance(reqConfig))
43
49
  if (!resultToast(ret?.data, messageInstance, {messageCb, service, compConfig})) {
44
50
  await Promise.reject()
45
51
  return
@@ -215,8 +221,10 @@ export function openDailg({
215
221
  }
216
222
  }
217
223
  }
224
+ const dialogProps = parseExtendAttr({extendAttr: pagePopupMap.extendAttr})
218
225
  dialogClose = openChildDialog({
219
226
  buttonActions,
227
+ dialogProps,
220
228
  parentRootValue: rootValue,
221
229
  selectionsObj,
222
230
  busiIdentityId,
@@ -1,6 +1,6 @@
1
1
  import { resultToast } from "../../utils/respone"
2
2
 
3
- export async function executeLoadServices(services = [], { requestTraceId, axiosInstance, messageInstance, reqData, respCb }) {
3
+ export async function executeLoadServices(services = [], { requestTraceId, businessIdentityReqData = {}, axiosInstance, messageInstance, reqData, respCb }) {
4
4
  if (reqData?.notLoad) {
5
5
  return
6
6
  }
@@ -13,20 +13,29 @@ export async function executeLoadServices(services = [], { requestTraceId, axios
13
13
  for (let i = 0; i < loadServices.length; i++) {
14
14
  const service = loadServices[i]
15
15
  const url = service.serviceCode
16
- const ret = await (axiosInstance.value && axiosInstance.value({
17
- url,
18
- method: "post",
19
- data: {
20
- requestTraceId,
16
+ const httpMethod = service.httpMethod || "post"
17
+ const reqResult = {
18
+ requestTraceId,
21
19
  pmHandleBusinessIdentity: {
22
- busiIdentityId: service.busiIdentityId,
23
- pageMetaId: service.pageMetaId,
24
- tenantId: service.tenantId,
25
- mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
26
- },
27
- ...(reqData || {})
28
- }
29
- }))
20
+ busiIdentityId: service.busiIdentityId,
21
+ pageMetaId: service.pageMetaId,
22
+ tenantId: service.tenantId,
23
+ mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
24
+ ...businessIdentityReqData,
25
+ },
26
+ ...(reqData || {})
27
+ }
28
+ const reqConfig = {
29
+ url,
30
+ method: httpMethod,
31
+ data: reqResult
32
+ }
33
+ if (httpMethod.toLocaleLowerCase() === 'get') {
34
+ reqConfig.params = reqResult
35
+ delete reqConfig.data
36
+ }
37
+
38
+ const ret = await (axiosInstance.value && axiosInstance.value(reqConfig))
30
39
  if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
31
40
  respCb && respCb(ret?.data?.result)
32
41
  return
@@ -1,9 +1,10 @@
1
1
  <script setup>
2
- import { commonPropsType, hasOwn } from '../../utils/index.js'
2
+ import { commonPropsType, getConfigOptions, hasOwn } from '../../utils/index.js'
3
3
  import { computed, inject, reactive, ref, useAttrs, watch } from 'vue'
4
4
 
5
5
  const attrs = useAttrs()
6
6
  const lang = inject('lang')
7
+ const selects = inject('selects')
7
8
  const tableRef = ref(null)
8
9
  const props = defineProps({
9
10
  ...commonPropsType,
@@ -12,7 +13,7 @@ const tableData = ref([])
12
13
  const modelValue = defineModel()
13
14
 
14
15
  const isFrontPage = computed(() => {
15
- return props.config?.frontPageFlag === '1'
16
+ return props.config?.frontPageFlag == '1'
16
17
  })
17
18
  const tableProps = computed(() => {
18
19
  return {
@@ -21,6 +22,8 @@ const tableProps = computed(() => {
21
22
  display: props.config?.display,
22
23
  open: props.config?.defaultOpenFlag === '1',
23
24
  showlandscape: props.config?.showLandscape === '1',
25
+ rowkey: props.config?.rowkey,
26
+ height: props.config?.height,
24
27
  }
25
28
  })
26
29
  const page = reactive({
@@ -30,9 +33,12 @@ const page = reactive({
30
33
  })
31
34
 
32
35
  const normalTableData = computed(() => {
33
- return !isFrontPage.value ?
36
+ const orgList = !isFrontPage.value ?
34
37
  tableData.value :
35
38
  tableData.value.slice((page.pageNum - 1) * page.pageSize, page.pageNum * page.pageSize)
39
+ return orgList.map(row => {
40
+ return normalTableRowValue(row)
41
+ })
36
42
  })
37
43
 
38
44
  const normalPageTotal = computed(() => {
@@ -74,7 +80,7 @@ const tableEvents = computed(() => {
74
80
  })
75
81
  // 是否配置分页功能 ====== start======
76
82
  const pageable = computed(() => {
77
- return props.config?.pageable === '1'
83
+ return props.config?.pageable == '1'
78
84
  })
79
85
  const pageAlign = computed(() => {
80
86
  return props.config?.pageAlign
@@ -126,10 +132,10 @@ const getTableColumnProps = (config) => {
126
132
  prop: config.metaCode,
127
133
  width: config.columnWidth,
128
134
  ellipsis: config.ellipsis === '1',
129
- showexpand: config.showexpand === '1'
135
+ showexpand: config.showexpand === '1',
136
+ fixed: config.fixed,
130
137
  }
131
138
  }
132
-
133
139
  watch(modelValue, (val) => {
134
140
  setTimeout(() => {
135
141
  tableData.value = val || (tableProps.value.card ? [] : [])
@@ -138,9 +144,41 @@ watch(modelValue, (val) => {
138
144
  }, {
139
145
  immediate: true
140
146
  })
147
+ // 这个的监听是因为 table正常形态的时候,改变分页,行高会越来越高,所以就设置了key
148
+ // 设置key之后需要重新setTableData
149
+ watch(() => {
150
+ return `${tableProps.value.card}${tableProps.value.display}${!tableProps.value.card ? page.pageNum : 0}`
151
+ }, () => {
152
+ setTimeout(() => {
153
+ tableRef.value?.setTableData(normalTableData.value)
154
+ }, 100);
155
+ })
156
+
157
+ function getOptions(config) {
158
+ return getConfigOptions(config, selects)
159
+ }
160
+
161
+ function normalVal(val, options) {
162
+ const findItem = options?.find(item => item.columnValue == val)
163
+ if (findItem) {
164
+ return lang?.value?.indexOf('zh') > -1 ? findItem.columnDesc_zh : findItem.columnDesc
165
+ }
166
+ return val
167
+ }
168
+
169
+
170
+ function normalTableRowValue(row) {
171
+ const ret = {
172
+ ...row
173
+ }
174
+ pmPageMetaList.value.forEach(config => {
175
+ ret[config.metaCode] = normalVal(ret[config.metaCode], getOptions(config))
176
+ })
177
+ return ret
178
+ }
141
179
  </script>
142
180
  <template>
143
- <cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}`" v-bind="tableProps" :data="normalTableData" @rowclick="tableEvents.onRowclick">
181
+ <cmi-table ref="tableRef" :key="`${tableProps.card}${tableProps.display}${!tableProps.card ? page.pageNum : 0}`" v-bind="tableProps" :data="normalTableData" @rowclick="tableEvents.onRowclick">
144
182
  <cmi-table-column
145
183
  v-for="column in pmPageMetaList" :key="column.metaCode"
146
184
  v-bind="{
@@ -109,7 +109,7 @@ export default {
109
109
  const ret = sortList.reduce((ret, item) => {
110
110
  ret = ret.sort((a, b) => (a[item.prop] > b[item.prop] ? (item.order === 'descending' ? 1 : -1) : a[item.prop] === b[item.prop] ? 0 : (item.order === 'descending' ? -1 : 1)))
111
111
  return ret
112
- }, [...(props.refValue.value || [])])
112
+ }, [...(normalTableData.value || [])])
113
113
  return ret
114
114
  })
115
115
 
@@ -134,7 +134,7 @@ export default {
134
134
  if (!props.columnWidth) {
135
135
  props.minWidth = '160px'
136
136
  }
137
- if (props.width == 0 || props.width == '0px') {
137
+ if (props.width == 0 || props.width == '0px' || config.hidden == '1') {
138
138
  props.className = 'hidden-column'
139
139
  props.width = '1px'
140
140
  }
@@ -1,4 +1,5 @@
1
1
  <template>
2
+
2
3
  <ElSelect class="custom-self-select" v-bind="{...attrs, ...selectProps }" v-model="value" @clear="clear">
3
4
  <ElOption v-for="option in props.options"
4
5
  :key="option.columnValue"
@@ -66,6 +67,10 @@ const selectProps = computed(() => {
66
67
  if (typeof attrs.multiple === 'string') {
67
68
  attrs.multiple = attrs.multiple == '1'
68
69
  }
70
+ if (!attrs['suffix-icon'] && !attrs.suffixIcon) {
71
+ delete attrs.suffixIcon
72
+ delete attrs['suffix-icon']
73
+ }
69
74
  attrs.multipleLimit = Number(parseInt(attrs.multipleLimit || 0))
70
75
  return attrs
71
76
  })
@@ -44,7 +44,7 @@ export function usePageConfig() {
44
44
 
45
45
  export function useBuildInData({ messageInstance, loadingInstance, requestTraceId }) {
46
46
  const pageConfig = ref(null)
47
- function getPageConfig(reqData, cb) {
47
+ function getPageConfig(reqData, { configCb, selectsCb}) {
48
48
  if (loadingInstance.start && typeof loadingInstance.start === 'function') {
49
49
  loadingInstance.start()
50
50
  } else if (loadingInstance.show && typeof loadingInstance.show === 'function') {
@@ -54,8 +54,8 @@ export function useBuildInData({ messageInstance, loadingInstance, requestTraceI
54
54
  if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
55
55
  // pageConfig.value = normalPageConfigs(mock)
56
56
  pageConfig.value = normalPageConfigs(ret.data.result)
57
- cb(pageConfig.value)
58
- getSelects(ret.data.result?.pmBusinessIdentityVO?.tenantId)
57
+ configCb && configCb(pageConfig.value)
58
+ getSelects(ret.data.result?.pmBusinessIdentityVO?.tenantId, selectsCb)
59
59
  return
60
60
  } else {
61
61
  if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
@@ -73,12 +73,13 @@ export function useBuildInData({ messageInstance, loadingInstance, requestTraceI
73
73
  })
74
74
  }
75
75
  const selects = ref({})
76
- function getSelects(tenantId) {
76
+ function getSelects(tenantId, selectsCb) {
77
77
  buildInRequest(GET_SYS_PARAM_CACHE, {
78
78
  tenantId
79
79
  }).then(ret => {
80
80
  if (resultToast(ret.data, messageInstance, { noSuccessIip: true })) {
81
81
  selects.value = JSON.parse(ret.data.result || '{}')
82
+ selectsCb && selectsCb(selects.value)
82
83
  return
83
84
  } else {
84
85
  if (loadingInstance.finish && typeof loadingInstance.finish === 'function') {
package/src/index.jsx CHANGED
@@ -98,6 +98,11 @@ export default {
98
98
  type: Object,
99
99
  default: () => ({})
100
100
  },
101
+ // 加载服务中businessIdentity的额外参数
102
+ businessIdentityReqData: {
103
+ type: Object,
104
+ default: () => ({})
105
+ },
101
106
  // 如果当前页面是弹框,这个是父页面传入的根数据
102
107
  parentRootValue: {
103
108
  type: Object,
@@ -187,6 +192,7 @@ export default {
187
192
  {
188
193
  requestTraceId: props.requestTraceId,
189
194
  messageInstance: toRef(props, 'messageInstance'),
195
+ businessIdentityReqData: props.businessIdentityReqData,
190
196
  axiosInstance,
191
197
  reqData: props.loadEvnetsReq,
192
198
  respCb: (result) => {
@@ -36,9 +36,15 @@ getPageConfig({
36
36
  busiIdentityId: props.busiIdentityId,
37
37
  queryPageMeta: '1',
38
38
  queryPageService: '1',
39
- }, (pageConfig) => {
40
- // 配置数据加载完成事件 'loadedConfigCompeted'
41
- attrs?.onLoadedConfigCompeted?.(pageConfig)
39
+ }, {
40
+ configCb: (pageConfig) => {
41
+ // 配置数据加载完成事件 'loadedConfigCompeted'
42
+ attrs?.onLoadedConfigCompeted?.(pageConfig)
43
+ },
44
+ selectsCb: (selects) => {
45
+ // 配置数据加载完成事件 'loadedConfigCompeted'
46
+ attrs?.onLoadedSelectsCompeted?.(selects)
47
+ },
42
48
  })
43
49
  const allSelects = computed(() => {
44
50
  return {
@@ -257,3 +257,29 @@ export function getUuid () {
257
257
  return (c === 'x' ? random : (random & 0x3) | 0x8).toString(16);
258
258
  });
259
259
  }
260
+
261
+ export function getConfigOptions(config, selects) {
262
+ const referenceOptions = config.referenceOptions
263
+ const selectKey = config.selectKey
264
+ let optionItemsList = []
265
+ try {
266
+ optionItemsList = JSON.parse(config?.optionItems || '[]').map(item => {
267
+ return {
268
+ columnValue: item.value,
269
+ columnDesc_zh: item.label,
270
+ columnDesc: item.label_en || item.label,
271
+ columnStatus: item.columnStatus
272
+ }
273
+ })
274
+ } catch (error) {
275
+ optionItemsList = []
276
+ }
277
+ const options = (selects?.value && selects?.value?.[selectKey]) || (selects?.value && selects?.value?.[`${config.metaCode}ListValue`]) || (selects?.value && selects?.value?.[referenceOptions]) || optionItemsList || []
278
+ return options
279
+ // const disabled = calcDisable(config, props.mode)
280
+ // if (disabled) {
281
+ // return options
282
+ // } else {
283
+ // return options.filter(item => !(item.columnStatus == '0' || item.columnStatus == '2'))
284
+ // }
285
+ }
@@ -1,4 +1,4 @@
1
- import { normalPixel, getDate, findComponent, isPatchComponent } from './common.js'
1
+ import { normalPixel, getDate, findComponent, isPatchComponent, getConfigOptions } from './common.js'
2
2
 
3
3
  export const MODE = {
4
4
  OPERATE: 'operate',
@@ -144,29 +144,7 @@ export const commonPropsType = {
144
144
  type: Array,
145
145
  default: () => [],
146
146
  getValue(config, props, modelValue, selects) {
147
- const referenceOptions = config.referenceOptions
148
- const selectKey = config.selectKey
149
- let optionItemsList = []
150
- try {
151
- optionItemsList = JSON.parse(config?.optionItems || '[]').map(item => {
152
- return {
153
- columnValue: item.value,
154
- columnDesc_zh: item.label,
155
- columnDesc: item.label_en || item.label,
156
- columnStatus: item.columnStatus
157
- }
158
- })
159
- } catch (error) {
160
- optionItemsList = []
161
- }
162
- const options = (selects?.value && selects?.value?.[selectKey]) || (selects?.value && selects?.value?.[`${config.metaCode}ListValue`]) || (selects?.value && selects?.value?.[referenceOptions]) || optionItemsList || []
163
- return options
164
- // const disabled = calcDisable(config, props.mode)
165
- // if (disabled) {
166
- // return options
167
- // } else {
168
- // return options.filter(item => !(item.columnStatus == '0' || item.columnStatus == '2'))
169
- // }
147
+ return getConfigOptions(config, selects)
170
148
  }
171
149
  },
172
150
  placeholder: {