windturbine.vue 24 KB

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