Browse Source

智能门锁

znms
lzp 4 months ago
parent
commit
db2e718684
  1. 150
      src/views/index.vue
  2. 5
      src/views/login.vue

150
src/views/index.vue

@ -12,18 +12,22 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="noticeList" max-height="600">
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table v-loading="loading" :data="tableList" max-height="600">
<el-table-column label="序号" align="center" prop="noticeId" width="100" >
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column
label="时间"
align="center"
prop="noticeTitle"
prop="reportTime"
:show-overflow-tooltip="true"
min-width="100"
/>
<el-table-column label="类型" align="center" prop="noticeType" min-width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
</template>
</el-table-column>
@ -40,55 +44,54 @@
<script>
import { queryProjectInfoByKey, deviceList, attributes, sendAttribute, sendCommand } from "@/api/school";
export default {
name: "Notice",
dicts: ['sys_notice_status', 'sys_notice_type'],
data() {
return {
deviceId: "", // id
deviceInfo: {
temperature: 0, //
threshold: 0, //
},
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableList: [],
//
title: "",
//
open: false,
value2: false,
loading: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
},
//
form: {},
//
rules: {
threshold: [
{ required: true, message: "阈值不能为空", trigger: "blur" }
noticeTitle: [
{ required: true, message: "公告标题不能为空", trigger: "blur" }
],
},
//
version: "3.8.9",
noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
};
},
created() {
this.getqueryProjectInfoByKey() // keyid
this.getqueryProjectInfoByKey();
},
methods: {
// 湿
handleDehumidification() {
sendCommand({
"commandId": "447173913707264", // 湿,
"commandParams": this.deviceInfo.dehumidification, // 0 1 ,
"deviceId": this.deviceId
}).then(res => {
this.getDeviceList(res.data.id) // id
});
},
//
handleLight(){
sendCommand({
"commandId": "447173913707264", // 湿,
"commandParams": this.deviceInfo.dehumidification, // 0 1 ,
"deviceId": this.deviceId
}).then(res => {
this.getDeviceList(res.data.id) // id
});
},
//
handleSettings() {
this.open = true;
@ -112,35 +115,26 @@ export default {
deviceList({
projectId: _id
}).then(res => {
const w2Device = res.rows.find(device => device.deviceName === "W1");
const w2Device = res.rows.find(device => device.deviceName === "D1");
this.deviceId = w2Device.id;
this.getAttributes(this.deviceId); // id
})
},
// id
getAttributes(_id) {
attributes({
deviceId: _id,
}).then(({ data: { deviceAttributeRecordList: records } }) => {
}).then(res => {
this.loading = false;
// id
const findAttr = (id, defaultValue = '-') =>
records.find(row => row.id === id)?.attributeValue || defaultValue;
//
this.deviceInfo = {
temperature: findAttr(447173909669888), //
humidity: findAttr(447173911846400), // 湿
serialNumber: findAttr(447173913707263), //
light: findAttr(447173913707265, '0'), // ()
dehumidification: findAttr(447173913707264, '0'), // 湿()
};
this.tableList = res.data.deviceAttributeRecordList;
});
},
/** 下发属性 */
submitForm: function () {
this.$refs["form"].validate(valid => {
if (valid) {
let param = { "Wen": `#${this.form.threshold}` } //
let param = {"Wen":`#${this.form.threshold}`} //
sendAttribute({
"attributeParams": JSON.stringify(param), // JSON
"deviceId": this.deviceId // id
@ -148,13 +142,11 @@ export default {
this.getAttributes(this.deviceId); // id
this.$modal.msgSuccess("操作成功");
this.open = false;
});
}
});
},
},
methods: {
/** 查询公告列表 */
getList() {
this.loading = true;
@ -171,51 +163,3 @@ export default {
}
};
</script>
<style scoped lang="scss">
.div-box {
transform: scale(1.4);
width: 500px;
box-sizing: border-box;
padding: 16px;
border: 1px solid #ccc;
border-radius: 10px;
.div-box-title {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
text-align: center;
border-bottom: 1px solid #ccc;
padding-bottom: 16px;
}
}
.div-ul {
.div-li>div:nth-of-type(1) {
border-right: 1px solid #ccc;
margin-right: 16px;
}
.div-li {
font-size: 18px;
display: flex;
justify-content: space-between;
margin-bottom: 12px;
div {
flex: 1
}
span {
color: #666;
}
}
}
.div-tips {
span {
color: #666;
}
}
</style>

5
src/views/login.vue

@ -8,11 +8,7 @@
>
<h3 class="title" style="margin-bottom: 0">
</h3>
<<<<<<< HEAD
<h3 class="title">智能门锁</h3>
=======
<h3 class="title">智能水温控制系统</h3>
>>>>>>> znhyg
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
@ -85,7 +81,6 @@
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<div>山西经济管理干部学院教务部</div>
<div>Copyright © 2018-2025 ruoyi.vip All Rights Reserved.</div>
</div>
</div>

Loading…
Cancel
Save