Commit effb6f6f authored by Administrator's avatar Administrator

地图增加切断装置

parent cd47bb4f
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddShutOffToDeviceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('device', function (Blueprint $table) {
$table->integer('shutoff_status')->default(0)->comment('切断装置状态,0初始化状态,1开启,2关闭');
$table->integer('shutoff_type')->default(0)->comment('切断装置类型,0未绑定,1电磁阀,2机械手');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('device', function (Blueprint $table) {
$table->dropColumn('shutoff_status');
$table->dropColumn('shutoff_type');
});
}
}
......@@ -54,7 +54,7 @@
<el-dialog
:title="dialogTitle"
:visible.sync="dialogTableVisible"
width="20%"
width="40%"
:modal="false"
custom-class="zero-dialog"
>
......@@ -70,7 +70,7 @@
<template slot="title">
设备列表 - {{ leftDeviceName }}
</template>
<el-table :data="markersDevice" style="100%" max-height="700">
<el-table :data="markersDevice" style="100%" max-height="700" @row-click="openDeviceBox">
<el-table-column property="devicenum" label="设备编号" width="200px"></el-table-column>
<el-table-column property="deviceinfo" label="位置" width="200px"></el-table-column>
<el-table-column property="nd" label="值" width="40px"></el-table-column>
......@@ -322,6 +322,14 @@ export default {
title: '检测介质',
content: deviceInfo.gas,
},
{
title: '切断装置',
content: this.shutoffDevice(deviceInfo.shutoff_type),
},
{
title: '切断装置状态',
content: this.shutoffStatus(deviceInfo.shutoff_status),
},
{
title: '状态',
content: deviceInfo.status_name,
......@@ -341,6 +349,24 @@ export default {
];
});
},
// 切断装置
shutoffDevice(id) {
const shutoff_types = [];
shutoff_types[0] = '未绑定';
shutoff_types[1] = '电磁阀';
shutoff_types[2] = '机械手';
return shutoff_types[id];
},
shutoffStatus(id) {
const shutoff = [];
shutoff[0] = '初始化';
shutoff[1] = '开启';
shutoff[2] = '关闭';
return shutoff[id];
},
openDeviceBox(row, column, event) {
this.getUserDeviceInfo(row.id);
},
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment