This commit is contained in:
姚宇浩 2024-07-02 10:35:51 +08:00
parent eaca2116f7
commit e59a72cc31
4 changed files with 158 additions and 132 deletions

View File

@ -3,7 +3,14 @@
</template>
<script setup >
import { onMounted, reactive, ref,onBeforeMount,defineProps } from "vue";
import {
onMounted,
reactive,
ref,
onBeforeMount,
defineProps,
watch,
} from "vue";
// echarts
import * as echarts from "echarts";
@ -15,14 +22,14 @@ const props = defineProps({
year: {
type: Array,
default: () => [],
}
},
});
const data = reactive({
list: [],
year: [],
option: {},
bg: [],
})
});
const chart = ref(); // DOM
const getOption = () => {
@ -102,7 +109,7 @@ const getOption = () => {
label: {
show: true,
color: "#ffffff",
position:'top',
position: "top",
formatter: function (data) {
return data.value;
},
@ -120,7 +127,7 @@ const getOption = () => {
{
offset: 0,
// color: 'RGBA(184, 204, 241, 1)'
color: 'rgba(255, 234, 90, 0.50)',
color: "rgba(255, 234, 90, 0.50)",
},
{
offset: 1,
@ -136,27 +143,41 @@ const getOption = () => {
},
],
};
};
watch(
() => props.list,
(newValue, oldValue) => {
setTimeout(() => {
data.list = props.list;
data.year = props.year;
data.year.forEach(() => {
data.bg.push(0);
});
getOption();
setChart();
}, 600);
}
);
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value);
// 使
myChart.setOption(data.option);
}
};
onBeforeMount(() => {
setTimeout(() => {
data.list = props.list
data.year = props.year
data.list = props.list;
data.year = props.year;
data.year.forEach(() => {
data.bg.push(0)
})
getOption()
setChart()
}, 600)
data.bg.push(0);
});
getOption();
setChart();
}, 600);
});
</script>
<style scoped>

View File

@ -35,7 +35,7 @@
</span>
</div>
<ePie
v-if="leftchoose.first == '1'"
v-if="leftchoose.first == '1' && showEchart"
:list="data.medicalInsurance.ffrc"
:year="data.medicalInsurance.year"
></ePie>
@ -54,9 +54,9 @@
</div>
</div>
<div class="sm_title_1"></div>
<tnb :list="data.lmb.tnbrs" :year="data.lmb.year"></tnb>
<tnb :list="data.lmb.tnbrs" :year="data.lmb.year" v-if="showEchart"></tnb>
<div class="sm_title_2"></div>
<gxy :list="data.lmb.gxyrs" :year="data.lmb.year"></gxy>
<gxy :list="data.lmb.gxyrs" :year="data.lmb.year" v-if="showEchart"></gxy>
</div>
</div>
<div class="displayFlex center_bg">
@ -114,7 +114,7 @@
<div class="minTopPart2">
<div class="left">
<div class="leftImg">
<eP4 :list="data.jkda.jdl"></eP4>
<eP4 :list="data.jkda.jdl" v-if="showEchart"></eP4>
</div>
<div class="left_me">
<div>建档率</div>
@ -123,7 +123,7 @@
</div>
<div class="right">
<div class="rightImg">
<eP4_1 :list="data.jkda.jtysqyl"></eP4_1>
<eP4_1 :list="data.jkda.jtysqyl" v-if="showEchart"></eP4_1>
</div>
<div class="right_me">
<div>家庭医生签约率</div>
@ -141,7 +141,7 @@
</div>
</div>
<!-- <div style="width: 100%; "> -->
<eP5 :list="data.jsbgl"></eP5>
<eP5 :list="data.jsbgl" v-if="showEchart"></eP5>
<!-- </div> -->
</div>
</div>
@ -177,7 +177,7 @@
<i></i>
</div>
</div>
<eP7 :list="data.jktj.jktjrs" :year="data.jktj.year"></eP7>
<eP7 :list="data.jktj.jktjrs" :year="data.jktj.year" v-if="showEchart"></eP7>
</div>
<div class="flex1">
<div class="yd_title last">
@ -216,6 +216,7 @@ import tnb from "./echarts_hygiene/tnb.vue";
import gxy from "./echarts_hygiene/gxy.vue";
import { ref, reactive, onMounted, onBeforeMount } from "vue";
import http from "@/utils/request.js";
const showEchart=ref(true)
const leftchoose = ref({
first: "1",
second: "1",
@ -292,6 +293,7 @@ const getData = async () => {
data.fyglrs = res.data.fyglrs;
data.jktj = res.data.jktj;
data.jkhd = res.data.jkhd;
showEchart.value=true;
}
});
};

