GeneralAppearance.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <div class="general-appearance">
  3. <div class="btn-group-tabs">
  4. <BtnGroup2 :btnGroups="btnGroups" :rowIndex="rowIndex" :index="selectIndex" @select="select"></BtnGroup2>
  5. </div>
  6. <div class="panel-title">
  7. <div class="panel-title-name">
  8. <div class="sub-title-item">
  9. <img src="../../../assets/map/fan/black.png" />
  10. <span class="sub-title gray">接入台数</span>
  11. <span class="sub-count font-num white">{{ wpnumMap.jrts }}</span>
  12. </div>
  13. <div class="sub-title-item">
  14. <img src="../../../assets/map/fan/green.png" />
  15. <span class="sub-title green">待机台数</span>
  16. <span class="sub-count font-num green">{{ wpnumMap.djts }}</span>
  17. </div>
  18. <div class="sub-title-item">
  19. <img src="../../../assets/map/fan/blue.png" />
  20. <span class="sub-title blue">并网台数</span>
  21. <span class="sub-count font-num blue">{{ wpnumMap.yxts }}</span>
  22. </div>
  23. <div class="sub-title-item">
  24. <img src="../../../assets/map/fan/purple.png" />
  25. <span class="sub-title pink">限电台数</span>
  26. <span class="sub-count font-num pink">{{ wpnumMap.xdts }}</span>
  27. </div>
  28. <div class="sub-title-item">
  29. <img src="../../../assets/map/fan/red.png" />
  30. <span class="sub-title red">故障台数</span>
  31. <span class="sub-count font-num red">{{ wpnumMap.gzts }}</span>
  32. </div>
  33. <div class="sub-title-item">
  34. <img src="../../../assets/map/fan/orange.png" />
  35. <span class="sub-title orange">检修台数</span>
  36. <span class="sub-count font-num orange">{{ wpnumMap.whts }}</span>
  37. </div>
  38. <div class="sub-title-item">
  39. <img src="../../../assets/map/fan/black.png" />
  40. <span class="sub-title gray">离线台数</span>
  41. <span class="sub-count font-num gray">{{ wpnumMap.lxts }} {{wpId}}</span>
  42. </div>
  43. </div>
  44. <!-- <div class="query-actions btnR" v-if="wpId == 'PL_GDC' || wpId == 'PL2_GDC'">
  45. <button class="btn" :class="wpId == 'PL_GDC'?'green':''" @click="pl('PL_GDC')">平罗一期</button>
  46. <button class="btn" :class="wpId == 'PL2_GDC'?'green':''" @click="pl('PL2_GDC')">平罗二期</button>
  47. </div> -->
  48. </div>
  49. <div>
  50. <MHS class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'MHS_FDC'" />
  51. <NSS class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'NSS_FDC'" />
  52. <QS class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'QS_FDC'" />
  53. <SBQ class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'SBQ_FDC'" />
  54. <XS class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'XS_FDC'" />
  55. <XH class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'XH_GDC'" />
  56. <DWK class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'DWK_GDC'" />
  57. <PL1 class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'PL_GDC'" />
  58. <PL2 class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'PL2_GDC'" />
  59. <MCH class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'MCH_GDC'" />
  60. <HZJ class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'HZJ_GDC'" />
  61. <AK class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'AK_GDC'" />
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  67. import MHS from "../components/generalappearance/mhs.vue";
  68. import NSS from "../components/generalappearance/nss.vue";
  69. import QS from "../components/generalappearance/qs.vue";
  70. import SBQ from "../components/generalappearance/sbq.vue";
  71. import XS from "../components/generalappearance/xs.vue";
  72. import XH from "../components/generalappearance/xh.vue";
  73. import DWK from "../components/generalappearance/dwk.vue";
  74. import PL1 from "../components/generalappearance/pl1.vue";
  75. import PL2 from "../components/generalappearance/pl2.vue";
  76. import MCH from "../components/generalappearance/mch.vue";
  77. import HZJ from "../components/generalappearance/hzj.vue";
  78. import AK from "../components/generalappearance/ak.vue";
  79. export default {
  80. // 名称
  81. name: "GeneralAppearance",
  82. // 使用组件
  83. components: {
  84. BtnGroup2,
  85. MHS,
  86. NSS,
  87. QS,
  88. SBQ,
  89. XS,
  90. XH,
  91. DWK,
  92. PL1,
  93. PL2,
  94. MCH,
  95. HZJ,
  96. AK
  97. },
  98. // 数据
  99. data() {
  100. return {
  101. timmer: undefined,
  102. wpId: undefined, //场站
  103. wpnumMap: {}, //风机监视数量
  104. fjmap: [], //场站风机详情
  105. zmmap: {},
  106. selectIndex: 0,
  107. rowIndex: 0,
  108. btnGroups: [{
  109. icon: "svg-wind-site",
  110. btns: [],
  111. },
  112. {
  113. icon: "svg-photovoltaic",
  114. btns: [],
  115. },
  116. ],
  117. };
  118. },
  119. created() {
  120. let that = this;
  121. that.wpId = that.$route.params.wpId;
  122. that.$nextTick(() => {
  123. that.getWp();
  124. that.timmer = setInterval(() => {
  125. that.requestData();
  126. }, that.$store.state.websocketTimeSec);
  127. });
  128. },
  129. // 函数
  130. methods: {
  131. select(res) {
  132. this.$router.replace({
  133. path: `/monitor/windsite/generalappearance/${res.code}`,
  134. });
  135. },
  136. getWp() {
  137. let that = this;
  138. that.API.requestData({
  139. method: "GET",
  140. subUrl: "powercompare/windfarmAllAjax",
  141. success(res) {
  142. let btnGroup = [{
  143. icon: "svg-wind-site",
  144. btns: [],
  145. },
  146. {
  147. icon: "svg-photovoltaic",
  148. btns: [],
  149. },
  150. ];
  151. res.data.forEach((ele, index) => {
  152. if (ele.id.indexOf("FDC") !== -1) {
  153. btnGroup[0].btns.push({
  154. text: ele.name,
  155. code: ele.id,
  156. });
  157. } else {
  158. btnGroup[1].btns.push({
  159. text: ele.name,
  160. code: ele.id,
  161. });
  162. // if(ele.id == 'PL_GDC'){
  163. // btnGroup[1].btns.push({
  164. // text: '平罗二期光伏电站',
  165. // code: 'PL2_GDC',
  166. // });
  167. // }
  168. }
  169. });
  170. that.btnGroups = btnGroup;
  171. that.renderBtnActiveIndex();
  172. },
  173. });
  174. },
  175. requestData() {
  176. let that = this;
  177. that.API.requestData({
  178. method: "POST",
  179. subUrl: "monitor/findGeneralAppearance",
  180. data: {
  181. wpId: that.wpId,
  182. },
  183. success(res) {
  184. if (res.code == 200) {
  185. that.wpnumMap = res.data.fczbmap.jczbmap;
  186. that.fjmap = res.data.fjmap[0];
  187. console.log(that.fjmap)
  188. that.zmmap = res.data.zmmap;
  189. }
  190. },
  191. });
  192. },
  193. renderBtnActiveIndex() {
  194. this.btnGroups.forEach((pEle, pIndex) => {
  195. pEle.btns.forEach((cEle, cIndex) => {
  196. if (cEle.code === this.wpId) {
  197. this.rowIndex = pIndex;
  198. this.selectIndex = cIndex;
  199. }
  200. });
  201. });
  202. },
  203. pl(a) { //单指平罗2个总貌
  204. this.$router.replace({
  205. path: `/monitor/windsite/generalappearance/${a}`,
  206. });
  207. }
  208. },
  209. unmounted() {
  210. clearInterval(this.timmer);
  211. this.timmer = null;
  212. },
  213. watch: {
  214. $route(res) {
  215. this.wpId = res.params.wpId;
  216. if (res.params.wpId) {
  217. this.requestData();
  218. this.renderBtnActiveIndex();
  219. }
  220. },
  221. },
  222. };
  223. </script>
  224. <style lang="less" scoped>
  225. .general-appearance {
  226. width: 100%;
  227. height: calc(100vh - 90px);
  228. display: flex;
  229. flex-direction: column;
  230. .btn-group-tabs {
  231. display: flex;
  232. flex-direction: row;
  233. }
  234. .btnR {
  235. flex: 1;
  236. text-align: end;
  237. }
  238. .general-appearance-body {
  239. flex-grow: 1;
  240. }
  241. .panel-title {
  242. width: 100%;
  243. background-color: fade(@darkgray, 40%);
  244. margin-top: 1.481vh;
  245. padding: 6px;
  246. display: flex;
  247. align-items: center;
  248. .panel-title-name {
  249. color: @green;
  250. display: flex;
  251. align-items: center;
  252. line-height: 0;
  253. font-size: 0;
  254. i,
  255. span {
  256. margin: 0 0 0 1.481vh;
  257. line-height: 0;
  258. font-size: 13px;
  259. }
  260. }
  261. .sub-title-item {
  262. display: flex;
  263. align-items: center;
  264. margin-left: 16px;
  265. .sub-title {
  266. font-size: 13px;
  267. margin-left: 6px;
  268. }
  269. .sub-count {
  270. font-size: 13px;
  271. font-weight: 500;
  272. }
  273. img {
  274. height: 31px;
  275. }
  276. }
  277. }
  278. }
  279. </style>