wuqun 2 years ago
parent
commit
3d24ba6685
  1. 3
      api/app/lib/controllers/patrolManage/patrolRecord.js
  2. 8
      web/client/src/sections/projectRegime/components/projectAddModel.js

3
api/app/lib/controllers/patrolManage/patrolRecord.js

@ -119,6 +119,7 @@ async function findPatrolRecord (ctx, next) {
} }
} }
let userInfo = ctx.fs.api.userInfo; let userInfo = ctx.fs.api.userInfo;
rslt = rslt.filter(f => f)
if (userInfo.username != 'SuperAdmin') { if (userInfo.username != 'SuperAdmin') {
if (userInfo.structure) { if (userInfo.structure) {
rslt = rslt.filter(s => userInfo.structure.find(x => x == s.points.project.id)) rslt = rslt.filter(s => userInfo.structure.find(x => x == s.points.project.id))
@ -204,7 +205,7 @@ async function addPatrolRecord (ctx, next) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400; ctx.status = 400;
ctx.body = { ctx.body = {
"message": '新增巡检计划失败' "message": '新增巡检记录失败'
} }
} }
} }

8
web/client/src/sections/projectRegime/components/projectAddModel.js

@ -38,15 +38,15 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, f
if (e) { if (e) {
placeSearch.setCity(e.poi.adcode); placeSearch.setCity(e.poi.adcode);
placeSearch.search(e.poi.name, function (status, result) { placeSearch.search(e.poi.name, function (status, result) {
form.setFieldValue('longitude', result.poiList.pois[0].location.lat) form.setFieldValue('longitude', result.poiList.pois[0].location.lng)
form.setFieldValue('latitude', result.poiList.pois[0].location.lng) form.setFieldValue('latitude', result.poiList.pois[0].location.lat)
}) //关键字查询查询 }) //关键字查询查询
} }
} }
auto.on("select", select);//注册监听,当选中某条记录时会触发 auto.on("select", select);//注册监听,当选中某条记录时会触发
map.on('click', function (e) { //点击地图获取经纬度 map.on('click', function (e) { //点击地图获取经纬度
form.setFieldValue('longitude', e.lnglat.lat) form.setFieldValue('longitude', e.lnglat.lng)
form.setFieldValue('latitude', e.lnglat.lng) form.setFieldValue('latitude', e.lnglat.lat)
}); });
}); });

Loading…
Cancel
Save