vue2-client 1.16.31 → 1.16.32

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.
@@ -1,694 +1,700 @@
1
- <template>
2
- <div>
3
- <div v-show="ready">
4
- <a-row v-if="this.readonly" 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-->
36
- <!-- type="primary"-->
37
- <!-- v-if = "userTemplateVisible"-->
38
- <!-- @click="useTemplateData"-->
39
- <!-- >-->
40
- <!-- 使用-->
41
- <!-- </a-button>-->
42
- <a-button type="primary" @click="Recording" v-if="canRecord" v-model="recording">
43
- {{ recording? '停止' : '录音' }}
44
- </a-button>
45
- <a-button type="primary" @click="openRenameModal" v-if="this.resId !== -1">
46
- 重命名
47
- </a-button>
48
- <!-- 组合按钮容器 -->
49
- <div class="save-btn-main">
50
- <!-- 保存按钮 (左侧) -->
51
- <a-button
52
- type="primary"
53
- class="save-btn-main"
54
- @click="showSaveModal('normal')"
55
- >
56
- 保存
57
- </a-button>
58
-
59
- <!-- 下拉部分 (右侧) -->
60
- <!-- 下拉触发部分 -->
61
- <template v-if="modeType !== 'design'">
62
- <a-dropdown
63
- :trigger="['click']"
64
- placement="bottomRight">
65
- <a-button
66
- type="primary"
67
- class="dropdown-trigger-btn">
68
- <a-icon type="down" />
69
- </a-button>
70
- <a-menu slot="overlay">
71
- <a-menu-item @click="showSaveModal('template')">
72
- 保存并作为模板
73
- </a-menu-item>
74
- </a-menu>
75
- </a-dropdown>
76
- </template>
77
- </div>
78
- <a-modal
79
- title="保存"
80
- :visible="saveVisible"
81
- :confirm-loading="false"
82
- @ok="handleSaveConfirm"
83
- @cancel="saveVisible = false"
84
- >
85
- <a-form-item label="文件名" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
86
- <a-input
87
- v-model="fileName"
88
- placeholder="请输入文件名"
89
- @pressEnter="handleSaveConfirm"
90
- />
91
- </a-form-item>
92
- </a-modal>
93
- </template>
94
- <a-button type="primary" @click="print">
95
- 打印
96
- </a-button>
97
- <a-button @click="refresh">
98
- 刷新
99
- </a-button>
100
- </a-space>
101
- <a-dropdown>
102
- <a-menu slot="overlay" @click="handleExportMenuClick">
103
- <a-menu-item key="exportPdf">导出为Pdf</a-menu-item>
104
- <a-menu-item key="exportWord">导出为Word</a-menu-item>
105
- <a-menu-item key="exportHtmlWithStyle">导出为Html</a-menu-item>
106
- </a-menu>
107
- <a-button style="margin-left: 8px"> 导出 <a-icon type="down" /> </a-button>
108
- </a-dropdown>
109
- </a-col>
110
- </a-row>
111
- <a-divider/>
112
- <a-spin tip="加载中,马上好" :spinning="loading">
113
- <iframe
114
- id="x-editor"
115
- src="/his/editor/editor.html"
116
- v-bind="objectOfAttrs"
117
- @load="onload"
118
- style="height: calc(-200px - 3rem + 100vh);">
119
- </iframe>
120
- </a-spin>
121
- </div>
122
- <div v-show="!ready">
123
- <a-empty description="请选择文书" />
124
- </div>
125
- <a-modal
126
- :destroyOnClose="true"
127
- :title="this.resDataModalMode === 'modify' ? '修改文档' : '新建文档'"
128
- :visible="resDataModalVisible"
129
- okText="提交"
130
- @cancel="resDataModalVisible = false"
131
- @ok="onSubmit">
132
- <a-form-model ref="resModifyForm" :model="modifyResModel" :rules="resRules">
133
- <a-form-model-item prop="f_file_name" label="文档名">
134
- <a-input v-model="modifyResModel.f_file_name" placeholder="请输入文档名"/>
135
- </a-form-model-item>
136
- </a-form-model>
137
- </a-modal></div>
138
- </template>
139
-
140
- <script>
141
-
142
- import { runLogic } from '@vue2-client/services/api/common'
143
- import { initDiagnosisDropdown } from './diagnosisAutocomplete'
144
-
145
- export default {
146
- name: 'XHisEditor',
147
- computed: {
148
- resListCp () {
149
- const list = this.resList
150
- if (this.resId === -1) {
151
- list.push({
152
- label: '未保存文档*', value: -1
153
- })
154
- }
155
- return list
156
- }
157
- },
158
- data () {
159
- return {
160
- temporaryParameter: {},
161
- canRecord: false,
162
- recording: false, // 是否正在录音
163
- readonly: false,
164
- ready: false,
165
- loading: false,
166
- resDataModalMode: 'modify',
167
- resDataModalVisible: false,
168
- saveVisible: false,
169
- // 使用按钮显隐控制
170
- // userTemplateVisible: false,
171
- objectOfAttrs: {
172
- width: '100%',
173
- height: '650vh',
174
- frameborder: 0
175
- },
176
- // 数据模式
177
- modeType: 'form',
178
- // 是否显示模式切换功能
179
- showModeChoose: true,
180
- // 是否作为模板 1 是,0 否
181
- isTemplate: 0,
182
- // 模板id
183
- templateId: undefined,
184
- admissionId: undefined,
185
- // 保存类型
186
- saveType: 'normal',
187
- fileName: '',
188
- // 数据模式列表
189
- modeList: [
190
- {
191
- label: '预览',
192
- value: 'readonly'
193
- },
194
- {
195
- label: '表单',
196
- value: 'form'
197
- },
198
- {
199
- label: '设计',
200
- value: 'design'
201
- }
202
- ],
203
- // 编辑器实例
204
- editorRef: null,
205
- // 文档资源列表
206
- resList: [],
207
- // 文档资源ID
208
- resId: undefined,
209
- // 文档链接
210
- fileUrl: undefined,
211
- // 文档绑定数据
212
- bindObject: undefined,
213
- // 合并模板数据后文档数据
214
- assignBindObject: undefined,
215
- // 数据模式 template:模板编辑;data:数据编辑
216
- dataMode: undefined,
217
- // 保存数据调用的Logic名称
218
- saveDataLogicName: undefined,
219
- // 保存数据调用Logic传入的额外参数
220
- logicExtraParams: undefined,
221
- // 服务名
222
- serviceName: undefined,
223
- // 当前文档信息
224
- currResData: {},
225
- // 切换的文档id
226
- toggleResId: undefined,
227
- // 待提交的修改信息
228
- modifyResModel: {},
229
- codeData: {},
230
- resRules: {
231
- f_file_name: [{ required: true, message: '请输入文档名', trigger: 'blur' }],
232
- }
233
- }
234
- },
235
- // 初始化 保存后 加载文件后 诊断选择
236
- emits: ['init', 'saveafter', 'afterLoadFile', 'selected'],
237
- methods: {
238
- runLogic,
239
- /* eslint-disable */
240
- async initDiagnosisAutocomplete (dropDownBoxParams) {
241
- console.log('dropDownBoxParams',dropDownBoxParams)
242
- if (!this.editorRef || !this.editorRef.document) {
243
- return
244
- }
245
-
246
- // 添加参数检查
247
- if (!dropDownBoxParams || !Array.isArray(dropDownBoxParams) || dropDownBoxParams.length === 0) {
248
- return
249
- }
250
-
251
- // 创建一个简单的自定义事件系统
252
- // 1. 创建一个隐藏的DOM元素作为事件通道
253
- const eventChannel = this.editorRef.document.createElement('div');
254
- eventChannel.id = 'diagnosis-event-channel';
255
- eventChannel.style.display = 'none';
256
- this.editorRef.document.body.appendChild(eventChannel);
257
- // 2. 在iframe文档中监听自定义事件
258
- const that = this;
259
- this.editorRef.document.addEventListener('diagnosis-selected', function(e) {
260
- if (e && e.detail) {
261
- that.$emit('selected', { item: e.detail, editor: that.editorRef });
262
- that.codeData = { ...that.codeData, ...{[e.detail.codeKey]: e.detail.code} }
263
- }
264
- });
265
-
266
- for (const param of dropDownBoxParams) {
267
- if (param.identificationCode && param.dataLogic) {
268
- try {
269
- let preliDiagnoData = null
270
- // 保留获取后端数据的逻辑
271
- await runLogic(param.dataLogic,
272
- {}, 'af-his').then(res => {
273
- preliDiagnoData = res
274
- })
275
-
276
- // 创建脚本元素
277
- const scriptElement = this.editorRef.document.createElement('script')
278
-
279
- // 注入自定义事件触发函数和初始化代码
280
- scriptElement.textContent = `
281
- // 定义一个函数来触发自定义事件
282
- function triggerDiagnosisSelected(data) {
283
- const event = new CustomEvent('diagnosis-selected', {
284
- detail: data,
285
- bubbles: true
286
- });
287
- document.dispatchEvent(event);
288
- }
289
-
290
- // 初始化诊断下拉菜单,使用自定义事件触发函数
291
- (${initDiagnosisDropdown.toString()})(
292
- editor,
293
- ${JSON.stringify(preliDiagnoData)},
294
- '${param.identificationCode}',
295
- triggerDiagnosisSelected
296
- );
297
- `;
298
-
299
- this.editorRef.document.body.appendChild(scriptElement);
300
- } catch (error) {
301
- console.error('初始化诊断自动完成失败:', error);
302
- }
303
- }
304
- }
305
- },
306
- showSaveModal (type) {
307
- this.saveType = type // 记录当前保存类型
308
- if (type === 'template') {
309
- this.saveVisible = true
310
- }else {
311
- if (this.resId !== -1 || this.resId !== undefined) {
312
- this.save()
313
- } else {
314
- this.openAddResModal()
315
- }
316
- }
317
-
318
- },
319
- handleSaveConfirm () {
320
- if (!this.fileName.trim()) {
321
- this.$message.error('文件名不能为空')
322
- return
323
- }
324
- this.saveAsTemplate()
325
- },
326
- /* eslint-disable */
327
- // 初始化文档
328
- onload (e) {
329
- if (e && e.target && e.target.contentWindow) {
330
- this.editorRef = e.target.contentWindow.editor
331
- // 等待文档加载完成
332
- this.$emit('init', {})
333
- }
334
- },
335
- init (params, loadResList = true) {
336
- console.log("===============>",params)
337
- this.temporaryParameter = params
338
- this.canRecord = params.canRecord == undefined || params.canRecord == null? false : params.canRecord
339
- const {
340
- fileUrl,
341
- resId,
342
- currResData = {},
343
- bindObject,
344
- saveDataLogicName,
345
- logicExtraParams,
346
- dropDownBoxParams,
347
- serviceName,
348
- showModeChoose = true,
349
- modeType = 'form'
350
- } = params
351
- this.resId = resId
352
- if (bindObject) {
353
- this.dataMode = 'data'
354
- this.bindObject = bindObject
355
- } else {
356
- this.dataMode = 'template'
357
- }
358
- if (logicExtraParams?.admissionId !== undefined && logicExtraParams?.templateId !== undefined) {
359
- this.admissionId = logicExtraParams.admissionId
360
- this.templateId = logicExtraParams.templateId
361
- } else {
362
- console.warn('病例id:admissionId不存在或模板id:templateId不存在')
363
- }
364
- this.saveDataLogicName = saveDataLogicName
365
- this.logicExtraParams = logicExtraParams
366
- this.serviceName = serviceName
367
- this.showModeChoose = showModeChoose
368
- this.modeType = (modeType === "readonly!" ? "readonly" :modeType)
369
- this.readonly = (modeType !== "readonly!")
370
- this.ready = true
371
- // 先加载文件
372
- this.loadFile(fileUrl, bindObject, currResData).then(async () => {
373
- // 文件加载完成后再初始化自动完成
374
- await this.initDiagnosisAutocomplete(dropDownBoxParams)
375
- })
376
- if(loadResList){
377
- this.loadResList()
378
- }
379
- },
380
- // 加载文档
381
- loadFile (fileUrl, bindObject, currResData) {
382
- this.loading = true
383
- return new Promise((resolve) => {
384
- this.editorRef.loadUrl(fileUrl).then(() => {
385
- if (bindObject) {
386
- this.editorRef.setBindObject(bindObject)
387
- if (bindObject.template) {
388
- for (const key of Object.keys(bindObject.template)) {
389
- this.editorRef.bindDataList(key, bindObject.template[key])
390
- }
391
- }
392
- }
393
- // 拿取多于模板中的数据
394
- const diff = this.bindObject? Object.fromEntries(
395
- Object.entries(this.bindObject)
396
- .filter(([key]) => !(key in this.editorRef.getBindObject()))
397
- ) : {}
398
- this.codeData = {...this.codeData,...diff}
399
- this.changeMode()
400
- this.fileUrl = fileUrl
401
- if (!currResData.f_file_name) {
402
- currResData.f_file_name = '未命名'
403
- }
404
- this.currResData = currResData
405
- this.loading = false
406
- this.$emit('afterLoadFile', {})
407
- resolve()
408
- })
409
- })
410
- },
411
- // 保存并作为模板
412
- saveAsTemplate () {
413
- this.isTemplate = 1
414
- this.save()
415
- },
416
- // 加载文档列表
417
- loadResList () {
418
- console.log("getTemplateListLogic=======",this.logicExtraParams)
419
- runLogic('getTemplateListLogic', this.logicExtraParams, this.serviceName).then(res => {
420
- this.resList = res
421
- this.toggleResId = this.resId
422
- })
423
- },
424
- // 修改模式
425
- changeMode (e) {
426
- this.editorRef.execCommand(this.modeType)
427
- },
428
- // 启动录音功能
429
- async Recording () {
430
- this.recording = !this.recording
431
- if (this.recording) {
432
- const recording = await this.$recording.startRecording()
433
- this.$message.warn(recording.msg)
434
- } else {
435
- try {
436
- // 1. 获取录音和接口数据
437
- const recording = this.$recording.stopRecording()
438
- this.$message.warn(recording.msg)
439
- const data = await this.$recording.getRecordingData()
440
- const result = await this.runLogic('communacation', {record_content: data}, 'af-his')
441
- // 验证基础结构
442
- if (!result || typeof result.value !== 'string') {
443
- throw new Error('接口返回格式错误,缺少有效的value字段')
444
- }
445
- // 2. 处理外层JSON字符串(关键修复)
446
- let outerJsonStr = result.value
447
- // 修复1:处理布尔值
448
- outerJsonStr = outerJsonStr.replace(/\bTrue\b/g, 'true')
449
- // 修复2:移除所有控制字符
450
- outerJsonStr = outerJsonStr.replace(/[\x00-\x1F]/g, '')
451
- // 修复3:精准转义data字段内的双引号
452
- // 匹配 "data": "..." 结构并转义内容中的双引号
453
- outerJsonStr = outerJsonStr.replace(/"data":\s*"([^"]*)"/g, (match, content) => {
454
- // 转义内容中的双引号为\"
455
- const escapedContent = content.replace(/"/g, '\\"')
456
- return `"data": "${escapedContent}"`
457
- })
458
- // 直接在整个字符串里匹配 ```json{...}```
459
- const regex = /```json([\s\S]*?)```/
460
- const match = outerJsonStr.match(regex)
461
- let extractedJsonStr = ''
462
- if (match && match[1]) {
463
- extractedJsonStr = match[1].trim()
464
- }
465
- const outerObj = JSON.parse(extractedJsonStr)
466
- console.log("outerObj = ", outerObj)
467
- this.temporaryParameter.bindObject = {...this.temporaryParameter.bindObject, ...outerObj}
468
- this.init(this.temporaryParameter)
469
- } catch (e) {
470
- console.error('总错误:', e.message)
471
- this.$message.error(`解析失败: ${e.message}`)
472
- }
473
- }
474
- },
475
- // 打开文档信息修改面板
476
- openRenameModal () {
477
- this.resDataModalMode = 'modify'
478
- this.modifyResModel = {
479
- f_file_name: this.currResData.f_file_name
480
- }
481
- this.resDataModalVisible = true
482
- },
483
- // 提交文档信息修改
484
- onSubmit () {
485
- this.$refs.resModifyForm.validate(valid => {
486
- if (valid) {
487
- if (this.resDataModalMode === 'modify' && this.modifyResModel.f_file_name === this.currResData.f_file_name) {
488
- this.$message.warn('新文档名不能与原文档名一致!')
489
- return false
490
- }
491
- this.save()
492
- return true
493
- } else {
494
- return false
495
- }
496
- })
497
- },
498
- // 打开文档新建面板
499
- openAddResModal () {
500
- this.resDataModalMode = 'add'
501
- this.modifyResModel = {
502
- f_file_name: undefined
503
- }
504
- this.resDataModalVisible = true
505
- },
506
- // 新建文档
507
- addRes () {
508
- this.$emit('add', {})
509
- // const params = Object.assign({
510
- // isAddForce: true
511
- // }, this.logicExtraParams)
512
- // this.reload(params)
513
- },
514
- // 重新加载
515
- reload (params) {
516
- runLogic('getFileInformation', params , this.serviceName).then(res => {
517
- this.resDataModalVisible = false
518
- this.assignBindObject = this.assignTemplates(this.bindObject, res.bindObject)
519
- this.useTemplateData()
520
- })
521
- },
522
- // 合并模板数据
523
- assignTemplates (newBindObject, templateData) {
524
- // 检查templates数组是否存在
525
- if (!templateData.templates || !Array.isArray(templateData.templates)) {
526
- console.warn('templateData.templates不存在或不是数组')
527
- return newBindObject
528
- }
529
- // 遍历templates数组中的每个属性名
530
- templateData.templates.forEach(propName => {
531
- // 检查templateData是否有该属性
532
- if (propName in templateData) {
533
- // 无论newBindObject是否有该属性,都进行赋值/添加
534
- newBindObject[propName] = templateData[propName]
535
- } else {
536
- console.warn(`templateData中不存在属性: ${propName}`)
537
- }
538
- })
539
- return newBindObject
540
- },
541
- useTemplateData () {
542
- // 确认是否有合并后的模板数据
543
- if (!this.assignBindObject) {
544
- this.$message.warning('没有可用的模板数据');
545
- return;
546
- }
547
- this.editorRef.setBindObject(this.assignBindObject)
548
- // console.log('resId', this.resId)
549
- },
550
- // 切换文档
551
- changeRes (value) {
552
- console.log('value', value)
553
- let params = {
554
- resId: value
555
- }
556
- if (value === -1) {
557
- params = {
558
- ...params,
559
- admissionId: this.admissionId,
560
- f_template_id: this.templateId
561
- }
562
- const that = this
563
- this.$confirm({
564
- title: '确认切换文档吗?',
565
- content: '您有尚未保存的文档,切换文档将丢失所有的修改',
566
- onOk () {
567
- that.reload(params)
568
- // that.userTemplateVisible = true
569
- },
570
- onCancel () {
571
- that.toggleResId = that.resId
572
- },
573
- })
574
- } else {
575
- const selectedItem = this.resListCp.find(item => item.value === value);
576
- console.log('selectedItem=================', selectedItem)
577
- if(selectedItem.templateId != this.templateId){
578
- runLogic('getFileInformation', selectedItem.params.params , this.serviceName).then(res => {
579
- this.init({
580
- modeType: this.modeType,
581
- fileUrl: res.url,
582
- resId: res.id,
583
- currResData: res.currResData,
584
- bindObject: res.bindObject,
585
- saveDataLogicName: params?.saveDataLogicName,
586
- serviceName: this.serviceName,
587
- logicExtraParams: params?.logicExtraParams,
588
- dropDownBoxParams: params?.dropDownBoxParams
589
- }, false)
590
- })
591
- }else{
592
- this.reload({resId: selectedItem.id})
593
- }
594
- }
595
- },
596
- // 保存文档
597
- save () {
598
- // 验证必须输入项
599
- if (this.editorRef.validate()) {
600
- // 获取HTML文档和结构化数据(JSON)
601
- console.log('save',this.editorRef.getBindObject())
602
- const data = {
603
- doc: this.editorRef.getHtml(),
604
- dataObject: {
605
- ...this.editorRef.getBindObject(),
606
- ...this.codeData // 合并 codeData 数据
607
- },
608
- dataMode: this.dataMode,
609
- resId: this.resId,
610
- modifyResModel: this.modifyResModel,
611
- logicExtraParams: this.logicExtraParams,
612
- is_template: this.isTemplate,
613
- f_file_name: this.fileName
614
- }
615
- // 保存HTML文档和结构化数据到后端服务
616
- runLogic(this.saveDataLogicName, data, this.serviceName).then(res => {
617
- this.$message.success('保存成功')
618
- this.changeRes(res.currResData.id)
619
- this.$emit('saveafter', data.dataObject)
620
- }).finally(() => {
621
- this.resDataModalVisible = false
622
- this.saveVisible = false
623
- })
624
- } else {
625
- this.$message.error('请检查未填写的项目')
626
- }
627
- },
628
- // 打印文档
629
- print () {
630
- this.editorRef.execCommand('print')
631
- },
632
- // 关闭编辑器
633
- close () {
634
- this.ready = false
635
- },
636
- // 刷新文档
637
- refresh () {
638
- this.loadFile(this.fileUrl, this.bindObject, this.currResData)
639
- },
640
- // 导出下拉菜单
641
- handleExportMenuClick (e) {
642
- const key = e.key
643
- this.editorRef.execCommand(key)
644
- }
645
- }
646
- }
647
- </script>
648
- <style scoped lang="less">
649
- .editor-action-container {
650
- height: 40px;
651
- }
652
- :deep(.ant-divider-horizontal) {
653
- margin: 4px 0;
654
- }
655
- /* 组合按钮容器 - 关键修正 */
656
- .combined-save-btn {
657
- display: inline-flex;
658
- height: 32px;
659
- }
660
-
661
- /* 主保存按钮 - 保持原有样式 */
662
- .save-btn-main {
663
- border-top-right-radius: 0 !important;
664
- border-bottom-right-radius: 0 !important;
665
- border-right: none !important;
666
- height: 32px;
667
- padding: 0 15px;
668
- display: inline-flex;
669
- align-items: center;
670
- justify-content: center;
671
- margin-right: -1px; /* 关键:负边距消除间距 */
672
- }
673
-
674
- /* 下拉按钮 - 仅调整间距 */
675
- .dropdown-trigger-btn {
676
- height: 32px !important;
677
- width: 24px !important;
678
- min-width: 24px !important;
679
- padding: 0 !important;
680
- border-top-left-radius: 0 !important;
681
- border-bottom-left-radius: 0 !important;
682
- border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
683
- display: inline-flex;
684
- align-items: center;
685
- justify-content: center;
686
- margin-left: 0px;
687
- }
688
-
689
- /* 下拉图标保持原样 */
690
- .dropdown-trigger-btn .anticon {
691
- font-size: 12px;
692
- margin: 0 !important;
693
- }
694
- </style>
1
+ <template>
2
+ <div>
3
+ <div v-show="ready">
4
+ <a-row v-if="this.readonly" 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
+ class="custom-radio-group"
23
+ v-show="showModeChoose"
24
+ button-style="solid"
25
+ @change="changeMode"
26
+ v-model="modeType">
27
+ <a-radio-button v-for="item of modeList" :key="item.value" :value="item.value">
28
+ {{ item.label }}
29
+ </a-radio-button>
30
+ </a-radio-group>
31
+ </a-space>
32
+ </a-col>
33
+ <a-col class="editor-action">
34
+ <a-space>
35
+ <template v-if="this.modeType !== 'readonly'">
36
+ <!-- <a-button-->
37
+ <!-- type="primary"-->
38
+ <!-- v-if = "userTemplateVisible"-->
39
+ <!-- @click="useTemplateData"-->
40
+ <!-- >-->
41
+ <!-- 使用-->
42
+ <!-- </a-button>-->
43
+ <a-button type="primary" @click="Recording" v-if="canRecord" v-model="recording">
44
+ {{ recording? '停止' : '录音' }}
45
+ </a-button>
46
+ <a-button type="primary" @click="openRenameModal" v-if="this.resId !== -1">
47
+ 重命名
48
+ </a-button>
49
+ <!-- 组合按钮容器 -->
50
+ <div class="save-btn-main">
51
+ <!-- 保存按钮 (左侧) -->
52
+ <a-button
53
+ type="primary"
54
+ class="save-btn-main"
55
+ @click="showSaveModal('normal')"
56
+ >
57
+ 保存
58
+ </a-button>
59
+
60
+ <!-- 下拉部分 (右侧) -->
61
+ <!-- 下拉触发部分 -->
62
+ <template v-if="modeType !== 'design'">
63
+ <a-dropdown
64
+ :trigger="['click']"
65
+ placement="bottomRight">
66
+ <a-button
67
+ type="primary"
68
+ class="dropdown-trigger-btn">
69
+ <a-icon type="down" />
70
+ </a-button>
71
+ <a-menu slot="overlay">
72
+ <a-menu-item @click="showSaveModal('template')">
73
+ 保存并作为模板
74
+ </a-menu-item>
75
+ </a-menu>
76
+ </a-dropdown>
77
+ </template>
78
+ </div>
79
+ <a-modal
80
+ title="保存"
81
+ :visible="saveVisible"
82
+ :confirm-loading="false"
83
+ @ok="handleSaveConfirm"
84
+ @cancel="saveVisible = false"
85
+ >
86
+ <a-form-item label="文件名" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
87
+ <a-input
88
+ v-model="fileName"
89
+ placeholder="请输入文件名"
90
+ @pressEnter="handleSaveConfirm"
91
+ />
92
+ </a-form-item>
93
+ </a-modal>
94
+ </template>
95
+ <a-button type="primary" @click="print">
96
+ 打印
97
+ </a-button>
98
+ <a-button @click="refresh">
99
+ 刷新
100
+ </a-button>
101
+ </a-space>
102
+ <a-dropdown>
103
+ <a-menu slot="overlay" @click="handleExportMenuClick">
104
+ <a-menu-item key="exportPdf">导出为Pdf</a-menu-item>
105
+ <a-menu-item key="exportWord">导出为Word</a-menu-item>
106
+ <a-menu-item key="exportHtmlWithStyle">导出为Html</a-menu-item>
107
+ </a-menu>
108
+ <a-button style="margin-left: 8px"> 导出 <a-icon type="down" /> </a-button>
109
+ </a-dropdown>
110
+ </a-col>
111
+ </a-row>
112
+ <a-divider/>
113
+ <a-spin tip="加载中,马上好" :spinning="loading">
114
+ <iframe
115
+ id="x-editor"
116
+ src="/his/editor/editor.html"
117
+ v-bind="objectOfAttrs"
118
+ @load="onload"
119
+ style="height: calc(-200px - 3rem + 100vh);">
120
+ </iframe>
121
+ </a-spin>
122
+ </div>
123
+ <div v-show="!ready">
124
+ <a-empty description="请选择文书" />
125
+ </div>
126
+ <a-modal
127
+ :destroyOnClose="true"
128
+ :title="this.resDataModalMode === 'modify' ? '修改文档' : '新建文档'"
129
+ :visible="resDataModalVisible"
130
+ okText="提交"
131
+ @cancel="resDataModalVisible = false"
132
+ @ok="onSubmit">
133
+ <a-form-model ref="resModifyForm" :model="modifyResModel" :rules="resRules">
134
+ <a-form-model-item prop="f_file_name" label="文档名">
135
+ <a-input v-model="modifyResModel.f_file_name" placeholder="请输入文档名"/>
136
+ </a-form-model-item>
137
+ </a-form-model>
138
+ </a-modal></div>
139
+ </template>
140
+
141
+ <script>
142
+
143
+ import { runLogic } from '@vue2-client/services/api/common'
144
+ import { initDiagnosisDropdown } from './diagnosisAutocomplete'
145
+
146
+ export default {
147
+ name: 'XHisEditor',
148
+ computed: {
149
+ resListCp () {
150
+ const list = this.resList
151
+ if (this.resId === -1) {
152
+ list.push({
153
+ label: '未保存文档*', value: -1
154
+ })
155
+ }
156
+ return list
157
+ }
158
+ },
159
+ data () {
160
+ return {
161
+ temporaryParameter: {},
162
+ canRecord: false,
163
+ recording: false, // 是否正在录音
164
+ readonly: false,
165
+ ready: false,
166
+ loading: false,
167
+ resDataModalMode: 'modify',
168
+ resDataModalVisible: false,
169
+ saveVisible: false,
170
+ // 使用按钮显隐控制
171
+ // userTemplateVisible: false,
172
+ objectOfAttrs: {
173
+ width: '100%',
174
+ height: '650vh',
175
+ frameborder: 0
176
+ },
177
+ // 数据模式
178
+ modeType: 'form',
179
+ // 是否显示模式切换功能
180
+ showModeChoose: true,
181
+ // 是否作为模板 1 是,0
182
+ isTemplate: 0,
183
+ // 模板id
184
+ templateId: undefined,
185
+ admissionId: undefined,
186
+ // 保存类型
187
+ saveType: 'normal',
188
+ fileName: '',
189
+ // 数据模式列表
190
+ modeList: [
191
+ {
192
+ label: '预览',
193
+ value: 'readonly'
194
+ },
195
+ {
196
+ label: '表单',
197
+ value: 'form'
198
+ },
199
+ {
200
+ label: '设计',
201
+ value: 'design'
202
+ }
203
+ ],
204
+ // 编辑器实例
205
+ editorRef: null,
206
+ // 文档资源列表
207
+ resList: [],
208
+ // 文档资源ID
209
+ resId: undefined,
210
+ // 文档链接
211
+ fileUrl: undefined,
212
+ // 文档绑定数据
213
+ bindObject: undefined,
214
+ // 合并模板数据后文档数据
215
+ assignBindObject: undefined,
216
+ // 数据模式 template:模板编辑;data:数据编辑
217
+ dataMode: undefined,
218
+ // 保存数据调用的Logic名称
219
+ saveDataLogicName: undefined,
220
+ // 保存数据调用Logic传入的额外参数
221
+ logicExtraParams: undefined,
222
+ // 服务名
223
+ serviceName: undefined,
224
+ // 当前文档信息
225
+ currResData: {},
226
+ // 切换的文档id
227
+ toggleResId: undefined,
228
+ // 待提交的修改信息
229
+ modifyResModel: {},
230
+ codeData: {},
231
+ resRules: {
232
+ f_file_name: [{ required: true, message: '请输入文档名', trigger: 'blur' }],
233
+ }
234
+ }
235
+ },
236
+ // 初始化 保存后 加载文件后 诊断选择
237
+ emits: ['init', 'saveafter', 'afterLoadFile', 'selected'],
238
+ methods: {
239
+ runLogic,
240
+ /* eslint-disable */
241
+ async initDiagnosisAutocomplete (dropDownBoxParams) {
242
+ console.log('dropDownBoxParams',dropDownBoxParams)
243
+ if (!this.editorRef || !this.editorRef.document) {
244
+ return
245
+ }
246
+
247
+ // 添加参数检查
248
+ if (!dropDownBoxParams || !Array.isArray(dropDownBoxParams) || dropDownBoxParams.length === 0) {
249
+ return
250
+ }
251
+
252
+ // 创建一个简单的自定义事件系统
253
+ // 1. 创建一个隐藏的DOM元素作为事件通道
254
+ const eventChannel = this.editorRef.document.createElement('div');
255
+ eventChannel.id = 'diagnosis-event-channel';
256
+ eventChannel.style.display = 'none';
257
+ this.editorRef.document.body.appendChild(eventChannel);
258
+ // 2. 在iframe文档中监听自定义事件
259
+ const that = this;
260
+ this.editorRef.document.addEventListener('diagnosis-selected', function(e) {
261
+ if (e && e.detail) {
262
+ that.$emit('selected', { item: e.detail, editor: that.editorRef });
263
+ that.codeData = { ...that.codeData, ...{[e.detail.codeKey]: e.detail.code} }
264
+ }
265
+ });
266
+
267
+ for (const param of dropDownBoxParams) {
268
+ if (param.identificationCode && param.dataLogic) {
269
+ try {
270
+ let preliDiagnoData = null
271
+ // 保留获取后端数据的逻辑
272
+ await runLogic(param.dataLogic,
273
+ {}, 'af-his').then(res => {
274
+ preliDiagnoData = res
275
+ })
276
+
277
+ // 创建脚本元素
278
+ const scriptElement = this.editorRef.document.createElement('script')
279
+
280
+ // 注入自定义事件触发函数和初始化代码
281
+ scriptElement.textContent = `
282
+ // 定义一个函数来触发自定义事件
283
+ function triggerDiagnosisSelected(data) {
284
+ const event = new CustomEvent('diagnosis-selected', {
285
+ detail: data,
286
+ bubbles: true
287
+ });
288
+ document.dispatchEvent(event);
289
+ }
290
+
291
+ // 初始化诊断下拉菜单,使用自定义事件触发函数
292
+ (${initDiagnosisDropdown.toString()})(
293
+ editor,
294
+ ${JSON.stringify(preliDiagnoData)},
295
+ '${param.identificationCode}',
296
+ triggerDiagnosisSelected
297
+ );
298
+ `;
299
+
300
+ this.editorRef.document.body.appendChild(scriptElement);
301
+ } catch (error) {
302
+ console.error('初始化诊断自动完成失败:', error);
303
+ }
304
+ }
305
+ }
306
+ },
307
+ showSaveModal (type) {
308
+ this.saveType = type // 记录当前保存类型
309
+ if (type === 'template') {
310
+ this.saveVisible = true
311
+ }else {
312
+ if (this.resId !== -1 || this.resId !== undefined) {
313
+ this.save()
314
+ } else {
315
+ this.openAddResModal()
316
+ }
317
+ }
318
+
319
+ },
320
+ handleSaveConfirm () {
321
+ if (!this.fileName.trim()) {
322
+ this.$message.error('文件名不能为空')
323
+ return
324
+ }
325
+ this.saveAsTemplate()
326
+ },
327
+ /* eslint-disable */
328
+ // 初始化文档
329
+ onload (e) {
330
+ if (e && e.target && e.target.contentWindow) {
331
+ this.editorRef = e.target.contentWindow.editor
332
+ // 等待文档加载完成
333
+ this.$emit('init', {})
334
+ }
335
+ },
336
+ init (params, loadResList = true) {
337
+ console.log("===============>",params)
338
+ this.temporaryParameter = params
339
+ this.canRecord = params.canRecord == undefined || params.canRecord == null? false : params.canRecord
340
+ const {
341
+ fileUrl,
342
+ resId,
343
+ currResData = {},
344
+ bindObject,
345
+ saveDataLogicName,
346
+ logicExtraParams,
347
+ dropDownBoxParams,
348
+ serviceName,
349
+ showModeChoose = true,
350
+ modeType = 'form'
351
+ } = params
352
+ this.resId = resId
353
+ if (bindObject) {
354
+ this.dataMode = 'data'
355
+ this.bindObject = bindObject
356
+ } else {
357
+ this.dataMode = 'template'
358
+ }
359
+ if (logicExtraParams?.admissionId !== undefined && logicExtraParams?.templateId !== undefined) {
360
+ this.admissionId = logicExtraParams.admissionId
361
+ this.templateId = logicExtraParams.templateId
362
+ } else {
363
+ console.warn('病例id:admissionId不存在或模板id:templateId不存在')
364
+ }
365
+ this.saveDataLogicName = saveDataLogicName
366
+ this.logicExtraParams = logicExtraParams
367
+ this.serviceName = serviceName
368
+ this.showModeChoose = showModeChoose
369
+ this.modeType = (modeType === "readonly!" ? "readonly" :modeType)
370
+ this.readonly = (modeType !== "readonly!")
371
+ this.ready = true
372
+ // 先加载文件
373
+ this.loadFile(fileUrl, bindObject, currResData).then(async () => {
374
+ // 文件加载完成后再初始化自动完成
375
+ await this.initDiagnosisAutocomplete(dropDownBoxParams)
376
+ })
377
+ if(loadResList){
378
+ this.loadResList()
379
+ }
380
+ },
381
+ // 加载文档
382
+ loadFile (fileUrl, bindObject, currResData) {
383
+ this.loading = true
384
+ return new Promise((resolve) => {
385
+ this.editorRef.loadUrl(fileUrl).then(() => {
386
+ if (bindObject) {
387
+ this.editorRef.setBindObject(bindObject)
388
+ if (bindObject.template) {
389
+ for (const key of Object.keys(bindObject.template)) {
390
+ this.editorRef.bindDataList(key, bindObject.template[key])
391
+ }
392
+ }
393
+ }
394
+ // 拿取多于模板中的数据
395
+ const diff = this.bindObject? Object.fromEntries(
396
+ Object.entries(this.bindObject)
397
+ .filter(([key]) => !(key in this.editorRef.getBindObject()))
398
+ ) : {}
399
+ this.codeData = {...this.codeData,...diff}
400
+ this.changeMode()
401
+ this.fileUrl = fileUrl
402
+ if (!currResData.f_file_name) {
403
+ currResData.f_file_name = '未命名'
404
+ }
405
+ this.currResData = currResData
406
+ this.loading = false
407
+ this.$emit('afterLoadFile', {})
408
+ resolve()
409
+ })
410
+ })
411
+ },
412
+ // 保存并作为模板
413
+ saveAsTemplate () {
414
+ this.isTemplate = 1
415
+ this.save()
416
+ },
417
+ // 加载文档列表
418
+ loadResList () {
419
+ console.log("getTemplateListLogic=======",this.logicExtraParams)
420
+ runLogic('getTemplateListLogic', this.logicExtraParams, this.serviceName).then(res => {
421
+ this.resList = res
422
+ this.toggleResId = this.resId
423
+ })
424
+ },
425
+ // 修改模式
426
+ changeMode (e) {
427
+ this.editorRef.execCommand(this.modeType)
428
+ },
429
+ // 启动录音功能
430
+ async Recording () {
431
+ this.recording = !this.recording
432
+ if (this.recording) {
433
+ const recording = await this.$recording.startRecording()
434
+ this.$message.warn(recording.msg)
435
+ } else {
436
+ try {
437
+ // 1. 获取录音和接口数据
438
+ const recording = this.$recording.stopRecording()
439
+ this.$message.warn(recording.msg)
440
+ const data = await this.$recording.getRecordingData()
441
+ const result = await this.runLogic('communacation', {record_content: data}, 'af-his')
442
+ // 验证基础结构
443
+ if (!result || typeof result.value !== 'string') {
444
+ throw new Error('接口返回格式错误,缺少有效的value字段')
445
+ }
446
+ // 2. 处理外层JSON字符串(关键修复)
447
+ let outerJsonStr = result.value
448
+ // 修复1:处理布尔值
449
+ outerJsonStr = outerJsonStr.replace(/\bTrue\b/g, 'true')
450
+ // 修复2:移除所有控制字符
451
+ outerJsonStr = outerJsonStr.replace(/[\x00-\x1F]/g, '')
452
+ // 修复3:精准转义data字段内的双引号
453
+ // 匹配 "data": "..." 结构并转义内容中的双引号
454
+ outerJsonStr = outerJsonStr.replace(/"data":\s*"([^"]*)"/g, (match, content) => {
455
+ // 转义内容中的双引号为\"
456
+ const escapedContent = content.replace(/"/g, '\\"')
457
+ return `"data": "${escapedContent}"`
458
+ })
459
+ // 直接在整个字符串里匹配 ```json{...}```
460
+ const regex = /```json([\s\S]*?)```/
461
+ const match = outerJsonStr.match(regex)
462
+ let extractedJsonStr = ''
463
+ if (match && match[1]) {
464
+ extractedJsonStr = match[1].trim()
465
+ }
466
+ const outerObj = JSON.parse(extractedJsonStr)
467
+ console.log("outerObj = ", outerObj)
468
+ this.temporaryParameter.bindObject = {...this.temporaryParameter.bindObject, ...outerObj}
469
+ this.init(this.temporaryParameter)
470
+ } catch (e) {
471
+ console.error('总错误:', e.message)
472
+ this.$message.error(`解析失败: ${e.message}`)
473
+ }
474
+ }
475
+ },
476
+ // 打开文档信息修改面板
477
+ openRenameModal () {
478
+ this.resDataModalMode = 'modify'
479
+ this.modifyResModel = {
480
+ f_file_name: this.currResData.f_file_name
481
+ }
482
+ this.resDataModalVisible = true
483
+ },
484
+ // 提交文档信息修改
485
+ onSubmit () {
486
+ this.$refs.resModifyForm.validate(valid => {
487
+ if (valid) {
488
+ if (this.resDataModalMode === 'modify' && this.modifyResModel.f_file_name === this.currResData.f_file_name) {
489
+ this.$message.warn('新文档名不能与原文档名一致!')
490
+ return false
491
+ }
492
+ this.save()
493
+ return true
494
+ } else {
495
+ return false
496
+ }
497
+ })
498
+ },
499
+ // 打开文档新建面板
500
+ openAddResModal () {
501
+ this.resDataModalMode = 'add'
502
+ this.modifyResModel = {
503
+ f_file_name: undefined
504
+ }
505
+ this.resDataModalVisible = true
506
+ },
507
+ // 新建文档
508
+ addRes () {
509
+ this.$emit('add', {})
510
+ // const params = Object.assign({
511
+ // isAddForce: true
512
+ // }, this.logicExtraParams)
513
+ // this.reload(params)
514
+ },
515
+ // 重新加载
516
+ reload (params) {
517
+ runLogic('getFileInformation', params , this.serviceName).then(res => {
518
+ this.resDataModalVisible = false
519
+ this.assignBindObject = this.assignTemplates(this.bindObject, res.bindObject)
520
+ this.useTemplateData()
521
+ })
522
+ },
523
+ // 合并模板数据
524
+ assignTemplates (newBindObject, templateData) {
525
+ // 检查templates数组是否存在
526
+ if (!templateData.templates || !Array.isArray(templateData.templates)) {
527
+ console.warn('templateData.templates不存在或不是数组')
528
+ return newBindObject
529
+ }
530
+ // 遍历templates数组中的每个属性名
531
+ templateData.templates.forEach(propName => {
532
+ // 检查templateData是否有该属性
533
+ if (propName in templateData) {
534
+ // 无论newBindObject是否有该属性,都进行赋值/添加
535
+ newBindObject[propName] = templateData[propName]
536
+ } else {
537
+ console.warn(`templateData中不存在属性: ${propName}`)
538
+ }
539
+ })
540
+ return newBindObject
541
+ },
542
+ useTemplateData () {
543
+ // 确认是否有合并后的模板数据
544
+ if (!this.assignBindObject) {
545
+ this.$message.warning('没有可用的模板数据');
546
+ return;
547
+ }
548
+ this.editorRef.setBindObject(this.assignBindObject)
549
+ // console.log('resId', this.resId)
550
+ },
551
+ // 切换文档
552
+ changeRes (value) {
553
+ console.log('value', value)
554
+ let params = {
555
+ resId: value
556
+ }
557
+ if (value === -1) {
558
+ params = {
559
+ ...params,
560
+ admissionId: this.admissionId,
561
+ f_template_id: this.templateId
562
+ }
563
+ const that = this
564
+ this.$confirm({
565
+ title: '确认切换文档吗?',
566
+ content: '您有尚未保存的文档,切换文档将丢失所有的修改',
567
+ onOk () {
568
+ that.reload(params)
569
+ // that.userTemplateVisible = true
570
+ },
571
+ onCancel () {
572
+ that.toggleResId = that.resId
573
+ },
574
+ })
575
+ } else {
576
+ const selectedItem = this.resListCp.find(item => item.value === value);
577
+ console.log('selectedItem=================', selectedItem)
578
+ if(selectedItem.templateId != this.templateId){
579
+ runLogic('getFileInformation', selectedItem.params.params , this.serviceName).then(res => {
580
+ this.init({
581
+ modeType: this.modeType,
582
+ fileUrl: res.url,
583
+ resId: res.id,
584
+ currResData: res.currResData,
585
+ bindObject: res.bindObject,
586
+ saveDataLogicName: params?.saveDataLogicName,
587
+ serviceName: this.serviceName,
588
+ logicExtraParams: params?.logicExtraParams,
589
+ dropDownBoxParams: params?.dropDownBoxParams
590
+ }, false)
591
+ })
592
+ }else{
593
+ this.reload({resId: selectedItem.id})
594
+ }
595
+ }
596
+ },
597
+ // 保存文档
598
+ save () {
599
+ // 验证必须输入项
600
+ if (this.editorRef.validate()) {
601
+ // 获取HTML文档和结构化数据(JSON)
602
+ console.log('save',this.editorRef.getBindObject())
603
+ const data = {
604
+ doc: this.editorRef.getHtml(),
605
+ dataObject: {
606
+ ...this.editorRef.getBindObject(),
607
+ ...this.codeData // 合并 codeData 数据
608
+ },
609
+ dataMode: this.dataMode,
610
+ resId: this.resId,
611
+ modifyResModel: this.modifyResModel,
612
+ logicExtraParams: this.logicExtraParams,
613
+ is_template: this.isTemplate,
614
+ f_file_name: this.fileName
615
+ }
616
+ // 保存HTML文档和结构化数据到后端服务
617
+ runLogic(this.saveDataLogicName, data, this.serviceName).then(res => {
618
+ this.$message.success('保存成功')
619
+ this.changeRes(res.currResData.id)
620
+ this.$emit('saveafter', data.dataObject)
621
+ }).finally(() => {
622
+ this.resDataModalVisible = false
623
+ this.saveVisible = false
624
+ })
625
+ } else {
626
+ this.$message.error('请检查未填写的项目')
627
+ }
628
+ },
629
+ // 打印文档
630
+ print () {
631
+ this.editorRef.execCommand('print')
632
+ },
633
+ // 关闭编辑器
634
+ close () {
635
+ this.ready = false
636
+ },
637
+ // 刷新文档
638
+ refresh () {
639
+ this.loadFile(this.fileUrl, this.bindObject, this.currResData)
640
+ },
641
+ // 导出下拉菜单
642
+ handleExportMenuClick (e) {
643
+ const key = e.key
644
+ this.editorRef.execCommand(key)
645
+ }
646
+ }
647
+ }
648
+ </script>
649
+ <style scoped lang="less">
650
+ .editor-action-container {
651
+ height: 40px;
652
+ }
653
+ :deep(.ant-divider-horizontal) {
654
+ margin: 4px 0;
655
+ }
656
+ /* 组合按钮容器 - 关键修正 */
657
+ .combined-save-btn {
658
+ display: inline-flex;
659
+ height: 32px;
660
+ }
661
+
662
+ /* 主保存按钮 - 保持原有样式 */
663
+ .save-btn-main {
664
+ border-top-right-radius: 0 !important;
665
+ border-bottom-right-radius: 0 !important;
666
+ border-right: none !important;
667
+ height: 32px;
668
+ padding: 0 15px;
669
+ display: inline-flex;
670
+ align-items: center;
671
+ justify-content: center;
672
+ margin-right: -1px; /* 关键:负边距消除间距 */
673
+ }
674
+
675
+ /* 下拉按钮 - 仅调整间距 */
676
+ .dropdown-trigger-btn {
677
+ height: 32px !important;
678
+ width: 24px !important;
679
+ min-width: 24px !important;
680
+ padding: 0 !important;
681
+ border-top-left-radius: 0 !important;
682
+ border-bottom-left-radius: 0 !important;
683
+ border-left: 1px solid rgba(255, 255, 255, 0.3) !important;
684
+ display: inline-flex;
685
+ align-items: center;
686
+ justify-content: center;
687
+ margin-left: 0px;
688
+ }
689
+
690
+ /* 下拉图标保持原样 */
691
+ .dropdown-trigger-btn .anticon {
692
+ font-size: 12px;
693
+ margin: 0 !important;
694
+ }
695
+ .custom-radio-group {
696
+ .ant-radio-button-wrapper-checked {
697
+ background-color: rgb(0, 87, 254) !important;
698
+ }
699
+ }
700
+ </style>