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,8 +619,7 @@ export default{ ...@@ -619,8 +619,7 @@ 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;
...@@ -664,6 +663,15 @@ export default{ ...@@ -664,6 +663,15 @@ export default{
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!