主诉分类

This commit is contained in:
zhaotiantian
2023-11-28 16:59:09 +08:00
parent 86ab4a706c
commit e3feba62a8
3 changed files with 142 additions and 44 deletions
+3 -1
View File
@@ -5,7 +5,8 @@ import {
Button, Button,
Radio, Radio,
Modal, Modal,
Table Table,
Select
} from 'ant-design-vue'; } from 'ant-design-vue';
export default function registerGlobComp(app: App) { export default function registerGlobComp(app: App) {
@@ -15,4 +16,5 @@ export default function registerGlobComp(app: App) {
.use(Radio) .use(Radio)
.use(Modal) .use(Modal)
.use(Table) .use(Table)
.use(Select)
} }
+136 -42
View File
@@ -1,45 +1,54 @@
<template> <template>
<div> <div>
<public-title title="主诉分类"/> <public-title title="主诉分类"/>
<div class="inner"> <div class="inner">
<div class="title"> <div class="title">
<div class="type-time"> <div class="type-check">
<span :class="selectIndex===index?'select':'unSelect'" v-for="(item,index) in typeTime" :key="index" @click="handleSelect(index)">{{item.name}}</span> <span :class="selectIndex===index?'select':'unSelect'" v-for="(item,index) in typeTime" :key="index"
</div> @click="handleSelect(index)">{{ item.name }}</span>
<div class="type-all">全部数据</div>
</div>
<div class="line-chart" ref="chiefChart"></div>
</div> </div>
<div class="type-all">
<a-select v-model:value="typesSelect" class="type-select" >
<a-select-option value="全部数据">全部数据</a-select-option>
<a-select-option value="jack">Jack</a-select-option>
<a-select-option value="lucy">Lucy</a-select-option>
</a-select>
</div>
</div>
<div class="line-chart" ref="chiefChart"></div>
</div> </div>
</div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref,onMounted } from 'vue'; import {ref, onMounted} from 'vue';
import PublicTitle from "../publicTitle.vue"; import PublicTitle from "../publicTitle.vue";
import * as echarts from 'echarts'; import * as echarts from 'echarts';
const typesSelect = ref('全部数据')
const typeTime = ref([ const typeTime = ref([
{ {
name:'男', name: '男',
value:'man', value: 'man',
},{ }, {
name:'女', name: '女',
value:'women', value: 'women',
}, },
]) ])
const selectIndex = ref(0) const selectIndex = ref(0)
const chiefChart = ref<HTMLElement>() const chiefChart = ref<HTMLElement>()
onMounted(()=>{ onMounted(() => {
let xdata = ['创伤类', '心血管', '心神类', '呼吸类' , '消化类', '肿瘤类', '其他']; let xdata = ['创伤类', '心血管', '心神类', '呼吸类', '消化类', '肿瘤类', '其他'];
let ydata = [120, 200, 150, 80, 70, 110, 130]; let ydata = [120, 200, 150, 80, 70, 110, 130];
initChart(xdata,ydata) initChart(xdata, ydata)
}) })
function initChart(xData,ydata){
function initChart(xData, ydata) {
let myChart = echarts.init(chiefChart.value) let myChart = echarts.init(chiefChart.value)
let options = { let options = {
grid:{ grid: {
top: '10%', top: '10%',
left:'8%', left: '8%',
right:'8%', right: '8%',
bottom: '20%' bottom: '20%'
}, },
xAxis: { xAxis: {
@@ -47,34 +56,34 @@ function initChart(xData,ydata){
data: xData, data: xData,
axisLabel: { axisLabel: {
color: '#FFFFFF', color: '#FFFFFF',
fontSize:14, fontSize: 14,
}, },
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
color: '#FFFFFF', color: '#FFFFFF',
fontSize:14, fontSize: 14,
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle:{ lineStyle: {
type:'dashed', type: 'dashed',
color:'rgba(217, 231, 255, 0.2)' color: 'rgba(217, 231, 255, 0.2)'
} }
} }
}, },
series: [ series: [
{ {
data:ydata , data: ydata,
type: 'bar', type: 'bar',
barWidth: '20%', barWidth: '20%',
itemStyle:{ itemStyle: {
color:new echarts.graphic.LinearGradient( color: new echarts.graphic.LinearGradient(
0, 0, 0, 1, 0, 0, 0, 1,
[ [
{ offset: 0, color: '#008CFF' }, {offset: 0, color: '#008CFF'},
{ offset: 1, color: '#33CBFE' } {offset: 1, color: '#33CBFE'}
] ]
) )
} }
@@ -86,21 +95,106 @@ function initChart(xData,ydata){
myChart.resize(); myChart.resize();
}); });
} }
function handleSelect(index) {
selectIndex.value = index
}
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.inner { .inner {
height: calc(100% - 40px); height: calc(100% - 40px);
.title{ .title {
width: 100%;
display: flex;
align-items: center;
justify-content: right;
padding: 2% 0;
.type-check {
color: #ffffff;
width: 15%;
display: flex; display: flex;
justify-content: right; justify-content: space-around;
.type-all{
color: #ffffff; span {
padding: 0 2%;
cursor: pointer;
font-size: 16px;
}
.select {
color: #45A2FF;
position: relative;
&:after {
content: '';
position: absolute;
display: block;
width: 100%;
left: 0;
bottom: -12px;
height: 6px;
background: url("../../assets/images/light.png") no-repeat;
background-size: 100% 100%;
}
}
.unSelect {
color: #A3A4A4;
} }
} }
.line-chart{
margin: 0 auto; .type-all {
width: 96%; width: 18%;
height: 80%; color: #ffffff;
.type-select {
width: 94%;
color: #008CFF;
}
} }
}
.line-chart {
margin: 0 auto;
width: 96%;
height: 80%;
}
}
</style>
<style lang="less">
.ant-select-dropdown{
background-color: #00152b!important;
border-right: 1px solid #1b7ef2;
border-left: 1px solid #1b7ef2;
border-bottom: 1px solid #1b7ef2;
}
.ant-select-item{
color: #1b7ef2!important;
}
//框背景色
.ant-select:not(.ant-select-customize-input) .ant-select-selector{
color: #1b7ef2!important;
background-color: transparent!important;
border: 1px solid #1b7ef2 !important;
}
.ant-select-item-option-selected{
color: #ffffff!important;
}
// 选中字体颜色
.ant-select-selection-item{
color: #1b7ef2!important;
}
.ant-select-item-option-active{
background-color:transparent!important;
}
.ant-select-item-option-active:hover{
background-color: #002e64!important;
}
// 箭头颜色
.ant-select-arrow {
color: #1b7ef2 !important;
}
.ant-select-item-option-selected:not(.ant-select-item-option-disabled){
background-color:#002e64!important;
} }
</style> </style>
+3 -1
View File
@@ -1,5 +1,6 @@
<template> <template>
<a-modal <a-modal
class="dialog"
v-model:visible="props.openVis" v-model:visible="props.openVis"
:title="props.title" :title="props.title"
:width="props.width" :width="props.width"
@@ -31,6 +32,7 @@
</script> </script>
<style lang="less"> <style lang="less">
.dialog{
.ant-modal-title{ .ant-modal-title{
position: relative; position: relative;
display: flex; display: flex;
@@ -61,5 +63,5 @@
.ant-modal-wrap{ .ant-modal-wrap{
background-color: rgba(0,0,0,0.6); background-color: rgba(0,0,0,0.6);
} }
}
</style> </style>