Commit ea0dc6f8 authored by SQL_Mou's avatar SQL_Mou
parents ecb236ae f672485f
......@@ -2,10 +2,10 @@ ENV = 'development'
# 接口地址
#VUE_APP_BASE_API = 'http://localhost:8000'
VUE_APP_BASE_API = 'http://192.168.0.108:9090'
VUE_APP_BASE_API = 'http://192.168.0.108:9092'
VUE_APP_WS_API = 'ws://8.143.203.103:9092/webSocket'
VUE_APP_LOCAL_API = 'http://192.168.0.108:9090'
VUE_APP_LOCAL_API2 = 'http://192.168.0.108:9090'
VUE_APP_LOCAL_API = 'http://192.168.0.108:9092'
VUE_APP_LOCAL_API2 = 'http://192.168.0.108:9092'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......@@ -2289,6 +2289,32 @@ var HttpReq = function(){
params:param,
})
},
//新增用户
apiusersAdd: function(data){
return request({
url: '/api/users',
method: 'POST',
data:data,
}).then((res) => {
return res
})
},
//修改用户
apiusersUpdate: function(data){
return request({
url: '/api/users',
method: 'PUT',
data:data,
})
},
//删除用户
apiusersDel: function(data){
return request({
url: '/api/users',
method: 'Delete',
data:data,
})
},
//获取用于选择用户的用户名(没用过的用户名)
getNoUseSystemUserNameQuery:function(param){
return request({
......@@ -2587,6 +2613,22 @@ var HttpReq = function(){
params:param,
})
},
//所有角色信息
apirolesallQuery: function(param){
return request({
url: '/api/roles/all',
method: 'get',
params:param,
})
},
//获取轨迹分段时间以及坐标
apimineAlarmHistoryTjQuery: function(param){
return request({
url: '/api/mineAlarmHistory/Tj',
method: 'get',
params:param,
})
},
......
......@@ -48,6 +48,8 @@ export default {
carPlaySpeed:1,
stopPointData:[],
leadTime:false,
//获取停车时间段以及坐标点
stopCarCoordinates:[],
}
},
......@@ -137,19 +139,56 @@ export default {
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)// 构建地图
//获取停车时间段以及坐标点
if(that.leadTime){
HttpReq.truckDispatching.apimineAlarmHistoryTjQuery({number:that.carNumber,bTime:bTime,eTime:eTime}).then((resTj) => {
let arr1 = [];
resTj.data.forEach((itemTj1,indexTj1)=>{
let arr2 = {};
let arr2_5 = [];
itemTj1.line.forEach((itemTj2,indexTj2)=>{
let arr3 = [];
arr3.push(itemTj2.x);
arr3.push(itemTj2.y);
arr3.push(1000);
arr2_5.push(arr3);
})
arr2.time1 = itemTj1.time1;
arr2.time2 = itemTj1.time2;
arr2.line = arr2_5;
arr1.push(arr2);
})
that.stopCarCoordinates = arr1;
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)// 构建地图
})
}
})
}
})
})
}else{
that.stopCarCoordinates = [];
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)// 构建地图
})
}
})
}
}
}
})
......@@ -262,6 +301,19 @@ export default {
that.addDemoGraphic1(graphicLayer2,item.lon,item.lat,item.alarmTime,item.time);
})
//展示轨迹
that.stopCarCoordinates.forEach((item,index)=>{
var graphicLayer3 = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer3);
var itemText = `<table style="width: auto;">
<tr>
<th scope="col" colspan="2" style="text-align:center;font-size:15px;">${item.time1}${item.time2}</th>
</tr>
</table>`;
initGraphicManager(graphicLayer3,itemText);
that.addDemoGraphic2(graphicLayer3,item);
})
//webgl渲染失败后,刷新页面
map.on(mars3d.EventType.renderError,function(event){
window.location.reload();
......@@ -275,7 +327,7 @@ export default {
// 抛出事件
this.$emit('onload', map)
},
//车辆轨迹1
//车辆轨迹1:车辆运动
addGraphic_02(graphicLayer2,positions,truckName) {
let that = this;
var property = new Cesium.SampledPositionProperty();
......@@ -299,8 +351,8 @@ export default {
width: 4,
color: "rgb(251,84,48)",
opacity: 1.0,
leadTime: that.leadTime ? 9999 : 0, // 前方的路线不显示
trailTime: that.leadTime ? 9999 : 0,
leadTime: 0, // 前方的路线不显示
trailTime: 0,
//高亮时的样式(默认为鼠标移入,也可以指定type:'click'单击高亮),构造后也可以openHighlight、closeHighlight方法来手动调用
highlight: {
type: mars3d.EventType.click,
......@@ -356,6 +408,31 @@ export default {
})
graphicLayer.addGraphic(graphic)
},
//展示轨迹
addDemoGraphic2(graphicLayer,item) {
const graphic = new mars3d.graphic.PolylineEntity({
positions: item.line,
style: {
width: 6,
materialType: mars3d.MaterialType.PolylineOutline,
color: 'blue',
label: {
text: "",
font_size: 18,
color: "white",
distanceDisplayCondition: true,
distanceDisplayCondition_far: 500000,
distanceDisplayCondition_near: 0,
visibleDepth:false,
},
highlight: {
type: mars3d.EventType.click,
color: "#ff0000",
},
},
})
graphicLayer.addGraphic(graphic)
},
//测距画线
startDrawGraphic(boo) {
let that = this;
......
......@@ -47,6 +47,9 @@
toJavaCoordinates:[],
controlPointId:0,
lineData:[],
weilanzuobianData:[],
weilanName:[],
areaColorData:[],
}
},
......@@ -90,6 +93,7 @@
methods: {
//后台获取数据
getCoordinate(data) {
let that = this;
this.zuobianData = data;
HttpReq.truckDispatching.apiPathmapQuery({size:9999}).then((res) => {
if(res.code == 200){
......@@ -117,17 +121,40 @@
arr1.push(obj1);
});
this.lineData = arr1;
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.screenMapSetUpQuery({size:9999}).then((res) => {
if(true){;
let data1 = [];
for(let key in res){
that.weilanName.push(key);
that.areaColorData.push(res[key][0].color);
let arrays = [];
res[key].forEach(function(item){
var arr = [];
arr[0] = item.lon;
arr[1] = item.lat;
arr[2] = "500";
arrays.push(arr);
})
data1.push(arrays)
}
that.weilanzuobianData = data1
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)// 构建地图
})
}
})
}
})
})
......@@ -164,14 +191,12 @@
})
this.$nextTick(()=>{
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
})
}
})
......@@ -191,14 +216,12 @@
this.$nextTick(()=>{
if(res.code == 200){
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
}
})
})
......@@ -238,14 +261,12 @@
})
this.$nextTick(()=>{
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
})
}
})
......@@ -269,14 +290,12 @@
this.$nextTick(()=>{
if(res.code == 200){
this.$notify({
title: '关键点信息上传成功,即将刷新页面',
title: '关键点信息上传成功!',
type: 'success',
duration: 2000,
dangerouslyUseHTMLString: true,
});
setTimeout(function (){
window.location.reload();
},2000);
this.$parent.resetData();
}
})
})
......@@ -287,7 +306,7 @@
//创建地图
initMars3d(options) {
let that = this;
if (this[`map${this.mapKey}`]) return
//if (this[`map${this.mapKey}`]) return
const mapOptions = {
...options,
......@@ -300,6 +319,14 @@
// 创建三维地球场景
map = new mars3d.Map(`mars3d-container${this.mapKey}`, mapOptions)
this[`map${this.mapKey}`] = map
//围栏回显
that.weilanzuobianData.forEach(function(item,index){
var graphicLayer = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer);
initLayerManager(graphicLayer,that.weilanName[index]);
that.addGraphic_01(graphicLayer,item,that.weilanName[index],that.areaColorData[index]);
})
//关键点显示
that.zuobianData.forEach(function(item,index){
......@@ -342,6 +369,28 @@
})
graphicLayer.addGraphic(graphic)
},
//围栏回显
addGraphic_01(graphicLayer,positions,weilanName,color){
let graphic = new mars3d.graphic.PolygonEntity({
positions: positions,
style: {
color: color,
opacity: 0.5,
outline: true,
outlineWidth: 3,
outlineColor: "#ffffff",
label: {
text: weilanName,
font_size: 18,
color: "#ffffff",
distanceDisplayCondition: true,
distanceDisplayCondition_far: 500000,
distanceDisplayCondition_near: 0,
},
},
});
graphicLayer.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer)
},
//画线
addDemoGraphic2(graphicLayer,item) {
const graphic = new mars3d.graphic.PolylineEntity({
......@@ -369,11 +418,6 @@
this.toJavaCoordinates = [];
let that = this;
var graphicLayer3 = new mars3d.layer.GraphicLayer();
graphicLayer3.on(mars3d.EventType.click, function (event) {
var mpt = mars3d.LatLngPoint.fromCartesian(event.cartesian);
that.toJavaCoordinates.push(mpt.toString().split(','));
//console.log(that.toJavaCoordinates);
});
map.addLayer(graphicLayer3);
initLayerManager(graphicLayer3);
graphicLayer3.startDraw({
......@@ -393,6 +437,10 @@
pixelOffset: new Cesium.Cartesian2(10, -25), //偏移量
},
},
success: function (graphic){
var mpt = mars3d.LatLngPoint.fromCartesian(graphic._position_draw);
that.toJavaCoordinates.push(mpt.toString().split(','));
}
});
},
bindLayerPopup(graphicLayer,item) {
......
......@@ -19,9 +19,9 @@
<div class="ctin-box">
<div class="content-within">
<div class="content-fix">
<div class="toolbar">
<!-- <div class="toolbar">
<el-button size="mini" type="primary" icon="el-icon-plus" @click="toAdd">新增</el-button>
</div>
</div> -->
<div class="content">
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName">
<el-table-column prop="name" label="设备编码" align="center"></el-table-column>
......@@ -47,7 +47,7 @@
<el-dialog append-to-body :close-on-click-modal="true" :before-close="cancelForm" :visible.sync="form.visible" :title="form.title" width="700px">
<el-form :model="form.item" :rules="rules" ref="form1" :inline="true" size="small" label-width="150px">
<el-form-item label="设备编码" prop="name">
<el-input v-model="form.item.name" style="width:280px;" placeholder="请输入设备编码"/>
<el-input v-model="form.item.name" style="width:280px;" placeholder="请输入设备编码" :disabled="form.reqType == 'edit'"/>
</el-form-item>
<el-form-item label="设备状态" prop="status">
<el-select v-model="form.item.status" placeholder="请选择设备状态" style="width:280px;">
......@@ -182,7 +182,7 @@ export default {
},
toDelete(item) {
var id = item.id;
var communicationName = item.number
var communicationName = item.name;
this.$confirm('确认删除该条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -239,9 +239,6 @@ export default {
}).catch(function(error) {
form.status.cu = 0
});
//新增通信账号
// let communicationAccount = lastData.number;
// HttpReq.truckDispatching.communicationAccountAdd({name:communicationAccount}).then((res) => {})
},
//修改设备
reqUpdateItem(form, item){
......@@ -285,8 +282,14 @@ export default {
}
this.loadData();
})
//删除通信账号
// HttpReq.truckDispatching.communicationAccountDel({name:communicationName}).then((res) => {})
//将车辆信息表中的终端设备字段改为空
HttpReq.truckDispatching.carInformationQuery({equipmentName:communicationName}).then((res) => {
if(res.code == 200 && res.data.totalElements != 0){
let lastData = res.data.content[0];
lastData.equipmentName = '';
HttpReq.truckDispatching.carInformationUpdate(lastData).then((resDel) => {})
}
})
},
}
}
......
......@@ -177,8 +177,10 @@ export default {
let rightTemporaryData = [];
this.$nextTick(()=>{
HttpReq.truckDispatching.screenTitleMenuQuery({size:9999,status:1,pid:0,sort:'dsort'}).then((res) => {
if(res.code == 200){;
let array1 = res.data.content;
if(res.code == 200){
let array1 = res.data.content.sort(function(a,b){
return parseInt(a.dsort) - parseInt(b.dsort);
});
for(let i = 0 ; i<3 ; i++){
leftTemporaryData.push(array1[i]);
}
......@@ -203,7 +205,10 @@ export default {
let left1 = [];
let center1 = [];
let right1 = [];
res.data.content.forEach((item,index)=>{
let array1 = res.data.content.sort(function(a,b){
return parseInt(a.dsort) - parseInt(b.dsort);
});
array1.forEach((item,index)=>{
if(item.pos == 'left'){
left1.push(item);
}else if(item.pos == 'right'){
......@@ -240,7 +245,10 @@ export default {
let left1 = [];
let center1 = [];
let right1 = [];
res.data.content.forEach((item,index)=>{
let array1 = res.data.content.sort(function(a,b){
return parseInt(a.dsort) - parseInt(b.dsort);
});
array1.forEach((item,index)=>{
if(item.pos == 'left'){
left1.push(item);
}else if(item.pos == 'right'){
......@@ -277,7 +285,10 @@ export default {
let left1 = [];
let center1 = [];
let right1 = [];
res.data.content.forEach((item,index)=>{
let array1 = res.data.content.sort(function(a,b){
return parseInt(a.dsort) - parseInt(b.dsort);
});
array1.forEach((item,index)=>{
if(item.pos == 'left'){
left1.push(item);
}else if(item.pos == 'right'){
......@@ -314,7 +325,10 @@ export default {
let left1 = [];
let center1 = [];
let right1 = [];
res.data.content.forEach((item,index)=>{
let array1 = res.data.content.sort(function(a,b){
return parseInt(a.dsort) - parseInt(b.dsort);
});
array1.forEach((item,index)=>{
if(item.pos == 'left'){
left1.push(item);
}else if(item.pos == 'right'){
......
......@@ -149,9 +149,9 @@ export default {
number: [
{required: true, message: '请输入车牌号', trigger: 'blur' }
],
equipmentName: [
{required: true, message: '请选择终端设备', trigger: 'change' }
],
// equipmentName: [
// {required: true, message: '请选择终端设备', trigger: 'change' }
// ],
road: [
{required: true, message: '请选择所属车队名称', trigger: 'change' }
],
......
This diff is collapsed.
......@@ -411,30 +411,63 @@ export default {
})
HttpReq.truckDispatching.screenMapSetUpDel(weilanName).then((res) => {})
//删除该卸区点所对应的路径图信息
if(items.areaclass == '卸区'){
let delname = items.name;
HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:delname}).then((res1) => {
if(res1.code == 200){
let idArr1 = [];
res1.data.content.forEach((item1,index1)=>{
idArr1.push(item1.id);
HttpReq.truckDispatching.RegionalCaiDianQuery({areaName:items.name}).then((resAll) => {
if(resAll.code == 200){
//totalElements == 0 说明为卸区,删除卸区对应点以及路径图信息
if(resAll.data.totalElements == 0){
let delname = items.name;
HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:delname}).then((res1) => {
if(res1.code == 200){
let idArr1 = [];
res1.data.content.forEach((item1,index1)=>{
idArr1.push(item1.id);
})
//删除
if(idArr1.length != 0){
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {})
}
}
})
HttpReq.truckDispatching.apiCpointQuery({name:delname}).then((res2) => {
if(res2.code == 200){
if(res2.data.content[0].id){
HttpReq.truckDispatching.apiCpointDel([res2.data.content[0].id]).then((res) => {})
}
}
})
}else{
//totalElements != 0 说明为采区,删除采区对应点以及路径图信息
resAll.data.content.forEach((itemdel1,indexdel1)=>{
//删除该采点所对应的路径图信息
let delname = itemdel1.areaName + '/' + itemdel1.name;
HttpReq.truckDispatching.apiPathmapQuery({size:9999,end:delname}).then((res1) => {
if(res1.code == 200){
let idArr1 = [];
res1.data.content.forEach((item1,index1)=>{
idArr1.push(item1.id);
})
//删除
if(idArr1.length != 0){
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {})
}
}
})
//删除对应控制点
HttpReq.truckDispatching.apiCpointQuery({name:delname}).then((res2) => {
if(res2.code == 200){
if(res2.data.content[0].id){
HttpReq.truckDispatching.apiCpointDel([res2.data.content[0].id]).then((res) => {})
}
}
})
//采点表里面的采点
HttpReq.truckDispatching.RegionalCaiDianDel([itemdel1.id]).then((res) => {})
})
//删除
if(idArr1.length != 0){
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {})
}
}
})
HttpReq.truckDispatching.apiCpointQuery({name:delname}).then((res2) => {
if(res2.code == 200){
if(res2.data.content[0].id){
HttpReq.truckDispatching.apiCpointDel([res2.data.content[0].id]).then((res) => {})
}
}
})
}
}
})
},
//图片上传
excelImport(event) {
......
......@@ -16,7 +16,7 @@
<el-input-number v-model="query.coefficient" :precision="2" :step="0.1" :min="0" :max="9999" @change="inputInitialFn()"></el-input-number>
<el-button size="mini" type="success" @click="addKeyPoints()" :disabled="addKeyPointsAble">添加路径关键点</el-button>
<div style="width:62vw;height: 72vh;overflow: hidden;margin-top: 1vh;">
<mars3dViewerMap :url="configUrl" @onload="onMapload" ref="mars3dViewerMapMethod"/>
<mars3dViewerMap :url="configUrl" @onload="onMapload" ref="mars3dViewerMapMethod" :key="shuaxinTimer"/>
</div>
</div>
</div>
......@@ -122,6 +122,8 @@ export default {
faControlPointId:0,
//选择连接点数据
selectConnectPointArray:[],
//重置地图
shuaxinTimer:null,
};
},
mounted(){
......@@ -245,18 +247,27 @@ export default {
idArr1.push(item1.id);
})
//删除
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
if(idArr1.length == 0){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
this.resetData();
})
}else{
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
this.resetData();
})
})
})
}
}
})
},
......@@ -289,18 +300,27 @@ export default {
idArr1.push(item1.id);
})
//删除
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((res) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
if(idArr1.length == 0){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
this.resetData();
})
}else{
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
this.resetData();
})
})
})
}
}
})
},
......@@ -347,25 +367,32 @@ export default {
idArr1.push(item2.id);
})
//删除
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({
title: '删除成功,即将重新加载,请勿操作!',
type: 'success',
duration: 2500
});
setTimeout(function (){
window.location.reload();
},2000);
if(idArr1.length == 0){
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
this.resetData();
})
}else{
HttpReq.truckDispatching.apiPathmapDel(idArr1).then((resDel1) => {
HttpReq.truckDispatching.apiCpointDel([this.faControlPointId]).then((resDel2) => {
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
this.resetData();
})
})
})
}
}
})
}
})
},
//点击关键点获取对应数据
clickPointFn(item){
......@@ -440,6 +467,38 @@ export default {
})
}
},
//重置数据
resetData(){
//获取各个点的数据
HttpReq.truckDispatching.apiCpointQuery({size:9999}).then((res) => {
if(res.code == 200){
let arr1 = [];
res.data.content.forEach((item,index)=>{
let obj1 = {};
obj1.end = item.name;
obj1.weight = 0;
arr1.push(obj1);
})
this.controlPointData = arr1;
this.shuaxinTimer = new Date().getTime();
this.$refs.mars3dViewerMapMethod.getCoordinate(res.data.content);
//添加路径关键点按钮可否使用
this.addKeyPointsAble = false;
//选择关键点类型
this.activeName = "";
//装卸车点名称
this.entruckingValue1 = [];
this.detrainingValue2 = [];
this.controlPointValue3 = '';
//保存时判断为添加还是修改
this.transmitWay = 'add';
//暂存修改删除时的id
this.faControlPointId = 0;
//选择连接点数据
this.selectConnectPointArray = [];
}
})
},
// 地图构造完成回调
onMapload(map) {
// 以下为演示代码
......
......@@ -44,7 +44,7 @@
</el-select>
</el-form-item>
<el-form-item label="排序" prop="dsort">
<el-input-number v-model="form.item.dsort"></el-input-number>
<el-input-number v-model="form.item.dsort" :min="1" :precision="0" :step="1"></el-input-number>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="form.item.status" placeholder="请选择状态" style="width:280px;">
......@@ -98,7 +98,10 @@ export default {
//获取对应子标题
HttpReq.truckDispatching.screenTitleMenuQuery({size:9999,pid:item.children,sort:'dsort'}).then((res2) => {
if(res2.code == 200){
sonData.children = res2.data.content;
let sortArr = res2.data.content.sort(function(a,b){
return parseInt(a.dsort) - parseInt(b.dsort);
});
sonData.children = sortArr;
alltableData.push(sonData);
this.tableData = alltableData;
}else{
......@@ -151,29 +154,48 @@ export default {
//修改菜单配置
reqUpdateItem(form, item){
let lastData = {...item};
lastData.id = this.alarmTimeId;
if(lastData.children){
delete lastData.children;
}
HttpReq.truckDispatching.screenTitleMenuUpdate(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
this.$notify({
title: '大屏配置修改成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
let panduan1 = true;
HttpReq.truckDispatching.screenTitleMenuQuery({size:9999,pid:lastData.pid}).then((res1) => {
if(res1.code == 200){
res1.data.content.forEach((item1,index1)=>{
if(item1.dsort == lastData.dsort && item1.title != lastData.title){
panduan1 = false;
}
})
if(panduan1){
lastData.id = this.alarmTimeId;
if(lastData.children){
delete lastData.children;
}
HttpReq.truckDispatching.screenTitleMenuUpdate(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
this.$notify({
title: '大屏配置修改成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) {
form.status.cu = 0
});
}else{
this.$notify({
title: "排序序号与该模块中的序号重复,请重新选择排序!",
type: 'error',
duration: 2500
})
form.status.cu = 0;
}
}
}).catch(function(error) {
form.status.cu = 0
});
})
},
//组件状态展示修改
statusChange(row){
......
......@@ -25,6 +25,7 @@ module.exports = {
productionSourceMap: false,
devServer: {
host: 'localhost', // 也可以直接写IP地址这样方便真机测试
//host: '192.168.0.102', // 也可以直接写IP地址这样方便真机测试
port: port,
open: true,
//https: true,
......
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