vue2-client 1.10.32 → 1.10.35

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 (27) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +196 -196
  3. package/src/base-client/components/common/XAddNativeForm/demo.vue +43 -43
  4. package/src/base-client/components/common/XAddReport/XAddReport.vue +1 -1
  5. package/src/base-client/components/common/XConversation/XConversation.vue +12 -0
  6. package/src/base-client/components/common/XDataCard/XDataCard.vue +17 -16
  7. package/src/base-client/components/common/XForm/XFormItem.vue +1248 -1286
  8. package/src/base-client/components/common/XFormCol/XFormCol.vue +157 -157
  9. package/src/base-client/components/common/XFormGroup/XFormGroup.vue +301 -301
  10. package/src/base-client/components/common/XFormTable/XFormTable.vue +12 -0
  11. package/src/base-client/components/common/XFormTable/demo.vue +2 -2
  12. package/src/base-client/components/common/XIntervalPicker/XIntervalPicker.vue +121 -0
  13. package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +1 -1
  14. package/src/base-client/components/common/XReportGrid/XReport.vue +1079 -1070
  15. package/src/base-client/components/common/XReportGrid/XReportDemo.vue +46 -47
  16. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +628 -628
  17. package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +380 -380
  18. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1104 -1104
  19. package/src/base-client/components/common/XReportGrid/print.js +184 -184
  20. package/src/base-client/components/common/XTab/XTab.vue +57 -25
  21. package/src/components/cache/AKeepAlive.js +11 -4
  22. package/src/layouts/BlankView.vue +59 -3
  23. package/src/pages/ReportGrid/index.vue +76 -76
  24. package/src/router/async/router.map.js +95 -148
  25. package/src/router/guards.js +260 -263
  26. package/src/utils/microAppUtils.js +49 -40
  27. package/src/utils/routerUtil.js +526 -450
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.10.32",
3
+ "version": "1.10.35",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
package/src/App.vue CHANGED
@@ -1,196 +1,196 @@
1
- <template>
2
- <a-config-provider :locale="locale" :get-popup-container="popContainer">
3
- <router-view/>
4
- </a-config-provider>
5
- </template>
6
-
7
- <script>
8
- import { enquireScreen } from '@vue2-client/utils/util'
9
- import { mapState, mapMutations } from 'vuex'
10
- import themeUtil from '@vue2-client/utils/themeUtil'
11
- import { getI18nKey } from '@vue2-client/utils/routerUtil'
12
- import { setSystemVersion } from '@vue2-client/utils/request'
13
- import waterMark from '@vue2-client/utils/waterMark'
14
-
15
- export default {
16
- name: 'App',
17
- data () {
18
- return {
19
- locale: {}
20
- }
21
- },
22
- created () {
23
- this.setHtmlTitle()
24
- this.setLanguage(this.lang)
25
- enquireScreen(isMobile => this.setDevice(isMobile))
26
- },
27
- mounted () {
28
- this.setWeekModeTheme(this.weekMode)
29
- const configStr = localStorage.getItem(process.env.VUE_APP_WEB_CONFIG_KEY)
30
- if (configStr) {
31
- const config = JSON.parse(configStr)
32
- if (config?.$globalProp?.environment === 'dev') {
33
- // 设置水印
34
- waterMark('开发环境')
35
- }
36
- }
37
- // 设置系统版本
38
- setSystemVersion(this.compatible)
39
- // 获取基座应用的信息进行初始化
40
- this.setMicroApp()
41
- },
42
- watch: {
43
- weekMode (val) {
44
- this.setWeekModeTheme(val)
45
- },
46
- lang (val) {
47
- this.setLanguage(val)
48
- this.setHtmlTitle()
49
- },
50
- $route () {
51
- this.setHtmlTitle()
52
- },
53
- 'theme.mode': {
54
- immediate: true,
55
- handler: function (val) {
56
- this.changeThemeMode(val)
57
- }
58
- },
59
- 'theme.color': {
60
- immediate: true,
61
- handler: function (val) {
62
- this.changeThemeColor(val)
63
- }
64
- },
65
- layout: function () {
66
- window.dispatchEvent(new Event('resize'))
67
- }
68
- },
69
- computed: {
70
- ...mapState('setting', ['layout', 'theme', 'weekMode', 'lang', 'compatible'])
71
- },
72
- methods: {
73
- ...mapMutations('setting', ['setDevice']),
74
- changeThemeColor (val) {
75
- if (process.env.NODE_ENV === 'production') {
76
- const closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`)
77
- themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage)
78
- } else {
79
- console.info('为保证构建性能,关闭开发环境下的主题色切换')
80
- }
81
- },
82
- changeThemeMode (val) {
83
- if (process.env.NODE_ENV === 'production') {
84
- const closeMessage = this.$message.loading(`您选择了主题模式 ${val}, 正在切换...`)
85
- themeUtil.changeThemeColor(this.theme.color, val).then(closeMessage)
86
- } else {
87
- console.info('为保证构建性能,关闭开发环境下的主题模式切换')
88
- }
89
- },
90
- setWeekModeTheme (weekMode) {
91
- if (weekMode) {
92
- document.body.classList.add('week-mode')
93
- } else {
94
- document.body.classList.remove('week-mode')
95
- }
96
- },
97
- setMicroApp () {
98
- let baseApp = '/login'
99
- let queryData = {}
100
- const that = this
101
- if (window.__MICRO_APP_ENVIRONMENT__) {
102
- const data = window.microApp.getData() // 获取主应用下发的data数据
103
- if (data.baseroute) {
104
- baseApp = data.baseroute
105
- } // 获取主应用下发的data数据
106
- if (data.queryData) {
107
- queryData = data.queryData
108
- }
109
- this.setMicroAppTheme(data.themeStore)
110
- window.microApp.addDataListener((_data) => {
111
- if (_data.baseroute) {
112
- baseApp = _data.baseroute
113
- }
114
- that.setMicroAppTheme(_data.themeStore)
115
- })
116
- console.log('microApp', window.microApp)
117
- this.$router.replace({ path: baseApp, query: queryData })
118
- }
119
- },
120
- setMicroAppTheme (themeStore) {
121
- try {
122
- let themeScheme = 'dark'
123
- if (themeStore && themeStore.themeColor && themeStore.themeScheme) {
124
- if (themeStore.themeScheme === 'dark') {
125
- themeScheme = 'night'
126
- }
127
- themeUtil.changeThemeColor(themeStore.themeColor, themeScheme)
128
- }
129
- } catch (e) {
130
- }
131
- },
132
- setLanguage (lang) {
133
- this.$i18n.locale = lang
134
- switch (lang) {
135
- case 'CN':
136
- this.locale = require('ant-design-vue/es/locale-provider/zh_CN').default
137
- break
138
- case 'HK':
139
- this.locale = require('ant-design-vue/es/locale-provider/zh_TW').default
140
- break
141
- case 'US':
142
- default:
143
- this.locale = require('ant-design-vue/es/locale-provider/en_US').default
144
- break
145
- }
146
- },
147
- setHtmlTitle () {
148
- // 微应用下不设置title
149
- if (window.__MICRO_APP_ENVIRONMENT__) {
150
- return
151
- }
152
- const route = this.$route
153
- const key = route.path === '/' ? 'home.name' : getI18nKey(route.matched[route.matched.length - 1].path)
154
- document.title = process.env.VUE_APP_NAME + ' | ' + this.$t(key)
155
- },
156
- popContainer () {
157
- return document.getElementById('popContainer')
158
- }
159
- }
160
- }
161
- </script>
162
-
163
- <style lang="less" scoped>
164
- #id {
165
- }
166
- </style>
167
- <style lang="less">
168
- @import "./font-style/font.css";
169
-
170
- body {
171
- font-family: 'PingFangSC-Regular-woff2', 'Microsoft YaHei UI', serif !important;
172
- }
173
-
174
- .water-mark-wrap {
175
- position: absolute;
176
- width: 100%;
177
- height: 100%;
178
- z-index: 9999;
179
- pointer-events: none;
180
- top: 0;
181
- left: 0;
182
- display: flex;
183
- overflow: hidden;
184
- flex-wrap: wrap;
185
- }
186
-
187
- .water-word {
188
- display: flex;
189
- align-items: center;
190
- justify-content: center;
191
- font-size: 18px;
192
- color: rgba(8, 8, 8, 0.1);
193
- transform: rotate(-45deg);
194
- user-select: none;
195
- }
196
- </style>
1
+ <template>
2
+ <a-config-provider :locale="locale" :get-popup-container="popContainer">
3
+ <router-view/>
4
+ </a-config-provider>
5
+ </template>
6
+
7
+ <script>
8
+ import { enquireScreen } from '@vue2-client/utils/util'
9
+ import { mapState, mapMutations } from 'vuex'
10
+ import themeUtil from '@vue2-client/utils/themeUtil'
11
+ import { getI18nKey } from '@vue2-client/utils/routerUtil'
12
+ import { setSystemVersion } from '@vue2-client/utils/request'
13
+ import waterMark from '@vue2-client/utils/waterMark'
14
+ import { isMicroAppEnv } from '@vue2-client/utils/microAppUtils'
15
+
16
+ export default {
17
+ name: 'App',
18
+ data () {
19
+ return {
20
+ locale: {}
21
+ }
22
+ },
23
+ created () {
24
+ this.setHtmlTitle()
25
+ this.setLanguage(this.lang)
26
+ enquireScreen(isMobile => this.setDevice(isMobile))
27
+ },
28
+ mounted () {
29
+ this.setWeekModeTheme(this.weekMode)
30
+ const configStr = localStorage.getItem(process.env.VUE_APP_WEB_CONFIG_KEY)
31
+ if (configStr) {
32
+ const config = JSON.parse(configStr)
33
+ if (config?.$globalProp?.environment === 'dev') {
34
+ // 设置水印
35
+ waterMark('开发环境')
36
+ }
37
+ }
38
+ // 设置系统版本
39
+ setSystemVersion(this.compatible)
40
+ // 获取基座应用的信息进行初始化
41
+ this.setMicroApp()
42
+ },
43
+ watch: {
44
+ weekMode (val) {
45
+ this.setWeekModeTheme(val)
46
+ },
47
+ lang (val) {
48
+ this.setLanguage(val)
49
+ this.setHtmlTitle()
50
+ },
51
+ $route () {
52
+ this.setHtmlTitle()
53
+ },
54
+ 'theme.mode': {
55
+ immediate: true,
56
+ handler: function (val) {
57
+ this.changeThemeMode(val)
58
+ }
59
+ },
60
+ 'theme.color': {
61
+ immediate: true,
62
+ handler: function (val) {
63
+ this.changeThemeColor(val)
64
+ }
65
+ },
66
+ layout: function () {
67
+ window.dispatchEvent(new Event('resize'))
68
+ }
69
+ },
70
+ computed: {
71
+ ...mapState('setting', ['layout', 'theme', 'weekMode', 'lang', 'compatible'])
72
+ },
73
+ methods: {
74
+ ...mapMutations('setting', ['setDevice']),
75
+ changeThemeColor (val) {
76
+ if (process.env.NODE_ENV === 'production') {
77
+ const closeMessage = this.$message.loading(`您选择了主题色 ${val}, 正在切换...`)
78
+ themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage)
79
+ } else {
80
+ console.info('为保证构建性能,关闭开发环境下的主题色切换')
81
+ }
82
+ },
83
+ changeThemeMode (val) {
84
+ if (process.env.NODE_ENV === 'production') {
85
+ const closeMessage = this.$message.loading(`您选择了主题模式 ${val}, 正在切换...`)
86
+ themeUtil.changeThemeColor(this.theme.color, val).then(closeMessage)
87
+ } else {
88
+ console.info('为保证构建性能,关闭开发环境下的主题模式切换')
89
+ }
90
+ },
91
+ setWeekModeTheme (weekMode) {
92
+ if (weekMode) {
93
+ document.body.classList.add('week-mode')
94
+ } else {
95
+ document.body.classList.remove('week-mode')
96
+ }
97
+ },
98
+ setMicroApp () {
99
+ let baseApp = '/login'
100
+ let queryData = {}
101
+ const that = this
102
+ if (isMicroAppEnv()) {
103
+ const data = window.microApp.getData() // 获取主应用下发的data数据
104
+ if (data.baseroute) {
105
+ baseApp = data.baseroute
106
+ } // 获取主应用下发的data数据
107
+ if (data.queryData) {
108
+ queryData = data.queryData
109
+ }
110
+ this.setMicroAppTheme(data.themeStore)
111
+ window.microApp.addDataListener((_data) => {
112
+ if (_data.baseroute) {
113
+ baseApp = _data.baseroute
114
+ }
115
+ that.setMicroAppTheme(_data.themeStore)
116
+ })
117
+ this.$router.replace({ path: baseApp, query: queryData })
118
+ }
119
+ },
120
+ setMicroAppTheme (themeStore) {
121
+ try {
122
+ let themeScheme = 'dark'
123
+ if (themeStore && themeStore.themeColor && themeStore.themeScheme) {
124
+ if (themeStore.themeScheme === 'dark') {
125
+ themeScheme = 'night'
126
+ }
127
+ themeUtil.changeThemeColor(themeStore.themeColor, themeScheme)
128
+ }
129
+ } catch (e) {
130
+ }
131
+ },
132
+ setLanguage (lang) {
133
+ this.$i18n.locale = lang
134
+ switch (lang) {
135
+ case 'CN':
136
+ this.locale = require('ant-design-vue/es/locale-provider/zh_CN').default
137
+ break
138
+ case 'HK':
139
+ this.locale = require('ant-design-vue/es/locale-provider/zh_TW').default
140
+ break
141
+ case 'US':
142
+ default:
143
+ this.locale = require('ant-design-vue/es/locale-provider/en_US').default
144
+ break
145
+ }
146
+ },
147
+ setHtmlTitle () {
148
+ // 微应用下不设置title
149
+ if (window.__MICRO_APP_ENVIRONMENT__) {
150
+ return
151
+ }
152
+ const route = this.$route
153
+ const key = route.path === '/' ? 'home.name' : getI18nKey(route.matched[route.matched.length - 1].path)
154
+ document.title = process.env.VUE_APP_NAME + ' | ' + this.$t(key)
155
+ },
156
+ popContainer () {
157
+ return document.getElementById('popContainer')
158
+ }
159
+ }
160
+ }
161
+ </script>
162
+
163
+ <style lang="less" scoped>
164
+ #id {
165
+ }
166
+ </style>
167
+ <style lang="less">
168
+ @import "./font-style/font.css";
169
+
170
+ body {
171
+ font-family: 'PingFangSC-Regular-woff2', 'Microsoft YaHei UI', serif !important;
172
+ }
173
+
174
+ .water-mark-wrap {
175
+ position: absolute;
176
+ width: 100%;
177
+ height: 100%;
178
+ z-index: 9999;
179
+ pointer-events: none;
180
+ top: 0;
181
+ left: 0;
182
+ display: flex;
183
+ overflow: hidden;
184
+ flex-wrap: wrap;
185
+ }
186
+
187
+ .water-word {
188
+ display: flex;
189
+ align-items: center;
190
+ justify-content: center;
191
+ font-size: 18px;
192
+ color: rgba(8, 8, 8, 0.1);
193
+ transform: rotate(-45deg);
194
+ user-select: none;
195
+ }
196
+ </style>
@@ -1,43 +1,43 @@
1
- <script>
2
- import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
3
- import { getConfigByNameAsync } from '@vue2-client/services/api/common'
4
-
5
- export default {
6
- name: 'Demo',
7
- components: { XAddNativeForm },
8
- mounted () {
9
- const realTableData = [{ tsc_f_contract_id: null, tsc_f_contract_code: '3316370809565024955', tsc_f_createfile_date: '2025-01-13 00:00:00', tsc_f_data: '王翔测试-15358338312: 繁荣南路滨河花园4楼号4单元19楼层1908门牌号' }]
10
- getConfigByNameAsync('signContractForm', 'af-revenue').then(res => {
11
- this.$refs.xAddFrom.init(Object.assign(res, {
12
- modifyModelData: {
13
- data: {
14
- oldSignList: realTableData
15
- }
16
- }
17
- }))
18
- })
19
- },
20
- methods: {
21
- aaa (attr, value) {
22
- },
23
- singLocal () {
24
- console.log('singLocal')
25
- }
26
- }
27
- }
28
- </script>
29
-
30
- <template>
31
- <a-card>
32
- <x-add-native-form
33
- ref="xAddFrom"
34
- @getinfo="aaa"
35
- @onSubmit="aaa"
36
- @singLocal="singLocal"
37
- />
38
- </a-card>
39
- </template>
40
-
41
- <style scoped lang="less">
42
-
43
- </style>
1
+ <script>
2
+ import XAddNativeForm from '@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'
3
+ import { getConfigByNameAsync } from '@vue2-client/services/api/common'
4
+
5
+ export default {
6
+ name: 'Demo',
7
+ components: { XAddNativeForm },
8
+ mounted () {
9
+ const realTableData = [{ tsc_f_contract_id: null, tsc_f_contract_code: '3316370809565024955', tsc_f_createfile_date: '2025-01-13 00:00:00', tsc_f_data: '王翔测试-15358338312: 繁荣南路滨河花园4楼号4单元19楼层1908门牌号' }]
10
+ getConfigByNameAsync('ceshiCRUD', 'af-system').then(res => {
11
+ this.$refs.xAddFrom.init(Object.assign(res, {
12
+ modifyModelData: {
13
+ data: {
14
+ oldSignList: realTableData
15
+ }
16
+ }
17
+ }))
18
+ })
19
+ },
20
+ methods: {
21
+ aaa (attr, value) {
22
+ },
23
+ singLocal () {
24
+ console.log('singLocal')
25
+ }
26
+ }
27
+ }
28
+ </script>
29
+
30
+ <template>
31
+ <a-card>
32
+ <x-add-native-form
33
+ ref="xAddFrom"
34
+ @getinfo="aaa"
35
+ @onSubmit="aaa"
36
+ @singLocal="singLocal"
37
+ />
38
+ </a-card>
39
+ </template>
40
+
41
+ <style scoped lang="less">
42
+
43
+ </style>
@@ -87,7 +87,7 @@ export default {
87
87
  currUser: this.currUser
88
88
  }
89
89
  },
90
- inject: ['getParentComponentByName'],
90
+ inject: ['getParentComponentByName', 'setGlobalData', 'getGlobalData'],
91
91
  computed: {
92
92
  businessTitle () {
93
93
  return this.businessType + this.title
@@ -44,6 +44,18 @@ export default {
44
44
  return null
45
45
  },
46
46
  },
47
+ setGlobalData: {
48
+ default: () => () => {
49
+ console.warn('setGlobalData is not provided.')
50
+ return null
51
+ },
52
+ },
53
+ getGlobalData: {
54
+ default: () => () => {
55
+ console.warn('getGlobalData is not provided.')
56
+ return null
57
+ },
58
+ },
47
59
  getSelectedData: {
48
60
  default: () => () => {
49
61
  console.warn('getSelectedData is not provided.')
@@ -4,22 +4,23 @@
4
4
  <template v-for="(card, itemIndex) in data">
5
5
  <a-card :key="'card' + itemIndex" class="data-card">
6
6
  <!-- 绑带 -->
7
- <!-- <div class="ribbon" v-for="column in tableColumns" v-if="column.dataIndex === item.key" :key="column.dataIndex">-->
8
- <!-- <template v-if="column.slotType === 'badge'">-->
9
- <!-- <x-badge-->
10
- <!-- :service-name="serviceName"-->
11
- <!-- :env="env"-->
12
- <!-- :dataCard="true"-->
13
- <!-- :badge-key="column.slotKeyMap"-->
14
- <!-- :value="card[item.key]" />-->
15
- <!-- </template>-->
16
- <!-- <template v-else>-->
17
- <!-- <slot :name="column.slots.customRender">{{ card[config.bandage] }}</slot>-->
18
- <!-- </template>-->
19
- <!-- </div>-->
20
- <div v-if="config && card[config.ribbon]"
21
- class="ribbon"
22
- :style="{ backgroundColor: getRibbonColor(card[config.ribbonColor]) }">
7
+ <!-- <div class="ribbon" v-for="column in tableColumns" v-if="column.dataIndex === item.key" :key="column.dataIndex">-->
8
+ <!-- <template v-if="column.slotType === 'badge'">-->
9
+ <!-- <x-badge-->
10
+ <!-- :service-name="serviceName"-->
11
+ <!-- :env="env"-->
12
+ <!-- :dataCard="true"-->
13
+ <!-- :badge-key="column.slotKeyMap"-->
14
+ <!-- :value="card[item.key]" />-->
15
+ <!-- </template>-->
16
+ <!-- <template v-else>-->
17
+ <!-- <slot :name="column.slots.customRender">{{ card[config.bandage] }}</slot>-->
18
+ <!-- </template>-->
19
+ <!-- </div>-->
20
+ <div
21
+ v-if="config && card[config.ribbon]"
22
+ class="ribbon"
23
+ :style="{ backgroundColor: getRibbonColor(card[config.ribbonColor]) }">
23
24
  {{ card[config.ribbon] }}
24
25
  </div>
25
26
  <!-- 自定义标题 -->