Commit 01ed96ad authored by wends's avatar wends

update 仪表盘

parent a387c6b8
<template> <template>
<el-card class="container"> <el-card class="container">
<el-tabs <el-row :gutter="20" class="content">
v-model="activeModel" <el-col :xs="8" :sm="8" :md="6" :lg="4">
tab-position="left" <div class="left">
@tab-click="onTabClick" <div class="search">
<el-select v-model="eModel" style="width: 100%">
<el-option
v-for="item in eModelList"
:key="item.value"
:label="item.label"
:value="item.value"
> >
<el-tab-pane </el-option>
v-for="(model, index) in modelList" </el-select>
:key="index" </div>
:label="model.name" <div class="custom-menu">
:name="model.id.toString()" <el-menu
ref="customMenu"
default-active="1"
> >
<div v-if="activeModel === model.id.toString()"> <el-menu-item
v-for="(model, index) in eInstanceList"
:key="'model' + index"
:index="model.id.toString()"
>{{ model.name }}</el-menu-item>
</el-menu>
</div>
</div>
</el-col>
<el-col :xs="16" :sm="16" :md="18" :lg="20">
<el-form <el-form
:ref="'form'+activeModel" :ref="'form'+activeModel"
:model="chartField" :model="chartField"
...@@ -79,9 +96,8 @@ ...@@ -79,9 +96,8 @@
></e-line> ></e-line>
</el-col> </el-col>
</el-row> </el-row>
</div> </el-col>
</el-tab-pane> </el-row>
</el-tabs>
</el-card> </el-card>
</template> </template>
...@@ -108,6 +124,35 @@ export default { ...@@ -108,6 +124,35 @@ export default {
count: 0, count: 0,
instanceList: [], instanceList: [],
propertyList: [], propertyList: [],
eModel: 1,
eModelList: [
{
value: 1,
label: '设备模型一'
},
{
value: 2,
label: '设备模型二'
}
],
eInstanceList: [
{
id: 1,
name: '设备实例一'
},
{
id: 2,
name: '设备实例二'
},
{
id: 3,
name: '设备实例三'
},
{
id: 4,
name: '设备实例四'
}
],
chartData: [], chartData: [],
chartList: [], chartList: [],
rules: { rules: {
...@@ -167,7 +212,7 @@ export default { ...@@ -167,7 +212,7 @@ export default {
}, },
createCharts() { createCharts() {
const form = `form${this.activeModel}` const form = `form${this.activeModel}`
this.$refs[form][0].validate() this.$refs[form].validate()
.then(_ => { .then(_ => {
this.chartData = [] this.chartData = []
this.chartList = [] this.chartList = []
...@@ -208,6 +253,39 @@ export default { ...@@ -208,6 +253,39 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.container{ .container{
min-height: calc(100vh - 90px); min-height: calc(100vh - 95px);
.content{
display: flex;
min-height: calc(100vh - 135px);
.left{
width: 100%;
height: 100%;
.search{
height: 40px;
}
.custom-menu{
background-color: #efeff1;
height: calc(100% - 40px);
.el-menu{
background-color: initial;
border-right: none;
border-top: solid 1px #e6e6e6;
border-left: solid 1px #e6e6e6;
.el-menu-item.el-menu-item{
min-width: initial;
background-color: #efeff1;
}
.el-menu-item.is-active{
background-color: #fff;
color: #303133;
}
}
}
}
.top{
display: flex;
justify-content: space-between;
}
}
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment