|
@@ -8,123 +8,119 @@
|
|
|
@fun2="getIDName"
|
|
@fun2="getIDName"
|
|
|
@fun3="getIsOnline"
|
|
@fun3="getIsOnline"
|
|
|
></search-bar>
|
|
></search-bar>
|
|
|
- <template v-if="displayType == 1">
|
|
|
|
|
- <el-row :gutter="10">
|
|
|
|
|
- <el-col
|
|
|
|
|
- :xs="24"
|
|
|
|
|
- :sm="24"
|
|
|
|
|
- :md="12"
|
|
|
|
|
- :lg="8"
|
|
|
|
|
- :xl="6"
|
|
|
|
|
- v-for="item in equipList"
|
|
|
|
|
- :key="item.imei"
|
|
|
|
|
- >
|
|
|
|
|
- <el-card class="box-card">
|
|
|
|
|
- <span
|
|
|
|
|
- :class="['on-stauts', item.device_status == 1 ? 'on' : 'off']"
|
|
|
|
|
- ></span>
|
|
|
|
|
- <div
|
|
|
|
|
- class="superOperate"
|
|
|
|
|
- v-show="userType == 1"
|
|
|
|
|
- @click="equipOperation(item.d_id)"
|
|
|
|
|
- >
|
|
|
|
|
- <i class="el-icon-setting"></i>
|
|
|
|
|
- </div>
|
|
|
|
|
- <img src="@/assets/images/cure/scd/scdIconOn.png" />
|
|
|
|
|
- <p class="equip">{{ item.device_id }}</p>
|
|
|
|
|
- <div class="item_info">
|
|
|
|
|
- <p>设备名称 : {{ item.device_name }}</p>
|
|
|
|
|
- <p>最新上报时间 : {{ (item.status_time * 1000) | formatTime }}</p>
|
|
|
|
|
- <p>地址 : {{ item.address || '无' }}</p>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="btns">
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="info"
|
|
|
|
|
- @click="equipStateSet(item.device_id, item.device_status)"
|
|
|
|
|
- >设备状态</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="warning"
|
|
|
|
|
- @click="EquipControl(item.d_id)"
|
|
|
|
|
- >设备控制</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button size="mini" type="success" @click="simSet(item.d_id)"
|
|
|
|
|
- >SIM卡状态</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- @click="dataDetails(item.device_id, item.d_id)"
|
|
|
|
|
- >数据详情</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-card>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template v-if="displayType == 2">
|
|
|
|
|
- <el-card class="box-card">
|
|
|
|
|
- <el-table :data="equipList" stripe style="width: 100%">
|
|
|
|
|
- <el-table-column prop="device_id" label="设备ID" width="180">
|
|
|
|
|
- <template slot-scope="scope">{{ scope.row.device_id }}</template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="device_name" label="设备名称" width="180">
|
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
|
- scope.row.device_name == '' ? '无' : scope.row.device_name
|
|
|
|
|
- }}</template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="device_status" label="在线状态">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <p style="color: #17bb89" v-if="scope.row.device_status == 1">
|
|
|
|
|
- 在线
|
|
|
|
|
- </p>
|
|
|
|
|
- <p style="color: #eb6765" v-if="scope.row.device_status == 0">
|
|
|
|
|
- 离线
|
|
|
|
|
- </p>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="dver_num" label="设备版本"></el-table-column>
|
|
|
|
|
- <el-table-column prop="status_time" label="最新上报时间">
|
|
|
|
|
- <template slot-scope="scope">{{
|
|
|
|
|
- (scope.row.status_time * 1000) | formatTime
|
|
|
|
|
- }}</template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="操作" width="400">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="info"
|
|
|
|
|
- @click="
|
|
|
|
|
- equipStateSet(scope.row.device_id, scope.row.device_status)
|
|
|
|
|
- "
|
|
|
|
|
- >设备状态</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="warning"
|
|
|
|
|
- @click="EquipControl(scope.row.d_id)"
|
|
|
|
|
- >设备控制</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="success"
|
|
|
|
|
- @click="simSet(scope.row.d_id)"
|
|
|
|
|
- >SIM卡状态</el-button
|
|
|
|
|
- >
|
|
|
|
|
- <el-button
|
|
|
|
|
- size="mini"
|
|
|
|
|
- type="danger"
|
|
|
|
|
- @click="dataDetails(scope.row.device_id, scope.row.d_id)"
|
|
|
|
|
- >数据详情</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </el-card>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <div v-loading='dataloading'>
|
|
|
|
|
+ <template v-if="displayType == 1">
|
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
|
+ <el-col
|
|
|
|
|
+ :xs="24"
|
|
|
|
|
+ :sm="24"
|
|
|
|
|
+ :md="12"
|
|
|
|
|
+ :lg="8"
|
|
|
|
|
+ :xl="6"
|
|
|
|
|
+ v-for="item in equipList"
|
|
|
|
|
+ :key="item.imei"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
|
+ <span
|
|
|
|
|
+ :class="['on-stauts', item.device_status == 1 ? 'on' : 'off']"
|
|
|
|
|
+ ></span>
|
|
|
|
|
+ <img src="@/assets/images/cure/scd/scdIconOn.png" />
|
|
|
|
|
+ <p class="equip">{{ item.device_id }}</p>
|
|
|
|
|
+ <div class="item_info">
|
|
|
|
|
+ <p>设备名称 : {{ item.device_name || '无' }}</p>
|
|
|
|
|
+ <p>最新上报时间 : {{ item.status_time }}</p>
|
|
|
|
|
+ <p>地址 : {{ item.address || '无' }}</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="btns">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ @click="equipStateSet(item.device_id,item.device_status)"
|
|
|
|
|
+ >设备状态</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="warning"
|
|
|
|
|
+ @click="EquipControl(item.device_id)"
|
|
|
|
|
+ >设备控制</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="dataDetails(item.device_id,item.device_name,item.address)"
|
|
|
|
|
+ >数据详情</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="displayType == 2">
|
|
|
|
|
+ <el-card class="box-card">
|
|
|
|
|
+ <el-table :data="equipList" stripe style="width: 100%">
|
|
|
|
|
+ <el-table-column prop="device_id" label="设备ID" width="180">
|
|
|
|
|
+ <template slot-scope="scope">{{ scope.row.device_id }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="device_name" label="设备名称" width="180">
|
|
|
|
|
+ <template slot-scope="scope">{{
|
|
|
|
|
+ scope.row.device_name == '' ? '无' : scope.row.device_name
|
|
|
|
|
+ }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="device_status" label="在线状态">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <p style="color: #17bb89" v-if="scope.row.device_status == 1">
|
|
|
|
|
+ 在线
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <p style="color: #eb6765" v-if="scope.row.device_status == 0">
|
|
|
|
|
+ 离线
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="address" label="地址">
|
|
|
|
|
+ <template slot-scope="scope">{{ scope.row.address }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="status_time" label="最新上报时间">
|
|
|
|
|
+ <template slot-scope="scope">{{ scope.row.status_time }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作" width="400">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ @click="
|
|
|
|
|
+ equipStateSet(scope.row.device_id,scope.row.device_status)
|
|
|
|
|
+ "
|
|
|
|
|
+ >设备状态</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="warning"
|
|
|
|
|
+ @click="EquipControl(scope.row.device_id)"
|
|
|
|
|
+ >设备控制</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="dataDetails(scope.row.device_id,scope.row.device_name,scope.row.address)"
|
|
|
|
|
+ >数据详情</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- 暂无数据 -->
|
|
|
|
|
+ <div class="expertDiagnosis_referral_units_not" v-if="equipList.length<=0 && displayType==1">
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="@/assets/images/zanwu.png"
|
|
|
|
|
+ alt
|
|
|
|
|
+ class="expertDiagnosis_referral_units_notImg"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<el-pagination
|
|
<el-pagination
|
|
|
|
|
+ v-if="equipList.length>0"
|
|
|
background
|
|
background
|
|
|
layout="prev, pager, next"
|
|
layout="prev, pager, next"
|
|
|
:total="totalNum"
|
|
:total="totalNum"
|
|
@@ -199,15 +195,15 @@
|
|
|
label-width="120px"
|
|
label-width="120px"
|
|
|
>
|
|
>
|
|
|
<el-form-item label="设备开关:" prop="ds">
|
|
<el-form-item label="设备开关:" prop="ds">
|
|
|
- <el-select v-model="equipContrlForm.ds">
|
|
|
|
|
- <el-option label="开机" value="1"></el-option>
|
|
|
|
|
- <el-option label="关机" value="0"></el-option>
|
|
|
|
|
|
|
+ <el-select v-model="equipContrlForm.ds" @change="equipSwitch">
|
|
|
|
|
+ <el-option label="开机" :value="1"></el-option>
|
|
|
|
|
+ <el-option label="关机" :value="0"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="定时模式:" prop="ts">
|
|
<el-form-item label="定时模式:" prop="ts">
|
|
|
<el-select v-model="equipContrlForm.ts" placeholder="定时模式">
|
|
<el-select v-model="equipContrlForm.ts" placeholder="定时模式">
|
|
|
- <el-option label="光控" value="0"></el-option>
|
|
|
|
|
- <el-option label="时控" value="1"></el-option>
|
|
|
|
|
|
|
+ <el-option label="光控" :value="0"></el-option>
|
|
|
|
|
+ <el-option label="时控" :value="1"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
<el-form-item
|
|
@@ -221,9 +217,9 @@
|
|
|
placeholder="起始时间"
|
|
placeholder="起始时间"
|
|
|
v-model="equipContrlForm.st"
|
|
v-model="equipContrlForm.st"
|
|
|
:picker-options="{
|
|
:picker-options="{
|
|
|
- start: '00:00',
|
|
|
|
|
- step: '01:00',
|
|
|
|
|
- end: '24:00'
|
|
|
|
|
|
|
+ start: '0:00',
|
|
|
|
|
+ step: '1:00',
|
|
|
|
|
+ end: '23:00'
|
|
|
}"
|
|
}"
|
|
|
></el-time-select>
|
|
></el-time-select>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -233,9 +229,10 @@
|
|
|
placeholder="结束时间"
|
|
placeholder="结束时间"
|
|
|
v-model="equipContrlForm.et"
|
|
v-model="equipContrlForm.et"
|
|
|
:picker-options="{
|
|
:picker-options="{
|
|
|
- start: '00:00',
|
|
|
|
|
- step: '01:00',
|
|
|
|
|
- end: '24:00'
|
|
|
|
|
|
|
+ start: '0:00',
|
|
|
|
|
+ step: '1:00',
|
|
|
|
|
+ end: '23:00',
|
|
|
|
|
+ minTime: equipContrlForm.st
|
|
|
}"
|
|
}"
|
|
|
></el-time-select>
|
|
></el-time-select>
|
|
|
</el-col>
|
|
</el-col>
|
|
@@ -261,16 +258,16 @@
|
|
|
<div class="sliderParent">
|
|
<div class="sliderParent">
|
|
|
<div class="block">
|
|
<div class="block">
|
|
|
<el-slider
|
|
<el-slider
|
|
|
- :min="10"
|
|
|
|
|
- step="10"
|
|
|
|
|
- :max="120"
|
|
|
|
|
|
|
+ :min='10'
|
|
|
|
|
+ :step='10'
|
|
|
|
|
+ :max='120'
|
|
|
v-model="equipContrlForm.dattim"
|
|
v-model="equipContrlForm.dattim"
|
|
|
show-input
|
|
show-input
|
|
|
></el-slider>
|
|
></el-slider>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="自清虫定时:" prop="clt">
|
|
|
|
|
|
|
+ <!-- <el-form-item label="自清虫定时:" prop="clt">
|
|
|
<div class="sliderParent">
|
|
<div class="sliderParent">
|
|
|
<div class="block">
|
|
<div class="block">
|
|
|
<el-slider
|
|
<el-slider
|
|
@@ -281,7 +278,7 @@
|
|
|
></el-slider>
|
|
></el-slider>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item class="handAddFormBtn">
|
|
<el-form-item class="handAddFormBtn">
|
|
|
<el-button type="primary" size="mini" @click="equipControlSubm"
|
|
<el-button type="primary" size="mini" @click="equipControlSubm"
|
|
|
>确定</el-button
|
|
>确定</el-button
|
|
@@ -349,6 +346,7 @@ import SearchBar from '@/components/SearchBar'
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ dataloading:false,
|
|
|
//图表和表格切换
|
|
//图表和表格切换
|
|
|
displayType: '1',
|
|
displayType: '1',
|
|
|
//在线状态按钮切换
|
|
//在线状态按钮切换
|
|
@@ -406,7 +404,6 @@ export default {
|
|
|
ts: '',
|
|
ts: '',
|
|
|
tt: '',
|
|
tt: '',
|
|
|
dattim: 10,
|
|
dattim: 10,
|
|
|
- clt: 10
|
|
|
|
|
},
|
|
},
|
|
|
//参数
|
|
//参数
|
|
|
queryInfo: {
|
|
queryInfo: {
|
|
@@ -461,22 +458,43 @@ export default {
|
|
|
},
|
|
},
|
|
|
//获取设备列表
|
|
//获取设备列表
|
|
|
getEquipList() {
|
|
getEquipList() {
|
|
|
|
|
+ this.dataloading = true;
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- url: '/api/api_gateway?method=forecast.worm_lamp.lamp_list',
|
|
|
|
|
|
|
+ url: '/api/equipmanage_scd',
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
- device_type_id: 2,
|
|
|
|
|
- page_size: 8,
|
|
|
|
|
|
|
+ req: 'filter',
|
|
|
|
|
+ is_online:this.queryInfo.is_online,
|
|
|
|
|
+ ename: this.queryInfo.ename,
|
|
|
page: this.queryInfo.page,
|
|
page: this.queryInfo.page,
|
|
|
- device_status: this.queryInfo.is_online,
|
|
|
|
|
- device_name: this.queryInfo.ename,
|
|
|
|
|
- device_id: this.queryInfo.f_id
|
|
|
|
|
|
|
+ f_id: this.queryInfo.f_id,
|
|
|
})
|
|
})
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- if (res.data.message == '') {
|
|
|
|
|
- this.equipList = res.data.data.data
|
|
|
|
|
- this.totalNum = res.data.data.counts
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.dataloading = false
|
|
|
|
|
+ if(res.data.nums){
|
|
|
|
|
+ var dat = res.data.dat;
|
|
|
|
|
+ var arr = [];
|
|
|
|
|
+ for(var i = 0;i<dat.length;i++){
|
|
|
|
|
+ arr.push({
|
|
|
|
|
+ address: dat[i].locat,
|
|
|
|
|
+ device_id: dat[i].equip_id,
|
|
|
|
|
+ device_name: dat[i].equip_name,
|
|
|
|
|
+ device_status: parseInt(dat[i].is_online),
|
|
|
|
|
+ status_time: dat[i].upl_time,
|
|
|
|
|
+ })
|
|
|
|
|
+ if(i == dat.length-1){
|
|
|
|
|
+ console.log(arr)
|
|
|
|
|
+ this.equipList = arr
|
|
|
|
|
+ this.totalNum = res.data.nums
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.equipList = []
|
|
|
|
|
+ this.totalNum = 0
|
|
|
|
|
+ }
|
|
|
|
|
+ },error =>{
|
|
|
|
|
+ this.dataloading = false
|
|
|
|
|
+ this.$message.error('获取失败')
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
simSet(d_id) {
|
|
simSet(d_id) {
|
|
@@ -519,27 +537,40 @@ export default {
|
|
|
this.getEquipList()
|
|
this.getEquipList()
|
|
|
},
|
|
},
|
|
|
// 数据详情
|
|
// 数据详情
|
|
|
- dataDetails(e_id, d_id) {
|
|
|
|
|
|
|
+ dataDetails(e_id,name,address) {
|
|
|
this.currImei = e_id
|
|
this.currImei = e_id
|
|
|
- this.$router.push(`/index/scdDetail/${e_id}/${d_id}`)
|
|
|
|
|
|
|
+ this.$router.push({path:`/index/scdDetail`,query:{id:e_id,name:name,address:address}})
|
|
|
},
|
|
},
|
|
|
//sim卡状态
|
|
//sim卡状态
|
|
|
handleClick(tab, event) {
|
|
handleClick(tab, event) {
|
|
|
console.log(tab, event)
|
|
console.log(tab, event)
|
|
|
},
|
|
},
|
|
|
// 设备状态弹框
|
|
// 设备状态弹框
|
|
|
- equipStateSet(id, device_status) {
|
|
|
|
|
|
|
+ equipStateSet(id,status) {
|
|
|
this.currImei = id
|
|
this.currImei = id
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- url: '/api/api_gateway?method=forecast.worm_lamp.device_history_data',
|
|
|
|
|
|
|
+ url: '/api/equipmanage_scd',
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
- device_type_id: 2,
|
|
|
|
|
- page_size: 1,
|
|
|
|
|
- device_id: id,
|
|
|
|
|
- page: 1
|
|
|
|
|
|
|
+ req: 'imei',
|
|
|
|
|
+ id: id,
|
|
|
})
|
|
})
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
|
|
+ var scd_status = eval('('+res.data.scd_status+')');
|
|
|
|
|
+ this.equipStateList[0].val = scd_status.ds == 0 ? '关机' : '开机';
|
|
|
|
|
+ if(scd_status.ws == 0){
|
|
|
|
|
+ this.equipStateList[1].val = '待机'
|
|
|
|
|
+ }else if(scd_status.ws == 1){
|
|
|
|
|
+ this.equipStateList[1].val = '工作'
|
|
|
|
|
+ }else if(scd_status.ws == 2){
|
|
|
|
|
+ this.equipStateList[1].val = '充电'
|
|
|
|
|
+ }
|
|
|
|
|
+ this.equipStateList[2].val = scd_status.tt == 0 ? '常亮' : scd_status.tt;
|
|
|
|
|
+ this.equipStateList[3].val = scd_status.clt/60;
|
|
|
|
|
+ this.equipStateList[4].val = scd_status.tbs == 0 ? '正常' : '保护'
|
|
|
|
|
+ this.equipStateList[5].val = status == 0 ? '离线' : '在线'
|
|
|
|
|
+ this.equipStateList[6].val = scd_status.rps == 0 ? '正常' : '保护'
|
|
|
|
|
+
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
let data = res.data.data.data[0].d_h_t
|
|
let data = res.data.data.data[0].d_h_t
|
|
|
this.equipStateList[5].val = device_status == 0 ? '离线' : '在线'
|
|
this.equipStateList[5].val = device_status == 0 ? '离线' : '在线'
|
|
@@ -573,39 +604,82 @@ export default {
|
|
|
this.equipStateDialogVisible = true
|
|
this.equipStateDialogVisible = true
|
|
|
},
|
|
},
|
|
|
//设备控制
|
|
//设备控制
|
|
|
- EquipControl(d_id) {
|
|
|
|
|
- this.d_id = d_id
|
|
|
|
|
|
|
+ EquipControl(id) {
|
|
|
|
|
+ this.currImei = id
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- url:
|
|
|
|
|
- '/api/api_gateway?method=forecast.send_control.device_control_info',
|
|
|
|
|
- data: this.qs.stringify({ d_id, get_type: 1 })
|
|
|
|
|
|
|
+ url: '/api/equipmanage_scd',
|
|
|
|
|
+ data: this.qs.stringify({
|
|
|
|
|
+ req: 'imei',
|
|
|
|
|
+ id: id,
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- if (Object.keys(res.data.data).length > 0) {
|
|
|
|
|
- let data = res.data.data
|
|
|
|
|
- this.equipContrlForm = data
|
|
|
|
|
|
|
+ var scd_status = eval('('+res.data.scd_status+')');
|
|
|
|
|
+ this.equipContrlForm = {
|
|
|
|
|
+ dattim: scd_status.dattim,
|
|
|
|
|
+ ds: scd_status.ds,
|
|
|
|
|
+ et: scd_status.et,
|
|
|
|
|
+ st: scd_status.st,
|
|
|
|
|
+ ts: scd_status.tcs,
|
|
|
|
|
+ tt: scd_status.tt,
|
|
|
}
|
|
}
|
|
|
this.equipControlDialogVisible = true
|
|
this.equipControlDialogVisible = true
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
equipControlSubm() {
|
|
equipControlSubm() {
|
|
|
|
|
+ let obj = this.equipContrlForm
|
|
|
|
|
+ obj.st = obj.st && obj.st.toString().slice(0, 2) != '0' ? obj.st.toString().slice(0, 2) : obj.st.toString().slice(1, 2)
|
|
|
|
|
+ obj.et = obj.et && obj.et.toString().slice(0, 2) != '0' ? obj.et.toString().slice(0, 2) : obj.et.toString().slice(1, 2)
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
- url: '/api/api_gateway?method=forecast.send_control.device_control',
|
|
|
|
|
|
|
+ url: '/api/scd_mqtt',
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
- device_type_id: 2,
|
|
|
|
|
- d_id: this.d_id,
|
|
|
|
|
- config: JSON.stringify(this.equipContrlForm)
|
|
|
|
|
|
|
+ sw: 'datt',
|
|
|
|
|
+ topicid: JSON.stringify([this.currImei]),
|
|
|
|
|
+ dattim: this.equipContrlForm.dattim
|
|
|
})
|
|
})
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- if (res.data.data) {
|
|
|
|
|
|
|
+ if (res.data != 0) {
|
|
|
|
|
+ this.$message.error('设备控制修改失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ url: '/api/scd_mqtt_all',
|
|
|
|
|
+ data: this.qs.stringify({
|
|
|
|
|
+ sw: 'timer',
|
|
|
|
|
+ ts: this.equipContrlForm.ts,
|
|
|
|
|
+ hours: this.equipContrlForm.tt,
|
|
|
|
|
+ begin: this.equipContrlForm.st,
|
|
|
|
|
+ end: this.equipContrlForm.et
|
|
|
|
|
+ })
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if (res.data == 0) {
|
|
|
this.$message.success('设备控制修改成功')
|
|
this.$message.success('设备控制修改成功')
|
|
|
} else {
|
|
} else {
|
|
|
- his.$message.error('设备控制修改失败')
|
|
|
|
|
|
|
+ this.$message.error('设备控制修改失败')
|
|
|
}
|
|
}
|
|
|
this.equipControlDialogVisible = false
|
|
this.equipControlDialogVisible = false
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ //设备开关控制
|
|
|
|
|
+ equipSwitch(){
|
|
|
|
|
+ this.$axios({
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ url: '/api/scd_mqtt',
|
|
|
|
|
+ data: this.qs.stringify({
|
|
|
|
|
+ sw: 'timer',
|
|
|
|
|
+ topicid: JSON.stringify([this.currImei]),
|
|
|
|
|
+ ds: this.equipContrlForm.ds
|
|
|
|
|
+ })
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ if (res.data == 0) {
|
|
|
|
|
+ this.$message.success('设备控制修改成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error('设备控制修改失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
equipControlDialogClosed() {
|
|
equipControlDialogClosed() {
|
|
|
this.$refs.equipContrlRef.resetFields()
|
|
this.$refs.equipContrlRef.resetFields()
|
|
|
// console.log(this.equipContrlForm)
|
|
// console.log(this.equipContrlForm)
|
|
@@ -817,4 +891,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
/deep/.el-date-editor--time-select{width:100%!important}
|
|
/deep/.el-date-editor--time-select{width:100%!important}
|
|
|
/deep/.line{text-align:center}
|
|
/deep/.line{text-align:center}
|
|
|
|
|
+// 暂无数据
|
|
|
|
|
+.expertDiagnosis_referral_units_not {
|
|
|
|
|
+ width: 272px;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|