vue2-client 1.10.33 → 1.11.1

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 (29) hide show
  1. package/package.json +107 -107
  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 +207 -207
  5. package/src/base-client/components/common/XConversation/XConversation.vue +275 -263
  6. package/src/base-client/components/common/XForm/XForm.vue +393 -393
  7. package/src/base-client/components/common/XForm/XFormItem.vue +1248 -1248
  8. package/src/base-client/components/common/XFormCol/XFormCol.vue +157 -157
  9. package/src/base-client/components/common/XFormTable/XFormTable.vue +868 -856
  10. package/src/base-client/components/common/XIntervalPicker/XIntervalPicker.vue +121 -121
  11. package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +201 -201
  12. package/src/base-client/components/common/XReportGrid/XReport.vue +1079 -1070
  13. package/src/base-client/components/common/XReportGrid/XReportDemo.vue +46 -47
  14. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +628 -628
  15. package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +380 -380
  16. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1104 -1104
  17. package/src/base-client/components/common/XReportGrid/print.js +184 -184
  18. package/src/base-client/components/common/XTab/XTab.vue +233 -201
  19. package/src/base-client/components/common/XTable/XTable.vue +114 -195
  20. package/src/base-client/components/common/XTable/XTableWrapper.vue +240 -0
  21. package/src/base-client/components/layout/XPageView/RenderRow.vue +12 -11
  22. package/src/components/STable/index.js +12 -12
  23. package/src/components/cache/AKeepAlive.js +179 -179
  24. package/src/layouts/BlankView.vue +78 -78
  25. package/src/pages/ReportGrid/index.vue +76 -76
  26. package/src/router/async/router.map.js +148 -95
  27. package/src/utils/indexedDB.js +167 -216
  28. package/src/utils/microAppUtils.js +49 -49
  29. package/vue.config.js +6 -5
