vue2-client 1.12.71 → 1.12.72
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/XCollapse/XCollapse.vue +216 -214
- package/src/base-client/components/common/XCollapse/XCollapseDemo.vue +15 -0
- package/src/base-client/components/common/XReportGrid/XReport.vue +1014 -1014
- package/src/base-client/components/common/XReportGrid/XReportDemo.vue +44 -44
- package/src/base-client/components/common/XReportGrid/XReportDesign.vue +616 -616
- package/src/base-client/components/his/XHisEditor/XHisEditor.vue +62 -22
- package/src/base-client/components/his/XHisEditor/diagnosisAutocomplete.js +241 -0
- package/src/base-client/components/his/XList/XList.vue +94 -90
- package/src/base-client/plugins/AppData.js +126 -126
- package/src/pages/ReportGrid/index.vue +76 -76
- package/src/pages/userInfoDetailManage/PriceAdjustments/index.vue +64 -0
- package/src/pages/userInfoDetailManage/UserException/index.vue +64 -0
- package/src/pages/userInfoDetailManage/userInfoDetailQueryTabs.vue +7 -1
- package/src/router/async/router.map.js +122 -119
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
<script>
|
|
89
89
|
|
|
90
90
|
import { runLogic } from '@vue2-client/services/api/common'
|
|
91
|
+
import { initDiagnosisDropdown } from './diagnosisAutocomplete'
|
|
91
92
|
|
|
92
93
|
export default {
|
|
93
94
|
name: 'XHisEditor',
|
|
@@ -163,12 +164,42 @@ export default {
|
|
|
163
164
|
},
|
|
164
165
|
methods: {
|
|
165
166
|
runLogic,
|
|
167
|
+
async initDiagnosisAutocomplete (dropDownBoxParams) {
|
|
168
|
+
if (!this.editorRef || !this.editorRef.document) {
|
|
169
|
+
return
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// 添加参数检查
|
|
173
|
+
if (!dropDownBoxParams || !Array.isArray(dropDownBoxParams) || dropDownBoxParams.length === 0) {
|
|
174
|
+
return
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
dropDownBoxParams.forEach(async (param) => {
|
|
178
|
+
if (param.identificationCode && param.dataLogic) {
|
|
179
|
+
try {
|
|
180
|
+
let preliDiagnoData = null
|
|
181
|
+
// 保留获取后端数据的逻辑
|
|
182
|
+
await runLogic(param.dataLogic,
|
|
183
|
+
{}, 'af-his').then(res => {
|
|
184
|
+
preliDiagnoData = res
|
|
185
|
+
})
|
|
186
|
+
const scriptElement = this.editorRef.document.createElement('script')
|
|
187
|
+
scriptElement.textContent = `(${initDiagnosisDropdown.toString()})(editor,${JSON.stringify(preliDiagnoData)},'${param.identificationCode}')`
|
|
188
|
+
this.editorRef.document.body.appendChild(scriptElement)
|
|
189
|
+
} catch (error) {
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
},
|
|
166
195
|
// 初始化文档
|
|
167
|
-
onload
|
|
168
|
-
|
|
169
|
-
|
|
196
|
+
onload (e) {
|
|
197
|
+
if (e && e.target && e.target.contentWindow) {
|
|
198
|
+
this.editorRef = e.target.contentWindow.editor
|
|
199
|
+
// 等待文档加载完成
|
|
200
|
+
this.$emit('init', {})
|
|
201
|
+
}
|
|
170
202
|
},
|
|
171
|
-
// 初始化组件
|
|
172
203
|
init (params) {
|
|
173
204
|
const {
|
|
174
205
|
fileUrl,
|
|
@@ -177,6 +208,7 @@ export default {
|
|
|
177
208
|
bindObject,
|
|
178
209
|
saveDataLogicName,
|
|
179
210
|
logicExtraParams,
|
|
211
|
+
dropDownBoxParams,
|
|
180
212
|
serviceName,
|
|
181
213
|
showModeChoose = true,
|
|
182
214
|
modeType = 'readonly'
|
|
@@ -194,29 +226,36 @@ export default {
|
|
|
194
226
|
this.showModeChoose = showModeChoose
|
|
195
227
|
this.modeType = modeType
|
|
196
228
|
this.ready = true
|
|
197
|
-
|
|
229
|
+
// 先加载文件
|
|
230
|
+
this.loadFile(fileUrl, bindObject, currResData).then(() => {
|
|
231
|
+
// 文件加载完成后再初始化自动完成
|
|
232
|
+
this.initDiagnosisAutocomplete(dropDownBoxParams)
|
|
233
|
+
})
|
|
198
234
|
this.loadResList()
|
|
199
235
|
},
|
|
200
236
|
// 加载文档
|
|
201
237
|
loadFile (fileUrl, bindObject, currResData) {
|
|
202
238
|
this.loading = true
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
239
|
+
return new Promise((resolve) => {
|
|
240
|
+
this.editorRef.loadUrl(fileUrl).then(() => {
|
|
241
|
+
if (bindObject) {
|
|
242
|
+
this.editorRef.setBindObject(bindObject)
|
|
243
|
+
if (bindObject.template) {
|
|
244
|
+
for (const key of Object.keys(bindObject.template)) {
|
|
245
|
+
this.editorRef.bindDataList(key, bindObject.template[key])
|
|
246
|
+
}
|
|
209
247
|
}
|
|
210
248
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
249
|
+
this.changeMode()
|
|
250
|
+
this.fileUrl = fileUrl
|
|
251
|
+
if (!currResData.f_file_name) {
|
|
252
|
+
currResData.f_file_name = '未命名'
|
|
253
|
+
}
|
|
254
|
+
this.currResData = currResData
|
|
255
|
+
this.loading = false
|
|
256
|
+
this.$emit('afterLoadFile', {})
|
|
257
|
+
resolve()
|
|
258
|
+
})
|
|
220
259
|
})
|
|
221
260
|
},
|
|
222
261
|
// 加载文档列表
|
|
@@ -270,7 +309,7 @@ export default {
|
|
|
270
309
|
},
|
|
271
310
|
// 重新加载
|
|
272
311
|
reload (params) {
|
|
273
|
-
runLogic('
|
|
312
|
+
runLogic('getFileInformation', params, this.serviceName).then(res => {
|
|
274
313
|
this.resDataModalVisible = false
|
|
275
314
|
this.init({
|
|
276
315
|
modeType: this.modeType,
|
|
@@ -280,7 +319,8 @@ export default {
|
|
|
280
319
|
bindObject: res.bindObject,
|
|
281
320
|
saveDataLogicName: this.saveDataLogicName,
|
|
282
321
|
serviceName: this.serviceName,
|
|
283
|
-
logicExtraParams: this.logicExtraParams
|
|
322
|
+
logicExtraParams: this.logicExtraParams,
|
|
323
|
+
dropDownBoxParams: this.dropDownBoxParams
|
|
284
324
|
})
|
|
285
325
|
})
|
|
286
326
|
},
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
export function initDiagnosisDropdown (editor, data, identificationCode) {
|
|
2
|
+
if (typeof editor === 'undefined' || !editor.$) {
|
|
3
|
+
return
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// 确保元素存在
|
|
7
|
+
const diagnosisField = editor.$(identificationCode)
|
|
8
|
+
|
|
9
|
+
if (!diagnosisField.length) {
|
|
10
|
+
return
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 更详细的调试信息
|
|
14
|
+
const fieldElement = diagnosisField[0]
|
|
15
|
+
|
|
16
|
+
// 模拟诊断数据
|
|
17
|
+
const mockDiagnosisList = data
|
|
18
|
+
// 生成唯一的下拉框类名
|
|
19
|
+
const dropdownClassName = `diagnosis-dropdown-${identificationCode.replace('#', '')}`
|
|
20
|
+
// 创建下拉列表容器 - 使用 Ant Design 风格
|
|
21
|
+
editor.$(`.${dropdownClassName}`).remove() // 修改这里,使用唯一的类名
|
|
22
|
+
const dropdownList = editor.document.createElement('div')
|
|
23
|
+
dropdownList.className = dropdownClassName // 使用唯一的类名
|
|
24
|
+
|
|
25
|
+
// 添加 Ant Design 样式,修改样式选择器使用唯一的类名
|
|
26
|
+
const styleElement = editor.document.createElement('style')
|
|
27
|
+
styleElement.textContent = `
|
|
28
|
+
.${dropdownClassName} {
|
|
29
|
+
display: none;
|
|
30
|
+
position: absolute;
|
|
31
|
+
z-index: 999999;
|
|
32
|
+
background: #fff;
|
|
33
|
+
border-radius: 2px;
|
|
34
|
+
box-shadow: 0 3px 6px -4px rgba(0,0,0,.12), 0 6px 16px 0 rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05);
|
|
35
|
+
padding: 4px 0;
|
|
36
|
+
min-width: 300px;
|
|
37
|
+
width: auto;
|
|
38
|
+
max-width: 400px;
|
|
39
|
+
max-height: 256px;
|
|
40
|
+
overflow-y: auto;
|
|
41
|
+
}
|
|
42
|
+
.${dropdownClassName}::-webkit-scrollbar {
|
|
43
|
+
width: 6px;
|
|
44
|
+
height: 6px;
|
|
45
|
+
}
|
|
46
|
+
.${dropdownClassName}::-webkit-scrollbar-thumb {
|
|
47
|
+
background: rgba(0,0,0,.2);
|
|
48
|
+
border-radius: 3px;
|
|
49
|
+
}
|
|
50
|
+
.${dropdownClassName} .ant-list-item {
|
|
51
|
+
padding: 8px 12px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
transition: all .3s;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
.${dropdownClassName} .ant-list-item:hover {
|
|
57
|
+
background: #f5f5f5;
|
|
58
|
+
}
|
|
59
|
+
.${dropdownClassName} .ant-list-item-content {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 8px;
|
|
64
|
+
}
|
|
65
|
+
.${dropdownClassName} .ant-list-item-title {
|
|
66
|
+
color: rgba(0,0,0,.85);
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
line-height: 1.5715;
|
|
70
|
+
flex: 1;
|
|
71
|
+
min-width: 120px;
|
|
72
|
+
}
|
|
73
|
+
.${dropdownClassName} .ant-list-item-description {
|
|
74
|
+
color: rgba(0,0,0,.45);
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
line-height: 1.5715;
|
|
77
|
+
min-width: 80px;
|
|
78
|
+
}
|
|
79
|
+
.${dropdownClassName} .ant-list-empty {
|
|
80
|
+
padding: 16px;
|
|
81
|
+
color: rgba(0,0,0,.45);
|
|
82
|
+
text-align: center;
|
|
83
|
+
min-width: 200px;
|
|
84
|
+
}
|
|
85
|
+
`
|
|
86
|
+
editor.document.head.appendChild(styleElement)
|
|
87
|
+
|
|
88
|
+
// 将下拉列表添加到编辑器文档中
|
|
89
|
+
diagnosisField.after(dropdownList)
|
|
90
|
+
|
|
91
|
+
// 获取当前模式
|
|
92
|
+
function getCurrentMode () {
|
|
93
|
+
return editor.option.mode
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 检查是否允许编辑
|
|
97
|
+
function isEditableMode () {
|
|
98
|
+
const currentMode = getCurrentMode()
|
|
99
|
+
return currentMode === 'form' || currentMode === 'design'
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// 更新下拉列表位置的函数
|
|
103
|
+
function updateDropdownPosition () {
|
|
104
|
+
try {
|
|
105
|
+
// 获取输入框的位置和尺寸
|
|
106
|
+
const fieldRect = fieldElement.getBoundingClientRect()
|
|
107
|
+
|
|
108
|
+
// 获取父容器的滚动位置
|
|
109
|
+
const scrollTop = editor.$(editor.document).scrollTop()
|
|
110
|
+
const scrollLeft = editor.$(editor.document).scrollLeft()
|
|
111
|
+
|
|
112
|
+
// 计算绝对位置
|
|
113
|
+
const top = fieldRect.bottom + scrollTop
|
|
114
|
+
const left = fieldRect.left + scrollLeft
|
|
115
|
+
|
|
116
|
+
// 设置下拉列表位置,不设置宽度,让它自适应内容
|
|
117
|
+
dropdownList.style.cssText = `
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: ${top}px;
|
|
120
|
+
left: ${left}px;
|
|
121
|
+
display: block;
|
|
122
|
+
`
|
|
123
|
+
} catch (error) {
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// 处理输入事件的函数
|
|
128
|
+
function handleInput () {
|
|
129
|
+
if (!isEditableMode()) {
|
|
130
|
+
dropdownList.style.display = 'none'
|
|
131
|
+
return
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const keyword = this.textContent.trim()
|
|
135
|
+
|
|
136
|
+
if (keyword && keyword !== '请输入') {
|
|
137
|
+
const results = mockDiagnosisList.filter(item =>
|
|
138
|
+
item.name.toLowerCase().includes(keyword.toLowerCase()) ||
|
|
139
|
+
item.code.toLowerCase().includes(keyword.toLowerCase())
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
// 1. 先清空内容
|
|
143
|
+
dropdownList.innerHTML = ''
|
|
144
|
+
|
|
145
|
+
// 2. 添加内容
|
|
146
|
+
if (results.length === 0) {
|
|
147
|
+
dropdownList.innerHTML = `
|
|
148
|
+
<div class="ant-list-empty">
|
|
149
|
+
<div style="color: rgba(0,0,0,.25);">
|
|
150
|
+
<svg viewBox="64 64 896 896" width="16" height="16" fill="currentColor">
|
|
151
|
+
<path d="M928 224H768v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56H548v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56H328v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56H96c-17.7 0-32 14.3-32 32v576c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V256c0-17.7-14.3-32-32-32zM424 688c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v48zm0-136c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v48zm136 136c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v48zm0-136c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v48zm136 136c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v48zm0-136c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8v-48c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v48z"/>
|
|
152
|
+
</svg>
|
|
153
|
+
<div style="margin-top: 8px;">无匹配结果</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
`
|
|
157
|
+
} else {
|
|
158
|
+
const itemsHtml = results.map(item => `
|
|
159
|
+
<div class="ant-list-item">
|
|
160
|
+
<div class="ant-list-item-content">
|
|
161
|
+
<div class="ant-list-item-title">${item.name}</div>
|
|
162
|
+
<div class="ant-list-item-description">${item.code}</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
`).join('')
|
|
166
|
+
dropdownList.innerHTML = itemsHtml
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// 3. 更新位置并显示
|
|
170
|
+
updateDropdownPosition()
|
|
171
|
+
} else {
|
|
172
|
+
dropdownList.style.display = 'none'
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 输入法编辑状态处理
|
|
177
|
+
let isCompositing = false
|
|
178
|
+
|
|
179
|
+
// 输入法开始
|
|
180
|
+
fieldElement.addEventListener('compositionstart', function (e) {
|
|
181
|
+
isCompositing = true
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
// 输入法结束
|
|
185
|
+
fieldElement.addEventListener('compositionend', function (e) {
|
|
186
|
+
isCompositing = false
|
|
187
|
+
handleInput.call(this)
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
// 输入事件
|
|
191
|
+
fieldElement.addEventListener('input', function (e) {
|
|
192
|
+
if (!isCompositing) {
|
|
193
|
+
handleInput.call(this)
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
// 焦点事件
|
|
198
|
+
fieldElement.addEventListener('focus', function (e) {
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
// 失去焦点事件
|
|
202
|
+
fieldElement.addEventListener('blur', function (e) {
|
|
203
|
+
setTimeout(() => {
|
|
204
|
+
if (!this.textContent.trim()) {
|
|
205
|
+
this.textContent = '请输入'
|
|
206
|
+
}
|
|
207
|
+
}, 200)
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
// 点击选项事件
|
|
211
|
+
editor.$(dropdownList).on('mousedown', '.ant-list-item', function (e) {
|
|
212
|
+
e.preventDefault()
|
|
213
|
+
e.stopPropagation()
|
|
214
|
+
if (isEditableMode()) {
|
|
215
|
+
const name = editor.$(this).find('.ant-list-item-title').text()
|
|
216
|
+
fieldElement.textContent = name
|
|
217
|
+
dropdownList.style.display = 'none'
|
|
218
|
+
fieldElement.focus()
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
// 点击文档其他区域时隐藏下拉列表,修改选择器
|
|
223
|
+
editor.$(editor.document).on('mousedown', function (e) {
|
|
224
|
+
if (!editor.$(e.target).closest(`.${dropdownClassName}, ${identificationCode}`).length) {
|
|
225
|
+
dropdownList.style.display = 'none'
|
|
226
|
+
}
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
// 添加滚动事件监听,实时更新下拉列表位置
|
|
230
|
+
editor.$(editor.window).on('scroll', function () {
|
|
231
|
+
if (dropdownList.style.display !== 'none') {
|
|
232
|
+
updateDropdownPosition()
|
|
233
|
+
}
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
editor.$(editor.window).on('resize', function () {
|
|
237
|
+
if (dropdownList.style.display !== 'none') {
|
|
238
|
+
updateDropdownPosition()
|
|
239
|
+
}
|
|
240
|
+
})
|
|
241
|
+
}
|
|
@@ -1,90 +1,94 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="list-wrapper" >
|
|
3
|
-
<a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container">
|
|
4
|
-
<a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
|
|
5
|
-
{{ item.number }} {{ item.name }}
|
|
6
|
-
</a-list-item>
|
|
7
|
-
</a-list>
|
|
8
|
-
</div>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
|
|
13
|
-
import { runLogic } from '@vue2-client/services/api/common'
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
name: 'XList',
|
|
17
|
-
props: {
|
|
18
|
-
queryParamsName: {
|
|
19
|
-
type: Object,
|
|
20
|
-
default: 'outpatientWaitLogic'
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
inject: ['getComponentByName'],
|
|
24
|
-
data () {
|
|
25
|
-
return {
|
|
26
|
-
data: []
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
created () {
|
|
30
|
-
this.getData(this.queryParamsName)
|
|
31
|
-
},
|
|
32
|
-
methods: {
|
|
33
|
-
async getData (config) {
|
|
34
|
-
runLogic(config, {}, 'af-his').then(res => {
|
|
35
|
-
this.data = res
|
|
36
|
-
})
|
|
37
|
-
},
|
|
38
|
-
handleClick (index) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.list-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
.list-wrapper::-webkit-scrollbar
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="list-wrapper" >
|
|
3
|
+
<a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container">
|
|
4
|
+
<a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
|
|
5
|
+
{{ item.number }} {{ item.name }}
|
|
6
|
+
</a-list-item>
|
|
7
|
+
</a-list>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
import { runLogic } from '@vue2-client/services/api/common'
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'XList',
|
|
17
|
+
props: {
|
|
18
|
+
queryParamsName: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: 'outpatientWaitLogic'
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
inject: ['getComponentByName'],
|
|
24
|
+
data () {
|
|
25
|
+
return {
|
|
26
|
+
data: []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
created () {
|
|
30
|
+
this.getData(this.queryParamsName)
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
async getData (config) {
|
|
34
|
+
runLogic(config, {}, 'af-his').then(res => {
|
|
35
|
+
this.data = res
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
handleClick (index) {
|
|
39
|
+
console.log('xlist按钮被点击了!')
|
|
40
|
+
console.warn(this.getComponentByName)
|
|
41
|
+
const xCollapseComponent = this.getComponentByName('XCollapse')
|
|
42
|
+
console.warn('xCollapseComponent', xCollapseComponent)
|
|
43
|
+
this.$emit('listClick', this.data[index])
|
|
44
|
+
},
|
|
45
|
+
refreshList () {
|
|
46
|
+
this.getData(this.queryParamsName)
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style scoped>
|
|
54
|
+
.list-wrapper {
|
|
55
|
+
max-height: 240px;
|
|
56
|
+
overflow-y: auto;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
padding-right: 2px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.list-container {
|
|
62
|
+
width: 100%;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.list-item {
|
|
66
|
+
height: 35px;
|
|
67
|
+
border-radius: 6px;
|
|
68
|
+
background-color: #F4F4F4;
|
|
69
|
+
padding: 8px 15px 7px 15px;
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
width: 100%;
|
|
74
|
+
border: 1px solid #D9D9D9;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
margin-bottom: 16px;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
overflow: clip;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 自定义滚动条样式 */
|
|
82
|
+
.list-wrapper::-webkit-scrollbar {
|
|
83
|
+
width: 6px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.list-wrapper::-webkit-scrollbar-thumb {
|
|
87
|
+
background-color: #d9d9d9;
|
|
88
|
+
border-radius: 3px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.list-wrapper::-webkit-scrollbar-track {
|
|
92
|
+
background-color: #f0f0f0;
|
|
93
|
+
}
|
|
94
|
+
</style>
|