windturbine.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882
  1. <template>
  2. <div style="width: 100%; height: 100%">
  3. <el-row type="flex" justify="space-between">
  4. <div class="handle-box" style="margin-bottom: 10px">
  5. <el-button size="mini" round class="buttons" @click="handleInsert">
  6. 新增记录
  7. </el-button>
  8. <el-button size="mini" round class="buttons" @click="export2Excel">
  9. 批量导出</el-button
  10. >
  11. <el-button size="mini" round class="buttons" @click="outExe">
  12. 模板下载</el-button
  13. >
  14. <el-upload
  15. style="display: inline; margin-left: 10px"
  16. :action="`${$store.state.baseURL}/alarmconfiguration/import`"
  17. :headers="token"
  18. :show-file-list="false"
  19. :on-success="handleSuccess"
  20. :on-progress="handleProgress"
  21. :on-error="handleError"
  22. >
  23. <el-button
  24. size="mini"
  25. round
  26. class="buttons"
  27. @click="exportShow = true"
  28. >
  29. 批量导入</el-button
  30. >
  31. </el-upload>
  32. </div>
  33. <div style="display: flex; flex-direction: row; margin-bottom: 10px">
  34. <el-select
  35. v-if="isStation"
  36. v-model="query.stationId"
  37. clearable
  38. size="mini"
  39. style="width: 150px"
  40. placeholder="全部场站"
  41. popper-class="select"
  42. @change="changeStation()"
  43. >
  44. <el-option
  45. v-for="item in stationList"
  46. :key="item.id"
  47. :value="item.id"
  48. :label="item.name"
  49. ></el-option>
  50. </el-select>
  51. <el-select
  52. v-model="query.modelId"
  53. clearable
  54. size="mini"
  55. style="width: 150px"
  56. placeholder="全部机型"
  57. popper-class="select"
  58. >
  59. <el-option
  60. v-for="item in state.modelList"
  61. :key="item"
  62. :value="item"
  63. :label="item"
  64. ></el-option>
  65. </el-select>
  66. <el-input
  67. placeholder="请输入名称"
  68. v-model="query.name"
  69. style="width: 150px; margin-right: 10px"
  70. size="mini"
  71. clearable
  72. ></el-input>
  73. <el-button
  74. icon="Search"
  75. size="mini"
  76. round
  77. class="buttons"
  78. @click="getData"
  79. >搜索</el-button
  80. >
  81. </div>
  82. </el-row>
  83. <div class="wind-table">
  84. <el-table
  85. :data="state.tableData"
  86. size="mini"
  87. style="width: 100%; height: calc(100% - 65px)"
  88. stripe
  89. >
  90. <el-table-column
  91. v-for="item in state.tableHeader"
  92. :key="item.id"
  93. :prop="item.prop"
  94. :label="item.label"
  95. :align="item.align"
  96. header-align="center"
  97. :width="item.width"
  98. :min-width="item.minWidth"
  99. show-overflow-tooltip
  100. >
  101. <template #default="{ row }">
  102. <span v-if="item.prop == 'rank'">
  103. {{ levelIdConvert(row.rank) }}</span
  104. >
  105. <span v-else-if="item.prop == 'deviceType'">
  106. {{ warningClassIfyIdConvert(row.deviceType) }}</span
  107. >
  108. <span v-else-if="item.prop == 'resetTable'">
  109. {{ row.resetTable ? "是" : "否" }}</span
  110. >
  111. <span v-else-if="item.prop == 'enabled'">
  112. {{ row.enabled == 1 ? "是" : "否" }}</span
  113. >
  114. <span v-else>{{ row[item.prop] ? row[item.prop] : "--" }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="操作" align="center" width="100">
  118. <template #default="scope">
  119. <el-button
  120. type="text"
  121. :style="`color: ${
  122. $store.state.theme ? '#1890ff' : '#47aee7'
  123. } !important`"
  124. icon="el-icon-lx-edit"
  125. @click="handleEditClick(scope.row)"
  126. >
  127. 编辑</el-button
  128. >
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. <div class="pagination">
  133. <el-pagination
  134. class="b"
  135. layout="total, sizes, prev, pager, next"
  136. :page-sizes="[19, 50, 100, 200, 500]"
  137. @size-change="
  138. (value) => {
  139. query.pageSize = value;
  140. query.pageNum = 1;
  141. getData();
  142. }
  143. "
  144. :current-page="query.pageNum"
  145. :page-size="query.pageSize"
  146. :total="total"
  147. @current-change="handlePageChange"
  148. ></el-pagination>
  149. </div>
  150. </div>
  151. <windturbinecomponents
  152. @close="dialogclose"
  153. :isVisible="state.visible"
  154. :form="state.form"
  155. />
  156. </div>
  157. </template>
  158. <script setup>
  159. import {
  160. windturbinebj_fetchTableData,
  161. getWtModel,
  162. getWpList,
  163. } from "@/api/zhbj/index.js";
  164. import { outExportExcel } from "@/tools/excel/exportExcel.js"; //引入文件
  165. import { ref, onMounted, provide, computed, reactive, watch } from "vue";
  166. import { useStore } from "vuex";
  167. import { ElMessageBox, ElMessage } from "element-plus";
  168. import windturbinecomponents from "./windturbine_components.vue";
  169. const token = { token: sessionStorage.getItem("token") };
  170. const store = useStore();
  171. const stationList = ref([]);
  172. const getStationList = async () => {
  173. const { data } = await getWpList("windturbine");
  174. stationList.value = data || [];
  175. };
  176. const isStation = computed(() => stationList.value.length);
  177. const state = reactive({
  178. tableData: [
  179. {
  180. id: "001047",
  181. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS001DB0111SW01RAW00",
  182. triggerType: -1,
  183. deviceId: null,
  184. suffix: null,
  185. rank: 4,
  186. uniformCode: "DI00001",
  187. stationId: "SXJ_KGDL_DJYF01_SBS",
  188. modelId: null,
  189. alarmType: "booststation",
  190. deviceType: "booststation",
  191. components: null,
  192. subcomponents: null,
  193. description: "220kV总圣线231测控231断路器合位",
  194. characteristic: "动作",
  195. resetTable: false,
  196. enable: true,
  197. name: null,
  198. nemCode: null,
  199. faultCause: null,
  200. resolvent: null,
  201. stationName: "丁家窑风电场",
  202. componentsName: null,
  203. },
  204. {
  205. id: "001048",
  206. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS002DB0111SW02RAW00",
  207. triggerType: -1,
  208. deviceId: null,
  209. suffix: null,
  210. rank: 4,
  211. uniformCode: "DI00002",
  212. stationId: "SXJ_KGDL_DJYF01_SBS",
  213. modelId: null,
  214. alarmType: "booststation",
  215. deviceType: "booststation",
  216. components: null,
  217. subcomponents: null,
  218. description: "220kV总圣线231测控231-A刀闸合位",
  219. characteristic: "动作",
  220. resetTable: false,
  221. enable: true,
  222. name: null,
  223. nemCode: null,
  224. faultCause: null,
  225. resolvent: null,
  226. stationName: "丁家窑风电场",
  227. componentsName: null,
  228. },
  229. {
  230. id: "001049",
  231. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS003DB0111SW01RAW00",
  232. triggerType: -1,
  233. deviceId: null,
  234. suffix: null,
  235. rank: 4,
  236. uniformCode: "DI00003",
  237. stationId: "SXJ_KGDL_DJYF01_SBS",
  238. modelId: null,
  239. alarmType: "booststation",
  240. deviceType: "booststation",
  241. components: null,
  242. subcomponents: null,
  243. description: "220kV总圣线231测控231-1刀闸合位",
  244. characteristic: "动作",
  245. resetTable: false,
  246. enable: true,
  247. name: null,
  248. nemCode: null,
  249. faultCause: null,
  250. resolvent: null,
  251. stationName: "丁家窑风电场",
  252. componentsName: null,
  253. },
  254. {
  255. id: "001050",
  256. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS004DB0111SW01RAW00",
  257. triggerType: -1,
  258. deviceId: null,
  259. suffix: null,
  260. rank: 4,
  261. uniformCode: "DI00004",
  262. stationId: "SXJ_KGDL_DJYF01_SBS",
  263. modelId: null,
  264. alarmType: "booststation",
  265. deviceType: "booststation",
  266. components: null,
  267. subcomponents: null,
  268. description: "220kV总圣线231测控231-A0地刀合位",
  269. characteristic: "动作",
  270. resetTable: false,
  271. enable: true,
  272. name: null,
  273. nemCode: null,
  274. faultCause: null,
  275. resolvent: null,
  276. stationName: "丁家窑风电场",
  277. componentsName: null,
  278. },
  279. {
  280. id: "001051",
  281. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS005DB0111SW01RAW00",
  282. triggerType: -1,
  283. deviceId: null,
  284. suffix: null,
  285. rank: 4,
  286. uniformCode: "DI00005",
  287. stationId: "SXJ_KGDL_DJYF01_SBS",
  288. modelId: null,
  289. alarmType: "booststation",
  290. deviceType: "booststation",
  291. components: null,
  292. subcomponents: null,
  293. description: "220kV总圣线231测控231-10地刀合位",
  294. characteristic: "动作",
  295. resetTable: false,
  296. enable: true,
  297. name: null,
  298. nemCode: null,
  299. faultCause: null,
  300. resolvent: null,
  301. stationName: "丁家窑风电场",
  302. componentsName: null,
  303. },
  304. {
  305. id: "001052",
  306. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS006DB0111SW01RAW00",
  307. triggerType: -1,
  308. deviceId: null,
  309. suffix: null,
  310. rank: 4,
  311. uniformCode: "DI00006",
  312. stationId: "SXJ_KGDL_DJYF01_SBS",
  313. modelId: null,
  314. alarmType: "booststation",
  315. deviceType: "booststation",
  316. components: null,
  317. subcomponents: null,
  318. description: "220kV总圣线231测控231-线0地刀合位",
  319. characteristic: "动作",
  320. resetTable: false,
  321. enable: true,
  322. name: null,
  323. nemCode: null,
  324. faultCause: null,
  325. resolvent: null,
  326. stationName: "丁家窑风电场",
  327. componentsName: null,
  328. },
  329. {
  330. id: "001053",
  331. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS006DB0111SW09RAW00",
  332. triggerType: 1,
  333. deviceId: null,
  334. suffix: null,
  335. rank: 5,
  336. uniformCode: "DI00007",
  337. stationId: "SXJ_KGDL_DJYF01_SBS",
  338. modelId: null,
  339. alarmType: "booststation",
  340. deviceType: "booststation",
  341. components: null,
  342. subcomponents: null,
  343. description: "复合信号虚装置全站事故总",
  344. characteristic: "事故",
  345. resetTable: false,
  346. enable: true,
  347. name: null,
  348. nemCode: null,
  349. faultCause: null,
  350. resolvent: null,
  351. stationName: "丁家窑风电场",
  352. componentsName: null,
  353. },
  354. {
  355. id: "001054",
  356. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS007DB0111SW01RAW00",
  357. triggerType: -1,
  358. deviceId: null,
  359. suffix: null,
  360. rank: 4,
  361. uniformCode: "DI00008",
  362. stationId: "SXJ_KGDL_DJYF01_SBS",
  363. modelId: null,
  364. alarmType: "booststation",
  365. deviceType: "booststation",
  366. components: null,
  367. subcomponents: null,
  368. description: "1#变压器高压侧201测控201断路器合位",
  369. characteristic: "动作",
  370. resetTable: false,
  371. enable: true,
  372. name: null,
  373. nemCode: null,
  374. faultCause: null,
  375. resolvent: null,
  376. stationName: "丁家窑风电场",
  377. componentsName: null,
  378. },
  379. {
  380. id: "001055",
  381. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS008DB0111SW02RAW00",
  382. triggerType: -1,
  383. deviceId: null,
  384. suffix: null,
  385. rank: 4,
  386. uniformCode: "DI00009",
  387. stationId: "SXJ_KGDL_DJYF01_SBS",
  388. modelId: null,
  389. alarmType: "booststation",
  390. deviceType: "booststation",
  391. components: null,
  392. subcomponents: null,
  393. description: "1#变压器高压侧201测控201-A刀闸合位",
  394. characteristic: "动作",
  395. resetTable: false,
  396. enable: true,
  397. name: null,
  398. nemCode: null,
  399. faultCause: null,
  400. resolvent: null,
  401. stationName: "丁家窑风电场",
  402. componentsName: null,
  403. },
  404. {
  405. id: "001056",
  406. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS009DB0111SW02RAW00",
  407. triggerType: -1,
  408. deviceId: null,
  409. suffix: null,
  410. rank: 4,
  411. uniformCode: "DI00010",
  412. stationId: "SXJ_KGDL_DJYF01_SBS",
  413. modelId: null,
  414. alarmType: "booststation",
  415. deviceType: "booststation",
  416. components: null,
  417. subcomponents: null,
  418. description: "1#变压器高压侧201测控201-1刀闸合位",
  419. characteristic: "动作",
  420. resetTable: false,
  421. enable: true,
  422. name: null,
  423. nemCode: null,
  424. faultCause: null,
  425. resolvent: null,
  426. stationName: "丁家窑风电场",
  427. componentsName: null,
  428. },
  429. {
  430. id: "001057",
  431. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS010DB0111SW05RAW00",
  432. triggerType: -1,
  433. deviceId: null,
  434. suffix: null,
  435. rank: 4,
  436. uniformCode: "DI00011",
  437. stationId: "SXJ_KGDL_DJYF01_SBS",
  438. modelId: null,
  439. alarmType: "booststation",
  440. deviceType: "booststation",
  441. components: null,
  442. subcomponents: null,
  443. description: "1#变压器高压侧201测控201-A0地刀合位",
  444. characteristic: "动作",
  445. resetTable: false,
  446. enable: true,
  447. name: null,
  448. nemCode: null,
  449. faultCause: null,
  450. resolvent: null,
  451. stationName: "丁家窑风电场",
  452. componentsName: null,
  453. },
  454. {
  455. id: "001058",
  456. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS011DB0111SW04RAW00",
  457. triggerType: -1,
  458. deviceId: null,
  459. suffix: null,
  460. rank: 4,
  461. uniformCode: "DI00012",
  462. stationId: "SXJ_KGDL_DJYF01_SBS",
  463. modelId: null,
  464. alarmType: "booststation",
  465. deviceType: "booststation",
  466. components: null,
  467. subcomponents: null,
  468. description: "1#变压器高压侧201测控201-10地刀合位",
  469. characteristic: "动作",
  470. resetTable: false,
  471. enable: true,
  472. name: null,
  473. nemCode: null,
  474. faultCause: null,
  475. resolvent: null,
  476. stationName: "丁家窑风电场",
  477. componentsName: null,
  478. },
  479. {
  480. id: "001059",
  481. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS012DB0111SW01RAW00",
  482. triggerType: -1,
  483. deviceId: null,
  484. suffix: null,
  485. rank: 4,
  486. uniformCode: "DI00013",
  487. stationId: "SXJ_KGDL_DJYF01_SBS",
  488. modelId: null,
  489. alarmType: "booststation",
  490. deviceType: "booststation",
  491. components: null,
  492. subcomponents: null,
  493. description: "1#变压器高压侧201测控201-变0地刀合位",
  494. characteristic: "动作",
  495. resetTable: false,
  496. enable: true,
  497. name: null,
  498. nemCode: null,
  499. faultCause: null,
  500. resolvent: null,
  501. stationName: "丁家窑风电场",
  502. componentsName: null,
  503. },
  504. {
  505. id: "001060",
  506. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS013DB0111SW03RAW00",
  507. triggerType: -1,
  508. deviceId: null,
  509. suffix: null,
  510. rank: 4,
  511. uniformCode: "DI00014",
  512. stationId: "SXJ_KGDL_DJYF01_SBS",
  513. modelId: null,
  514. alarmType: "booststation",
  515. deviceType: "booststation",
  516. components: null,
  517. subcomponents: null,
  518. description: "1#变压器高压侧201测控1#主变2010地刀合位",
  519. characteristic: "动作",
  520. resetTable: false,
  521. enable: true,
  522. name: null,
  523. nemCode: null,
  524. faultCause: null,
  525. resolvent: null,
  526. stationName: "丁家窑风电场",
  527. componentsName: null,
  528. },
  529. {
  530. id: "001061",
  531. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS014DB0111SW01RAW00",
  532. triggerType: -1,
  533. deviceId: null,
  534. suffix: null,
  535. rank: 4,
  536. uniformCode: "DI00015",
  537. stationId: "SXJ_KGDL_DJYF01_SBS",
  538. modelId: null,
  539. alarmType: "booststation",
  540. deviceType: "booststation",
  541. components: null,
  542. subcomponents: null,
  543. description: "1#主变35kV侧301进线断路器合位",
  544. characteristic: "动作",
  545. resetTable: false,
  546. enable: true,
  547. name: null,
  548. nemCode: null,
  549. faultCause: null,
  550. resolvent: null,
  551. stationName: "丁家窑风电场",
  552. componentsName: null,
  553. },
  554. {
  555. id: "001062",
  556. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS015DB0111SW01RAW00",
  557. triggerType: -1,
  558. deviceId: null,
  559. suffix: null,
  560. rank: 4,
  561. uniformCode: "DI00016",
  562. stationId: "SXJ_KGDL_DJYF01_SBS",
  563. modelId: null,
  564. alarmType: "booststation",
  565. deviceType: "booststation",
  566. components: null,
  567. subcomponents: null,
  568. description: "1#主变35kV侧301进线手车工作位置",
  569. characteristic: "动作",
  570. resetTable: false,
  571. enable: true,
  572. name: null,
  573. nemCode: null,
  574. faultCause: null,
  575. resolvent: null,
  576. stationName: "丁家窑风电场",
  577. componentsName: null,
  578. },
  579. {
  580. id: "001063",
  581. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS016DB0111SW11RAW00",
  582. triggerType: -1,
  583. deviceId: null,
  584. suffix: null,
  585. rank: 4,
  586. uniformCode: "DI00017",
  587. stationId: "SXJ_KGDL_DJYF01_SBS",
  588. modelId: null,
  589. alarmType: "booststation",
  590. deviceType: "booststation",
  591. components: null,
  592. subcomponents: null,
  593. description: "2#变压器高压侧202测控202断路器合位",
  594. characteristic: "动作",
  595. resetTable: false,
  596. enable: true,
  597. name: null,
  598. nemCode: null,
  599. faultCause: null,
  600. resolvent: null,
  601. stationName: "丁家窑风电场",
  602. componentsName: null,
  603. },
  604. {
  605. id: "001064",
  606. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS018DB0111SW01RAW00",
  607. triggerType: -1,
  608. deviceId: null,
  609. suffix: null,
  610. rank: 4,
  611. uniformCode: "DI00018",
  612. stationId: "SXJ_KGDL_DJYF01_SBS",
  613. modelId: null,
  614. alarmType: "booststation",
  615. deviceType: "booststation",
  616. components: null,
  617. subcomponents: null,
  618. description: "2#变压器高压侧202测控202-1刀闸合位",
  619. characteristic: "动作",
  620. resetTable: false,
  621. enable: true,
  622. name: null,
  623. nemCode: null,
  624. faultCause: null,
  625. resolvent: null,
  626. stationName: "丁家窑风电场",
  627. componentsName: null,
  628. },
  629. {
  630. id: "001065",
  631. tagId: "FD-DJY-YuanDong.140623F0221MDQ02GS019DB0111SW01RAW00",
  632. triggerType: -1,
  633. deviceId: null,
  634. suffix: null,
  635. rank: 4,
  636. uniformCode: "DI00019",
  637. stationId: "SXJ_KGDL_DJYF01_SBS",
  638. modelId: null,
  639. alarmType: "booststation",
  640. deviceType: "booststation",
  641. components: null,
  642. subcomponents: null,
  643. description: "2#变压器高压侧202测控202-A0地刀合位",
  644. characteristic: "动作",
  645. resetTable: false,
  646. enable: true,
  647. name: null,
  648. nemCode: null,
  649. faultCause: null,
  650. resolvent: null,
  651. stationName: "丁家窑风电场",
  652. componentsName: null,
  653. },
  654. ],
  655. modelList: [],
  656. visible: false,
  657. form: {},
  658. tableHeader: [
  659. { label: "序列号", prop: "id", align: "center" },
  660. { label: "统一编码", prop: "uniformCode", align: "center" },
  661. { label: "描述", prop: "description", align: "left", width: 180 },
  662. { label: "停机类型", prop: "characteristic", align: "center" },
  663. { label: "风机型号", prop: "modelId", align: "center" },
  664. { label: "报警类型", prop: "alarmTypeName", align: "center" },
  665. { label: "故障编码", prop: "nemCode", align: "center" },
  666. { label: "报警级别", prop: "rank", align: "center" },
  667. { label: "报警分类", prop: "deviceType", align: "center", minWidth: 50 },
  668. {
  669. label: "是否可以复位",
  670. prop: "resetTable",
  671. align: "center",
  672. minWidth: 50,
  673. },
  674. { label: "是否启用", prop: "enabled", align: "center", minWidth: 50 },
  675. {
  676. label: "关联部件",
  677. prop: "componentsName",
  678. align: "center",
  679. minWidth: 50,
  680. },
  681. ],
  682. });
  683. const query = reactive({
  684. pageNum: 1,
  685. pageSize: 19,
  686. stationId: "",
  687. modelId: "",
  688. name: "",
  689. });
  690. let total = ref(0);
  691. onMounted(() => {
  692. getStationList();
  693. getData();
  694. getequipmentmodel_list();
  695. });
  696. const dialogclose = () => {
  697. state.visible = false;
  698. getData();
  699. };
  700. const getData = async () => {
  701. const { data } = await windturbinebj_fetchTableData(query);
  702. data.records.forEach((ele) => {
  703. ele.alarmTypeName = warningClassIfyIdConvert(ele.alarmType);
  704. });
  705. state.tableData = data.records;
  706. total.value = data.total;
  707. };
  708. const handleInsert = () => {
  709. state.visible = true;
  710. };
  711. const handleEditClick = (row) => {
  712. console.warn(row);
  713. let obj = Object.assign({}, row);
  714. state.form = obj;
  715. state.visible = true;
  716. };
  717. //changeStation
  718. const changeStation = async () => {
  719. query.modelId = "";
  720. await getequipmentmodel_list();
  721. };
  722. // 机型
  723. const getequipmentmodel_list = async () => {
  724. const { data } = await getWtModel(query.stationId);
  725. state.modelList = data || [];
  726. };
  727. // 分页导航
  728. const handlePageChange = (val) => {
  729. query.pageNum = val;
  730. getData();
  731. };
  732. const tableHeader = [
  733. "id",
  734. "报警级别(ZC_BJ:运转正常;YJ_BJ:运转状态超出标准范围;GZ_BJ:非正常停止运转;WH_BJ:停机维护;XD_BJ:限电/计划停机)",
  735. "制造商(HFYG_CS:合肥阳光电源有限公司;AMS_CS:艾默生;NRJD_CS:国电南瑞吉电新能源;MGSK_CS:美国赛康;LHDL_CS:联合动力;SYHC_CS:沈阳华创)",
  736. "名称",
  737. "上一级节点",
  738. "是否有子节点",
  739. "序列号",
  740. "类别 :正常停机,正常启动,快速停机,紧急停机",
  741. "风机型号",
  742. "全部默认为1",
  743. "统一编码",
  744. "是否展示(0:是;1:否)",
  745. "报警分类(bj:变桨;bpq:变频器;clx:齿轮箱;fdj:发电机;hh:滑环;jcjr:机舱加热;lq:冷却;ph:偏航;rh:润滑;yy:液压;zz:主轴;other:其它;kz:控制;yl:叶轮;jc:机舱;xb:箱变;dw:电网;td:塔底;fsy:风速仪)",
  746. "消缺规定时间",
  747. "是否可以复位(0:是;1:否)",
  748. "报警类型编号",
  749. "故障编码",
  750. "关联部件",
  751. ];
  752. const tableKey = [
  753. "id",
  754. "levelId",
  755. "manufacturerCode",
  756. "chineseText",
  757. "parentId",
  758. "isleaf",
  759. "sequenceNumber",
  760. "characteristic",
  761. "modelId",
  762. "codeName",
  763. "ednaValue",
  764. "display",
  765. "warningClassIfyId",
  766. "standardTime",
  767. "isreset",
  768. "warningTypeId",
  769. "faultCode",
  770. "relatedParts",
  771. ];
  772. // 批量导出
  773. const export2Excel = async () => {
  774. const res = await windturbinebj_fetchTableData({
  775. ...query,
  776. pageNum: 1,
  777. pageSize: 999999,
  778. });
  779. outExportExcel(
  780. state.tableHeader.map((item) => item.label),
  781. state.tableHeader.map((item) => item.prop),
  782. res.data.records.map((item) => {
  783. return {
  784. ...item,
  785. rank: levelIdConvert(item.rank),
  786. alarmTypeName: warningClassIfyIdConvert(item.alarmType),
  787. deviceType: warningClassIfyIdConvert(item.deviceType),
  788. enabled: item.enabled == 1 ? "是" : "否",
  789. resetTable: item.resetTable ? "是" : "否",
  790. };
  791. }),
  792. "设备报警配置导出excel"
  793. );
  794. };
  795. // 模板下载
  796. const outExe = () => {
  797. const data = [];
  798. ElMessage.success(`导出成功!`);
  799. outExportExcel(tableHeader, tableKey, data, "风机报警模板");
  800. };
  801. // 批量导入
  802. const handleSuccess = (response, file, fileList) => {
  803. ElMessage.success("导入成功!");
  804. getData();
  805. };
  806. const handleProgress = (response, file, fileList) => {};
  807. const handleError = (response, file, fileList) => {
  808. ElMessage.success("导入失败!");
  809. };
  810. // 报警级别
  811. const levelIdConvert = (val) => {
  812. switch (val) {
  813. case 1:
  814. return "低级";
  815. case 2:
  816. return "低中级";
  817. case 3:
  818. return "中级";
  819. case 4:
  820. return "中高级";
  821. case 5:
  822. return "高级";
  823. default:
  824. return "";
  825. }
  826. };
  827. // 报警分类
  828. const warningClassIfyIdConvert = (val) => {
  829. switch (val) {
  830. case "interver":
  831. return "光伏";
  832. case "windturbine":
  833. return "风机";
  834. case "booststation":
  835. return "升压站";
  836. default:
  837. return "";
  838. }
  839. };
  840. // 统一编码
  841. const ednaValueConvert = (val) => {
  842. if (val === 0) {
  843. return "";
  844. } else if (val < 100 && val > 0) {
  845. return "DI0" + val;
  846. } else if (val >= 100) {
  847. return "DI" + val;
  848. }
  849. };
  850. </script>
  851. <style scoped lang="less">
  852. .wind-table {
  853. height: calc(100% - 40px);
  854. }
  855. .buttons {
  856. background-color: rgba(5, 187, 76, 0.2);
  857. border: 1px solid #3b6c53;
  858. color: #b3b3b3;
  859. font-size: 14px;
  860. &:hover {
  861. background-color: rgba(5, 187, 76, 0.5);
  862. color: #ffffff;
  863. }
  864. }
  865. .el-select ::v-deep {
  866. margin-right: 10px;
  867. }
  868. .el-button + .el-button {
  869. margin-left: 10px;
  870. }
  871. .pagination {
  872. padding-top: 15px;
  873. }
  874. </style>