vue2-client 1.18.29 → 1.18.30
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/docs/HChart/351/205/215/347/275/256/346/226/207/346/241/243.md +2347 -0
- package/package.json +1 -1
- package/src/base-client/components/his/HChart/HChart.vue +35 -9
- package/src/base-client/components/his/HChart/demo.vue +88 -88
- package/src/base-client/components/his/HChart/index.md +798 -798
- package/src/base-client/components/his/XIcon/XIcon.vue +73 -73
- package/src/base-client/components/his/XIcon/index.js +3 -3
- package/src/base-client/components/his/XIcon/index.md +177 -177
- package/src/assets/img/paymentMethod/icon1.png +0 -0
- package/src/assets/img/paymentMethod/icon2.png +0 -0
- package/src/assets/img/paymentMethod/icon3.png +0 -0
- package/src/assets/img/paymentMethod/icon4.png +0 -0
- package/src/assets/img/paymentMethod/icon5.png +0 -0
- package/src/assets/img/paymentMethod/icon6.png +0 -0
- package/src/base-client/components/common/XReport/XReportHospitalizationDemo.vue +0 -45
- package/src-base-client/components/his/XCharge/XCharge.vue +0 -0
- /package/{src-base-client/components/his/XCharge/README.md → assets/c__Users_QXLL_AppData_Roaming_Cursor_User_workspaceStorage_4fb3d7e3441d32bc6f2c7358b4188b48_images_e8c132e6dde513250d7f9721712df1f8-f1522a08-1aa0-4866-b4e5-b34cf2e21109.png} +0 -0
package/package.json
CHANGED
|
@@ -274,12 +274,24 @@ const resolveStaticDataset = (config) => {
|
|
|
274
274
|
return scoped
|
|
275
275
|
}
|
|
276
276
|
let scopedDataset = dataset
|
|
277
|
+
// 先处理时间粒度筛选(radioFilter),因为 dataset 的第一层可能是时间粒度
|
|
278
|
+
const filterKeys = [
|
|
279
|
+
selectedFilterValue.value,
|
|
280
|
+
radioFilterConfig.value?.defaultValue
|
|
281
|
+
].filter(Boolean)
|
|
282
|
+
if (filterKeys.length) {
|
|
283
|
+
const filterScoped = pickByKeys(dataset, filterKeys, true)
|
|
284
|
+
if (Array.isArray(filterScoped)) return filterScoped
|
|
285
|
+
if (filterScoped && typeof filterScoped === 'object') scopedDataset = filterScoped
|
|
286
|
+
}
|
|
287
|
+
if (Array.isArray(scopedDataset)) return scopedDataset
|
|
288
|
+
// 再处理级联筛选或侧边列表筛选
|
|
277
289
|
if (isCascadeMode.value) {
|
|
278
290
|
const cascadeKeys = cascadeColumns.value
|
|
279
291
|
.map(column => column.field && selectedCascadeValues.value[column.field])
|
|
280
292
|
.filter(value => value !== undefined && value !== null && value !== '')
|
|
281
293
|
if (cascadeKeys.length) {
|
|
282
|
-
const cascadeScoped = pickNestedByKeys(
|
|
294
|
+
const cascadeScoped = pickNestedByKeys(scopedDataset, cascadeKeys)
|
|
283
295
|
if (Array.isArray(cascadeScoped)) return cascadeScoped
|
|
284
296
|
if (cascadeScoped && typeof cascadeScoped === 'object') scopedDataset = cascadeScoped
|
|
285
297
|
}
|
|
@@ -289,18 +301,32 @@ const resolveStaticDataset = (config) => {
|
|
|
289
301
|
sideListConfig.value?.defaultValue
|
|
290
302
|
].filter(Boolean)
|
|
291
303
|
if (listKeys.length) {
|
|
292
|
-
|
|
304
|
+
// 优先在已按时间粒度过滤后的 scopedDataset 中取
|
|
305
|
+
const listScoped = pickByKeys(scopedDataset, listKeys, true)
|
|
293
306
|
if (Array.isArray(listScoped)) return listScoped
|
|
294
|
-
if (listScoped && typeof listScoped === 'object')
|
|
307
|
+
if (listScoped && typeof listScoped === 'object') {
|
|
308
|
+
// 在侧边列表命中的作用域内,再次按时间粒度过滤(处理 { dept: { week: [...] } } 场景)
|
|
309
|
+
let scopedAfterList = listScoped
|
|
310
|
+
if (filterKeys.length) {
|
|
311
|
+
const filterScopedInner = pickByKeys(scopedAfterList, filterKeys, true)
|
|
312
|
+
if (Array.isArray(filterScopedInner)) return filterScopedInner
|
|
313
|
+
if (filterScopedInner && typeof filterScopedInner === 'object') scopedAfterList = filterScopedInner
|
|
314
|
+
}
|
|
315
|
+
scopedDataset = scopedAfterList
|
|
316
|
+
} else {
|
|
317
|
+
// 如果时间粒度在第二层(如 { dept: { week: [...] } }),尝试反向嵌套取值
|
|
318
|
+
const nestedOrder = pickNestedByKeys(dataset, [...listKeys, ...filterKeys])
|
|
319
|
+
if (Array.isArray(nestedOrder)) return nestedOrder
|
|
320
|
+
if (nestedOrder && typeof nestedOrder === 'object') scopedDataset = nestedOrder
|
|
321
|
+
else {
|
|
322
|
+
const reverseNested = pickNestedByKeys(dataset, [...filterKeys, ...listKeys])
|
|
323
|
+
if (Array.isArray(reverseNested)) return reverseNested
|
|
324
|
+
if (reverseNested && typeof reverseNested === 'object') scopedDataset = reverseNested
|
|
325
|
+
}
|
|
326
|
+
}
|
|
295
327
|
}
|
|
296
328
|
}
|
|
297
329
|
if (Array.isArray(scopedDataset)) return scopedDataset
|
|
298
|
-
const filterKeys = [
|
|
299
|
-
selectedFilterValue.value,
|
|
300
|
-
radioFilterConfig.value?.defaultValue
|
|
301
|
-
].filter(Boolean)
|
|
302
|
-
const filterScoped = pickByKeys(scopedDataset, filterKeys, false)
|
|
303
|
-
if (Array.isArray(filterScoped)) return filterScoped
|
|
304
330
|
const firstArray = pickFirstArray(scopedDataset)
|
|
305
331
|
if (Array.isArray(firstArray)) return firstArray
|
|
306
332
|
}
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="h-chart-test-container">
|
|
3
|
-
<h2>HChart 组件测试案例</h2>
|
|
4
|
-
|
|
5
|
-
<section class="test-section">
|
|
6
|
-
<h3>测试1: 通过 queryParamsName 查询配置(从后端获取配置和数据)</h3>
|
|
7
|
-
<div class="chart-wrapper">
|
|
8
|
-
<HChart
|
|
9
|
-
ref="chart1"
|
|
10
|
-
query-params-name="accountsReceivableChart"
|
|
11
|
-
:fixed-query-form="{ condition: '1=1', dateRange: '2024-01' }"
|
|
12
|
-
service-name="af-his"
|
|
13
|
-
@init="handleChartInit"
|
|
14
|
-
@dataLoaded="handleDataLoaded"
|
|
15
|
-
@error="handleError"
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
<div class="test-actions">
|
|
19
|
-
<a-button @click="refreshChart1">刷新图表</a-button>
|
|
20
|
-
<a-button @click="reloadChart1">重新加载(更新查询条件)</a-button>
|
|
21
|
-
</div>
|
|
22
|
-
</section>
|
|
23
|
-
|
|
24
|
-
<section class="test-section">
|
|
25
|
-
<h3>测试日志</h3>
|
|
26
|
-
<div class="log-container">
|
|
27
|
-
<div v-for="(log, index) in logs" :key="index" class="log-item">
|
|
28
|
-
<span class="log-time">{{ log.time }}</span>
|
|
29
|
-
<span class="log-type" :class="log.type">{{ log.type }}</span>
|
|
30
|
-
<span class="log-message">{{ log.message }}</span>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
<a-button @click="clearLogs">清空日志</a-button>
|
|
34
|
-
</section>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script setup>
|
|
39
|
-
import { ref } from 'vue'
|
|
40
|
-
import { message } from 'ant-design-vue'
|
|
41
|
-
import HChart from './HChart.vue'
|
|
42
|
-
|
|
43
|
-
const chart1 = ref(null)
|
|
44
|
-
|
|
45
|
-
const logs = ref([])
|
|
46
|
-
|
|
47
|
-
const addLog = (type, messageText) => {
|
|
48
|
-
logs.value.unshift({
|
|
49
|
-
time: new Date().toLocaleTimeString(),
|
|
50
|
-
type,
|
|
51
|
-
message: typeof messageText === 'object' ? JSON.stringify(messageText, null, 2) : messageText
|
|
52
|
-
})
|
|
53
|
-
if (logs.value.length > 50) logs.value.pop()
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const clearLogs = () => {
|
|
57
|
-
logs.value = []
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const handleChartInit = (config) => {
|
|
61
|
-
addLog('init', `图表初始化: ${config?.title || '未知'}`)
|
|
62
|
-
message.success(`图表初始化成功: ${config?.title || '未知'}`)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const handleDataLoaded = (data) => {
|
|
66
|
-
addLog('dataLoaded', `数据加载完成,共 ${data?.length || 0} 条`)
|
|
67
|
-
console.log('数据加载完成:', data)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const handleError = (error) => {
|
|
71
|
-
addLog('error', `错误: ${error?.message || String(error)}`)
|
|
72
|
-
message.error(`图表加载错误: ${error?.message || String(error)}`)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const refreshChart1 = () => {
|
|
76
|
-
if (!chart1.value) return
|
|
77
|
-
chart1.value.refresh()
|
|
78
|
-
addLog('action', '刷新图表')
|
|
79
|
-
message.info('正在刷新图表...')
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const reloadChart1 = () => {
|
|
83
|
-
if (!chart1.value) return
|
|
84
|
-
chart1.value.reload({ condition: '1=1', dateRange: '2024-02' })
|
|
85
|
-
addLog('action', '重新加载图表,更新查询条件')
|
|
86
|
-
message.info('正在重新加载图表...')
|
|
87
|
-
}
|
|
88
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="h-chart-test-container">
|
|
3
|
+
<h2>HChart 组件测试案例</h2>
|
|
4
|
+
|
|
5
|
+
<section class="test-section">
|
|
6
|
+
<h3>测试1: 通过 queryParamsName 查询配置(从后端获取配置和数据)</h3>
|
|
7
|
+
<div class="chart-wrapper">
|
|
8
|
+
<HChart
|
|
9
|
+
ref="chart1"
|
|
10
|
+
query-params-name="accountsReceivableChart"
|
|
11
|
+
:fixed-query-form="{ condition: '1=1', dateRange: '2024-01' }"
|
|
12
|
+
service-name="af-his"
|
|
13
|
+
@init="handleChartInit"
|
|
14
|
+
@dataLoaded="handleDataLoaded"
|
|
15
|
+
@error="handleError"
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="test-actions">
|
|
19
|
+
<a-button @click="refreshChart1">刷新图表</a-button>
|
|
20
|
+
<a-button @click="reloadChart1">重新加载(更新查询条件)</a-button>
|
|
21
|
+
</div>
|
|
22
|
+
</section>
|
|
23
|
+
|
|
24
|
+
<section class="test-section">
|
|
25
|
+
<h3>测试日志</h3>
|
|
26
|
+
<div class="log-container">
|
|
27
|
+
<div v-for="(log, index) in logs" :key="index" class="log-item">
|
|
28
|
+
<span class="log-time">{{ log.time }}</span>
|
|
29
|
+
<span class="log-type" :class="log.type">{{ log.type }}</span>
|
|
30
|
+
<span class="log-message">{{ log.message }}</span>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<a-button @click="clearLogs">清空日志</a-button>
|
|
34
|
+
</section>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup>
|
|
39
|
+
import { ref } from 'vue'
|
|
40
|
+
import { message } from 'ant-design-vue'
|
|
41
|
+
import HChart from './HChart.vue'
|
|
42
|
+
|
|
43
|
+
const chart1 = ref(null)
|
|
44
|
+
|
|
45
|
+
const logs = ref([])
|
|
46
|
+
|
|
47
|
+
const addLog = (type, messageText) => {
|
|
48
|
+
logs.value.unshift({
|
|
49
|
+
time: new Date().toLocaleTimeString(),
|
|
50
|
+
type,
|
|
51
|
+
message: typeof messageText === 'object' ? JSON.stringify(messageText, null, 2) : messageText
|
|
52
|
+
})
|
|
53
|
+
if (logs.value.length > 50) logs.value.pop()
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const clearLogs = () => {
|
|
57
|
+
logs.value = []
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const handleChartInit = (config) => {
|
|
61
|
+
addLog('init', `图表初始化: ${config?.title || '未知'}`)
|
|
62
|
+
message.success(`图表初始化成功: ${config?.title || '未知'}`)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const handleDataLoaded = (data) => {
|
|
66
|
+
addLog('dataLoaded', `数据加载完成,共 ${data?.length || 0} 条`)
|
|
67
|
+
console.log('数据加载完成:', data)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const handleError = (error) => {
|
|
71
|
+
addLog('error', `错误: ${error?.message || String(error)}`)
|
|
72
|
+
message.error(`图表加载错误: ${error?.message || String(error)}`)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const refreshChart1 = () => {
|
|
76
|
+
if (!chart1.value) return
|
|
77
|
+
chart1.value.refresh()
|
|
78
|
+
addLog('action', '刷新图表')
|
|
79
|
+
message.info('正在刷新图表...')
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const reloadChart1 = () => {
|
|
83
|
+
if (!chart1.value) return
|
|
84
|
+
chart1.value.reload({ condition: '1=1', dateRange: '2024-02' })
|
|
85
|
+
addLog('action', '重新加载图表,更新查询条件')
|
|
86
|
+
message.info('正在重新加载图表...')
|
|
87
|
+
}
|
|
88
|
+
</script>
|