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,258 @@
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
+ const option = {
65
+ title: {
66
+ text: this.config.title,
67
+ subtext: this.config.subtext,
68
+ left: 'center',
69
+ textStyle: {
70
+ fontSize: 16,
71
+ fontWeight: 'bold'
72
+ },
73
+ subtextStyle: {
74
+ fontSize: 12,
75
+ color: '#666'
76
+ }
77
+ },
78
+ legend: {
79
+ bottom: 10,
80
+ data: ['测量值', '中心线', '±1SD', '±2SD', '±3SD']
81
+ },
82
+ tooltip: {
83
+ trigger: 'axis',
84
+ axisPointer: {
85
+ type: 'cross'
86
+ },
87
+ formatter: function (params) {
88
+ let result = `第${params[0].data[0]}次测量<br/>`
89
+ params.forEach(param => {
90
+ if (param.seriesName === '测量值') {
91
+ result += `${param.seriesName}: ${param.data[1]}<br/>`
92
+ }
93
+ })
94
+ return result
95
+ }
96
+ },
97
+ grid: {
98
+ left: '10%',
99
+ right: '10%',
100
+ top: '15%',
101
+ bottom: '15%'
102
+ },
103
+ xAxis: {
104
+ type: 'category',
105
+ name: '测量次数',
106
+ nameLocation: 'middle',
107
+ nameGap: 30,
108
+ axisLine: {
109
+ lineStyle: {
110
+ color: '#333'
111
+ }
112
+ },
113
+ axisTick: {
114
+ show: true
115
+ },
116
+ splitLine: {
117
+ show: false
118
+ }
119
+ },
120
+ yAxis: {
121
+ type: 'value',
122
+ name: this.config.formatter,
123
+ nameLocation: 'middle',
124
+ nameGap: 50,
125
+ axisLine: {
126
+ lineStyle: {
127
+ color: '#333'
128
+ }
129
+ },
130
+ splitLine: {
131
+ lineStyle: {
132
+ type: 'dashed',
133
+ color: '#ddd'
134
+ }
135
+ }
136
+ },
137
+ series: [
138
+ {
139
+ name: '测量值',
140
+ type: 'line',
141
+ data: this.data,
142
+ symbol: 'circle',
143
+ symbolSize: 8,
144
+ lineStyle: {
145
+ color: '#1890ff',
146
+ width: 2
147
+ },
148
+ itemStyle: {
149
+ color: '#1890ff',
150
+ borderColor: '#fff',
151
+ borderWidth: 2
152
+ },
153
+ markLine: {
154
+ silent: true,
155
+ symbol: 'none',
156
+ lineStyle: {
157
+ color: '#52c41a',
158
+ width: 2,
159
+ type: 'solid'
160
+ },
161
+ data: [
162
+ {
163
+ yAxis: centerLine,
164
+ label: {
165
+ formatter: `中心线: ${centerLine}`,
166
+ position: 'insideEndTop'
167
+ }
168
+ },
169
+ {
170
+ yAxis: sd1Upper,
171
+ lineStyle: {
172
+ color: '#faad14',
173
+ type: 'dashed'
174
+ },
175
+ label: {
176
+ formatter: `+1SD: ${sd1Upper.toFixed(2)}`,
177
+ position: 'insideEndTop'
178
+ }
179
+ },
180
+ {
181
+ yAxis: sd1Lower,
182
+ lineStyle: {
183
+ color: '#faad14',
184
+ type: 'dashed'
185
+ },
186
+ label: {
187
+ formatter: `-1SD: ${sd1Lower.toFixed(2)}`,
188
+ position: 'insideEndBottom'
189
+ }
190
+ },
191
+ {
192
+ yAxis: sd2Upper,
193
+ lineStyle: {
194
+ color: '#ff7a45',
195
+ type: 'dashed'
196
+ },
197
+ label: {
198
+ formatter: `+2SD: ${sd2Upper.toFixed(2)}`,
199
+ position: 'insideEndTop'
200
+ }
201
+ },
202
+ {
203
+ yAxis: sd2Lower,
204
+ lineStyle: {
205
+ color: '#ff7a45',
206
+ type: 'dashed'
207
+ },
208
+ label: {
209
+ formatter: `-2SD: ${sd2Lower.toFixed(2)}`,
210
+ position: 'insideEndBottom'
211
+ }
212
+ },
213
+ {
214
+ yAxis: sd3Upper,
215
+ lineStyle: {
216
+ color: '#ff4d4f',
217
+ type: 'dashed'
218
+ },
219
+ label: {
220
+ formatter: `+3SD: ${sd3Upper.toFixed(2)}`,
221
+ position: 'insideEndTop'
222
+ }
223
+ },
224
+ {
225
+ yAxis: sd3Lower,
226
+ lineStyle: {
227
+ color: '#ff4d4f',
228
+ type: 'dashed'
229
+ },
230
+ label: {
231
+ formatter: `-3SD: ${sd3Lower.toFixed(2)}`,
232
+ position: 'insideEndBottom'
233
+ }
234
+ }
235
+ ]
236
+ }
237
+ }
238
+ ]
239
+ }
240
+ option && myChart.setOption(option)
241
+ }
242
+ },
243
+ watch: {
244
+ queryParamsName: {
245
+ deep: true,
246
+ immediate: true,
247
+ handler (val) {
248
+ console.log('queryParamsName', val)
249
+ this.initDome(val, {})
250
+ }
251
+ }
252
+ }
253
+ }
254
+ </script>
255
+
256
+ <style scoped lang="less">
257
+
258
+ </style>
@@ -0,0 +1,269 @@
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
+ const option = {
65
+ title: {
66
+ text: this.config.title,
67
+ subtext: this.config.subtext,
68
+ left: 'center',
69
+ textStyle: {
70
+ fontSize: 16,
71
+ fontWeight: 'bold'
72
+ },
73
+ subtextStyle: {
74
+ fontSize: 12,
75
+ color: '#666'
76
+ }
77
+ },
78
+ legend: {
79
+ bottom: 10,
80
+ data: ['测量值', '中心线', '±1SD', '±2SD', '±3SD']
81
+ },
82
+ tooltip: {
83
+ trigger: 'axis',
84
+ axisPointer: {
85
+ type: 'cross'
86
+ },
87
+ formatter: function (params) {
88
+ let result = `第${params[0].data[0]}次测量<br/>`
89
+ params.forEach(param => {
90
+ if (param.seriesName === '测量值') {
91
+ result += `${param.seriesName}: ${param.data[1]}<br/>`
92
+ }
93
+ })
94
+ return result
95
+ }
96
+ },
97
+ grid: {
98
+ left: '10%',
99
+ right: '10%',
100
+ top: '15%',
101
+ bottom: '15%'
102
+ },
103
+ xAxis: {
104
+ type: 'category',
105
+ name: '测量次数',
106
+ nameLocation: 'middle',
107
+ nameGap: 30,
108
+ axisLine: {
109
+ lineStyle: {
110
+ color: '#333'
111
+ }
112
+ },
113
+ axisTick: {
114
+ show: true
115
+ },
116
+ splitLine: {
117
+ show: false
118
+ }
119
+ },
120
+ yAxis: {
121
+ type: 'value',
122
+ name: this.config.formatter,
123
+ nameLocation: 'middle',
124
+ nameGap: 50,
125
+ show: true,
126
+ axisLine: {
127
+ show: true,
128
+ lineStyle: {
129
+ color: '#333'
130
+ }
131
+ },
132
+ axisTick: {
133
+ show: true
134
+ },
135
+ axisLabel: {
136
+ show: true
137
+ },
138
+ min: Math.min(...this.data.map(item => item[1])) - this.sd * 2,
139
+ max: Math.max(...this.data.map(item => item[1])) + this.sd * 2,
140
+ splitLine: {
141
+ show: true,
142
+ lineStyle: {
143
+ type: 'dashed',
144
+ color: '#ddd'
145
+ }
146
+ }
147
+ },
148
+ series: [
149
+ {
150
+ name: '测量值',
151
+ type: 'line',
152
+ data: this.data,
153
+ symbol: 'circle',
154
+ symbolSize: 8,
155
+ lineStyle: {
156
+ color: '#1890ff',
157
+ width: 2
158
+ },
159
+ itemStyle: {
160
+ color: '#1890ff',
161
+ borderColor: '#fff',
162
+ borderWidth: 2
163
+ },
164
+ markLine: {
165
+ silent: true,
166
+ symbol: 'none',
167
+ lineStyle: {
168
+ color: '#52c41a',
169
+ width: 2,
170
+ type: 'solid'
171
+ },
172
+ data: [
173
+ {
174
+ yAxis: centerLine,
175
+ label: {
176
+ formatter: `中心线: ${centerLine}`,
177
+ position: 'insideEndTop'
178
+ }
179
+ },
180
+ {
181
+ yAxis: sd1Upper,
182
+ lineStyle: {
183
+ color: '#faad14',
184
+ type: 'dashed'
185
+ },
186
+ label: {
187
+ formatter: `+1SD: ${sd1Upper.toFixed(2)}`,
188
+ position: 'insideEndTop'
189
+ }
190
+ },
191
+ {
192
+ yAxis: sd1Lower,
193
+ lineStyle: {
194
+ color: '#faad14',
195
+ type: 'dashed'
196
+ },
197
+ label: {
198
+ formatter: `-1SD: ${sd1Lower.toFixed(2)}`,
199
+ position: 'insideEndBottom'
200
+ }
201
+ },
202
+ {
203
+ yAxis: sd2Upper,
204
+ lineStyle: {
205
+ color: '#ff7a45',
206
+ type: 'dashed'
207
+ },
208
+ label: {
209
+ formatter: `+2SD: ${sd2Upper.toFixed(2)}`,
210
+ position: 'insideEndTop'
211
+ }
212
+ },
213
+ {
214
+ yAxis: sd2Lower,
215
+ lineStyle: {
216
+ color: '#ff7a45',
217
+ type: 'dashed'
218
+ },
219
+ label: {
220
+ formatter: `-2SD: ${sd2Lower.toFixed(2)}`,
221
+ position: 'insideEndBottom'
222
+ }
223
+ },
224
+ {
225
+ yAxis: sd3Upper,
226
+ lineStyle: {
227
+ color: '#ff4d4f',
228
+ type: 'dashed'
229
+ },
230
+ label: {
231
+ formatter: `+3SD: ${sd3Upper.toFixed(2)}`,
232
+ position: 'insideEndTop'
233
+ }
234
+ },
235
+ {
236
+ yAxis: sd3Lower,
237
+ lineStyle: {
238
+ color: '#ff4d4f',
239
+ type: 'dashed'
240
+ },
241
+ label: {
242
+ formatter: `-3SD: ${sd3Lower.toFixed(2)}`,
243
+ position: 'insideEndBottom'
244
+ }
245
+ }
246
+ ]
247
+ }
248
+ }
249
+ ]
250
+ }
251
+ option && myChart.setOption(option)
252
+ }
253
+ },
254
+ watch: {
255
+ queryParamsName: {
256
+ deep: true,
257
+ immediate: true,
258
+ handler (val) {
259
+ console.log('queryParamsName', val)
260
+ this.initDome(val, {})
261
+ }
262
+ }
263
+ }
264
+ }
265
+ </script>
266
+
267
+ <style scoped lang="less">
268
+
269
+ </style>