vue2-client 1.12.2 → 1.12.3-9.alpha.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 (44) hide show
  1. package/.env.iot +19 -0
  2. package/babel.config.js +4 -1
  3. package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +175 -174
  4. package/package.json +2 -2
  5. package/src/base-client/components/common/XCardSet/XCardSet.vue +300 -0
  6. package/src/base-client/components/common/XCollapse/XCollapse.vue +154 -0
  7. package/src/base-client/components/common/XConversation/XConversation.vue +87 -2
  8. package/src/base-client/components/common/XConversation/XConversationDemo.vue +28 -28
  9. package/src/base-client/components/common/XDataCard/XDataCard.vue +47 -21
  10. package/src/base-client/components/common/XDatePicker/index.vue +13 -3
  11. package/src/base-client/components/common/XForm/XForm.vue +1 -1
  12. package/src/base-client/components/common/XForm/XFormItem.vue +17 -7
  13. package/src/base-client/components/common/XForm/XTreeSelect.vue +263 -264
  14. package/src/base-client/components/common/XForm/demo.vue +105 -0
  15. package/src/base-client/components/common/XFormTable/demo.vue +11 -3
  16. package/src/base-client/components/common/XPrint/Demo.vue +41 -41
  17. package/src/base-client/components/common/XRate/demo.vue +102 -0
  18. package/src/base-client/components/common/XRate/index.vue +136 -0
  19. package/src/base-client/components/common/XReportGrid/XReport.vue +240 -305
  20. package/src/base-client/components/common/XReportGrid/XReportDemo.vue +0 -2
  21. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +115 -345
  22. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +100 -723
  23. package/src/base-client/components/common/XTable/XTable.vue +3 -0
  24. package/src/base-client/components/common/XTable/XTableWrapper.vue +7 -3
  25. package/src/base-client/components/his/XHDescriptions/XHDescriptions.vue +172 -0
  26. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +360 -359
  27. package/src/layouts/GridView.vue +43 -45
  28. package/src/logic/plugins/common/DateTools.js +3 -0
  29. package/src/logic/plugins/common/VueTools.js +30 -0
  30. package/src/logic/plugins/index.js +3 -1
  31. package/src/pages/LogicCallExample/index.vue +10 -0
  32. package/src/pages/WorkflowDetail/WorkFlowDemo.vue +47 -32
  33. package/src/pages/WorkflowDetail/WorkflowDetail.vue +5 -0
  34. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +876 -864
  35. package/src/pages/userInfoDetailManage/index.vue +82 -82
  36. package/src/plugins/HiPrintPlugin.js +164 -124
  37. package/src/router/async/router.map.js +3 -2
  38. package/src/services/v3Api.js +116 -116
  39. package/src/utils/EncryptUtil.js +6 -7
  40. package/src/utils/indexedDB.js +3 -1
  41. package/src/utils/request.js +4 -8
  42. package/src/utils/routerUtil.js +17 -0
  43. package/.babelrc +0 -3
  44. package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +0 -380
