resolver-egretimp-plus 0.0.10 → 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.
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "resolver-egretimp-plus",
3
- "version": "0.0.10",
3
+ "version": "0.0.21",
4
4
  "description": "交付体验渲染",
5
5
  "main": "./dist/web/index.js",
6
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",
@@ -5,7 +5,7 @@ module.exports = {
5
5
  mode: 'production',
6
6
  entry: {
7
7
  web: path.resolve(__dirname, '../index-web.js'),
8
- h5: path.resolve(__dirname, '../index-h5.js'),
8
+ h5: path.resolve(__dirname, '../index-H5.js'),
9
9
  },
10
10
  output: {
11
11
  clean: true,
@@ -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,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
+ // }
@@ -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
+ }