Commit f41668bc authored by 何鹏程's avatar 何鹏程

修改救护车相关

parent 018d0a13
......@@ -44,7 +44,7 @@ export default {
init() {
const myChart = this.chart || echarts.init(this.$refs.chart);
const data = this.dataList.map(item => {
return [item.name, item.value]
return [item.name || item.areaName, item.value || item.count]
})
let option = {
title: {
......
......@@ -63,7 +63,7 @@ export default {
radius: ['60%', '100%'],
left: 'center',
height: 200,
width: 584,
width: 400,
minAngle: 5,
bottom: 100,
top: 50,
......
......@@ -31,6 +31,16 @@
</el-select>
</el-form-item>
<div class="btns">
<el-button
type="primary"
size="small"
@click="exportFile(4)"
>导出饼图</el-button>
<el-button
type="primary"
size="small"
@click="exportFile(5)"
>导出柱状图</el-button>
<el-button
type="primary"
size="small"
......@@ -59,9 +69,26 @@
:colorList="vechieType"
/>
</div>
<div class="box">
<div class="title">
医疗机构与非医疗机构占比
</div>
<EchartsPie
:dataList="unitTypeList"
:colorList="unitTypeColor"
/>
</div>
</div>
<div class="box mb">
<div class="title">救护车总数排行(总数:{{ getCount(allCarList) }})</div>
<EchartsBar
:dataList="allCarList"
:areaList="areaList"
title="车辆"
/>
</div>
<div class="box">
<div class="title">院前急救车总数排行</div>
<div class="title">院前急救车总数排行(总数:{{ getCount(carCountList) }})</div>
<EchartsBar
:dataList="carCountList"
:areaList="areaList"
......@@ -69,18 +96,34 @@
/>
</div>
<div class="box mb">
<div class="title">非院前急救车总数排行</div>
<div class="title">非院前急救车总数排行(总数:{{ getCount(unCarCountList) }})</div>
<EchartsBar
:dataList="unCarCountList"
:areaList="areaList"
title="车辆"
/>
</div>
<div class="box mb">
<div class="title">急救中心急救车总数排行(总数:{{ getCount(allCenterList) }})</div>
<EchartsBar
:dataList="allCenterList"
:areaList="areaList"
title="车辆"
/>
</div>
<div class="box mb">
<div class="title">非急救转运车总数排行(总数:{{ getCount(noPreTransList) }})</div>
<EchartsBar
:dataList="noPreTransList"
:areaList="areaList"
title="车辆"
/>
</div>
</div>
</div>
</template>
<script>
import { queryEmergencyResource } from '@/api/common'
import { queryEmergencyResource, exportEmergencyResources } from '@/api/common'
import { getDic } from '../../util/dict'
import EchartsPie from './components/echartsPie.vue'
import EchartsBar from './components/echartsBar.vue'
......@@ -101,7 +144,25 @@ export default {
vechieSpecialList: [],
vechieTypeList: [],
vechieType: [],
vechieSpecialPurpose: []
unitTypeList: [],
vechieSpecialPurpose: [],
unitTypeColor: [
{
color: "#80F1A8",
name: "公立医疗"
},
{
color: "#49734E",
name: "民营医疗"
},
{
color: "#D8B43E",
name: "非医疗机构"
}
],
allCarList: [],
noPreTransList: [],
allCenterList: []
}
},
mounted() {
......@@ -117,15 +178,42 @@ export default {
getData() {
queryEmergencyResource(this.searchForm).then(res => {
if (res.msg == 201) {
const { carCountList, unCarCountList, vechieSpecialList, vechieTypeList } = res.respData
const { carCountList, unCarCountList, vechieSpecialList, vechieTypeList, unitTypeList, allCarList, noPreTransList, allCenterList } = res.respData
this.carCountList = carCountList || []
this.unCarCountList = unCarCountList || []
this.vechieSpecialList = vechieSpecialList || []
this.vechieTypeList = vechieTypeList || []
this.unitTypeList = unitTypeList || []
this.allCarList = allCarList || []
this.noPreTransList = noPreTransList || []
this.allCenterList = allCenterList || []
} else {
this.$message.error(res.content)
}
})
},
exportFile(exportType) {
const params = {
...this.searchForm,
exportType: exportType
}
exportEmergencyResources(params).then(res => {
if (res.msg === 201) {
window.open(res.respData)
} else {
this.$message.error(res.content)
}
})
},
getCount(list) {
let count = 0
if (Array.isArray(list) && list.length > 0) {
count = list.reduce((a, b) => {
console.log(b)
return a + b.value
}, 0)
}
return count
}
}
}
......@@ -138,18 +226,20 @@ export default {
.top-main {
min-width: 1300px;
position: relative;
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
.box {
width: calc(50% - 12px);
min-width: auto;
flex: 1;
margin-right: 20px;
.title {
padding: 16px 32px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
font-weight: 500;
}
&:last-child {
position: absolute;
top: 0;
right: 1px;
margin-right: 0;
}
}
}
......
......@@ -32,11 +32,12 @@
prop="unitType"
>
<el-radio-group
class="radio-group-type1"
class="radio-group-type4"
v-model="dataForm.unitType"
>
<el-radio :label="1">公立医疗</el-radio>
<el-radio :label="2">民营医院</el-radio>
<el-radio :label="3">非医疗机构</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
......@@ -584,7 +585,10 @@ export default {
}
}
}
.radio-group-type4 {
font-size: 14px;
line-height: 32px;
}
.el-input.is-disabled .el-input__inner {
border: 1px solid #40a2de;
background-color: #fff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment