From 0f391ffc225ef339a6e62c666e8299f20f912218 Mon Sep 17 00:00:00 2001 From: zk Date: Sat, 15 Jun 2024 15:51:18 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=B0=83=E6=95=B4=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=C2=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/less/index.less | 43 +++++-- src/assets/theme/theme.css | 5 + src/assets/theme/themeList.ts | 7 ++ src/components/body-d-left/bodyLeftHooks.ts | 114 +++++++++++++++--- src/components/body-d-left/oneL.vue | 4 - src/components/body-d-left/threeL.vue | 21 ++-- src/components/body-d-left/twoL.vue | 54 +++------ src/components/body-d-right/bodyRightHooks.ts | 65 +++++++++- src/components/body-d-right/oneR.vue | 7 +- src/components/body-d-right/twoR.vue | 4 +- src/components/publicTitle.vue | 5 +- src/components/xianMap/xianMap.vue | 2 +- src/hooks/theme/useTheme.ts | 2 + 13 files changed, 243 insertions(+), 90 deletions(-) diff --git a/src/assets/less/index.less b/src/assets/less/index.less index d7b3aac..bf66493 100644 --- a/src/assets/less/index.less +++ b/src/assets/less/index.less @@ -3,7 +3,6 @@ @import "./public-title"; .type-time { - padding-right: 4%; padding-top: 3%; font-size: 16px; display: flex; @@ -34,6 +33,7 @@ .unSelect.dark { color: var(--typeTimeUnSelectColor); } + .select.light { color: #5876DB; background-color: #BDC9F5; @@ -44,7 +44,26 @@ } .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; + position: relative; + margin-left: 5px; + border: 1px solid #607DDB; + border-radius: 5px; + } + + .unSelect.light { + background-color: #d2d7f7; margin-left: 5px; color: #889BDB; border: 1px solid #BDC9F5; @@ -86,14 +105,14 @@ } // 下拉框样式-start -.ant-select.bg-000 { - color: #fff !important; - background-color: #000; +.ant-select { + color: var(--antSelectFontColor) !important; + background-color: var(--antSelectBg); } .ant-select-dropdown { background-color: var(--antSelectDropdownBg) !important; - border: 1px solid var(----antSelectDropdownBorderColor); + border: 1px solid var(--antSelectDropdownBorderColor); border-top: none; } @@ -115,7 +134,7 @@ // 选中字体颜色 .ant-select-selection-item { //color: #1b7ef2 !important; - color: #fff; + color: var(--antSelectFontColor); } .ant-select-item-option-active { @@ -123,7 +142,7 @@ } .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) { - background-color: #002e64 !important; + background-color: var(--antSelectItemActive) !important; } // 下拉框样式-end @@ -143,12 +162,12 @@ } .ant-cascader-menu-item:hover { - background-color: #002e64 !important; + background-color: var(--antSelectItemActive) !important; } .ant-cascader-menu-item-active { - color: #fff !important; - background-color: #002e64 !important; + color: var(--antSelectFontColor) !important; + background-color: var(--antSelectItemActive) !important; } .ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon, .ant-cascader-menu-item-loading-icon { @@ -157,7 +176,7 @@ // 级联选择器样式-end .ant-empty-description { - color: #fff; + color: var(--antSelectFontColor); } //空表格hover白色 diff --git a/src/assets/theme/theme.css b/src/assets/theme/theme.css index bb33895..c3e071e 100644 --- a/src/assets/theme/theme.css +++ b/src/assets/theme/theme.css @@ -2,6 +2,11 @@ --antSelectDropdownBg: #00152b; --antSelectDropdownBorderColor: #1b7ef2; + --antSelectItemActive: #002e64; + --antSelectFontColor: #fff; + --antSelectBg: #000; /*服务详情数据*/ + --typeTimeSelectColor: #45a2ff; + --typeTimeUnSelectColor: #a3a4a4; } \ No newline at end of file diff --git a/src/assets/theme/themeList.ts b/src/assets/theme/themeList.ts index 2aba713..f06c604 100644 --- a/src/assets/theme/themeList.ts +++ b/src/assets/theme/themeList.ts @@ -3,6 +3,9 @@ export const themeList = { /*下拉框*/ antSelectDropdownBg: '#00152b', antSelectDropdownBorderColor: '#1b7ef2', + antSelectItemActive: '#002e64', //选中或鼠标移过 + antSelectFontColor: '#fff', + antSelectBg: '#000', /*服务详情数据*/ typeTimeSelectColor: '#45a2ff', typeTimeUnSelectColor: '#a3a4a4', @@ -10,6 +13,10 @@ export const themeList = { light: { antSelectDropdownBg: '#fff', antSelectDropdownBorderColor: '#1b7ef2', + antSelectItemActive: '#ced7f6', + antSelectFontColor: '#5876DB', + antSelectBg: '#ced7f6', + /*服务详情数据*/ typeTimeSelectColor: '#45a2ff', typeTimeUnSelectColor: '#a3a4a4', }, diff --git a/src/components/body-d-left/bodyLeftHooks.ts b/src/components/body-d-left/bodyLeftHooks.ts index afd2a4b..b6b8cb3 100644 --- a/src/components/body-d-left/bodyLeftHooks.ts +++ b/src/components/body-d-left/bodyLeftHooks.ts @@ -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:体检医院雷达图 * @date 2023/6/27 * @param indicator:名称及最大值 * @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 { - // 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: { top: '1%', left: '5%', @@ -184,6 +220,7 @@ export const radarCharts = ({ indicator, countList }) => { color: '#fff', fontSize: 14, }, + ...radarName, }, shape: 'polygon', center: ['50%', '50%'], @@ -201,6 +238,7 @@ export const radarCharts = ({ indicator, countList }) => { lineStyle: { width: 1, color: '#597589', // 设置网格的颜色 + ...splitLine, }, }, indicator: indicator, @@ -213,6 +251,7 @@ export const radarCharts = ({ indicator, countList }) => { return `${params}\n${countList[dataIndex]}`; }, color: '#ffffff', + ...axisName, }, }, polar: { @@ -252,17 +291,20 @@ export const radarCharts = ({ indicator, countList }) => { itemStyle: { normal: { color: '#05D5FF', + ...itemStyle, }, }, areaStyle: { normal: { color: '#05D5FF', opacity: 0.5, + ...areaStyle, }, }, lineStyle: { width: 2, color: '#05D5FF', + ...lineStyle, }, label: { 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() { if (ydata.length) { return Math.max(...ydata) < 5 ? 5 : null; @@ -302,6 +380,7 @@ export function barOption(xData, ydata) { }, backgroundColor: 'rgba(50,50,50,0.7)', borderColor: '#1b7ef2', + ...tooltip, }, xAxis: { type: 'category', @@ -309,6 +388,7 @@ export function barOption(xData, ydata) { axisLabel: { color: '#FFFFFF', fontSize: 14, + ...xAxisLabel, }, axisLine: { color: '#bac9e1', @@ -319,11 +399,13 @@ export function barOption(xData, ydata) { nameTextStyle: { color: '#fff', padding: [0, 0, 0, -15], + ...xAxisLabel, }, type: 'value', axisLabel: { color: '#FFFFFF', fontSize: 14, + ...xAxisLabel, }, splitLine: { show: true, @@ -341,10 +423,7 @@ export function barOption(xData, ydata) { type: 'bar', barWidth: '20%', itemStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ - { offset: 0, color: '#008CFF' }, - { offset: 1, color: '#33CBFE' }, - ]), + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, itemStyle), }, barMaxWidth: '10', label: { @@ -352,6 +431,7 @@ export function barOption(xData, ydata) { position: 'top', color: '#33CBFE', fontWeight: 'normal', + ...xAxisLabel, }, }, ], diff --git a/src/components/body-d-left/oneL.vue b/src/components/body-d-left/oneL.vue index c256056..e494005 100644 --- a/src/components/body-d-left/oneL.vue +++ b/src/components/body-d-left/oneL.vue @@ -34,7 +34,6 @@ import { timeTab, useSpin, useStatistics } from '/@/components/body-d-left/bodyLeftHooks.ts'; import { useDetailStore } from '/@/store/modules/detailData.ts'; import { useSession, caching } from '/@/hooks/autoRefresh/caching.ts'; - import { setTheme } from '/@/assets/theme/themeList.ts'; import { useTheme } from '/@/hooks/theme/useTheme.ts'; const { themeType } = useTheme(); @@ -59,9 +58,6 @@ onMounted(() => { getList(); - if (props.theme) { - setTheme(props.theme); - } }); const useDetail = useDetailStore(); diff --git a/src/components/body-d-left/threeL.vue b/src/components/body-d-left/threeL.vue index 5fbe6fe..4c9424b 100644 --- a/src/components/body-d-left/threeL.vue +++ b/src/components/body-d-left/threeL.vue @@ -1,13 +1,13 @@