Browse Source

智能门锁列表接口替换

znms
lzp 4 months ago
parent
commit
17d50e3e77
  1. 25
      src/api/school.js
  2. 28
      src/views/index.vue

25
src/api/school.js

@ -1,12 +1,5 @@
import request from "@/utils/request";
// 获取设备信息
export function attributes(data) {
return request({
url: "/app/device/attributes",
method: "get",
params: data,
});
}
// 根据项目key查找项目id
export function queryProjectInfoByKey(data) {
return request({
@ -23,6 +16,22 @@ export function deviceList(data) {
params: data,
});
}
// 设备日志
export function attributesRecord(data) {
return request({
url: "/app/device/attributes/record",
method: "get",
params: data,
});
}
// 获取设备信息
export function attributes(data) {
return request({
url: "/app/device/attributes",
method: "get",
params: data,
});
}
// 下发属性
export function sendAttribute(data) {
return request({

28
src/views/index.vue

@ -9,13 +9,13 @@
@click="handleAdd"
>远程开锁</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getAttributes(deviceId)"></right-toolbar>
</el-row>
<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}}
{{ scope.$index + 1 + (queryParams.pageNum - 1) * queryParams.pageSize }}
</template>
</el-table-column>
<el-table-column
@ -37,18 +37,19 @@
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
@pagination="getAttributes(deviceId)"
/>
</div>
</template>
<script>
import { queryProjectInfoByKey, deviceList, attributes, sendAttribute, sendCommand } from "@/api/school";
import { queryProjectInfoByKey, deviceList, attributes, sendAttribute, sendCommand,attributesRecord } from "@/api/school";
export default {
name: "Notice",
data() {
return {
deviceId: "", // id
//
loading: true,
//
@ -71,9 +72,6 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
},
//
form: {},
@ -123,11 +121,14 @@ export default {
// id
getAttributes(_id) {
attributes({
attributesRecord({
pageNum: this.queryParams.pageNum,
pageSize: this.queryParams.pageSize,
deviceId: _id,
}).then(res => {
this.loading = false;
this.tableList = res.data.deviceAttributeRecordList;
this.tableList = res.rows;
this.total = res.total;
});
},
/** 下发属性 */
@ -147,15 +148,6 @@ export default {
}
});
},
/** 查询公告列表 */
getList() {
this.loading = true;
listNotice(this.queryParams).then(response => {
this.noticeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 新增按钮操作 */
handleAdd() {
this.$message.success('操作成功');

Loading…
Cancel
Save