Browse Source

peter

360view
newPeter7 2 years ago
parent
commit
43d1ae8578
  1. 5
      src/components/360View/key-indicators.vue
  2. 200
      src/components/echarts/yanzhou.vue
  3. 1
      src/page-subspecialty/views/modules/optometryManagement/seeDoctor/informBook/notice-book.vue

5
src/components/360View/key-indicators.vue

@ -25,7 +25,7 @@
desc="视力"
class="scroll-echearts"
/>
<echarts-yanya
<echarts-yanzhou
:id-name="'key-indicators-yanzhou'"
:chart-data="shiliAndYanya.yanZhouList"
desc="眼轴"
@ -69,9 +69,10 @@
import echartsShili from '@/components/echarts/shili'
import echartsLine from '@/components/echarts/line'
import echartsYanya from '@/components/echarts/yanya'
import echartsYanzhou from '@/components/echarts/yanzhou'
export default {
components: { echartsShili, echartsYanya, echartsLine },
components: { echartsShili, echartsYanya,echartsYanzhou, echartsLine },
props: {
patientId: {
type: String,

200
src/components/echarts/yanzhou.vue

@ -0,0 +1,200 @@
<template>
<div>
<div :id="idName" ref="yanzhouRef" :style="{ height: height, width: width }" />
</div>
</template>
<script>
import moment from 'moment' //
export default {
props: {
idName: { type: String, default: 'chart' },
width: { type: String, default: '100%' },
height: { type: String, default: '200px' },
chartData: { type: Array, default: () => [] },
desc: { type: String, default: '' }
},
data() {
return {
date: [],
typeList: {
OD: [],
OS: [],
typeNull: []
},
legendData: [],
seriesData: [],
disabled: false
}
},
watch: {
chartData: {
handler(val, olVal) {
this.initFun()
},
deep: true
}
},
mounted() {
this.initFun()
},
methods: {
initFun() {
this.date = []
this.typeList = {
OD: [],
OS: [],
typeNull: []
}
this.legendData = []
this.seriesData = []
if (this.chartData && this.chartData.length > 0) {
this.disabled = false
this.chartData.forEach(item => {
this.date.push(moment(item.examTime).format('l'))
this.typeList.OD.push([item.examTime, item.odOil.slice(0, item.odOil.length - 3)])
this.legendData[0] = 'OD'
this.typeList.OS.push([item.examTime, item.osOil.slice(0, item.osOil.length - 3)])
this.legendData[1] = 'OS'
})
} else {
this.disabled = true
}
this.$nextTick(() => {
this.visionFun()
})
},
visionFun() {
// domecharts
const yanzhou = this.$echarts.init(document.getElementById(this.idName))
const colors = ['#4462FF', '#0DB760', '#000000']
Object.keys(this.typeList).forEach((item, index) => {
if (this.typeList[item].length > 0) {
this.seriesData.push({
name: item,
type: 'line',
// stack: index,
data: this.typeList[item],
label: {
show: true,
position: item === 'OD' ? [-25, -30] : [10, -5],
backgroundColor: item === 'OD' ? '#4a6bff' : '#0db760',
padding: [6, 6],
color: '#ffffff',
// color: 'rgba(24, 24, 24, 0.1)',
borderRadius: 10
},
smooth: true,
itemStyle: {
color: colors[index]
},
symbolSize: 10
})
}
})
// domecharts
yanzhou.setOption({
title: {
text: this.desc,
textStyle: {
'color': '#000000'
},
left: 10
},
tooltip: {
// trigger: 'axis'
backgroundColor: '#ece6e6',
textStyle: {
color: '#000000' //
},
formatter(params) {
return params.seriesName + '<br/>' + params.data[0] + '&nbsp&nbsp&nbsp' + params.data[1]
}
},
legend: {
data: this.legendData,
icon: 'pin',
textStyle: {
color: '#000000'
},
right: 30
},
dataZoom: [
{
type: 'inside',
disabled: this.disabled,
start: 0,
end: 100
}
],
grid: {
top: 55,
left: 50,
right: 50,
bottom: 30,
containLabel: false
},
xAxis: {
type: 'time',
boundaryGap: false,
axisLabel: {
show: true,
showMaxLabel: true,
textStyle: {
color: '#000000'
},
formatter: function(value, index) {
const showD = moment(value).format('YYYY/M/D')
return showD
}
},
axisLine: {
lineStyle: {
color: 'rgba(24, 24, 24, 0.1)'
}
},
// 线
splitLine: {
show: true
}
},
yAxis: {
type: 'value',
min: function(value) { //
return Math.floor(value.min)
},
max: function(value) { //
return Math.ceil(value.max)
},
splitNumber: 1, //
axisLabel: {
show: true,
textStyle: {
color: '#000000'
}
},
axisLine: {
lineStyle: {
color: 'rgba(24, 24, 24, 0.1)'
}
}
},
series: [
...this.seriesData
]
})
//
window.addEventListener('resize', () => { yanzhou.resize() })
// div
this.$erd.listenTo(this.$refs.yanzhouRef, () => {
this.$nextTick(() => {
yanzhou.resize()
})
})
}
}
}
</script>
<style style="scss" scoped>
</style>

1
src/page-subspecialty/views/modules/optometryManagement/seeDoctor/informBook/notice-book.vue

@ -203,7 +203,6 @@ export default {
},
handlePrint() {
this.printHidden = false
this.printPage('notice-one')
},
//
getNoticeName() {

Loading…
Cancel
Save