diff --git a/api/app/lib/controllers/patrolManage/patrolRecord.js b/api/app/lib/controllers/patrolManage/patrolRecord.js index 53c4312..de21bc0 100644 --- a/api/app/lib/controllers/patrolManage/patrolRecord.js +++ b/api/app/lib/controllers/patrolManage/patrolRecord.js @@ -610,6 +610,27 @@ function getPointInfo(opts) { } } +} +//所有点位信息不做权限过滤 +function getPointInfoAll(opts) { + return async function (ctx, next){ + try{ + let rslt=[] + const models = ctx.fs.dc.models; + const {projectId}=ctx.query + let generalInclude = [{model:models.Project,where:{id :projectId}},{model:models.Device}] + rslt=await models.Point.findAll({ + include:generalInclude + }) + ctx.status = 200 + ctx.body = rslt + }catch(error){ + ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); + ctx.status = 400; + ctx.body = { message: '所有点位信息' } + } + } + } //根据结构物查询对应巡检计划的模板 function getTemplate(opts){ @@ -793,5 +814,6 @@ module.exports = { getTemplate, reportQuest, getSubSystemPatrol, - getAllPatrol + getAllPatrol, + getPointInfoAll } \ No newline at end of file diff --git a/api/app/lib/routes/patrolManage/patrolRecord.js b/api/app/lib/routes/patrolManage/patrolRecord.js index c1b54f5..3b4bcf1 100644 --- a/api/app/lib/routes/patrolManage/patrolRecord.js +++ b/api/app/lib/routes/patrolManage/patrolRecord.js @@ -42,6 +42,10 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/patrolRecord/pointInfo'] = { content: '点位信息', visible: true }; router.get('/patrolRecord/pointInfo', patrolRecord.getPointInfo(opts)) + //点位信息 + app.fs.api.logAttr['GET/pointInfo/all'] = { content: '点位信息(所有点位信息)', visible: true }; + router.get('/pointInfo/all', patrolRecord.getPointInfoAll(opts)) + //查询模板 app.fs.api.logAttr['GET/patrolRecord/getTemplate'] = { content: '查询模板', visible: true }; router.get('/patrolRecord/getTemplate', patrolRecord.getTemplate(opts)) diff --git a/weapp/package/groundDisasterInspection/groundDisasterInspection.js b/weapp/package/groundDisasterInspection/groundDisasterInspection.js index 0a1dfe5..284e377 100644 --- a/weapp/package/groundDisasterInspection/groundDisasterInspection.js +++ b/weapp/package/groundDisasterInspection/groundDisasterInspection.js @@ -1,6 +1,6 @@ // package/report/report.js -import { getPointList,getPatrolTemplates,getPatrolTemplate,getTemplates,reportQuest,getPatrolPlan,getStructuresList,getDetail } from "../../utils/getApiUrl"; +import { getPointList,getPointInfoAll,getPatrolTemplates,getPatrolTemplate,getTemplates,reportQuest,getPatrolPlan,getStructuresList,getDetail } from "../../utils/getApiUrl"; import {Request} from "../../common"; const moment = require("../../utils/moment"); @@ -171,7 +171,7 @@ input4Change(e){ const that = this const projectId=that.data.sList.find(item=>item.id==that.data?.sList[Number(event.detail.value)].id)?.id const query={projectId} - Request.get(getPointList(query)).then(res => { + Request.get(getPointInfoAll(query)).then(res => { if(res){ that.setData({data:res}) } diff --git a/weapp/utils/getApiUrl.js b/weapp/utils/getApiUrl.js index 745e142..c60d96d 100644 --- a/weapp/utils/getApiUrl.js +++ b/weapp/utils/getApiUrl.js @@ -61,6 +61,12 @@ exports.getPointList = (query) => { return `/patrolRecord/pointInfo?projectId=${projectId}` } +exports.getPointInfoAll = (query) => { + const {projectId } = query; + return `/pointInfo/all?projectId=${projectId}` +} + + // 获取点位最新一条巡检记录 exports.getdPointCurPatrolRecord = (pointId) => { return `/patrolRecord/${pointId}/cur`