@@ -1,359 +1,360 @@
1
- <template>
2
- <div>
3
- <div v-show="ready">
4
- <a-row class="editor-action-container" type="flex" justify="space-between">
5
- <a-col class="editor-tools">
6
- <a-space>
7
- <template v-if="resList.length > 0">
8
- <a-select
9
- style="width: 200px"
10
- v-model="toggleResId"
11
- placeholder="请选择文档"
12
- show-search
13
- @change="changeRes"
14
- >
15
- <a-select-option v-for="item of resListCp" :key="item.value" :value="item.value">{{ item.label }}</a-select-option>
16
- </a-select>
17
- <template v-if="this.modeType !== 'readonly' && this.resId !== -1">
18
- <a-button icon="plus" @click="addRes"/>
19
- </template>
20
- </template>
21
- <a-radio-group
22
- v-show="showModeChoose"
23
- button-style="solid"
24
- @change="changeMode"
25
- v-model="modeType">
26
- <a-radio-button v-for="item of modeList" :key="item.value" :value="item.value">
27
- {{ item.label }}
28
- </a-radio-button>
29
- </a-radio-group>
30
- </a-space>
31
- </a-col>
32
- <a-col class="editor-action">
33
- <a-space>
34
- <template v-if="this.modeType !== 'readonly'">
35
- <a-button type="primary" @click="openRenameModal" v-if="this.resId !== -1">
36
- 重命名
37
- </a-button>
38
- <a-button type="primary" @click="() => this.resId !== -1 ? save() : openAddResModal()">
39
- 保存
40
- </a-button>
41
- </template>
42
- <a-button type="primary" @click="print">
43
- 打印
44
- </a-button>
45
- <a-button @click="refresh">
46
- 刷新
47
- </a-button>
48
- </a-space>
49
- <a-dropdown>
50
- <a-menu slot="overlay" @click="handleExportMenuClick">
51
- <a-menu-item key="exportPdf">导出为Pdf</a-menu-item>
52
- <a-menu-item key="exportWord">导出为Word</a-menu-item>
53
- <a-menu-item key="exportHtmlWithStyle">导出为Html</a-menu-item>
54
- </a-menu>
55
- <a-button style="margin-left: 8px"> 导出 <a-icon type="down" /> </a-button>
56
- </a-dropdown>
57
- </a-col>
58
- </a-row>
59
- <a-divider/>
60
- <a-spin tip="加载中,马上好" :spinning="loading">
61
- <iframe
62
- id="x-editor"
63
- src="/his/editor/editor.html"
64
- v-bind="objectOfAttrs"
65
- @load="onload"
66
- style="height: calc(-200px - 3rem + 100vh);">
67
- </iframe>
68
- </a-spin>
69
- </div>
70
- <div v-show="!ready">
71
- <a-empty description="请选择文书" />
72
- </div>
73
- <a-modal
74
- :destroyOnClose="true"
75
- :title="this.resDataModalMode === 'modify' ? '修改文档' : '新建文档'"
76
- :visible="resDataModalVisible"
77
- okText="提交"
78
- @cancel="resDataModalVisible = false"
79
- @ok="onSubmit">
80
- <a-form-model ref="resModifyForm" :model="modifyResModel" :rules="resRules">
81
- <a-form-model-item prop="f_file_name" label="文档名">
82
- <a-input v-model="modifyResModel.f_file_name" placeholder="请输入文档名"/>
83
- </a-form-model-item>
84
- </a-form-model>
85
- </a-modal></div>
86
- </template>
87
-
88
- <script>
89
-
90
- import { runLogic } from '@vue2-client/services/api/common'
91
-
92
- export default {
93
- name: 'XHisEditor',
94
- computed: {
95
- resListCp () {
96
- const list = this.resList
97
- if (this.resId === -1) {
98
- list.push({
99
- label: '未保存文档*', value: -1
100
- })
101
- }
102
- return list
103
- }
104
- },
105
- data () {
106
- return {
107
- ready: false,
108
- loading: false,
109
- resDataModalMode: 'modify',
110
- resDataModalVisible: false,
111
- objectOfAttrs: {
112
- width: '100%',
113
- height: '650vh',
114
- frameborder: 0
115
- },
116
- // 数据模式
117
- modeType: 'readonly',
118
- // 是否显示模式切换功能
119
- showModeChoose: true,
120
- // 数据模式列表
121
- modeList: [
122
- {
123
- label: '预览',
124
- value: 'readonly'
125
- },
126
- {
127
- label: '表单',
128
- value: 'form'
129
- },
130
- {
131
- label: '设计',
132
- value: 'design'
133
- }
134
- ],
135
- // 编辑器实例
136
- editorRef: null,
137
- // 文档资源列表
138
- resList: [],
139
- // 文档资源ID
140
- resId: undefined,
141
- // 文档链接
142
- fileUrl: undefined,
143
- // 文档绑定数据
144
- bindObject: undefined,
145
- // 数据模式 template:模板编辑;data:数据编辑
146
- dataMode: undefined,
147
- // 保存数据调用的Logic名称
148
- saveDataLogicName: undefined,
149
- // 保存数据调用Logic传入的额外参数
150
- logicExtraParams: undefined,
151
- // 服务名
152
- serviceName: undefined,
153
- // 当前文档信息
154
- currResData: {},
155
- // 切换的文档id
156
- toggleResId: undefined,
157
- // 待提交的修改信息
158
- modifyResModel: {},
159
- resRules: {
160
- f_file_name: [{ required: true, message: '请输入文档名', trigger: 'blur' }],
161
- }
162
- }
163
- },
164
- methods: {
165
- // 初始化文档
166
- onload: function (e) {
167
- this.editorRef = e.target.contentWindow.editor
168
- this.$emit('init', {})
169
- },
170
- // 初始化组件
171
- init (params) {
172
- const {
173
- fileUrl,
174
- resId,
175
- currResData = {},
176
- bindObject,
177
- saveDataLogicName,
178
- logicExtraParams,
179
- serviceName,
180
- showModeChoose = true,
181
- modeType = 'readonly'
182
- } = params
183
- this.resId = resId
184
- if (bindObject) {
185
- this.dataMode = 'data'
186
- this.bindObject = bindObject
187
- } else {
188
- this.dataMode = 'template'
189
- }
190
- this.saveDataLogicName = saveDataLogicName
191
- this.logicExtraParams = logicExtraParams
192
- this.serviceName = serviceName
193
- this.showModeChoose = showModeChoose
194
- this.modeType = modeType
195
- this.ready = true
196
- this.loadFile(fileUrl, bindObject, currResData)
197
- this.loadResList()
198
- },
199
- // 加载文档
200
- loadFile (fileUrl, bindObject, currResData) {
201
- this.loading = true
202
- this.editorRef.loadUrl(fileUrl).then(() => {
203
- if (bindObject) {
204
- this.editorRef.setBindObject(bindObject)
205
- if (bindObject.template) {
206
- for (const key of Object.keys(bindObject.template)) {
207
- this.editorRef.bindDataList(key, bindObject.template[key])
208
- }
209
- }
210
- }
211
- this.changeMode()
212
- this.fileUrl = fileUrl
213
- if (!currResData.f_file_name) {
214
- currResData.f_file_name = '未命名'
215
- }
216
- this.currResData = currResData
217
- this.loading = false
218
- this.$emit('afterLoadFile', {})
219
- })
220
- },
221
- // 加载文档列表
222
- loadResList () {
223
- runLogic('getMedicalList', this.logicExtraParams, this.serviceName).then(res => {
224
- this.resList = res
225
- this.toggleResId = this.resId
226
- })
227
- },
228
- // 修改模式
229
- changeMode (e) {
230
- this.editorRef.execCommand(this.modeType)
231
- },
232
- // 打开文档信息修改面板
233
- openRenameModal () {
234
- this.resDataModalMode = 'modify'
235
- this.modifyResModel = {
236
- f_file_name: this.currResData.f_file_name
237
- }
238
- this.resDataModalVisible = true
239
- },
240
- // 提交文档信息修改
241
- onSubmit () {
242
- this.$refs.resModifyForm.validate(valid => {
243
- if (valid) {
244
- if (this.resDataModalMode === 'modify' && this.modifyResModel.f_file_name === this.currResData.f_file_name) {
245
- this.$message.warn('新文档名不能与原文档名一致!')
246
- return false
247
- }
248
- this.save()
249
- return true
250
- } else {
251
- return false
252
- }
253
- })
254
- },
255
- // 打开文档新建面板
256
- openAddResModal () {
257
- this.resDataModalMode = 'add'
258
- this.modifyResModel = {
259
- f_file_name: undefined
260
- }
261
- this.resDataModalVisible = true
262
- },
263
- // 新建文档
264
- addRes () {
265
- const params = Object.assign({
266
- isAddForce: true
267
- }, this.logicExtraParams)
268
- this.reload(params)
269
- },
270
- // 重新加载
271
- reload (params) {
272
- runLogic('getMedicalRecord', params, this.serviceName).then(res => {
273
- this.resDataModalVisible = false
274
- this.init({
275
- modeType: this.modeType,
276
- fileUrl: res.url,
277
- resId: res.id,
278
- currResData: res.currResData,
279
- bindObject: res.bindObject,
280
- saveDataLogicName: this.saveDataLogicName,
281
- serviceName: this.serviceName,
282
- logicExtraParams: this.logicExtraParams
283
- })
284
- })
285
- },
286
- // 切换文档
287
- changeRes (value) {
288
- if (this.resId === -1) {
289
- const that = this
290
- this.$confirm({
291
- title: '确认切换文档吗?',
292
- content: '您有尚未保存的文档,切换文档将丢失所有的修改',
293
- onOk () {
294
- that.reload({
295
- resId: value
296
- })
297
- },
298
- onCancel () {
299
- that.toggleResId = that.resId
300
- },
301
- })
302
- } else {
303
- this.reload({
304
- resId: value
305
- })
306
- }
307
- },
308
- // 保存文档
309
- save () {
310
- // 验证必须输入项
311
- if (this.editorRef.validate()) {
312
- // 获取HTML文档和结构化数据(JSON)
313
- const data = {
314
- doc: this.editorRef.getHtml(),
315
- dataObject: this.editorRef.getBindObject(),
316
- dataMode: this.dataMode,
317
- resId: this.resId,
318
- modifyResModel: this.modifyResModel,
319
- logicExtraParams: this.logicExtraParams
320
- }
321
- // 保存HTML文档和结构化数据到后端服务
322
- runLogic(this.saveDataLogicName, data, this.serviceName).then(res => {
323
- this.$message.success('保存成功')
324
- this.changeRes(res.currResData.id)
325
- }).finally(() => {
326
- this.resDataModalVisible = false
327
- })
328
- } else {
329
- this.$message.error('请检查未填写的项目')
330
- }
331
- },
332
- // 打印文档
333
- print () {
334
- this.editorRef.execCommand('print')
335
- },
336
- // 关闭编辑器
337
- close () {
338
- this.ready = false
339
- },
340
- // 刷新文档
341
- refresh () {
342
- this.loadFile(this.fileUrl, this.bindObject, this.currResData)
343
- },
344
- // 导出下拉菜单
345
- handleExportMenuClick (e) {
346
- const key = e.key
347
- this.editorRef.execCommand(key)
348
- }
349
- }
350
- }
351
- </script>
352
- <style scoped lang="less">
353
- .editor-action-container {
354
- height: 40px;
355
- }
356
- :deep(.ant-divider-horizontal) {
357
- margin: 4px 0;
358
- }
359
- </style>
1
+ <template>
2
+ <div>
3
+ <div v-show="ready">
4
+ <a-row class="editor-action-container" type="flex" justify="space-between">
5
+ <a-col class="editor-tools">
6
+ <a-space>
7
+ <template v-if="resList.length > 0">
8
+ <a-select
9
+ style="width: 200px"
10
+ v-model="toggleResId"
11
+ placeholder="请选择文档"
12
+ show-search
13
+ @change="changeRes"
14
+ >
15
+ <a-select-option v-for="item of resListCp" :key="item.value" :value="item.value">{{ item.label }}</a-select-option>
16
+ </a-select>
17
+ <template v-if="this.modeType !== 'readonly' && this.resId !== -1">
18
+ <a-button icon="plus" @click="addRes"/>
19
+ </template>
20
+ </template>
21
+ <a-radio-group
22
+ v-show="showModeChoose"
23
+ button-style="solid"
24
+ @change="changeMode"
25
+ v-model="modeType">
26
+ <a-radio-button v-for="item of modeList" :key="item.value" :value="item.value">
27
+ {{ item.label }}
28
+ </a-radio-button>
29
+ </a-radio-group>
30
+ </a-space>
31
+ </a-col>
32
+ <a-col class="editor-action">
33
+ <a-space>
34
+ <template v-if="this.modeType !== 'readonly'">
35
+ <a-button type="primary" @click="openRenameModal" v-if="this.resId !== -1">
36
+ 重命名
37
+ </a-button>
38
+ <a-button type="primary" @click="() => this.resId !== -1 ? save() : openAddResModal()">
39
+ 保存
40
+ </a-button>
41
+ </template>
42
+ <a-button type="primary" @click="print">
43
+ 打印
44
+ </a-button>
45
+ <a-button @click="refresh">
46
+ 刷新
47
+ </a-button>
48
+ </a-space>
49
+ <a-dropdown>
50
+ <a-menu slot="overlay" @click="handleExportMenuClick">
51
+ <a-menu-item key="exportPdf">导出为Pdf</a-menu-item>
52
+ <a-menu-item key="exportWord">导出为Word</a-menu-item>
53
+ <a-menu-item key="exportHtmlWithStyle">导出为Html</a-menu-item>
54
+ </a-menu>
55
+ <a-button style="margin-left: 8px"> 导出 <a-icon type="down" /> </a-button>
56
+ </a-dropdown>
57
+ </a-col>
58
+ </a-row>
59
+ <a-divider/>
60
+ <a-spin tip="加载中,马上好" :spinning="loading">
61
+ <iframe
62
+ id="x-editor"
63
+ src="/his/editor/editor.html"
64
+ v-bind="objectOfAttrs"
65
+ @load="onload"
66
+ style="height: calc(-200px - 3rem + 100vh);">
67
+ </iframe>
68
+ </a-spin>
69
+ </div>
70
+ <div v-show="!ready">
71
+ <a-empty description="请选择文书" />
72
+ </div>
73
+ <a-modal
74
+ :destroyOnClose="true"
75
+ :title="this.resDataModalMode === 'modify' ? '修改文档' : '新建文档'"
76
+ :visible="resDataModalVisible"
77
+ okText="提交"
78
+ @cancel="resDataModalVisible = false"
79
+ @ok="onSubmit">
80
+ <a-form-model ref="resModifyForm" :model="modifyResModel" :rules="resRules">
81
+ <a-form-model-item prop="f_file_name" label="文档名">
82
+ <a-input v-model="modifyResModel.f_file_name" placeholder="请输入文档名"/>
83
+ </a-form-model-item>
84
+ </a-form-model>
85
+ </a-modal></div>
86
+ </template>
87
+
88
+ <script>
89
+
90
+ import { runLogic } from '@vue2-client/services/api/common'
91
+
92
+ export default {
93
+ name: 'XHisEditor',
94
+ computed: {
95
+ resListCp () {
96
+ const list = this.resList
97
+ if (this.resId === -1) {
98
+ list.push({
99
+ label: '未保存文档*', value: -1
100
+ })
101
+ }
102
+ return list
103
+ }
104
+ },
105
+ data () {
106
+ return {
107
+ ready: false,
108
+ loading: false,
109
+ resDataModalMode: 'modify',
110
+ resDataModalVisible: false,
111
+ objectOfAttrs: {
112
+ width: '100%',
113
+ height: '650vh',
114
+ frameborder: 0
115
+ },
116
+ // 数据模式
117
+ modeType: 'readonly',
118
+ // 是否显示模式切换功能
119
+ showModeChoose: true,
120
+ // 数据模式列表
121
+ modeList: [
122
+ {
123
+ label: '预览',
124
+ value: 'readonly'
125
+ },
126
+ {
127
+ label: '表单',
128
+ value: 'form'
129
+ },
130
+ {
131
+ label: '设计',
132
+ value: 'design'
133
+ }
134
+ ],
135
+ // 编辑器实例
136
+ editorRef: null,
137
+ // 文档资源列表
138
+ resList: [],
139
+ // 文档资源ID
140
+ resId: undefined,
141
+ // 文档链接
142
+ fileUrl: undefined,
143
+ // 文档绑定数据
144
+ bindObject: undefined,
145
+ // 数据模式 template:模板编辑;data:数据编辑
146
+ dataMode: undefined,
147
+ // 保存数据调用的Logic名称
148
+ saveDataLogicName: undefined,
149
+ // 保存数据调用Logic传入的额外参数
150
+ logicExtraParams: undefined,
151
+ // 服务名
152
+ serviceName: undefined,
153
+ // 当前文档信息
154
+ currResData: {},
155
+ // 切换的文档id
156
+ toggleResId: undefined,
157
+ // 待提交的修改信息
158
+ modifyResModel: {},
159
+ resRules: {
160
+ f_file_name: [{ required: true, message: '请输入文档名', trigger: 'blur' }],
161
+ }
162
+ }
163
+ },
164
+ methods: {
165
+ runLogic,
166
+ // 初始化文档
167
+ onload: function (e) {
168
+ this.editorRef = e.target.contentWindow.editor
169
+ this.$emit('init', {})
170
+ },
171
+ // 初始化组件
172
+ init (params) {
173
+ const {
174
+ fileUrl,
175
+ resId,
176
+ currResData = {},
177
+ bindObject,
178
+ saveDataLogicName,
179
+ logicExtraParams,
180
+ serviceName,
181
+ showModeChoose = true,
182
+ modeType = 'readonly'
183
+ } = params
184
+ this.resId = resId
185
+ if (bindObject) {
186
+ this.dataMode = 'data'
187
+ this.bindObject = bindObject
188
+ } else {
189
+ this.dataMode = 'template'
190
+ }
191
+ this.saveDataLogicName = saveDataLogicName
192
+ this.logicExtraParams = logicExtraParams
193
+ this.serviceName = serviceName
194
+ this.showModeChoose = showModeChoose
195
+ this.modeType = modeType
196
+ this.ready = true
197
+ this.loadFile(fileUrl, bindObject, currResData)
198
+ this.loadResList()
199
+ },
200
+ // 加载文档
201
+ loadFile (fileUrl, bindObject, currResData) {
202
+ this.loading = true
203
+ this.editorRef.loadUrl(fileUrl).then(() => {
204
+ if (bindObject) {
205
+ this.editorRef.setBindObject(bindObject)
206
+ if (bindObject.template) {
207
+ for (const key of Object.keys(bindObject.template)) {
208
+ this.editorRef.bindDataList(key, bindObject.template[key])
209
+ }
210
+ }
211
+ }
212
+ this.changeMode()
213
+ this.fileUrl = fileUrl
214
+ if (!currResData.f_file_name) {
215
+ currResData.f_file_name = '未命名'
216
+ }
217
+ this.currResData = currResData
218
+ this.loading = false
219
+ this.$emit('afterLoadFile', {})
220
+ })
221
+ },
222
+ // 加载文档列表
223
+ loadResList () {
224
+ runLogic('getMedicalList', this.logicExtraParams, this.serviceName).then(res => {
225
+ this.resList = res
226
+ this.toggleResId = this.resId
227
+ })
228
+ },
229
+ // 修改模式
230
+ changeMode (e) {
231
+ this.editorRef.execCommand(this.modeType)
232
+ },
233
+ // 打开文档信息修改面板
234
+ openRenameModal () {
235
+ this.resDataModalMode = 'modify'
236
+ this.modifyResModel = {
237
+ f_file_name: this.currResData.f_file_name
238
+ }
239
+ this.resDataModalVisible = true
240
+ },
241
+ // 提交文档信息修改
242
+ onSubmit () {
243
+ this.$refs.resModifyForm.validate(valid => {
244
+ if (valid) {
245
+ if (this.resDataModalMode === 'modify' && this.modifyResModel.f_file_name === this.currResData.f_file_name) {
246
+ this.$message.warn('新文档名不能与原文档名一致!')
247
+ return false
248
+ }
249
+ this.save()
250
+ return true
251
+ } else {
252
+ return false
253
+ }
254
+ })
255
+ },
256
+ // 打开文档新建面板
257
+ openAddResModal () {
258
+ this.resDataModalMode = 'add'
259
+ this.modifyResModel = {
260
+ f_file_name: undefined
261
+ }
262
+ this.resDataModalVisible = true
263
+ },
264
+ // 新建文档
265
+ addRes () {
266
+ const params = Object.assign({
267
+ isAddForce: true
268
+ }, this.logicExtraParams)
269
+ this.reload(params)
270
+ },
271
+ // 重新加载
272
+ reload (params) {
273
+ runLogic('getMedicalRecord', params, this.serviceName).then(res => {
274
+ this.resDataModalVisible = false
275
+ this.init({
276
+ modeType: this.modeType,
277
+ fileUrl: res.url,
278
+ resId: res.id,
279
+ currResData: res.currResData,
280
+ bindObject: res.bindObject,
281
+ saveDataLogicName: this.saveDataLogicName,
282
+ serviceName: this.serviceName,
283
+ logicExtraParams: this.logicExtraParams
284
+ })
285
+ })
286
+ },
287
+ // 切换文档
288
+ changeRes (value) {
289
+ if (this.resId === -1) {
290
+ const that = this
291
+ this.$confirm({
292
+ title: '确认切换文档吗?',
293
+ content: '您有尚未保存的文档,切换文档将丢失所有的修改',
294
+ onOk () {
295
+ that.reload({
296
+ resId: value
297
+ })
298
+ },
299
+ onCancel () {
300
+ that.toggleResId = that.resId
301
+ },
302
+ })
303
+ } else {
304
+ this.reload({
305
+ resId: value
306
+ })
307
+ }
308
+ },
309
+ // 保存文档
310
+ save () {
311
+ // 验证必须输入项
312
+ if (this.editorRef.validate()) {
313
+ // 获取HTML文档和结构化数据(JSON)
314
+ const data = {
315
+ doc: this.editorRef.getHtml(),
316
+ dataObject: this.editorRef.getBindObject(),
317
+ dataMode: this.dataMode,
318
+ resId: this.resId,
319
+ modifyResModel: this.modifyResModel,
320
+ logicExtraParams: this.logicExtraParams
321
+ }
322
+ // 保存HTML文档和结构化数据到后端服务
323
+ runLogic(this.saveDataLogicName, data, this.serviceName).then(res => {
324
+ this.$message.success('保存成功')
325
+ this.changeRes(res.currResData.id)
326
+ }).finally(() => {
327
+ this.resDataModalVisible = false
328
+ })
329
+ } else {
330
+ this.$message.error('请检查未填写的项目')
331
+ }
332
+ },
333
+ // 打印文档
334
+ print () {
335
+ this.editorRef.execCommand('print')
336
+ },
337
+ // 关闭编辑器
338
+ close () {
339
+ this.ready = false
340
+ },
341
+ // 刷新文档
342
+ refresh () {
343
+ this.loadFile(this.fileUrl, this.bindObject, this.currResData)
344
+ },
345
+ // 导出下拉菜单
346
+ handleExportMenuClick (e) {
347
+ const key = e.key
348
+ this.editorRef.execCommand(key)
349
+ }
350
+ }
351
+ }
352
+ </script>
353
+ <style scoped lang="less">
354
+ .editor-action-container {
355
+ height: 40px;
356
+ }
357
+ :deep(.ant-divider-horizontal) {
358
+ margin: 4px 0;
359
+ }
360
+ </style>