vue2-client 1.15.109 → 1.15.111
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/.history/src/base-client/components/his/XChart/XChart_20250812134005.vue +160 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134010.vue +160 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134019.vue +160 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134037.vue +160 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134112.vue +160 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134114.vue +160 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134828.vue +148 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134838.vue +155 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134846.vue +155 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812134917.vue +155 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812151145.vue +149 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812151810.vue +153 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812151822.vue +153 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812151910.vue +153 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812152858.vue +258 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812152902.vue +258 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812152907.vue +258 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812152919.vue +258 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153141.vue +269 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153149.vue +276 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153153.vue +276 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153155.vue +276 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153157.vue +276 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153158.vue +276 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153200.vue +276 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153210.vue +276 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812153918.vue +275 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812154157.vue +280 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812154212.vue +280 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812154250.vue +280 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812154252.vue +280 -0
- package/.history/src/base-client/components/his/XChart/XChart_20250812154444.vue +280 -0
- package/package.json +1 -1
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +4 -3
- package/src/base-client/components/his/XChart/XChart.vue +280 -0
- package/src/base-client/components/his/XChart/dome.vue +19 -0
- package/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +2 -2
- 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,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>
|