View File

@ -229,9 +229,9 @@
<img class="sexMove" src="../assets/images/sy/sexImg.png" alt="" />
</div>
</div>
<ePie2 style="margin-top: 20px" :list="data.ageRatio"></ePie2>
<ePie2 style="margin-top: 20px" :list="data.ageRatio" v-if="showEchart"></ePie2>
<div class="bt">
<ePie style="margin-bottom: 20px" :list="data.ageGroup"></ePie>
<ePie style="margin-bottom: 20px" :list="data.ageGroup" v-if="showEchart"></ePie>
<div
class="btList"
ref="mainRef"
@ -623,6 +623,8 @@ import qyfw1 from "../assets/images/sy/ljzcs.png";
import qyfw2 from "../assets/images/sy/rzbms.png";
import qyfw3 from "../assets/images/sy/shqys.png";
import qyfw4 from "../assets/images/sy/dxje.png";
//echart
const showEchart=ref(true)
//
const dialogShow = ref(false);
const dialogShowEc = ref(false);
@ -1270,6 +1272,7 @@ const getData = async () => {
data.jtsyList[4].key2_value =
res.data.transportation.highSpeedRail.passengerFlow;
}
showEchart.value=true;
});
};
//

View File

@ -36,7 +36,7 @@
</span>
</div>
<ePie
v-if="leftchoose.first == '1' && showR"
v-if="leftchoose.first == '1' && showEchart"
:list1="data.leftTop1"
:list2="data.leftTop2"
:year="data.leftTopYear"
@ -82,7 +82,7 @@
</span>
</div>
<eP2
v-if="leftchoose.second == '1' && showR"
v-if="leftchoose.second == '1' && showEchart"
:list1="data.leftCenter1"
:list2="data.leftCenter2"
:year="data.leftCenterYear"
@ -128,7 +128,7 @@
</span>
</div>
<eP3
v-if="leftchoose.third == '1' && showR"
v-if="leftchoose.third == '1' && showEchart"
:list1="data.leftbottom1"
:list2="data.leftbottom2"
:year="data.leftbottomYear"
@ -170,7 +170,7 @@
</div>
</div>
<div class="ageGroupone">
<ePie3d v-if="showR" :list="data.rkgk"></ePie3d>
<ePie3d v-if="showEchart" :list="data.rkgk"></ePie3d>
<div class="btList" ref="mainRef">
<div class="btListding">
<span>各年龄段</span>
@ -201,7 +201,7 @@
</div>
</div>
<ylJHSY
v-if="showR"
v-if="showEchart"
:list1="data.centerBottom1"
:list2="data.centerBottom2"
:year="data.centerBottomYear"
@ -265,7 +265,7 @@
<div class="serviceTop">
<div class="visit">
<img class="serviceimg" src="@/assets/YLimg/ylimg8.png" alt="" />
<ylSMFW v-if="showR" :list="data.smfwcs"></ylSMFW>
<ylSMFW v-if="showEchart" :list="data.smfwcs"></ylSMFW>
</div>
<div class="medicalService">
<img class="serviceimg" src="@/assets/YLimg/ylimg9.png" alt="" />
@ -287,7 +287,7 @@
/>
</div>
<ylXZZC
v-if="showR"
v-if="showEchart"
:list1="data.zccs1"
:list2="data.zccs2"
@village="chooseVillage"
@ -336,7 +336,7 @@ const leftchoose = ref({
second: "1",
third: "1",
});
const showR = ref(false);
const showEchart = ref(false);
//
const dialogShow = ref(false);
const tableType = reactive({
@ -662,7 +662,7 @@ const getData = () => {
data.zccs2.push(element.zccs); //
});
}
showR.value = true;
showEchart.value = true;
});
};
</script>