Commit ba9c4ac5 by 冒粤蓉

fix

1 parent fbdbcabd
...@@ -17,6 +17,10 @@ export default { ...@@ -17,6 +17,10 @@ export default {
getFenceDetailById(params = {}) { getFenceDetailById(params = {}) {
return request(params, '/trialdrive/fence/info', 'get') return request(params, '/trialdrive/fence/info', 'get')
}, },
// 查看原围栏
getUpdatedFenceDetail(params = {}) {
return request(params, '/trialdrive/fence/change/info', 'get')
},
getVehicleSnList(params = {}) { getVehicleSnList(params = {}) {
return request(params, '/trialdrive/vehicle/linksns/search', 'get') return request(params, '/trialdrive/vehicle/linksns/search', 'get')
}, },
......
...@@ -46,7 +46,8 @@ function render({ data = {} , container } = {}) { ...@@ -46,7 +46,8 @@ function render({ data = {} , container } = {}) {
data(){ data(){
return { return {
parentRouter: data.router, parentRouter: data.router,
parentVuex: data.store parentVuex: data.store,
parentCommon: data.common
} }
}, },
render: h => h(App), render: h => h(App),
......
...@@ -573,24 +573,24 @@ export default{ ...@@ -573,24 +573,24 @@ export default{
listener() { listener() {
const state = history.state; const state = history.state;
if(!state) { if(!state) {
this.init(); this.init(null);
return; return;
} }
const { fenceId, readonlyStatus } = state; const { fenceId, readonlyStatus, btnRemark } = state;
if(readonlyStatus) { if(readonlyStatus) {
this.readonlyStatus = readonlyStatus; this.readonlyStatus = readonlyStatus;
this.fenceId = fenceId; this.fenceId = fenceId;
} }
this.init(); this.init(btnRemark);
}, },
init(){ init(btnRemark){
const { id, btnText } = this.$route.query; const { id, btnText } = this.$route.query;
if(id) { if(id) {
this.fenceId = id; this.fenceId = id;
this.btnText = btnText; this.btnText = btnText;
} }
if(typeof this.fenceId != 'undefined'){ if(typeof this.fenceId != 'undefined'){
this.getFenceDetail(this.fenceId); btnRemark === 'viewUpdated' ? this.getUpdatedFenceDetail(this.fenceId) :this.getFenceDetail(this.fenceId);;
}else{ }else{
// 围栏编号无意义 屏蔽 // 围栏编号无意义 屏蔽
// MONITOR_SERVICE.getNewFenceId().then((res)=>{ // MONITOR_SERVICE.getNewFenceId().then((res)=>{
...@@ -619,51 +619,59 @@ export default{ ...@@ -619,51 +619,59 @@ export default{
} }
}) })
}, },
getFenceDetail(id){ getDetailData(res) {
MONITOR_SERVICE.getFenceDetailById({fenceId: id}).then((res)=>{ if(res.code == 200){
if(res.code == 200){ const form = this.form;
const form = this.form; const data = res.data;
const data = res.data; for(let key in data){
for(let key in data){ form[key] = data[key]
form[key] = data[key] }
this.form.dateRange = [form.startTime, form.endTime];
this.areaCode = form.areaCode
this.restainFenceName = form.fenceName;
this.form.fenceName = form.fenceName;
this.form.msgtel = data.telNumbers;
this.form.specialShopId = data.shopId;
this.form.specialShopName = data.shopName;
this.getFenceSnsList(id, '', data.snList)
if(form.shapeType === 1){
this.mapData = {
fenceType: 'circle',
lng: form.lng,
lat: form.lat,
radius: form.radius,
}
}else if(form.shapeType === 4){
this.mapData = {
fenceType: 'area',
areaCode: this.form.areaCode
}
}else if(form.shapeType === 3){
if(data.lnglat){
this.polygonPath = data.lnglat.split('|').map((item)=>{
return [item.split(',')[0], item.split(',')[1]]
})
} }
this.form.dateRange = [form.startTime, form.endTime];
this.areaCode = form.areaCode
this.restainFenceName = form.fenceName;
this.form.fenceName = form.fenceName;
this.form.msgtel = data.telNumbers;
this.form.specialShopId = data.shopId;
this.form.specialShopName = data.shopName;
this.getFenceSnsList(id, '', data.snList)
if(form.shapeType === 1){
this.mapData = {
fenceType: 'circle',
lng: form.lng,
lat: form.lat,
radius: form.radius,
}
}else if(form.shapeType === 4){
this.mapData = {
fenceType: 'area',
areaCode: this.form.areaCode
}
}else if(form.shapeType === 3){
if(data.lnglat){
this.polygonPath = data.lnglat.split('|').map((item)=>{
return [item.split(',')[0], item.split(',')[1]]
})
}
console.log(this.polygonPath) console.log(this.polygonPath)
this.mapData = { this.mapData = {
fenceType: 'polygon', fenceType: 'polygon',
polygonPath: this.polygonPath polygonPath: this.polygonPath
}
} }
this.$refs.fenceMap.initFence(this.mapData);
} }
this.$refs.fenceMap.initFence(this.mapData);
}
},
getFenceDetail(id){
MONITOR_SERVICE.getFenceDetailById({fenceId: id}).then((res)=>{
this.getDetailData(res, id);
});
},
getUpdatedFenceDetail(id){
MONITOR_SERVICE.getUpdatedFenceDetail({fenceId: id}).then((res)=>{
this.getDetailData(res, id);
}); });
}, },
getFenceSnsList(id, cur, resData){ getFenceSnsList(id, cur, resData){
......
...@@ -276,6 +276,9 @@ export default{ ...@@ -276,6 +276,9 @@ export default{
this.total = total; this.total = total;
this.loading = false; this.loading = false;
this.queryLoading = false; this.queryLoading = false;
this.$nextTick(()=> {
this.$root.parentCommon.setAuthBtn();
})
}); });
}, },
getParams(){ getParams(){
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!