master
石超 2023-09-19 15:10:21 +08:00
parent 191fc0d9d4
commit 2c5b4ea8a4
4 changed files with 915 additions and 933 deletions

View File

@ -55,11 +55,8 @@ export default {
window.websocket.onerror = this.websocketonerror;
window.websocket.onmessage = this.setOnmessageMessage;
window.websocket.onclose = this.websocketclose;
// websocketserver
// window.onbeforeunload = that.onbeforeunload
},
start() {
// console.log("start");
//
this.timeoutObj && clearTimeout(this.timeoutObj);
this.serverTimeoutObj && clearTimeout(this.serverTimeoutObj);
@ -117,20 +114,18 @@ export default {
},
websocketonerror(e) {
console.log("WebSocket连接发生错误" + e + ",重启socket");
this.initWebSocket();
},
websocketclose(e) {
window.websocket.close();
clearTimeout(this.timeoutObj);
clearTimeout(this.serverTimeoutObj);
console.log("WebSocket连接关闭,重启socket");
this.initWebSocket();
this.reconnect();
},
websocketsend(messsage) {
window.websocket.send(messsage);
},
closeWebSocket() {
// websocket
window.websocket.close();
},
},

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
<script>
import { mapState,mapGetters } from "vuex";
import axios from "axios";
import { postMethodCommon,getMethodCommon } from '@/api/common.js';
import { getMethodCommon } from '@/api/common.js';
let BASE_URL = process.env.VUE_APP_BASE_API;
import AppConfig from '../../../../public/config/app.json'
import { parse } from '../lib/handleGeojson.js';

View File

@ -49,9 +49,7 @@
<script>
let BASE_URL = process.env.VUE_APP_BASE_API
import AppConfigInfo from "../../../../public/config/app.json"
import axios from 'axios'
import { parse } from '../lib/handleGeojson';
export default {
name: 'taskDelivery',
props: ['globalmap','lng','lat'],
@ -197,56 +195,36 @@
},
onSubmit() {
let url = "https://restapi.amap.com/v3/geocode/regeo?key=4f992c089f9496201f6e4ea39ff3ab60&location=" + this.lng + "," + this.lat + "&extensions=base"
axios({
method: 'get',
url: url,
}).then(res => {
let address = res.data.regeocode.formatted_address
this.submitForm(address);
}).catch(err =>{
console.log('ee',err)
})
var querys = {
content: this.content,
lng: this.lng,
lat: this.lat,
}
if (this.lng == '') {
this.$message.warning("请选择位置");
return;
}
var url = process.env.VUE_APP_BASE_API + '/FireManagement/FireClueTask'
var _this = this
axios({
method: "post",
url: url,
data: querys,
headers: {
'X-Token': localStorage.getItem("X-Token")
}
}).then(res => {
if (res.data.code == 200) {
this.$message.success(res.data.msg);
_this.close()
} else {
this.$message.error(res.data.msg);
}
})
},
submitForm(address){
let recipientUsers = [];
this.multipleSelection.forEach((item,index)=>{
recipientUsers.push(item.id)
})
var querys = {
content: this.content,
address:address,
lng: this.lng,
lat: this.lat,
recipientUsers:recipientUsers,
}
if(this.lng == ''){
this.$message.warning("请选择位置");
return;
}
var url = process.env.VUE_APP_BASE_API + '/FireManagement/FireClueTask'
var _this = this
axios({
method: "post",
url: url,
data: querys,
headers: {
'X-Token': localStorage.getItem("X-Token")
}
}).then(res => {
if (res.data.code == 200) {
this.$message.success(res.data.msg);
_this.close()
}else{
this.$message.success(res.data.msg);
}
})
}
}
}
</script>