@@ -1,121 +1,121 @@
1
- <template>
2
- <div>
3
- <!-- 新增/修改模式 -->
4
- <a-input
5
- v-if="mode === '新增/修改'"
6
- v-model="singleValue"
7
- :read-only="readOnly"
8
- :disabled="disabled"
9
- style="width:100%"
10
- :placeholder="placeholder"
11
- @blur="handleBlur"
12
- @change="handleSingleChange"/>
13
- <!-- 查询模式 -->
14
- <a-input-group v-else compact>
15
- <a-input
16
- v-model="localValue[0]"
17
- class="intervalPicker-begin"
18
- :placeholder="startPlaceholder"
19
- @change="handleChange"/>
20
- <a-input
21
- class="intervalPicker-center"
22
- style="backgroundColor: #fff"
23
- placeholder="~"
24
- disabled
25
- />
26
- <a-input
27
- v-model="localValue[1]"
28
- class="intervalPicker-end"
29
- :placeholder="endPlaceholder"
30
- @change="handleChange"/>
31
- </a-input-group>
32
- </div>
33
- </template>
34
-
35
- <script>
36
- export default {
37
- name: 'XIntervalPicker',
38
- props: {
39
- value: {
40
- type: [Array, String, Number],
41
- default: () => undefined
42
- },
43
- mode: {
44
- type: String,
45
- default: '查询'
46
- },
47
- readOnly: {
48
- type: Boolean,
49
- default: false
50
- },
51
- disabled: {
52
- type: Boolean,
53
- default: false
54
- },
55
- placeholder: {
56
- type: String,
57
- default: '请输入'
58
- },
59
- startPlaceholder: {
60
- type: String,
61
- default: '起始值'
62
- },
63
- endPlaceholder: {
64
- type: String,
65
- default: '结束值'
66
- }
67
- },
68
- data () {
69
- return {
70
- localValue: ['', ''],
71
- singleValue: ''
72
- }
73
- },
74
- watch: {
75
- value: {
76
- handler (newVal) {
77
- if (this.mode === '新增/修改') {
78
- this.singleValue = newVal || ''
79
- } else {
80
- this.localValue = Array.isArray(newVal) ? [...newVal] : ['', '']
81
- }
82
- },
83
- immediate: true
84
- }
85
- },
86
- methods: {
87
- handleChange () {
88
- // 如果两个输入框都为空或undefined,则发出undefined
89
- if (!this.localValue[0] && !this.localValue[1]) {
90
- this.$emit('input', undefined)
91
- return
92
- }
93
- // 否则发出当前数组值
94
- this.$emit('input', this.localValue)
95
- },
96
- handleSingleChange () {
97
- this.$emit('input', this.singleValue || undefined)
98
- },
99
- handleBlur (e) {
100
- this.$emit('blur', e)
101
- }
102
- }
103
- }
104
- </script>
105
-
106
- <style lang="less" scoped>
107
- .intervalPicker-begin {
108
- width: calc(50% - 14px);
109
- }
110
-
111
- .intervalPicker-center {
112
- width: 30px;
113
- border-left: 0;
114
- pointer-events: none;
115
- }
116
-
117
- .intervalPicker-end {
118
- width: calc(50% - 14px);
119
- border-left: 0;
120
- }
121
- </style>
1
+ <template>
2
+ <div>
3
+ <!-- 新增/修改模式 -->
4
+ <a-input
5
+ v-if="mode === '新增/修改'"
6
+ v-model="singleValue"
7
+ :read-only="readOnly"
8
+ :disabled="disabled"
9
+ style="width:100%"
10
+ :placeholder="placeholder"
11
+ @blur="handleBlur"
12
+ @change="handleSingleChange"/>
13
+ <!-- 查询模式 -->
14
+ <a-input-group v-else compact>
15
+ <a-input
16
+ v-model="localValue[0]"
17
+ class="intervalPicker-begin"
18
+ :placeholder="startPlaceholder"
19
+ @change="handleChange"/>
20
+ <a-input
21
+ class="intervalPicker-center"
22
+ style="backgroundColor: #fff"
23
+ placeholder="~"
24
+ disabled
25
+ />
26
+ <a-input
27
+ v-model="localValue[1]"
28
+ class="intervalPicker-end"
29
+ :placeholder="endPlaceholder"
30
+ @change="handleChange"/>
31
+ </a-input-group>
32
+ </div>
33
+ </template>
34
+
35
+ <script>
36
+ export default {
37
+ name: 'XIntervalPicker',
38
+ props: {
39
+ value: {
40
+ type: [Array, String, Number],
41
+ default: () => undefined
42
+ },
43
+ mode: {
44
+ type: String,
45
+ default: '查询'
46
+ },
47
+ readOnly: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ disabled: {
52
+ type: Boolean,
53
+ default: false
54
+ },
55
+ placeholder: {
56
+ type: String,
57
+ default: '请输入'
58
+ },
59
+ startPlaceholder: {
60
+ type: String,
61
+ default: '起始值'
62
+ },
63
+ endPlaceholder: {
64
+ type: String,
65
+ default: '结束值'
66
+ }
67
+ },
68
+ data () {
69
+ return {
70
+ localValue: ['', ''],
71
+ singleValue: ''
72
+ }
73
+ },
74
+ watch: {
75
+ value: {
76
+ handler (newVal) {
77
+ if (this.mode === '新增/修改') {
78
+ this.singleValue = newVal || ''
79
+ } else {
80
+ this.localValue = Array.isArray(newVal) ? [...newVal] : ['', '']
81
+ }
82
+ },
83
+ immediate: true
84
+ }
85
+ },
86
+ methods: {
87
+ handleChange () {
88
+ // 如果两个输入框都为空或undefined,则发出undefined
89
+ if (!this.localValue[0] && !this.localValue[1]) {
90
+ this.$emit('input', undefined)
91
+ return
92
+ }
93
+ // 否则发出当前数组值
94
+ this.$emit('input', this.localValue)
95
+ },
96
+ handleSingleChange () {
97
+ this.$emit('input', this.singleValue || undefined)
98
+ },
99
+ handleBlur (e) {
100
+ this.$emit('blur', e)
101
+ }
102
+ }
103
+ }
104
+ </script>
105
+
106
+ <style lang="less" scoped>
107
+ .intervalPicker-begin {
108
+ width: calc(50% - 14px);
109
+ }
110
+
111
+ .intervalPicker-center {
112
+ width: 30px;
113
+ border-left: 0;
114
+ pointer-events: none;
115
+ }
116
+
117
+ .intervalPicker-end {
118
+ width: calc(50% - 14px);
119
+ border-left: 0;
120
+ }
121
+ </style>
@@ -1,201 +1,201 @@
1
- <template>
2
- <a-drawer
3
- :destroyOnClose="true"
4
- :visible="visible"
5
- placement="right"
6
- width="85vw"
7
- @close="visible=false"
8
- v-bind="attr">
9
- <x-report
10
- @updateImg="updateImg"
11
- @selectRow="selectRow"
12
- ref="main"
13
- :env="env"
14
- :use-oss-for-img="false"
15
- :config-name="configName"
16
- :show-img-in-cell="true"
17
- :display-only="displayOnly"
18
- :edit-mode="false"
19
- :show-save-button="false"
20
- :dont-format="true"/>
21
- </a-drawer>
22
- </template>
23
- <script>
24
- import { mapState } from 'vuex'
25
- import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
26
- import { runLogic } from '@vue2-client/services/api/common'
27
- import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
28
- import { getRealKeyData } from '@vue2-client/utils/util'
29
-
30
- export default {
31
- name: 'XReportDrawer',
32
- components: {
33
- XReport: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue'),
34
- },
35
- props: {
36
- env: {
37
- type: String,
38
- default: 'prod'
39
- }
40
- },
41
- data () {
42
- return {
43
- // 业务类型
44
- businessType: '',
45
- configName: '',
46
- displayOnly: true,
47
- serverName: '',
48
- // 业务标题
49
- title: '',
50
- // 自定义标题
51
- resolvedTitle: '',
52
- // 新增或修改业务是否执行中
53
- loading: false,
54
- // 是否显示新增/修改模态框
55
- visible: false,
56
- // 选中的处理对象的id号
57
- selectedId: null,
58
- // 混入插槽组件的数据
59
- mixinData: {},
60
- // 打开窗口接收到的外部环境数据
61
- outEnv: {},
62
- // 外部传递来的 modal 参数
63
- attr: {},
64
- }
65
- },
66
- provide () {
67
- return {
68
- getSelectedId: () => this.getSelectedId(),
69
- getSelectedData: () => {
70
- return this.selectedId
71
- },
72
- getMixinData: () => {
73
- return this.mixinData
74
- },
75
- getOutEnv: () => {
76
- return this.outEnv
77
- },
78
- isInAModal: () => {
79
- return true
80
- },
81
- currUser: this.currUser
82
- }
83
- },
84
- inject: ['getParentComponentByName'],
85
- computed: {
86
- businessTitle () {
87
- return this.businessType + this.title
88
- },
89
- ...mapState('account', { currUser: 'user' })
90
- },
91
- methods: {
92
- getWindow,
93
- isMicroAppEnv,
94
- microDispatch,
95
- getMicroData,
96
- getRealKeyData,
97
- runLogic,
98
- init (params) {
99
- console.log('params', params)
100
- const {
101
- configName = '',
102
- serverName = process.env.VUE_APP_SYSTEM_NAME,
103
- displayOnly = true,
104
- selectedId = null,
105
- outEnv = {},
106
- mixinData = {},
107
- attr = {}
108
- } = params
109
- this.configName = configName
110
- this.serverName = serverName
111
- this.displayOnly = displayOnly
112
- this.visible = true
113
- this.attr = attr
114
- // 有选中项,给选中项赋值
115
- if (selectedId) {
116
- this.selectedId = selectedId
117
- }
118
- // 当有些组件需要外部传数据时 使用这个混入
119
- this.mixinData = mixinData
120
- // 把打开时的环境传递给打开窗口,以便js脚本中使用
121
- this.outEnv = outEnv
122
- },
123
- getSelectedId () {
124
- if (typeof this.selectedId === 'object') {
125
- if (this.selectedId.selectedId) {
126
- return this.selectedId.selectedId
127
- }
128
- if (Object.keys(this.selectedId) > 0) {
129
- return this.selectedId[Object.keys(this.selectedId)[0]]
130
- }
131
- } else {
132
- return this.selectedId
133
- }
134
- },
135
- selectRow (selectedRowKeys, selectedRows) {
136
- this.table_selectedRowKeys = selectedRowKeys
137
- this.table_selectedRows = selectedRows
138
- console.log('XAddReport')
139
- this.$emit('selectRow', selectedRowKeys, selectedRows)
140
- },
141
- close () {
142
- this.loading = false
143
- this.visible = false
144
- this.$emit('close')
145
- },
146
- getComponentByName (name) {
147
- const innerRef = this.getParentComponentByName(name)
148
- if (innerRef) {
149
- return innerRef
150
- } else {
151
- return this.$refs.main.getComponentByName(name)
152
- }
153
- },
154
- async onSubmit () {
155
- if (this.$refs.main?.config?.confirmFunction) {
156
- console.info('执行自定义确认逻辑')
157
- let func = this.$refs.main?.config?.confirmFunction
158
- if (func && func.startsWith('function')) {
159
- func = func.replace('function', 'async function')
160
- }
161
- const result = executeStrFunctionByContext(this, func, [])
162
- if (result instanceof Promise) {
163
- result.then((res) => {
164
- if (!res) {
165
- this.close()
166
- return
167
- }
168
- let messageType = 'success'
169
- // 如果传递了组件名字 自动调用刷新
170
- if (res?.name) {
171
- const waitRefreshRef = this.getComponentByName(res.name)
172
- if (waitRefreshRef) {
173
- waitRefreshRef.refresh()
174
- } else {
175
- console.warn(`未找到组件${res.name}无法刷新`)
176
- }
177
- }
178
- // 如果传递消息类型 自动调用消息
179
- if (res?.messageType) {
180
- messageType = res.messageType
181
- }
182
- // 如果传递了提示信息自动调用提示
183
- if (res?.message) {
184
- this.$message[messageType](res?.message)
185
- }
186
- this.close()
187
- })
188
- } else {
189
- this.close()
190
- }
191
- } else {
192
- console.warn('未配置modal确认按钮逻辑')
193
- this.close()
194
- }
195
- },
196
- updateImg (data) {
197
- console.log(data)
198
- }
199
- }
200
- }
201
- </script>
1
+ <template>
2
+ <a-drawer
3
+ :destroyOnClose="true"
4
+ :visible="visible"
5
+ placement="right"
6
+ width="85vw"
7
+ @close="visible=false"
8
+ v-bind="attr">
9
+ <x-report
10
+ @updateImg="updateImg"
11
+ @selectRow="selectRow"
12
+ ref="main"
13
+ :env="env"
14
+ :use-oss-for-img="false"
15
+ :config-name="configName"
16
+ :show-img-in-cell="true"
17
+ :display-only="displayOnly"
18
+ :edit-mode="false"
19
+ :show-save-button="false"
20
+ :dont-format="true"/>
21
+ </a-drawer>
22
+ </template>
23
+ <script>
24
+ import { mapState } from 'vuex'
25
+ import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
26
+ import { runLogic } from '@vue2-client/services/api/common'
27
+ import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
28
+ import { getRealKeyData } from '@vue2-client/utils/util'
29
+
30
+ export default {
31
+ name: 'XReportDrawer',
32
+ components: {
33
+ XReport: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue'),
34
+ },
35
+ props: {
36
+ env: {
37
+ type: String,
38
+ default: 'prod'
39
+ }
40
+ },
41
+ data () {
42
+ return {
43
+ // 业务类型
44
+ businessType: '',
45
+ configName: '',
46
+ displayOnly: true,
47
+ serverName: '',
48
+ // 业务标题
49
+ title: '',
50
+ // 自定义标题
51
+ resolvedTitle: '',
52
+ // 新增或修改业务是否执行中
53
+ loading: false,
54
+ // 是否显示新增/修改模态框
55
+ visible: false,
56
+ // 选中的处理对象的id号
57
+ selectedId: null,
58
+ // 混入插槽组件的数据
59
+ mixinData: {},
60
+ // 打开窗口接收到的外部环境数据
61
+ outEnv: {},
62
+ // 外部传递来的 modal 参数
63
+ attr: {},
64
+ }
65
+ },
66
+ provide () {
67
+ return {
68
+ getSelectedId: () => this.getSelectedId(),
69
+ getSelectedData: () => {
70
+ return this.selectedId
71
+ },
72
+ getMixinData: () => {
73
+ return this.mixinData
74
+ },
75
+ getOutEnv: () => {
76
+ return this.outEnv
77
+ },
78
+ isInAModal: () => {
79
+ return true
80
+ },
81
+ currUser: this.currUser
82
+ }
83
+ },
84
+ inject: ['getParentComponentByName', 'setGlobalData', 'getGlobalData'],
85
+ computed: {
86
+ businessTitle () {
87
+ return this.businessType + this.title
88
+ },
89
+ ...mapState('account', { currUser: 'user' })
90
+ },
91
+ methods: {
92
+ getWindow,
93
+ isMicroAppEnv,
94
+ microDispatch,
95
+ getMicroData,
96
+ getRealKeyData,
97
+ runLogic,
98
+ init (params) {
99
+ console.log('params', params)
100
+ const {
101
+ configName = '',
102
+ serverName = process.env.VUE_APP_SYSTEM_NAME,
103
+ displayOnly = true,
104
+ selectedId = null,
105
+ outEnv = {},
106
+ mixinData = {},
107
+ attr = {}
108
+ } = params
109
+ this.configName = configName
110
+ this.serverName = serverName
111
+ this.displayOnly = displayOnly
112
+ this.visible = true
113
+ this.attr = attr
114
+ // 有选中项,给选中项赋值
115
+ if (selectedId) {
116
+ this.selectedId = selectedId
117
+ }
118
+ // 当有些组件需要外部传数据时 使用这个混入
119
+ this.mixinData = mixinData
120
+ // 把打开时的环境传递给打开窗口,以便js脚本中使用
121
+ this.outEnv = outEnv
122
+ },
123
+ getSelectedId () {
124
+ if (typeof this.selectedId === 'object') {
125
+ if (this.selectedId.selectedId) {
126
+ return this.selectedId.selectedId
127
+ }
128
+ if (Object.keys(this.selectedId) > 0) {
129
+ return this.selectedId[Object.keys(this.selectedId)[0]]
130
+ }
131
+ } else {
132
+ return this.selectedId
133
+ }
134
+ },
135
+ selectRow (selectedRowKeys, selectedRows) {
136
+ this.table_selectedRowKeys = selectedRowKeys
137
+ this.table_selectedRows = selectedRows
138
+ console.log('XAddReport')
139
+ this.$emit('selectRow', selectedRowKeys, selectedRows)
140
+ },
141
+ close () {
142
+ this.loading = false
143
+ this.visible = false
144
+ this.$emit('close')
145
+ },
146
+ getComponentByName (name) {
147
+ const innerRef = this.getParentComponentByName(name)
148
+ if (innerRef) {
149
+ return innerRef
150
+ } else {
151
+ return this.$refs.main.getComponentByName(name)
152
+ }
153
+ },
154
+ async onSubmit () {
155
+ if (this.$refs.main?.config?.confirmFunction) {
156
+ console.info('执行自定义确认逻辑')
157
+ let func = this.$refs.main?.config?.confirmFunction
158
+ if (func && func.startsWith('function')) {
159
+ func = func.replace('function', 'async function')
160
+ }
161
+ const result = executeStrFunctionByContext(this, func, [])
162
+ if (result instanceof Promise) {
163
+ result.then((res) => {
164
+ if (!res) {
165
+ this.close()
166
+ return
167
+ }
168
+ let messageType = 'success'
169
+ // 如果传递了组件名字 自动调用刷新
170
+ if (res?.name) {
171
+ const waitRefreshRef = this.getComponentByName(res.name)
172
+ if (waitRefreshRef) {
173
+ waitRefreshRef.refresh()
174
+ } else {
175
+ console.warn(`未找到组件${res.name}无法刷新`)
176
+ }
177
+ }
178
+ // 如果传递消息类型 自动调用消息
179
+ if (res?.messageType) {
180
+ messageType = res.messageType
181
+ }
182
+ // 如果传递了提示信息自动调用提示
183
+ if (res?.message) {
184
+ this.$message[messageType](res?.message)
185
+ }
186
+ this.close()
187
+ })
188
+ } else {
189
+ this.close()
190
+ }
191
+ } else {
192
+ console.warn('未配置modal确认按钮逻辑')
193
+ this.close()
194
+ }
195
+ },
196
+ updateImg (data) {
197
+ console.log(data)
198
+ }
199
+ }
200
+ }
201
+ </script>