resolver-egretimp-plus 0.0.9 → 0.0.21

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.
Files changed (75) hide show
  1. package/dist/h5/index.js +2 -0
  2. package/dist/h5/index.js.LICENSE.txt +1 -0
  3. package/dist/web/index.js +2 -0
  4. package/index-H5.js +2 -0
  5. package/index-web.js +2 -0
  6. package/index.js +0 -2
  7. package/package.json +7 -5
  8. package/scripts/webpack.config.js +6 -2
  9. package/src/api/builtIn.js +2 -0
  10. package/src/components/helper/button-H5.js +17 -0
  11. package/src/components/loading/index.js +6 -0
  12. package/src/components/loading/loading.js +98 -0
  13. package/src/components/loading/loading.scss +74 -0
  14. package/src/components/loading/loading.vue +91 -0
  15. package/src/components/{packages → packages-H5}/CmiButton.vue +1 -1
  16. package/src/components/{packages → packages-web}/CustomComponentTabPane.vue +1 -1
  17. package/src/components/{packages → packages-web}/CustomComponentTabs.vue +6 -3
  18. package/src/components/{patchComponents.js → patchComponents-H5.js} +2 -2
  19. package/src/components/patchComponents-web.js +46 -0
  20. package/src/enums/index.js +3 -0
  21. package/src/hooks/pageConfig.js +73 -1
  22. package/src/index.jsx +6 -0
  23. package/src/renderer.jsx +2 -1
  24. package/src/resolver-H5.vue +13 -0
  25. package/src/resolver-web.vue +13 -0
  26. package/src/utils/render.jsx +5 -5
  27. package/src/utils/request.js +34 -1
  28. package/dist/index.js +0 -2
  29. /package/dist/{index.js.LICENSE.txt → web/index.js.LICENSE.txt} +0 -0
  30. /package/src/components/{packages → packages-H5}/CmiCalendar.vue +0 -0
  31. /package/src/components/{packages → packages-H5}/CmiCell.vue +0 -0
  32. /package/src/components/{packages → packages-H5}/CmiCheckbox.vue +0 -0
  33. /package/src/components/{packages → packages-H5}/CmiDatetimePicker.vue +0 -0
  34. /package/src/components/{packages → packages-H5}/CmiDropdownMenu.vue +0 -0
  35. /package/src/components/{packages → packages-H5}/CmiInput.vue +0 -0
  36. /package/src/components/{packages → packages-H5}/CmiLink.vue +0 -0
  37. /package/src/components/{packages → packages-H5}/CmiPicker.vue +0 -0
  38. /package/src/components/{packages → packages-H5}/CmiRadio.vue +0 -0
  39. /package/src/components/{packages → packages-H5}/CmiSearch.vue +0 -0
  40. /package/src/components/{packages → packages-H5}/CmiSelect.vue +0 -0
  41. /package/src/components/{packages → packages-H5}/CustomComponentCardH5.vue +0 -0
  42. /package/src/components/{packages → packages-H5}/CustomComponentColH5.vue +0 -0
  43. /package/src/components/{packages → packages-H5}/CustomComponentCollapseH5.vue +0 -0
  44. /package/src/components/{packages → packages-H5}/CustomComponentFormLayoutH5.vue +0 -0
  45. /package/src/components/{packages → packages-H5}/CustomComponentTabPaneH5.vue +0 -0
  46. /package/src/components/{packages → packages-H5}/CustomComponentTableH5.vue +0 -0
  47. /package/src/components/{packages → packages-H5}/CustomComponentTabsH5.vue +0 -0
  48. /package/src/components/{packages → packages-web}/CustomComponentCard.vue +0 -0
  49. /package/src/components/{packages → packages-web}/CustomComponentCol.vue +0 -0
  50. /package/src/components/{packages → packages-web}/CustomComponentCollapse.vue +0 -0
  51. /package/src/components/{packages → packages-web}/CustomComponentCycle.vue +0 -0
  52. /package/src/components/{packages → packages-web}/CustomComponentCycleTabPane.vue +0 -0
  53. /package/src/components/{packages → packages-web}/CustomComponentDialog.vue +0 -0
  54. /package/src/components/{packages → packages-web}/CustomComponentEditor.vue +0 -0
  55. /package/src/components/{packages → packages-web}/CustomComponentFormLayout.vue +0 -0
  56. /package/src/components/{packages → packages-web}/CustomComponentGrid.vue +0 -0
  57. /package/src/components/{packages → packages-web}/CustomComponentGridCol.vue +0 -0
  58. /package/src/components/{packages → packages-web}/CustomComponentInputDialog.vue +0 -0
  59. /package/src/components/{packages → packages-web}/CustomComponentPlain.vue +0 -0
  60. /package/src/components/{packages → packages-web}/CustomComponentRow.vue +0 -0
  61. /package/src/components/{packages → packages-web}/CustomComponentSelectEmployees.vue +0 -0
  62. /package/src/components/{packages → packages-web}/CustomComponentSendMail.vue +0 -0
  63. /package/src/components/{packages → packages-web}/CustomComponentSteps.vue +0 -0
  64. /package/src/components/{packages → packages-web}/CustomComponentTable.jsx +0 -0
  65. /package/src/components/{packages → packages-web}/CustomComponentTree.vue +0 -0
  66. /package/src/components/{packages → packages-web}/ElButton.vue +0 -0
  67. /package/src/components/{packages → packages-web}/ElCheckbox.vue +0 -0
  68. /package/src/components/{packages → packages-web}/ElDatePicker.vue +0 -0
  69. /package/src/components/{packages → packages-web}/ElInput.vue +0 -0
  70. /package/src/components/{packages → packages-web}/ElInputNumber.vue +0 -0
  71. /package/src/components/{packages → packages-web}/ElPagination.vue +0 -0
  72. /package/src/components/{packages → packages-web}/ElRadio.vue +0 -0
  73. /package/src/components/{packages → packages-web}/ElSelect.vue +0 -0
  74. /package/src/components/{packages → packages-web}/ElText.vue +0 -0
  75. /package/src/components/{packages → packages-web}/ElTimePicker.vue +0 -0
