diff --git a/public/code/list/index.vue b/public/code/list/index.vue index 6576c71c..2a8d2d5c 100644 --- a/public/code/list/index.vue +++ b/public/code/list/index.vue @@ -30,11 +30,11 @@ <% })%> 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/ops.js b/src/api/model/ops.js index 2d0f2216..0e076a4d 100644 --- a/src/api/model/ops.js +++ b/src/api/model/ops.js @@ -10,5 +10,20 @@ export default { return await http.get(this.url, data); } } - } + }, + file_logs: { + list: { + url: `${config.API_URL}/monitor/log/`, + name: "文件日志", + req: async function(data){ + return await http.get(this.url, data); + } + }, + detail: { + name: "文件日志", + req: async function(name){ + return await http.get(`${config.API_URL}/monitor/log/${name}/`); + } + } + }, } diff --git a/src/api/model/system.js b/src/api/model/system.js index 17374145..c1b3b76d 100644 --- a/src/api/model/system.js +++ b/src/api/model/system.js @@ -332,7 +332,7 @@ export default { }, runOnce: { name: "执行一次", - req: async function(data,id){ + req: async function(data, id){ return await http.post(`${config.API_URL}/system/ptask/${id}/run_once/`,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..ab45a7f8 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -175,6 +175,11 @@ export default { stripe: { type: Boolean, default: false }, pageSize: { type: Number, default: config.pageSize }, pageSizes: { type: Array, default: config.pageSizes }, + pageStr: { type: String, default: config.request.page }, + pageSizeStr: { type: String, default: config.request.pageSize }, + orderStr: { type: String, default: config.request.order }, + isTree: { type: Boolean, default: false }, + parseData: { type: Function, default: config.parseData }, rowKey: { type: String, default: "" }, summaryMethod: { type: Function, default: null }, column: { type: Object, default: () => {} }, @@ -194,7 +199,7 @@ export default { this.total = this.tableData.length; }, apiObj() { - this.tableParams = this.params; + // this.tableParams = this.params; this.refresh(); }, }, @@ -219,7 +224,7 @@ export default { order: null, loading: false, tableHeight: "100%", - tableParams: this.params, + tableParams: Object.assign({}, this.params), userColumn: [], customColumnShow: false, summary: {}, @@ -241,7 +246,11 @@ export default { if (this.apiObj) { this.getData(); } else if (this.data) { - this.tableData = this.data; + if (this.isTree) { + this.tableData = this.redata(this.data); + } else { + this.tableData = this.data; + } this.total = this.tableData.length; } }, @@ -266,55 +275,34 @@ 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] } Object.assign(reqData, this.tableParams); try { var res = await this.apiObj.req(reqData); - if (this.hidePagination) { - 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 || []; - } - this.loading = false; - this.$refs.scTable.setScrollTop(0); - this.$emit("dataChange", res, this.tableData); - } - } catch (error) { - this.loading = false; - this.emptyText = error.response.data.err_msg || error.statusText; - 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.isTree) { + this.tableData = this.redata(dataList); + } 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; @@ -322,32 +310,36 @@ export default { this.$emit("dataChange", res, this.tableData); } catch (error) { this.loading = false; - this.emptyText = "数据格式错误"; + if(error.response.data){ + this.emptyText = error.response.data.err_msg; + }else{ + this.emptyText = error.statusText || "数据格式错误"; + } 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,30 +354,30 @@ 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(); }, - //重载数据 替换params - reload(params, page = 1) { - this.currentPage = page; - this.tableParams = params || {}; + //重载数据 tableParams变为固定的params + reload() { + this.currentPage = 1; + this.tableParams = Object.assign({}, 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/config/route.js b/src/config/route.js index 3fb25c3a..f83a9376 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -34,6 +34,7 @@ const routes = [ "title": "首页", "icon": "el-icon-home-filled", "type": "menu", + "perms": ["home"] }, "children": [ { @@ -77,6 +78,7 @@ const routes = [ "title": "事件", "icon": "el-icon-goods-filled", "type": "menu", + "perms": ["ecm"] }, "children": [ { @@ -150,7 +152,8 @@ const routes = [ "meta": { "title": "工单", "icon": "el-icon-circle-check-filled", - "type": "menu" + "type": "menu", + "perms": ["wf"] }, "children": [ { @@ -248,7 +251,8 @@ const routes = [ "meta": { "title": "作业", "icon": "el-icon-list", - "type": "menu" + "type": "menu", + "perms": ["opm"] }, "children": [ { @@ -379,7 +383,8 @@ const routes = [ "meta": { "title": "相关方", "icon": "el-icon-avatar", - "type": "menu" + "type": "menu", + "perms": ["rpm"] }, "children": [ { @@ -451,7 +456,8 @@ const routes = [ "meta": { "title": "访客", "icon": "el-icon-user-filled", - "type": "menu" + "type": "menu", + "perms": ["vm"] }, "children": [ { @@ -503,7 +509,8 @@ const routes = [ "meta": { "title": "区域", "icon": "el-icon-location-filled", - "type": "menu" + "type": "menu", + "perms": ["am"] }, "children": [ { @@ -563,7 +570,8 @@ const routes = [ "meta": { "title": "人事", "icon": "el-icon-platform", - "type": "menu" + "type": "menu", + "perms": ["hrm"] }, "children": [ @@ -608,7 +616,8 @@ const routes = [ "meta": { "title": "系统", "icon": "el-icon-tools", - "type": "menu" + "type": "menu", + "perms": ["sys"] }, "children": [ { @@ -616,7 +625,7 @@ const routes = [ "name": "user", "meta": { "title": "账户管理", - "icon": "el-icon-user-filled", + "icon": "el-icon-user", "type": "menu", "perms": ["user"] }, @@ -638,7 +647,7 @@ const routes = [ "name": "post", "meta": { "title": "岗位管理", - "icon": "sc-icon-organization", + "icon": "el-icon-postcard", "type": "menu", "perms": ["post"] }, @@ -704,7 +713,7 @@ const routes = [ "path": "/ops/log", "meta": { "title": "请求日志", - "icon": "el-icon-fold", + "icon": "el-icon-document", "perms": ["log"] }, "component": "ops/log_request" @@ -714,20 +723,20 @@ const routes = [ "path": "/ops/thirdLogs", "meta": { "title": "第三方日志", - "icon": "el-icon-fold", + "icon": "el-icon-document", "perms": ["third_log"] }, "component": "ops/thirdLogs" }, { - "name": "files", - "path": "/ops/files", + "name": "fileLogs", + "path": "/ops/fileLogs", "meta": { "title": "文件日志", - "icon": "el-icon-fold", + "icon": "el-icon-document", "perms": ["file_log"] }, - "component": "ops/files" + "component": "ops/fileLogs" }, ] }, 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 @@ + + diff --git a/src/views/ops/files.vue b/src/views/ops/files.vue deleted file mode 100644 index 8d4487ff..00000000 --- a/src/views/ops/files.vue +++ /dev/null @@ -1,71 +0,0 @@ - - - diff --git a/src/views/ops/log_request.vue b/src/views/ops/log_request.vue index 5f89bc5a..cc9998d6 100644 --- a/src/views/ops/log_request.vue +++ b/src/views/ops/log_request.vue @@ -1,74 +1,130 @@ diff --git a/src/views/ops/menu.vue b/src/views/ops/menu.vue index 39703a06..6e1ed341 100644 --- a/src/views/ops/menu.vue +++ b/src/views/ops/menu.vue @@ -1,285 +1,328 @@ diff --git a/src/views/ops/thirdLogs.vue b/src/views/ops/thirdLogs.vue index 9c1edf84..3b207ab2 100644 --- a/src/views/ops/thirdLogs.vue +++ b/src/views/ops/thirdLogs.vue @@ -1,72 +1,148 @@ diff --git a/src/views/setting/task/logs.vue b/src/views/setting/task/logs.vue index 26979832..e2c1494c 100644 --- a/src/views/setting/task/logs.vue +++ b/src/views/setting/task/logs.vue @@ -20,7 +20,7 @@ diff --git a/src/views/sys/dept.vue b/src/views/sys/dept.vue index a48cd8ce..2751626b 100644 --- a/src/views/sys/dept.vue +++ b/src/views/sys/dept.vue @@ -13,19 +13,19 @@ - - + + @@ -82,9 +82,7 @@ search: { keyword: null }, - params:{ - page:0 - }, + params:{}, isSaving: false, limitedVisible : false, type: "add", diff --git a/src/views/sys/dict.vue b/src/views/sys/dict.vue index 8e274972..70f878fa 100644 --- a/src/views/sys/dict.vue +++ b/src/views/sys/dict.vue @@ -49,11 +49,11 @@ diff --git a/src/views/sys/post.vue b/src/views/sys/post.vue index 628ecc40..d32c9869 100644 --- a/src/views/sys/post.vue +++ b/src/views/sys/post.vue @@ -11,7 +11,7 @@ - + @@ -30,26 +30,23 @@
-
岗位关系
+
岗位权限
- + - - - - + - + - - + +