Commit ba9c4ac5 by 冒粤蓉

fix

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