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

修改救护车相关

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