|
|
@ -7,17 +7,16 @@
|
|
|
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="editDevice">新增</el-button>
|
|
|
|
<el-button size="mini" type="primary" icon="el-icon-plus" @click="editDevice">新增</el-button>
|
|
|
|
<el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteDevice">删除</el-button>
|
|
|
|
<el-button size="mini" icon="el-icon-delete" type="danger" @click="deleteDevice">删除</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="deviceBox">
|
|
|
|
<div id="deviceBox">
|
|
|
|
<div class="deviceMsg" v-for="i in 150" :key="i">
|
|
|
|
<div class="deviceMsg" v-for="(item, index) in deviceData" :key="index">
|
|
|
|
<el-popover placement="right" width="250" trigger="click">
|
|
|
|
<el-popover placement="right" width="270" trigger="click">
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
|
|
<el-col :span="24">
|
|
|
|
<div class="iconBox">
|
|
|
|
<div class="iconBox">
|
|
|
|
<img src="../../../assets/images/位置.png" class="iconImg" alt />
|
|
|
|
<img src="../../../assets/images/位置.png" class="iconImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="span1 span2">位置</span>
|
|
|
|
<span class="span1 span2">位置</span>
|
|
|
|
<span class="span1 span3">001</span>
|
|
|
|
<span class="span1 span3">{{item.location}}</span>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
@ -26,7 +25,7 @@
|
|
|
|
<img src="../../../assets/images/网络.png" class="iconImg" alt />
|
|
|
|
<img src="../../../assets/images/网络.png" class="iconImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="span1 span4">IP地址</span>
|
|
|
|
<span class="span1 span4">IP地址</span>
|
|
|
|
<span class="span1 span5">192.168.88.88</span>
|
|
|
|
<span class="span1 span5">{{item.deviceIp}}</span>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
@ -35,7 +34,7 @@
|
|
|
|
<img src="../../../assets/images/音符.png" class="iconImg" alt />
|
|
|
|
<img src="../../../assets/images/音符.png" class="iconImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="span1 span2">音符</span>
|
|
|
|
<span class="span1 span2">音符</span>
|
|
|
|
<span class="span1 span3">1</span>
|
|
|
|
<span class="span1 span3">{{item.note}}</span>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
@ -44,7 +43,7 @@
|
|
|
|
<img src="../../../assets/images/音量.png" class="iconImg" alt />
|
|
|
|
<img src="../../../assets/images/音量.png" class="iconImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="span1 span2">音量</span>
|
|
|
|
<span class="span1 span2">音量</span>
|
|
|
|
<span class="span1 span3">50%</span>
|
|
|
|
<span class="span1 span3">{{item.volume}}</span>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
@ -53,7 +52,11 @@
|
|
|
|
<img src="../../../assets/images/设置.png" class="iconImg" alt />
|
|
|
|
<img src="../../../assets/images/设置.png" class="iconImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="span1">设备状态</span>
|
|
|
|
<span class="span1">设备状态</span>
|
|
|
|
<span class="span1">正常</span>
|
|
|
|
<span class="span1">{{item.status==0?'正常':'异常'}}</span>
|
|
|
|
|
|
|
|
<!-- <template slot-scope="scope">
|
|
|
|
|
|
|
|
<span class="span1" v-if="scope.row.stasus == '1'">不正常</span>
|
|
|
|
|
|
|
|
<span class="span1" v-else-if="scope.row.status == '0'">正常</span>
|
|
|
|
|
|
|
|
</template>-->
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
@ -62,7 +65,7 @@
|
|
|
|
<img src="../../../assets/images/时间.png" class="iconImg" alt />
|
|
|
|
<img src="../../../assets/images/时间.png" class="iconImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="span1">创建时间</span>
|
|
|
|
<span class="span1">创建时间</span>
|
|
|
|
<span class="span1">2022.02.22</span>
|
|
|
|
<span class="span1">{{item.createTime}}</span>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
@ -71,37 +74,121 @@
|
|
|
|
<img src="../../../assets/images/创建人.png" class="iconImg" alt />
|
|
|
|
<img src="../../../assets/images/创建人.png" class="iconImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="span1 span6">创建人</span>
|
|
|
|
<span class="span1 span6">创建人</span>
|
|
|
|
<span class="span1 span7">张大大</span>
|
|
|
|
<span class="span1 span7">{{item.createBy}}</span>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="shadows" slot="reference"></div>
|
|
|
|
<div :class="item.status==0?'shadows':'active'" slot="reference"></div>
|
|
|
|
</el-popover>
|
|
|
|
</el-popover>
|
|
|
|
|
|
|
|
<div class="deleteIcon" @click="removeItem(index,deviceData)">
|
|
|
|
<div class="deleteIcon">
|
|
|
|
|
|
|
|
<img src="../../../assets/images/删除.png" class="deleteImg" alt />
|
|
|
|
<img src="../../../assets/images/删除.png" class="deleteImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span class="deviceStatus">正常</span>
|
|
|
|
<span class="deviceStatus">{{item.status==0?'正常':'异常'}}</span>
|
|
|
|
<span class="deviceNumber">{{i}}</span>
|
|
|
|
<span class="deviceNumber">{{item.deviceId}}</span>
|
|
|
|
|
|
|
|
|
|
|
|
<img src="../../../assets/images/喇叭.png" class="deviceImg" alt />
|
|
|
|
<img src="../../../assets/images/喇叭.png" class="deviceImg" alt />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 新增设备对话框-->
|
|
|
|
|
|
|
|
<el-dialog title :visible.sync="addDevice" width="20%" style="top:20vh" center>
|
|
|
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
|
|
<el-form-item label="位置" prop="location">
|
|
|
|
|
|
|
|
<el-input placeholder="请输入位置" v-model="form.location"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
|
|
<el-form-item label="IP地址" prop="address">
|
|
|
|
|
|
|
|
<el-input placeholder="请输入IP地址" v-model="form.address"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
|
|
<el-form-item label="音符" prop="note">
|
|
|
|
|
|
|
|
<el-input placeholder="请输入音符" v-model="form.note"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
|
|
<el-form-item label="音量" prop="volume">
|
|
|
|
|
|
|
|
<el-input placeholder="请输入音量" v-model="form.volume"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
|
<el-button type="primary" @click="addDevice = false">取 消</el-button>
|
|
|
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
<div class="panel-footer"></div>
|
|
|
|
<div class="panel-footer"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import flexible from "@/layout/flexible.js";
|
|
|
|
import flexible from "@/layout/flexible.js";
|
|
|
|
|
|
|
|
import { listDevice } from "@/api/Device";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {};
|
|
|
|
return {
|
|
|
|
|
|
|
|
//查询参数
|
|
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
|
|
pageNum: 1
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
address: null,
|
|
|
|
|
|
|
|
note: null,
|
|
|
|
|
|
|
|
volume: null,
|
|
|
|
|
|
|
|
location: null,
|
|
|
|
|
|
|
|
addDevice: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
form: {},
|
|
|
|
|
|
|
|
forms: {},
|
|
|
|
|
|
|
|
rules: {},
|
|
|
|
|
|
|
|
deviceData: []
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
//查询设备数据
|
|
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
|
|
this.loading = true;
|
|
|
|
|
|
|
|
listDevice(this.queryParams).then(result => {
|
|
|
|
|
|
|
|
this.deviceData = result.rows;
|
|
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
//新增按钮
|
|
|
|
//新增按钮
|
|
|
|
editDevice() {},
|
|
|
|
editDevice() {
|
|
|
|
|
|
|
|
this.addDevice = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//确定按钮
|
|
|
|
|
|
|
|
submitForm() {
|
|
|
|
|
|
|
|
this.addDevice = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
//删除按钮
|
|
|
|
//删除按钮
|
|
|
|
deleteDevice() {}
|
|
|
|
deleteDevice() {},
|
|
|
|
|
|
|
|
//删除对应的喇叭
|
|
|
|
|
|
|
|
removeItem(index, deviceData) {
|
|
|
|
|
|
|
|
this.$modal
|
|
|
|
|
|
|
|
.confirm("确认要删除吗")
|
|
|
|
|
|
|
|
.then(function() {
|
|
|
|
|
|
|
|
deviceData.splice(index, 1);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
@ -181,6 +268,7 @@ export default {
|
|
|
|
border-radius: 0;
|
|
|
|
border-radius: 0;
|
|
|
|
background: none;
|
|
|
|
background: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 设备正常时的遮罩层 */
|
|
|
|
.shadows {
|
|
|
|
.shadows {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
top: 0px;
|
|
|
@ -188,8 +276,19 @@ export default {
|
|
|
|
width: 79px;
|
|
|
|
width: 79px;
|
|
|
|
height: 90px;
|
|
|
|
height: 90px;
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
/* background:grey;
|
|
|
|
/* background:red;
|
|
|
|
opacity: 0.4; */
|
|
|
|
opacity: 0.4; */
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 设备异常时的遮罩层 */
|
|
|
|
|
|
|
|
.active {
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
top: 0px;
|
|
|
|
|
|
|
|
left: 0px;
|
|
|
|
|
|
|
|
width: 79px;
|
|
|
|
|
|
|
|
height: 90px;
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
background: red;
|
|
|
|
|
|
|
|
opacity: 0.4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.deviceStatus {
|
|
|
|
.deviceStatus {
|
|
|
|
color: white;
|
|
|
|
color: white;
|
|
|
@ -215,6 +314,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.deleteIcon {
|
|
|
|
.deleteIcon {
|
|
|
|
width: 8px;
|
|
|
|
width: 8px;
|
|
|
|
|
|
|
|
height: 5px;
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
top: 2px;
|
|
|
|
top: 2px;
|
|
|
|
right: 5px;
|
|
|
|
right: 5px;
|
|
|
|