package/index-H5.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './index.js'
2
+ export { default as default} from './src/resolver-H5.vue'
package/index-web.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './index.js'
2
+ export { default as default} from './src/resolver-web.vue'
package/index.js CHANGED
@@ -1,5 +1,3 @@
1
- export { default as default} from './src/index.jsx'
2
-
3
1
  export { default as Renderer} from './src/renderer.jsx'
4
2
  import { commonPropsType } from './src/utils/index.js'
5
3
 
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.0.9",
3
+ "version": "0.0.21",
4
4
  "description": "交付体验渲染",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
5
+ "main": "./dist/web/index.js",
6
+ "module": "./dist/web/index.js",
7
7
  "exports": {
8
- ".": "./dist/index.js",
9
- "./dist/*": "./dist/*"
8
+ ".": "./dist/web/index.js",
9
+ "./h5": "./dist/h5/index.js",
10
+ "./web": "./dist/web/index.js",
11
+ "./*": "./*"
10
12
  },
11
13
  "scripts": {
12
14
  "build:package": "webpack --config scripts/webpack.config.js",
@@ -3,14 +3,18 @@ const { VueLoaderPlugin, default: loader } = require('vue-loader')
3
3
 
4
4
  module.exports = {
5
5
  mode: 'production',
6
- entry: path.resolve(__dirname, '../index.js'),
6
+ entry: {
7
+ web: path.resolve(__dirname, '../index-web.js'),
8
+ h5: path.resolve(__dirname, '../index-H5.js'),
9
+ },
7
10
  output: {
11
+ clean: true,
8
12
  library: {
9
13
  // name: 'resolver',
10
14
  type: 'module'
11
15
  },
12
16
  path: path.resolve(__dirname, '../dist'),
13
- filename: 'index.js'
17
+ filename: '[name]/index.js'
14
18
  },
15
19
  module: {
16
20
  rules: [
@@ -0,0 +1,2 @@
1
+ export const QUERY_PAGE_CONFIG_DATA = '/sa-lcp/api/v1/pageConfig/queryPageConfigData'
2
+ export const LCP_LOGIN = '/sa-lcp/login'
@@ -0,0 +1,17 @@
1
+ // import { ElMessage } from 'element-plus';
2
+
3
+ export async function dispatchClickEvents ({serviceList = [], axiosInstance, reqData}) {
4
+ for (let i = 0; i < serviceList.length; i++) {
5
+ const service = serviceList[i]
6
+ const url = service.serviceCode
7
+ const ret = await (axiosInstance.value && axiosInstance.value({
8
+ url,
9
+ method: "post",
10
+ data: reqData
11
+ }))
12
+ if (!ret?.data?.success) {
13
+ // ElMessage.error(ret?.data?.resultMessage || '')
14
+ await Promise.reject()
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ import CmiTLoading from './loading.vue'
3
+ import { CmiLoading, loadingInstance as Loading } from './loading.js'
4
+
5
+ let loadingInstance = Loading
6
+ export { CmiTLoading, loadingInstance, CmiLoading }
@@ -0,0 +1,98 @@
1
+ /* eslint-disable */
2
+ import { createApp } from 'vue'
3
+ import loading from './loading.vue'
4
+ const app = createApp(loading)
5
+
6
+ let instance = null
7
+ let seed = 1
8
+
9
+ let getAnInstance = () => {
10
+ if (instance) {
11
+ return instance
12
+ }
13
+ instance = app.mount(document.createElement('div'))
14
+ console.log('install==:', instance)
15
+ return instance
16
+ }
17
+
18
+
19
+ let isChildOf = (child, parent) => {
20
+ var parentNode
21
+ if (child && parent) {
22
+ parentNode = child.parentNode
23
+ while (parentNode) {
24
+ if (parent === parentNode) {
25
+ return true
26
+ }
27
+ parentNode = parentNode.parentNode
28
+ }
29
+ }
30
+ return false
31
+ }
32
+
33
+ let removeDom = event => {
34
+ if (event.target && event.target.parentNode) {
35
+ event.target.parentNode.removeChild(event.target)
36
+ } else {
37
+ isChildOf(event, event.parentNode) && event.parentNode.removeChild(event)
38
+ }
39
+ }
40
+
41
+ app.config.globalProperties.close = function (el) {
42
+ let instance = getAnInstance()
43
+ instance.show = false
44
+ if ('transitionend' in window || 'webkitTransitionEnd' in window) {
45
+ this.$el.addEventListener('transitionend', removeDom)
46
+ this.$el.addEventListener('webkitTransitionEnd', removeDom)
47
+ } else {
48
+ removeDom(el)
49
+ }
50
+ this.closed = true
51
+ }
52
+
53
+ app.config.globalProperties.start = function (el) {
54
+ let instance = getAnInstance()
55
+ instance.closed = false
56
+ instance.id = seed++
57
+ instance.show = true
58
+ document.body.appendChild(instance.$el)
59
+ }
60
+
61
+ app.config.globalProperties.finish = function (el) {
62
+ let instance = getAnInstance()
63
+ instance.closed = true
64
+ instance.id = seed++
65
+ instance.show = false
66
+ if (instance && instance.$el) {
67
+ removeDom(instance.$el)
68
+ }
69
+ }
70
+
71
+ let CmiLoading = (options = {}) => {
72
+ let duration = options.duration || 1500
73
+
74
+ let instance = getAnInstance()
75
+ instance.closed = false
76
+ instance.id = seed++
77
+ clearTimeout(instance.timer)
78
+
79
+ document.body.appendChild(instance.$el)
80
+ Vue.nextTick(() => {
81
+ instance.show = true
82
+ instance.$el.removeEventListener('transitionend', removeDom)
83
+ instance.$el.removeEventListener('webkitTransitionEnd', removeDom)
84
+ instance.timer = setTimeout(() => {
85
+ if (instance.closed) return
86
+ if ('transitionend' in window || 'webkitTransitionEnd' in window) {
87
+ instance.close()
88
+ } else {
89
+ instance.close(instance.$el)
90
+ }
91
+ }, duration)
92
+ })
93
+ return instance
94
+ }
95
+
96
+ let loadingInstance = getAnInstance()
97
+
98
+ export { CmiLoading, loadingInstance }
@@ -0,0 +1,74 @@
1
+ .loading.is-fullscreen {
2
+ position: fixed;
3
+ }
4
+ .loading {
5
+ position: absolute;
6
+ z-index: 10000;
7
+ // background-color: rgba(0,0,0,.4);
8
+ margin: 0;
9
+ top: 0;
10
+ right: 0;
11
+ bottom: 0;
12
+ left: 0;
13
+ -webkit-transition: opacity 0.3s;
14
+ transition: opacity 0.3s;
15
+ .h2 {
16
+ top: 30%;
17
+ margin-top: -21px;
18
+ width: 100%;
19
+ text-align: center;
20
+ position: absolute;
21
+ font-size: 3rem;
22
+ }
23
+ }
24
+ .loadEffect .word {
25
+ font-size: 16px;
26
+ color: var(--cmi-font-color-2);
27
+ letter-spacing: -0.2px;
28
+ font-weight: 500;
29
+ }
30
+
31
+ // loading e30177 91c426 4c4f53
32
+ .loadEffect {
33
+ margin: 0 auto;
34
+ margin-top: 100px;
35
+ background-color: var(--cmi-white-color-1);
36
+ box-shadow: 0 4px 10px 0 hsla(0, 0%, 86%, 0.5);
37
+ border-radius: var(--cmi-border-radius);
38
+ line-height: 1.2;
39
+ width: 140px;
40
+ height: 96px;
41
+ }
42
+ .loadEffect span {
43
+ display: inline-block;
44
+ width: 18.5px;
45
+ height: 18.5px;
46
+ margin-right: 10px;
47
+ border-radius: 50%;
48
+ -webkit-animation: load 1.04s ease infinite;
49
+ }
50
+ .loadEffect span:last-child {
51
+ margin-right: 0px;
52
+ }
53
+ @keyframes load {
54
+ 0% {
55
+ opacity: 1;
56
+ -webkit-transform: scale(1.3);
57
+ }
58
+ 100% {
59
+ opacity: 0.2;
60
+ -webkit-transform: scale(0.3);
61
+ }
62
+ }
63
+ .loadEffect span:nth-child(1) {
64
+ -webkit-animation-delay: 0.23s;
65
+ background: #168fd1;
66
+ }
67
+ .loadEffect span:nth-child(2) {
68
+ -webkit-animation-delay: 0.38s;
69
+ background: #ea1681;
70
+ }
71
+ .loadEffect span:nth-child(3) {
72
+ -webkit-animation-delay: 0.53s;
73
+ background: #8dc449;
74
+ }
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div class="loading is-fullscreen" v-show="model">
3
+ <div class="h2 text-primary">
4
+ <div class="loadEffect">
5
+ <span></span>
6
+ <span></span>
7
+ <span></span>
8
+ <div class="word" style="display: block">{{ worldTip }}</div>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ </template>
13
+ <script>
14
+ /* eslint-disable */
15
+ import { useLocaleStoreWithOut } from '@/stores/modules/locale'
16
+ import { computed } from 'vue'
17
+ export default {
18
+ name: 'CmiLoading',
19
+ setup() {
20
+ const localeStore = useLocaleStoreWithOut()
21
+ const lang = computed(() => {
22
+ return localeStore.getLocale
23
+ })
24
+ return {
25
+ lang
26
+ }
27
+ },
28
+ data() {
29
+ return {
30
+ show: true
31
+ }
32
+ },
33
+ props: {
34
+ isNative: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
+ value: {
39
+ type: Boolean,
40
+ default: false
41
+ },
42
+ duration: {
43
+ type: Number,
44
+ default: 1500
45
+ },
46
+ autoHide: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ word: {
51
+ type: String,
52
+ default: ''
53
+ }
54
+ },
55
+ computed: {
56
+ model: {
57
+ get() {
58
+ return this.isNative ? this.show : this.value || ''
59
+ },
60
+ set(val) {
61
+ if (this.isNative) {
62
+ this.show = val
63
+ } else {
64
+ this.$emit('input', val)
65
+ }
66
+ }
67
+ },
68
+ worldTip() {
69
+ return this.word || this.lang == 'zh-CN' ? '加载中...' : 'Loading...'
70
+ }
71
+ },
72
+ watch: {
73
+ model(val) {
74
+ this.hide(val)
75
+ }
76
+ },
77
+ methods: {
78
+ hide(val) {
79
+ let that = this
80
+ if (val && this.autoHide) {
81
+ setTimeout(() => {
82
+ that.model = false
83
+ }, that.duration)
84
+ }
85
+ }
86
+ }
87
+ }
88
+ </script>
89
+ <style lang="scss">
90
+ @import './loading.scss';
91
+ </style>
@@ -2,7 +2,7 @@
2
2
  import { defineProps, inject, getCurrentInstance, computed, useAttrs } from 'vue'
3
3
  import { commonPropsType } from '../../utils/index.js'
4
4
  import { useRoute } from 'vue-router'
5
- import { dispatchClickEvents } from '../helper/button.js';
5
+ import { dispatchClickEvents } from '../helper/button-H5.js';
6
6
 
7
7
  const appContext = getCurrentInstance()?.appContext
8
8
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <TabPane v-bind="{...tabPaneProps, ...polyProps, ...attrs}">
2
+ <TabPane v-bind="{...attrs, ...tabPaneProps, ...polyProps}">
3
3
  <template #label v-if="slotsPageMetalist.length">
4
4
  <Renderer :config="slotsPageMetalist" v-model="props.refValue.value"></Renderer>
5
5
  </template>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Tabs :class="[`tabs-level-${level}`, fullBorder ? 'full-border' : '']" v-bind="{...transTabsProps, ...attrs}" v-model="activeNames">
2
+ <Tabs :class="[`tabs-level-${level}`, fullBorder ? 'full-border' : '']" v-bind="transTabsProps" v-model="activeNames">
3
3
  <Renderer :config="tabpanes" v-model="props.refValue.value"></Renderer>
4
4
  </Tabs>
5
5
  </template>
@@ -18,10 +18,13 @@ const props = defineProps({
18
18
  })
19
19
  const attrs = useAttrs()
20
20
  const tabsProps = computed(() => {
21
- return Object.keys(ElTabs.props).reduce((ret, key) => {
21
+ const ret = Object.keys(ElTabs.props).reduce((ret, key) => {
22
22
  ret[key] = props[key]
23
23
  return ret
24
- }, {})
24
+ }, {...attrs})
25
+ delete ret.modelValue
26
+ delete ret['onUpdate:modelValue']
27
+ return ret
25
28
  })
26
29
  const tabpanes = computed(() => {
27
30
  return props.config.pmPageMetaList || []
@@ -8,14 +8,14 @@ export default function () {
8
8
  let resolveModule = null
9
9
  try {
10
10
  if (require) {
11
- modulesFiles = require.context('./packages', false, /\.(vue|jsx|js)$/)
11
+ modulesFiles = require.context('./packages-H5', false, /\.(vue|jsx|js)$/)
12
12
  modulesFilesKeys = modulesFiles.keys() || []
13
13
  resolveModule = (modulePath) => {
14
14
  return modulesFiles(modulePath)
15
15
  }
16
16
  }
17
17
  } catch (error) {
18
- modulesFiles = import.meta.glob('./packages/*.{vue,jsx,js}')
18
+ modulesFiles = import.meta.glob('./packages-H5/*.{vue,jsx,js}')
19
19
  modulesFilesKeys = Object.keys(modulesFiles)
20
20
  resolveModule = (modulePath) => {
21
21
  return modulesFiles[modulePath]
@@ -0,0 +1,46 @@
1
+ let composeKeys = null
2
+ let composeComponents = null
3
+
4
+ export default function () {
5
+ if (!composeComponents || !composeKeys) {
6
+ let modulesFiles = {}
7
+ let modulesFilesKeys = []
8
+ let resolveModule = null
9
+ try {
10
+ if (require) {
11
+ modulesFiles = require.context('./packages-web', false, /\.(vue|jsx|js)$/)
12
+ modulesFilesKeys = modulesFiles.keys() || []
13
+ resolveModule = (modulePath) => {
14
+ return modulesFiles(modulePath)
15
+ }
16
+ }
17
+ } catch (error) {
18
+ modulesFiles = import.meta.glob('./packages-web/*.{vue,jsx,js}')
19
+ modulesFilesKeys = Object.keys(modulesFiles)
20
+ resolveModule = (modulePath) => {
21
+ return modulesFiles[modulePath]
22
+ }
23
+ }
24
+
25
+ const keys = modulesFilesKeys.map(modulePath => modulePath.replace(/(.*\/)*([^.]+).*/ig,"$2"))
26
+ const components = modulesFilesKeys.reduce((retObj, modulePath) => {
27
+ const moduleName = modulePath.replace(/(.*\/)*([^.]+).*/ig,"$2")
28
+ const value = resolveModule(modulePath)
29
+ retObj[moduleName] = value.default || value
30
+ return retObj
31
+ }, {})
32
+
33
+ composeKeys = [
34
+ // ...dynamicKeys,
35
+ ...keys
36
+ ]
37
+ composeComponents = {
38
+ // ...dynamicComponents,
39
+ ...components
40
+ }
41
+ }
42
+ return {
43
+ composeKeys,
44
+ composeComponents
45
+ }
46
+ }
@@ -0,0 +1,3 @@
1
+ export const ACCOUNT = ''
2
+ export const PASSWORD = ''
3
+ export const AUTH_CODE = ''
@@ -17,4 +17,76 @@ export function usePageConfig() {
17
17
  pageConfigRef,
18
18
  hireRelatMapRulesRef,
19
19
  }
20
- }
20
+ }
21
+
22
+ // export function usePageConfig() {
23
+ // const pageConfig = ref(null)
24
+ // function getPageConfig(reqData) {
25
+ // queryPageConfigData(reqData).then(ret => {
26
+ // if (ret.data.success) {
27
+ // pageConfig.value = ret.data.result
28
+ // return
29
+ // }
30
+ // ElMessage.error(ret.data.resultMessage)
31
+ // })
32
+ // }
33
+ // function getSelects() {}
34
+ // const selects = ref({
35
+ // treeListValue: [
36
+ // {
37
+ // id: 1,
38
+ // label: 'Level one 1',
39
+ // children: [
40
+ // {
41
+ // id: 4,
42
+ // label: 'Level two 1-1',
43
+ // children: [
44
+ // {
45
+ // id: 9,
46
+ // label: 'Level three 1-1-1',
47
+ // },
48
+ // {
49
+ // id: 10,
50
+ // label: 'Level three 1-1-2',
51
+ // },
52
+ // ],
53
+ // },
54
+ // ],
55
+ // },
56
+ // {
57
+ // id: 2,
58
+ // label: 'Level one 2',
59
+ // children: [
60
+ // {
61
+ // id: 5,
62
+ // label: 'Level two 2-1',
63
+ // },
64
+ // {
65
+ // id: 6,
66
+ // label: 'Level two 2-2',
67
+ // },
68
+ // ],
69
+ // },
70
+ // {
71
+ // id: 3,
72
+ // label: 'Level one 3',
73
+ // children: [
74
+ // {
75
+ // id: 7,
76
+ // label: 'Level two 3-1',
77
+ // },
78
+ // {
79
+ // id: 8,
80
+ // label: 'Level two 3-2',
81
+ // },
82
+ // ],
83
+ // },
84
+ // ]
85
+ // })
86
+ // return {
87
+ // pageConfig,
88
+ // getPageConfig,
89
+ // getSelects,
90
+ // selects
91
+ // }
92
+ // }
package/src/index.jsx CHANGED
@@ -68,6 +68,10 @@ export default {
68
68
  isH5: {
69
69
  type: Boolean,
70
70
  default: false
71
+ },
72
+ getNativeComps: {
73
+ type: Function,
74
+ default: () => ({composeComponents: {}})
71
75
  }
72
76
  },
73
77
  setup(props, { emit, attrs, expose }) {
@@ -90,6 +94,8 @@ export default {
90
94
  watch(toRef(props, 'config'), () => {
91
95
  initPageConfig(props.config, props.lang, props.polyfillConfigs, instance, props.isH5)
92
96
  })
97
+
98
+ provide('_getNativeComps', props.getNativeComps)
93
99
  provide('pageConfig', pageConfigRef)
94
100
  const dynamicMapComp = reactive({})
95
101
  provide('_axiosInstance', axiosInstance)
package/src/renderer.jsx CHANGED
@@ -40,6 +40,7 @@ export default {
40
40
  emit('update:modelValue', val)
41
41
  }
42
42
  })
43
+ const getNativeComps = inject('_getNativeComps')
43
44
  const _isH5 = inject('_isH5')
44
45
  const injectMode = inject('injectMode', '')
45
46
  const mode = props.mode || injectMode
@@ -55,7 +56,7 @@ export default {
55
56
  return null
56
57
  }
57
58
  const disabled = calcDisable(config, mode)
58
- const component = getComponentForConfig(config, disabled, _isH5?.value)
59
+ const component = getComponentForConfig({config, disabled, getNativeComps, isH5: _isH5?.value})
59
60
  if (component) {
60
61
  const layoutPolyfill = generateLayoutPolyfill(config, disabled, _isH5?.value) // // 生成布局框(col)的辅助函数
61
62
  return layoutPolyfill(
@@ -0,0 +1,13 @@
1
+ <script setup>
2
+ import getNativeComps from './components/patchComponents-H5.js'
3
+ import { useAttrs } from 'vue';
4
+ import Resolver from './index.jsx'
5
+
6
+ defineOptions({
7
+ inheritAttrs: false
8
+ })
9
+ const attrs = useAttrs()
10
+ </script>
11
+ <template>
12
+ <Resolver v-bind="attrs" :getNativeComps="getNativeComps"></Resolver>
13
+ </template>
@@ -0,0 +1,13 @@
1
+ <script setup>
2
+ import getNativeComps from './components/patchComponents-web'
3
+ import { useAttrs } from 'vue';
4
+ import Resolver from './index.jsx'
5
+
6
+ defineOptions({
7
+ inheritAttrs: false
8
+ })
9
+ const attrs = useAttrs()
10
+ </script>
11
+ <template>
12
+ <Resolver v-bind="attrs" :getNativeComps="getNativeComps"></Resolver>
13
+ </template>
@@ -1,9 +1,9 @@
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
3
  import { resolveComponent, inject } from 'vue'
4
- import getNativeComps from '../components/patchComponents'
5
- import CustomComponentColH5 from '../components/packages/CustomComponentColH5.vue'
6
- import { commonPropsType,
4
+ import CustomComponentColH5 from '../components/packages-H5/CustomComponentColH5.vue'
5
+ import {
6
+ commonPropsType,
7
7
  FORM_META_TYPE,
8
8
  NOT_NEED_FORM_ITEM_META_TYPE,
9
9
  SPECIAL_SET_FULL_WIDTH_ITEM_META_TYPE,
@@ -23,7 +23,7 @@ import { commonPropsType,
23
23
  } from './const.js'
24
24
  import { preserveCheck } from './preserveFunc.js'
25
25
  import { isArray, isFunction, isString } from './is.js'
26
- import CustomComponentPlain from '../components/packages/CustomComponentPlain.vue'
26
+ import CustomComponentPlain from '../components/packages-web/CustomComponentPlain.vue'
27
27
  import QuestionFilled from '../components/icons/question-filled.vue'
28
28
 
29
29
  // 解析配置中的defStyle属性
@@ -239,7 +239,7 @@ export function isPlainColumn(config, disabled) {
239
239
  return false
240
240
  }
241
241
 
242
- export function getComponentForConfig(config, disabled) {
242
+ export function getComponentForConfig({config, disabled, getNativeComps}) {
243
243
  // 表格中中的列,是否需要转换为普通形式
244
244
  if (isPlainColumn(config, disabled)) {
245
245
  return CustomComponentPlain
@@ -7,4 +7,37 @@ export function generateRequester(config) {
7
7
  service.interceptors.request.use(interceptors?.requestThen, interceptors?.requestCatch)
8
8
  service.interceptors.response.use(interceptors?.responseThen, interceptors?.responseCatch)
9
9
  return service
10
- }
10
+ }
11
+
12
+ const service = axios.create({
13
+ timeout: 60000 // request timeout
14
+ })
15
+ service.interceptors.request.use(
16
+ config => {
17
+ return {
18
+ ...config,
19
+ }
20
+ },
21
+ error => {
22
+ debugger
23
+ }
24
+ )
25
+
26
+ // response interceptor
27
+ service.interceptors.response.use(
28
+ response => {
29
+ const { config } = response
30
+ return response
31
+ },
32
+ error => {
33
+ debugger
34
+ }
35
+ )
36
+
37
+ export function buildInRequest(url, method = 'post', config = {}) {
38
+ return service({
39
+ url,
40
+ method,
41
+ ...config,
42
+ })
43
+ }