resolver-egretimp-plus 0.0.43 → 0.0.45

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.43",
3
+ "version": "0.0.45",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -201,7 +201,8 @@ export default {
201
201
  lang,
202
202
  rootValue,
203
203
  dynamicMapComp,
204
- props
204
+ props,
205
+ messageInstance: messageInstance?.value
205
206
  }) // 生成formItem()的辅助函数
206
207
  return formItemPolyfill(
207
208
  <currentComponent.value
@@ -0,0 +1 @@
1
+ export { default as default} from './src/index.vue'
@@ -0,0 +1,106 @@
1
+ <script setup>
2
+ import { computed, useAttrs } from 'vue';
3
+
4
+ const props = defineProps({
5
+ messageInstance: {
6
+ type: [Object, Function],
7
+ default: () => null
8
+ },
9
+ config: [Object, Array],
10
+ lang: String,
11
+ labelWidth: [String, Number]
12
+ })
13
+ const attrs = useAttrs()
14
+ const label = computed(() => {
15
+ if (props.config.labelHidden == '1' || props.config.labelWidth === 0 || props.config.labelWidth === '0') {
16
+ return ''
17
+ }
18
+ return (props.lang.indexOf('zh') > -1 ? props.config.metaNameZh : props.config.metaNameEn) || ''
19
+ })
20
+ const labelWidth = computed(() => {
21
+ if (!!props.config.labelPosition) {
22
+ return props.config.labelPosition
23
+ }
24
+ return 'left'
25
+ })
26
+ function handleClickTip() {
27
+ messageInstance?.text(props.lang.indexOf('zh') > -1 ? props.config.hintContentZh : props.config.hintContentEn)
28
+ }
29
+
30
+ </script>
31
+ <template>
32
+ <cmi-form-item v-bind="attrs" class="custom-form-item-h5"
33
+ :class="[{'--required': props.config.requiredFlag == '1', '--label-hide': !labelWidth,
34
+ '--label-text-left': labelPosition === 'left', '--label-text-right': labelPosition === 'right'
35
+ }, customClass]"
36
+ :labelWidth="props.labelWidth"
37
+ >
38
+ <div slot="label" class="custom-label--formItem">
39
+ <div class="custom-label-content">
40
+ <span class="label-required" v-if="props.config.requiredFlag == '1'">*</span>
41
+ <span class="label-text">{{ label }}</span>
42
+ <span class="label-tip" v-if="props.config.hintFlag == '1'" @click="handleClickTip"><cmi-icon-question-circle size="14"/></span>
43
+ </div>
44
+ </div>
45
+ <slot></slot>
46
+ </cmi-form-item>
47
+ </template>
48
+ <style lang="scss" scoped>
49
+ cmi-form-item {
50
+ position: relative;
51
+
52
+ .custom-label--formItem {
53
+ display: inline-flex;
54
+ align-items: center;
55
+ width: 100%;
56
+ // height: 16px;
57
+
58
+ .custom-label-content {
59
+ width: 100%;
60
+ display: -webkit-box;
61
+ line-height: 16px;
62
+ overflow: hidden;
63
+ text-overflow: ellipsis;
64
+ -webkit-line-clamp: 2;
65
+ -webkit-box-orient: vertical;
66
+ text-align: left;
67
+ .label-required {
68
+ color: #f5222d;
69
+ position: relative;
70
+ right: 3px;
71
+ top: 3px;
72
+ }
73
+ .label-text {
74
+ padding-right: 3px;
75
+ }
76
+ .label-tip {
77
+ position: absolute;
78
+ right: 16px;
79
+ top: 2px;
80
+ }
81
+ }
82
+ }
83
+
84
+ &.--label-text-left {
85
+ .custom-label--formItem {
86
+ .custom-label-content {
87
+ text-align: left;
88
+ }
89
+ }
90
+ }
91
+
92
+ &.--label-text-right {
93
+ .custom-label--formItem {
94
+ .custom-label-content {
95
+ text-align: right;
96
+ }
97
+ }
98
+ }
99
+
100
+ &.--required {
101
+ .custom-label-content {
102
+ padding-left: 3px;
103
+ }
104
+ }
105
+ }
106
+ </style>
@@ -4,14 +4,15 @@ import { RESULT_CODE, resultToast } from "../../utils/respone"
4
4
 
