InterlockSummaryDetailList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <template>
  2. <div>
  3. <div class="interlock-detail-header">
  4. <a-icon type="arrow-left" @click="goBack"/>
  5. <span>{{currentData.detailName ? currentData.detailName : '详情'}}</span>
  6. </div>
  7. <div class="iotmenu-content">
  8. <a-card :bordered="false" style="background-color: #FAFAFA;">
  9. <!-- 查询区域 -->
  10. <div class="table-page-search-wrapper">
  11. <div class="iotmenu-search-container">
  12. <div class="item-search">
  13. <a-input placeholder="请输入联锁条件" v-model="queryParam.interlockConditionTag" @change="searchQuery"></a-input>
  14. </div>
  15. </div>
  16. </div>
  17. <!-- <div class="table-page-search-wrapper">
  18. <a-form layout="inline" @keyup.enter.native="searchQuery">
  19. <a-row :gutter="24">
  20. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  21. <a-form-item label="联锁条件">
  22. <a-input placeholder="请输入联锁条件" v-model="queryParam.interlockConditionTag"></a-input>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  26. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  27. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  28. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  29. <a @click="handleToggleSearch" style="margin-left: 8px">
  30. {{ toggleSearchStatus ? '收起' : '展开' }}
  31. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  32. </a>
  33. </span>
  34. </a-col>
  35. </a-row>
  36. </a-form>
  37. </div> -->
  38. <!-- 查询区域-END -->
  39. <!-- 操作按钮区域 -->
  40. <!-- <div class="table-operator">
  41. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  42. <a-button type="primary" icon="download" @click="handleExportXls('联锁详细信息表')">导出</a-button>
  43. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  44. <a-button type="primary" icon="import">导入</a-button>
  45. </a-upload> -->
  46. <!-- 高级查询区域 -->
  47. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  48. <a-dropdown v-if="selectedRowKeys.length > 0">
  49. <a-menu slot="overlay">
  50. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  51. </a-menu>
  52. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  53. </a-dropdown>
  54. </div> -->
  55. <!-- table区域-begin -->
  56. <div>
  57. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  58. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  59. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  60. </div> -->
  61. <a-table
  62. ref="table"
  63. size="middle"
  64. :scroll="{x:true}"
  65. bordered
  66. rowKey="id"
  67. :columns="columns"
  68. :dataSource="dataSource"
  69. :pagination="ipagination"
  70. :loading="loading"
  71. class="j-table-force-nowrap"
  72. @change="handleTableChange">
  73. <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
  74. <!-- 输入卡件状态 -->
  75. <span slot="inputStatus" slot-scope="text, record">
  76. <span :class="record.inputStatus === record.controlSystemStatusNormal ? 'normal-tag':'abnormal-tag'">
  77. {{ text }}
  78. </span>
  79. </span>
  80. <!-- 输出卡件状态 -->
  81. <span slot="outputStatus" slot-scope="text, record">
  82. <span :class="record.outputStatus === record.controlSystemStatusNormal ? 'normal-tag':'abnormal-tag'">
  83. {{ text }}
  84. </span>
  85. </span>
  86. <!-- MP状态 -->
  87. <span slot="mpStatus" slot-scope="text, record">
  88. <span :class="record.mpStatus === record.controlSystemStatusNormal ? 'normal-tag':'abnormal-tag'">
  89. {{ text }}
  90. </span>
  91. </span>
  92. <template slot="htmlSlot" slot-scope="text">
  93. <div v-html="text"></div>
  94. </template>
  95. <template slot="imgSlot" slot-scope="text,record">
  96. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  97. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  98. </template>
  99. <template slot="fileSlot" slot-scope="text">
  100. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  101. <a-button
  102. v-else
  103. :ghost="true"
  104. type="primary"
  105. icon="download"
  106. size="small"
  107. @click="downloadFile(text)">
  108. 下载
  109. </a-button>
  110. </template>
  111. <span slot="action" slot-scope="text, record">
  112. <a @click="handleEdit(record)">编辑</a>
  113. <a-divider type="vertical" />
  114. <a-dropdown>
  115. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  116. <a-menu slot="overlay">
  117. <a-menu-item>
  118. <a @click="handleDetail(record)">详情</a>
  119. </a-menu-item>
  120. <a-menu-item>
  121. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  122. <a>删除</a>
  123. </a-popconfirm>
  124. </a-menu-item>
  125. </a-menu>
  126. </a-dropdown>
  127. </span>
  128. </a-table>
  129. </div>
  130. <interlock-detail-modal ref="modalForm" @ok="modalFormOk"></interlock-detail-modal>
  131. </a-card>
  132. </div>
  133. </div>
  134. </template>
  135. <script>
  136. import '@/assets/less/TableExpand.less'
  137. import { mixinDevice } from '@/utils/mixin'
  138. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  139. import InterlockDetailModal from './modules/InterlockDetailModal'
  140. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  141. import { httpAction, getAction } from '@/api/manage'
  142. export default {
  143. name: 'InterlockDetailList',
  144. mixins:[JeecgListMixin, mixinDevice],
  145. components: {
  146. InterlockDetailModal
  147. },
  148. props: ['currentData'],
  149. data () {
  150. return {
  151. description: '联锁详细信息表管理页面',
  152. // 表头
  153. columns: [
  154. // {
  155. // title: '序号',
  156. // dataIndex: '',
  157. // key:'rowIndex',
  158. // width:60,
  159. // align:"center",
  160. // customRender:function (t,r,index) {
  161. // return parseInt(index)+1;
  162. // }
  163. // },
  164. // {
  165. // title:'联锁总表id',
  166. // align:"center",
  167. // dataIndex: 'summaryid'
  168. // },
  169. {
  170. title:'联锁名称',
  171. align:"center",
  172. dataIndex: 'interlockname',
  173. customRender:function (t,r,index) {
  174. return {children: t,attrs: {rowSpan:r.rowSpan}};
  175. },
  176. },
  177. // {
  178. // // title:'联锁条件值',
  179. // title:'联锁条件',
  180. // align:"center",
  181. // dataIndex: 'interlockCondition'
  182. // },
  183. {
  184. // title:'联锁条件点位',
  185. title:'联锁条件',
  186. align:"center",
  187. dataIndex: 'interlockConditionTag'
  188. },
  189. {
  190. title:'描述',
  191. align:"center",
  192. dataIndex: 'description'
  193. },
  194. {
  195. title:'逻辑关系',
  196. align:"center",
  197. dataIndex: 'ljgx_dictText',
  198. customRender:function (t,r,index) {
  199. return {children: t,attrs: {rowSpan:r.rowSpan2}};
  200. },
  201. },
  202. {
  203. title:'联锁设定值',
  204. align:"center",
  205. dataIndex: 'interlockSetValue'
  206. },
  207. // {
  208. // title:'当前值',
  209. // align:"center",
  210. // dataIndex: 'currentValue'
  211. // },
  212. {
  213. title:'是否旁路',
  214. align:"center",
  215. dataIndex: 'bypassName'
  216. },
  217. {
  218. title:'联锁输出值',
  219. align:"center",
  220. dataIndex: 'interlockOutValue',
  221. customRender:function (t,r,index) {
  222. return {children: t,attrs: {rowSpan:r.rowSpan3}};
  223. },
  224. },
  225. {
  226. title:'输入卡件状态',
  227. align:"center",
  228. dataIndex: 'inputStatusName',
  229. scopedSlots: { customRender: 'inputStatus' }
  230. },
  231. {
  232. title:'输出卡件状态',
  233. align:"center",
  234. dataIndex: 'outputStatusName',
  235. scopedSlots: { customRender: 'outputStatus' }
  236. },
  237. {
  238. title:'MP状态',
  239. align:"center",
  240. dataIndex: 'mpStatusName',
  241. scopedSlots: { customRender: 'mpStatus' }
  242. },
  243. // {
  244. // title: '操作',
  245. // dataIndex: 'action',
  246. // align:"center",
  247. // fixed:"right",
  248. // width:147,
  249. // scopedSlots: { customRender: 'action' }
  250. // }
  251. ],
  252. url: {
  253. list: "/detail/interlockDetail/list2",
  254. delete: "/detail/interlockDetail/delete",
  255. deleteBatch: "/detail/interlockDetail/deleteBatch",
  256. exportXlsUrl: "/detail/interlockDetail/exportXls",
  257. importExcelUrl: "detail/interlockDetail/importExcel",
  258. },
  259. dictOptions:{},
  260. superFieldList:[],
  261. }
  262. },
  263. // watch: {
  264. // currentData: {
  265. // handler(newVal, oldVal){
  266. // console.log(newVal, oldVal)
  267. // this.loadData()
  268. // },
  269. // immediate: true,
  270. // deep: true
  271. // }
  272. // },
  273. created() {
  274. // this.queryParam.summaryid = this.$route.query.summaryid
  275. this.getSuperFieldList();
  276. },
  277. computed: {
  278. importExcelUrl: function(){
  279. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  280. },
  281. },
  282. methods: {
  283. loadData(arg) {
  284. let that = this
  285. if(!this.url.list){
  286. this.$message.error("请设置url.list属性!")
  287. return
  288. }
  289. //加载数据 若传入参数1则加载第一页的内容
  290. if (arg === 1) {
  291. this.ipagination.current = 1;
  292. }
  293. // if (this.$route.query.summaryid) {
  294. // this.queryParam.summaryid = this.$route.query.summaryid
  295. // }
  296. // this.queryParam.interlockSystemId = this.$route.query.interlockSystemId
  297. var params = this.getQueryParams();//查询条件
  298. params.summaryid = this.currentData.summaryid
  299. params.interlockSystemId = this.currentData.interlockSystemId
  300. this.loading = true;
  301. getAction(this.url.list, params).then((res) => {
  302. if (res.success) {
  303. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  304. this.dataSource = res.result.records||res.result;
  305. if(res.result.total)
  306. {
  307. // 合并单元格
  308. //判断跨行
  309. let rowSpan = 0
  310. let rowSpan2 = 0
  311. let rowSpan3 = 0
  312. let interlockname = ''
  313. let interlocknamePD = ''
  314. let ljgx = ''
  315. let interlockOutValue = ''
  316. for (let i = that.dataSource.length-1; i >= 0; i--) {
  317. // 联锁名称合并
  318. if (interlockname == '') {
  319. that.dataSource[i].rowSpan = 0
  320. interlockname = that.dataSource[i].interlockname
  321. rowSpan++
  322. } else {
  323. if(interlockname == that.dataSource[i].interlockname){
  324. that.dataSource[i].rowSpan = 0
  325. rowSpan++
  326. }else{
  327. that.dataSource[i+1].rowSpan = rowSpan
  328. that.dataSource[i].rowSpan = 0
  329. rowSpan = 1
  330. interlockname = that.dataSource[i].interlockname
  331. }
  332. }
  333. // 联锁状态合并
  334. if (ljgx == '') {
  335. that.dataSource[i].rowSpan2 = 0
  336. ljgx = that.dataSource[i].ljgx
  337. interlocknamePD = that.dataSource[i].interlockname
  338. rowSpan2++
  339. } else {
  340. if(ljgx == that.dataSource[i].ljgx){
  341. // that.dataSource[i].rowSpan2 = 0
  342. // rowSpan2++
  343. if (interlocknamePD == that.dataSource[i].interlockname) {
  344. that.dataSource[i].rowSpan2 = 0
  345. rowSpan2++
  346. } else {
  347. that.dataSource[i+1].rowSpan2 = rowSpan2
  348. that.dataSource[i].rowSpan2 = 0
  349. rowSpan2 = 1
  350. ljgx = that.dataSource[i].ljgx
  351. interlocknamePD = that.dataSource[i].interlockname
  352. }
  353. }else{
  354. that.dataSource[i+1].rowSpan2 = rowSpan2
  355. that.dataSource[i].rowSpan2 = 0
  356. rowSpan2 = 1
  357. ljgx = that.dataSource[i].ljgx
  358. interlocknamePD = that.dataSource[i].interlockname
  359. }
  360. }
  361. // 回路健康级别合并
  362. if (interlockOutValue === '') {
  363. // console.log('第一层')
  364. that.dataSource[i].rowSpan3 = 0
  365. interlockOutValue = that.dataSource[i].interlockOutValue
  366. interlocknamePD = that.dataSource[i].interlockname
  367. rowSpan3++
  368. } else {
  369. if(interlockOutValue == that.dataSource[i].interlockOutValue){
  370. // console.log(99,i,interlocknamePD,that.dataSource[i+1].interlockname)
  371. if (interlocknamePD == that.dataSource[i+1].interlockname) {
  372. // console.log(11111)
  373. that.dataSource[i].rowSpan3 = 0
  374. rowSpan3++
  375. } else {
  376. // console.log(22222)
  377. that.dataSource[i+1].rowSpan3 = rowSpan3
  378. that.dataSource[i].rowSpan3 = 0
  379. rowSpan3 = 1
  380. interlockOutValue = that.dataSource[i].interlockOutValue
  381. interlocknamePD = that.dataSource[i].interlockname
  382. }
  383. }else{
  384. // console.log('第二层else')
  385. that.dataSource[i+1].rowSpan3 = rowSpan3
  386. that.dataSource[i].rowSpan3 = 0
  387. rowSpan3 = 1
  388. interlockOutValue = that.dataSource[i].interlockOutValue
  389. interlocknamePD = that.dataSource[i].interlockname
  390. }
  391. }
  392. }
  393. that.dataSource[0].rowSpan = rowSpan
  394. that.dataSource[0].rowSpan2 = rowSpan2
  395. that.dataSource[0].rowSpan3 = rowSpan3
  396. this.ipagination.total = res.result.total;
  397. }else{
  398. this.ipagination.total = 0;
  399. }
  400. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  401. }else{
  402. this.$message.warning(res.message)
  403. }
  404. }).finally(() => {
  405. this.loading = false
  406. })
  407. },
  408. goBack(){
  409. this.$emit('click')
  410. },
  411. initDictConfig(){
  412. },
  413. getSuperFieldList(){
  414. let fieldList=[];
  415. fieldList.push({type:'string',value:'summaryid',text:'联锁总表id',dictCode:''})
  416. fieldList.push({type:'string',value:'interlockname',text:'联锁名称',dictCode:''})
  417. fieldList.push({type:'string',value:'interlockCondition',text:'联锁条件',dictCode:''})
  418. fieldList.push({type:'string',value:'interlockConditionTag',text:'联锁条件点位',dictCode:''})
  419. fieldList.push({type:'string',value:'description',text:'描述',dictCode:''})
  420. fieldList.push({type:'string',value:'deviceId',text:'设备id',dictCode:''})
  421. fieldList.push({type:'string',value:'moduleName',text:'模块名称',dictCode:''})
  422. fieldList.push({type:'string',value:'instrumentStatus',text:'仪表状态',dictCode:''})
  423. fieldList.push({type:'string',value:'instrumentStatusJuge',text:'仪表状态判断方式',dictCode:'instrument_status_juge'})
  424. fieldList.push({type:'string',value:'instrumentStatusTag',text:'仪表状态点位',dictCode:''})
  425. fieldList.push({type:'string',value:'instrumentStatusValue',text:'仪表状态值',dictCode:''})
  426. fieldList.push({type:'string',value:'ysmnlTag',text:'原始模拟量位号',dictCode:''})
  427. fieldList.push({type:'string',value:'ysmnlValue',text:'原始模拟量值',dictCode:''})
  428. fieldList.push({type:'string',value:'upperLimit',text:'高限',dictCode:''})
  429. fieldList.push({type:'string',value:'lowerLimit',text:'低限',dictCode:''})
  430. fieldList.push({type:'string',value:'thresholdValue',text:'阈值',dictCode:''})
  431. fieldList.push({type:'string',value:'thresholdTime',text:'时间',dictCode:''})
  432. fieldList.push({type:'string',value:'thresholdTimeUnit',text:'时间单位',dictCode:''})
  433. fieldList.push({type:'string',value:'interlockSetValue',text:'联锁设定值',dictCode:''})
  434. fieldList.push({type:'string',value:'interlockSetTag',text:'联锁设定值点位',dictCode:''})
  435. fieldList.push({type:'string',value:'currentValue',text:'当前值',dictCode:''})
  436. fieldList.push({type:'string',value:'currentValueTag',text:'当前值位号',dictCode:''})
  437. fieldList.push({type:'string',value:'ifBypass',text:'是否旁路',dictCode:''})
  438. fieldList.push({type:'string',value:'ifBypassTag',text:'旁路状态点位',dictCode:''})
  439. fieldList.push({type:'string',value:'inputStatus',text:'输入卡件状态',dictCode:''})
  440. fieldList.push({type:'string',value:'inputStatusTag',text:'输入卡件状态点位',dictCode:''})
  441. fieldList.push({type:'string',value:'outputStatus',text:'输出卡件状态',dictCode:''})
  442. fieldList.push({type:'string',value:'outputStatusTag',text:'输出卡件状态点位',dictCode:''})
  443. fieldList.push({type:'string',value:'mpStatus',text:'MP状态',dictCode:''})
  444. fieldList.push({type:'string',value:'mpStatusTag',text:'状态点位',dictCode:''})
  445. fieldList.push({type:'Text',value:'remark',text:'备注',dictCode:''})
  446. this.superFieldList = fieldList
  447. }
  448. }
  449. }
  450. </script>
  451. <style scoped>
  452. @import '~@assets/less/common.less';
  453. </style>