GeneralAppearance.vue 7.6 KB

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