5
5
  export async function dispatchClickEvents ({serviceList = [], axiosInstance, dynamicMapComp, rootValue, dynamicHireRelat, messageCb, compConfig, messageInstance}) {
6
6
  const dynamicMapCompKeys = Object.keys(dynamicMapComp)
7
+ const mixinServiceConfig = serviceList.find(service => service.serviceType === '1')
7
8
  for (let i = 0; i < serviceList.length; i++) {
8
9
  const service = serviceList[i]
9
- dispatchClickEvent(service, {dynamicMapComp, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance})
10
+ dispatchClickEvent(service, {dynamicMapComp, mixinServiceConfig, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance})
10
11
  }
11
12
  }
12
13
 
13
- export async function dispatchClickEvent(service, { dynamicMapComp, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance }) {
14
- let reqData = rootValue
14
+ export async function dispatchClickEvent(service, { dynamicMapComp, mixinServiceConfig, rootValue, dynamicMapCompKeys, dynamicHireRelat, axiosInstance, messageCb, compConfig, messageInstance }) {
15
+ let reqData = rootValue || {}
15
16
  let tableConfig = null
16
17
  if (service.transactionType == '1') {
17
18
  reqData = getReqData(service.inParamMappingList || [], {dynamicMapComp, dynamicMapCompKeys, dynamicHireRelat})
@@ -25,7 +26,15 @@ export async function dispatchClickEvent(service, { dynamicMapComp, rootValue, d
25
26
  const ret = await (axiosInstance && axiosInstance({
26
27
  url,
27
28
  method: "post",
28
- data: reqData
29
+ data: {
30
+ pmHandleBusinessIdentity: {
31
+ busiIdentityId: service.busiIdentityId,
32
+ pageMetaId: service.pageMetaId,
33
+ tenantId: service.tenantId,
34
+ mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
35
+ },
36
+ ...reqData
37
+ }
29
38
  }))
30
39
  if (!resultToast(ret?.data, messageInstance, {messageCb, service, compConfig})) {
31
40
  await Promise.reject()
@@ -1,12 +1,22 @@
1
1
  export async function executeLoadServices(services = [], { axiosInstance, messageInstance, reqData, respCb }) {
2
2
  const loadServices = services.filter(ser => ser.eventType == '1')
3
+ // const mixinServiceConfig = services.find(service => service.serviceType === '1')
4
+
3
5
  for (let i = 0; i < loadServices.length; i++) {
4
6
  const service = loadServices[i]
5
7
  const url = service.serviceCode
6
8
  const ret = await (axiosInstance.value && axiosInstance.value({
7
9
  url,
8
10
  method: "post",
9
- data: reqData
11
+ data: {
12
+ pmHandleBusinessIdentity: {
13
+ busiIdentityId: service.busiIdentityId,
14
+ pageMetaId: service.pageMetaId,
15
+ tenantId: service.tenantId,
16
+ // mainServiceCode: mixinServiceConfig?.mainServiceCode, // 提交按钮绑定上绑定的融合服务编码
17
+ },
18
+ ...(reqData || {})
19
+ }
10
20
  }))
11
21
  // const ret = await (new Promise((res) => {
12
22
  // setTimeout(() => {
@@ -25,12 +25,20 @@ const onChange = (e) => {
25
25
  modelValue.value = e.detail.value
26
26
  }
27
27
 
28
+ const normalVal = computed(() => {
29
+ const findItem = props?.options?.find(item => item.columnValue == modelValue.value)
30
+ if (findItem) {
31
+ return lang?.value?.indexOf('zh') > -1 ? findItem.columnDesc_zh : findItem.columnDesc
32
+ }
33
+ return modelValue.value
34
+ })
35
+
28
36
  </script>
29
37
 
30
38
  <template>
31
39
  <cmi-cell-group>
32
40
  <cmi-cell
33
- :value="modelValue" v-bind="{ ...attrs, ...calcProps}"
41
+ :value="normalVal" v-bind="{ ...attrs, ...calcProps}"
34
42
  @change="onChange"
35
43
  ></cmi-cell>
36
44
  </cmi-cell-group>
@@ -30,16 +30,6 @@ const checkboxProps = computed(() => {
30
30
  const attrs = useAttrs()
31
31
  const modeValue = defineModel()
32
32
 
33
- const aa = [
34
- {
35
- columnValue: 'aaa',
36
- columnDesc_zh: 'aaa',
37
- },
38
- {
39
- columnValue: 'bbb',
40
- columnDesc_zh: 'bbb',
41
- }
42
- ]
43
33
  const onChange = ({ detail }) => {
44
34
  modeValue.value = detail.value
45
35
  }
@@ -49,11 +39,11 @@ const onSigleChange = ({ detail }) => {
49
39
  </script>
50
40
 
51
41
  <template>
52
- <cmi-checkbox-group :value="modeValue" @change="onChange" v-if="props.options && props.options.length" v-bind="{...checkboxGroupProps, ...attrs}">
42
+ <cmi-checkbox-group :value="modeValue" @change="onChange" v-if="props.options && props.options.length" v-bind="{...attrs, ...checkboxGroupProps}">
53
43
  <cmi-checkbox
54
44
  class="mr-20"
55
45
  v-for="option in props.options" :key="option.columnValue"
56
- :disabled="option.columnStatus == '0' || option.columnStatus == '2'"
46
+ :disabled="props.disabled || option.columnStatus == '0' || option.columnStatus == '2'"
57
47
  :name="option.columnValue" :label="lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc"
58
48
  >
59
49
  {{lang.indexOf('zh') > -1 ? option.columnDesc_zh : option.columnDesc}}
@@ -9,7 +9,7 @@ const props = defineProps({
9
9
  const inputProps = computed(() => {
10
10
  return {
11
11
  label: props.config?.label,
12
- type: props.config?.type,
12
+ type: props.config?.displayType,
13
13
  name: props.config?.name,
14
14
  placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
15
15
  min: props.config?.min,
@@ -54,7 +54,7 @@ const selectProps = computed(() => {
54
54
  multiple: isMutiple.value,
55
55
  placeholder: lang?.value?.indexOf('zh') > -1 ? props.config?.defPlacehold : props.config?.defPlaceholdEn,
56
56
  'max-options-visible': props.config?.['max-options-visible'] || props.config?.maxOptionsVisible,
57
- required: props.required,
57
+ // required: props.required,
58
58
  }
59
59
  })
60
60
  const clear = () => {
@@ -16,8 +16,8 @@ const attrs = useAttrs()
16
16
  const lang = inject('lang')
17
17
  const cmiProps = computed(() => {
18
18
  return {
19
- title: lang?.value?.indexOf('zh') ? props.config?.metaNameZh : props.config?.metaNameEn,
20
- subtitle: lang?.value?.indexOf('zh') ? props.config.subtitleZh : props.config.subtitleEn,
19
+ title: lang?.value?.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
20
+ subtitle: lang?.value?.indexOf('zh') > -1 ? props.config.subtitleZh : props.config.subtitleEn,
21
21
  content: props.content,
22
22
  noborder: props.noborder == '1' ? true : false,
23
23
  cardbgcolor: props.cardbgcolor || '#FAFAFA',
@@ -16,7 +16,7 @@ const tableProps = computed(() => {
16
16
  card: props.config?.displayType === 'card',
17
17
  display: props.config?.display,
18
18
  open: props.config?.open === '1',
19
- showlandscape: props.config?.showlandscape === '1',
19
+ showlandscape: props.config?.showLandscape === '1',
20
20
  }
21
21
  })
22
22
 
@@ -12,6 +12,9 @@ const inputProps = computed(() => {
12
12
  total[key] = props[key]
13
13
  return total
14
14
  }, {})
15
+ if (props.config?.icon) {
16
+ ret.suffixIcon = props.config?.icon
17
+ }
15
18
  return ret
16
19
  })
17
20
  const attrs = useAttrs()
package/src/index.jsx CHANGED
@@ -139,7 +139,7 @@ export default {
139
139
  })
140
140
  // 触发加载事件执行
141
141
  executeLoadServices(
142
- props.config?.pmPageServiceMapVOList || [],
142
+ props.config?.pmPageServiceMapVOList || props.config?.lcpPageServiceMapVOList || [],
143
143
  {
144
144
  messageInstance: toRef(props, 'messageInstance'),
145
145
  axiosInstance,
@@ -34,7 +34,7 @@ getPageConfig({
34
34
  queryPageMeta: '1',
35
35
  queryPageService: '1',
36
36
  }, (pageConfig) => {
37
- // 数据加载完成事件 'loadedConfigCompeted'
37
+ // 配置数据加载完成事件 'loadedConfigCompeted'
38
38
  attrs?.onLoadedConfigCompeted?.(pageConfig)
39
39
  })
40
40
  const allSelects = computed(() => {
@@ -1,6 +1,6 @@
1
1
  import { getCodeMapRules } from '../rules/rulesDriver.js'
2
2
  import { resolveAssetComponents, findComponent, compareComponet, normalPixel, isPlainObject, hasOwn, isFnStr, normalCapitalizeComponent, capitalize, camelize, formatDate} from './common.js'
3
- import { resolveComponent, inject } from 'vue'
3
+ import { resolveComponent, inject, defineAsyncComponent } from 'vue'
4
4
  import CustomComponentColH5 from '../components/packages-H5/CustomComponentColH5.vue'
5
5
  import {
6
6
  commonPropsType,
@@ -26,6 +26,7 @@ import { isArray, isFunction, isString } from './is.js'
26
26
  import CustomComponentPlain from '../components/packages-web/CustomComponentPlain.vue'
27
27
  import QuestionFilled from '../components/icons/question-filled.vue'
28
28
  import { dispatchClickEvent, dispatchClickEvents, getTableConfig } from '../components/helper/eventOrchestration.js'
29
+ import CmiFormItem from '../components/cmiFormItem'
29
30
 
30
31
  // 解析配置中的defStyle属性
31
32
  export function parseDefStyle(defStyle) {
@@ -582,20 +583,27 @@ function generateFormItemPc (config, lang, compProps, params,) {
582
583
  }
583
584
  }
584
585
 
585
- function generateFormItemH5(config, lang, compProps, params) {
586
+ function generateFormItemH5(config, lang, compProps, params = {}) {
587
+ const { messageInstance } = params
588
+ const props = {
589
+ config,
590
+ lang,
591
+ messageInstance,
592
+ hidemessage: config?.hidemessage == '1' ? true : false,
593
+ hideasterisk: config?.hideasterisk == '1' ? true : false,
594
+ ...getFormItemExtendProps(config, lang, params),
595
+ }
596
+ // labelWidth 需要特殊处理
597
+ if (hasOwn(config, 'labelWidth')) {
598
+ props.labelWidth = props.labelWidth && `${props.labelWidth}` !== '-1' ? props.labelWidth : undefined
599
+ }
600
+
586
601
  return node => {
587
602
  if (!config.needformItem && !config.showFormItem) {
588
603
  return node
589
604
  }
590
- const props = {
591
- label: lang.indexOf('zh') > -1 ? config.metaNameZh : config.metaNameEn,
592
- hidemessage: config?.hidemessage == '1' ? true : false,
593
- hideasterisk: config?.hideasterisk == '1' ? true : false,
594
- ...getFormItemExtendProps(config, lang, params),
595
- }
596
-
597
605
  return (
598
- <cmi-form-item class="custom-form-item-h5" {...props}>{node}</cmi-form-item>
606
+ <CmiFormItem {...props}>{node}</CmiFormItem>
599
607
  )
600
608
  }
601
609
  }
@@ -627,7 +635,7 @@ function getFormItemRule(config, lang, params) {
627
635
  const required = config.requiredFlag === '1'
628
636
  const onlyRequiredFlag = config.onlyRequiredFlag
629
637
  const rules = [{
630
- required,
638
+ // required,
631
639
  validator: (rule, value, callback) => {
632
640
  if (config.editFlag === '0') callback()
633
641
  const val = config.bindValue
@@ -673,7 +681,7 @@ function getFormItemRule(config, lang, params) {
673
681
  rules.push({
674
682
  validator: (rule, value, callback) => {
675
683
  if (config.editFlag === '0') callback()
676
- const val = config.bindValue
684
+ const val = (config.bindValue === null || config.bindValue === undefined) ? '' : config.bindValue
677
685
 
678
686
  for (let i = 0; i < regexPattern.length; i++) {
679
687
  const validInfo = regexPattern[i]