From accebdce93486d3b4f26e55ffdea047549cce20c Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期一, 28 七月 2025 21:12:38 +0800 Subject: [PATCH] Merge branch 'master' of http://125.76.225.53:18448/r/xhj/vue_mdc_xhj --- src/views/mdc/base/EquipmentList.vue | 440 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 440 insertions(+), 0 deletions(-) diff --git a/src/views/mdc/base/EquipmentList.vue b/src/views/mdc/base/EquipmentList.vue new file mode 100644 index 0000000..ae5950e --- /dev/null +++ b/src/views/mdc/base/EquipmentList.vue @@ -0,0 +1,440 @@ +<template> + <a-card :bordered="false"> + + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + + <a-col :md="4" :sm="4"> + <a-form-item label="璁惧缂栧彿"> + <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="queryParam.equipmentId"></a-input> + </a-form-item> + </a-col> + + <a-col :md="4" :sm="4"> + <a-form-item label="璁惧鍚嶇О"> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="queryParam.equipmentName"></a-input> + </a-form-item> + </a-col> + + <a-col :md="4" :sm="4"> + <a-form-item label="杞﹂棿鍚嶇О"> + <!--<a-input placeholder="璇疯緭鍏ヨ溅闂村悕绉�" v-model="queryParam.productionName"></a-input>--> + <a-tree-select v-model="queryParam.productionName" :treeData="workshopTreeData" placeholder="璇烽�夋嫨杞﹂棿" + :treeDefaultExpandedKeys="treeDefaultExpandedKeys"></a-tree-select> + </a-form-item> + </a-col> + + <a-col :md="4" :sm="4"> + <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-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> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay" @click="handleMenuClick"> + <a-menu-item key="1"> + <a-icon type="delete" @click="batchDel"/> + 鍒犻櫎 + </a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> + 鎵归噺鎿嶄綔 + <a-icon type="down"/> + </a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i>宸查�夋嫨 <a style="font-weight: 600">{{ + selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :scroll="{x:'max-content',y:465}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical"/> + + <a-dropdown> + <a class="ant-dropdown-link"> + 鏇村 <a-icon type="down"/> + </a> + <a-menu slot="overlay"> + <a-menu-item> + <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <user-modal ref="modalForm" @ok="modalFormOk"></user-modal> + </a-card> +</template> + +<script> + import UserModal from './modules/EquipmentList/UserModal' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { queryProductionTreeListByMdc } from '@/api/api' + import { mapActions } from 'vuex' + + export default { + name: 'EquipmentList', + mixins: [JeecgListMixin], + components: { + 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: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 200 + }, + { + title: '璁惧鍚嶇О', + align: 'center', + width: 200, + dataIndex: 'equipmentName' + }, + { + title: '杞﹂棿', + align: 'center', + width: 200, + dataIndex: 'productionName' + }, + { + title: '璁惧绫诲瀷', + align: 'center', + width: 200, + dataIndex: 'equipmentType' + }, + { + title: '椹卞姩绫诲瀷', + align: 'center', + width: 200, + dataIndex: 'driveType' + }, + { + title: '鏈哄簥IP', + align: 'center', + width: 200, + dataIndex: 'equipmentIp' + }, + { + title: '璁惧鍔熺巼', + align: 'center', + width: 200, + dataIndex: 'devicePower' + }, + { + title: '閮ㄩ棬', + align: 'center', + width: 200, + dataIndex: 'orgCodeTxt' + }, + + { + title: '绯荤粺鐗堟湰', + align: 'center', + width: 200, + dataIndex: 'systemVersion' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 150, + fixed: 'right' + } + + ], + url: { + list: '/mdc/mdcEquipment/list', + delete: '/mdc/mdcEquipment/delete', + deleteBatch: '/mdc/mdcEquipment/deleteBatch', + exportXlsUrl: '/mdc/mdcEquipment/exportXls' + }, + isDepartType: '', + workshopTreeData: [], + treeDefaultExpandedKeys: [] + } + }, + created() { + this.queryTreeData() + this.getWorkshopListByApi() + }, + methods: { + ...mapActions(['QueryDepartTree']), + queryTreeData() { + this.QueryDepartTree().then(res => { + if (res.success) { + this.isDepartType = res.result[0].value + if (this.isDepartType == -1) { + this.columns = [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 200 + // sorter: true + }, + { + title: '璁惧鍚嶇О', + align: 'center', + dataIndex: 'equipmentName', + width: 200 + // sorter: true + }, + { + title: '瀹夎浣嶇疆', + align: 'center', + width: 200, + dataIndex: 'equipmentAddress' + }, + { + title: '杞﹂棿', + align: 'center', + width: 200, + dataIndex: 'productionName' + }, + { + title: '璁惧绫诲瀷', + align: 'center', + width: 200, + dataIndex: 'equipmentType' + }, + + { + title: '椹卞姩绫诲瀷', + align: 'center', + width: 200, + dataIndex: 'driveType' + // sorter: true + }, + { + title: '鏈哄簥IP', + align: 'center', + width: 200, + dataIndex: 'equipmentIp' + }, + { + title: '璁惧鍔熺巼', + align: 'center', + width: 200, + dataIndex: 'devicePower' + }, + { + title: '绯荤粺鐗堟湰', + align: 'center', + width: 200, + dataIndex: 'systemVersion' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 150, + fixed: 'right' + } + + ] + } else { + this.columns = [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '璁惧缂栧彿', + align: 'center', + dataIndex: 'equipmentId', + width: 200 + // sorter: true + }, + { + title: '璁惧鍚嶇О', + align: 'center', + width: 200, + dataIndex: 'equipmentName' + }, + { + title: '杞﹂棿', + align: 'center', + width: 200, + dataIndex: 'productionName' + }, + { + title: '璁惧绫诲瀷', + align: 'center', + width: 200, + dataIndex: 'equipmentType' + }, + + { + title: '椹卞姩绫诲瀷', + align: 'center', + width: 200, + dataIndex: 'driveType' + // sorter: true + }, + { + title: '鏈哄簥IP', + align: 'center', + width: 200, + dataIndex: 'equipmentIp' + }, + { + title: '璁惧鍔熺巼', + align: 'center', + width: 200, + dataIndex: 'devicePower' + }, + { + title: '閮ㄩ棬', + align: 'center', + width: 200, + dataIndex: 'orgCodeTxt' + }, + + { + title: '绯荤粺鐗堟湰', + align: 'center', + width: 200, + dataIndex: 'systemVersion' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 150, + fixed: 'right' + } + + ] + } + + } else { + // this.$message.warn(res.message) + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }).finally(() => { + }) + }, + /** + * 璋冪敤鎺ュ彛鑾峰彇鏌ヨ鍖哄煙杞﹂棿鏍戝垪琛� + */ + getWorkshopListByApi() { + queryProductionTreeListByMdc().then(res => { + if (res.success) { + this.workshopTreeData = res.result + this.treeDefaultExpandedKeys = [...res.result].map(item => item.key) + } + }) + }, + handleEdit: function(record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.disSeach = true + // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 + this.$refs.modalForm.removeValidate() + }, + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + this.$refs.modalForm.disSeach = false + }, + handleMenuClick(e) { + if (e.key == 1) { + this.batchDel() + } + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> \ No newline at end of file -- Gitblit v1.9.3