From 9c3e38a41dd44416c9e95f86eda3edab6df7d0be Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 10 七月 2025 10:28:23 +0800 Subject: [PATCH] 设备台账点击设备列表中的统一编码可以打开详情弹窗并带入行记录 --- src/views/mdc/base/EquipmentList.vue | 154 ++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 122 insertions(+), 32 deletions(-) diff --git a/src/views/mdc/base/EquipmentList.vue b/src/views/mdc/base/EquipmentList.vue index 2a5815b..b8e5c4a 100644 --- a/src/views/mdc/base/EquipmentList.vue +++ b/src/views/mdc/base/EquipmentList.vue @@ -6,19 +6,19 @@ <a-form layout="inline" @keyup.enter.native="searchQuery"> <a-row :gutter="24"> - <a-col :md="6" :sm="12"> + <a-col :md="6" :sm="6"> <a-form-item label="璁惧缂栧彿"> <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"></a-input> </a-form-item> </a-col> - <a-col :md="6" :sm="8"> + <a-col :md="6" :sm="6"> <a-form-item label="璁惧鍚嶇О"> <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="queryParam.equipmentName"></a-input> </a-form-item> </a-col> - <a-col :md="6" :sm="8"> + <a-col :md="6" :sm="6"> <a-form-item label="杞﹂棿鍚嶇О"> <!--<a-input placeholder="璇疯緭鍏ヨ溅闂村悕绉�" v-model="queryParam.productionName"></a-input>--> <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="璇烽�夋嫨杞﹂棿" @@ -26,15 +26,45 @@ </a-form-item> </a-col> - <a-col :md="6" :sm="8"> + <template v-if="toggleSearchStatus"> + <a-col :md="6" :sm="6"> + <a-form-item label="璁惧绾у埆"> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="queryParam.deviceLevel" + allow-clear/> + </a-form-item> + </a-col> + <a-col :md="6" :sm="6"> + <a-form-item label="閲嶈绋嬪害"> + <j-dict-select-tag placeholder="璇烽�夋嫨閲嶈绋嬪害" dictCode="device_importance_level" v-model="queryParam.deviceImportanceLevel" + allow-clear/> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="6"> + <a-form-item label="寮傚父鐘舵��"> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧寮傚父鐘舵��" dictCode="device_abnormal_status" + v-model="queryParam.deviceAbnormalStatus" + allow-clear/> + </a-form-item> + </a-col> + </template> + + <a-col :md="6" :sm="6"> <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a + @click="toggleSearchStatus=!toggleSearchStatus" + style="margin-left: 8px" + > + {{ toggleSearchStatus ? '鏀惰捣' : '灞曞紑' }} + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> + </a> </a-col> </a-row> </a-form> </div> - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <!-- 鎿嶄綔鎸夐挳鍖哄煙路 --> <div class="table-operator" style="border-top: 5px"> <a-button @click="handleAdd" type="primary" icon="plus">娣诲姞璁惧</a-button> <a-button type="primary" icon="download" @click="handleExportXls('璁惧淇℃伅')">瀵煎嚭</a-button> @@ -72,6 +102,33 @@ :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> + <!--<template slot="equipmentId" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="equipmentName" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="productionName" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="equipmentType" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="driveType" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="equipmentIp" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="devicePower" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <!--<template slot="systemVersion" slot-scope="text,record">--> + <!--<div :style="{color:record.deviceAbnormalStatus===1?null:'#f00'}">{{text}}</div>--> + <!--</template>--> + <template slot="deviceAbnormalStatus" slot-scope="text,record"> + <div :style="{color:text&&text!==1?'#f00':null}">{{record.deviceAbnormalStatus_dictText}}</div> + </template> <span slot="action" slot-scope="text, record"> <a @click="handleEdit(record)">缂栬緫</a> @@ -94,8 +151,6 @@ </a-menu> </a-dropdown> </span> - - </a-table> </div> <!-- table鍖哄煙-end --> @@ -110,18 +165,32 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { queryProductionTreeList } from '@/api/api' import { mapActions } from 'vuex' + import Template1 from '../../jeecg/JVxeDemo/layout-demo/Template1' export default { name: 'EquipmentList', mixins: [JeecgListMixin], components: { - UserModal, + Template1, + UserModal }, data() { return { description: '杩欐槸璁惧绠$悊椤甸潰', queryParam: {}, recycleBinVisible: false, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 30, + pageSizeOptions: ['30', '50', '100'], + showTotal: (total, range) => { + return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�' + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, columns: [ { title: '#', @@ -138,6 +207,7 @@ align: 'center', dataIndex: 'equipmentId', width: 200 + // sorter: true }, { title: '璁惧鍚嶇О', @@ -154,14 +224,16 @@ { title: '璁惧绫诲瀷', align: 'center', - width: 200, + width: 180, dataIndex: 'equipmentType' }, + { title: '椹卞姩绫诲瀷', align: 'center', width: 200, dataIndex: 'driveType' + // sorter: true }, { title: '鏈哄簥IP', @@ -172,21 +244,26 @@ { title: '璁惧鍔熺巼', align: 'center', - width: 200, + width: 150, dataIndex: 'devicePower' }, - { - title: '閮ㄩ棬', - align: 'center', - width: 200, - dataIndex: 'orgCodeTxt' - }, - + // { + // title: '閮ㄩ棬', + // align: "center", + // width: 200, + // dataIndex: 'orgCodeTxt' + // }, { title: '绯荤粺鐗堟湰', align: 'center', - width: 200, + width: 150, dataIndex: 'systemVersion' + }, + { + title: '寮傚父鐘舵��', + align: 'center', + width: 100, + dataIndex: 'deviceAbnormalStatus' }, { title: '鎿嶄綔', @@ -196,7 +273,6 @@ width: 150, fixed: 'right' } - ], url: { list: '/mdc/mdcEquipment/list', @@ -235,46 +311,53 @@ title: '璁惧缂栧彿', align: 'center', dataIndex: 'equipmentId', - width: 200 + width: 200, + scopedSlots: { customRender: 'equipmentId' } // sorter: true }, { title: '璁惧鍚嶇О', align: 'center', width: 200, - dataIndex: 'equipmentName' + dataIndex: 'equipmentName', + scopedSlots: { customRender: 'equipmentName' } }, { title: '杞﹂棿', align: 'center', width: 200, - dataIndex: 'productionName' + dataIndex: 'productionName', + scopedSlots: { customRender: 'productionName' } }, { title: '璁惧绫诲瀷', align: 'center', - width: 200, - dataIndex: 'equipmentType' + width: 180, + dataIndex: 'equipmentType', + scopedSlots: { customRender: 'equipmentType' } }, { title: '椹卞姩绫诲瀷', align: 'center', width: 200, - dataIndex: 'driveType' + dataIndex: 'driveType', + scopedSlots: { customRender: 'driveType' } // sorter: true }, { title: '鏈哄簥IP', align: 'center', width: 200, - dataIndex: 'equipmentIp' + dataIndex: 'equipmentIp', + scopedSlots: { customRender: 'equipmentIp' } }, { title: '璁惧鍔熺巼', align: 'center', - width: 200, - dataIndex: 'devicePower' + width: 150, + dataIndex: 'devicePower', + scopedSlots: { customRender: 'devicePower' } }, // { // title: '閮ㄩ棬', @@ -282,12 +365,19 @@ // width: 200, // dataIndex: 'orgCodeTxt' // }, - { title: '绯荤粺鐗堟湰', align: 'center', - width: 200, - dataIndex: 'systemVersion' + width: 150, + dataIndex: 'systemVersion', + scopedSlots: { customRender: 'systemVersion' } + }, + { + title: '寮傚父鐘舵��', + align: 'center', + width: 100, + dataIndex: 'deviceAbnormalStatus', + scopedSlots: { customRender: 'deviceAbnormalStatus' } }, { title: '鎿嶄綔', @@ -420,7 +510,7 @@ if (e.key == 1) { this.batchDel() } - }, + } } } </script> -- Gitblit v1.9.3