¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |