Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
|
5149884737 | 4 months ago |
|
5c27bb470c | 4 months ago |
|
d71e90323f | 4 months ago |
|
76ebaea6be | 4 months ago |
|
27a6b21ab3 | 4 months ago |
|
6d8b06cc33 | 4 months ago |
|
f0f822fc1f | 4 months ago |
|
2f969b9e3a | 4 months ago |
|
bdc8dae729 | 4 months ago |
|
28989fe11f | 4 months ago |
|
413841f7db | 4 months ago |
|
60dee5a31a | 4 months ago |
12 changed files with 228 additions and 173 deletions
@ -1,16 +1,16 @@ |
|||
# 页面标题 |
|||
VUE_APP_TITLE = 智能化衣柜 |
|||
VUE_APP_TITLE = 智能水温控制系统 |
|||
|
|||
# 生产环境配置 |
|||
NODE_ENV = 'production' |
|||
|
|||
|
|||
# 大唐 |
|||
VUE_APP_BASE_API = '/commen_api/' |
|||
VUE_APP_IMG_URL = '/commen_api/' |
|||
VUE_APP_API_QZURL = '/commen_api/' |
|||
VUE_APP_BASE_API = '/multimodal/' |
|||
VUE_APP_IMG_URL = '/multimodal/' |
|||
VUE_APP_API_QZURL = '/multimodal/' |
|||
|
|||
# 访问路径 |
|||
VUE_APP_PUBLIC_PATH = '/commen/' |
|||
VUE_APP_PUBLIC_PATH = '/multimodal_yf/waterTemperature/' |
|||
|
|||
|
|||
|
@ -1,115 +1,40 @@ |
|||
import request from "@/utils/request"; |
|||
// ------ 教务处学校管理 ------
|
|||
|
|||
// 学校列表
|
|||
export function schoolList(data) { |
|||
// 获取设备信息
|
|||
export function attributes(data) { |
|||
return request({ |
|||
url: "/school/list", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// 新增/修改学校
|
|||
export function schoolAdd(data) { |
|||
return request({ |
|||
url: "/school/add", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// 新增/修改学校
|
|||
export function schoolDel(data) { |
|||
return request({ |
|||
url: "/school/del", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
|
|||
// ------ 教务处评审管理 ------
|
|||
// 评审列表
|
|||
export function commentList(data) { |
|||
return request({ |
|||
url: "/come/list", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// 评审详情
|
|||
export function reviewDetails(data) { |
|||
return request({ |
|||
url: "/come/detail", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// ------ 专家评审 ------
|
|||
// 学校列表
|
|||
|
|||
export function expertschoolist(data) { |
|||
return request({ |
|||
url: "/expert/school/list", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// 评审详情
|
|||
export function expertReviewDetails(data) { |
|||
return request({ |
|||
url: "/expert/comment/list", |
|||
method: "post", |
|||
data: data, |
|||
url: "/app/device/attributes", |
|||
method: "get", |
|||
params: data, |
|||
}); |
|||
} |
|||
// 评审
|
|||
export function expertReviewAdd(data) { |
|||
// 根据项目key查找项目id
|
|||
export function queryProjectInfoByKey(data) { |
|||
return request({ |
|||
url: "/expert/comment/add", |
|||
method: "post", |
|||
data: data, |
|||
url: "/app/device/queryProjectInfoByKey", |
|||
method: "get", |
|||
params: data, |
|||
}); |
|||
} |
|||
// ------ 分片相关接口 ------
|
|||
|
|||
// 校验文件是否已上传
|
|||
export function register(data) { |
|||
// 根据项目id查找设备列表
|
|||
export function deviceList(data) { |
|||
return request({ |
|||
url: "/mediaUpload/register", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// 校验分片是否已上传
|
|||
export function checkchunk(data) { |
|||
return request({ |
|||
url: "/mediaUpload/checkchunk", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// 循环上传分片
|
|||
export function uploadchunk(data) { |
|||
return request({ |
|||
url: "/mediaUpload/uploadchunk", |
|||
method: "post", |
|||
data: data, |
|||
headers: { |
|||
"Content-Type": "multipart/form-data", |
|||
}, |
|||
url: "/app/device/list", |
|||
method: "get", |
|||
params: data, |
|||
}); |
|||
} |
|||
// 合并分片
|
|||
export function mergechunks(data) { |
|||
// 下发属性
|
|||
export function sendAttribute(data) { |
|||
return request({ |
|||
url: "/mediaUpload/mergechunks", |
|||
url: "/app/device/sendAttribute", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
} |
|||
// 合并后上传文件
|
|||
export function addFile(data) { |
|||
// 下发命令
|
|||
export function sendCommand(data) { |
|||
return request({ |
|||
url: "/netdisk/file/add", |
|||
url: "/app/device/sendCommand", |
|||
method: "post", |
|||
data: data, |
|||
}); |
|||
|
@ -1,86 +1,213 @@ |
|||
<template> |
|||
<div style="padding: 16px"> |
|||
<!-- <img src="./welcome.5e305008.png" style="" /> --> |
|||
<div v-loading="loading" |
|||
style="padding: 16px;min-height: calc(100vh - 84px);display: flex; justify-content: center;align-items: center;"> |
|||
<div class="div-box"> |
|||
<div class="div-box-title"> 智能水温控制系统 </div> |
|||
<div class="div-ul"> |
|||
<div class="div-li"> |
|||
<div> |
|||
<span>当前温度:</span>{{ deviceInfo.temperature }}℃ |
|||
</div> |
|||
<div> |
|||
<span>报警器:</span> |
|||
<el-switch disabled v-model="value2" active-color="#13ce66" inactive-color="#ff4949"> |
|||
</el-switch> |
|||
</div> |
|||
</div> |
|||
<!-- ON:开启 OFF:关闭 --> |
|||
<div class="div-li"> |
|||
<div> |
|||
<span>加热器:</span> |
|||
<el-switch disabled v-model="value2" active-color="#13ce66" inactive-color="#ff4949"> |
|||
</el-switch> |
|||
</div> |
|||
<div class="div-tips"> |
|||
<span>温度阈值设定:</span>{{ deviceInfo.threshold }} <i class="el-icon-edit" |
|||
style="color: rgb(64, 158, 255);margin-left: 4px;cursor: pointer;" @click="handleSettings"></i> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
<!-- 添加或修改公告对话框 --> |
|||
<el-dialog title="温度阈值设定" :visible.sync="open" width="780px" append-to-body> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|||
|
|||
<el-form-item label="阈值" prop="threshold"> |
|||
<el-input v-model="form.threshold" placeholder="请输入阈值" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="open = false">取 消</el-button> |
|||
</div> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { queryProjectInfoByKey, deviceList, attributes, sendAttribute, sendCommand } from "@/api/school"; |
|||
export default { |
|||
name: "Index", |
|||
data() { |
|||
return { |
|||
deviceId: "", // 设备id |
|||
deviceInfo: { |
|||
temperature: 0, // 温度 |
|||
threshold: 0, // 阈值 |
|||
}, |
|||
open: false, |
|||
value2: false, |
|||
loading: false, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
threshold: [ |
|||
{ required: true, message: "阈值不能为空", trigger: "blur" } |
|||
], |
|||
}, |
|||
// 版本号 |
|||
version: "3.8.9", |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getqueryProjectInfoByKey() // 根据项目key查找项目id |
|||
}, |
|||
methods: { |
|||
goTarget(href) { |
|||
window.open(href, "_blank"); |
|||
// 温度阈值设定弹窗 |
|||
handleSettings() { |
|||
this.open = true; |
|||
this.form = { |
|||
threshold: this.deviceInfo.threshold, |
|||
}; |
|||
// this.$message.success(''); |
|||
}, |
|||
|
|||
// 根据项目key查找项目id |
|||
getqueryProjectInfoByKey() { |
|||
this.loading = true; |
|||
queryProjectInfoByKey({ |
|||
projectKey: "qKStHKKt" |
|||
}).then(res => { |
|||
this.getDeviceList(res.data.id) // 根据项目id查找设备列表 |
|||
}); |
|||
}, |
|||
// 根据项目id查找设备列表 |
|||
getDeviceList(_id) { |
|||
deviceList({ |
|||
projectId: _id |
|||
}).then(res => { |
|||
const w2Device = res.rows.find(device => device.deviceName === "W2"); |
|||
this.deviceId = w2Device.id; |
|||
this.getAttributes(this.deviceId); // 根据设备id查找设备信息 |
|||
}) |
|||
}, |
|||
|
|||
// 根据设备id查找设备信息 |
|||
getAttributes(_id) { |
|||
attributes({ |
|||
deviceId: _id, |
|||
}).then(res => { |
|||
this.loading = false; |
|||
// 获取温度和阈值信息,并赋值给deviceInfo |
|||
let deviceAttributeRecordList = res.data.deviceAttributeRecordList |
|||
let temperature = deviceAttributeRecordList.find(row => row.id === 447236074165760).attributeValue; |
|||
let threshold = deviceAttributeRecordList.find(row => row.id === 447236078508288).attributeValue; |
|||
// 阈值 threshold 特殊处理 |
|||
if (threshold.indexOf("#") !== -1) { |
|||
threshold = threshold.slice(1); // 去掉# |
|||
} |
|||
this.deviceInfo = { |
|||
temperature: temperature, |
|||
threshold: threshold, |
|||
} |
|||
|
|||
// 根基温度值是否低于阈值,设置报警器、加热器的状态 |
|||
this.value2 = false; |
|||
if (temperature < threshold) { |
|||
this.value2 = true; |
|||
} |
|||
}); |
|||
}, |
|||
/** 下发属性 */ |
|||
submitForm: function () { |
|||
this.$refs["form"].validate(valid => { |
|||
if (valid) { |
|||
sendAttribute({ |
|||
"attributeAndValues": [ |
|||
{ |
|||
"attributeIdentifier": "Wen", |
|||
"attributeValue": this.form.threshold |
|||
} |
|||
], |
|||
"deviceId": this.deviceId // 设备id |
|||
}).then(response => { |
|||
this.getAttributes(this.deviceId); // 根据设备id查找设备信息 |
|||
this.$modal.msgSuccess("操作成功"); |
|||
this.open = false; |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.home { |
|||
blockquote { |
|||
padding: 10px 20px; |
|||
margin: 0 0 20px; |
|||
font-size: 17.5px; |
|||
border-left: 5px solid #eee; |
|||
} |
|||
hr { |
|||
margin-top: 20px; |
|||
margin-bottom: 20px; |
|||
border: 0; |
|||
border-top: 1px solid #eee; |
|||
} |
|||
.col-item { |
|||
.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; |
|||
} |
|||
} |
|||
|
|||
ul { |
|||
padding: 0; |
|||
margin: 0; |
|||
.div-ul { |
|||
.div-li>div:nth-of-type(1) { |
|||
border-right: 1px solid #ccc; |
|||
margin-right: 16px; |
|||
} |
|||
|
|||
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif; |
|||
font-size: 13px; |
|||
color: #676a6c; |
|||
overflow-x: hidden; |
|||
.div-li { |
|||
font-size: 18px; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
margin-bottom: 12px; |
|||
|
|||
ul { |
|||
list-style-type: none; |
|||
div { |
|||
flex: 1; |
|||
align-items: center; |
|||
} |
|||
|
|||
h4 { |
|||
margin-top: 0px; |
|||
span { |
|||
color: #666; |
|||
} |
|||
|
|||
h2 { |
|||
margin-top: 10px; |
|||
font-size: 26px; |
|||
font-weight: 100; |
|||
} |
|||
} |
|||
|
|||
p { |
|||
margin-top: 10px; |
|||
.div-li:last-child { |
|||
margin-bottom: 0; |
|||
} |
|||
|
|||
b { |
|||
font-weight: 700; |
|||
} |
|||
} |
|||
.div-tips { |
|||
font-size: 18px; |
|||
line-height: 22px; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
.update-log { |
|||
ol { |
|||
display: block; |
|||
list-style-type: decimal; |
|||
margin-block-start: 1em; |
|||
margin-block-end: 1em; |
|||
margin-inline-start: 0; |
|||
margin-inline-end: 0; |
|||
padding-inline-start: 40px; |
|||
} |
|||
span { |
|||
color: #666; |
|||
} |
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue