Browse Source

feat:fix bugs

master
zhaobing’ 1 year ago
parent
commit
000901655a
  1. 24
      api/app/lib/controllers/patrolManage/patrolRecord.js
  2. 4
      api/app/lib/routes/patrolManage/patrolRecord.js
  3. 4
      weapp/package/groundDisasterInspection/groundDisasterInspection.js
  4. 6
      weapp/utils/getApiUrl.js

24
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
}

4
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))

4
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})
}

6
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`

Loading…
Cancel
Save