update 调整样式·
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<div class="common-card" :class="[themeType]">
|
||||
<public-title title="体检数据" />
|
||||
<public-title title="体检数据" :themeType="themeType" />
|
||||
<div class="inner">
|
||||
<div class="type-time">
|
||||
<span
|
||||
v-for="(item, index) in timeTab"
|
||||
:key="index"
|
||||
:class="selectIndex === item.value ? 'select' : 'unSelect'"
|
||||
@click="handleSelect(item.value)"
|
||||
:class="[selectIndex === index ? 'select' : 'unSelect', themeType]"
|
||||
@click="handleSelect(index, item.value)"
|
||||
>{{ item.name }}</span
|
||||
>
|
||||
</div>
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { onMounted, ref, unref, watch } from 'vue';
|
||||
import PublicTitle from '/@/components/publicTitle.vue';
|
||||
import { getDetail } from '/@/components/body-d-left/left.api';
|
||||
import { useSpin, timeTab, useHospitalList, radarCharts, allValueEmpty } from '/@/components/body-d-left/bodyLeftHooks';
|
||||
@@ -37,10 +37,11 @@
|
||||
const { setSession, getSession } = useSession();
|
||||
const { LEFT_KEY3 } = caching;
|
||||
const { setSpin, spinning } = useSpin();
|
||||
const selectIndex = ref('2');
|
||||
|
||||
function handleSelect(val: string) {
|
||||
selectIndex.value = val;
|
||||
const selectIndex = ref(0);
|
||||
const selectVal = ref('2'); //本年
|
||||
function handleSelect(index: number, value: string) {
|
||||
selectIndex.value = index;
|
||||
selectVal.value = value;
|
||||
setSpin(true);
|
||||
setTimeout(() => {
|
||||
setSpin(false);
|
||||
@@ -57,7 +58,7 @@
|
||||
async function getList() {
|
||||
setSpin(true);
|
||||
try {
|
||||
const { code, result } = (await getDetail({ dataType: props.setting.dataType, condition: selectIndex.value })) || {};
|
||||
const { code, result } = (await getDetail({ dataType: props.setting.dataType, condition: selectVal.value })) || {};
|
||||
setSpin(!spinning.value);
|
||||
if (code != 200) {
|
||||
return;
|
||||
@@ -83,7 +84,7 @@
|
||||
if (countList.length < 1) return;
|
||||
let max = Math.max(...countList);
|
||||
const indicator = radarList?.value.map((item) => ({ name: item?.hospitalName, max: max }));
|
||||
const option = radarCharts({ indicator, countList });
|
||||
const option = radarCharts({ indicator, countList, theme: unref(themeType) });
|
||||
myChart.setOption(option);
|
||||
window.addEventListener('resize', () => {
|
||||
myChart.resize();
|
||||
|
||||
Reference in New Issue
Block a user