vue2-client 1.15.110 → 1.15.112

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 (37) hide show
  1. package/.history/src/base-client/components/his/XChart/XChart_20250812134005.vue +160 -0
  2. package/.history/src/base-client/components/his/XChart/XChart_20250812134010.vue +160 -0
  3. package/.history/src/base-client/components/his/XChart/XChart_20250812134019.vue +160 -0
  4. package/.history/src/base-client/components/his/XChart/XChart_20250812134037.vue +160 -0
  5. package/.history/src/base-client/components/his/XChart/XChart_20250812134112.vue +160 -0
  6. package/.history/src/base-client/components/his/XChart/XChart_20250812134114.vue +160 -0
  7. package/.history/src/base-client/components/his/XChart/XChart_20250812134828.vue +148 -0
  8. package/.history/src/base-client/components/his/XChart/XChart_20250812134838.vue +155 -0
  9. package/.history/src/base-client/components/his/XChart/XChart_20250812134846.vue +155 -0
  10. package/.history/src/base-client/components/his/XChart/XChart_20250812134917.vue +155 -0
  11. package/.history/src/base-client/components/his/XChart/XChart_20250812151145.vue +149 -0
  12. package/.history/src/base-client/components/his/XChart/XChart_20250812151810.vue +153 -0
  13. package/.history/src/base-client/components/his/XChart/XChart_20250812151822.vue +153 -0
  14. package/.history/src/base-client/components/his/XChart/XChart_20250812151910.vue +153 -0
  15. package/.history/src/base-client/components/his/XChart/XChart_20250812152858.vue +258 -0
  16. package/.history/src/base-client/components/his/XChart/XChart_20250812152902.vue +258 -0
  17. package/.history/src/base-client/components/his/XChart/XChart_20250812152907.vue +258 -0
  18. package/.history/src/base-client/components/his/XChart/XChart_20250812152919.vue +258 -0
  19. package/.history/src/base-client/components/his/XChart/XChart_20250812153141.vue +269 -0
  20. package/.history/src/base-client/components/his/XChart/XChart_20250812153149.vue +276 -0
  21. package/.history/src/base-client/components/his/XChart/XChart_20250812153153.vue +276 -0
  22. package/.history/src/base-client/components/his/XChart/XChart_20250812153155.vue +276 -0
  23. package/.history/src/base-client/components/his/XChart/XChart_20250812153157.vue +276 -0
  24. package/.history/src/base-client/components/his/XChart/XChart_20250812153158.vue +276 -0
  25. package/.history/src/base-client/components/his/XChart/XChart_20250812153200.vue +276 -0
  26. package/.history/src/base-client/components/his/XChart/XChart_20250812153210.vue +276 -0
  27. package/.history/src/base-client/components/his/XChart/XChart_20250812153918.vue +275 -0
  28. package/.history/src/base-client/components/his/XChart/XChart_20250812154157.vue +280 -0
  29. package/.history/src/base-client/components/his/XChart/XChart_20250812154212.vue +280 -0
  30. package/.history/src/base-client/components/his/XChart/XChart_20250812154250.vue +280 -0
  31. package/.history/src/base-client/components/his/XChart/XChart_20250812154252.vue +280 -0
  32. package/.history/src/base-client/components/his/XChart/XChart_20250812154444.vue +280 -0
  33. package/package.json +1 -1
  34. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +4 -3
  35. package/src/base-client/components/his/XChart/XChart.vue +282 -0
  36. package/src/base-client/components/his/XChart/dome.vue +19 -0
  37. package/src/router/async/router.map.js +1 -1
