|
@@ -5,12 +5,12 @@
|
|
|
<a-row :gutter="48">
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="设备编号" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <a-input id="equipment-equipmentNo" allowClear :maxLength="30" v-model="queryParam.equipmentNo" placeholder="请输入网点名称" />
|
|
|
+ <a-input id="equipment-deviceNo" allowClear :maxLength="30" v-model="queryParam.deviceNo" placeholder="请输入网点名称" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
|
<a-form-item label="网点名称" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
|
|
|
- <a-input id="equipment-networkName" allowClear :maxLength="30" v-model="queryParam.networkName" placeholder="请输入网点名称" />
|
|
|
+ <a-input id="equipment-stationName" allowClear :maxLength="30" v-model="queryParam.stationName" placeholder="请输入网点名称" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="6">
|
|
@@ -32,6 +32,16 @@
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
bordered>
|
|
|
+ <!-- 箱体投放比例 -->
|
|
|
+ <template slot="boxOnePersent" slot-scope="text, record">{{ record.boxOnePersent ? record.boxOnePersent * 100 + '%' : '--' }}</template>
|
|
|
+ <template slot="boxTwoPersent" slot-scope="text, record">{{ record.boxTwoPersent ? record.boxTwoPersent * 100 + '%' : '--' }}</template>
|
|
|
+ <template slot="boxThreePersent" slot-scope="text, record">{{ record.boxThreePersent ? record.boxThreePersent * 100 + '%' : '--' }}</template>
|
|
|
+ <template slot="boxFourPersent" slot-scope="text, record">{{ record.boxFourPersent ? record.boxFourPersent * 100 + '%' : '--' }}</template>
|
|
|
+ <template slot="boxFivePersent" slot-scope="text, record">{{ record.boxFivePersent ? record.boxFivePersent * 100 + '%' : '--' }}</template>
|
|
|
+ <!-- 状态 -->
|
|
|
+ <template slot="state" slot-scope="text, record">
|
|
|
+ <span :class="record.state==0 ? 'red' : record.state==1 ? 'green' : ''">{{ record.state == 0 ? '已禁用' : record.state == 1 ? '已启用' : '--' }}</span>
|
|
|
+ </template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
|
<a-button
|
|
@@ -49,6 +59,7 @@
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import equipmentLogModal from './logModal.vue'
|
|
|
+import { deviceList } from '@/api/device'
|
|
|
export default {
|
|
|
name: 'Equipment',
|
|
|
components: { STable, VSelect, equipmentLogModal },
|
|
@@ -60,51 +71,42 @@ export default {
|
|
|
},
|
|
|
// 查询参数
|
|
|
queryParam: {
|
|
|
- equipmentNo: '', // 设备编号
|
|
|
- networkName: '' // 网点名称
|
|
|
+ deviceNo: '', // 设备编号
|
|
|
+ stationName: '' // 网点名称
|
|
|
},
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
- { title: '网点名称', dataIndex: 'networkName', width: 200, align: 'center' },
|
|
|
- { title: '地址', dataIndex: 'address', width: 200, align: 'center' },
|
|
|
- { title: '设备编号', dataIndex: 'equipmentNo', width: 200, align: 'center' },
|
|
|
- { title: '箱体类型', dataIndex: 'type', width: 200, align: 'center' },
|
|
|
+ { title: '网点名称', dataIndex: 'stationName', width: 200, align: 'center' },
|
|
|
+ { title: '地址', dataIndex: 'stationAddress', width: 200, align: 'center' },
|
|
|
+ { title: '设备编号', dataIndex: 'deviceNo', width: 200, align: 'center' },
|
|
|
+ { title: '箱体类型', dataIndex: 'deviceTypeName', width: 200, align: 'center' },
|
|
|
{ title: '内置箱体数', dataIndex: 'boxNum', width: 200, align: 'center' },
|
|
|
{ title: '内置各箱体已投放比例(%)',
|
|
|
children: [
|
|
|
- { title: '1号箱', dataIndex: 'oProportion', width: 100, align: 'center' },
|
|
|
- { title: '2号箱', dataIndex: 'tProportion', width: 100, align: 'center' }
|
|
|
+ { title: '1号箱', scopedSlots: { customRender: 'boxOnePersent' }, width: 100, align: 'center' },
|
|
|
+ { title: '2号箱', scopedSlots: { customRender: 'boxTwoPersent' }, width: 100, align: 'center' },
|
|
|
+ { title: '3号箱', scopedSlots: { customRender: 'boxThreePersent' }, width: 100, align: 'center' },
|
|
|
+ { title: '4号箱', scopedSlots: { customRender: 'boxFourPersent' }, width: 100, align: 'center' },
|
|
|
+ { title: '5号箱', scopedSlots: { customRender: 'boxFivePersent' }, width: 100, align: 'center' }
|
|
|
]
|
|
|
},
|
|
|
- { title: '版本', dataIndex: 'edition', width: 200, align: 'center' },
|
|
|
- { title: '状态', dataIndex: 'status', width: 100, align: 'center' },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
|
|
|
+ { title: '版本', dataIndex: 'boxVersion', width: 200, align: 'center' },
|
|
|
+ { title: '状态', scopedSlots: { customRender: 'state' }, width: 150, align: 'center' },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
- // return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
- // for (let i = 0; i < res.data.list.length; i++) {
|
|
|
- // const _item = res.data.list[i]
|
|
|
- // _item.no = no + i + 1
|
|
|
- // _item.status = _item.status + '' === '1'
|
|
|
- // }
|
|
|
- // return res.data
|
|
|
- // }
|
|
|
- // })
|
|
|
- return new Promise((resolve) => {
|
|
|
- const data = [
|
|
|
- { id: 1, no: 1, networkName: '网点1', equipmentNo: '陕西省', type: '西安市', boxNum: '未央区', address: '凤城十二路', oProportion: '早高峰期', tProportion: '23%', edition: '1.2.1', status: '1' },
|
|
|
- { id: 2, no: 2, networkName: '网点2', equipmentNo: '陕西省', type: '西安市', boxNum: '未央区', address: '凤城十二路', oProportion: '晚高峰期', tProportion: '23%', edition: '1.2.1', status: '1' },
|
|
|
- { id: 3, no: 3, networkName: '网点3', equipmentNo: '陕西省', type: '西安市', boxNum: '未央区', address: '凤城十二路', oProportion: '早高峰期', tProportion: '23%', edition: '1.2.1', status: '1' },
|
|
|
- { id: 4, no: 4, networkName: '网点4', equipmentNo: '陕西省', type: '西安市', boxNum: '未央区', address: '凤城十二路', oProportion: '早高峰期', tProportion: '23%', edition: '1.2.1', status: '1' },
|
|
|
- { id: 5, no: 5, networkName: '网点5', equipmentNo: '陕西省', type: '西安市', boxNum: '未央区', address: '凤城十二路', oProportion: '早高峰期', tProportion: '23%', edition: '1.2.1', status: '1' },
|
|
|
- { id: 6, no: 6, networkName: '网点6', equipmentNo: '陕西省', type: '西安市', boxNum: '未央区', address: '凤城十二路', oProportion: '早高峰期', tProportion: '23%', edition: '1.2.1', status: '1' },
|
|
|
- { id: 7, no: 7, networkName: '网点7', equipmentNo: '陕西省', type: '西安市', boxNum: '未央区', address: '凤城十二路', oProportion: '早高峰期', tProportion: '23%', edition: '1.2.1', status: '1' }
|
|
|
- ]
|
|
|
- resolve(data)
|
|
|
+ return deviceList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ const no = (res.data.pageNo - 1) * res.data.pageSize
|
|
|
+ this.orderTotal = res.data.count
|
|
|
+ for (let i = 0; i < res.data.list.length; i++) {
|
|
|
+ const _item = res.data.list[i]
|
|
|
+ _item.no = no + i + 1
|
|
|
+ }
|
|
|
+ return res.data
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
orderTotal: '', // 合计开单数量
|
|
@@ -112,16 +114,11 @@ export default {
|
|
|
equipmentId: null // 设备id
|
|
|
}
|
|
|
},
|
|
|
- beforeRouteEnter (to, from, next) {
|
|
|
- next(vm => {
|
|
|
- vm.handleReset()
|
|
|
- })
|
|
|
- },
|
|
|
methods: {
|
|
|
// 重置
|
|
|
handleReset () {
|
|
|
- console.log('重置', this.queryParam)
|
|
|
- this.form.resetFields()
|
|
|
+ this.queryParam.deviceNo = ''
|
|
|
+ this.queryParam.stationName = ''
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 查看掉线日志
|
|
@@ -166,5 +163,14 @@ export default {
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
}
|
|
|
+ .blue {
|
|
|
+ color: #1890FF;
|
|
|
+ }
|
|
|
+ .green {
|
|
|
+ color: #16b50e;
|
|
|
+ }
|
|
|
+ .red {
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|