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/DeviceParamThresholdManagement.vue | 250 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 250 insertions(+), 0 deletions(-) diff --git a/src/views/mdc/base/DeviceParamThresholdManagement.vue b/src/views/mdc/base/DeviceParamThresholdManagement.vue new file mode 100644 index 0000000..2ed2a2d --- /dev/null +++ b/src/views/mdc/base/DeviceParamThresholdManagement.vue @@ -0,0 +1,250 @@ +<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="6" :sm="12"> + <a-form-item label="涓枃鍚�"> + <j-input placeholder="璇疯緭鍏ヤ腑鏂囧悕" v-model="queryParam.chineseName"></j-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="8"> + <a-form-item label="鑻辨枃鍚�"> + <j-input placeholder="璇疯緭鍏ヨ嫳鏂囧悕" v-model="queryParam.englishName"></j-input> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="8"> + <a-form-item label="椹卞姩绫诲瀷"> + <a-auto-complete + v-model="queryParam.controlSystemType" + :data-source="driveTypeList" + placeholder="璇烽�夋嫨鎺у埗绯荤粺绫诲瀷" + :filter-option="filterOption" + :allowClear="true" + /> + </a-form-item> + </a-col> + + <a-col :md="6" :sm="8"> + <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-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:600}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <template slot="avatarslot" slot-scope="text, record, index"> + <div class="anty-img-wrap"> + <a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/> + </div> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical"/> + + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + + </span> + + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <ParamThresholdModal ref="modalForm" @ok="modalFormOk" :driveTypeList="driveTypeList"/> + </a-card> +</template> + +<script> + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import api from '@/api/mdc' + import ParamThresholdModal from './modules/DeviceParamThresholdManagement/ParamThresholdModal' + + export default { + name: 'EquipmentList', + mixins: [JeecgListMixin], + components: { + ParamThresholdModal + }, + data() { + return { + name: 'DeviceParamThresholdManagement', + description: '杩欐槸璁惧鍙傛暟闃堝�肩鐞嗛〉闈�', + queryParam: {}, + /* 鍒嗛〉鍙傛暟 */ + 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: 'chineseName', + width: 350 + // sorter: true + }, + { + title: '鑻辨枃鍚�', + align: 'center', + width: 350, + dataIndex: 'englishName' + }, + { + title: '椹卞姩绫诲瀷', + align: 'center', + width: 350, + dataIndex: 'controlSystemType' + }, + { + title: '闃堝�间笂闄�', + align: 'center', + width: 270, + dataIndex: 'maxThreshold' + // scopedSlots: {customRender: "avatarslot"} + }, + { + title: '闃堝�间笅闄�', + align: 'center', + width: 270, + dataIndex: 'minThreshold' + // sorter: true + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + fixed: 'right', + width: 150 + } + ], + driveTypeList: [], + url: { + list: '/mdc/mdcEquipmentThreshold/list', + delete: '/mdc/mdcEquipmentThreshold/delete', + deleteBatch: '/mdc/mdcEquipmentThreshold/deleteBatch' + } + } + }, + created() { + this.getDriveTypeByApi() + }, + methods: { + handleEdit: function(record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + + // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 + this.$refs.modalForm.removeValidate() + }, + + handleAdd: function() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + + // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 + this.$refs.modalForm.removeValidate() + }, + + handleMenuClick(e) { + if (e.key == 1) { + this.batchDel() + } else if (e.key == 2) { + this.batchFrozen(2) + } else if (e.key == 3) { + this.batchFrozen(1) + } + }, + + /** + * 璋冪敤鎺ュ彛鑾峰彇鎺у埗绯荤粺绫诲瀷 + */ + getDriveTypeByApi() { + api.getDriveTypeApi().then((res) => { + this.driveTypeList = res.result.map(item => item.value) + }) + }, + + /** + * 鑱旀兂杈撳叆妗嗙瓫閫夊姛鑳� + * @param input 杈撳叆鐨勫唴瀹� + * @param option 閰嶇疆 + * @returns {boolean} 鍒ゆ柇鏄惁绛涢�� + */ + filterOption(input, option) { + return ( + option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0 + ) + } + } + + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> \ No newline at end of file -- Gitblit v1.9.3