| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384 |
- <template>
- <view class="container">
- <!-- -->
- <view class="container_title">
- <l-liquid v-model:current="modelVale" :percent="target" :outline="true" background="#007545"
- waveColor="#007545" innerColor="rgba(#007545, 0.1)">
- <text class="liquid_text">{{devicedata.soc}} <text class="income_unit">%</text></text>
- </l-liquid>
- </view>
-
- <view class="container_box">
- <view class="health">
- {{$t('devicedetails.label')}}
- </view>
- <view class="income_box">
- <view class="income">
- <view class="income_yesterday">
- <image class="income_image" src="/static/realtimepower.png" mode="aspectFill" />
- <view class="income_yesterday1">{{$t('devicedetails.power')}}:</view>
- <view class="income_yesterday2">{{devicedata.realTimepower}} <text class="income_unit">kW</text></view>
- </view>
- <view class="income_tired">
- <image class="income_image" src="/static/electriccurrent.png" mode="aspectFill" />
- <view class="income_tired1">{{$t('devicedetails.charge')}}:</view>
- <view class="income_tired2">{{devicedata.chargingCurrent}} <text class="income_unit">A</text></view>
- </view>
- </view>
- <view class="income">
- <view class="income_yesterday">
- <image class="income_image" src="/static/cumulativestorage.png" mode="aspectFill" />
- <view class="income_yesterday1">{{$t('devicedetails.today')}}:</view>
- <view class="income_yesterday2">{{devicedata.dayExportKwh}} <text class="income_unit">kWh</text></view>
- </view>
- <view class="income_tired">
- <image class="income_image" src="/static/storage.png" mode="aspectFill" />
- <view class="income_tired1">{{$t('devicedetails.total')}}:</view>
- <view class="income_tired2">{{devicedata.accumulativeExportKwh}} <text class="income_unit">kWh</text></view>
- </view>
- </view>
- <view class="income">
- <view class="income_yesterday">
- <image class="income_image" src="/static/totalvoltage.png" mode="aspectFill" />
- <view class="income_yesterday1">{{$t('devicedetails.battery')}}:</view>
- <view class="income_yesterday2">{{devicedata.totalVoltageOfBattery}} <text class="income_unit">V</text></view>
- </view>
- <view class="income_tired">
- <image class="income_image" src="/static/biandianzhan.png" mode="aspectFill" />
- <view class="income_tired1">{{$t('devicedetails.insulation')}}:</view>
- <view class="income_tired2">{{devicedata.insulationImpedance}} <text class="income_unit">kQ</text></view>
- </view>
- </view>
- <view class="income_income">
- <view class="income_income_yesterday">
- <image class="income_image" src="/static/device1.png" mode="aspectFit" />
- <view class="income_yesterday1">{{$t('devicedetails.title')}}:</view>
- <view class="income_yesterday2">{{devicedata.name}}</view>
- </view>
- </view>
- <view class="income_income">
-
- <view class="income_income_yesterday">
- <image class="income_image" src="/static/model.png" mode="aspectFit" />
- <view class="income_tired1">{{$t('devicedetails.model')}}:</view>
- <view class="income_tired2">{{devicedata.equipmentmodel}}</view>
- </view>
- </view>
- </view>
- </view>
- <!-- 顶部标签栏 -->
- <!-- <view class="toptabbar">
- <top-tabbar :tabIndex="tabIndex" :tabBars="tabBars" @toggleToptab="toggleTab" selectedBottomColor="#30c58d"
- selectedTextColor="#343434" textColor="#7d7e80" bgColor="#ffffff"></top-tabbar>
- </view> -->
- <!-- <view class="datecalendar">
- <view class="datecalendar_1">
- <view @click="ondatecalendar(1)" class="datecalendar_1sun"
- :style="brightcalendar == 1?'backgroundColor:#007544;color:#ffffff':'backgroundColor:#ffffff'">
- 日
- </view>
- <view @click="ondatecalendar(2)" class="datecalendar_1moon"
- :style="brightcalendar == 2?'backgroundColor:#007544;color:#ffffff':'backgroundColor:#ffffff'">
- 月
- </view>
- <view @click="ondatecalendar(3)" class="datecalendar_1year"
- :style="brightcalendar==3?'backgroundColor:#007544;color:#ffffff':'backgroundColor:#ffffff'">
- 年
- </view>
- </view>
- <view v-if="brightcalendar!=3" class="datecalendar_2" @click="Dateselection">
- {{date}}
- </view>
- </view> -->
- <!-- <KDatePicker v-model="show" :type="selectiondata" :modelValue="date" :is-disabled="isDisabled"
- @change="handleChange" :formatter="formatter" /> -->
- <!-- 图表 -->
- <!-- <view class="qiun_data">
- <view class="qiun_title" v-if="brightcalendar == 1">
- {{tabIndex==0?'电量(MWh/日)':'收益(元/日)'}}
- </view>
- <view class="qiun_title" v-if="brightcalendar == 2">
- {{tabIndex==0?'电量(MWh/月)':'收益(万元/月)'}}
- </view>
- <view class="qiun_title" v-if="brightcalendar == 3">
- {{tabIndex==0?'电量(MWh/年)':'收益(万元/年)'}}
- </view>
- <qiun-data-charts type="column" :opts="opts" :ontouch="true" :chartData="chartData" />
- </view> -->
- <!-- <view class="qiun_data">
- <view class="qiun_title" v-if="brightcalendar == 1">
- {{tabIndex==0?'电压(V)':'温度(℃)'}}
- </view>
- <view class="qiun_title" v-if="brightcalendar == 2">
- {{tabIndex==0?'电压(V)':'温度(℃)'}}
- </view>
-
- <qiun-data-charts type="area" :opts="optsline" :ontouch="true" :chartData="chartDataline" />
- </view> -->
- <!-- <view class="container_box">
- <view class="income_box">
- <view class="incomeweekday">
- <view class="weekday1">
-
- <view class="income_yesterday1">设备ID:</view>
- </view>
- <view class="restday1">
-
- <view class="income_moon1">型号:</view>
- </view>
-
- </view>
-
- </view>
- </view> -->
- <view class="energy">
- <view class="energy_title">
- <!-- 运行计划 -->
- {{$t('devicedetails.schedule')}}
- </view>
- <view class="energy_calendar">
- <uni-calendar
- :insert="true"
- :lunar="true"
- :selected="selecteddata"
- @change="oncalendar"
- @monthSwitch="oncalendar"
- />
- </view>
- </view>
- <view class="container_box">
- <view class="income_box">
- <view class="incomeweekday">
- <view class="weekday1" @click="weekday(1)" :style="weekdaytype==1?'border: 1rpx solid #2979ff;color:#2979ff':'border: 1rpx solid #fff'">
- <view class="weekday"></view>
- <view class="income_yesterday1" :style="weekdaytype==1?'color:#2979ff':'color: #999999;'">{{$t('devicedetails.weekdays')}}</view>
- </view>
- <view class="restday1" @click="weekday(2)" :style="weekdaytype==2?'border: 1rpx solid #2979ff;color:#2979ff':'border: 1rpx solid #fff'">
- <view class="restday"></view>
- <view class="income_moon1" :style="weekdaytype==2?'color:#2979ff':'color: #999999;'">{{$t('devicedetails.weekends')}}</view>
- </view>
- <view class="restday2"> </view>
- <view class="restday2"> </view>
- </view>
-
- </view>
- </view>
- <view class="power_box1">
- <view class="powerstation">
- <view class="power_yesterdaystrategy" @click="ondevices">
- <view class="strategybox">
- <image class="strategycalendar" src="/static/calendar.png" mode=""></image>
- <view class="power_iconstrategy">
- <view class="power_yesterday11">{{date}}</view>
- <view class="power_yesterday11">{{$t('devicedetails.listTitle')}}:{{weekdaytype==1?$t('devicedetails.weekdays'):$t('devicedetails.weekends')}}</view>
- </view>
- </view>
-
- <view class="power_strategy">{{$t('devicedetails.detailTitle')}}<image class="energy_jumpto" src="/static/jumpto.png" mode=""></image></view>
- </view>
- </view>
- </view>
- <view class="power_box2">
- <view class="powerstation">
- <view class="power_yesterdaystrategy">
- <view class="strategybox">
- <image class="strategy" src="/static/startstop.png" mode=""></image>
- <view class="power_iconstrategy">
- <view class="power_yesterday11">{{$t('devicedetails.powerControl')}}</view>
- <!-- <view class="power_yesterday1">2024-09-13</view> -->
- </view>
- </view>
- <l-switch v-model="defaultValue" disabled="false" :placeholder="[$t('devicedetails.on'), $t('devicedetails.off')]" dotSize="14px" height="22px" width="32px"></l-switch>
-
- <!-- <view class="power_strategy1" @click="toggle('center')">开启<image class="energy_jumpto" src="/static/jumpto.png" mode=""></image></view> -->
- <!-- <view class="power_strategy2" @click="toggle('center')">停止<image class="energy_jumpto" src="/static/jumpto.png" mode=""></image></view> -->
- </view>
- </view>
- </view>
- <!-- 普通弹窗-->
- <uni-popup ref="popupRef" background-color="#fff" @change="change" borderRadius="10rpx">
- <view class="popup-content" :class="{ 'popup-height': devicetype === 'left' || devicetype === 'right' }">
- <view class="popuptext">
- 是否开启?
- </view>
- <view class="popupbutton">
- <button class="cancel-button" size="mini" @click="handleCancel">取消</button>
-
- <button class="confirm-button" @click="handleConfirm">确认</button>
- </view>
-
- </view>
- </uni-popup>
- </view>
- </template>
- <!-- -->
- <!-- -->
- <script setup>
- import {
- onMounted,
- ref
- } from 'vue';
- import topTabbar from '@/components/top-tabbar.vue';
- import KDatePicker from '../../components/k-date-picker/KDatePicker.vue';
- import { formatAmount,Accumulateddischarge } from '@/utils/format.js'; // 引入格式化函数
- import request from '@/utils/request';
- import {
- getMonthRange,
- getMonth
- } from '@/utils/date.js';
- import { onLoad,onHide,onShow,onUnload } from '@dcloudio/uni-app';
- const deviceid = ref()
- onLoad((options) => {
- console.log('页面加载,参数为:', options);
- if (options) {
- uni.setNavigationBarTitle({
- title: options.stationName||'设备',
- });
- deviceid.value = options.id
- // options.date
- }
- });
- const interval = ref(null)
- onHide(() => {
- // 页面隐藏时也可以选择清理定时器
- if (interval.value) {
- clearInterval(interval.value);
- interval.value = null
- }
- });
- onUnload(() => {
- // 页面隐藏时也可以选择清理定时器
- if (interval.value) {
- clearInterval(interval.value);
- interval.value = null
- }
- });
- onShow(() => {
-
- // 页面再次显示时重新启动定时器
- if (!interval.value) {
- setIntervalDemo();
- }
- });
-
- const setIntervalDemo =() => {
- interval.value = setInterval(() => {
- getoverview(); // 首页收益充电
- }, 10000)
- };
- onMounted(() => {
- const monthRange = getMonthRange();
- date.value = monthRange.firstDay.substring(0, 7);
- getoverview(); // 首页收益充电
- // getmuitiStationinfo(); // 电站接口
- operationplan(); // 运行计划
- // gettemperature(); // 温度统计图
- });
- const target = ref(0)
- const modelVale = ref(0)
- const devicedata = ref({})
- const getoverview = async () => {
- console.log(deviceid.value);
- // /station/f39b18f4-100c-498d-af97-d4ea70d0c7de/system/stationHDES0124050011/realtime/info
- try {
- const response = await request({
- url: `/connectionapp/system/${deviceid.value}/realtime/info`,
- method: 'POST',
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- });
- devicedata.value = response.data
- modelVale.value =devicedata.value.soc*1
- target.value =devicedata.value.soc*1
-
- } catch (error) {
- console.error('登录失败:', error);
- }
- }
- // 电站数量
- const muitiStationinfo = ref()
- const onlineStatus = ref()
- const getmuitiStationinfo = async () => {
- try {
- const response = await request({
- url: '/muitiStation/page/info',
- method: 'POST',
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- data: {
- state: '',
- city: '',
- country: '',
- county: '',
- keyword: '',
- keywordCategory: 0,
- countryCode: '',
- provinceCode: '',
- cityCode: '',
- countyCode: '',
- pn: 1,
- ps: 99,
- onlineStatus: ''
- }
- });
- muitiStationinfo.value = response.data.stationPicArray
-
- } catch (error) {
- console.error('登录失败:', error);
- }
- };
- // 图表数据
- const chartData = ref();
- const chartDataline = ref();
- const opts = ref({
- enableScroll: true, //开启滚动条,X轴配置里需要配置itemCount单屏幕数据点数量
- color: ["#B2D5CB"],
- padding: [15, 10, 0, 15],
- backgroundColor: "#B2D5CB",
- legend: false,
- xAxis: {
- disableGrid: true,
- itemCount: 5, //单屏数据密度即图表可视区域内显示的X轴数据点数量,仅在启用enableScroll时有效
- scrollShow: false, //是否显示滚动条,配合拖拽滚动使用(即仅在启用【基本配置】的 enableScroll 时有效)
-
- },
- yAxis: {
- gridType: "dash",
- dashLength: 2,
-
- },
- extra: {
- line: {
- type: "straight",
- width: 2,
- activeType: "hollow",
-
- },
- column: {
- barBorderRadius: [4, 4, 0, 0],
- },
- }
-
- })
- const optsline = ref({
- enableScroll: true, //开启滚动条,X轴配置里需要配置itemCount单屏幕数据点数量
- color: ["#B2D5CB"],
- padding: [15, 10, 0, 15],
- backgroundColor: "#B2D5CB",
- legend: false,
- xAxis: {
- disableGrid: true,
- itemCount: 5, //单屏数据密度即图表可视区域内显示的X轴数据点数量,仅在启用enableScroll时有效
- scrollShow: false, //是否显示滚动条,配合拖拽滚动使用(即仅在启用【基本配置】的 enableScroll 时有效)
- boundaryGap: "justify",
- },
- yAxis: {
- gridType: "dash",
- dashLength: 2,
-
- },
- extra: {
-
- area: {
- type: "straight",
- opacity: 0.2,
- addLine: true,
- width: 2,
- gradient: false,
- activeType: "hollow"
- }
- }
-
- })
- const params = ref();
- // 多站电量
- const getelectricity = async () => {
-
- try {
- const response = await request({
- url: '/api/va/hisdata/hour/datas',
- method: 'GET',
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- data:{
- page:1,
- rows:100,
- starttime:date.value,
- filed:filed.value,
- filter:filter.value,
- uuid:deviceid.value
- }
- });
- let arr1 = [];
- let arr2 = [];
- response.data.list.forEach((item, index) => {
- if (brightcalendar.value == 1) {
- const ymdSubstring = item.recordtime.slice(3, 5);
- arr1.push(ymdSubstring);
- if(tabIndex.value==0){
- arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
- }else{
- arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/1000).toFixed(2));
- }
- } else if(brightcalendar.value == 2) {
- const ymdSubstring = item.recordtime;
- arr1.push(ymdSubstring);
- if(tabIndex.value==0){
- arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
- }else{
- arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/10000).toFixed(2));
- }
-
- }else if(brightcalendar.value == 3){
- const ymdSubstring = item.recordtime;
- arr1.push(ymdSubstring);
- if(tabIndex.value==0){
- arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
- }else{
- arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/10000).toFixed(2));
- }
-
- }
-
- })
- // setTimeout(() => {
- //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
- let res = {}
- if(tabIndex.value==0){
- res = {
- categories: arr1,
- series: [{
- name: "电量",
- data: arr2
- },
-
- ]
- };
- }else{
- res = {
- categories: arr1,
- series: [{
- name: "收益",
- data: arr2
- },
-
- ]
- };
- }
-
- chartData.value = JSON.parse(JSON.stringify(res));
- chartData.value ={
- categories: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
- series: [
- {
- name: '销量',
- data: [120, 200, 150, 80, 70, 110, 130]
- }
- ]
- }
- // }, 500);
- } catch (error) {
- console.error('登录失败:', error);
- };
- };
- // 温度电压
- const gettemperature = async () => {
-
- try {
- const response = await request({
- url: '/api/va/hisdata/hour/datas',
- method: 'GET',
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- data:{
- page:1,
- rows:100,
- starttime:date.value,
- filed:filed.value,
- filter:filter.value,
- uuid:deviceid.value
- }
- });
- let arr1 = [];
- let arr2 = [];
- response.data.list.forEach((item, index) => {
- if (brightcalendar.value == 1) {
- const ymdSubstring = item.recordtime.slice(3, 5);
- arr1.push(ymdSubstring);
- if(tabIndex.value==0){
- arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
- }else{
- arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/1000).toFixed(2));
- }
- } else if(brightcalendar.value == 2) {
- const ymdSubstring = item.recordtime;
- arr1.push(ymdSubstring);
- if(tabIndex.value==0){
- arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
- }else{
- arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/10000).toFixed(2));
- }
-
- }else if(brightcalendar.value == 3){
- const ymdSubstring = item.recordtime;
- arr1.push(ymdSubstring);
- if(tabIndex.value==0){
- arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
- }else{
- arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/10000).toFixed(2));
- }
-
- }
-
- })
- // setTimeout(() => {
- //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
- let res = {}
- if(tabIndex.value==0){
- res = {
- categories: arr1,
- series: [{
- name: "电量",
- data: arr2
- },
-
- ]
- };
- }else{
- res = {
- categories: arr1,
- series: [{
- name: "收益",
- data: arr2
- },
-
- ]
- };
- }
-
- chartDataline.value = JSON.parse(JSON.stringify(res));
- chartDataline.value ={
- categories: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
- series: [
- {
- name: '销量',
- data: [120, 200, 150, 80, 70, 110, 130]
- }
- ]
- }
- // }, 500);
- } catch (error) {
- console.error('登录失败:', error);
- };
- };
- // 选中标签的索引
- const tabIndex = ref(0);
- // 导航栏标签列表
- const tabBars = ref([{
- name: '电量',
- id: 0
- },
- {
- name: '收益',
- id: 1
- },
- ]);
- // 切换标签
- const toggleTab = (index) => {
- tabIndex.value = index;
- if(tabIndex.value==0){
- filter.value = '5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta,469dc1cc-e5ad-492f-a350-f7bc473d55ee_delta'
- }else{
- filter.value = 'a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta'
-
- }
- getelectricity();
- };
- const show = ref(false)
- const date = ref('')
- const open = () => {
- show.value = true;
- toggleTab(tabIndex.value);
- };
- const isDisabled = (value) => {
- return value > new Date().getTime()
- }
- const handleChange = async (value) => {
- // 示例用法
- try {
- date.value = value
-
- show.value = false
- getelectricity();
-
- } catch (error) {
- console.error(error.message);
- }
-
- };
- const brightcalendar = ref(1);
- const selectiondata = ref('month');
- const formatter = ref('YYYY-MM');
- const filed = ref('day');
- const filter = ref('5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta,469dc1cc-e5ad-492f-a350-f7bc473d55ee_delta');
-
- const ondatecalendar = (e) => {
- console.log(e);
- brightcalendar.value = e
- if (e == 1) {
- const monthRange = getMonthRange();
- date.value = monthRange.firstDay.substring(0, 7);
- filed.value = 'day'
- selectiondata.value = 'month'
- formatter.value = 'YYYY-MM'
- } else if (e == 2) {
- const Year = new Date().getFullYear(); // 获取当前年份
- date.value = Year
- selectiondata.value = 'year'
- formatter.value = 'YYYY'
- filed.value = 'Month'
- } else if (e == 3) {
- filed.value = 'year'
- }
- getelectricity();
- }
- const Dateselection = (e) => {
- console.log(e);
- open();
- }
- // 策略详情
- const ondevices = () => {
- if(weekdaytype.value==1){
- uni.navigateTo({
- url: `/pages/strategy/index?id=${deviceid.value}&type=1`
- })
- }else{
- uni.navigateTo({
- url: `/pages/strategy/index?id=${deviceid.value}&type=2`
- })
- }
-
- }
- const onhost = () => {
- uni.navigateTo({
- url: '/pages/devicedetails/index'
- })
- }
- // change
- // 日历
- const oncalendar = (e) => {
- // console.log(e);
- let month = 0
- if(e.month*1<10){
- month = '0' + e.month
- }else{
- month = e.month
- }
- date.value = e.year +'-'+month
- operationplan();
- }
- const weekdaytype =ref(1);
- // 工作日 休息日
- const weekday = (e) => {
- // console.log(e);
- weekdaytype.value =e
- }
- // 运行计划
- const selecteddata = ref()
- const operationplan = async () => {
- console.log(deviceid.value);
- try {
- const response = await request({
- url: `/connectionapp/plan`,
- method: 'get',
- header: {
- 'Content-Type': 'application/x-www-form-urlencoded'
- },
- data:{
- grid:deviceid.value,
- month:date.value
- }
- });
- // console.log(response);
- selecteddata.value = response.data
-
- } catch (error) {
- console.error('登录失败:', error);
- }
- }
- // 设备启停
- const devicetype =ref('center')
- const msgType= ref('success')
- const messageText=ref('这是一条成功提示')
- const value= ref('')
- const popupRef = ref(null)
- const toggle=(type)=> {
- console.log(type);
- devicetype.value = type
- // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
- if (popupRef.value) {
- popupRef.value.open(type);
- }
- };
- // 处理取消按钮点击事件
- const handleCancel=()=> {
- console.log('用户点击了取消');
- this.$refs.popupRef.close(); // 关闭弹出层
- };
-
- // 处理确认按钮点击事件
- const handleConfirm=()=> {
- console.log('用户点击了确认');
- this.$refs.popupRef.close(); // 关闭弹出层
- // 在这里添加确认后的逻辑
- };
-
- // popup 状态变化事件
- const change=(e)=> {
- console.log('弹出层状态变化:', e);
- }
- </script>
- <style scoped>
- uni-page {
- width: 100%;
- height: 100%;
- overflow: auto;
- visibility: hidden;
- }
-
- .container {
- background: linear-gradient(to bottom, #007545 -40%, #f0f5f5 40%, #f0f5f5 100%);
- box-sizing: border-box;
- padding-bottom:1rpx;
- }
-
- .l-liquid {
- /* background-color: #007545; */
- border: 10rpx solid #007545;
- }
-
- .liquid_text {
- font-size: 38rpx;
- color: #fff;
- }
-
- .container_title {
- width: 100%;
- height: 400rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .container_box {
- width: 100%;
- padding: 0rpx 20rpx;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .health{
- color: #007545;
- font-size: 28rpx;
- margin-bottom: 20rpx;
- }
- .container_box1{
- width: 100%;
- padding: 0rpx 20rpx;
- box-sizing: border-box;
- margin-top: 20rpx;
- }
- .container_parameter {
- width: 100%;
- height: 500rpx;
- background-color: #ffffff;
- border-radius: 10rpx;
- }
-
- .income_box {
- width: 100%;
- background-color: #ffffff;
- box-sizing: border-box;
- border-radius: 16rpx;
- }
-
- .income {
- width: 100%;
- display: flex;
- align-items: center;
- padding: 20rpx;
- box-sizing: border-box;
- /* justify-content: space-around; */
- /* justify-content: space-between; */
- }
- .income_income{
- width: 100%;
- display: flex;
- align-items: center;
- padding: 20rpx;
- box-sizing: border-box;
- }
- .income_income_yesterday{
- /* width: 320rpx; */
- display: flex;
- align-items: center;
- }
- .income_image {
- width: 36rpx;
- height: 36rpx;
- margin-right: 6rpx;
- }
-
- .income_yesterday,
- .income_moon,
- .income_tired {
- width: 320rpx;
- display: flex;
- align-items: center;
- /* justify-content: space-around; */
- /* justify-content: space-between; */
- }
-
- .income_yesterday1,
- .income_moon1,
- .income_tired1 {
- font-size: 26rpx;
- color: #999999;
- }
-
- .income_yesterday2,
- .income_moon2,
- .income_tired2 {
- font-size: 26rpx;
- margin-left: 8rpx;
- color: #222;
- }
-
- .qiun_data {
- width: 100%;
- padding: 16rpx;
- overflow: auto;
- box-sizing: border-box;
- }
-
- .qiun_title {
- height: 12%;
- font-size: 28rpx;
- margin-left: 20rpx;
- }
-
- .power_box {
- width: 100%;
- padding: 0rpx 20rpx;
- box-sizing: border-box;
- margin-bottom: 30rpx;
- }
- .power_box1 {
- width: 100%;
- padding: 0rpx 20rpx;
- box-sizing: border-box;
- }
- .power_box2{
- width: 100%;
- padding: 0rpx 20rpx;
- box-sizing: border-box;
- margin-bottom: 30rpx;
- }
- .powerstation {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
-
- .power_yesterday,
- .power_moon,
- .power_tired {
- width: 31%;
- padding: 20rpx 0rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- border-radius: 10rpx;
- background-color: #ffffff;
- }
-
- .power_yesterday image,
- .power_moon image,
- .power_tired image {
- width: 40rpx;
- height: 40rpx;
- }
-
- .power_yesterday image {
- /* background-color: #007544; */
- }
-
- .power_moon image {
- /* background-color: #3774f3; */
- }
-
- .power_tired image {
- /* background-color: #b3cef9; */
- }
- .power_icon{
- display: flex;
- }
- .power_yesterday1,
- .power_moon1,
- .power_tired1 {
- font-size: 26rpx;
- margin-left:10rpx;
- color: #999999;
- }
- .power_yesterday11{
- font-size: 26rpx;
- margin-left:10rpx;
- color: #222;
- }
- .power_moon2,.power_yesterday2,.power_tired2{
- margin-top:10rpx;
- font-size: 24rpx;
- }
-
- .toptabbar {
- width: 100%;
- height: 80rpx;
- margin-top: 20px;
- padding: 10rpx 20rpx;
- box-sizing: border-box;
- }
-
- /deep/ .uni-scroll-view-content {
- display: flex;
- justify-content: center;
- }
-
- .datecalendar {
- display: flex;
- justify-content: space-between;
- padding: 0rpx 24rpx;
- margin-top: 60rpx;
- }
-
- .datecalendar_1 {
- width: 320rpx;
- height: 60rpx;
- display: flex;
- font-size: 28rpx;
- border: 0.2rpx solid #999999;
- border-radius: 40rpx;
- overflow: overlay;
- }xz
-
- .datecalendar_1sun {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- color: #222222;
- background-color: #ffffff;
- }
-
- .datecalendar_1moon {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #ffffff;
- border-left: 0.2rpx solid #999999;
- border-right: 0.2rpx solid #999999;
- }
-
- .datecalendar_1year {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #ffffff;
- }
-
- .datecalendar_2 {
- width: 180rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- border: 0.2rpx solid #999999;
- border-radius: 40rpx;
- }
-
- .qiun_data {
- width: 100%;
- height: 600rpx;
- padding: 16rpx;
- overflow: auto;
- box-sizing: border-box;
- }
-
- .qiun_title {
- height: 12%;
- font-size: 28rpx;
- margin-left: 20rpx;
- }
- /* --------------------------------------- */
- .energy {
- width: 100%;
- padding: 20rpx;
- box-sizing: border-box;
- }
- .energy_hostbox{
- padding: 20rpx;
- box-sizing: border-box;
- }
- .energy_host {
- width: 100%;
- padding: 20rpx;
- box-sizing: border-box;
- background-color: #ffffff;
- margin-bottom: 10rpx;
- border-radius: 10rpx;
- }
- .energy_title {
- width: 100%;
- }
-
- .energy_box {
- width: 100%;
- background-color: #B2D5CB;
- border-radius: 10rpx;
- margin-top: 20rpx;
- padding: 30rpx 16rpx;
- display: flex;
- align-items: center;
- box-sizing: border-box;
- }
-
- .energy_boximage {
- width: 88rpx;
- height: 88rpx;
- }
-
- .energy_boxtitle {
- flex: 1;
- display: flex;
- flex-direction: column;
- margin-left: 20rpx;
- }
-
- .energy_boxtitle1 {
- font-size: 28rpx;
- }
-
- .energy_boxtitle2 {
- font-size: 28rpx;
- margin-top: 4rpx;
- }
-
- .energy_right {
- display: flex;
- align-items: center;
- }
-
- .energy_boxright {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
-
- .energy_boxright1 {
- padding: 8rpx 6rpx;
- font-size: 26rpx;
- border-radius: 50rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: rgba(0, 116, 84, .3);
- color: #fff;
- }
-
- .energy_boxright2 {
- font-size: 24rpx;
- margin-top: 10rpx;
- }
-
- .energy_jumpto {
- width: 30rpx;
- height: 30rpx;
- margin-left: 8rpx;
- }
- .energy_calendar{
- margin-top:30rpx;
- border-radius: 10rpx;
- overflow: hidden;
- }
- .incomeweekday{
- width: 100%;
- height: 100rpx;
- display: flex;
- align-items: center;
- /* justify-content: space-around; */
- }
- .weekday{
- width: 20rpx;
- height: 20rpx;
- border-radius: 50rpx;
- background-color: red;
- margin-right: 10rpx;
- }
- .restday1{
- display: flex;
- align-items: center;
- margin-left: 40rpx;
- padding: 10rpx;
- border-radius: 100rpx;
- box-sizing: border-box;
- }
- .restday2{
- display: flex;
- align-items: center;
- margin-left: 40rpx;
- border: 1rpx solid #fff;
- padding: 10rpx;
- border-radius: 100rpx;
- box-sizing: border-box;
- }
- .weekday1{
- display: flex;
- align-items: center;
- margin-left: 20rpx;
-
- padding: 10rpx;
- border-radius: 100rpx;
- box-sizing: border-box;
- }
- .restday{
- width: 20rpx;
- height: 20rpx;
- border-radius: 50rpx;
- background-color: #007545;
- margin-right: 10rpx;
- }
- .power_yesterdaystrategy{
- width: 100%;
- padding: 20rpx 20rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- border-radius: 10rpx;
- background-color: #ffffff;
- margin-top: 20rpx;
- overflow: hidden;
- box-sizing: border-box;
- }
- .power_iconstrategy{
- flex-direction: column;
- }
- .strategy{
- width: 60rpx;
- height: 60rpx;
- }
- .strategycalendar{
- width: 60rpx;
- height: 60rpx;
- padding: 6rpx;
- box-sizing: border-box;
- }
- .strategybox{
- display: flex;
- align-items: center;
- }
- .power_strategy{
- font-size: 24rpx;
- color: #ccc;
- display: flex;
- align-items: center;
- }
-
- .power_strategy1{
- font-size: 24rpx;
- color: #B2D5CB;
- display: flex;
- align-items: center;
- }
- .power_strategy2{
- font-size: 24rpx;
- color: red;
- display: flex;
- align-items: center;
- }
- @mixin flex {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- }
-
- @mixin height {
- /* #ifndef APP-NVUE */
- height: 100%;
- /* #endif */
- /* #ifdef APP-NVUE */
- flex: 1;
- /* #endif */
- }
-
- .box {
- @include flex;
- }
-
- .button {
- @include flex;
- align-items: center;
- justify-content: center;
- flex: 1;
- height: 35px;
- margin: 0 5px;
- border-radius: 5px;
- }
-
- .example-body {
- background-color: #fff;
- padding: 10px 0;
- }
-
- .button-text {
- color: #fff;
- font-size: 12px;
- }
-
- .popup-content {
- @include flex;
- align-items: center;
- justify-content: center;
- padding: 15px;
- background-color: #fff;
- }
-
- .popup-height {
- @include height;
- width: 400px;
- }
-
- .text {
- font-size: 12px;
- color: #333;
- }
-
- .popup-success {
- color: #fff;
- background-color: #e1f3d8;
- }
-
- .popup-warn {
- color: #fff;
- background-color: #faecd8;
- }
-
- .popup-error {
- color: #fff;
- background-color: #fde2e2;
- }
-
- .popup-info {
- color: #fff;
- background-color: #f2f6fc;
- }
-
- .success-text {
- color: #09bb07;
- }
-
- .warn-text {
- color: #e6a23c;
- }
-
- .error-text {
- color: #f56c6c;
- }
-
- .info-text {
- color: #909399;
- }
-
- .dialog,
- .share {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: column;
- }
-
- .dialog-box {
- padding: 10px;
- }
-
- .dialog .button,
- .share .button {
- /* #ifndef APP-NVUE */
- width: 100%;
- /* #endif */
- margin: 0;
- margin-top: 10px;
- padding: 3px 0;
- flex: 1;
- }
-
- .dialog-text {
- font-size: 14px;
- color: #333;
- }
- /* 弹出层内容样式 */
- .popup-content {
- padding: 20px;
- text-align: center;
- border-radius: 20rpx;
- }
-
- /* 文本样式 */
- .popuptext {
- font-size: 26rpx;
- color: #333;
- margin-bottom: 20rpx;
- }
-
- /* 取消按钮样式 */
- .cancel-button {
- width: 120rpx;
- height: 60rpx;
- margin-top: 10rpx;
- font-size: 24rpx;
- background-color: #f0f0f0;
- color: #333;
- margin-right: 40rpx;
- }
-
- /* 确认按钮样式 */
- .confirm-button {
- width: 120rpx;
- height: 60rpx;
- margin-top: 10rpx;
- font-size: 24rpx;
- background-color: #007aff;
- color: #fff;
- }
-
- /* 根据设备类型调整高度 */
- .popup-height {
- height: 200px;
- }
- .popupbutton{
- display: flex;
- }
- .income_unit{
- font-size: 20rpx;
- }
- </style>
|