resolver-egretimp-plus 0.1.39 → 0.1.40

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.39",
3
+ "version": "0.1.40",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -9,9 +9,13 @@ const props = defineProps({
9
9
  const attrs = useAttrs()
10
10
  const tabProps = computed(() => {
11
11
  return {
12
- label: lang.value.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
12
+ label: props?.config?.hidden == '1' ?
13
+ '' :
14
+ lang.value.indexOf('zh') > -1 ? props.config?.metaNameZh : props.config?.metaNameEn,
13
15
  name: props.config?.metaCode,
14
- disabled: props.config?.editFlag == '0'
16
+ disabled: props?.config?.hidden == '1' ?
17
+ true :
18
+ props.config?.editFlag == '0'
15
19
  }
16
20
  })
17
21
  const modelValue = defineModel()
@@ -22,7 +26,7 @@ const pmPageMetaList = computed(() => {
22
26
  </script>
23
27
 
24
28
  <template>
25
- <cmi-tab-content v-bind="{...attrs, ...tabProps}" :style="props.config?.style">
29
+ <cmi-tab-content v-bind="{...attrs, ...tabProps}" :style="props.config?.style">
26
30
  <slot>
27
31
  <Renderer :config="pmPageMetaList" v-model="modelValue"></Renderer>
28
32
  </slot>
@@ -19,26 +19,36 @@ const activeNames = computed({
19
19
  get() {
20
20
  const currentTab = tabpanes.value.find(tab => tab.defaultShowFlag == '1')
21
21
  const currentCycleTab = tabpanes.value.find(tab => tab.currentCode)
22
- return (currentTab && currentTab.metaCode)
23
- || (currentCycleTab && currentCycleTab.currentCode)
24
- || (tabpanes.value[0] && (tabpanes.value[0].metaType === 'CustomComponentTabPaneH5' && tabpanes.value[0].metaCode) || (tabpanes.value[0].metaType === 'CustomComponentCycleTabPaneH5' && `${tabpanes.value[0].metaCode}-0`))
22
+ if (currentTab) {
23
+ return currentTab?.isCycle == '1' ? `${currentTab.metaCode}-0` : currentTab.metaCode
24
+ }
25
+ if (currentCycleTab) {
26
+ return currentCycleTab.currentCode
27
+ }
28
+ if (tabpanes.value[0]) {
29
+ if (assertMetaType(tabpanes.value[0], 'CustomComponentCycleTabPaneH5') || tabpanes.value[0]?.isCycle == '1') {
30
+ return `${tabpanes.value[0].metaCode}-0`
31
+ } else {
32
+ return tabpanes.value[0].metaCode
33
+ }
34
+ }
25
35
  },
26
36
  set(val) {
27
37
  tabpanes.value.forEach(tab => {
28
- if (tab.metaType === 'CustomComponentTabPane') {
38
+ if (assertMetaType(tab, 'CustomComponentCycleTabPaneH5') || tab?.isCycle == '1') {
39
+ if (/^cycleTabpane-(\d+)$/.test(val)) {
40
+ tab.currentCode = val
41
+ } else {
42
+ tab.currentCode = ''
43
+ }
44
+ } else if (tab.metaType === 'CustomComponentTabPaneH5') {
29
45
  if (tab.metaCode === val) {
30
46
  tab.defaultShowFlag = '1'
31
47
  } else {
32
48
  tab.defaultShowFlag = '0'
33
49
  }
34
50
  }
35
- if (tab.metaType === 'CustomComponentCycleTabPane') {
36
- if (new RegExp(`^${tab.metaCode}-(\d+)$`).test(val)) {
37
- tab.currentCode = val
38
- } else {
39
- tab.currentCode = ''
40
- }
41
- }
51
+
42
52
  })
43
53
  }
44
54
  })
@@ -77,11 +87,14 @@ const customClass = computed(() => {
77
87
  }
78
88
  })
79
89
 
90
+ function assertMetaType(config, metaType) {
91
+ return config.renderby === metaType || config.metaType === metaType
92
+ }
80
93
  </script>
81
94
 
82
95
  <template>
83
96
  <cmi-tabs :class="customClass" v-bind="{...attrs, ...tabProps}">
84
- <CustomComponentTabPaneH5
97
+ <CustomComponentTabPaneH5
85
98
  v-for="tabpane in tabpanes" :config="tabpane" :key="tabpane.metaId"
86
99
  >
87
100
  <Renderer :config="tabpane?.pmPageMetaList || []" :additionConfigs="[tabpane]" :modelValue="getValue(tabpane.metaCode)" @update:modelValue="(val) => { onUpdateModelValue(val, tabpane.metaCode) }"></Renderer>
@@ -229,7 +229,6 @@ export function parseCondition(rule) {
229
229
  formatRefVal = Number(refVal)
230
230
  formatTargetVal = Number(targetVal)
231
231
  }
232
-
233
232
  switch (condition.symbol) {
234
233
  case 1:
235
234
  return formatRefVal > formatTargetVal
@@ -87,4 +87,11 @@
87
87
  margin-bottom: var(--prmary-marign);
88
88
  margin-right: var(--prmary-marign);
89
89
  }
90
+
91
+ .polyfill-form-item_error {
92
+ width: 100%;
93
+ overflow: hidden;
94
+ text-overflow: ellipsis;
95
+ white-space: nowrap;
96
+ }
90
97
  }
@@ -710,7 +710,9 @@ function generateFormItemPc (config, lang, compProps, params,) {
710
710
  }
711
711
  }
712
712
 
713
- const slots = {}
713
+ const slots = {
714
+ error: (info) => createFormLabelErrorTip(info, config, lang)
715
+ }
714
716
  slots[slotName] = () => node
715
717
  if (isFormItem && slotName !== 'label') {
716
718
  slots.label = () => createFormLable(config, lang)
@@ -987,6 +989,11 @@ function createFormLable(config, lang = 'zh') {
987
989
  </div>
988
990
  )
989
991
  }
992
+ function createFormLabelErrorTip(info, config, lang='zh') {
993
+ return (
994
+ <span title={info.error} class="el-form-item__error polyfill-form-item_error">{info.error}</span>
995
+ )
996
+ }
990
997
 
991
998
  export function getComponentPropsKeys(comp, config) {
992
999
  let propsKeys = []