Commit 149d81ce authored by xiexingan's avatar xiexingan

用电数据

parent e812355c
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
@close="cancelhandlePic" @close="cancelhandlePic"
> >
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="设备名称:" style="margin-bottom:0"> <el-form-item label="设备名称:" style="margin-bottom: 0">
<el-input size="mini" autocomplete="off"></el-input> <el-input size="mini" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备编号:" style="margin-bottom:0"> <el-form-item label="设备编号:" style="margin-bottom: 0">
<el-input size="mini" autocomplete="off"></el-input> <el-input size="mini" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="数据起止阶段:" > <el-form-item label="数据起止阶段:">
<el-date-picker <!-- <el-date-picker
style="width:172px" style="width:172px"
size="mini" size="mini"
type="date" type="date"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
type="date" type="date"
placeholder="" placeholder=""
> >
</el-date-picker> </el-date-picker> -->
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" type="primary" icon="el-icon-search" <el-button size="mini" type="primary" icon="el-icon-search"
...@@ -35,7 +35,9 @@ ...@@ -35,7 +35,9 @@
> >
</el-form-item> </el-form-item>
</el-form> </el-form>
<div v-if="statisticModalVisible" id="categoryId" style="height: 200px"></div> <div v-if="statisticModalVisible" id="categoryId" style="height: 400px">
<chart id="111" :data="data" title="能耗数据" color="#21ACFC"></chart>
</div>
<div slot="footer"> <div slot="footer">
<el-button @click="cancelhandlePic">取 消</el-button> <el-button @click="cancelhandlePic">取 消</el-button>
<el-button type="primary" @click.stop="cancelhandlePic">确 定</el-button> <el-button type="primary" @click.stop="cancelhandlePic">确 定</el-button>
...@@ -43,25 +45,37 @@ ...@@ -43,25 +45,37 @@
</el-dialog> </el-dialog>
</template> </template>
<script > <script >
import chart from '@/pages/components/chart.vue'
export default { export default {
name: "statisticPicTableModal", name: 'statisticPicTableModal',
props: ["statisticModalVisible"], props: ['statisticModalVisible'],
components: {
chart
},
data() { data() {
return { return {
formLabelWidth: "120px", formLabelWidth: '120px',
category: null, category: null,
}; 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]
]
}
}, },
watch: { watch: {
statisticModalVisible(value) { statisticModalVisible(value) {
if (value) { if (value) {
setTimeout(() => { setTimeout(() => {
this.initCategory(); this.initCategory()
}, 3000); }, 1000)
}else{ } else {
this.category = null this.category = null
} }
}, }
}, },
mounted() { mounted() {
...@@ -71,29 +85,29 @@ export default { ...@@ -71,29 +85,29 @@ export default {
}, },
methods: { methods: {
cancelhandlePic() { cancelhandlePic() {
this.$emit("cancelhandlePic"); this.$emit('cancelhandlePic')
}, }
initCategory() { // initCategory() {
let gId = document.getElementById("categoryId"); // let gId = document.getElementById('categoryId')
this.category = this.$echarts.init(gId); // this.category = this.$echarts.init(gId)
const option = { // const option = {
xAxis: { // xAxis: {
type: "category", // type: 'category',
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
}, // },
yAxis: { // yAxis: {
type: "value", // type: 'value'
}, // },
series: [ // series: [
{ // {
data: [150, 230, 224, 218, 135, 147, 260], // data: [150, 230, 224, 218, 135, 147, 260],
type: "line", // type: 'line'
}, // }
], // ]
}; // }
this.category.setOption(option); // this.category.setOption(option)
}, // }
}, }
}; }
</script> </script>
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