@@ -0,0 +1,276 @@
1
+ <template>
2
+ <div ref="main" :style="{width: config.width, height: config.height}">
3
+ </div>
4
+ </template>
5
+
6
+ <script>
7
+ import * as echarts from 'echarts'
8
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
9
+
10
+ export default {
11
+ name: 'XChart',
12
+ props: {
13
+ // 配置名
14
+ queryParamsName: {
15
+ type: String,
16
+ default: ''
17
+ },
18
+ // 服务名
19
+ serviceName: {
20
+ type: String,
21
+ default: 'af-his'
22
+ }
23
+ },
24
+ data () {
25
+ return {
26
+ data: [],
27
+ // 配置项
28
+ config: {},
29
+ // 标准值
30
+ standardValue: 0,
31
+ // 标准差
32
+ sd: 0
33
+ }
34
+ },
35
+ mounted () {},
36
+ methods: {
37
+ initDome (queryParamsName, parameter) {
38
+ getConfigByName(queryParamsName, 'af-his', async (res) => {
39
+ this.config = res
40
+ console.log('res', res)
41
+ runLogic(res.data, parameter, 'af-his').then(result => {
42
+ this.standardValue = result[0][this.config.standardValue]
43
+ this.sd = result[0].sd
44
+ const listData = result.map(item => [item.x, item.y])
45
+ this.data = listData
46
+ this.renderChart()
47
+ })
48
+ })
49
+ },
50
+ // 渲染图表
51
+ renderChart () {
52
+ const chartDom = this.$refs.main
53
+ const myChart = echarts.init(chartDom)
54
+
55
+ // 计算控制线
56
+ const centerLine = this.standardValue
57
+ const sd1Upper = centerLine + this.sd
58
+ const sd1Lower = centerLine - this.sd
59
+ const sd2Upper = centerLine + 2 * this.sd
60
+ const sd2Lower = centerLine - 2 * this.sd
61
+ const sd3Upper = centerLine + 3 * this.sd
62
+ const sd3Lower = centerLine - 3 * this.sd
63
+
64
+ // 计算y轴范围,让靶值居中
65
+ const dataMin = Math.min(...this.data.map(item => item[1]))
66
+ const dataMax = Math.max(...this.data.map(item => item[1]))
67
+ const range = Math.max(dataMax - centerLine, centerLine - dataMin, this.sd * 4)
68
+ const yMin = centerLine - range
69
+ const yMax = centerLine + range
70
+
71
+ const option = {
72
+ title: {
73
+ text: this.config.title,
74
+ subtext: this.config.subtext,
75
+ left: 'center',
76
+ textStyle: {
77
+ fontSize: 16,
78
+ fontWeight: 'bold'
79
+ },
80
+ subtextStyle: {
81
+ fontSize: 12,
82
+ color: '#666'
83
+ }
84
+ },
85
+ legend: {
86
+ bottom: 10,
87
+ data: ['测量值', '中心线', '±1SD', '±2SD', '±3SD']
88
+ },
89
+ tooltip: {
90
+ trigger: 'axis',
91
+ axisPointer: {
92
+ type: 'cross'
93
+ },
94
+ formatter: function (params) {
95
+ let result = `第${params[0].data[0]}次测量<br/>`
96
+ params.forEach(param => {
97
+ if (param.seriesName === '测量值') {
98
+ result += `${param.seriesName}: ${param.data[1]}<br/>`
99
+ }
100
+ })
101
+ return result
102
+ }
103
+ },
104
+ grid: {
105
+ left: '10%',
106
+ right: '10%',
107
+ top: '15%',
108
+ bottom: '15%'
109
+ },
110
+ xAxis: {
111
+ type: 'category',
112
+ name: '测量次数',
113
+ nameLocation: 'middle',
114
+ nameGap: 30,
115
+ axisLine: {
116
+ lineStyle: {
117
+ color: '#333'
118
+ }
119
+ },
120
+ axisTick: {
121
+ show: true
122
+ },
123
+ splitLine: {
124
+ show: false
125
+ }
126
+ },
127
+ yAxis: {
128
+ type: 'value',
129
+ name: this.config.formatter,
130
+ nameLocation: 'middle',
131
+ nameGap: 50,
132
+ show: true,
133
+ axisLine: {
134
+ show: true,
135
+ lineStyle: {
136
+ color: '#333'
137
+ }
138
+ },
139
+ axisTick: {
140
+ show: true
141
+ },
142
+ axisLabel: {
143
+ show: true
144
+ },
145
+ min: Math.min(...this.data.map(item => item[1])) - this.sd * 2,
146
+ max: Math.max(...this.data.map(item => item[1])) + this.sd * 2,
147
+ splitLine: {
148
+ show: true,
149
+ lineStyle: {
150
+ type: 'dashed',
151
+ color: '#ddd'
152
+ }
153
+ }
154
+ },
155
+ series: [
156
+ {
157
+ name: '测量值',
158
+ type: 'line',
159
+ data: this.data,
160
+ symbol: 'circle',
161
+ symbolSize: 8,
162
+ lineStyle: {
163
+ color: '#1890ff',
164
+ width: 2
165
+ },
166
+ itemStyle: {
167
+ color: '#1890ff',
168
+ borderColor: '#fff',
169
+ borderWidth: 2
170
+ },
171
+ markLine: {
172
+ silent: true,
173
+ symbol: 'none',
174
+ lineStyle: {
175
+ color: '#52c41a',
176
+ width: 2,
177
+ type: 'solid'
178
+ },
179
+ data: [
180
+ {
181
+ yAxis: centerLine,
182
+ label: {
183
+ formatter: `中心线: ${centerLine}`,
184
+ position: 'insideEndTop'
185
+ }
186
+ },
187
+ {
188
+ yAxis: sd1Upper,
189
+ lineStyle: {
190
+ color: '#faad14',
191
+ type: 'dashed'
192
+ },
193
+ label: {
194
+ formatter: `+1SD: ${sd1Upper.toFixed(2)}`,
195
+ position: 'insideEndTop'
196
+ }
197
+ },
198
+ {
199
+ yAxis: sd1Lower,
200
+ lineStyle: {
201
+ color: '#faad14',
202
+ type: 'dashed'
203
+ },
204
+ label: {
205
+ formatter: `-1SD: ${sd1Lower.toFixed(2)}`,
206
+ position: 'insideEndBottom'
207
+ }
208
+ },
209
+ {
210
+ yAxis: sd2Upper,
211
+ lineStyle: {
212
+ color: '#ff7a45',
213
+ type: 'dashed'
214
+ },
215
+ label: {
216
+ formatter: `+2SD: ${sd2Upper.toFixed(2)}`,
217
+ position: 'insideEndTop'
218
+ }
219
+ },
220
+ {
221
+ yAxis: sd2Lower,
222
+ lineStyle: {
223
+ color: '#ff7a45',
224
+ type: 'dashed'
225
+ },
226
+ label: {
227
+ formatter: `-2SD: ${sd2Lower.toFixed(2)}`,
228
+ position: 'insideEndBottom'
229
+ }
230
+ },
231
+ {
232
+ yAxis: sd3Upper,
233
+ lineStyle: {
234
+ color: '#ff4d4f',
235
+ type: 'dashed'
236
+ },
237
+ label: {
238
+ formatter: `+3SD: ${sd3Upper.toFixed(2)}`,
239
+ position: 'insideEndTop'
240
+ }
241
+ },
242
+ {
243
+ yAxis: sd3Lower,
244
+ lineStyle: {
245
+ color: '#ff4d4f',
246
+ type: 'dashed'
247
+ },
248
+ label: {
249
+ formatter: `-3SD: ${sd3Lower.toFixed(2)}`,
250
+ position: 'insideEndBottom'
251
+ }
252
+ }
253
+ ]
254
+ }
255
+ }
256
+ ]
257
+ }
258
+ option && myChart.setOption(option)
259
+ }
260
+ },
261
+ watch: {
262
+ queryParamsName: {
263
+ deep: true,
264
+ immediate: true,
265
+ handler (val) {
266
+ console.log('queryParamsName', val)
267
+ this.initDome(val, {})
268
+ }
269
+ }
270
+ }
271
+ }
272
+ </script>
273
+
274
+ <style scoped lang="less">
275
+
276
+ </style>
@@ -0,0 +1,276 @@
1
+ <template>
2
+ <div ref="main" :style="{width: config.width, height: config.height}">
3
+ </div>
4
+ </template>
5
+
6
+ <script>
7
+ import * as echarts from 'echarts'
8
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
9
+
10
+ export default {
11
+ name: 'XChart',
12
+ props: {
13
+ // 配置名
14
+ queryParamsName: {
15
+ type: String,
16
+ default: ''
17
+ },
18
+ // 服务名
19
+ serviceName: {
20
+ type: String,
21
+ default: 'af-his'
22
+ }
23
+ },
24
+ data () {
25
+ return {
26
+ data: [],
27
+ // 配置项
28
+ config: {},
29
+ // 标准值
30
+ standardValue: 0,
31
+ // 标准差
32
+ sd: 0
33
+ }
34
+ },
35
+ mounted () {},
36
+ methods: {
37
+ initDome (queryParamsName, parameter) {
38
+ getConfigByName(queryParamsName, 'af-his', async (res) => {
39
+ this.config = res
40
+ console.log('res', res)
41
+ runLogic(res.data, parameter, 'af-his').then(result => {
42
+ this.standardValue = result[0][this.config.standardValue]
43
+ this.sd = result[0].sd
44
+ const listData = result.map(item => [item.x, item.y])
45
+ this.data = listData
46
+ this.renderChart()
47
+ })
48
+ })
49
+ },
50
+ // 渲染图表
51
+ renderChart () {
52
+ const chartDom = this.$refs.main
53
+ const myChart = echarts.init(chartDom)
54
+
55
+ // 计算控制线
56
+ const centerLine = this.standardValue
57
+ const sd1Upper = centerLine + this.sd
58
+ const sd1Lower = centerLine - this.sd
59
+ const sd2Upper = centerLine + 2 * this.sd
60
+ const sd2Lower = centerLine - 2 * this.sd
61
+ const sd3Upper = centerLine + 3 * this.sd
62
+ const sd3Lower = centerLine - 3 * this.sd
63
+
64
+ // 计算y轴范围,让靶值居中
65
+ const dataMin = Math.min(...this.data.map(item => item[1]))
66
+ const dataMax = Math.max(...this.data.map(item => item[1]))
67
+ const range = Math.max(dataMax - centerLine, centerLine - dataMin, this.sd * 4)
68
+ const yMin = centerLine - range
69
+ const yMax = centerLine + range
70
+
71
+ const option = {
72
+ title: {
73
+ text: this.config.title,
74
+ subtext: this.config.subtext,
75
+ left: 'center',
76
+ textStyle: {
77
+ fontSize: 16,
78
+ fontWeight: 'bold'
79
+ },
80
+ subtextStyle: {
81
+ fontSize: 12,
82
+ color: '#666'
83
+ }
84
+ },
85
+ legend: {
86
+ bottom: 10,
87
+ data: ['测量值', '中心线', '±1SD', '±2SD', '±3SD']
88
+ },
89
+ tooltip: {
90
+ trigger: 'axis',
91
+ axisPointer: {
92
+ type: 'cross'
93
+ },
94
+ formatter: function (params) {
95
+ let result = `第${params[0].data[0]}次测量<br/>`
96
+ params.forEach(param => {
97
+ if (param.seriesName === '测量值') {
98
+ result += `${param.seriesName}: ${param.data[1]}<br/>`
99
+ }
100
+ })
101
+ return result
102
+ }
103
+ },
104
+ grid: {
105
+ left: '10%',
106
+ right: '10%',
107
+ top: '15%',
108
+ bottom: '15%'
109
+ },
110
+ xAxis: {
111
+ type: 'category',
112
+ name: '测量次数',
113
+ nameLocation: 'middle',
114
+ nameGap: 30,
115
+ axisLine: {
116
+ lineStyle: {
117
+ color: '#333'
118
+ }
119
+ },
120
+ axisTick: {
121
+ show: true
122
+ },
123
+ splitLine: {
124
+ show: false
125
+ }
126
+ },
127
+ yAxis: {
128
+ type: 'value',
129
+ name: this.config.formatter,
130
+ nameLocation: 'middle',
131
+ nameGap: 50,
132
+ show: true,
133
+ axisLine: {
134
+ show: true,
135
+ lineStyle: {
136
+ color: '#333'
137
+ }
138
+ },
139
+ axisTick: {
140
+ show: true
141
+ },
142
+ axisLabel: {
143
+ show: true
144
+ },
145
+ min: yMin,
146
+ max: yMax,
147
+ splitLine: {
148
+ show: true,
149
+ lineStyle: {
150
+ type: 'dashed',
151
+ color: '#ddd'
152
+ }
153
+ }
154
+ },
155
+ series: [
156
+ {
157
+ name: '测量值',
158
+ type: 'line',
159
+ data: this.data,
160
+ symbol: 'circle',
161
+ symbolSize: 8,
162
+ lineStyle: {
163
+ color: '#1890ff',
164
+ width: 2
165
+ },
166
+ itemStyle: {
167
+ color: '#1890ff',
168
+ borderColor: '#fff',
169
+ borderWidth: 2
170
+ },
171
+ markLine: {
172
+ silent: true,
173
+ symbol: 'none',
174
+ lineStyle: {
175
+ color: '#52c41a',
176
+ width: 2,
177
+ type: 'solid'
178
+ },
179
+ data: [
180
+ {
181
+ yAxis: centerLine,
182
+ label: {
183
+ formatter: `中心线: ${centerLine}`,
184
+ position: 'insideEndTop'
185
+ }
186
+ },
187
+ {
188
+ yAxis: sd1Upper,
189
+ lineStyle: {
190
+ color: '#faad14',
191
+ type: 'dashed'
192
+ },
193
+ label: {
194
+ formatter: `+1SD: ${sd1Upper.toFixed(2)}`,
195
+ position: 'insideEndTop'
196
+ }
197
+ },
198
+ {
199
+ yAxis: sd1Lower,
200
+ lineStyle: {
201
+ color: '#faad14',
202
+ type: 'dashed'
203
+ },
204
+ label: {
205
+ formatter: `-1SD: ${sd1Lower.toFixed(2)}`,
206
+ position: 'insideEndBottom'
207
+ }
208
+ },
209
+ {
210
+ yAxis: sd2Upper,
211
+ lineStyle: {
212
+ color: '#ff7a45',
213
+ type: 'dashed'
214
+ },
215
+ label: {
216
+ formatter: `+2SD: ${sd2Upper.toFixed(2)}`,
217
+ position: 'insideEndTop'
218
+ }
219
+ },
220
+ {
221
+ yAxis: sd2Lower,
222
+ lineStyle: {
223
+ color: '#ff7a45',
224
+ type: 'dashed'
225
+ },
226
+ label: {
227
+ formatter: `-2SD: ${sd2Lower.toFixed(2)}`,
228
+ position: 'insideEndBottom'
229
+ }
230
+ },
231
+ {
232
+ yAxis: sd3Upper,
233
+ lineStyle: {
234
+ color: '#ff4d4f',
235
+ type: 'dashed'
236
+ },
237
+ label: {
238
+ formatter: `+3SD: ${sd3Upper.toFixed(2)}`,
239
+ position: 'insideEndTop'
240
+ }
241
+ },
242
+ {
243
+ yAxis: sd3Lower,
244
+ lineStyle: {
245
+ color: '#ff4d4f',
246
+ type: 'dashed'
247
+ },
248
+ label: {
249
+ formatter: `-3SD: ${sd3Lower.toFixed(2)}`,
250
+ position: 'insideEndBottom'
251
+ }
252
+ }
253
+ ]
254
+ }
255
+ }
256
+ ]
257
+ }
258
+ option && myChart.setOption(option)
259
+ }
260
+ },
261
+ watch: {
262
+ queryParamsName: {
263
+ deep: true,
264
+ immediate: true,
265
+ handler (val) {
266
+ console.log('queryParamsName', val)
267
+ this.initDome(val, {})
268
+ }
269
+ }
270
+ }
271
+ }
272
+ </script>
273
+
274
+ <style scoped lang="less">
275
+
276
+ </style>