| | |
| | | // 引入自定义主题 |
| | | import "./theme/transparent"; |
| | | import noRepeat from "@/assets/js/tools/noRepeat"; |
| | | import formatTime from "@/assets/js/tools/formatTime"; |
| | | export default { |
| | | chart: "", |
| | | props: { |
| | |
| | | let valuesLength = values.length; |
| | | let colorsLength = colors.length; |
| | | data = data.map(item=>{ |
| | | item.value[0] = new Date(item.value[0]).getTime(); |
| | | item.value[1] = new Date(item.value[1]).getTime(); |
| | | item.value[0] = formatTime(new Date(item.value[0]).format("hh:mm:ss"))/3600; |
| | | item.value[1] = formatTime(new Date(item.value[1]).format("hh:mm:ss"))/3600; |
| | | |
| | | let value = item.value[2]; |
| | | let index = values.indexOf(value); |
| | | let color = colors[0]; |
| | |
| | | tooltip: {}, |
| | | xAxis: { |
| | | name: "", |
| | | type: "time", |
| | | type: "value", |
| | | splitNumber: 25, |
| | | lineStyle: { |
| | | show: noBottom, |
| | | }, |
| | |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | show: false, |
| | | show: true, |
| | | interval: 0, |
| | | formatter: function(value) { |
| | | return new Date(value).format("hh:mm:ss"); |
| | | }, |
| | | // formatter: function(value) { |
| | | // return Number(new Date(value).format("hh")); |
| | | // }, |
| | | textStyle: { |
| | | color: '#d1e6eb', |
| | | }, |
| | |
| | | <template> |
| | | <div class="params-container"> |
| | | <div class="params-chart"> |
| | | <ele-price-bar ref="elePriceBar"></ele-price-bar> |
| | | </div> |
| | | <el-form |
| | | ref="ruleForm" |
| | | size="mini" |
| | |
| | | |
| | | <script> |
| | | import AddPlan from "./addPlan.vue"; |
| | | import elePriceBar from "@/components/chart/elePriceBar"; |
| | | export default { |
| | | components: { |
| | | AddPlan, |
| | | elePriceBar, |
| | | }, |
| | | props: { |
| | | batt: { |
| | |
| | | return "(充电)"; |
| | | } |
| | | }, |
| | | searchElePrices() { |
| | | let batt = this.batt; |
| | | let loading = this.$layer.loading(); |
| | | // 查询电价 |
| | | this.$apis.dcdc |
| | | .searchElePrices(batt.tmp_id) |
| | | .then((res) => { |
| | | // 关闭弹出框 |
| | | this.$layer.close(loading); |
| | | |
| | | let rs = JSON.parse(res.data.result); |
| | | let data = []; |
| | | if (rs.code == 1) { |
| | | data = rs.data; |
| | | } |
| | | let barData = data.map((child) => { |
| | | return { |
| | | value: [ |
| | | "2022-10-01 " + child.tmp_starttime, |
| | | "2022-10-01 " + child.tmp_stoptime, |
| | | child.ele_price, |
| | | "电费", |
| | | ], |
| | | itemStyle: { |
| | | color: "#49A1FA", |
| | | }, |
| | | }; |
| | | }); |
| | | |
| | | // 设置电价的图表 |
| | | this.$refs.elePriceBar.setData({ |
| | | title: "", |
| | | data: barData, |
| | | }); |
| | | }) |
| | | .catch((error) => { |
| | | // 关闭弹出框 |
| | | this.$layer.close(loading); |
| | | }); |
| | | }, |
| | | }, |
| | | computed: { |
| | | otherParams() { |
| | |
| | | }, |
| | | mounted() { |
| | | this.searchPlan(); |
| | | this.searchElePrices(); |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | width: 1200px; |
| | | background-color: #ececec; |
| | | } |
| | | .params-chart { |
| | | height: 200px; |
| | | background-color: #0b388a; |
| | | } |
| | | </style> |
| | |
| | | <el-tab-pane label="电价统计分析" name="elePrice" v-if="isLithium"> |
| | | <ele-price-tpl ref="elePriceTpl" :devId="batt.FBSDeviceId" :name="acTabs" :batt="batt"></ele-price-tpl> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="BMS信息" name="bmsInfo" v-if="isLithium"> |
| | | <bms-info></bms-info> |
| | | </el-tab-pane> |
| | | <!-- <el-tab-pane label="BMS信息" name="bmsInfo" v-if="isLithium" v-show="false">--> |
| | | <!-- <bms-info></bms-info>--> |
| | | <!-- </el-tab-pane>--> |
| | | </el-tabs> |
| | | </div> |
| | | </flex-layout> |