InterlockSummaryList.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <!-- <a-form layout="inline" @keyup.enter.native="searchQuery"> -->
  6. <div class="iotmenu-search-container">
  7. <!-- <div v-if="clickSystemNode.interlockType === '1'" class="item-search-btn">
  8. <a-button v-has="'add:summary'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
  9. </div> -->
  10. <div v-if="clickSystemNode.interlockType === '1' && clickSystemNode.limitType === '0'" class="item-search-btn">
  11. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  12. </div>
  13. <div class="item-search">
  14. <a-input placeholder="联锁名称" v-model="queryParam.interlockname" allow-clear @change="searchQuery">
  15. <a-icon slot="prefix" type="search" />
  16. </a-input>
  17. </div>
  18. <div class="item-search">
  19. <a-input placeholder="联锁条件" v-model="queryParam.interlockConditionTag" allow-clear @change="searchQuery">
  20. <a-icon slot="prefix" type="search" />
  21. </a-input>
  22. </div>
  23. <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
  24. <a-select placeholder="仪表状态" v-model="queryParam.instrumentStatus" allowClear :options="instrumentOptions" @change="searchQuery"></a-select>
  25. </div>
  26. <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
  27. <a-select placeholder="控制系统状态" v-model="queryParam.controlSystemStatus" allowClear :options="controlSystemOptions" @change="searchQuery"></a-select>
  28. </div>
  29. <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
  30. <a-select placeholder="旁路状态" v-model="queryParam.bypass" allowClear :options="bypassOptions" @change="searchQuery"></a-select>
  31. </div>
  32. <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
  33. <!-- <j-dict-select-tag v-model="queryParam.interlockStatus" placeholder="联锁状态" dictCode="interlock_status" @change="searchQuery"/> -->
  34. <a-select placeholder="联锁状态" v-model="queryParam.interlockStatus" allowClear :options="interlockOptions" @change="searchQuery"></a-select>
  35. </div>
  36. <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
  37. <a-select placeholder="回路健康级别" v-model="queryParam.loopHealthLevel" allowClear :options="healthLevelOption" @change="searchQuery"></a-select>
  38. </div>
  39. </div>
  40. <!-- <a-row :gutter="24">
  41. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  42. </a-col>
  43. <template v-if="toggleSearchStatus">
  44. </template>
  45. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  46. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  47. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  48. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  49. <a @click="handleToggleSearch" style="margin-left: 8px">
  50. {{ toggleSearchStatus ? '收起' : '展开' }}
  51. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  52. </a>
  53. </span>
  54. </a-col>
  55. </a-row> -->
  56. <!-- </a-form> -->
  57. </div>
  58. <!-- 查询区域-END -->
  59. <!-- 操作按钮区域 -->
  60. <div class="table-operator">
  61. <!-- <a-button v-if="selectData.interlockType == '1'" v-has="'add:summary'" @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
  62. <!-- <a-button type="primary" icon="download" @click="handleExportXls('联锁总表')">导出</a-button>
  63. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  64. <a-button type="primary" icon="import">导入</a-button>
  65. </a-upload> -->
  66. <!-- 高级查询区域 -->
  67. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  68. <a-dropdown v-if="selectedRowKeys.length > 0">
  69. <a-menu slot="overlay">
  70. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  71. </a-menu>
  72. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  73. </a-dropdown> -->
  74. </div>
  75. <!-- table区域-begin -->
  76. <div>
  77. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;padding-left: 18px;">
  78. <span style="color: #a3a3a3;">回路健康级别:A代表回路健康;B代表回路有故障;C代表回路有严重故障;D代表回路失效;</span>
  79. </div> -->
  80. <a-table
  81. ref="table"
  82. size="middle"
  83. :scroll="{x:true}"
  84. bordered
  85. rowKey="id"
  86. :columns="columns"
  87. :dataSource="dataSource"
  88. :pagination="ipagination"
  89. :loading="loading"
  90. class="j-table-force-nowrap"
  91. @change="handleTableChange">
  92. <!-- :customRow="customRow" -->
  93. <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
  94. <!-- 表头注释 -->
  95. <span slot="loopHealthLevelTitle">
  96. 回路健康级别
  97. <a-tooltip placement="top">
  98. <template slot="title">
  99. <span> A-健康;B-故障;C-严重故障;D-失效 </span>
  100. <!-- <span> A代表回路健康;B代表回路有故障;C代表回路有严重故障;D代表回路失效; </span> -->
  101. </template>
  102. <a-icon type="question-circle" />
  103. </a-tooltip>
  104. </span>
  105. <!-- 仪表状态 -->
  106. <span slot="instrumentStatus" slot-scope="text, record">
  107. <span :class="record.instrumentStatus === record.instrumentStatusNormal ? 'normal-tag':'abnormal-tag'">
  108. {{ text }}
  109. </span>
  110. <!-- <a-tag :color="record.instrumentStatus === record.instrumentStatusNormal ? 'green':'orange'">
  111. {{ text }}
  112. </a-tag> -->
  113. </span>
  114. <!-- 控制系统状态 -->
  115. <span slot="controlSystemStatus" slot-scope="text, record">
  116. <span :class="record.controlSystemStatus === record.controlSystemStatusNormal ? 'normal-tag':'abnormal-tag'">
  117. {{ text }}
  118. </span>
  119. </span>
  120. <!-- 旁路状态 -->
  121. <span slot="bypassStatus" slot-scope="text, record">
  122. <span :class="record.bypass === record.bypassYes ? 'normal-tag':'abnormal-tag'">
  123. {{ text }}
  124. </span>
  125. </span>
  126. <!-- 联锁状态 -->
  127. <!-- <span slot="interlockStatus" slot-scope="text, record">
  128. <a-tag :color="record.bypass === record.bypassYes ? 'green':'orange'">
  129. {{ text }}
  130. </a-tag>
  131. </span> -->
  132. <!-- <span slot="action" slot-scope="text, record">
  133. <a @click="handleEdit(record)">编辑</a>
  134. <a-divider type="vertical" />
  135. <a-dropdown>
  136. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  137. <a-menu slot="overlay">
  138. <a-menu-item>
  139. <a @click="handleDetail(record)">详情</a>
  140. </a-menu-item>
  141. <a-menu-item>
  142. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  143. <a>删除</a>
  144. </a-popconfirm>
  145. </a-menu-item>
  146. </a-menu>
  147. </a-dropdown>
  148. </span> -->
  149. </a-table>
  150. </div>
  151. <interlock-summary-modal ref="modalForm" @ok="modalFormOk"></interlock-summary-modal>
  152. </a-card>
  153. </template>
  154. <script>
  155. import '@/assets/less/TableExpand.less'
  156. import { mixinDevice } from '@/utils/mixin'
  157. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  158. import InterlockSummaryModal from './modules/InterlockSummaryModal'
  159. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  160. import { httpAction, getAction } from '@/api/manage'
  161. import { colAuthFilter } from "@/utils/authFilter"
  162. import cookie from 'js-cookie'
  163. export default {
  164. name: 'InterlockSummaryList',
  165. mixins:[JeecgListMixin, mixinDevice],
  166. components: {
  167. InterlockSummaryModal
  168. },
  169. data () {
  170. return {
  171. description: '联锁总表管理页面',
  172. // 表头
  173. columns: [
  174. // {
  175. // title: '序号',
  176. // dataIndex: '',
  177. // key:'rowIndex',
  178. // width:60,
  179. // align:"center",
  180. // customRender:function (t,r,index) {
  181. // return parseInt(index)+1;
  182. // }
  183. // },
  184. // {
  185. // title:'装置',
  186. // align:"center",
  187. // // width: 100,
  188. // dataIndex: 'interlockApparatusName',
  189. // customRender:(text,record,index)=> {
  190. // return {children: record.interlockApparatusName,attrs: {rowSpan:record.rowSpan}};
  191. // },
  192. // },
  193. // {
  194. // title:'系统',
  195. // align:"center",
  196. // // width: 100,
  197. // dataIndex: 'interlockSystemName',
  198. // customRender:(text,record,index)=> {
  199. // return {children: record.interlockSystemName,attrs: {rowSpan:record.rowSpan}};
  200. // },
  201. // },
  202. {
  203. title:'联锁名称',
  204. align:"center",
  205. // width: 100,
  206. dataIndex: 'interlockname',
  207. customRender:(text,record,index)=> {
  208. var children = (
  209. <a-tooltip>
  210. <template slot="title">
  211. { record.interlockApparatusName } -- { record.interlockSystemName }
  212. </template>
  213. { record.interlockname }
  214. </a-tooltip>
  215. )
  216. return {
  217. children: [children],
  218. attrs: {rowSpan:record.rowSpan}
  219. }
  220. },
  221. customCell: (record, index)=>{ return this.customCellDetail(record, index)}
  222. // sorter: (a, b) => a.interlockname - b.interlockname,
  223. },
  224. {
  225. title:'联锁条件',
  226. align:"center",
  227. // width: 100,
  228. dataIndex: 'interlockConditionTag'
  229. },
  230. {
  231. title:'仪表状态',
  232. align:"center",
  233. // width: 100,
  234. dataIndex: 'instrumentStatusName',
  235. scopedSlots: { customRender: 'instrumentStatus' }
  236. },
  237. // {
  238. // title:'系统id',
  239. // align:"center",
  240. // dataIndex: 'interlockSystemId'
  241. // },
  242. // {
  243. // title:'装置id',
  244. // align:"center",
  245. // dataIndex: 'interlockApparatusId'
  246. // },
  247. {
  248. title:'控制系统状态',
  249. align:"center",
  250. // width: 120,
  251. dataIndex: 'controlSystemStatusName',
  252. scopedSlots: { customRender: 'controlSystemStatus' }
  253. },
  254. {
  255. title:'旁路状态',
  256. align:"center",
  257. // width: 100,
  258. dataIndex: 'bypassName',
  259. scopedSlots: { customRender: 'bypassStatus' }
  260. },
  261. {
  262. title:'联锁状态',
  263. align:"center",
  264. // width: 100,
  265. dataIndex: 'interlockStatusName',
  266. customRender:function (text,record,index) {
  267. let classTag = {
  268. class: `${record.interlockStatus === record.interlockStatusTy ? 'normal-tag':'abnormal-tag'}`
  269. }
  270. return {
  271. children: (
  272. <span {...classTag}>{text}</span>
  273. ),
  274. attrs: {rowSpan:record.rowSpan2}
  275. };
  276. },
  277. },
  278. {
  279. // title:'回路健康级别',
  280. align:"center",
  281. // width: 150,
  282. dataIndex: 'loopHealthLevel',
  283. slots: { title: 'loopHealthLevelTitle' },
  284. customRender:(text,record,index)=> {
  285. var children
  286. if(text === 'A'){
  287. children = (<span style="color: #52c41a;font-weight: 600;">{text}</span>)
  288. // children = (<a-tag style="color: red">{text}</a-tag>)
  289. }
  290. if(text === 'B'){
  291. children = (<span style="color: #FFE31F;font-weight: 600;">{text}</span>)
  292. }
  293. if(text === 'C'){
  294. children = (<span style="color: #FFA300;font-weight: 600;">{text}</span>)
  295. }
  296. if(text === 'D'){
  297. children = (<span style="color: #FF0000;font-weight: 600;">{text}</span>)
  298. }
  299. return {children: children, attrs: {rowSpan:record.rowSpan3}};
  300. },
  301. },
  302. // {
  303. // title:'逻辑关系',
  304. // align:"center",
  305. // dataIndex: 'ljgx'
  306. // },
  307. // {
  308. // title:'联锁输出值',
  309. // align:"center",
  310. // dataIndex: 'interlockOutValue'
  311. // },
  312. // {
  313. // title:'联锁输出值点位',
  314. // align:"center",
  315. // dataIndex: 'interlockOutValueTag'
  316. // },
  317. // {
  318. // title:'备注',
  319. // align:"center",
  320. // dataIndex: 'remark'
  321. // },
  322. {
  323. title: '操作',
  324. dataIndex: 'action',
  325. align:"center",
  326. fixed:"right",
  327. width: 100,
  328. // auth: 'testdemo:action',
  329. // scopedSlots: { customRender: 'action' },
  330. customRender: (text,record,index)=> {
  331. if(this.isSysManage || record.limitType === '0'){
  332. var onlyViewEdit = (
  333. <span class="edit-view-btn"></span>
  334. )
  335. var onlyViewDel = (
  336. <span class="delete-view-btn"></span>
  337. )
  338. var childrenEdit = (
  339. <a-tooltip>
  340. <template slot="title">
  341. 设置
  342. </template>
  343. <span class="edit-btn" onclick={() => { this.handleEdit(record) }}></span>
  344. </a-tooltip>
  345. )
  346. // var childrenEdit = (<a onclick={() => { this.handleEdit(record) }}>编辑</a>)
  347. // var childrenDivider = (<a-divider type="vertical"/>)
  348. // <a-popconfirm title="确定删除吗?" onConfirm={() => this.handleDelete(record.summaryid)}>
  349. // <a>删除</a>
  350. // </a-popconfirm>
  351. var childrenMore = (
  352. <a-popconfirm title="确定删除吗?" onConfirm={() => this.handleDelete(record.summaryid)}>
  353. <a-tooltip>
  354. <template slot="title">
  355. 删除
  356. </template>
  357. <span class="delete-btn"></span>
  358. </a-tooltip>
  359. </a-popconfirm>
  360. )
  361. return {
  362. children: [childrenEdit,childrenMore],
  363. // children: record.limitType === '0' ? [childrenEdit,childrenMore] : [onlyViewEdit, onlyViewDel],
  364. attrs: {
  365. rowSpan: record.rowSpan
  366. }
  367. }
  368. } else {
  369. return {
  370. children: (
  371. <span> - </span>
  372. ),
  373. attrs: {
  374. rowSpan: record.rowSpan
  375. }
  376. }
  377. }
  378. },
  379. }
  380. ],
  381. url: {
  382. list: "detail/interlockDetail/listPageByUser",
  383. // list: "/detail/interlockDetail/list1",
  384. delete: "/summary/interlockSummary/delete",
  385. deleteBatch: "/summary/interlockSummary/deleteBatch",
  386. exportXlsUrl: "/summary/interlockSummary/exportXls",
  387. importExcelUrl: "summary/interlockSummary/importExcel",
  388. },
  389. // 回路健康级别下拉列表
  390. healthLevelOption: [
  391. {value: 'A', label: 'A'},
  392. {value: 'B', label: 'B'},
  393. {value: 'C', label: 'C'},
  394. {value: 'D', label: 'D'},
  395. ],
  396. dictOptions:{},
  397. superFieldList:[],
  398. // mouseSummaryid: '', // 用于合并单元格悬浮样式设置
  399. // 当前系统默认值
  400. instrumentOptions: [], // 仪表状态
  401. controlSystemOptions: [], // 控制系统状态
  402. bypassOptions: [], // 旁路状态
  403. interlockOptions: [], // 联锁状态
  404. }
  405. },
  406. created() {
  407. this.columns = colAuthFilter(this.columns,'testdemo:');
  408. this.loadData();
  409. this.initDictConfig();
  410. this.getSuperFieldList();
  411. },
  412. computed: {
  413. importExcelUrl: function(){
  414. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  415. },
  416. clickSystemNode() {
  417. /** 其中:interlockType判断点击的是否为系统(0为装置,1为系统,2为未选中) */
  418. return this.$store.getters.clickSystemNode
  419. },
  420. isSysManage(){
  421. // return cookie.get('SSORole') === 'globalAdmin'
  422. return this.$store.getters.userInfo.role === '0'
  423. },
  424. },
  425. methods: {
  426. // 合并后悬浮行背景色一起显示--后来取消此需求
  427. // customRow(record, index) {
  428. // return {
  429. // style: {
  430. // //样式
  431. // 'background-color': record.summaryid === this.mouseSummaryid ? '#e6faff' : ''
  432. // },
  433. // on: {
  434. // // 鼠标移入
  435. // mouseenter: event => {
  436. // // 维护一个变量记录当前行id 因为我是根据id来进行行合并的
  437. // this.mouseSummaryid = record.summaryid
  438. // },
  439. // //移除 清除id 还原样式
  440. // mouseleave: (event) => {
  441. // this.mouseSummaryid = ''
  442. // },
  443. // // 点击合并行颜色未一起改变-待优化
  444. // click: (event) => {
  445. // this.mouseSummaryid = record.summaryid
  446. // },
  447. // }
  448. // }
  449. // },
  450. // 单元格点击事件
  451. customCellDetail(record, index, columnValue, columnTitle){
  452. return {
  453. style: {
  454. 'color': "#008cd6 !important",
  455. 'cursor': "pointer",
  456. 'font-size': "16px",
  457. 'font-weight': "700",
  458. },
  459. on: {
  460. // 点击事件
  461. click: (event) => {
  462. // this.$router.push({path: '/interLock/detail',query:{summaryid:record.summaryid,interlockSystemId:record.interlockSystemId}})
  463. var data = {
  464. summaryid: record.summaryid,
  465. interlockSystemId: record.interlockSystemId,
  466. detailName: record.interlockname,
  467. }
  468. this.$emit('click', data)
  469. },
  470. }
  471. }
  472. },
  473. changeSystemDefaulOptions(){
  474. },
  475. // 获得当前系统设置的默认参数
  476. getSystemDefaulOptions(){
  477. getAction('/base/interlockBase/queryById', {id: this.clickSystemNode.id}).then((res) => {
  478. console.log(res)
  479. var result = res.result
  480. // let numbers = [];
  481. // let words = [];
  482. // 使用正则表达式分割字符串
  483. // let parts = result.instrumentStatusNormal_dictText.split(/(\d+)/)
  484. // console.log(parts)
  485. // 循环处理分割结果
  486. // parts.forEach(part => {
  487. // if (part.match(/\d+/)) { // 匹配数字
  488. // numbers.push(Number(part));
  489. // } else if (part) { // 匹配非数字符号
  490. // words.push(part);
  491. // }
  492. // });
  493. if(result.bypassYes === '0'){
  494. this.bypassOptions = [
  495. { value: '0', title: result.bypassYesName },
  496. { value: '1', title: result.bypassNoName },
  497. ]
  498. } else {
  499. this.bypassOptions = [
  500. { value: '0', title: result.bypassNoName },
  501. { value: '1', title: result.bypassYesName },
  502. ]
  503. }
  504. if(result.controlSystemStatusNormal === '0'){
  505. this.controlSystemOptions = [
  506. { value: '0', title: result.controlSystemStatusNormalName },
  507. { value: '1', title: result.controlSystemStatusAbnormalName },
  508. ]
  509. } else {
  510. this.controlSystemOptions = [
  511. { value: '0', title: result.controlSystemStatusAbnormalName },
  512. { value: '1', title: result.controlSystemStatusNormalName },
  513. ]
  514. }
  515. if(result.instrumentStatusNormal === '0'){
  516. this.instrumentOptions = [
  517. { value: '0', title: result.instrumentStatusNormalName },
  518. { value: '1', title: result.instrumentStatusAbnormalName },
  519. ]
  520. } else {
  521. this.instrumentOptions = [
  522. { value: '0', title: result.instrumentStatusAbnormalName },
  523. { value: '1', title: result.instrumentStatusNormalName },
  524. ]
  525. }
  526. if(result.interlockStatusTy === '0'){
  527. this.interlockOptions = [
  528. { value: '0', title: result.interlockStatusTyName },
  529. { value: '1', title: result.interlockStatusWtyName },
  530. ]
  531. } else {
  532. this.interlockOptions = [
  533. { value: '0', title: result.interlockStatusWtyName },
  534. { value: '1', title: result.interlockStatusTyName },
  535. ]
  536. }
  537. })
  538. },
  539. loadData(arg) {
  540. let that = this
  541. if(!this.url.list){
  542. this.$message.error("请设置url.list属性!")
  543. return
  544. }
  545. //加载数据 若传入参数1则加载第一页的内容
  546. if (arg === 1) {
  547. this.ipagination.current = 1;
  548. }
  549. var params = this.getQueryParams();//查询条件
  550. this.loading = true;
  551. // 左右两边重置分别控制各自的,所以转换数据换到这里
  552. if (this.clickSystemNode.interlockType == 1) {
  553. this.getSystemDefaulOptions()
  554. params.interlockApparatusId = ''
  555. params.interlockSystemId = this.clickSystemNode.id
  556. } else {
  557. params.interlockSystemId = ''
  558. params.interlockApparatusId = this.clickSystemNode.id
  559. }
  560. getAction(this.url.list, params).then((res) => {
  561. if (res.success) {
  562. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  563. this.dataSource = res.result.records||res.result;
  564. if(res.result.total)
  565. {
  566. // 合并单元格
  567. //判断跨行
  568. let rowSpan = 0
  569. let rowSpan2 = 0
  570. let rowSpan3 = 0
  571. let interlockname = ''
  572. let interlocknamePD = ''
  573. let interlockStatus = ''
  574. let loopHealthLevel = ''
  575. for (let i = that.dataSource.length-1; i >= 0; i--) {
  576. // 联锁名称合并
  577. if (interlockname == '') {
  578. that.dataSource[i].rowSpan = 0
  579. interlockname = that.dataSource[i].interlockname
  580. rowSpan++
  581. } else {
  582. if(interlockname == that.dataSource[i].interlockname){
  583. that.dataSource[i].rowSpan = 0
  584. rowSpan++
  585. }else{
  586. that.dataSource[i+1].rowSpan = rowSpan
  587. that.dataSource[i].rowSpan = 0
  588. rowSpan = 1
  589. interlockname = that.dataSource[i].interlockname
  590. }
  591. }
  592. // 联锁状态合并
  593. if (interlockStatus == '') {
  594. that.dataSource[i].rowSpan2 = 0
  595. interlockStatus = that.dataSource[i].interlockStatus
  596. interlocknamePD = that.dataSource[i].interlockname
  597. rowSpan2++
  598. } else {
  599. if(interlockStatus == that.dataSource[i].interlockStatus){
  600. // that.dataSource[i].rowSpan2 = 0
  601. // rowSpan2++
  602. if (interlocknamePD == that.dataSource[i].interlockname) {
  603. that.dataSource[i].rowSpan2 = 0
  604. rowSpan2++
  605. } else {
  606. that.dataSource[i+1].rowSpan2 = rowSpan2
  607. that.dataSource[i].rowSpan2 = 0
  608. rowSpan2 = 1
  609. interlockStatus = that.dataSource[i].interlockStatus
  610. interlocknamePD = that.dataSource[i].interlockname
  611. }
  612. }else{
  613. that.dataSource[i+1].rowSpan2 = rowSpan2
  614. that.dataSource[i].rowSpan2 = 0
  615. rowSpan2 = 1
  616. interlockStatus = that.dataSource[i].interlockStatus
  617. interlocknamePD = that.dataSource[i].interlockname
  618. }
  619. }
  620. // 回路健康级别合并
  621. if (loopHealthLevel === '') {
  622. // console.log('第一层')
  623. that.dataSource[i].rowSpan3 = 0
  624. // // 判断回路健康级别是否为空(不会出现此类问题)
  625. // if (that.dataSource[i].loopHealthLevel != '') {
  626. // console.log('走不走这步')
  627. // loopHealthLevel = that.dataSource[i].loopHealthLevel
  628. // interlocknamePD = that.dataSource[i].interlockname
  629. // rowSpan3++
  630. // }
  631. loopHealthLevel = that.dataSource[i].loopHealthLevel
  632. interlocknamePD = that.dataSource[i].interlockname
  633. rowSpan3++
  634. } else {
  635. if(loopHealthLevel == that.dataSource[i].loopHealthLevel){
  636. // console.log(99,i,interlocknamePD,that.dataSource[i+1].interlockname)
  637. if (interlocknamePD == that.dataSource[i+1].interlockname) {
  638. // console.log(11111)
  639. that.dataSource[i].rowSpan3 = 0
  640. rowSpan3++
  641. } else {
  642. // console.log(22222)
  643. that.dataSource[i+1].rowSpan3 = rowSpan3
  644. that.dataSource[i].rowSpan3 = 0
  645. rowSpan3 = 1
  646. loopHealthLevel = that.dataSource[i].loopHealthLevel
  647. interlocknamePD = that.dataSource[i].interlockname
  648. }
  649. }else{
  650. // console.log('第二层else')
  651. that.dataSource[i+1].rowSpan3 = rowSpan3
  652. that.dataSource[i].rowSpan3 = 0
  653. rowSpan3 = 1
  654. loopHealthLevel = that.dataSource[i].loopHealthLevel
  655. interlocknamePD = that.dataSource[i].interlockname
  656. }
  657. }
  658. }
  659. that.dataSource[0].rowSpan = rowSpan
  660. that.dataSource[0].rowSpan2 = rowSpan2
  661. that.dataSource[0].rowSpan3 = rowSpan3
  662. // console.log(22222222222,that.dataSource)
  663. // console.log('返回的是',res.result.total)
  664. this.ipagination.total = res.result.total;
  665. // console.log('页码',this.ipagination.total)
  666. }else{
  667. this.ipagination.total = 0;
  668. }
  669. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  670. }else{
  671. this.$message.warning(res.message)
  672. }
  673. }).finally(() => {
  674. this.loading = false
  675. })
  676. },
  677. // 新增传值
  678. handleAdd() {
  679. this.$store.commit('SET_SUMMARYTYPE', '新增');
  680. this.$router.push({path: '/interLock/summary/set'})
  681. },
  682. handleEdit(record){
  683. this.$store.commit('SET_SUMMARYEDITINFO', record);
  684. this.$store.commit('SET_SUMMARYTYPE', '编辑');
  685. this.$router.push({path: '/interLock/summary/set'})
  686. },
  687. initDictConfig(){
  688. },
  689. getSuperFieldList(){
  690. let fieldList=[];
  691. fieldList.push({type:'string',value:'interlockname',text:'联锁名称',dictCode:''})
  692. fieldList.push({type:'string',value:'interlockSystemId',text:'系统id',dictCode:''})
  693. fieldList.push({type:'string',value:'interlockApparatusId',text:'装置id',dictCode:''})
  694. fieldList.push({type:'string',value:'interlockStatus',text:'联锁状态',dictCode:'interlock_status'})
  695. fieldList.push({type:'string',value:'loopHealthLevel',text:'回路健康级别',dictCode:''})
  696. fieldList.push({type:'string',value:'ljgx',text:'逻辑关系',dictCode:''})
  697. fieldList.push({type:'string',value:'interlockOutValue',text:'联锁输出值',dictCode:''})
  698. fieldList.push({type:'string',value:'interlockOutValueTag',text:'联锁输出值点位',dictCode:''})
  699. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  700. this.superFieldList = fieldList
  701. }
  702. }
  703. }
  704. </script>
  705. <style scoped>
  706. @import '~@assets/less/common.less';
  707. </style>
  708. <style lang="less" scoped>
  709. // ::v-deep(.ant-table-header) {
  710. // // 手动的添加隐藏样式
  711. // overflow-y: hidden !important;
  712. // // 设置表头右侧内边距 手动对齐
  713. // padding-right: 6px;
  714. // }
  715. // /deep/.ant-table-body::-webkit-scrollbar {
  716. // display: none;
  717. // }
  718. // /deep/.ant-table-header{
  719. // overflow-y: hidden!important;
  720. // }
  721. // .ant-table-cell {
  722. // white-space: nowrap
  723. // }
  724. /* 设置表格宽度自适应 */
  725. // .ant-table-body {
  726. // overflow-x: auto;
  727. // }
  728. </style>