| | |
| | | <div style="margin-bottom: 10px;"><el-button @click="controlCommand()" size="mini">下发</el-button></div> |
| | | </div> |
| | | </div> |
| | | <el-collapse v-model="activeNames"> |
| | | <el-collapse-item v-for="(item) in stationList" :name="item.stationId"> |
| | | <div style="max-height: 55vh; overflow:auto;"> |
| | | <el-collapse v-model="activeNames" accordion> |
| | | <el-collapse-item v-for="(item) in displayStationList" :name="item.stationId"> |
| | | <template slot="title"> |
| | | <div style="width: 100%;display: flex;"> |
| | | <div style="width: 50%;">{{ item.stationId }}站</div> |
| | |
| | | <el-descriptions-item label="可出">{{ item.outEnable ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="空板信号">{{ item.emptyMk ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="满板信号">{{ item.fullPlt ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="运行阻塞">{{ item.runBlock ? 'Y' : 'N' }}</el-descriptions-item> |
| | | <el-descriptions-item label="托盘高度">{{ item.palletHeight }}</el-descriptions-item> |
| | | <el-descriptions-item label="条码">{{ item.barcode }}</el-descriptions-item> |
| | | <el-descriptions-item label="故障代码">{{ item.error }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </div> |
| | | <div style="display:flex; justify-content:flex-end; margin-top:8px;"> |
| | | <el-pagination |
| | | small |
| | | @current-change="handlePageChange" |
| | | @size-change="handleSizeChange" |
| | | :current-page="currentPage" |
| | | :page-size="pageSize" |
| | | :page-sizes="[10,20,50,100]" |
| | | layout="total, prev, pager, next" |
| | | :total="stationList.length"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | `, |
| | | props: ["param"], |
| | |
| | | stationList: [], |
| | | activeNames: "", |
| | | searchStationId: "", |
| | | showControl: true, |
| | | showControl: false, |
| | | controlParam: { |
| | | stationId: "", |
| | | taskNo: "", |
| | | targetStationId: "", |
| | | }, |
| | | pageSize: 25, |
| | | currentPage: 1, |
| | | }; |
| | | }, |
| | | created() { |
| | | setInterval(() => { |
| | | this.getDevpStateInfo(); |
| | | }, 1000); |
| | | }, |
| | | computed: { |
| | | displayStationList() { |
| | | const start = (this.currentPage - 1) * this.pageSize; |
| | | const end = start + this.pageSize; |
| | | return this.stationList.slice(start, end); |
| | | } |
| | | }, |
| | | watch: { |
| | | param: { |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | handlePageChange(page) { |
| | | this.currentPage = page; |
| | | }, |
| | | handleSizeChange(size) { |
| | | this.pageSize = size; |
| | | this.currentPage = 1; |
| | | }, |
| | | getDevpStateInfo() { |
| | | if (this.$root.sendWs) { |
| | | this.$root.sendWs(JSON.stringify({ |
| | | "url": "/console/latest/data/station", |
| | | "data": {} |
| | | })); |
| | | } |
| | | }, |
| | | setStationList(res) { |
| | | let that = this; |
| | | $.ajax({ |
| | | url: baseUrl + "/console/latest/data/station", |
| | | headers: { |
| | | token: localStorage.getItem("token"), |
| | | }, |
| | | method: "post", |
| | | success: (res) => { |
| | | // 堆垛机信息表获取 |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | if (res.code == 200) { |
| | | let list = res.data; |
| | | |
| | | if (that.searchStationId == "") { |
| | | that.stationList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.stationId == that.searchStationId) { |
| | | tmp.push(item); |
| | | } |
| | | }); |
| | | that.stationList = tmp; |
| | | if (that.searchStationId == "") { |
| | | that.stationList = list; |
| | | } else { |
| | | let tmp = []; |
| | | list.forEach((item) => { |
| | | if (item.stationId == that.searchStationId) { |
| | | tmp.push(item); |
| | | } |
| | | } |
| | | }, |
| | | }); |
| | | }); |
| | | that.stationList = tmp; |
| | | that.currentPage = 1; |
| | | } |
| | | } |
| | | }, |
| | | openControl() { |
| | | this.showControl = !this.showControl; |