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