Commit 1a4a833d authored by caicaicai's avatar caicaicai

修改

parent ec92cf7f
......@@ -3,7 +3,7 @@ ENV = 'development'
# 接口地址
#VUE_APP_BASE_API = 'http://localhost:8000'
VUE_APP_BASE_API = 'http://192.168.0.110:8001'
VUE_APP_WS_API = 'ws://localhost:8000'
VUE_APP_WS_API = 'ws://192.168.0.111:8001/webSocket'
VUE_APP_LOCAL_API = 'http://192.168.0.110:8001'
VUE_APP_LOCAL_API2 = 'http://192.168.0.110:8001'
......
......@@ -4,7 +4,7 @@ ENV = 'production'
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
VUE_APP_BASE_API = 'https://el-admin.xin'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://el-admin.xin'
VUE_APP_WS_API = 'ws://192.168.0.111:8001/webSocket'
VUE_APP_LOCAL_API = 'http://www.wheccloud.com:8002
VUE_APP_LOCAL_API2 = 'http://www.wheccloud.com:8002'
\ No newline at end of file
......@@ -1938,6 +1938,16 @@ var HttpReq = function(){
params:param,
})
},
//车辆调度——只获取采区接口
onlyGetMiningAreaQuery: function(param){
return request({
url: '/api/AreaNew/class',
method: 'get',
params:param,
})
},
......
<template>
<div style="wight:100%;height:100vh;position: absolute;">
<div style="wight:100%;height:100%;">
<div :id="`mars3d-container${mapKey}`"
:class="['mars3d-container', customClass, { 'mars3d-container-compare-rh' : compare }]"></div>
......@@ -42,6 +42,7 @@ export default {
data(){
return{
historyTrajectoryData:[],
persons:[
["122.128833", "37.526448", "500"],
["122.128638", "37.522818", "500"],
......@@ -89,6 +90,7 @@ export default {
["122.127833", "37.525448", "500"],
],
deviceId:'DESKTOP-L56LKGM',
zuobianData:[],
toJavaCoordinates:[],
weilanName:[],
......@@ -136,8 +138,9 @@ export default {
//后台获取数据
getCoordinate() {
let that = this;
//获取电子围栏
HttpReq.truckDispatching.screenMapSetUpQuery({size:9999}).then((res) => {
if(true){
if(true){;
//console.log(res);
let data1 = [];
for(let key in res){
......@@ -154,25 +157,58 @@ export default {
}
that.zuobianData = data1
//console.log("zuobianData",that.zuobianData);
//console.log("weilanName",that.weilanName);
//console.log("weilanName",that.weilanName);
this.$nextTick(()=>{
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
this.initMars3d(data.map3d)// 构建地图
})
}
})
}
})
this.$nextTick(()=>{
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
this.initMars3d(data.map3d)// 构建地图
//获取历史轨迹
HttpReq.truckDispatching.getAllHistroyCarTrajectoryQuery({id:that.deviceId}).then((res) => {
//console.log('获取历史轨迹',res);
if(res.code == 200){
let obj1 = {};
let array1 = [];
res.data.line.forEach((item,index)=>{
let array2 = [];
array2.push(item.location.x);
array2.push(item.location.y);
array2.push('500');
array1.push(array2);
})
obj1.name = res.data.devId;
obj1.arrays = array1;
let hisCenterData = [...that.historyTrajectoryData];
hisCenterData.push(obj1);
that.historyTrajectoryData = [...hisCenterData];
this.$nextTick(()=>{
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
this.initMars3d(data.map3d)// 构建地图
})
}
})
}
})
})
},
//上传围栏数据
uploaded(){
......@@ -248,20 +284,36 @@ export default {
initLayerManager(graphicLayer,that.weilanName[index]);
that.addGraphic_01(graphicLayer,item,that.weilanName[index]);
})
//历史轨迹回放
that.historyTrajectoryData.forEach(function(item,index){
var graphicLayer2 = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer2);
var itemText = `<table style="width: auto;">
<tr>
<th scope="col" colspan="2" style="text-align:center;font-size:15px;">卡车号码:${item.name}</th>
</tr>
<tr>
<td>名称:卡车二</td>
</tr>
</table>`;
initGraphicManager(graphicLayer2,itemText);
that.addGraphic_02(graphicLayer2,item.arrays,item.name);
})
//创建矢量数据图层2
// var graphicLayer1 = new mars3d.layer.GraphicLayer();
// map.addLayer(graphicLayer1);
// var item = `<table style="width: auto;">
// <tr>
// <th scope="col" colspan="2" style="text-align:center;font-size:15px;">卡车号码:鲁K12345</th>
// </tr>
// <tr>
// <td>名称:卡车一</td>
// </tr>
// </table>`;
// initGraphicManager(graphicLayer1,item);
// this.addGraphic_02(graphicLayer1,this.persons);
var graphicLayer1 = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer1);
var itemText = `<table style="width: auto;">
<tr>
<th scope="col" colspan="2" style="text-align:center;font-size:15px;">卡车号码:鲁K12345</th>
</tr>
<tr>
<td>名称:卡车一</td>
</tr>
</table>`;
initGraphicManager(graphicLayer1,itemText);
that.addGraphic_02(graphicLayer1,this.persons,'卡车一');
// 抛出事件
this.$emit('onload', map)
......@@ -318,7 +370,7 @@ export default {
graphicLayer.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer)
},
//车辆轨迹
addGraphic_02(graphicLayer1,positions) {
addGraphic_02(graphicLayer1,positions,truckName) {
var property = new Cesium.SampledPositionProperty();
var tempTime;
......@@ -345,7 +397,7 @@ export default {
},
},
label: {
text: "卡车一",
text: truckName,
font_size: 19,
font_family: "楷体",
color: Cesium.Color.AZURE,
......
......@@ -55,7 +55,7 @@
</el-select>
</el-form-item>
<el-form-item label="调度截止日期" style="display: inline-block;">
<el-date-picker v-model="form.endTime" type="datetime" placeholder="选择日期时间" style="width:220px;"></el-date-picker>
<el-date-picker v-model="form.endTime" type="datetime" placeholder="选择日期时间" style="width:220px;" :disabled='form.duration != "长期" '></el-date-picker>
</el-form-item>
<br>
<el-form-item label="说明" style="display: inline-block;">
......@@ -124,10 +124,8 @@ export default {
}
})
//获取区域信息
HttpReq.truckDispatching.RegionalInformationQuery({size:9999}).then((res) => {
if(res.code == 200){
this.areaInformationData = res.data.content;
}
HttpReq.truckDispatching.onlyGetMiningAreaQuery({size:9999}).then((res) => {
this.areaInformationData = res;
})
//获取车辆类型
HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => {
......@@ -141,23 +139,26 @@ export default {
//发起调度
toDispatch(){
let that = this;
let query1 = {...this.form};
query1.carNo = JSON.stringify(this.checkDataList);
HttpReq.truckDispatching.manualSchedulingAdd(query1).then((res) => {
if(res.code == 200){
this.$notify({
title: '车辆调度发起成功!',
type: 'success',
duration: 2500
});
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
this.checkDataList.forEach((item,index)=>{
let query1 = {...that.form};
query1.carNo = item;
HttpReq.truckDispatching.manualSchedulingAdd(query1).then((res) => {
if(res.code == 200){
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
})
this.$notify({
title: '车辆调度发起成功!',
type: 'success',
duration: 2500
});
this.query = {};
this.form = {};
this.checkDataList = [];
......
......@@ -32,6 +32,7 @@
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName">
<el-table-column prop="odd" label="调度单号" align="center"></el-table-column>
<el-table-column prop="carclass" label="车辆类型" align="center"></el-table-column>
<el-table-column prop="carNo" label="车牌号" align="center"></el-table-column>
<el-table-column prop="createTime" label="调度时间" align="center"></el-table-column>
<el-table-column prop="endTime" label="调度截止日期" align="center"></el-table-column>
<el-table-column prop="finishTime" label="完成调度时间" align="center"></el-table-column>
......@@ -39,7 +40,7 @@
<el-table-column prop="carshow" label="说明" align="center"></el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button>
<!-- <el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button> -->
<el-button size="mini" type="danger" icon="el-icon-delete" @click="toDelete(scope.row)"></el-button>
</template>
</el-table-column>
......@@ -164,17 +165,18 @@ export default {
//删除提示
toDelete(item) {
var id = item.id;
var odd = item.odd;
var itemAll = item;
this.$confirm('确认删除该条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((e) => {
this.reqRemoveProject([id],odd)
this.reqRemoveProject([id],itemAll)
}).catch((e) => {})
},
//删除调度
reqRemoveProject(item){
reqRemoveProject(item,itemAll){
//删除调度
HttpReq.truckDispatching.manualSchedulingDel(item).then((res) => {
if(res.status == 400){
this.$notify({
......@@ -191,6 +193,22 @@ export default {
}
this.loadData();
})
let obj1 = {...itemAll};
delete obj1.id;
obj1.flag = 1;
//新增到订单历史
HttpReq.truckDispatching.personRecordingAdd(obj1).then((res) => {
if(res.code == 200){
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
},
currentTime(time){
var date = new Date(time);
......
......@@ -21,7 +21,7 @@
</div>
<!-- 表格 -->
<div class="panel-bottom page-row">
<h3>人工补录管理</h3>
<h3>订单历史</h3>
<div class="ctin-box">
<div class="content-within">
<div class="content-fix">
......@@ -31,15 +31,17 @@
<div class="content">
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName">
<el-table-column prop="odd" label="调度单号" align="center"></el-table-column>
<el-table-column prop="carname" label="车辆类型" align="center"></el-table-column>
<el-table-column prop="endTime" label="调度时间" align="center"></el-table-column>
<el-table-column prop="carclass" label="车辆类型" align="center"></el-table-column>
<el-table-column prop="carNo" label="车牌号" align="center"></el-table-column>
<el-table-column prop="createTime" label="调度时间" align="center"></el-table-column>
<el-table-column prop="name" label="调度人" align="center"></el-table-column>
<el-table-column prop="startad" label="调度起点" align="center"></el-table-column>
<!-- <el-table-column prop="startad" label="调度起点" align="center"></el-table-column> -->
<el-table-column prop="destination" label="调度目的地" align="center"></el-table-column>
<el-table-column prop="flag" label="调度类型" align="center" :formatter="flagChange"></el-table-column>
<el-table-column prop="carshow" label="说明" align="center"></el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button>
<!-- <el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button> -->
<el-button size="mini" type="danger" icon="el-icon-delete" @click="toDelete(scope.row)"></el-button>
</template>
</el-table-column>
......@@ -99,12 +101,11 @@
<el-option label="清扫车" value="清扫车"></el-option>
</el-select>
</el-form-item>
<br>
<el-form-item label="起点" style="display: inline-block;">
<!-- <el-form-item label="起点" style="display: inline-block;">
<el-select v-model="formAdd.destination" placeholder="请选择起点" style="width:220px;">
<el-option v-for="(obj,index) in areaInformationDataAdd" :label="obj.name" :value="obj.name" :key="index"></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="目的地" style="display: inline-block;">
<el-select v-model="formAdd.startad" placeholder="请选择目的地" style="width:220px;">
<el-option v-for="(obj,index) in areaInformationDataAdd" :label="obj.name" :value="obj.name" :key="index"></el-option>
......@@ -122,7 +123,7 @@
<el-input type="textarea" v-model="formAdd.carshow" style="width:545px;"></el-input>
</el-form-item>
<br>
<el-button type="primary" style="height:40px;width:100px;margin-left:100px;" round @click="toDispatchAdd">调度</el-button>
<el-button type="primary" style="height:40px;width:100px;margin-left:100px;" round @click="toDispatchAdd">确认</el-button>
</el-form>
</el-dialog>
......@@ -306,9 +307,11 @@ export default {
param.size = 9999;
this.$nextTick(()=>{
//获取车辆信息以及状态
HttpReq.truckDispatching.carPeopStatus1Query(param).then((res) => {
this.carInformationDataAdd = res;
//获取车辆信息
HttpReq.truckDispatching.carInformationQuery(param).then((res) => {
if(res.code == 200){
this.carInformationDataAdd = res.data.content;
}
})
//获取车队
HttpReq.truckDispatching.carFleetQuery({size:9999}).then((res) => {
......@@ -317,10 +320,8 @@ export default {
}
})
//获取区域信息
HttpReq.truckDispatching.RegionalInformationQuery({size:9999}).then((res) => {
if(res.code == 200){
this.areaInformationDataAdd = res.data.content;
}
HttpReq.truckDispatching.onlyGetMiningAreaQuery({size:9999}).then((res) => {
this.areaInformationDataAdd = res;
})
//获取车辆类型
HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => {
......@@ -333,30 +334,42 @@ export default {
},
//发起调度
toDispatchAdd(){
let query1 = {...this.formAdd};
query1.carNo = JSON.stringify(this.checkDataListAdd);
HttpReq.truckDispatching.personRecordingAdd(query1).then((res) => {
if(res.code == 200){
this.$notify({
title: '车辆调度发起成功!',
type: 'success',
duration: 2500
});
this.loadDataAdd();
this.loadData();
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
let that = this;
this.checkDataListAdd.forEach((item,index)=>{
let query1 = {...this.formAdd};
query1.carNo = item;
query1.flag = 2;
HttpReq.truckDispatching.personRecordingAdd(query1).then((res) => {
if(res.code == 200){
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
})
this.$notify({
title: '添加成功!',
type: 'success',
duration: 2500
});
this.loadDataAdd();
this.loadData();
this.form.toAddVisible = false;
this.queryAdd = {};
this.formAdd = {};
this.checkDataListAdd = [];
}
},
//调度状态更改
flagChange(row){
return row.flag == 0 ? '智能调度' : row.flag == 1 ? '人工调度' : row.flag == 2 ? '人工补录' : row.flag
},
}
}
</script>
......
......@@ -399,13 +399,13 @@ export default {
//初始化weosocket
initWebSocket(){
//const wsuri = "ws://114.116.108.246:81/websocket/socketServer?userId="+userId;//连接地址,可加参数
const wsuri = "ws://192.168.0.111:8001/webSocket?userId=7";
const wsuri = process.env.VUE_APP_WS_API + "/" + 7;
this.websocket = new WebSocket(wsuri);
this.websocket.onopen = this.websocketonopen;
this.websocket.onerror = this.websocketonerror;
this.websocket.onmessage = this.websocketonmessage;
this.websocket.onclose = this.websocketclose;
},
},
//WebSocket连接成功
websocketonopen() {
console.log("WebSocket连接成功");
......
......@@ -25,7 +25,7 @@ module.exports = {
productionSourceMap: false,
devServer: {
// host: 'localhost', // 也可以直接写IP地址这样方便真机测试
host: '192.168.0.101', // 也可以直接写IP地址这样方便真机测试
host: '192.168.0.107', // 也可以直接写IP地址这样方便真机测试
port: port,
open: true,
overlay: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment