云链智安app
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.vue 30KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270
  1. <template>
  2. <view class="container">
  3. <!-- -->
  4. <view class="container_title">
  5. <l-liquid v-model:current="modelVale" :percent="target" :outline="true" background="#007545"
  6. waveColor="#007545" innerColor="rgba(#007545, 0.1)">
  7. <text class="liquid_text">{{modelVale}} <text class="income_unit">%</text></text>
  8. </l-liquid>
  9. </view>
  10. <view class="container_box">
  11. <view class="income_box">
  12. <view class="income">
  13. <view class="income_moon">
  14. <image class="income_image" src="/static/charge.png" mode="aspectFill" />
  15. <view class="income_moon1">{{$t('powerstation.todayCharge')}}</view>
  16. <view class="income_moon2">{{devicedata.dayImportKwh}} <text class="income_unit">kWh</text> </view>
  17. </view>
  18. <view class="income_tired">
  19. <image class="income_image" src="/static/discharge.png" mode="aspectFill" />
  20. <view class="income_tired1">{{$t('powerstation.todayDischarge')}}</view>
  21. <view class="income_tired2">{{devicedata.dayExportKwh}} <text class="income_unit">kWh</text></view>
  22. </view>
  23. <view class="income_yesterday">
  24. <image class="income_image" src="/static/Cumulative.png" mode="aspectFill" />
  25. <view class="income_yesterday1">{{$t('powerstation.totalDischarge')}}</view>
  26. <view class="income_yesterday2">{{Accumulateddischarge(devicedata.accumulativeExportKwh)}} <text class="income_unit">{{Accumulateddischargeunit(devicedata.accumulativeExportKwh)}}</text></view>
  27. </view>
  28. </view>
  29. <view class="income">
  30. <view class="income_yesterday">
  31. <image class="income_image" src="/static/income.png" mode="aspectFill" />
  32. <view class="income_yesterday1">{{$t('powerstation.yesterdayEarnings')}}</view>
  33. <view class="income_yesterday2">{{devicedata.yesterdaysearnings?devicedata.yesterdaysearnings.toFixed(2):''}} <text class="income_unit">元</text></view>
  34. </view>
  35. <view class="income_moon">
  36. <image class="income_image" src="/static/totalrevenue.png" mode="aspectFill" />
  37. <view class="income_moon1">{{$t('powerstation.totalEarnings')}}</view>
  38. <view class="income_moon2">{{formatAmount(devicedata.totalProfit)}} <text class="income_unit">{{formatAmountunit(devicedata.totalProfit)}}</text> </view>
  39. </view>
  40. <view class="income_tired">
  41. <image class="income_image" src="/static/efficiency.png" mode="aspectFill" />
  42. <view class="income_tired1">{{$t('powerstation.systemEfficiency')}}</view>
  43. <view class="income_tired2">99 <text class="income_unit">%</text></view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- 顶部标签栏 -->
  49. <view class="toptabbar">
  50. <top-tabbar :tabIndex="tabIndex" :tabBars="[{
  51. name:$t('powerstation.batteryStatus'),
  52. id: 0
  53. },
  54. {
  55. name:$t('powerstation.earnings'),
  56. id: 1
  57. },
  58. ]" @toggleToptab="toggleTab" selectedBottomColor="#30c58d"
  59. selectedTextColor="#343434" textColor="#7d7e80" bgColor="#ffffff"></top-tabbar>
  60. </view>
  61. <view class="datecalendar">
  62. <view class="datecalendar_1">
  63. <view @click="ondatecalendar(1)" class="datecalendar_1sun"
  64. :style="{
  65. backgroundColor: brightcalendar === 1 ? '#007544' : '#ffffff',
  66. color: brightcalendar === 1 ? '#ffffff' : 'inherit'
  67. }">
  68. {{$t('powerstation.daily')}}
  69. </view>
  70. <view @click="ondatecalendar(2)" class="datecalendar_1moon"
  71. :style="{
  72. backgroundColor: brightcalendar === 2 ? '#007544' : '#ffffff',
  73. color: brightcalendar === 2 ? '#ffffff' : 'inherit'
  74. }">
  75. {{$t('powerstation.monthly')}}
  76. </view>
  77. <view @click="ondatecalendar(3)" class="datecalendar_1year"
  78. :style="{
  79. backgroundColor: brightcalendar === 3 ? '#007544' : '#ffffff',
  80. color: brightcalendar === 3 ? '#ffffff' : 'inherit'
  81. }">
  82. {{$t('powerstation.yearly')}}
  83. </view>
  84. </view>
  85. <view v-if="brightcalendar!=3" class="datecalendar_2" @click="Dateselection">
  86. {{date}}
  87. </view>
  88. </view>
  89. <KDatePicker v-model="show" :type="selectiondata" :modelValue="date" :is-disabled="isDisabled"
  90. @change="handleChange" :formatter="formatter" />
  91. <!-- 图表 -->
  92. <view class="qiun_data">
  93. <view class="qiun_title" v-if="brightcalendar == 1">
  94. {{tabIndex==0?$t('powerstation.batteryStatus'):$t('powerstation.earnings')}} <text class="income_unit">{{tabIndex==0?'(MWh)':'(万元)'}}</text>
  95. </view>
  96. <view class="qiun_title" v-if="brightcalendar == 2">
  97. {{tabIndex==0?$t('powerstation.batteryStatus'):$t('powerstation.earnings')}} <text class="income_unit">{{tabIndex==0?'(MWh)':'(万元)'}}</text>
  98. </view>
  99. <view class="qiun_title" v-if="brightcalendar == 3">
  100. {{tabIndex==0?$t('powerstation.batteryStatus'):$t('powerstation.batteryStatus')}}<text class="income_unit">{{tabIndex==0?'(MWh)':'(万元)'}}</text>
  101. </view>
  102. <qiun-data-charts type="column" :opts="opts" :ontouch="true" :chartData="chartData" background='rgba(0,0,0,0)'/>
  103. </view>
  104. <view class="energy_hostbox">
  105. <view class="energy_host">
  106. <view class="energy_title">
  107. <!-- 我的主机 -->
  108. {{$t('powerstation.myHost')}}
  109. </view>
  110. <view class="energy_box" v-for="item in muitiStationdata" :key="item.conscolidationId" @click="onhost(item)">
  111. <image class="energy_boximage" src="/static/powerdian.png" mode=""></image>
  112. <view class="energy_boxtitle">
  113. <view class="energy_boxtitle1">
  114. {{item.name||$t('powerstation.Unnamed')}}
  115. </view>
  116. <view class="energy_boxtitle2">
  117. {{$t('powerstation.ac')}}:{{(item.acPower*1)}} <text class="income_unit">kW</text>
  118. </view>
  119. </view>
  120. <view class="energy_right">
  121. <view class="energy_boxright">
  122. <view class="energy_boxright1" v-if="item.batteryStatus==0">
  123. <!-- 空闲 -->
  124. {{$t('powerstation.idle')}}
  125. </view>
  126. <view class="energy_boxright1" v-if="item.batteryStatus==1">
  127. <!-- 充电 -->
  128. {{$t('powerstation.charging')}}
  129. </view>
  130. <view class="energy_boxright1" v-if="item.batteryStatus==2">
  131. <!-- 放电 -->
  132. {{$t('powerstation.discharging')}}
  133. </view>
  134. <view class="energy_boxright1" v-if="item.batteryStatus==3">
  135. <!-- 充满 -->
  136. {{$t('powerstation.full')}}
  137. </view>
  138. <view class="energy_boxright1" v-if="item.batteryStatus==4">
  139. <!-- 放空 -->
  140. {{$t('powerstation.empty')}}
  141. </view>
  142. <view class="energy_boxright1" v-if="item.batteryStatus==5">
  143. <!-- 故障 -->
  144. {{$t('powerstation.fault')}}
  145. </view>
  146. <view class="energy_boxright2">
  147. SOC: {{(item.soc)*1}}%
  148. </view>
  149. </view>
  150. <image class="energy_jumpto" src="/static/jumpto.png" mode=""></image>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. <!-- 电站信息 -->
  156. <view class="power_box">
  157. <view class="powerstation">
  158. <view class="power_yesterday">
  159. <view class="power_icon">
  160. <image src="/static/capacity.png" mode=""></image>
  161. <view class="power_yesterday1">
  162. <!-- 装机容量 -->
  163. {{$t('powerstation.installedCapacity')}}
  164. </view>
  165. </view>
  166. <view class="power_yesterday2">{{devicedata.installedCap || ''}} <text class="income_unit">kWh</text></view>
  167. </view>
  168. <view class="power_moon">
  169. <view class="power_icon">
  170. <image src="/static/date.png" mode=""></image>
  171. <view class="power_moon1">
  172. <!-- 投运日期 -->
  173. {{$t('powerstation.commissioningDate')}}
  174. </view>
  175. </view>
  176. <view class="power_moon2">{{devicedata.operationDate}}</view>
  177. </view>
  178. <view class="power_tired">
  179. <view class="power_icon">
  180. <image src="/static/time.png" mode=""></image>
  181. <view class="power_tired1">
  182. <!-- 投运时间 -->
  183. {{$t('powerstation.commissioningTime')}}
  184. </view>
  185. </view>
  186. <view class="power_tired2">{{devicedata.opertionTime }}<text class="income_unit">天</text></view>
  187. </view>
  188. </view>
  189. </view>
  190. <view class="energy">
  191. <view class="energy_title">
  192. <!-- 我的运行策略 -->
  193. {{$t('powerstation.schedule')}}
  194. </view>
  195. <view class="energy_calendar">
  196. <uni-calendar
  197. :insert="true"
  198. :lunar="true"
  199. :selected="selecteddata"
  200. @change="oncalendar"
  201. @monthSwitch="oncalendar"
  202. />
  203. </view>
  204. </view>
  205. <view class="container_box">
  206. <view class="income_box">
  207. <view class="incomeweekday">
  208. <view class="weekday1" @click="weekday(1)" :style="weekdaytype==1?'border: 1rpx solid #2979ff;color:#2979ff':'border: 1rpx solid #fff'">
  209. <view class="weekday"></view>
  210. <view class="income_yesterday1" :style="weekdaytype==1?'color:#2979ff':'color: #999999;'">{{$t('hostdetails.weekdays')}}</view>
  211. </view>
  212. <view class="restday1" @click="weekday(2)" :style="weekdaytype==2?'border: 1rpx solid #2979ff;color:#2979ff':'border: 1rpx solid #fff'">
  213. <view class="restday"></view>
  214. <view class="income_moon1" :style="weekdaytype==2?'color:#2979ff':'color: #999999;'">{{$t('hostdetails.weekends')}}</view>
  215. </view>
  216. <view class="restday2"> </view>
  217. <view class="restday2"> </view>
  218. </view>
  219. </view>
  220. </view>
  221. <view class="power_box1">
  222. <view class="powerstation">
  223. <view class="power_yesterdaystrategy" @click="ondevices">
  224. <view class="strategybox">
  225. <image class="strategycalendar" src="/static/calendar.png" mode=""></image>
  226. <view class="power_iconstrategy">
  227. <view class="power_yesterday11">{{date}}</view>
  228. <view class="power_yesterday11">{{$t('powerstation.listTitle')}}:{{weekdaytype==1?$t('hostdetails.weekdays'):$t('hostdetails.weekends')}}</view>
  229. </view>
  230. </view>
  231. <view class="power_strategy">{{$t('powerstation.detailTitle')}}<image class="energy_jumpto" src="/static/jumpto.png" mode=""></image></view>
  232. </view>
  233. </view>
  234. </view>
  235. <view class="power_box2">
  236. <view class="powerstation">
  237. <view class="power_yesterdaystrategy">
  238. <view class="strategybox">
  239. <image class="strategy" src="/static/startstop.png" mode=""></image>
  240. <view class="power_iconstrategy">
  241. <view class="power_yesterday11">{{$t('powerstation.powerControl')}}</view>
  242. <!-- <view class="power_yesterday1">2024-09-13</view> -->
  243. </view>
  244. </view>
  245. <l-switch v-model="defaultValue" disabled="false" :placeholder="[$t('hostdetails.on'), $t('hostdetails.off')]" dotSize="14px" height="22px" width="32px"></l-switch>
  246. <!-- <view class="power_strategy1" @click="toggle('center')">开启<image class="energy_jumpto" src="/static/jumpto.png" mode=""></image></view>
  247. <view class="power_strategy2" @click="toggle('center')">停止<image class="energy_jumpto" src="/static/jumpto.png" mode=""></image></view> -->
  248. </view>
  249. </view>
  250. </view>
  251. <!-- 普通弹窗-->
  252. <uni-popup ref="popupRef" background-color="#fff" @change="change" borderRadius="10rpx">
  253. <view class="popup-content" :class="{ 'popup-height': devicetype === 'left' || devicetype === 'right' }">
  254. <view class="popuptext">
  255. 是否开启?
  256. </view>
  257. <view class="popupbutton">
  258. <button class="cancel-button" size="mini" @click="handleCancel">取消</button>
  259. <button class="confirm-button" @click="handleConfirm">确认</button>
  260. </view>
  261. </view>
  262. </uni-popup>
  263. </view>
  264. </template>
  265. <!-- -->
  266. <script setup>
  267. import {
  268. onMounted,
  269. ref
  270. } from 'vue';
  271. import topTabbar from '@/components/top-tabbar.vue';
  272. import KDatePicker from '../../components/k-date-picker/KDatePicker.vue';
  273. import { formatAmount,formatAmountunit,Accumulateddischarge,Accumulateddischargeunit } from '@/utils/format.js'; // 引入格式化函数
  274. import request from '@/utils/request';
  275. import {
  276. getMonthRange,
  277. getMonth
  278. } from '@/utils/date.js';
  279. import { onLoad,onShow,onHide,onUnload } from '@dcloudio/uni-app';
  280. const deviceid = ref()
  281. const brightcalendar = ref(1);
  282. const date = ref()
  283. onLoad((options) => {
  284. console.log('页面加载,参数为:', options);
  285. if (options) {
  286. uni.setNavigationBarTitle({
  287. title: options.stationName||'电站',
  288. });
  289. deviceid.value = options.id
  290. // options.date
  291. }
  292. });
  293. const interval = ref(null)
  294. onHide(() => {
  295. // 页面隐藏时也可以选择清理定时器
  296. if (interval.value) {
  297. clearInterval(interval.value);
  298. interval.value = null
  299. }
  300. });
  301. onUnload(() => {
  302. // 页面隐藏时也可以选择清理定时器
  303. if (interval.value) {
  304. clearInterval(interval.value);
  305. interval.value = null
  306. }
  307. });
  308. onShow(() => {
  309. // 页面再次显示时重新启动定时器
  310. if (!interval.value) {
  311. setIntervalDemo();
  312. }
  313. });
  314. const setIntervalDemo =() => {
  315. interval.value = setInterval(() => {
  316. getoverview(); // 首页收益充电
  317. getmuitiStationdata(); // 并网点接口
  318. }, 10000)
  319. }
  320. onMounted(() => {
  321. const monthRange = getMonthRange();
  322. date.value = monthRange.firstDay.substring(0, 7);
  323. getoverview();
  324. getmuitiStationdata(); // 电站接口
  325. getelectricity(); // 充放电统计图
  326. operationplan();
  327. });
  328. const target = ref(0)
  329. const modelVale = ref(0)
  330. const devicedata = ref({})
  331. const getoverview = async () => {
  332. console.log(deviceid.value);
  333. try {
  334. const response = await request({
  335. url: `/muitiStation/${deviceid.value}/overw`,
  336. method: 'POST',
  337. header: {
  338. 'Content-Type': 'application/x-www-form-urlencoded'
  339. },
  340. });
  341. devicedata.value = response.data
  342. target.value = response.data.soc
  343. } catch (error) {
  344. console.error('登录失败:', error);
  345. }
  346. }
  347. // 并网点数量
  348. const muitiStationdata = ref()
  349. const onlineStatus = ref()
  350. const getmuitiStationdata = async () => {
  351. try {
  352. const response = await request({
  353. url: '/connectionapp/gridconnection',
  354. method: 'get',
  355. header: {
  356. 'Content-Type': 'application/x-www-form-urlencoded'
  357. },
  358. data: {
  359. powerId:deviceid.value
  360. }
  361. });
  362. // console.log(response);
  363. muitiStationdata.value = response.data
  364. } catch (error) {
  365. console.error('登录失败:', error);
  366. }
  367. };
  368. // 图表数据
  369. const chartData = ref({});
  370. const opts = ref({
  371. enableScroll: true, //开启滚动条,X轴配置里需要配置itemCount单屏幕数据点数量
  372. color: ["#B2D5CB"],
  373. padding: [15, 0, 0, 0],
  374. backgroundColor: "#B2D5CB",
  375. legend: {},
  376. xAxis: {
  377. disableGrid: true,
  378. itemCount: 5, //单屏数据密度即图表可视区域内显示的X轴数据点数量,仅在启用enableScroll时有效
  379. scrollShow: false, //是否显示滚动条,配合拖拽滚动使用(即仅在启用【基本配置】的 enableScroll 时有效)
  380. },
  381. yAxis: {
  382. gridType: "dash",
  383. dashLength: 2,
  384. },
  385. extra: {
  386. line: {
  387. type: "straight",
  388. width: 2,
  389. activeType: "hollow",
  390. },
  391. column: {
  392. barBorderRadius: [4, 4, 0, 0],
  393. },
  394. }
  395. })
  396. const params = ref();
  397. // 多站电量
  398. const getelectricity = async () => {
  399. try {
  400. const response = await request({
  401. url: '/api/va/hisdata/hour/datas',
  402. method: 'GET',
  403. header: {
  404. 'Content-Type': 'application/x-www-form-urlencoded'
  405. },
  406. data:{
  407. page:1,
  408. rows:100,
  409. starttime:date.value,
  410. filed:filed.value,
  411. filter:filter.value,
  412. uuid:deviceid.value
  413. }
  414. });
  415. let arr1 = [];
  416. let arr2 = [];
  417. response.data.list.forEach((item, index) => {
  418. if (brightcalendar.value == 1) {
  419. const ymdSubstring = item.recordtime.slice(3, 5);
  420. arr1.push(ymdSubstring);
  421. if(tabIndex.value==0){
  422. arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
  423. }else{
  424. arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/10000).toFixed(2));
  425. }
  426. } else if(brightcalendar.value == 2) {
  427. const ymdSubstring = item.recordtime;
  428. arr1.push(ymdSubstring);
  429. if(tabIndex.value==0){
  430. arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
  431. }else{
  432. arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/10000).toFixed(2));
  433. }
  434. }else if(brightcalendar.value == 3){
  435. const ymdSubstring = item.recordtime;
  436. arr1.push(ymdSubstring);
  437. if(tabIndex.value==0){
  438. arr2.push((item['5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta']/1000).toFixed(2));
  439. }else{
  440. arr2.push((item['a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta']/10000).toFixed(2));
  441. }
  442. }
  443. })
  444. setTimeout(() => {
  445. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  446. let res = {}
  447. if(tabIndex.value==0){
  448. res = {
  449. categories: arr1,
  450. series: [{
  451. name: "电量",
  452. data: arr2
  453. },
  454. ]
  455. };
  456. }else{
  457. res = {
  458. categories: arr1,
  459. series: [{
  460. name: "收益",
  461. data: arr2
  462. },
  463. ]
  464. };
  465. }
  466. chartData.value = JSON.parse(JSON.stringify(res));
  467. }, 500);
  468. } catch (error) {
  469. console.error('登录失败:', error);
  470. };
  471. };
  472. // 选中标签的索引
  473. const tabIndex = ref(0);
  474. // 导航栏标签列表
  475. const tabBars = ref([{
  476. name: '电量',
  477. id: 0
  478. },
  479. {
  480. name: '收益',
  481. id: 1
  482. },
  483. ]);
  484. // 切换标签
  485. const toggleTab = (index) => {
  486. tabIndex.value = index;
  487. if(tabIndex.value==0){
  488. filter.value = '5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta,469dc1cc-e5ad-492f-a350-f7bc473d55ee_delta'
  489. }else{
  490. filter.value = 'a0acf8cf-7d12-49af-97d9-1a2e630c4bfe_delta'
  491. }
  492. getelectricity();
  493. };
  494. const show = ref(false)
  495. const open = () => {
  496. show.value = true;
  497. toggleTab(tabIndex.value);
  498. };
  499. const isDisabled = (value) => {
  500. return value > new Date().getTime()
  501. }
  502. const handleChange = async (value) => {
  503. // 示例用法
  504. try {
  505. date.value = value
  506. show.value = false
  507. getelectricity();
  508. } catch (error) {
  509. console.error(error.message);
  510. }
  511. };
  512. const selectiondata = ref('month');
  513. const formatter = ref('YYYY-MM');
  514. const filed = ref('day');
  515. const filter = ref('5c465aaa-b65e-463f-a9ae-a338a630a4c1_delta,469dc1cc-e5ad-492f-a350-f7bc473d55ee_delta');
  516. const ondatecalendar = (e) => {
  517. console.log(e);
  518. brightcalendar.value = e
  519. if (e == 1) {
  520. const monthRange = getMonthRange();
  521. date.value = monthRange.firstDay.substring(0, 7);
  522. filed.value = 'day'
  523. selectiondata.value = 'month'
  524. formatter.value = 'YYYY-MM'
  525. } else if (e == 2) {
  526. const Year = new Date().getFullYear(); // 获取当前年份
  527. date.value = Year
  528. selectiondata.value = 'year'
  529. formatter.value = 'YYYY'
  530. filed.value = 'Month'
  531. } else if (e == 3) {
  532. filed.value = 'year'
  533. }
  534. getelectricity();
  535. }
  536. const Dateselection = (e) => {
  537. console.log(e);
  538. open();
  539. }
  540. // 计划详情
  541. const ondevices = () => {
  542. if(weekdaytype.value==1){
  543. uni.navigateTo({
  544. url: `/pages/strategy/index?id=${muitiStationdata.value[0].conscolidationId}&type=1`
  545. })
  546. }else{
  547. uni.navigateTo({
  548. url: `/pages/strategy/index?id=${muitiStationdata.value[0].conscolidationId}&type=2`
  549. })
  550. }
  551. // uni.navigateTo({
  552. // url: `/pages/strategy/index?id=${optionsinfo.value.id}&type=1`
  553. // })
  554. }
  555. const onhost = (item) => {
  556. console.log(item);
  557. uni.navigateTo({
  558. url: `/pages/hostdetails/index?id=${item.conscolidationId}&name=${item.name}`
  559. })
  560. }
  561. const weekdaytype =ref(1);
  562. // 工作日 休息日
  563. const weekday = (e) => {
  564. // console.log(e);
  565. weekdaytype.value =e
  566. }
  567. // 日历
  568. const oncalendar = (e) => {
  569. // console.log(e);
  570. let month = 0
  571. if(e.month*1<10){
  572. month = '0' + e.month
  573. }else{
  574. month = e.month
  575. }
  576. date.value = e.year +'-'+month
  577. operationplan();
  578. }
  579. // 运行计划
  580. const selecteddata = ref()
  581. const operationplan = async () => {
  582. console.log(deviceid.value);
  583. try {
  584. const response = await request({
  585. url: `/connectionapp/plan`,
  586. method: 'get',
  587. header: {
  588. 'Content-Type': 'application/x-www-form-urlencoded'
  589. },
  590. data:{
  591. grid:deviceid.value,
  592. month:date.value
  593. }
  594. });
  595. // console.log(response);
  596. selecteddata.value = response.data
  597. } catch (error) {
  598. console.error('登录失败:', error);
  599. }
  600. }
  601. const defaultValue =ref(1)
  602. // 设备启停
  603. const devicetype =ref('center')
  604. const msgType= ref('success')
  605. const messageText=ref('这是一条成功提示')
  606. const value= ref('')
  607. const popupRef = ref(null)
  608. const toggle=(type)=> {
  609. console.log(type);
  610. devicetype.value = type
  611. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  612. if (popupRef.value) {
  613. popupRef.value.open(type);
  614. }
  615. };
  616. // 处理取消按钮点击事件
  617. const handleCancel=()=> {
  618. console.log('用户点击了取消');
  619. popupRef.value.close(); // 关闭弹出层
  620. };
  621. // 处理确认按钮点击事件
  622. const handleConfirm=()=> {
  623. console.log('用户点击了确认');
  624. popupRef.value.close(); // 关闭弹出层
  625. // 在这里添加确认后的逻辑
  626. };
  627. // popup 状态变化事件
  628. const change=(e)=> {
  629. console.log('弹出层状态变化:', e);
  630. }
  631. </script>
  632. <!-- 电压 温度 -->
  633. <style scoped>
  634. .uni-page {
  635. width: 100%;
  636. height: 100%;
  637. }
  638. .container {
  639. background: linear-gradient(to bottom, #007545 -50%, #f0f5f5 40%, #f0f5f5 100%);
  640. box-sizing: border-box;
  641. padding-bottom:1rpx;
  642. }
  643. .l-liquid {
  644. /* background-color: #007545; */
  645. border: 10rpx solid #007545;
  646. }
  647. .liquid_text {
  648. font-size: 38rpx;
  649. color: #fff;
  650. }
  651. .container_title {
  652. width: 100%;
  653. height: 400rpx;
  654. display: flex;
  655. justify-content: center;
  656. align-items: center;
  657. }
  658. .container_box {
  659. width: 100%;
  660. padding: 0rpx 20rpx;
  661. box-sizing: border-box;
  662. }
  663. .container_box1{
  664. width: 100%;
  665. padding: 0rpx 20rpx;
  666. box-sizing: border-box;
  667. margin-top: 20rpx;
  668. }
  669. .container_parameter {
  670. width: 100%;
  671. height: 500rpx;
  672. background-color: #ffffff;
  673. border-radius: 10rpx;
  674. }
  675. .income_box {
  676. width: 100%;
  677. background-color: #ffffff;
  678. box-sizing: border-box;
  679. border-radius: 16rpx;
  680. }
  681. .income {
  682. width: 100%;
  683. height: 200rpx;
  684. display: flex;
  685. align-items: center;
  686. justify-content: space-around;
  687. }
  688. .income_image {
  689. width: 68rpx;
  690. height: 68rpx;
  691. margin-bottom: 6rpx;
  692. }
  693. .income_yesterday,
  694. .income_moon,
  695. .income_tired {
  696. flex: 1;
  697. display: flex;
  698. flex-direction: column;
  699. align-items: center;
  700. justify-content: space-around;
  701. }
  702. .income_yesterday1,
  703. .income_moon1,
  704. .income_tired1 {
  705. font-size: 24rpx;
  706. color: #999999;
  707. }
  708. .income_yesterday2,
  709. .income_moon2,
  710. .income_tired2 {
  711. font-size: 28rpx;
  712. font-weight: 600;
  713. }
  714. .income_unit{
  715. font-size: 20rpx;
  716. }
  717. .qiun_title {
  718. height: 12%;
  719. font-size: 28rpx;
  720. margin-left: 20rpx;
  721. }
  722. .power_box {
  723. width: 100%;
  724. padding: 0rpx 20rpx;
  725. margin-bottom: 30rpx;
  726. box-sizing: border-box;
  727. }
  728. .power_box1 {
  729. width: 100%;
  730. padding: 0rpx 20rpx;
  731. box-sizing: border-box;
  732. }
  733. .power_box2{
  734. width: 100%;
  735. padding: 0rpx 20rpx;
  736. margin-bottom: 30rpx;
  737. box-sizing: border-box;
  738. }
  739. .powerstation {
  740. width: 100%;
  741. display: flex;
  742. align-items: center;
  743. justify-content: space-between;
  744. }
  745. .power_yesterday,
  746. .power_moon,
  747. .power_tired {
  748. width: 31%;
  749. padding: 20rpx 0rpx;
  750. display: flex;
  751. flex-direction: column;
  752. align-items: center;
  753. justify-content: center;
  754. border-radius: 10rpx;
  755. background-color: #ffffff;
  756. }
  757. .power_yesterday image,
  758. .power_moon image,
  759. .power_tired image {
  760. width: 40rpx;
  761. height: 40rpx;
  762. }
  763. .power_yesterday image {
  764. /* background-color: #007544; */
  765. }
  766. .power_moon image {
  767. /* background-color: #3774f3; */
  768. }
  769. .power_tired image {
  770. /* background-color: #b3cef9; */
  771. }
  772. .power_icon{
  773. display: flex;
  774. }
  775. .power_yesterday1,
  776. .power_moon1,
  777. .power_tired1 {
  778. font-size: 26rpx;
  779. margin-left:10rpx;
  780. color: #999;
  781. }
  782. .power_yesterday11{
  783. font-size: 26rpx;
  784. margin-left:10rpx;
  785. color: #222;
  786. }
  787. .power_moon2,.power_yesterday2,.power_tired2{
  788. margin-top:10rpx;
  789. font-size: 28rpx;
  790. font-weight: 600;
  791. }
  792. .toptabbar {
  793. width: 100%;
  794. height: 80rpx;
  795. margin-top: 20px;
  796. padding: 10rpx 20rpx;
  797. box-sizing: border-box;
  798. }
  799. /deep/ .uni-scroll-view-content {
  800. display: flex;
  801. justify-content: center;
  802. }
  803. .datecalendar {
  804. display: flex;
  805. justify-content: space-between;
  806. padding: 0rpx 24rpx;
  807. margin-top: 60rpx;
  808. }
  809. .datecalendar_1 {
  810. width: 320rpx;
  811. height: 60rpx;
  812. display: flex;
  813. font-size: 28rpx;
  814. border: 0.2rpx solid #999999;
  815. border-radius: 40rpx;
  816. overflow: overlay;
  817. }
  818. .datecalendar_1sun {
  819. flex: 1;
  820. display: flex;
  821. align-items: center;
  822. justify-content: center;
  823. color: #222222;
  824. background-color: #ffffff;
  825. }
  826. .datecalendar_1moon {
  827. flex: 1;
  828. display: flex;
  829. align-items: center;
  830. justify-content: center;
  831. background-color: #ffffff;
  832. border-left: 0.2rpx solid #999999;
  833. border-right: 0.2rpx solid #999999;
  834. }
  835. .datecalendar_1year {
  836. flex: 1;
  837. display: flex;
  838. align-items: center;
  839. justify-content: center;
  840. background-color: #ffffff;
  841. }
  842. .datecalendar_2 {
  843. width: 180rpx;
  844. height: 60rpx;
  845. display: flex;
  846. align-items: center;
  847. justify-content: center;
  848. font-size: 28rpx;
  849. border: 0.2rpx solid #999999;
  850. border-radius: 40rpx;
  851. }
  852. .qiun_data {
  853. width: 100%;
  854. height: 600rpx;
  855. padding: 16rpx;
  856. overflow: auto;
  857. box-sizing: border-box;
  858. }
  859. .qiun_title {
  860. height: 12%;
  861. font-size: 28rpx;
  862. margin-left: 20rpx;
  863. }
  864. .energy {
  865. width: 100%;
  866. padding: 20rpx;
  867. box-sizing: border-box;
  868. }
  869. .energy_hostbox{
  870. padding: 20rpx;
  871. box-sizing: border-box;
  872. }
  873. .energy_host {
  874. width: 100%;
  875. padding: 20rpx;
  876. box-sizing: border-box;
  877. background-color: #ffffff;
  878. margin-bottom: 10rpx;
  879. border-radius: 10rpx;
  880. }
  881. .energy_title {
  882. width: 100%;
  883. }
  884. .energy_box {
  885. width: 100%;
  886. background-color: #B2D5CB;
  887. border-radius: 10rpx;
  888. margin-top: 20rpx;
  889. padding: 30rpx 16rpx;
  890. display: flex;
  891. align-items: center;
  892. box-sizing: border-box;
  893. }
  894. .energy_boximage {
  895. width: 88rpx;
  896. height: 88rpx;
  897. }
  898. .energy_boxtitle {
  899. flex: 1;
  900. display: flex;
  901. flex-direction: column;
  902. margin-left: 20rpx;
  903. }
  904. .energy_boxtitle1 {
  905. font-size: 28rpx;
  906. margin-top: 6rpx;
  907. font-weight: 600;
  908. }
  909. .energy_boxtitle2 {
  910. font-size: 26rpx;
  911. margin-top: 4rpx;
  912. }
  913. .energy_right {
  914. display: flex;
  915. align-items: center;
  916. }
  917. .energy_boxright {
  918. display: flex;
  919. flex-direction: column;
  920. align-items: center;
  921. justify-content: center;
  922. }
  923. .energy_boxright1 {
  924. padding: 6rpx 40rpx;
  925. font-size: 26rpx;
  926. border-radius: 50rpx;
  927. display: flex;
  928. align-items: center;
  929. justify-content: center;
  930. background-color: rgba(0, 116, 84, .3);
  931. color: #fff;
  932. }
  933. .energy_boxright2 {
  934. font-size: 24rpx;
  935. margin-top: 10rpx;
  936. }
  937. .energy_jumpto {
  938. width: 30rpx;
  939. height: 30rpx;
  940. margin-left: 8rpx;
  941. }
  942. .energy_calendar{
  943. margin-top:30rpx;
  944. border-radius: 10rpx;
  945. overflow: hidden;
  946. }
  947. .incomeweekday{
  948. width: 100%;
  949. height: 100rpx;
  950. display: flex;
  951. align-items: center;
  952. /* justify-content: space-around; */
  953. }
  954. .weekday{
  955. width: 20rpx;
  956. height: 20rpx;
  957. border-radius: 50rpx;
  958. background-color: red;
  959. margin-right: 10rpx;
  960. }
  961. .restday1{
  962. display: flex;
  963. align-items: center;
  964. margin-left: 40rpx;
  965. padding: 10rpx;
  966. border-radius: 100rpx;
  967. box-sizing: border-box;
  968. }
  969. .weekday1{
  970. display: flex;
  971. align-items: center;
  972. margin-left: 20rpx;
  973. padding: 10rpx;
  974. border-radius: 100rpx;
  975. box-sizing: border-box;
  976. }
  977. .restday{
  978. width: 20rpx;
  979. height: 20rpx;
  980. border-radius: 50rpx;
  981. background-color: #007545;
  982. margin-right: 10rpx;
  983. }
  984. .power_yesterdaystrategy{
  985. width: 100%;
  986. padding: 20rpx 20rpx;
  987. display: flex;
  988. align-items: center;
  989. justify-content: space-between;
  990. border-radius: 10rpx;
  991. background-color: #ffffff;
  992. margin-top: 20rpx;
  993. overflow: hidden;
  994. box-sizing: border-box;
  995. }
  996. .power_iconstrategy{
  997. flex-direction: column;
  998. }
  999. .strategy{
  1000. width: 60rpx;
  1001. height: 60rpx;
  1002. }
  1003. .strategycalendar{
  1004. width: 60rpx;
  1005. height: 60rpx;
  1006. padding: 6rpx;
  1007. box-sizing: border-box;
  1008. }
  1009. .strategybox{
  1010. display: flex;
  1011. align-items: center;
  1012. }
  1013. .power_strategy{
  1014. font-size: 24rpx;
  1015. color: #ccc;
  1016. display: flex;
  1017. align-items: center;
  1018. }
  1019. .power_strategy1{
  1020. font-size: 24rpx;
  1021. color: #999999;
  1022. display: flex;
  1023. align-items: center;
  1024. }
  1025. .power_strategy2{
  1026. font-size: 24rpx;
  1027. color: red;
  1028. display: flex;
  1029. align-items: center;
  1030. }
  1031. @mixin flex {
  1032. /* #ifndef APP-NVUE */
  1033. display: flex;
  1034. /* #endif */
  1035. flex-direction: row;
  1036. }
  1037. @mixin height {
  1038. /* #ifndef APP-NVUE */
  1039. height: 100%;
  1040. /* #endif */
  1041. /* #ifdef APP-NVUE */
  1042. flex: 1;
  1043. /* #endif */
  1044. }
  1045. .box {
  1046. @include flex;
  1047. }
  1048. .button {
  1049. @include flex;
  1050. align-items: center;
  1051. justify-content: center;
  1052. flex: 1;
  1053. height: 35px;
  1054. margin: 0 5px;
  1055. border-radius: 5px;
  1056. }
  1057. .example-body {
  1058. background-color: #fff;
  1059. padding: 10px 0;
  1060. }
  1061. .button-text {
  1062. color: #fff;
  1063. font-size: 12px;
  1064. }
  1065. .popup-content {
  1066. @include flex;
  1067. align-items: center;
  1068. justify-content: center;
  1069. padding: 15px;
  1070. background-color: #fff;
  1071. }
  1072. .popup-height {
  1073. @include height;
  1074. width: 400px;
  1075. }
  1076. .text {
  1077. font-size: 12px;
  1078. color: #333;
  1079. }
  1080. .popup-success {
  1081. color: #fff;
  1082. background-color: #e1f3d8;
  1083. }
  1084. .popup-warn {
  1085. color: #fff;
  1086. background-color: #faecd8;
  1087. }
  1088. .popup-error {
  1089. color: #fff;
  1090. background-color: #fde2e2;
  1091. }
  1092. .popup-info {
  1093. color: #fff;
  1094. background-color: #f2f6fc;
  1095. }
  1096. .success-text {
  1097. color: #09bb07;
  1098. }
  1099. .warn-text {
  1100. color: #e6a23c;
  1101. }
  1102. .error-text {
  1103. color: #f56c6c;
  1104. }
  1105. .info-text {
  1106. color: #909399;
  1107. }
  1108. .dialog,
  1109. .share {
  1110. /* #ifndef APP-NVUE */
  1111. display: flex;
  1112. /* #endif */
  1113. flex-direction: column;
  1114. }
  1115. .dialog-box {
  1116. padding: 10px;
  1117. }
  1118. .dialog .button,
  1119. .share .button {
  1120. /* #ifndef APP-NVUE */
  1121. width: 100%;
  1122. /* #endif */
  1123. margin: 0;
  1124. margin-top: 10px;
  1125. padding: 3px 0;
  1126. flex: 1;
  1127. }
  1128. .dialog-text {
  1129. font-size: 14px;
  1130. color: #333;
  1131. }
  1132. /* 弹出层内容样式 */
  1133. .popup-content {
  1134. padding: 20px;
  1135. text-align: center;
  1136. border-radius: 20rpx;
  1137. }
  1138. /* 文本样式 */
  1139. .popuptext {
  1140. font-size: 26rpx;
  1141. color: #333;
  1142. margin-bottom: 20rpx;
  1143. }
  1144. /* 取消按钮样式 */
  1145. .cancel-button {
  1146. width: 120rpx;
  1147. height: 60rpx;
  1148. margin-top: 10rpx;
  1149. font-size: 24rpx;
  1150. background-color: #f0f0f0;
  1151. color: #333;
  1152. margin-right: 40rpx;
  1153. }
  1154. /* 确认按钮样式 */
  1155. .confirm-button {
  1156. width: 120rpx;
  1157. height: 60rpx;
  1158. margin-top: 10rpx;
  1159. font-size: 24rpx;
  1160. background-color: #007aff;
  1161. color: #fff;
  1162. }
  1163. /* 根据设备类型调整高度 */
  1164. .popup-height {
  1165. height: 200px;
  1166. }
  1167. .popupbutton{
  1168. display: flex;
  1169. }
  1170. </style>