123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747 |
- <template>
- <div>
- <div class="my-title">历史记录</div>
- <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
- <el-form-item label="上报时间">
- <el-date-picker
- v-model="dataForm.date"
- value-format="yyyy-MM-dd HH:mm:ss"
- type="datetimerange"
- range-separator="至"
- start-placeholder="开始时间"
- end-placeholder="结束时间">
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button @click="search()">查询</el-button>
- </el-form-item>
- </el-form>
- <el-table
- :data="dataList"
- border
- v-loading="dataListLoading"
- style="width: 100%;">
- <el-table-column
- label="序号"
- type="index"
- width="50"
- align="center">
- </el-table-column>
- <el-table-column
- prop="deviceName"
- header-align="center"
- align="center"
- min-width="120"
- label="设备编号">
- </el-table-column>
- <el-table-column
- prop="deviceTimeStr"
- header-align="center"
- align="center"
- min-width="160"
- :show-overflow-tooltip="true"
- label="上报时间">
- </el-table-column>
- <el-table-column
- prop="serverTimeStr"
- header-align="center"
- align="center"
- min-width="160"
- :show-overflow-tooltip="true"
- label="系统接收时间">
- </el-table-column>
- <el-table-column
- prop="version"
- header-align="center"
- align="center"
- min-width="100"
- label="协议版本">
- </el-table-column>
- <el-table-column
- prop="ack"
- header-align="center"
- align="center"
- min-width="100"
- label="是否需要响应">
- <template slot-scope="scope">
- <span>{{ scope.row.ack === '0'?'否':'是' }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="longitude"
- header-align="center"
- align="center"
- min-width="100"
- label="纬度">
- </el-table-column>
- <el-table-column
- prop="latitude"
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="经度">
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="150"
- label="NC软件版本">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NCVersion'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- label="NC名称">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NCInfo'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第一轴下一指令">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos1'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第二轴下一指令">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos2'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第三轴下一指令">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos3'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第四轴下一指令">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos4'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第五轴下一指令">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos5'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第六轴下一指令">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='NextDistancePos6'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="自动运行时间">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='RunTime'">{{ formatTime(item.value) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="自动启动时间">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='StartTime'">{{ formatTime(item.value) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="循环时间">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CycleTime'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="上电时间">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='KeepAliveTime'">{{ formatTime(item.value) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="系统日期">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='SystemDate'">{{ formatDate(item.value) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="系统时间">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='SystemTime'">{{ formatTime(item.value) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="主程序名">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MainProName'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="当前运行程序号">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CuRunProNum'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="当前运行程序内容">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CuRunProContent'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="120"
- :show-overflow-tooltip="true"
- label="设备报警">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='AlarmMsg'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="进给设定转速FA">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='FeedSetSpeed'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- :show-overflow-tooltip="true"
- label="进给实际速度FE">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='FeedActualSpeed'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="主轴设定转速">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='SpindleSetSpeed'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="主轴实际转速">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='SpindleActualSpeed'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="主轴倍率">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='SpindleRate'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="进给倍率">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='FeedRate'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="快速移动倍率">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MoveRate'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="主轴负载">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='SpindleLoad'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="第一轴伺服轴负载">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad1'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="第二轴伺服轴负载">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad2'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="第三轴伺服轴负载">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad3'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="第四轴伺服轴负载">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad4'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="90"
- label="第五轴伺服轴负载">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad5'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第六轴伺服轴负载">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='ServoLoad6'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="设备运行模式">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='RunMode'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="设备运行状态">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='RunStatus'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="当前刀具号">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CulToolNum'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="设备急停状态">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='EmergencyStop'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="G代码状态">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='GCodeStatus'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="累计生产件数">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='ProductCounts'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第一轴机械坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MacPos1'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第二轴机械坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MacPos2'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第三轴机械坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MacPos3'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第四轴机械坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MacPos4'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第五轴机械坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MacPos5'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第六轴机械坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='MacPos6'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第一轴工件坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='WorkPos1'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第二轴工件坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='WorkPos2'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第三轴工件坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='WorkPos3'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第四轴工件坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='WorkPos4'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第五轴工件坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='WorkPos5'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第六轴工件坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='WorkPos6'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第一轴当前(相对)坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos1'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第二轴当前(相对)坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos2'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第三轴当前(相对)坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos3'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第四轴当前(相对)坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos4'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第五轴当前(相对)坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos5'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第六轴当前(相对)坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='CurrentPos6'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第一轴剩余坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='DistancePos1'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第二轴剩余坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='DistancePos2'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第三轴剩余坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='DistancePos3'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第四轴剩余坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='DistancePos4'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第五轴剩余坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='DistancePos5'">{{ item.value }}</span>
- </template>
- </el-table-column>
- <el-table-column
- header-align="center"
- align="center"
- min-width="100"
- label="第六轴剩余坐标">
- <template slot-scope="scope">
- <span v-for="item in scope.row.points" v-if="item.name==='DistancePos6'">{{ item.value }}</span>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- @size-change="sizeChangeHandle"
- @current-change="currentChangeHandle"
- :current-page="pageIndex"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- :total="totalPage"
- layout="total, sizes, prev, pager, next, jumper">
- </el-pagination>
- <span slot="footer" class="dialog-footer">
- <el-button @click="onChose">返回</el-button>
- </span>
- </div>
- </template>
- <script>
- import {formatDate, formatTime} from '@/utils/date-util'
- export default {
- name: 'device-history',
- components: {
- },
- data () {
- return {
- code: 0,
- dataForm: {},
- dataList: [],
- pageIndex: 1,
- pageSize: 10,
- totalPage: 0,
- dataListLoading: false,
- dataListSelections: []
- }
- },
- methods: {
- formatDate,
- formatTime,
- async init (code) {
- this.code = code
- this.search()
- },
- onChose () {
- this.$emit('onChose')
- },
- // 查询
- search () {
- this.pageIndex = 1
- this.getDataList()
- },
- // 获取数据列表
- getDataList () {
- this.dataListLoading = true
- this.addOrUpdateVisible = false
- this.$http({
- url: this.$http.adornUrl('/iot-platform/data-gateway/history'),
- method: 'get',
- params: this.$http.adornParams({
- 'current': this.pageIndex,
- 'size': this.pageSize,
- 'code': this.code,
- 'timeStart': this.dataForm.date ? this.dataForm.date[0] : null,
- 'timeEnd': this.dataForm.date ? this.dataForm.date[1] : null
- })
- }).then(({data}) => {
- if (data && data.code === '200') {
- this.dataList = data.data.records
- this.totalPage = Number(data.data.total)
- } else {
- this.dataList = []
- this.totalPage = 0
- }
- this.dataListLoading = false
- })
- },
- // 每页数
- sizeChangeHandle (val) {
- this.pageSize = val
- this.pageIndex = 1
- this.getDataList()
- },
- // 当前页
- currentChangeHandle (val) {
- this.pageIndex = val
- this.getDataList()
- },
- // 多选
- selectionChangeHandle (val) {
- this.dataListSelections = val
- },
- // 详情
- detailHandle (row) {
- // todo
- }
- }
- }
- </script>
- <style scoped>
- </style>
|