diff --git a/src/api/model/am.js b/src/api/model/am.js index a7bb9273..87dac647 100644 --- a/src/api/model/am.js +++ b/src/api/model/am.js @@ -99,9 +99,10 @@ export default { video: { list: { name: "获取视频设备列表", - req: async function(){ + req: async function(data){ return await http.post( `${config.API_URL}/third/tdevice/vchannel/`, + data ); } }, diff --git a/src/api/model/third.js b/src/api/model/third.js index ee099893..50fa7b08 100644 --- a/src/api/model/third.js +++ b/src/api/model/third.js @@ -4,7 +4,7 @@ import http from "@/utils/request" export default { tdevice: { list: { - name: "三方喇叭接口", + name: "三方设备接口", req: async function(data){ return await http.get( `${config.API_URL}/third/tdevice/`, @@ -30,6 +30,33 @@ export default { ); } }, + speakerSync: { + name: "同步喇叭", + req: async function(data){ + return await http.post( + `${config.API_URL}/third/tdevice/speaker_sync/`, + data + ); + } + }, + dchannelSync: { + name: "同步闸机", + req: async function(data){ + return await http.post( + `${config.API_URL}/third/tdevice/dchannel_sync/`, + data + ); + } + }, + vchannelSync: { + name: "同步监控", + req: async function(data){ + return await http.post( + `${config.API_URL}/third/tdevice/vchannel_sync/`, + data + ); + } + }, }, blt:{ list:{ diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index 3a7fedd0..4522295e 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -83,7 +83,7 @@ > {} }, @@ -231,6 +235,7 @@ export default { }; }, mounted() { + console.log(this.parseData); //判断是否开启自定义列 if (this.column) { this.getCustomColumn(); @@ -266,13 +271,13 @@ export default { async getData() { this.loading = true; var reqData = { - [config.request.page]: this.currentPage, - [config.request.pageSize]: this.scPageSize, + [this.pageStr]: this.currentPage, + [this.pageSizeStr]: this.scPageSize, // [config.request.prop]: this.prop, - [config.request.order]: this.order, + [this.orderStr]: this.order, }; if (this.hidePagination) { - reqData[config.request.page] = 0; + reqData[this.pageStr] = 0; // delete reqData[config.request.page] // delete reqData[config.request.pageSize] } @@ -283,12 +288,15 @@ export default { if (res.length == 0) { this.emptyText = "暂无数据"; } - if(this.$route.path==='/sys/dept'||this.$route.path==='/sys/perm'){ - this.tableData = this.redata(res); - console.log(this.tableData) - }else{ - this.tableData = res || []; - } + if ( + this.$route.path === "/sys/dept" || + this.$route.path === "/sys/perm" + ) { + this.tableData = this.redata(res); + console.log(this.tableData); + } else { + this.tableData = res || []; + } this.loading = false; this.$refs.scTable.setScrollTop(0); this.$emit("dataChange", res, this.tableData); @@ -299,22 +307,25 @@ export default { return false; } try { - var response = config.parseData(res); + var response = this.parseData(res); if (response.total === 0) { this.emptyText = "暂无数据"; } let dataList = null; if (this.hidePagination) { - dataList = response.data || []; + dataList = response.data || []; } else { - dataList = response.rows?response.rows:response.data.rows?response.data.rows:response.data.pageData?response.data.pageData:[]; + dataList = response.rows + } + if ( + this.$route.path === "/sys/dept" || + this.$route.path === "/ops/menu" + ) { + this.tableData = this.redata(dataList); + console.log(this.tableData); + } else { + this.tableData = dataList || []; } - if(this.$route.path==='/sys/dept'||this.$route.path==='/ops/menu'){ - this.tableData = this.redata(dataList); - console.log(this.tableData) - }else{ - this.tableData = dataList || []; - } this.total = response.total || 0; this.summary = response.summary || {}; this.loading = false; @@ -326,28 +337,28 @@ export default { return false; } }, - redata(postList){ - let posts = []; - postList.forEach(item => { - let obj = new Object(); - obj = {...item}; - obj.parentId = item.parent; - posts.push(obj) - }); - let obj = posts.reduce((res, v) => (res[v.id] = v , res), {});//Object - let arr = []; - for (let item of posts) { - if (item.parentId == null) { - arr.push(item); - continue - } - let parent = obj[item.parentId]; - parent.children = parent.children ? parent.children : []; - parent.children.push(item); - } - console.log(arr); - return arr; - }, + redata(postList) { + let posts = []; + postList.forEach((item) => { + let obj = new Object(); + obj = { ...item }; + obj.parentId = item.parent; + posts.push(obj); + }); + let obj = posts.reduce((res, v) => ((res[v.id] = v), res), {}); //Object + let arr = []; + for (let item of posts) { + if (item.parentId == null) { + arr.push(item); + continue; + } + let parent = obj[item.parentId]; + parent.children = parent.children ? parent.children : []; + parent.children.push(item); + } + console.log(arr); + return arr; + }, //分页点击 paginationChange() { this.getData(); @@ -362,17 +373,17 @@ export default { this.$refs.scTable.clearSelection(); this.getData(); }, - //更新数据 合并上一次params - upData(params, page = 1) { + //查询数据 追加query + upData(query, page = 1) { this.currentPage = page; this.$refs.scTable.clearSelection(); - Object.assign(this.tableParams, params || {}); + Object.assign(this.tableParams, query); this.getData(); }, - //重载数据 替换params 保留sort - queryData(params, page = 1) { + //查询数据 追加query 去除列filter + queryData(query, page = 1) { this.currentPage = page; - this.tableParams = params || {}; + Object.assign(this.tableParams, query); this.$refs.scTable.clearSelection(); this.$refs.scTable.clearFilter(); this.getData(); @@ -380,12 +391,12 @@ export default { //重载数据 替换params reload(params, page = 1) { this.currentPage = page; - this.tableParams = params || {}; + this.tableParams = params || this.params; this.$refs.scTable.clearSelection(); this.$refs.scTable.clearSort(); this.$refs.scTable.clearFilter(); this.getData(); - this.$emit('resetQuery') + this.$emit("resetQuery"); }, //自定义变化事件 columnSettingChange(userColumn) { diff --git a/src/layout/components/userselect.vue b/src/layout/components/userselect.vue index e24ee7bd..9095a62d 100644 --- a/src/layout/components/userselect.vue +++ b/src/layout/components/userselect.vue @@ -1,13 +1,12 @@ diff --git a/src/views/am/blt.vue b/src/views/am/blt.vue index aa956251..32b75968 100644 --- a/src/views/am/blt.vue +++ b/src/views/am/blt.vue @@ -1,148 +1,202 @@ diff --git a/src/views/am/em1.vue b/src/views/am/em1.vue index e8604f88..d735bb40 100644 --- a/src/views/am/em1.vue +++ b/src/views/am/em1.vue @@ -1,104 +1,172 @@ diff --git a/src/views/am/monitor.vue b/src/views/am/monitor.vue index ef9fbc54..a0461164 100644 --- a/src/views/am/monitor.vue +++ b/src/views/am/monitor.vue @@ -1,183 +1,261 @@