This commit is contained in:
duanxiaohai 2024-04-17 16:08:16 +08:00
commit 4c0e350c14
9 changed files with 259 additions and 153 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -3,11 +3,24 @@
</template>
<script setup>
import { onMounted, reactive, ref } from "vue";
import { onMounted, reactive, ref, onBeforeMount, defineProps, watch } from "vue";
// echarts
import * as echarts from "echarts";
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
});
const chart = ref(); // DOM
const data = reactive({
list: [],
option: {}
})
var colors = [
'#4EC2FF',
@ -16,31 +29,8 @@ var colors = [
'#268FFF',
'#FFE986'
]
var data = [
{
name: '正常',
value: 17
},
{
name: '关注',
value: 16
},
{
name: '追踪',
value: 14
},
{
name: '异常',
value: 8
},
{
name: '警戒',
value: 8
}
];
let option = {
const getOption = () => {
data.option = {
color: colors,
legend: {
orient: 'vertical',
@ -56,12 +46,11 @@ let option = {
},
formatter: function (name) {
var target;
for (var i = 0, l = data.length; i < l; i++) {
if (data[i].name == name) {
target = data[i].value;
for (var i = 0, l = data.list.length; i < l; i++) {
if (data.list[i].name == name) {
target = data.list[i].value;
}
}
return ` ${name} ${target} `;
},
},
@ -70,7 +59,6 @@ let option = {
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
series: [
/*内心原型图,展示整体数据概览*/
{
name: '测评分析',
@ -82,7 +70,7 @@ let option = {
label: {
show: false,
},
data: data
data: data.list
},
//
{
@ -107,23 +95,27 @@ let option = {
data: [100],
},
]
};
// 使
onMounted(() => {
// domecharts
// var myChart = echarts.init(document.getElementById('main'));
};
}
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value);
// init(); // vue3.2this
// 使
myChart.setOption(option);
myChart.setOption(data.option);
}
watch(() => props.list, (newVal, oldVal) => {
data.list = newVal
getOption()
setChart()
console.log('333', newVal, oldVal)
})
// 使
onMounted(() => {
data.list = props.list
getOption()
setChart()
// :
// window.addEventListener("resize", () => {
// myChart.resize();
// });
});
</script>

View File

@ -1,7 +1,7 @@
<template>
<div
ref="chart"
style="width: 100%; height: calc(100% - 76px); min-height: 205px"
style="width: 100%; height: calc(100% - 46px); min-height: 215px"
></div>
</template>
@ -27,7 +27,7 @@ let option = {
},
grid: {
top: "20%",
top: "10%",
left: "1%",
right: "10%",
bottom: "0%",
@ -41,7 +41,7 @@ let option = {
formatter: function (params) {
var str = ""; //
var paramsLen = params.length; //
var len = 4; //
var len = 5; //
var rowNumber = Math.ceil(paramsLen / len); //
if (paramsLen > len) {
//len
@ -67,7 +67,7 @@ let option = {
textStyle: {
color: "#ccc",
},
// rotate: 60,
rotate: 30,
},
data: data1,
},

View File

@ -11,7 +11,6 @@ const chart = ref(); // 创建DOM引用
const datas = {
value: 92.96,
text: "留 守 儿 童"
}
let option = {

View File

@ -1,7 +1,7 @@
<template>
<div
ref="chart"
style="width: 100%; height: calc(100% - 66px); min-height: 320px"
style="width: 100%; height: calc(100% - 60px); min-height: 320px"
></div>
</template>
@ -41,7 +41,7 @@ let option = {
formatter: function (params) {
var str = ""; //
var paramsLen = params.length; //
var len = 5; //
var len = 6; //
var rowNumber = Math.ceil(paramsLen / len); //
if (paramsLen > len) {
//len
@ -80,7 +80,7 @@ let option = {
splitLine: {
show: true,
lineStyle: {
color: "rgba(226, 226, 226, 0.3)",
color: "rgba(226, 226, 226, 0.2)",
width: 1,
},
},

View File

@ -1,5 +1,5 @@
<template>
<div ref="chart" style="width: 100%; height: calc(100% - 46px);min-height:155px;"></div>
<div ref="chart" style="width: 100%; height: calc(100% - 46px);min-height:165px;"></div>
</template>
<script setup >
@ -15,7 +15,7 @@ let option = {
formatter: "{b0}<br />{a0}:{c0} <br />{a1}:{c1} ",
},
legend: {
top: "8%",
top: "3%",
right: "11%",
textStyle: {
fontSize: 12,
@ -23,6 +23,7 @@ let option = {
},
},
grid: {
top:'23%',
left: "1%",
right: "10%",
bottom: "0%",

View File

@ -1,5 +1,5 @@
<template>
<div ref="chart" style="width: 100%; height: calc(100% - 46px);min-height:155px;"></div>
<div ref="chart" style="width: 100%; height: calc(100% - 46px);min-height:165px;"></div>
</template>
<script setup >
@ -17,7 +17,7 @@ let option = {
},
legend: {
data: ["职工医疗保险金额", "城乡医疗保险金额"],
top: "8%",
top: "3%",
right: "11%",
textStyle: {
fontSize: 12,
@ -25,6 +25,7 @@ let option = {
},
},
grid: {
top:'23%',
left: "1%",
right: "10%",
bottom: "3%",

View File

@ -21,32 +21,19 @@
<div class="yd_title left_2"></div>
<div class="selectLint">
<div class="selectBox">
<el-select
v-model="value"
placeholder="Select"
size="large"
class="selClass"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-select v-model="selectData.value1" placeholder="请选择" size="large" @change="selectChange1">
<el-option v-for="item in selectData.options1" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
<div class="selectBox">
<el-select v-model="value" placeholder="Select" size="large">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-select v-model="selectData.value2" placeholder="请选择" size="large" @change="selectChange1">
<el-option v-for="item in selectData.options2" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
</div>
<ePieRose></ePieRose>
<ePieRose :list="selectData.list"></ePieRose>
</div>
</div>
<div class="displayFlex center_bg">
@ -193,6 +180,7 @@
</template>
<script setup>
import { ref, reactive, onMounted, onBeforeMount } from 'vue'
import edCSR from "./echarts_education/edCSR.vue";
import edXX from "./echarts_education/edXX.vue";
import edie from "./echarts_education/pie.vue";
@ -201,31 +189,112 @@ import ePie2 from "./echarts_education/pie2.vue";
import ePie3 from "./echarts_education/pie3.vue";
import ePie4 from "./echarts_education/pie4.vue";
import ePieRose from "./echarts_education/pieRose.vue";
import { ref } from "vue";
const value = ref("");
const options = [
{
value: "Option1",
label: "Option1",
const selectData = reactive({
value1: '111',
value2: 'tes1',
options1: [{
value: '111',
label: '2023秋季检查',
},
{
value: "Option2",
label: "Option2",
value: '222',
label: '2024春季检查',
},],
options2: [{
value: 'tes1',
label: '中小学心理健康诊断测验(MHT',
},
{
value: "Option3",
label: "Option3",
value: 'tes2',
label: '小学心理健康诊断测验',
},
{
value: "Option4",
label: "Option4",
value: 'tes3',
label: '中学心理健康诊断',
},],
list: [],
})
var roseData1 = ref([
{
name: '正常',
value: 17
},
{
value: "Option5",
label: "Option5",
name: '关注',
value: 16
},
];
{
name: '追踪',
value: 14
},
{
name: '异常',
value: 8
},
{
name: '警戒',
value: 8
}
]);
var roseData2 = ref([
{
name: '正常',
value: 37
},
{
name: '关注',
value: 26
},
{
name: '追踪',
value: 24
},
{
name: '异常',
value: 18
},
{
name: '警戒',
value: 18
}
]);
var roseData3 = ref([
{
name: '正常',
value: 227
},
{
name: '关注',
value: 169
},
{
name: '追踪',
value: 114
},
{
name: '异常',
value: 98
},
{
name: '警戒',
value: 78
}
]);
const selectChange1 = () => {
if(selectData.value1 == '111'){
selectData.list = roseData1.value
}else if(selectData.value2 == 'tes1'){
selectData.list = roseData2.value
}else if(selectData.value2 == 'tes2'){
selectData.list = roseData3.value
}else{
selectData.list = roseData1.value
}
}
onBeforeMount(() => {
selectData.list = roseData1.value
});
</script>
<style lang="scss" scoped>
@ -264,6 +333,7 @@ const options = [
background-repeat: no-repeat;
background-size: 100% 100%;
}
.center_bg {
width: 582px;
box-sizing: border-box;
@ -272,6 +342,7 @@ const options = [
background-repeat: no-repeat;
background-size: 100% 100%;
}
.right_bg {
width: 642px;
box-sizing: border-box;
@ -582,6 +653,7 @@ const options = [
}
.czr-sl {
display: flex;
.historyimg {
width: 255px;
height: 56px;
@ -593,6 +665,7 @@ const options = [
justify-content: space-between;
padding-left: 70px;
span {
font-weight: 400;
font-size: 16px;
@ -605,20 +678,24 @@ const options = [
padding-right: 10px;
}
}
.historyimg1 {
background-image: url(@/assets/eduImg/jyImg14.png);
margin-right: 10px;
}
.historyimg2 {
background-image: url(@/assets/eduImg/jyImg15.png);
}
}
.earlyWarning {
height: calc(100% - 10px);
display: flex;
align-items: center;
justify-content: space-around;
.earlyWarning1 {
font-size: 26px;
color: #ffffff;
@ -630,10 +707,12 @@ const options = [
display: flex;
flex-direction: column;
align-items: center;
img {
width: 136px;
height: 100px;
}
.green {
font-size: 26px;
font-weight: bold;
@ -646,6 +725,7 @@ const options = [
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.yellow {
font-size: 26px;
font-weight: bold;
@ -658,6 +738,7 @@ const options = [
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.red {
font-size: 26px;
font-weight: bold;
@ -680,6 +761,7 @@ const options = [
display: flex;
align-items: center;
justify-content: center;
span {
font-weight: 500;
font-size: 14px;
@ -689,17 +771,21 @@ const options = [
font-family: PingFangSC, PingFang SC;
}
}
.historyimg1 {
background-image: url(@/assets/eduImg/jyImg4.png);
}
.historyimg2 {
background-image: url(@/assets/eduImg/jyImg6.png);
}
.historyimg3 {
background-image: url(@/assets/eduImg/jyImg5.png);
}
}
}
.czr-bj {
width: 529px;
height: calc(100% - 26px);
@ -719,18 +805,22 @@ const options = [
padding-left: 18px;
}
}
.situation {
width: 495px;
height: 26px;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.situation1 {
background-image: url(@/assets/eduImg/jyImg11.png);
}
.situation2 {
background-image: url(@/assets/eduImg/jyImg12.png);
}
.situation3 {
background-image: url(@/assets/eduImg/jyImg13.png);
}
@ -880,7 +970,7 @@ const options = [
font-style: normal;
}
}
}
};
.selectLint {
width: 94%;

View File

@ -45,7 +45,7 @@
<div class="yd_title center_1"></div>
<div class="minTopPart">
<div class="mtpImg1"></div>
<div class="mtpImg2"></div>
<div class="mtpImg2">建档份数</div>
<div class="mtpText2">33.67</div>
</div>
<div class="minTopPart2">
@ -83,7 +83,7 @@
<div class="yd_title service"></div>
<eP7></eP7>
</div>
<div >
<div class="flex1" style="height:100vh;">
<div class="yd_title last"></div>
<div class="table">
<div class="item" >3月2日健康日在龙中公园进行健康活动宣</div>
@ -581,13 +581,17 @@ const change = (name, index) => {
}
.mtpImg2 {
width: 140px;
height: 24px;
background-image: url(@/assets/minTop2.png);
height: 50px;
background-image: url(@/assets/images/hygiene/jd.png);
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
top: 59px;
right: 50px;
text-align: center;
color: #ffffff;
letter-spacing: 5px;
font-size: 20px;
}
.mtpText2 {
width: 140px;
@ -650,11 +654,12 @@ const change = (name, index) => {
}
}
.table {
margin-top: 10px;
width: 95%;
height: 200px;
height: calc(100% - 75px);
min-height: 200px;
height: calc(100% - 115px);
// background: red;
overflow-y: auto;
overflow-y: scroll;
.item {
margin-top: 10px;
padding: 16px 20px;
@ -664,4 +669,22 @@ const change = (name, index) => {
color: #ffffff;
}
}
/* 滚动条整体部分 */
.table::-webkit-scrollbar {
width: 5px;
// height: 10px;
}
/* 滚动槽 */
.table::-webkit-scrollbar-track {
border-radius: 1px;
background: rgba(41, 157, 255, 0.56);
-webkit-box-shadow: inset 0 0 6px rgba(139, 139, 139, 0.3);
}
/* 滚动条滑块样式 */
.table::-webkit-scrollbar-thumb {
background-clip: content-box;
border-radius: 6px;
background: rgba(41, 157, 255, 1);
-webkit-box-shadow: inset 0 0 6px rgba(20, 20, 20, 0.3);
}
</style>