|
@@ -0,0 +1,214 @@
|
|
|
+<template>
|
|
|
+ <div class="formContaner">
|
|
|
+ <div class="formTitle">{{$t("runCenter.searchForm.robotMonitor")}}</div>
|
|
|
+ <!-- 表单模块 -->
|
|
|
+ <el-descriptions :title="robotList[index].pname" class="description" direction="vertical" :column="2" v-for="(item, index) in robotList" :key="item.id" :colon="false" v-if="index%3==0" border>
|
|
|
+
|
|
|
+ <template slot="extra">
|
|
|
+ <el-button type="primary" icon="el-icon-refresh" size="small" @click="record(item, index)" >记录</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-refresh" size="small" @click="detail(item, index)" >详情</el-button>
|
|
|
+ </template>
|
|
|
+ <el-descriptions-item label="在线状态">
|
|
|
+ <el-tag size="small" :type="robotList[index].online_status=='1'? 'warning':'success'" >{{robotList[index].online_status=='1'? '空闲':'运行中'}}</el-tag>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="锁定状态">
|
|
|
+ <el-tag size="small">{{robotList[index].lock_status=='0'? '已锁定':(robotList[index].lock_status=='1')?'已放置':'未锁定'}}</el-tag>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="节点名称" v-if="robotList[index].node_name">
|
|
|
+ <el-tag size="medium">{{robotList[index].node_name}}</el-tag>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="目标位置" v-if="robotList[index].target_name">
|
|
|
+ <el-tag size="medium">{{robotList[index].target_name}}</el-tag>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="库位状态" v-if="item.point_id!=371">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card shadow="hover" style="width: 100%;margin-top: 20px; height:180px;">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>{{robotList[index+1].sname}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="slotDiv">
|
|
|
+ 锁定状态:<el-tag size="small" type="success">{{robotList[index+1].lock_status=='0'? '已锁定':(robotList[index+1].lock_status=='1')?'已放置':'未锁定'}}</el-tag>
|
|
|
+ </div>
|
|
|
+ <div class="slotDiv" v-if="robotList[index+1].node_name">
|
|
|
+ 节点名称:<el-tag size="small" type="success">{{robotList[index+1].node_name}}</el-tag>
|
|
|
+ </div>
|
|
|
+ <div class="slotDiv" v-if="robotList[index+1].target_name">
|
|
|
+ 目标位置:<el-tag size="small" type="success">{{robotList[index+1].target_name}}</el-tag>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card shadow="hover" style="width: 100%;margin-top: 20px; height:180px;">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>{{robotList[index+2].sname}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="slotDiv">
|
|
|
+ 锁定状态:<el-tag size="small" type="success">{{robotList[index+2].lock_status=='0'? '已锁定':(robotList[index+1].lock_status=='2')?'已放置':'未锁定'}}</el-tag>
|
|
|
+ </div>
|
|
|
+ <div class="slotDiv" v-if="robotList[index+2].node_name">
|
|
|
+ 节点名称:<el-tag size="small" type="success">{{robotList[index+2].node_name}}</el-tag>
|
|
|
+ </div>
|
|
|
+ <div class="slotDiv" v-if="robotList[index+2].target_name">
|
|
|
+ 目标位置:<el-tag size="small" type="success">{{robotList[index+2].target_name}}</el-tag>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+
|
|
|
+ <!--
|
|
|
+ <el-dialog
|
|
|
+ ref="view"
|
|
|
+ title="产线机器人"
|
|
|
+ :visible.sync="modeVisible"
|
|
|
+ width="50%"
|
|
|
+ custom-class="dialogNoTop"
|
|
|
+ >
|
|
|
+ <robot-view @close="modeClose" @success="editModeSuccess" />
|
|
|
+ </el-dialog> -->
|
|
|
+ <robot-view
|
|
|
+ ref="view"
|
|
|
+ :dialog-visible="modeVisible"
|
|
|
+ @success="editModeSuccess"
|
|
|
+ @close="modeClose"
|
|
|
+ />
|
|
|
+
|
|
|
+ <record-view
|
|
|
+ ref="recordView"
|
|
|
+ :dialog-visible="recordVisible"
|
|
|
+ @success="recordSuccess"
|
|
|
+ @close="recordClose"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ // 【产线管理】-API
|
|
|
+ import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
|
|
|
+ import elDragDialog from '@/directive/el-drag-dialog'
|
|
|
+ import { initQueryParams, initDicts } from '@/utils/commons'
|
|
|
+ import RobotView from "./components/View"
|
|
|
+ import RecordView from "./components/Record"
|
|
|
+ export default {
|
|
|
+ name: "robotMonitor",
|
|
|
+ directives: { elDragDialog },
|
|
|
+ components: {RobotView, RecordView},
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ dicts: {
|
|
|
+ ROBOT_TYPE: {} //机器人类型
|
|
|
+ },
|
|
|
+ modeVisible: false,
|
|
|
+ recordVisible: false,
|
|
|
+ rowData: {}, // row数据
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ robotList: [{name:"智能生产保障系统", runMode:"2"},{name:"舱体类加工单元", runMode:"2"},{name:"框体类加工单元", runMode:"1"}],
|
|
|
+ confirmDisabled: false,
|
|
|
+ tenant: this.initTenant(),
|
|
|
+ rules: {
|
|
|
+ id: [
|
|
|
+ { required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ created() {
|
|
|
+ initDicts(['ROBOT_TYPE'], this.dicts)
|
|
|
+ // 获取【产线】数据下拉
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ currentUser () {
|
|
|
+ return this.$store.state.account.user
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initTenant () {
|
|
|
+ return {
|
|
|
+ id: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ reset () {
|
|
|
+ // 先清除校验,再清除表单,不然有奇怪的bug
|
|
|
+ this.$refs.form.clearValidate()
|
|
|
+ this.$refs.form.resetFields()
|
|
|
+ this.tenant = this.initTenant()
|
|
|
+ },
|
|
|
+ // 获取【产线】数据下拉
|
|
|
+ fetch(){
|
|
|
+ areaMgrApi.robotList({}).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.robotList = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ modeClose(){
|
|
|
+ this.modeVisible = false
|
|
|
+ },
|
|
|
+ recordClose(){
|
|
|
+ this.recordVisible = false
|
|
|
+ },
|
|
|
+ editModeSuccess(){
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ recordSuccess(){
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ detail(item, index){
|
|
|
+ if(item.point_id==371){
|
|
|
+ item.storge_ids = item.storge_id
|
|
|
+ }else{
|
|
|
+ let storge_ids = [this.robotList[index].storge_id, this.robotList[index+1].storge_id,this.robotList[index+2].storge_id]
|
|
|
+ item.storge_ids = storge_ids.filter(item=>item!=null).join(",");
|
|
|
+ }
|
|
|
+ this.modeVisible = true
|
|
|
+ this.$refs.view.setTenant(item)
|
|
|
+ },
|
|
|
+ record(item, index){
|
|
|
+ this.recordVisible = true
|
|
|
+ this.$refs.recordView.setTenant(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<!-- 本组件的css -->
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .slotDiv {
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 5px;
|
|
|
+ }
|
|
|
+ .formTitle{
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 700;
|
|
|
+ margin: 30px 30px 20px 30px;
|
|
|
+ padding-bottom: 20px;
|
|
|
+ border-bottom: 1px solid #CCCCCC;
|
|
|
+ }
|
|
|
+ .description {
|
|
|
+ width:90%;
|
|
|
+ margin: 10px auto;
|
|
|
+ padding:0 3%;
|
|
|
+ }
|
|
|
+ .el-descriptions >>> .el-descriptions__table{
|
|
|
+ height:180px;
|
|
|
+ }
|
|
|
+ .el-descriptions >>> .el-descriptions-item__label{
|
|
|
+ margin-left:15px;
|
|
|
+ }
|
|
|
+ .formContaner form{
|
|
|
+ max-width: 600px;
|
|
|
+ }
|
|
|
+ .dialog-footer{
|
|
|
+ margin-left: 180px;
|
|
|
+ }
|
|
|
+</style>
|