resolver-egretimp-plus 0.0.191 → 0.0.193

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.191",
3
+ "version": "0.0.193",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
6
  "module": "./dist/web/index.js",
@@ -74,6 +74,8 @@ export default {
74
74
  const selects = inject('selects')
75
75
 
76
76
  definePrivatelyProp(props.config, '_rootValue', rootValue)
77
+ definePrivatelyProp(props.config, 'router', router)
78
+ definePrivatelyProp(props.config, 'route', route)
77
79
  // 当前组件的实例
78
80
  const instance = getCurrentInstance()
79
81
  const appContext = instance?.appContext
@@ -84,8 +86,7 @@ export default {
84
86
  }
85
87
  const onVnodeMounted = (e) => {
86
88
  definePrivatelyProp(props.config, 'vmIsBind', true)
87
- definePrivatelyProp(props.config, 'router', router)
88
- definePrivatelyProp(props.config, 'route', route)
89
+
89
90
 
90
91
  if (props.config.onVnodeMounted && typeof props.config.onVnodeMounted === 'function') {
91
92
  const context = {
@@ -11,6 +11,10 @@ export async function executeLoadServices(services = [], { requestTraceId, busin
11
11
  delete noramlReqData.notLoad
12
12
  const loadServices = services.filter(ser => ser.eventType == '1')
13
13
  const mixinServiceConfig = services.find(service => service.serviceType === '1')
14
+ if (!loadServices || !loadServices.length) {
15
+ notLoadCb && notLoadCb()
16
+ return
17
+ }
14
18
  for (let i = 0; i < loadServices.length; i++) {
15
19
  const service = loadServices[i]
16
20
  const url = service.serviceCode
@@ -59,6 +59,7 @@ const dataLoad = inject('dataLoad')
59
59
  const rootForm = inject('rootForm')
60
60
  const validate = inject('_validate', () => {})
61
61
  const parentRootValue = inject('_parentRootValue', {})
62
+ const rootInstance = inject('_rootInstance', {})
62
63
 
63
64
  const routeQuery= route?.query
64
65
 
@@ -82,7 +83,8 @@ const buttonAction = (...arg) => {
82
83
  routeQuery,
83
84
  validate,
84
85
  lastClick,
85
- parentRootValue
86
+ parentRootValue,
87
+ rootInstance
86
88
  }, appContext)
87
89
  }
88
90
  if (actionFnRet !== null && actionFnRet !== undefined) {
@@ -78,6 +78,7 @@ const dataLoad = inject('dataLoad')
78
78
  const rootForm = inject('rootForm')
79
79
  const validate = inject('_validate', () => {})
80
80
  const parentRootValue = inject('_parentRootValue', {})
81
+ const rootInstance = inject('_rootInstance', {})
81
82
 
82
83
  const routeQuery= route?.query
83
84
 
@@ -102,7 +103,8 @@ const buttonAction = async (e, params) => {
102
103
  routeQuery,
103
104
  validate,
104
105
  lastClick,
105
- parentRootValue
106
+ parentRootValue,
107
+ rootInstance
106
108
  }, appContext)
107
109
  }
108
110
  if (actionFnRet !== null && actionFnRet !== undefined) {
package/src/index.jsx CHANGED
@@ -140,6 +140,7 @@ export default {
140
140
  },
141
141
  emits: ['update:modelValue', 'rootStoreChange'],
142
142
  setup(props, { emit, attrs, expose }) {
143
+ const instance = getCurrentInstance()
143
144
  const ruleExecuter = null
144
145
  // const ruleExecuter = new RuleExecuter()
145
146
  const rootStore = reactive({})
@@ -167,7 +168,6 @@ export default {
167
168
  const dataLoad = computed(() => {
168
169
  return props.dataLoad || nativeDataLoad.value
169
170
  })
170
- const instance = getCurrentInstance()
171
171
  const { initPageConfig, pageConfigRef, mapCompRef, hireRelatMapRulesRef } = usePageConfig()
172
172
  function toExecuteLoadServices(clearFlag) {
173
173
  // 触发加载事件执行
@@ -258,6 +258,7 @@ export default {
258
258
  provide('buttonActions', props.buttonActions)
259
259
  provide('components', toRef(props, 'components'))
260
260
  provide('selects', toRef(props, 'selects'))
261
+ provide('_rootInstance', instance)
261
262
  provide('rootValue', computed({
262
263
  get() {
263
264
  return props.modelValue
@@ -68,9 +68,15 @@ const allInitEvents = {
68
68
  const { config } = this
69
69
  val = config?.bindValue
70
70
  } else {
71
+ let routeMatchs = null
71
72
  const _absoluteTarget = /^_absoluteTarget:(.+)$/
72
73
  const matchs = val.match(_absoluteTarget)
73
- if (typeof val === 'string' && matchs?.[1]) {
74
+ if ( typeof val === 'string' && (routeMatchs = val.match(/^_route:(.*)$/))) {
75
+ const { config } = this
76
+ const queryKey = routeMatchs[1]
77
+ const routeQuery = config?.route?.query
78
+ val = routeQuery?.[queryKey]
79
+ } else if (typeof val === 'string' && matchs?.[1]) {
74
80
  const { dynamicMapComp } = this
75
81
  const targetConfig = dynamicMapComp?.[matchs[1]]
76
82
  val = targetConfig?.bindValue || ''
@@ -6,7 +6,12 @@ export default function defaultVal(config) {
6
6
  const configDefaultVal = config.defaultVal || config.defaultValue
7
7
  let defaultVal = null
8
8
  try {
9
- if (/^{[\w\W]*}$/.test(configDefaultVal) || /^\[[\w\W]*\]$/.test(configDefaultVal)) {
9
+ let routeMatchs = null
10
+ if ( typeof configDefaultVal === 'string' && (routeMatchs = configDefaultVal.match(/^_route:(.*)$/))) {
11
+ const queryKey = routeMatchs[1]
12
+ const routeQuery = config?.route?.query
13
+ defaultVal = routeQuery?.[queryKey]
14
+ } else if (/^{[\w\W]*}$/.test(configDefaultVal) || /^\[[\w\W]*\]$/.test(configDefaultVal)) {
10
15
  defaultVal = JSON.parse(configDefaultVal)
11
16
  } else {
12
17
  if (configDefaultVal === ARG_FLAGS.CURRENT_DATE || configDefaultVal === 'currentDate') {