MatrixMonitor.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182
  1. <template>
  2. <view>
  3. <!--导航栏-->
  4. <cu-custom bgColor="bg-blacks" :isBack="false">
  5. <block slot="right">
  6. <image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-left: 2%;" @tap="openDrawer"></image>
  7. </block>
  8. <block slot="right">
  9. <view class="icon cuIcon-notice text-white" v-if="badge != 0" style="margin-left: -70%;">
  10. <view class="cu-tag looknumber" style="margin-top: -2%;">
  11. <block v-if="badge != 1">{{ badge > 99 ? '99+' : badge }}</block>
  12. </view>
  13. </view>
  14. </block>
  15. <block slot="right">
  16. </block>
  17. <block slot="content">{{address}}</block>
  18. <block slot="right">
  19. <view class="plus" @tap="showModal" data-target="viewModal">+</view>
  20. </block>
  21. </cu-custom>
  22. <!-- 抽屉组件 -->
  23. <div v-if="conflict==false">
  24. <drawer ref="drawer"></drawer>
  25. </div>
  26. <div class="plusDrawer" @tap="closePlusDrawer">
  27. <plusDrawer ref="plusDrawer"></plusDrawer>
  28. </div>
  29. <scroll-view scroll-y class="DrawerPage" :class="modalName == 'viewModal' ? 'show' : ''">
  30. <view class="windStationNameAndChoice">
  31. <view class="windStationName">{{ windStationName }}</view>
  32. <view class="windStationChoice"><a @click="showCenterVisible = true">其他ㅤ〉</a></view>
  33. <!-- @tap="showModal" data-target="DialogModal1" -->
  34. <!-- @tap="changeModalStaus" @click="showCenterVisible = true" -->
  35. </view>
  36. <!-- 选择风场弹窗 -->
  37. <!-- <view class="cu-modal" :class="modalName=='DialogModal1'?'show':''">
  38. <view class="cu-dialog">
  39. <view class="cu-bar bg-gradual-sisBlack justify-end">
  40. <view class="content" style="text-align: left;">选择您想查看的风场</view>
  41. <view class="action" @tap="hideModal">
  42. <text class="cuIcon-close text-white"></text>
  43. </view>
  44. </view>
  45. <view class="cu-bar bg-gray justify-end">
  46. <view class="action" style="width: 100%;margin: 0px;">
  47. <view class="windStationList" :style="{ 'height': windStationListHeight}">
  48. <view class="windStationItemContainer" v-for="(item,index) in windStation" :key="index" :class="[choiceIndex==index?'windStationItemContainerBlack':'windStationItemContainer']" >
  49. <view class="windStationItem" @tap="choiceWindStation(item,index)">{{item}}</view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view> -->
  56. <s-popup custom-class="center-popup" position="center" v-model="showCenterVisible">
  57. <view class="s-popup-wrapper" :style="{'height': spopupWrapperHeight}">
  58. <view class="s-popup-title">
  59. <view class="s-popup-word">选择您想查看的风场</view>
  60. <view class="s-popup-cha"><a @tap="showCenterVisible = false">×</a></view>
  61. </view>
  62. <view class="windStationList" :style="{ 'height': windStationListHeight}">
  63. <view class="windStationItemContainer" v-for="(item,index) in windFielddata" :key="index" :class="[choiceIndex==index?'windStationItemContainerBlack':'windStationItemContainer']">
  64. <view class="windStationItem" @tap="choiceWindStation(item,index)">{{item.name}}</view>
  65. </view>
  66. </view>
  67. </view>
  68. </s-popup>
  69. <!-- 风机状态卡片 -->
  70. <view class="windMotorStatusContainer">
  71. <view class="windMotorStatusCardJieRu" :class="[clickFlag == 'jieRu' ? 'windMotorStatusCardJieRuRed' : 'windMotorStatusCardJieRu']"
  72. @tap="clickWindMotorStatusCard('jieRu')">
  73. <view class="windMotorStatusCardIcon">
  74. <image src="../../static/picture/003.png" style="width: 25px;height: 25px;"></image>
  75. </view>
  76. 接入 {{ jieRu }}
  77. </view>
  78. <view class="windMotorStatusCardYunXing" :class="[clickFlag == 'yunXing' ? 'windMotorStatusCardYunXingRed' : 'windMotorStatusCardYunXing']"
  79. @tap="clickWindMotorStatusCard('yunXing')">
  80. <view class="windMotorStatusCardIcon">
  81. <image src="../../static/picture/001.png" style="width: 25px;height: 25px;"></image>
  82. </view>
  83. 运行 {{ yunXing }}
  84. </view>
  85. <view class="windMotorStatusCardDaiJi" :class="[clickFlag == 'daiJi' ? 'windMotorStatusCardDaiJiRed' : 'windMotorStatusCardDaiJi']"
  86. @tap="clickWindMotorStatusCard('daiJi')">
  87. <view class="windMotorStatusCardIcon">
  88. <image src="../../static/picture/000.png" style="width: 25px;height: 25px;"></image>
  89. </view>
  90. 待机 {{ daiJi }}
  91. </view>
  92. <view class="windMotorStatusCardJianXiu" :class="[clickFlag == 'jianXiu' ? 'windMotorStatusCardJianXiuRed' : 'windMotorStatusCardJianXiu']"
  93. @tap="clickWindMotorStatusCard('jianXiu')">
  94. <view class="windMotorStatusCardIcon">
  95. <image src="../../static/picture/004.png" style="width: 25px;height: 25px;"></image>
  96. </view>
  97. 检修 {{ jianXiu }}
  98. </view>
  99. <view class="windMotorStatusCardGuZhang" :class="[clickFlag == 'guZhang' ? 'windMotorStatusCardGuZhangRed' : 'windMotorStatusCardGuZhang']"
  100. @tap="clickWindMotorStatusCard('guZhang')">
  101. <view class="windMotorStatusCardIcon">
  102. <image src="../../static/picture/002.png" style="width: 25px;height: 25px;"></image>
  103. </view>
  104. 故障 {{ guZhang }}
  105. </view>
  106. <view class="windMotorStatusCardXianDian" :class="[clickFlag == 'xianDian' ? 'windMotorStatusCardXianDianRed' : 'windMotorStatusCardXianDian']"
  107. @tap="clickWindMotorStatusCard('xianDian')">
  108. <view class="windMotorStatusCardIcon">
  109. <image src="../../static/picture/005.png" style="width: 25px;height: 25px;"></image>
  110. </view>
  111. 限电 {{ xianDian }}
  112. </view>
  113. <view class="windMotorStatusCardShouLei" :class="[clickFlag == 'shouLei' ? 'windMotorStatusCardShouLeiRed' : 'windMotorStatusCardShouLei']"
  114. @tap="clickWindMotorStatusCard('shouLei')">
  115. <view class="windMotorStatusCardIcon">
  116. <image src="../../static/picture/007.png" style="width: 25px;height: 25px;"></image>
  117. </view>
  118. 受累 {{ shouLei }}
  119. </view>
  120. <view class="windMotorStatusCardLiXian" :class="[clickFlag == 'liXian' ? 'windMotorStatusCardLiXianRed' : 'windMotorStatusCardLiXian']"
  121. @tap="clickWindMotorStatusCard('liXian')">
  122. <view class="windMotorStatusCardIcon">
  123. <image src="../../static/picture/006.png" style="width: 25px;height: 25px;"></image>
  124. </view>
  125. 离线 {{ liXian }}
  126. </view>
  127. </view>
  128. <!-- 轮播圆点-->
  129. <swiper class="card-swiper" :class="dotStyle ? 'square-dot' : 'round-dot'" :indicator-dots="true" :circular="true"
  130. :autoplay="false" interval="5000" duration="500" @change="cardSwiper" indicator-color="#8799a3"
  131. indicator-active-color="#F14E51" :current="cardCur">
  132. <swiper-item v-for="(item, index) in windFielddata" :key="index" :class="cardCur == index ? 'cur' : ''">
  133. <view class="swiper-item"></view>
  134. </swiper-item>
  135. </swiper>
  136. <!-- 轮播卡片 -->
  137. <view class="windMotorMatrixContainer" :style="{ height: windMotorMatrixContainerHeight }">
  138. <swiper id="swiper1" class="screen-swiper" :class="dotStyle ? 'square-dot' : 'round-dot'" :indicator-dots="false"
  139. :circular="false" :autoplay="false" interval="5000" duration="500" :style="{ height: windMotorMatrixContainerHeight }"
  140. :current="cardCur" @change="cardSwiper">
  141. <swiper-item v-for="(item, index) in windFielddata" :key="index">
  142. <scroll-view scroll-y scroll-with-animation class="scrollList" :style="{ height: windMotorMatrixContainerHeight }">
  143. <view class="windMotorMatrixList" :style="{ height: windMotorMatrixListHeight }">
  144. <view class="windMotorMatrixDetail" v-for="(item2, index2) in windMotorMatrixDetail" :key="index2" :style="{ 'background-color': detailBackgroundColor[index2] }">
  145. <view class="windMotorMatrixDetailIcon">
  146. <image :src="'../../static/picture/' + item2.icon + '.png'" style="width: 25px;height: 25px;"></image>
  147. </view>
  148. <view class="windMotorMatrixDetailSpeed">{{ item2.speed }}m/s</view>
  149. <view class="windMotorMatrixDetailId">{{ item2.id }}</view>
  150. <view class="windMotorMatrixDetailPower">{{ item2.power }}kw</view>
  151. </view>
  152. </view>
  153. </scroll-view>
  154. </swiper-item>
  155. </swiper>
  156. </view>
  157. <!-- 切换轮播卡片的提示框 -->
  158. <view class="cu-modal" :class="modalName == 'Modal' ? 'show' : ''">
  159. <view class="cu-dialog">
  160. <view class="padding-xl bg-black">{{ modalWindStationName }}</view>
  161. </view>
  162. </view>
  163. </scroll-view>
  164. <view class="DrawerClose" :class="modalName == 'viewModal' ? 'show' : ''" @tap="hideModal"><text class="cuIcon-pullright"></text></view>
  165. </view>
  166. </template>
  167. <script>
  168. import drawer from '../../components/drawer/threeLineDrawer.vue';
  169. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  170. import sPopup from '@/s-popup';
  171. export default {
  172. components: {
  173. drawer: drawer,
  174. plusDrawer: plusDrawer,
  175. sPopup: sPopup
  176. },
  177. data: function() {
  178. return {
  179. conflict: false,
  180. address: '',
  181. userid: '',
  182. permissionsInformation: [],
  183. badge: 22,
  184. drawerList: [],
  185. plusDrawerList: [],
  186. windStationName: '',
  187. modalWindStationName: '',
  188. CustomBar: this.CustomBar,
  189. modalName: null,
  190. showCenterVisible: false,
  191. windStation: [],
  192. choiceIndex: -1,
  193. clickFlag: 'jieRu',
  194. cardCur: 0,
  195. dotStyle: false,
  196. windowWidth: '',
  197. leftNavigationtitle: '监视功能分组',
  198. windowHeight: '',
  199. spopupWrapperHeight: "",
  200. windStationListHeight: '',
  201. windMotorMatrixContainerHeight: '',
  202. windMotorMatrixListHeight: '',
  203. detailBackgroundColor: [],
  204. windMotorMatrixDetailMaHuagShan: [],
  205. windMotorMatrixDetail: [],
  206. windMotorMatrixDetailJieAll: [],
  207. jieRu: 0,
  208. yunXing: 0,
  209. daiJi: 0,
  210. jianXiu: 0,
  211. guZhang: 0,
  212. xianDian: 0,
  213. shouLei: 0,
  214. liXian: 0,
  215. windFielddata: [],
  216. };
  217. },
  218. onReady: function() {
  219. this.choiceIndex = -1;
  220. this.cardCur = 0;
  221. this.getProjectcollection();
  222. },
  223. onShow: function() {
  224. this.address = this.dataprocessing.getWindPowerStationName();
  225. // this.FDC = this.dataprocessing.getWindPowerStationId();
  226. // this.windPowerStationId = this.dataprocessing.getWindPowerStationId();
  227. // this.viewUserid();
  228. // this.monitoringAuthority();
  229. //this.getProjectcollection();
  230. // this.getWindfarmconnectioninformation();
  231. },
  232. created: function() {
  233. this.viewUserid();
  234. this.monitoringAuthority();
  235. // this.getWindfarmconnectioninformation();
  236. this.address = this.dataprocessing.getWindPowerStationName();
  237. this.FDC = this.dataprocessing.getWindPowerStationId();
  238. this.windPowerStationId = this.dataprocessing.getWindPowerStationId();
  239. this.getProjectcollection();
  240. this.$nextTick(function() {
  241. //this.getWeatherDataToday();
  242. //this.getWeatherData7();
  243. });
  244. this.cWidth = uni.upx2px(2000);
  245. this.cHeight = uni.upx2px(350);
  246. this.cWidth40 = uni.upx2px(5000);
  247. this.cHeight40 = uni.upx2px(350);
  248. this.windStation = this.dataprocessing.getWindPowerStationNameByNames(this.address);
  249. //this.windStationName = this.windStation[0].replace('风电场', '');
  250. this.windStationListHeight = this.windStation.length * 50 + 40 + 'px';
  251. this.spopupWrapperHeight = this.windStation.length * 50 + 90 + 'px';
  252. this.windowWidth = uni.getSystemInfoSync().windowWidth;
  253. this.windowHeight = uni.getSystemInfoSync().windowHeight;
  254. this.windMotorMatrixContainerHeight = this.windowHeight - 300 + 'px';
  255. this.windMotorMatrixDetailAll = this.windMotorMatrixDetailMaHuagShan;
  256. this.windMotorMatrixDetail = this.windMotorMatrixDetailAll;
  257. this.windMotorMatrixListHeight =
  258. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + (Math.ceil(this.windMotorMatrixDetail.length /
  259. 4) * 1 - 0.5) + '%)';
  260. //this.getWindMotorStatusCard();
  261. //this.getBackgroundColor();
  262. },
  263. computed: {
  264. backStageIp: function() {
  265. return this.$store.state.wholeSituationBackStageIp;
  266. },
  267. backStagePort: function() {
  268. return this.$store.state.wholeSituationBackStagePort;
  269. },
  270. windpowerstationNameToId: function() {
  271. return this.$store.state.windpowerstationNameToId;
  272. }
  273. },
  274. methods: {
  275. viewUserid: function() {
  276. this.plusDrawerList = uni.getStorageSync('plusList');
  277. },
  278. monitoringAuthority: function() {
  279. this.drawerList = uni.getStorageSync('leftlist1');
  280. },
  281. getProjectcollection: function() {
  282. let _this = this;
  283. console.log(this.FDC)
  284. uni.request({
  285. url: 'http://' + this.backStageIp + ':' + this.backStagePort + '/GyeeMatrixController/GyeeMatrixList?keyid=' +
  286. this.FDC,
  287. data: {},
  288. method: 'GET',
  289. success: function(res) {
  290. _this.windFielddata = res.data.data
  291. console.log(_this.windFielddata);
  292. if (_this.windFielddata.length > 0) {
  293. _this.FDC = _this.windFielddata[0].id;
  294. _this.getWindfarmconnectioninformation();
  295. _this.windStationName = _this.windFielddata[0].name.replace('风电场', '');
  296. _this.modalWindStationName = _this.windFielddata[0].name.replace('风电场', '');
  297. }
  298. },
  299. fail: () => {
  300. _this.tips = '网络错误,小程序端请检查合法域名';
  301. },
  302. });
  303. },
  304. getWindfarmconnectioninformation: function() {
  305. let _this = this;
  306. if (undefined != _this.socketTask && null != _this.socketTask) {
  307. uni.closeSocket({
  308. url: _this.socketTask.webUrl,
  309. complete: function() {
  310. console.log('WebSocket 已关闭!');
  311. _this.execonnection();
  312. }
  313. });
  314. } else {
  315. _this.execonnection();
  316. }
  317. },
  318. execonnection: function() {
  319. let _this = this;
  320. if (undefined != _this.FDC && null != _this.FDC) {
  321. if (_this.FDC.substring(3, 6) == "FDC") {
  322. _this.socketTask = uni.connectSocket({
  323. // 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
  324. url: 'ws://' + this.backStageIp + ':' + this.backStagePort +
  325. '/websocket/pageNumber_4/functionNumber_2/wp_' + _this.FDC,
  326. success(data) {
  327. console.log('websocket连接成功');
  328. }
  329. });
  330. } else {
  331. console.log(_this.FDC)
  332. _this.socketTask = uni.connectSocket({
  333. // 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】
  334. url: 'ws://' + this.backStageIp + ':' + this.backStagePort +
  335. '/websocket/pageNumber_4/functionNumber_2/pj_' + _this.FDC,
  336. success(data) {
  337. console.log('websocket连接成功');
  338. }
  339. });
  340. }
  341. let windpowerstationid = uni.getStorageSync('windpowerstationName');
  342. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  343. this.socketTask.onOpen(res => {
  344. console.log('WebSocket连接正常打开中...!');
  345. _this.is_open_socket = true;
  346. // 注:只有连接正常打开中 ,才能正常收到消息
  347. _this.socketTask.onMessage(res => {
  348. //console.log("收到服务器内容:" + res.data);
  349. let json = JSON.parse(res.data);
  350. // _this.windMotorMatrixDetail = res.data;
  351. _this.windMotorMatrixDetail = json;
  352. _this.windMotorMatrixDetailAll = _this.windMotorMatrixDetail;
  353. _this.getBackgroundColor();
  354. _this.getWindMotorStatusCard();
  355. console.log(_this.windMotorMatrixDetail)
  356. });
  357. });
  358. }
  359. },
  360. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  361. uni.setStorageSync('windpowerstationName', windpowerstationName);
  362. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  363. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  364. //this.common.goback('/pages/index/Index');
  365. },
  366. getWindPowerStationNameToSessionStorage() {
  367. uni.getStorageSync('windpowerstationName');
  368. return uni.getStorageSync('windpowerstationName');
  369. },
  370. openDrawer: function() {
  371. if (this.$refs.drawer != undefined) {
  372. //this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList);
  373. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList, this.leftNavigationtitle);
  374. } else {
  375. }
  376. },
  377. openPlusDrawer(e) {
  378. this.conflict = false;
  379. this.modalName = e.currentTarget.dataset.target;
  380. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  381. this.FDC = this.dataprocessing.getWindPowerStationId();
  382. },
  383. closePlusDrawer() {
  384. this.conflict = false;
  385. this.modalName = null;
  386. this.$refs.plusDrawer.hideModal(this.modalName);
  387. },
  388. showModal(e) {
  389. this.conflict = true;
  390. this.modalName = e.currentTarget.dataset.target;
  391. this.viewUserid();
  392. this.monitoringAuthority();
  393. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  394. },
  395. hideModal() {
  396. this.conflict = false;
  397. this.modalName = null;
  398. this.$refs.plusDrawer.hideModal(this.modalName);
  399. },
  400. showCardModal(modalName) {
  401. this.modalName = modalName;
  402. },
  403. hideCardModal(e) {
  404. this.modalName = null;
  405. },
  406. choiceWindStation: function(item, index) {
  407. this.choiceIndex = index;
  408. this.windStationName = item.name.replace('风电场', '');
  409. this.modalWindStationName = item.name.replace('风电场', '');
  410. //this.address = item;
  411. //this.pushWindPowerStationNameToSessionStorage(item);
  412. let _this = this;
  413. setTimeout(function() {
  414. // _this.hideModal();
  415. _this.showCenterVisible = false;
  416. _this.choiceIndex = -1;
  417. _this.cardCur = index;
  418. }, 1000);
  419. this.FDC = item.id;
  420. this.getWindfarmconnectioninformation();
  421. this.getWindMotorStatusCard();
  422. this.getBackgroundColor();
  423. },
  424. getWindMotorStatusCard: function() {
  425. this.jieRu = 0;
  426. this.yunXing = 0;
  427. this.daiJi = 0;
  428. this.jianXiu = 0;
  429. this.guZhang = 0;
  430. this.xianDian = 0;
  431. this.shouLei = 0;
  432. this.liXian = 0;
  433. this.jieRu = this.windMotorMatrixDetailAll.length;
  434. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  435. if (this.windMotorMatrixDetailAll[i].icon == '001') {
  436. this.yunXing++;
  437. }
  438. if (this.windMotorMatrixDetailAll[i].icon == '000') {
  439. this.daiJi++;
  440. }
  441. if (this.windMotorMatrixDetailAll[i].icon == '004') {
  442. this.jianXiu++;
  443. }
  444. if (this.windMotorMatrixDetailAll[i].icon == '002') {
  445. this.guZhang++;
  446. }
  447. if (this.windMotorMatrixDetailAll[i].icon == '005') {
  448. this.xianDian++;
  449. }
  450. if (this.windMotorMatrixDetailAll[i].icon == '007') {
  451. this.shouLei++;
  452. }
  453. if (this.windMotorMatrixDetailAll[i].icon == '003') {
  454. this.liXian++;
  455. }
  456. }
  457. },
  458. clickWindMotorStatusCard: function(clickFlag) {
  459. this.clickFlag = clickFlag;
  460. if (clickFlag == 'jieRu') {
  461. this.windMotorMatrixDetail = this.windMotorMatrixDetailAll;
  462. this.getBackgroundColor();
  463. }
  464. if (clickFlag == 'yunXing') {
  465. this.windMotorMatrixDetail = [];
  466. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  467. if (this.windMotorMatrixDetailAll[i].icon == '001') {
  468. this.windMotorMatrixDetail.push(this.windMotorMatrixDetailAll[i]);
  469. }
  470. }
  471. this.windMotorMatrixListHeight =
  472. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + Math.ceil(this.windMotorMatrixDetail
  473. .length / 4) * 1 + '%)';
  474. this.getBackgroundColor();
  475. }
  476. if (clickFlag == 'daiJi') {
  477. this.windMotorMatrixDetail = [];
  478. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  479. if (this.windMotorMatrixDetailAll[i].icon == '000') {
  480. this.windMotorMatrixDetail.push(this.windMotorMatrixDetailAll[i]);
  481. }
  482. }
  483. this.windMotorMatrixListHeight =
  484. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + Math.ceil(this.windMotorMatrixDetail
  485. .length / 4) * 1 + '%)';
  486. this.getBackgroundColor();
  487. }
  488. if (clickFlag == 'jianXiu') {
  489. this.windMotorMatrixDetail = [];
  490. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  491. if (this.windMotorMatrixDetailAll[i].icon == '004') {
  492. this.windMotorMatrixDetail.push(this.windMotorMatrixDetailAll[i]);
  493. }
  494. }
  495. this.windMotorMatrixListHeight =
  496. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + Math.ceil(this.windMotorMatrixDetail
  497. .length / 4) * 1 + '%)';
  498. this.getBackgroundColor();
  499. }
  500. if (clickFlag == 'guZhang') {
  501. this.windMotorMatrixDetail = [];
  502. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  503. if (this.windMotorMatrixDetailAll[i].icon == '002') {
  504. this.windMotorMatrixDetail.push(this.windMotorMatrixDetailAll[i]);
  505. }
  506. }
  507. this.windMotorMatrixListHeight =
  508. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + Math.ceil(this.windMotorMatrixDetail
  509. .length / 4) * 1 + '%)';
  510. this.getBackgroundColor();
  511. }
  512. if (clickFlag == 'xianDian') {
  513. this.windMotorMatrixDetail = [];
  514. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  515. if (this.windMotorMatrixDetailAll[i].icon == '005') {
  516. this.windMotorMatrixDetail.push(this.windMotorMatrixDetailAll[i]);
  517. }
  518. }
  519. this.windMotorMatrixListHeight =
  520. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + Math.ceil(this.windMotorMatrixDetail
  521. .length / 4) * 1 + '%)';
  522. this.getBackgroundColor();
  523. }
  524. if (clickFlag == 'shouLei') {
  525. this.windMotorMatrixDetail = [];
  526. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  527. if (this.windMotorMatrixDetailAll[i].icon == '008') {
  528. this.windMotorMatrixDetail.push(this.windMotorMatrixDetailAll[i]);
  529. }
  530. }
  531. this.windMotorMatrixListHeight =
  532. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + Math.ceil(this.windMotorMatrixDetail
  533. .length / 4) * 1 + '%)';
  534. this.getBackgroundColor();
  535. }
  536. if (clickFlag == 'liXian') {
  537. this.windMotorMatrixDetail = [];
  538. for (let i = 0; i < this.windMotorMatrixDetailAll.length; i++) {
  539. if (this.windMotorMatrixDetailAll[i].icon == '006') {
  540. this.windMotorMatrixDetail.push(this.windMotorMatrixDetailAll[i]);
  541. }
  542. }
  543. this.windMotorMatrixListHeight =
  544. 'calc(' + Math.ceil(this.windMotorMatrixDetail.length / 4) * 40 + 'px + ' + Math.ceil(this.windMotorMatrixDetail
  545. .length / 4) * 1 + '%)';
  546. this.getBackgroundColor();
  547. }
  548. },
  549. cardSwiper(e) {
  550. let _this = this;
  551. this.cardCur = e.detail.current;
  552. for (let i = 0; i < this.windFielddata.length; i++) {
  553. if (this.cardCur == i) {
  554. if (this.windFielddata[i].name.search('风电场') != -1) {
  555. this.windStationName = this.windFielddata[i].name.replace('风电场', '');
  556. } else {
  557. this.windStationName = this.windFielddata[i].name;
  558. }
  559. this.FDC = this.windFielddata[i].id;
  560. this.modalWindStationName = this.windFielddata[i].name;
  561. this.windMotorMatrixDetailAll = this.windMotorMatrixDetailMaHuagShan;
  562. this.getWindfarmconnectioninformation();
  563. this.getWindMotorStatusCard();
  564. this.clickWindMotorStatusCard(this.clickFlag);
  565. this.getBackgroundColor();
  566. this.showCardModal('Modal');
  567. setTimeout(function() {
  568. _this.hideCardModal();
  569. }, 1000);
  570. }
  571. }
  572. },
  573. getBackgroundColor: function() {
  574. this.detailBackgroundColor = [];
  575. for (let i = 0; i < this.windMotorMatrixDetail.length; i++) {
  576. if (this.windMotorMatrixDetail[i].icon == '000') {
  577. this.detailBackgroundColor.push('#00E086');
  578. }
  579. if (this.windMotorMatrixDetail[i].icon == '001') {
  580. this.detailBackgroundColor.push('#2675F6');
  581. }
  582. if (this.windMotorMatrixDetail[i].icon == '002') {
  583. this.detailBackgroundColor.push('#F14E51');
  584. }
  585. if (this.windMotorMatrixDetail[i].icon == '004') {
  586. this.detailBackgroundColor.push('#FF6B3E');
  587. }
  588. if (this.windMotorMatrixDetail[i].icon == '003') {
  589. this.detailBackgroundColor.push('#686868');
  590. }
  591. if (this.windMotorMatrixDetail[i].icon == '007') {
  592. this.detailBackgroundColor.push('#41346C');
  593. }
  594. if (this.windMotorMatrixDetail[i].icon == '005') {
  595. this.detailBackgroundColor.push('#CC3399');
  596. }
  597. if (this.windMotorMatrixDetail[i].icon == '006') {
  598. this.detailBackgroundColor.push('#686868');
  599. }
  600. }
  601. }
  602. }
  603. };
  604. </script>
  605. <style>
  606. @font-face {
  607. font-family: '方正兰亭细黑_GBK';
  608. src: url(../../static/fzltxh.TTF);
  609. }
  610. /* body {
  611. font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', STHeiti, 'Microsoft Yahei', Tahoma, Simsun, sans-serif;
  612. font-size: 20px;
  613. color: silver;
  614. background: #000;
  615. } */
  616. page {
  617. font-family: '方正兰亭细黑_GBK';
  618. background-color: #1f1f1f;
  619. color: silver;
  620. }
  621. .top {
  622. width: 100%;
  623. height: 130upx;
  624. padding-top: 5upx;
  625. background-color: #1f1f1f;
  626. position: fixed;
  627. top: 0px;
  628. left: 0px;
  629. z-index: 100;
  630. }
  631. .threeLine {
  632. width: 50px;
  633. height: 45px;
  634. float: left;
  635. }
  636. .text {
  637. width: calc(100% - 100px);
  638. height: 45px;
  639. float: left;
  640. user-select: text;
  641. -webkit-user-select: text;
  642. -moz-user-select: text;
  643. -ms-user-select: text;
  644. color: silver;
  645. line-height: 45px;
  646. margin-top: 11px;
  647. font-size: 10px;
  648. }
  649. .notice {
  650. width: 50px;
  651. height: 45px;
  652. float: left;
  653. }
  654. .plus {
  655. width: 50px;
  656. height: 45px;
  657. float: right;
  658. color: white;
  659. font-size: 35px;
  660. line-height: 45px;
  661. text-align: center;
  662. margin-top: 11px;
  663. }
  664. .textWindpowerstation {
  665. width: 180px;
  666. height: 45px;
  667. float: left;
  668. text-align: center;
  669. margin-left: 18px;
  670. }
  671. .DrawerPage {
  672. position: fixed;
  673. width: 100vw;
  674. height: 100vh;
  675. left: 0vw;
  676. background-color: #1f1f1f;
  677. transition: all 0.4s;
  678. }
  679. .DrawerPage.show {
  680. transform: scale(0.9, 0.9);
  681. left: 85vw;
  682. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  683. transform-origin: 0;
  684. }
  685. .DrawerWindow {
  686. position: absolute;
  687. width: 85vw;
  688. height: 100vh;
  689. left: 0;
  690. top: 0;
  691. transform: scale(0.9, 0.9) translateX(-100%);
  692. opacity: 0;
  693. pointer-events: none;
  694. transition: all 0.4s;
  695. padding: 100upx 0;
  696. }
  697. .DrawerWindow.show {
  698. transform: scale(1, 1) translateX(0%);
  699. opacity: 1;
  700. pointer-events: all;
  701. }
  702. .DrawerClose {
  703. position: absolute;
  704. width: 40vw;
  705. height: 100vh;
  706. right: 0;
  707. top: 0;
  708. color: transparent;
  709. padding-bottom: 30upx;
  710. display: flex;
  711. align-items: flex-end;
  712. justify-content: center;
  713. background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));
  714. letter-spacing: 5px;
  715. font-size: 50upx;
  716. opacity: 0;
  717. pointer-events: none;
  718. transition: all 0.4s;
  719. }
  720. .DrawerClose.show {
  721. opacity: 1;
  722. pointer-events: all;
  723. width: 15vw;
  724. color: #fff;
  725. }
  726. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  727. width: 64upx;
  728. height: 64upx;
  729. line-height: 64upx;
  730. margin: 0;
  731. display: inline-block;
  732. }
  733. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  734. margin: 0;
  735. }
  736. .DrawerPage .nav {
  737. flex: 1;
  738. }
  739. .DrawerPage .nav .cu-item.cur {
  740. border-bottom: 0;
  741. position: relative;
  742. }
  743. .DrawerPage .nav .cu-item.cur::after {
  744. content: '';
  745. width: 10upx;
  746. height: 10upx;
  747. background-color: currentColor;
  748. position: absolute;
  749. bottom: 10upx;
  750. border-radius: 10upx;
  751. left: 0;
  752. right: 0;
  753. margin: auto;
  754. }
  755. .DrawerPage .cu-bar.tabbar .action {
  756. flex: initial;
  757. }
  758. .windStationNameAndChoice {
  759. clear: both;
  760. width: 100%;
  761. height: 50px;
  762. /* border: 1px solid red; */
  763. }
  764. .windStationName {
  765. width: 70%;
  766. height: 100%;
  767. float: left;
  768. line-height: 50px;
  769. font-size: 16px;
  770. margin-left: 4%;
  771. }
  772. .windStationChoice {
  773. width: 20%;
  774. height: 100%;
  775. float: right;
  776. text-align: right;
  777. line-height: 50px;
  778. font-size: 10px;
  779. margin-right: 9px;
  780. }
  781. .windStationList {
  782. width: 100%;
  783. height: 290px;
  784. }
  785. .windStationItemContainer {
  786. width: 100%;
  787. }
  788. .windStationItemContainerBlack {
  789. width: 100%;
  790. background-color: grey;
  791. color: white;
  792. }
  793. .windStationItem {
  794. width: 80%;
  795. height: 50px;
  796. border-bottom: 1px solid #c8c8c8;
  797. text-align: left;
  798. line-height: 50px;
  799. margin-left: 10%;
  800. color: #333333;
  801. }
  802. .cu-dialog {
  803. width: 70%;
  804. }
  805. .cu-bar .content {
  806. width: 100%;
  807. margin-left: 10%;
  808. }
  809. .windMotorStatusContainer {
  810. width: 95%;
  811. height: 120px;
  812. background-color: #242424;
  813. color: white;
  814. font-size: 10px;
  815. margin-left: 2.5%;
  816. }
  817. .windMotorStatusCardJieRu {
  818. width: 22%;
  819. height: 45px;
  820. margin-left: 1.5%;
  821. margin-right: 1.5%;
  822. margin-top: 10px;
  823. float: left;
  824. background-color: #c2c2c2;
  825. line-height: 45px;
  826. }
  827. .windMotorStatusCardYunXing {
  828. width: 22%;
  829. height: 45px;
  830. margin-left: 1.5%;
  831. margin-right: 1.5%;
  832. margin-top: 10px;
  833. float: left;
  834. background-color: #2675f6;
  835. line-height: 45px;
  836. }
  837. .windMotorStatusCardDaiJi {
  838. width: 22%;
  839. height: 45px;
  840. margin-left: 1.5%;
  841. margin-right: 1.5%;
  842. margin-top: 10px;
  843. float: left;
  844. background-color: #00e086;
  845. line-height: 45px;
  846. }
  847. .windMotorStatusCardJianXiu {
  848. width: 22%;
  849. height: 45px;
  850. margin-left: 1.5%;
  851. margin-right: 1.5%;
  852. margin-top: 10px;
  853. float: left;
  854. background-color: #ff6b3e;
  855. line-height: 45px;
  856. }
  857. .windMotorStatusCardGuZhang {
  858. width: 22%;
  859. height: 45px;
  860. margin-left: 1.5%;
  861. margin-right: 1.5%;
  862. margin-top: 10px;
  863. float: left;
  864. background-color: #f14e51;
  865. line-height: 45px;
  866. }
  867. .windMotorStatusCardXianDian {
  868. width: 22%;
  869. height: 45px;
  870. margin-left: 1.5%;
  871. margin-right: 1.5%;
  872. margin-top: 10px;
  873. float: left;
  874. background-color: #cc3399;
  875. line-height: 45px;
  876. }
  877. .windMotorStatusCardShouLei {
  878. width: 22%;
  879. height: 45px;
  880. margin-left: 1.5%;
  881. margin-right: 1.5%;
  882. margin-top: 10px;
  883. float: left;
  884. background-color: #41346c;
  885. line-height: 45px;
  886. }
  887. .windMotorStatusCardLiXian {
  888. width: 22%;
  889. height: 45px;
  890. margin-left: 1.5%;
  891. margin-right: 1.5%;
  892. margin-top: 10px;
  893. float: left;
  894. background-color: #686868;
  895. line-height: 45px;
  896. }
  897. .windMotorStatusCardIcon {
  898. width: 25px;
  899. height: 25px;
  900. margin-top: 10px;
  901. float: left;
  902. }
  903. .windMotorStatusCardJieRuRed {
  904. width: 22%;
  905. height: 45px;
  906. margin-left: 1.5%;
  907. margin-right: 1.5%;
  908. margin-top: 10px;
  909. float: left;
  910. background-color: #c2c2c2;
  911. line-height: 45px;
  912. color: black;
  913. /* border: 1px solid red; */
  914. }
  915. .windMotorStatusCardYunXingRed {
  916. width: 22%;
  917. height: 45px;
  918. margin-left: 1.5%;
  919. margin-right: 1.5%;
  920. margin-top: 10px;
  921. float: left;
  922. background-color: #2675f6;
  923. line-height: 45px;
  924. color: black;
  925. /* border: 1px solid red; */
  926. }
  927. .windMotorStatusCardDaiJiRed {
  928. width: 22%;
  929. height: 45px;
  930. margin-left: 1.5%;
  931. margin-right: 1.5%;
  932. margin-top: 10px;
  933. float: left;
  934. background-color: #00e086;
  935. line-height: 45px;
  936. color: black;
  937. /* border: 1px solid red; */
  938. }
  939. .windMotorStatusCardJianXiuRed {
  940. width: 22%;
  941. height: 45px;
  942. margin-left: 1.5%;
  943. margin-right: 1.5%;
  944. margin-top: 10px;
  945. float: left;
  946. background-color: #ff6b3e;
  947. line-height: 45px;
  948. color: black;
  949. /* border: 1px solid red; */
  950. }
  951. .windMotorStatusCardGuZhangRed {
  952. width: 22%;
  953. height: 45px;
  954. margin-left: 1.5%;
  955. margin-right: 1.5%;
  956. margin-top: 10px;
  957. float: left;
  958. background-color: #f14e51;
  959. line-height: 45px;
  960. color: black;
  961. /* border: 1px solid red; */
  962. }
  963. .windMotorStatusCardXianDianRed {
  964. width: 22%;
  965. height: 45px;
  966. margin-left: 1.5%;
  967. margin-right: 1.5%;
  968. margin-top: 10px;
  969. float: left;
  970. background-color: #cc3399;
  971. line-height: 45px;
  972. color: black;
  973. /* border: 1px solid red; */
  974. }
  975. .windMotorStatusCardShouLeiRed {
  976. width: 22%;
  977. height: 45px;
  978. margin-left: 1.5%;
  979. margin-right: 1.5%;
  980. margin-top: 10px;
  981. float: left;
  982. background-color: #41346c;
  983. line-height: 45px;
  984. color: black;
  985. /* border: 1px solid red; */
  986. }
  987. .windMotorStatusCardLiXianRed {
  988. width: 22%;
  989. height: 45px;
  990. margin-left: 1.5%;
  991. margin-right: 1.5%;
  992. margin-top: 10px;
  993. float: left;
  994. background-color: #686868;
  995. line-height: 45px;
  996. color: black;
  997. /* border: 1px solid red; */
  998. }
  999. .card-swiper {
  1000. height: 40px !important;
  1001. }
  1002. .windMotorMatrixContainer {
  1003. width: 95%;
  1004. height: 400px;
  1005. background-color: #242424;
  1006. margin-left: 2.5%;
  1007. }
  1008. .windMotorMatrixList {
  1009. width: 100%;
  1010. height: calc(900px + 20%);
  1011. }
  1012. .windMotorMatrixDetail {
  1013. width: 24%;
  1014. height: 40px;
  1015. margin: 0.5%;
  1016. float: left;
  1017. color: white;
  1018. }
  1019. .windMotorMatrixDetailIcon {
  1020. width: 25px;
  1021. height: 25px;
  1022. float: left;
  1023. }
  1024. .windMotorMatrixDetailSpeed {
  1025. width: calc(100% - 26px);
  1026. height: 25px;
  1027. float: left;
  1028. text-align: right;
  1029. line-height: 25px;
  1030. font-size: 10px;
  1031. margin-right: 1px;
  1032. }
  1033. .windMotorMatrixDetailId {
  1034. width: 20px;
  1035. height: 20px;
  1036. float: left;
  1037. line-height: 10px;
  1038. text-align: left;
  1039. font-size: 4px;
  1040. margin-left: 3px;
  1041. }
  1042. .windMotorMatrixDetailPower {
  1043. width: calc(100% - 29px);
  1044. height: 20px;
  1045. float: left;
  1046. line-height: 10px;
  1047. text-align: right;
  1048. font-size: 10px;
  1049. margin-right: 1px;
  1050. }
  1051. /* .center-popup {
  1052. // #ifdef H5
  1053. /deep/.s-popup-wrapper {
  1054. width: 500rpx;
  1055. height: 500rpx;
  1056. background-color: #f0f0f0;
  1057. }
  1058. // #endif
  1059. } */
  1060. .s-popup-wrapper {
  1061. width: 500rpx;
  1062. background-color: #f0f0f0;
  1063. }
  1064. .s-popup-title {
  1065. width: 100%;
  1066. height: 50px;
  1067. background-color: #211E21;
  1068. }
  1069. .s-popup-word {
  1070. width: calc(100% - 65px);
  1071. height: 50px;
  1072. font-size: 10px;
  1073. color: white;
  1074. line-height: 50px;
  1075. float: left;
  1076. margin-left: 25px;
  1077. }
  1078. .s-popup-cha {
  1079. width: 40px;
  1080. height: 50px;
  1081. text-align: center;
  1082. line-height: 50px;
  1083. float: right;
  1084. font-size: 24px;
  1085. }
  1086. </style>