dj1.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <template>
  2. <div class="dj-1">
  3. <div class="action-bar">
  4. <div class="selections mg-b-16">
  5. <div class="item" @click="tabSelect(0)" :class="{ active: tabIndex == 0 }">风机运行情况信息</div>
  6. <div class="item" @click="tabSelect(1)" :class="{ active: tabIndex == 1 }">风机日详细信息</div>
  7. <div class="item" @click="tabSelect(2)" :class="{ active: tabIndex == 2 }">风场玫瑰图</div>
  8. <div class="item" @click="tabSelect(3)" :class="{ active: tabIndex == 3 }">风机玫瑰图</div>
  9. <div class="item" @click="tabSelect(4)" :class="{ active: tabIndex == 4 }">风机切入切出分析</div>
  10. </div>
  11. <div class="query mg-b-16">
  12. <div class="query-items">
  13. <div class="query-item">
  14. <div class="lable">风场:</div>
  15. <div class="search-input">
  16. <el-select v-model="wpId" clearable placeholder="请选择" popper-class="select" @change="getWtArray">
  17. <el-option v-for="item in wpArray" :key="item.id" :value="item.id" :label="item.name" />
  18. </el-select>
  19. </div>
  20. </div>
  21. <div class="query-item">
  22. <div class="lable">风机:</div>
  23. <div class="search-input">
  24. <el-select v-model="wtId" clearable placeholder="请选择" popper-class="select">
  25. <el-option v-for="item in wtArray" :key="item.id" :value="item.id" :label="item.name" />
  26. </el-select>
  27. </div>
  28. </div>
  29. <div class="query-item">
  30. <div class="lable">日期:</div>
  31. <div class="search-input">
  32. <el-date-picker v-model="recorddate" type="date" value-format="YYYY-MM-DD" placeholder="选择日期"
  33. popper-class="date-select">
  34. </el-date-picker>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="query-actions">
  39. <button class="btn green" @click="search">搜索</button>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- tab1 -->
  44. <div v-if="tabIndex == 0" class="tab-1">
  45. <panel :title="'损失电量分析'" class="mg-b-16">
  46. <area-bar-chart :height="'23.1481vh'" :bardata="{ legend: [] }" :lineData="lostChartData" :units="lostChartUnit"
  47. :areaData="LostChartBgColorData" />
  48. </panel>
  49. <panel :title="'电量'" class="mg-b-16">
  50. <multiple-bar-line-chart :height="'16.6667vh'" />
  51. </panel>
  52. <div class="table-info">
  53. <panel class="table-panel" :title="'当日报警记录'" :showLine="false">
  54. <Table :data="tableData" :canScroll="true" :height="'32.5vh'" />
  55. </panel>
  56. <panel class="table-panel" :title="'当日报警记录'" :showLine="false">
  57. <Table :data="tableData" :canScroll="true" :height="'32.5vh'" />
  58. </panel>
  59. <panel class="table-panel" :title="'当日报警记录'" :showLine="false">
  60. <Table :data="tableData" :canScroll="true" :height="'32.5vh'" />
  61. </panel>
  62. </div>
  63. </div>
  64. <!-- tab2 -->
  65. <div v-if="tabIndex == 1" class="tab-2">
  66. <el-row>
  67. <el-col :span="15">
  68. <panel :title="'功率曲线'" class="mg-b-16">
  69. <marker-line-chart :height="'28vh'" />
  70. </panel>
  71. <panel :title="'日发电量信息'" class="mg-b-16 outline" :showLine="false">
  72. <div class="power-info">
  73. <div class="info-item" v-for="index in 20" :key="index">
  74. <div class="text">设备可利用率:</div>
  75. <div class="value green">115.01</div>
  76. </div>
  77. </div>
  78. </panel>
  79. <div class="month-info">
  80. <div class="month-info-left">
  81. <panel :title="'月发电量信息'" class="mg-b-16 outline" :showLine="false">
  82. <div class="power-info month-3">
  83. <div class="info-item" v-for="index in 15" :key="index">
  84. <div class="text">月实际/保证:</div>
  85. <div class="value green">115.01</div>
  86. </div>
  87. </div>
  88. </panel>
  89. </div>
  90. <div class="month-info-right">
  91. <panel :title="'月发电量信息'" class="mg-b-16 outline" :showLine="false">
  92. <div class="power-info month-2">
  93. <div class="info-item" v-for="index in 2" :key="index">
  94. <div class="text">月实际/保证:</div>
  95. <div class="value green">115.01</div>
  96. </div>
  97. </div>
  98. </panel>
  99. <panel :title="'风资源'" class="radar-panel" :icon="'svg-wind-site'">
  100. <div class="wind-info">
  101. <div class="legend mg-r-16">
  102. <span class="dot"></span>
  103. <span>静风频率为2</span>
  104. </div>
  105. <direction-radar-chart :width="'60%'" :height="'180px'" />
  106. </div>
  107. </panel>
  108. </div>
  109. </div>
  110. </el-col>
  111. <el-col :span="9">
  112. <panel class="table-panel outline mg-b-16" :title="'当日报警记录'" :showLine="false">
  113. <Table :data="tableData" :canScroll="true" :height="'23vh'" />
  114. </panel>
  115. <panel class="table-panel outline mg-b-16" :title="'当日报警记录'" :showLine="false">
  116. <Table :data="tableData" :canScroll="true" :height="'23vh'" />
  117. </panel>
  118. <panel class="table-panel outline" :title="'当日报警记录'" :showLine="false">
  119. <Table :data="tableData" :canScroll="true" :height="'23vh'" />
  120. </panel>
  121. </el-col>
  122. </el-row>
  123. </div>
  124. <!-- tab3 -->
  125. <div v-if="tabIndex == 2" class="tab-3">
  126. <el-row>
  127. <el-col :span="8">
  128. <panel :title="'日最大风速'" class="radar-panel" :icon="'svg-wind-site'">
  129. <div class="wind-info">
  130. <div class="legend mg-r-16">
  131. <span class="dot"></span>
  132. <span>静风频率为2</span>
  133. </div>
  134. <direction-radar-chart :width="'100%'" :height="'350px'" />
  135. </div>
  136. </panel>
  137. </el-col>
  138. <el-col :span="8">
  139. <panel :title="'日最大风速'" class="radar-panel" :icon="'svg-wind-site'">
  140. <div class="wind-info">
  141. <div class="legend mg-r-16">
  142. <span class="dot"></span>
  143. <span>静风频率为2</span>
  144. </div>
  145. <direction-radar-chart :width="'100%'" :height="'350px'" />
  146. </div>
  147. </panel>
  148. </el-col>
  149. <el-col :span="8">
  150. <panel :title="'日最大风速'" class="radar-panel" :icon="'svg-wind-site'">
  151. <div class="wind-info">
  152. <div class="legend mg-r-16">
  153. <span class="dot"></span>
  154. <span>静风频率为2</span>
  155. </div>
  156. <direction-radar-chart :width="'100%'" :height="'350px'" />
  157. </div>
  158. </panel>
  159. </el-col>
  160. </el-row>
  161. <el-row>
  162. <el-col :span="8">
  163. <panel :title="'日最大风速'" class="radar-panel" :icon="'svg-wind-site'">
  164. <div class="wind-info">
  165. <div class="legend mg-r-16">
  166. <span class="dot"></span>
  167. <span>静风频率为2</span>
  168. </div>
  169. <direction-radar-chart :width="'100%'" :height="'350px'" />
  170. </div>
  171. </panel>
  172. </el-col>
  173. <el-col :span="8">
  174. <panel :title="'日最大风速'" class="radar-panel" :icon="'svg-wind-site'">
  175. <div class="wind-info">
  176. <div class="legend mg-r-16">
  177. <span class="dot"></span>
  178. <span>静风频率为2</span>
  179. </div>
  180. <direction-radar-chart :width="'100%'" :height="'350px'" />
  181. </div>
  182. </panel>
  183. </el-col>
  184. <el-col :span="8">
  185. <panel :title="'日最大风速'" class="radar-panel" :icon="'svg-wind-site'">
  186. <div class="wind-info">
  187. <div class="legend mg-r-16">
  188. <span class="dot"></span>
  189. <span>静风频率为2</span>
  190. </div>
  191. <direction-radar-chart :width="'100%'" :height="'350px'" />
  192. </div>
  193. </panel>
  194. </el-col>
  195. </el-row>
  196. </div>
  197. <!-- tab4 -->
  198. <div v-if="tabIndex == 3" class="tab-4">
  199. <el-row>
  200. <el-col :span="8">
  201. <panel title="日度损失电量分析">
  202. <dual-pie-chart height="350px" />
  203. </panel>
  204. </el-col>
  205. <el-col :span="8">
  206. <panel title="日度损失电量分析">
  207. <dual-pie-chart height="350px" />
  208. </panel>
  209. </el-col>
  210. <el-col :span="8">
  211. <panel title="日度损失电量分析">
  212. <dual-pie-chart height="350px" />
  213. </panel>
  214. </el-col>
  215. </el-row>
  216. <el-row>
  217. <el-col :span="8">
  218. <panel title="日度损失电量分析">
  219. <dual-pie-chart height="350px" />
  220. </panel>
  221. </el-col>
  222. <el-col :span="8">
  223. <panel title="日度损失电量分析">
  224. <dual-pie-chart height="350px" />
  225. </panel>
  226. </el-col>
  227. <el-col :span="8">
  228. <panel title="日度损失电量分析">
  229. <dual-pie-chart height="350px" />
  230. </panel>
  231. </el-col>
  232. </el-row>
  233. </div>
  234. </div>
  235. </template>
  236. <script>
  237. import AreaBarChart from "../../components/chart/combination/area-bar-chart.vue";
  238. import MultipleBarLineChart from "../../components/chart/combination/multiple-bar-line-chart.vue";
  239. import MarkerLineChart from "../../components/chart/line/marker-line-chart.vue";
  240. import DualPieChart from "../../components/chart/pie/dual-pie-chart.vue";
  241. import DirectionRadarChart from "../../components/chart/radar/direction-radar-chart.vue";
  242. import panel from "../../components/coms/panel/panel.vue";
  243. import Table from "../../components/coms/table/table.vue";
  244. export default {
  245. components: { panel, AreaBarChart, MultipleBarLineChart, Table, MarkerLineChart, DirectionRadarChart, DualPieChart },
  246. setup () { },
  247. data () {
  248. return {
  249. tabIndex: 0,
  250. tableData: {
  251. column: [
  252. {
  253. name: "风机",
  254. field: "name",
  255. is_num: false,
  256. is_light: false,
  257. },
  258. {
  259. name: "描述",
  260. field: "desc",
  261. is_num: false,
  262. is_light: false,
  263. },
  264. {
  265. name: "报警时间",
  266. field: "date",
  267. is_num: false,
  268. is_light: false,
  269. },
  270. ],
  271. data: [
  272. {
  273. name: "MG01-01",
  274. desc: "描述描述描述描述描述描述描述描述描述描述",
  275. date: "2020-01-01",
  276. },
  277. ],
  278. },
  279. wpArray: [],
  280. wpId: "",
  281. wtArray: [],
  282. wtId: "",
  283. recorddate: new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
  284. lostChartData: [],
  285. lostChartUnit: [],
  286. LostChartBgColorData: [],
  287. options: [
  288. {
  289. value: "选项1",
  290. label: "黄金糕",
  291. },
  292. {
  293. value: "选项2",
  294. label: "双皮奶",
  295. },
  296. {
  297. value: "选项3",
  298. label: "蚵仔煎",
  299. },
  300. {
  301. value: "选项4",
  302. label: "龙须面",
  303. },
  304. {
  305. value: "选项5",
  306. label: "北京烤鸭",
  307. },
  308. ],
  309. value1: [],
  310. value2: [],
  311. value3: [],
  312. value4: "",
  313. value5: "",
  314. };
  315. },
  316. methods: {
  317. // 获取风场
  318. getWpArray () {
  319. let that = this;
  320. that.API.requestData({
  321. method: "GET",
  322. subUrl: "powercompare/windfarmAjax",
  323. success (res) {
  324. that.wpArray = res.data;
  325. that.wpId = res.data[0].id;
  326. that.getWtArray(that.wpId, true);
  327. }
  328. });
  329. },
  330. // 获取风场
  331. getWtArray (wpId, keepRequest) {
  332. let that = this;
  333. if (wpId) {
  334. that.API.requestData({
  335. method: "GET",
  336. subUrl: "powercompare/windturbineAjax",
  337. data: {
  338. wpId
  339. },
  340. success (res) {
  341. that.wtArray = res.data;
  342. that.wtId = res.data[0].id;
  343. if (keepRequest) {
  344. that.getLostChartData();
  345. }
  346. }
  347. });
  348. } else {
  349. that.wtArray = [];
  350. that.wtId = "";
  351. }
  352. },
  353. // 获取损失电量分析图表数据
  354. getLostChartData () {
  355. let that = this;
  356. that.API.requestData({
  357. method: "POST",
  358. subUrl: "goodness/findWtRealPowerChar",
  359. data: {
  360. wtId: that.wtId,
  361. recorddate: that.recorddate
  362. },
  363. success (res) {
  364. console.log(111, res.data);
  365. const keyArray = ["value1", "value2", "value3", "value4"];
  366. let lostChartData = [[], [], [], []];
  367. const lostChartUnit = ["实发功率", "保证功率", "风速", "状态"];
  368. keyArray.forEach((key, keyIndex) => {
  369. res.data.forEach(ele => {
  370. lostChartData[keyIndex].push(ele[key]);
  371. });
  372. });
  373. that.lostChartData = lostChartData;
  374. that.lostChartUnit = lostChartUnit;
  375. that.getLostChartBgColorData();
  376. }
  377. });
  378. },
  379. // 获取损失电量分析图表背景颜色
  380. getLostChartBgColorData () {
  381. let that = this;
  382. that.API.requestData({
  383. method: "POST",
  384. subUrl: "goodness/getplotBands",
  385. data: {
  386. wtId: that.wtId,
  387. recorddate: that.recorddate
  388. },
  389. success (res) {
  390. console.log(222, res.data);
  391. let LostChartBgColorData = [];
  392. res.data.forEach((pEle, pIndex) => {
  393. LostChartBgColorData.push({
  394. name: pEle[0].name,
  395. start: (pIndex ? LostChartBgColorData[pIndex - 1].end : 0),
  396. end: (pIndex ? LostChartBgColorData[pIndex - 1].end : 0) + ((new Date(pEle[0].time2).getTime() / 1000) - (new Date(pEle[0].time1).getTime() / 1000)),
  397. color: pEle[0].itemStyle.color
  398. });
  399. });
  400. console.log(333, LostChartBgColorData);
  401. that.LostChartBgColorData = LostChartBgColorData;
  402. }
  403. });
  404. },
  405. tabSelect (state) {
  406. this.tabIndex = state;
  407. },
  408. // 搜索
  409. search () {
  410. if (this.tabIndex === 0) {
  411. this.getLostChartData();
  412. }
  413. }
  414. },
  415. created () {
  416. for (let i = 1; i < 50; i++) {
  417. this.tableData.data.push(JSON.parse(JSON.stringify(this.tableData.data[0])));
  418. }
  419. this.getWpArray();
  420. },
  421. };
  422. </script>
  423. <style lang="less">
  424. .dj-1 {
  425. .action-bar {
  426. display: flex;
  427. .selections {
  428. flex: 1 0 auto;
  429. display: flex;
  430. .item {
  431. flex: 0 0 164px;
  432. text-align: center;
  433. height: 33px;
  434. line-height: 33px;
  435. margin-right: 8px;
  436. color: @font-color;
  437. font-size: @fontsize-s;
  438. background: fade(@gray, 20);
  439. border: 1px solid fade(@gray, 20);
  440. &:hover,
  441. &.active {
  442. background: fade(@green, 20);
  443. border: 1px solid @green;
  444. color: @green;
  445. cursor: pointer;
  446. }
  447. }
  448. }
  449. }
  450. .outline {
  451. outline: 1px solid fade(@gray, 50);
  452. }
  453. .com-panel .panel-header {
  454. margin-bottom: 0px;
  455. }
  456. .table-info {
  457. display: flex;
  458. .table-panel {
  459. flex: 1 0 calc(100% / 3 - 8px);
  460. outline: 1px solid fade(@gray, 50);
  461. height: 100%;
  462. & + .table-panel {
  463. margin-left: 8px;
  464. }
  465. }
  466. }
  467. .tab-2 {
  468. .power-info {
  469. display: flex;
  470. flex-wrap: wrap;
  471. justify-content: space-between;
  472. &.month-3 {
  473. .info-item {
  474. flex: 0 0 calc(100% / 3 - 6px);
  475. &:nth-child(-n + 5) {
  476. margin-top: 8px;
  477. }
  478. &:nth-child(-n + 3) {
  479. margin-top: 0px;
  480. }
  481. }
  482. }
  483. &.month-2 {
  484. .info-item {
  485. flex: 0 0 calc(100% / 2 - 4px);
  486. &:nth-child(-n + 5) {
  487. margin-top: 8px;
  488. }
  489. &:nth-child(-n + 2) {
  490. margin-top: 0px;
  491. }
  492. }
  493. }
  494. .info-item {
  495. display: flex;
  496. align-items: center;
  497. flex: 0 0 calc(100% / 5 - 8px);
  498. background: fade(@gray, 20);
  499. height: 4.6296vh;
  500. line-height: 4.6296vh;
  501. margin-top: 8px;
  502. &:nth-child(-n + 5) {
  503. margin-top: 0px;
  504. }
  505. .text {
  506. font-size: 12px;
  507. flex: 0 0 110px;
  508. text-align: right;
  509. margin-right: 24px;
  510. color: @gray-l;
  511. }
  512. .value {
  513. font-size: 16px;
  514. }
  515. }
  516. }
  517. .month-info {
  518. display: flex;
  519. .month-info-left {
  520. flex: 0 0 705px;
  521. margin-right: 10px;
  522. }
  523. .month-info-right {
  524. flex: 1 0 auto;
  525. }
  526. }
  527. .moon-other {
  528. flex: 1 0 auto;
  529. }
  530. .radar-panel {
  531. height: 20.5vh;
  532. .panel-body {
  533. height: 100%;
  534. }
  535. }
  536. .wind-info {
  537. display: flex;
  538. .legend {
  539. font-size: 12px;
  540. flex: 0 0 140px;
  541. height: 20px;
  542. display: flex;
  543. align-items: center;
  544. justify-content: center;
  545. margin-top: 32px;
  546. margin-bottom: 16px;
  547. .dot {
  548. width: 7px;
  549. height: 7px;
  550. background: @green;
  551. display: inline-block;
  552. margin-right: 8px;
  553. }
  554. }
  555. }
  556. }
  557. .tab-3 {
  558. .wind-info {
  559. position: relative;
  560. .legend {
  561. position: absolute;
  562. left: 32px;
  563. top: 32px;
  564. font-size: 12px;
  565. flex: 0 0 140px;
  566. height: 20px;
  567. display: flex;
  568. align-items: center;
  569. justify-content: center;
  570. margin-top: 32px;
  571. margin-bottom: 16px;
  572. .dot {
  573. width: 7px;
  574. height: 7px;
  575. background: @green;
  576. display: inline-block;
  577. margin-right: 8px;
  578. }
  579. }
  580. }
  581. }
  582. .tab-4 {
  583. .panel-body {
  584. padding: 16px;
  585. }
  586. }
  587. }
  588. </style>