fix: update styles

This commit is contained in:
Qiuxia Fan 2022-01-06 10:51:26 +08:00
parent b40a5e600e
commit e234361853
3 changed files with 85 additions and 59 deletions

View File

@ -18,7 +18,7 @@ limitations under the License. -->
<grid-layout /> <grid-layout />
<el-dialog <el-dialog
v-model="dashboardStore.showConfig" v-model="dashboardStore.showConfig"
title="Edit" title="Edit Graph Options"
fullscreen fullscreen
@closed="dashboardStore.setConfigPanel(false)" @closed="dashboardStore.setConfigPanel(false)"
> >

View File

@ -14,16 +14,19 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="widget-config flex-v"> <div class="widget-config flex-v">
<div class="graph" style="height: 350px; width: 100%"> <div class="graph">
<div class="header">Title</div>
<div class="render-chart">
<component <component
:is="states.chartType" :is="states.chartType"
:intervalTime="appStoreWithOut.intervalTime" :intervalTime="appStoreWithOut.intervalTime"
:data="source" :data="source"
/> />
</div>
<span v-show="!source">{{ t("noData") }}</span> <span v-show="!source">{{ t("noData") }}</span>
</div> </div>
<div class="collapse" :style="{ height: configHeight + 'px' }">
<el-collapse <el-collapse
class="collapse"
v-model="states.activeNames" v-model="states.activeNames"
:style="{ '--el-collapse-header-font-size': '15px' }" :style="{ '--el-collapse-header-font-size': '15px' }"
> >
@ -71,6 +74,7 @@ limitations under the License. -->
<StandardOptions /> <StandardOptions />
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
</div>
<div class="footer"> <div class="footer">
<el-button size="mini"> <el-button size="mini">
{{ t("cancel") }} {{ t("cancel") }}
@ -168,6 +172,7 @@ export default defineComponent({
count: [1, 2, 5, 4, 5, 6, 7, 3, 4, 5, 2, 1, 6, 9], count: [1, 2, 5, 4, 5, 6, 7, 3, 4, 5, 2, 1, 6, 9],
avg: [3, 2, 4, 4, 5, 6, 5, 3, 4, 1, 2, 1, 6, 10], avg: [3, 2, 4, 4, 5, 6, 5, 3, 4, 1, 2, 1, 6, 10],
}; };
const configHeight = document.documentElement.clientHeight - 520;
return { return {
states, states,
changeChartType, changeChartType,
@ -178,6 +183,7 @@ export default defineComponent({
ChartTypes, ChartTypes,
source, source,
metricOpts, metricOpts,
configHeight,
}; };
}, },
}); });
@ -187,12 +193,27 @@ export default defineComponent({
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden;
} }
.graph { .graph {
position: relative;
min-width: 1280px; min-width: 1280px;
border: 1px solid #eee; border: 1px solid #eee;
padding: 10px; background-color: #fff;
}
.header {
padding: 3px 0;
text-align: center;
// border-bottom: 1px solid #eee;
background-color: aliceblue;
}
.render-chart {
padding: 5px;
height: 350px;
width: 100%;
} }
.selectors { .selectors {
@ -224,7 +245,8 @@ export default defineComponent({
} }
span.active { span.active {
background-color: #eee; background-color: #409eff;
color: #fff;
} }
.footer { .footer {
@ -239,6 +261,7 @@ span.active {
} }
.collapse { .collapse {
margin: 10px 0; margin-top: 10px;
overflow: auto;
} }
</style> </style>

View File

@ -87,6 +87,9 @@ function getOption() {
type: "dotted", type: "dotted",
}, },
showBackground: props.config.showBackground, showBackground: props.config.showBackground,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
markArea: markArea:
index === 0 index === 0
? { ? {