Commit d8bea079 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 44a8df15
......@@ -14,14 +14,14 @@ card-warp(title="室内气象分析", height="45px", showBackground)
el-button(
size="mini",
type="primary",
@click="handleDate(index)",
@click="handleDate(item.id)",
v-for="(item, index) in typeList",
:key="index",
:class="[index == currentActive ? 'isActive' : '']"
:class="[item.id == currentActive ? 'isActive' : '']"
) {{ item.name }}
.echartsWarp(width="100%", flex)
div(v-for='item in chartList' :key='item.id')
chart(:id="item.id", :data="data", :title="item.title", :color="item.color")
chart(:id="item.id", :data="item.data", :title="item.title", :color="item.color")
</template>
<script>
......@@ -34,25 +34,17 @@ export default {
return {
activeName: '1',
typeList: [
{ name: '当日' },
{ name: '本周' },
{ name: '当月' },
{ name: '今年' }
],
currentActive: '0',
data: [
['2019-8-14 8:00:00', 70],
['2019-8-14 8:00:01', 60],
['2019-8-14 8:00:02', 30],
['2019-8-14 8:00:03', 79],
['2019-8-14 8:00:06', 10],
['2019-8-14 8:00:20', 31]
{ name: '当日', id: 1 },
{ name: '本周', id: 2 },
{ name: '当月', id: 3 },
{ name: '今年', id: 4 }
],
currentActive: 1,
chartList: [
{ id: '11', title: '温度', color: '#21ACFC' },
{ id: '22', title: '湿度', color: '#36CBCB' },
{ id: '55', title: 'CO2', color: '#4ECB74' },
{ id: '77', title: '故障报警', color: '#975FE4' }
{ id: '11', title: '温度', color: '#21ACFC', data: [] },
{ id: '22', title: '湿度', color: '#36CBCB', data: [] },
{ id: '33', title: 'CO2', color: '#4ECB74', data: [] },
{ id: '44', title: '故障报警', color: '#975FE4', data: [] }
]
}
},
......@@ -60,8 +52,25 @@ export default {
tabClick(tab, event) {
console.log(tab, event)
},
getDataList() {},
// 当日 ,本周
getDataList() {
this.$http({
url: this.$http.adornUrl('/analysis/getSnqxzInfoTj'),
method: 'get',
params: this.$http.adornParams({
region: Number(this.activeName), //区域类型
type: this.currentActive
})
}).then((data) => {
if (data && data.code === 0) {
// console.log('数据', data)
this.chartList[0].data = data.temperatureList
this.chartList[1].data = data.humidityList
this.chartList[2].data = data.carbonDioxideList
this.chartList[3].data = data.carbonDioxideList
}
})
},
// 当日 ,本周
handleDate(i) {
this.currentActive = i
}
......@@ -113,7 +122,7 @@ export default {
color: #000000;
line-height: 40px;
&::before {
content: "";
content: '';
display: inline-block;
width: 10px;
height: 10px;
......
......@@ -11,16 +11,14 @@ card-warp(title="室外气象分析", height="45px", showBackground)
el-button(
size="mini",
type="primary",
@click="handleDate(index)",
@click="handleDate(item.id)",
v-for="(item, index) in typeList",
:key="index",
:class="[index == currentActive ? 'isActive' : '']"
:class="[item.id == currentActive ? 'isActive' : '']"
) {{ item.name }}
.echartsWarp(width="100%", flex)
div(v-for='item in chartList' :key='item.id')
chart(:id="item.id", :data="data", :title="item.title", :color="item.color")
div
pie
chart(:id="item.id", :data="item.data", :title="item.title", :color="item.color")
</template>
<script>
......@@ -34,37 +32,54 @@ export default {
data() {
return {
chartList: [
{ id: '11', title: '温度', color: '#21ACFC' },
{ id: '22', title: '湿度', color: '#36CBCB' },
{ id: '33', title: '风速', color: '#3AA0FF' },
{ id: '44', title: '光照', color: '#FAD337' },
{ id: '55', title: 'CO2', color: '#4ECB74' },
{ id: '66', title: 'PM2.5', color: '#999999' },
{ id: '77', title: '辐射', color: '#975FE4' }
],
data: [
['2019-8-14 8:00:00', 70],
['2019-8-14 8:00:01', 60],
['2019-8-14 8:00:02', 30],
['2019-8-14 8:00:03', 79],
['2019-8-14 8:00:06', 10],
['2019-8-14 8:00:20', 31]
{ id: '11', title: '温度', color: '#21ACFC', data: [] },
{ id: '22', title: '湿度', color: '#36CBCB', data: [] },
{ id: '33', title: '风速', color: '#3AA0FF', data: [] },
{ id: '44', title: '光照', color: '#FAD337', data: [] },
{ id: '55', title: 'CO2', color: '#4ECB74', data: [] },
{ id: '66', title: 'PM2.5', color: '#999999', data: [] },
{ id: '77', title: '辐射', color: '#975FE4', data: [] },
{ id: '88', title: '故障报警数', color: '#F2637B', data: [] }
],
typeList: [
{ name: '当日' },
{ name: '本周' },
{ name: '当月' },
{ name: '今年' }
{ name: '当日', id: 1 },
{ name: '本周', id: 2 },
{ name: '当月', id: 3 },
{ name: '今年', id: 4 }
],
currentActive: '0',
currentActive: 1,
name: '室外气象站'
}
},
created() {
this.getDataList()
},
methods: {
getDataList() {},
getDataList() {
this.$http({
url: this.$http.adornUrl('/analysis/getSwqxzInfoTj'),
method: 'get',
params: this.$http.adornParams({
type: this.currentActive
})
}).then((data) => {
if (data && data.code === 0) {
// console.log('数据', data)
this.chartList[0].data = data.temperatureList
this.chartList[1].data = data.humidityList
this.chartList[2].data = data.windSpeedList
this.chartList[3].data = data.illuminanceList
this.chartList[4].data = data.carbonDioxideList
this.chartList[5].data = data.fineParticlesList
this.chartList[6].data = data.radiationList
this.chartList[7].data = data.radiationList
}
})
},
// 当日 ,本周
handleDate(i) {
this.currentActive = i
this.getDataList()
}
}
}
......@@ -89,7 +104,7 @@ export default {
color: #000000;
line-height: 40px;
&::before {
content: "";
content: '';
display: inline-block;
width: 10px;
height: 10px;
......
......@@ -51,6 +51,7 @@ export default {
currentActive: 1,
type: null,
pageSize: 10,
pageIndex: 1,
totalPage: 0,
visible: false,
dataForm: {
......
......@@ -138,6 +138,7 @@ export default {
dataList: [{ id: 1 }],
dataListLoading: false,
pageSize: 10,
pageIndex: 1,
totalPage: 0
}
},
......
......@@ -229,7 +229,7 @@ export default {
},
getDataListTb() {
this.$http({
url: this.$http.adornUrl('/kanban/getSwqxzInfoTj'),
url: this.$http.adornUrl('/analysis/getSwqxzInfoTj'),
method: 'get',
params: this.$http.adornParams({
type: this.type
......
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