update 调整样式·

This commit is contained in:
zk
2024-06-15 15:51:18 +08:00
parent e16b9e054e
commit 0f391ffc22
13 changed files with 243 additions and 90 deletions
+31 -12
View File
@@ -3,7 +3,6 @@
@import "./public-title"; @import "./public-title";
.type-time { .type-time {
padding-right: 4%;
padding-top: 3%; padding-top: 3%;
font-size: 16px; font-size: 16px;
display: flex; display: flex;
@@ -34,6 +33,7 @@
.unSelect.dark { .unSelect.dark {
color: var(--typeTimeUnSelectColor); color: var(--typeTimeUnSelectColor);
} }
.select.light { .select.light {
color: #5876DB; color: #5876DB;
background-color: #BDC9F5; background-color: #BDC9F5;
@@ -44,7 +44,26 @@
} }
.unSelect.light { .unSelect.light {
background-color: #d2d7f7;
margin-left: 5px;
color: #889BDB;
border: 1px solid #BDC9F5;
border-radius: 5px;
}
}
.type-check {
.select.light {
color: #5876DB;
background-color: #BDC9F5; background-color: #BDC9F5;
position: relative;
margin-left: 5px;
border: 1px solid #607DDB;
border-radius: 5px;
}
.unSelect.light {
background-color: #d2d7f7;
margin-left: 5px; margin-left: 5px;
color: #889BDB; color: #889BDB;
border: 1px solid #BDC9F5; border: 1px solid #BDC9F5;
@@ -86,14 +105,14 @@
} }
// 下拉框样式-start // 下拉框样式-start
.ant-select.bg-000 { .ant-select {
color: #fff !important; color: var(--antSelectFontColor) !important;
background-color: #000; background-color: var(--antSelectBg);
} }
.ant-select-dropdown { .ant-select-dropdown {
background-color: var(--antSelectDropdownBg) !important; background-color: var(--antSelectDropdownBg) !important;
border: 1px solid var(----antSelectDropdownBorderColor); border: 1px solid var(--antSelectDropdownBorderColor);
border-top: none; border-top: none;
} }
@@ -115,7 +134,7 @@
// 选中字体颜色 // 选中字体颜色
.ant-select-selection-item { .ant-select-selection-item {
//color: #1b7ef2 !important; //color: #1b7ef2 !important;
color: #fff; color: var(--antSelectFontColor);
} }
.ant-select-item-option-active { .ant-select-item-option-active {
@@ -123,7 +142,7 @@
} }
.ant-select-item-option-active:hover { .ant-select-item-option-active:hover {
background-color: #002e64 !important; background-color: var(--antSelectItemActive) !important;
} }
// 箭头颜色 // 箭头颜色
@@ -132,7 +151,7 @@
} }
.ant-select-item-option-selected:not(.ant-select-item-option-disabled) { .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
background-color: #002e64 !important; background-color: var(--antSelectItemActive) !important;
} }
// 下拉框样式-end // 下拉框样式-end
@@ -143,12 +162,12 @@
} }
.ant-cascader-menu-item:hover { .ant-cascader-menu-item:hover {
background-color: #002e64 !important; background-color: var(--antSelectItemActive) !important;
} }
.ant-cascader-menu-item-active { .ant-cascader-menu-item-active {
color: #fff !important; color: var(--antSelectFontColor) !important;
background-color: #002e64 !important; background-color: var(--antSelectItemActive) !important;
} }
.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon, .ant-cascader-menu-item-loading-icon { .ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon, .ant-cascader-menu-item-loading-icon {
@@ -157,7 +176,7 @@
// 级联选择器样式-end // 级联选择器样式-end
.ant-empty-description { .ant-empty-description {
color: #fff; color: var(--antSelectFontColor);
} }
//空表格hover白色 //空表格hover白色
+5
View File
@@ -2,6 +2,11 @@
--antSelectDropdownBg: #00152b; --antSelectDropdownBg: #00152b;
--antSelectDropdownBorderColor: #1b7ef2; --antSelectDropdownBorderColor: #1b7ef2;
--antSelectItemActive: #002e64;
--antSelectFontColor: #fff;
--antSelectBg: #000;
/*服务详情数据*/ /*服务详情数据*/
--typeTimeSelectColor: #45a2ff;
--typeTimeUnSelectColor: #a3a4a4;
} }
+7
View File
@@ -3,6 +3,9 @@ export const themeList = {
/*下拉框*/ /*下拉框*/
antSelectDropdownBg: '#00152b', antSelectDropdownBg: '#00152b',
antSelectDropdownBorderColor: '#1b7ef2', antSelectDropdownBorderColor: '#1b7ef2',
antSelectItemActive: '#002e64', //选中或鼠标移过
antSelectFontColor: '#fff',
antSelectBg: '#000',
/*服务详情数据*/ /*服务详情数据*/
typeTimeSelectColor: '#45a2ff', typeTimeSelectColor: '#45a2ff',
typeTimeUnSelectColor: '#a3a4a4', typeTimeUnSelectColor: '#a3a4a4',
@@ -10,6 +13,10 @@ export const themeList = {
light: { light: {
antSelectDropdownBg: '#fff', antSelectDropdownBg: '#fff',
antSelectDropdownBorderColor: '#1b7ef2', antSelectDropdownBorderColor: '#1b7ef2',
antSelectItemActive: '#ced7f6',
antSelectFontColor: '#5876DB',
antSelectBg: '#ced7f6',
/*服务详情数据*/
typeTimeSelectColor: '#45a2ff', typeTimeSelectColor: '#45a2ff',
typeTimeUnSelectColor: '#a3a4a4', typeTimeUnSelectColor: '#a3a4a4',
}, },
+97 -17
View File
@@ -152,25 +152,61 @@ export function useHospitalList() {
}; };
} }
const radarChartsTheme = {
dark: {
radarName: {
textStyle: {
color: '#fff',
},
},
splitLine: {
color: '#597589',
},
axisName: {
color: '#ffffff',
},
areaStyle: {
color: '#05D5FF',
},
lineStyle: {
color: '#05D5FF',
},
itemStyle: {
color: '#05D5FF',
},
},
light: {
radarName: {
textStyle: {
color: '#607DDB',
},
},
splitLine: {
color: '#b5c2ef',
},
axisName: {
color: '#607DDB',
},
areaStyle: {
color: '#a0b6fd',
},
lineStyle: {
color: '#607DDB',
},
itemStyle: {
color: '#607DDB',
},
},
};
/** /**
* @Description:体检医院雷达图 * @Description:体检医院雷达图
* @date 2023/6/27 * @date 2023/6/27
* @param indicator:名称及最大值 * @param indicator:名称及最大值
* @param countList:数据项 * @param countList:数据项
*/ */
export const radarCharts = ({ indicator, countList }) => { export const radarCharts = ({ indicator, countList, theme }) => {
const { radarName, splitLine, axisName, areaStyle, lineStyle, itemStyle } = radarChartsTheme[theme] || radarChartsTheme.dark;
return { return {
// tooltip: {
// backgroundColor: 'rgba(50,50,50,0.7)',
// borderColor: 'rgba(50,50,50,0.7)',
// textStyle: {
// color: '#fff',
// },
// //雷达图的tooltip不会超出div,也可以设置position属性,position定位的tooltip 不会随着鼠标移动而位置变化,不友好
// confine: true,
// enterable: true, //鼠标是否可以移动到tooltip区域内
// valueFormatter: (params) => {},
// },
grid: { grid: {
top: '1%', top: '1%',
left: '5%', left: '5%',
@@ -184,6 +220,7 @@ export const radarCharts = ({ indicator, countList }) => {
color: '#fff', color: '#fff',
fontSize: 14, fontSize: 14,
}, },
...radarName,
}, },
shape: 'polygon', shape: 'polygon',
center: ['50%', '50%'], center: ['50%', '50%'],
@@ -201,6 +238,7 @@ export const radarCharts = ({ indicator, countList }) => {
lineStyle: { lineStyle: {
width: 1, width: 1,
color: '#597589', // 设置网格的颜色 color: '#597589', // 设置网格的颜色
...splitLine,
}, },
}, },
indicator: indicator, indicator: indicator,
@@ -213,6 +251,7 @@ export const radarCharts = ({ indicator, countList }) => {
return `${params}\n${countList[dataIndex]}`; return `${params}\n${countList[dataIndex]}`;
}, },
color: '#ffffff', color: '#ffffff',
...axisName,
}, },
}, },
polar: { polar: {
@@ -252,17 +291,20 @@ export const radarCharts = ({ indicator, countList }) => {
itemStyle: { itemStyle: {
normal: { normal: {
color: '#05D5FF', color: '#05D5FF',
...itemStyle,
}, },
}, },
areaStyle: { areaStyle: {
normal: { normal: {
color: '#05D5FF', color: '#05D5FF',
opacity: 0.5, opacity: 0.5,
...areaStyle,
}, },
}, },
lineStyle: { lineStyle: {
width: 2, width: 2,
color: '#05D5FF', color: '#05D5FF',
...lineStyle,
}, },
label: { label: {
normal: { normal: {
@@ -278,8 +320,44 @@ export const radarCharts = ({ indicator, countList }) => {
], ],
}; };
}; };
const barTheme = {
dark: {
tooltip: {
textStyle: {
color: '#fff',
},
backgroundColor: 'rgba(50,50,50,0.7)',
borderColor: '#1b7ef2',
},
xAxisLabel: {
color: '#FFFFFF',
},
itemStyle: [
{ offset: 0, color: '#008CFF' },
{ offset: 1, color: '#33CBFE' },
],
},
light: {
tooltip: {
textStyle: {
color: '#768ddb',
},
backgroundColor: '#d5dcf8',
borderColor: '#1b7ef2',
},
xAxisLabel: {
color: '#607DDB',
},
itemStyle: [
{ offset: 0, color: '#607DDB' },
{ offset: 1, color: '#768ddb' },
],
},
};
export function barOption(xData, ydata, theme) {
const { tooltip, xAxisLabel, itemStyle } = barTheme[theme] || barTheme.dark;
export function barOption(xData, ydata) {
function maxCount() { function maxCount() {
if (ydata.length) { if (ydata.length) {
return Math.max(...ydata) < 5 ? 5 : null; return Math.max(...ydata) < 5 ? 5 : null;
@@ -302,6 +380,7 @@ export function barOption(xData, ydata) {
}, },
backgroundColor: 'rgba(50,50,50,0.7)', backgroundColor: 'rgba(50,50,50,0.7)',
borderColor: '#1b7ef2', borderColor: '#1b7ef2',
...tooltip,
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
@@ -309,6 +388,7 @@ export function barOption(xData, ydata) {
axisLabel: { axisLabel: {
color: '#FFFFFF', color: '#FFFFFF',
fontSize: 14, fontSize: 14,
...xAxisLabel,
}, },
axisLine: { axisLine: {
color: '#bac9e1', color: '#bac9e1',
@@ -319,11 +399,13 @@ export function barOption(xData, ydata) {
nameTextStyle: { nameTextStyle: {
color: '#fff', color: '#fff',
padding: [0, 0, 0, -15], padding: [0, 0, 0, -15],
...xAxisLabel,
}, },
type: 'value', type: 'value',
axisLabel: { axisLabel: {
color: '#FFFFFF', color: '#FFFFFF',
fontSize: 14, fontSize: 14,
...xAxisLabel,
}, },
splitLine: { splitLine: {
show: true, show: true,
@@ -341,10 +423,7 @@ export function barOption(xData, ydata) {
type: 'bar', type: 'bar',
barWidth: '20%', barWidth: '20%',
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, itemStyle),
{ offset: 0, color: '#008CFF' },
{ offset: 1, color: '#33CBFE' },
]),
}, },
barMaxWidth: '10', barMaxWidth: '10',
label: { label: {
@@ -352,6 +431,7 @@ export function barOption(xData, ydata) {
position: 'top', position: 'top',
color: '#33CBFE', color: '#33CBFE',
fontWeight: 'normal', fontWeight: 'normal',
...xAxisLabel,
}, },
}, },
], ],
-4
View File
@@ -34,7 +34,6 @@
import { timeTab, useSpin, useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts'; import { timeTab, useSpin, useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts';
import { useDetailStore } from '/@/store/modules/detailData.ts'; import { useDetailStore } from '/@/store/modules/detailData.ts';
import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts'; import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts';
import { setTheme } from '/@/assets/theme/themeList.ts';
import { useTheme } from '/@/hooks/theme/useTheme.ts'; import { useTheme } from '/@/hooks/theme/useTheme.ts';
const { themeType } = useTheme(); const { themeType } = useTheme();
@@ -59,9 +58,6 @@
onMounted(() => { onMounted(() => {
getList(); getList();
if (props.theme) {
setTheme(props.theme);
}
}); });
const useDetail = useDetailStore(); const useDetail = useDetailStore();
+11 -10
View File
@@ -1,13 +1,13 @@
<template> <template>
<div class="common-card" :class="[themeType]"> <div class="common-card" :class="[themeType]">
<public-title title="体检数据" /> <public-title title="体检数据" :themeType="themeType" />
<div class="inner"> <div class="inner">
<div class="type-time"> <div class="type-time">
<span <span
v-for="(item, index) in timeTab" v-for="(item, index) in timeTab"
:key="index" :key="index"
:class="selectIndex === item.value ? 'select' : 'unSelect'" :class="[selectIndex === index ? 'select' : 'unSelect', themeType]"
@click="handleSelect(item.value)" @click="handleSelect(index, item.value)"
>{{ item.name }}</span >{{ item.name }}</span
> >
</div> </div>
@@ -19,7 +19,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref, watch } from 'vue'; import { onMounted, ref, unref, watch } from 'vue';
import PublicTitle from '/@/components/publicTitle.vue'; import PublicTitle from '/@/components/publicTitle.vue';
import { getDetail } from '/@/components/body-d-left/left.api'; import { getDetail } from '/@/components/body-d-left/left.api';
import { useSpin, timeTab, useHospitalList, radarCharts, allValueEmpty } from '/@/components/body-d-left/bodyLeftHooks'; import { useSpin, timeTab, useHospitalList, radarCharts, allValueEmpty } from '/@/components/body-d-left/bodyLeftHooks';
@@ -37,10 +37,11 @@
const { setSession, getSession } = useSession(); const { setSession, getSession } = useSession();
const { LEFT_KEY3 } = caching; const { LEFT_KEY3 } = caching;
const { setSpin, spinning } = useSpin(); const { setSpin, spinning } = useSpin();
const selectIndex = ref('2'); const selectIndex = ref(0);
const selectVal = ref('2'); //本年
function handleSelect(val: string) { function handleSelect(index: number, value: string) {
selectIndex.value = val; selectIndex.value = index;
selectVal.value = value;
setSpin(true); setSpin(true);
setTimeout(() => { setTimeout(() => {
setSpin(false); setSpin(false);
@@ -57,7 +58,7 @@
async function getList() { async function getList() {
setSpin(true); setSpin(true);
try { 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); setSpin(!spinning.value);
if (code != 200) { if (code != 200) {
return; return;
@@ -83,7 +84,7 @@
if (countList.length < 1) return; if (countList.length < 1) return;
let max = Math.max(...countList); let max = Math.max(...countList);
const indicator = radarList?.value.map((item) => ({ name: item?.hospitalName, max: max })); 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); myChart.setOption(option);
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
myChart.resize(); myChart.resize();
+17 -37
View File
@@ -1,22 +1,22 @@
<template> <template>
<div class="common-card" :class="[themeType]"> <div class="common-card" :class="[themeType]">
<public-title title="主诉分类" /> <public-title title="主诉分类" :themeType="themeType" />
<div class="zc-inner"> <div class="zc-inner">
<div class="title"> <div class="title">
<div class="type-check">
<span
:class="sexIndex === index ? 'select' : 'unSelect'"
v-for="(item, index) in sexType"
:key="index"
@click="handleSelect(index)"
>{{ item.name }}</span
>
</div>
<div class="type-all"> <div class="type-all">
<a-select v-model:value="selectValue" class="type-select" :options="selectOptions"> <a-select v-model:value="selectValue" class="type-select" :options="selectOptions">
<a-select-option value="全部数据">全部数据</a-select-option> <a-select-option value="全部数据">全部数据</a-select-option>
</a-select> </a-select>
</div> </div>
<div class="type-check">
<span
:class="[sexIndex === index ? 'select' : 'unSelect', themeType]"
v-for="(item, index) in sexType"
:key="index"
@click="handleSelect(index, item.value)"
>{{ item.name }}</span
>
</div>
</div> </div>
<div class="line-chart" ref="chiefChart"></div> <div class="line-chart" ref="chiefChart"></div>
<a-spin :spinning="spinning" class="spin"></a-spin> <a-spin :spinning="spinning" class="spin"></a-spin>
@@ -43,13 +43,15 @@
const { setSpin, spinning } = useSpin(); const { setSpin, spinning } = useSpin();
const sexIndex = ref(0); const sexIndex = ref(0);
const sexVal = ref('');
const chiefChart = ref<HTMLElement>(); const chiefChart = ref<HTMLElement>();
const selectOptions = ref([{ label: '全部数据', value: 'all' }]); const selectOptions = ref([{ label: '全部数据', value: 'all' }]);
const selectValue = ref('all'); const selectValue = ref('all');
function handleSelect(index: number) { function handleSelect(index: number, val: string) {
sexIndex.value = index; sexIndex.value = index;
sexVal.value = val;
} }
onMounted(() => { onMounted(() => {
@@ -73,7 +75,7 @@
setSpin(true); setSpin(true);
try { try {
const searchParams = { const searchParams = {
sex: sexType[sexIndex.value].value, sex: sexVal.value,
depart: selectValue.value == 'all' ? '' : selectValue.value, depart: selectValue.value == 'all' ? '' : selectValue.value,
}; };
const { code, result } = (await complaint(searchParams)) || {}; const { code, result } = (await complaint(searchParams)) || {};
@@ -106,7 +108,7 @@
function initChart(xData, ydata) { function initChart(xData, ydata) {
let myChart = echarts.init(chiefChart.value); let myChart = echarts.init(chiefChart.value);
let options = barOption(xData, ydata); let options = barOption(xData, ydata, themeType.value);
myChart.setOption(options); myChart.setOption(options);
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
myChart.resize(); myChart.resize();
@@ -129,41 +131,19 @@
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: right; justify-content: space-between;
padding: 2% 0; padding: 2% 0;
.type-check { .type-check {
color: #ffffff; color: #ffffff;
width: 15%;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
span { span {
padding: 0 2%; width: 50px;
cursor: pointer; cursor: pointer;
font-size: 16px; 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;
}
} }
.type-all { .type-all {
+62 -3
View File
@@ -95,7 +95,62 @@ export function useHealth() {
}; };
} }
export function ringOption(chartData, total) { const ringTheme = {
dark: {
color: ['#0098FA', '#0CD9B5', '#3B72AD'],
textStyle: {
color: '#ffffff',
},
subtextStyle: {
color: '#ffffff',
},
backgroundColor: 'rgba(50,50,50,0.7)',
borderColor: '#1b7ef2',
tooltip: {
textStyle: {
color: '#fff',
},
backgroundColor: 'rgba(50,50,50,0.7)',
borderColor: '#1b7ef2',
},
legend: {
textStyle: {
color: '#ffffff',
},
},
seriesLabel: {
color: '#ffffff',
},
},
light: {
color: ['#0098FA', '#0CD9B5', '#6077fc'],
textStyle: {
color: '#5169B8',
},
subtextStyle: {
color: '#607DDB',
},
backgroundColor: 'rgba(50,50,50,0.7)',
tooltip: {
textStyle: {
color: '#fff',
},
backgroundColor: '#607DDB',
borderColor: '#1b7ef2',
},
legend: {
textStyle: {
color: '#1b7ef2',
},
},
seriesLabel: {
color: '#27386E',
},
},
};
export function ringOption(chartData, total, theme) {
const { textStyle, subtextStyle, tooltip, legend, seriesLabel, color } = ringTheme[theme] || ringTheme.dark;
const data = visibleChartLabel(chartData); const data = visibleChartLabel(chartData);
return { return {
title: { title: {
@@ -107,14 +162,16 @@ export function ringOption(chartData, total) {
fontSize: 14, fontSize: 14,
color: '#ffffff', color: '#ffffff',
fontWeight: 'normal', fontWeight: 'normal',
...textStyle,
}, },
subtextStyle: { subtextStyle: {
color: '#ffffff', color: '#ffffff',
fontSize: 24, fontSize: 24,
fontWeight: 'bold', fontWeight: 'bold',
...subtextStyle,
}, },
}, },
color: ['#0098FA', '#0CD9B5', '#3B72AD'], color: color || ['#0098FA', '#0CD9B5', '#3B72AD'],
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
show: true, show: true,
@@ -123,6 +180,7 @@ export function ringOption(chartData, total) {
}, },
backgroundColor: 'rgba(50,50,50,0.7)', backgroundColor: 'rgba(50,50,50,0.7)',
borderColor: '#1b7ef2', borderColor: '#1b7ef2',
...tooltip,
}, },
legend: { legend: {
bottom: '0', bottom: '0',
@@ -133,6 +191,7 @@ export function ringOption(chartData, total) {
fontSize: 16, fontSize: 16,
}, },
selectedMode: false, selectedMode: false,
...legend,
}, },
series: [ series: [
{ {
@@ -146,6 +205,7 @@ export function ringOption(chartData, total) {
formatter: '{d}%', formatter: '{d}%',
color: '#ffffff', color: '#ffffff',
fontSize: 14, fontSize: 14,
...seriesLabel,
}, },
labelLine: { labelLine: {
show: false, show: false,
@@ -155,4 +215,3 @@ export function ringOption(chartData, total) {
], ],
}; };
} }
+6 -1
View File
@@ -2,7 +2,7 @@
<div class="terminal-container common-card" :class="[themeType]"> <div class="terminal-container common-card" :class="[themeType]">
<public-title title="健康终端报警" :themeType="themeType"> <public-title title="健康终端报警" :themeType="themeType">
<template #right> <template #right>
<span class="right-text" @click="viewDetail">查看详情</span> <span class="right-text" :class="[themeType]" @click="viewDetail">查看详情</span>
</template> </template>
</public-title> </public-title>
<div class="inner"> <div class="inner">
@@ -145,6 +145,11 @@
font-weight: 100; font-weight: 100;
cursor: pointer; cursor: pointer;
margin-right: 3px; margin-right: 3px;
font-size: 18px;
}
.right-text.light {
color: #667ecc;
} }
.right-text:hover { .right-text:hover {
+2 -2
View File
@@ -1,6 +1,6 @@
<template> <template>
<div class="common-card" :class="themeType"> <div class="common-card" :class="themeType">
<public-title title="长庆油田大病人数" /> <public-title title="长庆油田大病人数" :themeType="themeType" />
<div class="inner" ref="healthChart"></div> <div class="inner" ref="healthChart"></div>
</div> </div>
</template> </template>
@@ -51,7 +51,7 @@
function initChart(chartData, total) { function initChart(chartData, total) {
let myChart = echarts.init(healthChart.value); let myChart = echarts.init(healthChart.value);
let options = ringOption(chartData, total); let options = ringOption(chartData, total, unref(themeType));
myChart.setOption(options); myChart.setOption(options);
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
myChart.resize(); myChart.resize();
+2 -3
View File
@@ -1,9 +1,9 @@
<template> <template>
<div class="title-d public-title" :class="props.themeType"> <div class="title-d public-title" :class="props.themeType">
<span>{{ props.title }}</span> <span>{{ props.title }}</span>
<div v-if="props.themeType !== 'light'"> <div>
<span class="tips"><slot name="right"></slot></span> <span class="tips"><slot name="right"></slot></span>
<img src="../assets/img/point.png" alt="" /> <img v-if="props.themeType !== 'light'" src="../assets/img/point.png" alt="" />
</div> </div>
</div> </div>
</template> </template>
@@ -34,7 +34,6 @@
text-align: left; text-align: left;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
display: flex; display: flex;
+1 -1
View File
@@ -133,7 +133,7 @@
end: '', end: '',
}); });
const list = ref(tabList); const list = ref(tabList);
const currentIndex = ref(6); const currentIndex = ref(0);
function changeTab(item, i: number) { function changeTab(item, i: number) {
currentIndex.value = i; // 地方医院 currentIndex.value = i; // 地方医院
+2
View File
@@ -1,5 +1,6 @@
import { nextTick, onMounted, ref } from 'vue'; import { nextTick, onMounted, ref } from 'vue';
import { useUserStore } from '/@/store/modules/user.ts'; import { useUserStore } from '/@/store/modules/user.ts';
import { setTheme } from '/@/assets/theme/themeList.ts';
export function useTheme() { export function useTheme() {
const themeType = ref('light'); const themeType = ref('light');
@@ -7,6 +8,7 @@ export function useTheme() {
const store = useUserStore(); const store = useUserStore();
nextTick(() => { nextTick(() => {
themeType.value = store.getThemeType; themeType.value = store.getThemeType;
setTheme(themeType.value);
}); });
}); });
return { return {