Commit 8d550eb9 authored by caicaicai's avatar caicaicai

修改

parent 0f394f0e
......@@ -87,6 +87,7 @@ export default {
zuobianData:[],
toJavaCoordinates:[],
weilanName:[],
areaColorData:[],
}
},
......@@ -136,6 +137,7 @@ export default {
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 = [];
......@@ -145,6 +147,7 @@ export default {
arrays.push(arr);
})
data1.push(arrays)
}
that.zuobianData = data1
//console.log("zuobianData",that.zuobianData);
......@@ -203,7 +206,7 @@ export default {
var graphicLayer = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer);
initLayerManager(graphicLayer,that.weilanName[index]);
that.addGraphic_01(graphicLayer,item,that.weilanName[index]);
that.addGraphic_01(graphicLayer,item,that.weilanName[index],that.areaColorData[index]);
})
//实时位置
......@@ -217,11 +220,11 @@ export default {
this.$emit('onload', map)
},
//围栏回显
addGraphic_01(graphicLayer,positions,weilanName){
addGraphic_01(graphicLayer,positions,weilanName,color){
let graphic = new mars3d.graphic.PolygonEntity({
positions: positions,
style: {
color: "red",
color: color,
opacity: 0.5,
outline: true,
outlineWidth: 3,
......
......@@ -171,7 +171,7 @@ export default {
// })
},
//上传围栏数据
uploaded(text){
uploaded(text,color){
let newData = [...this.toJavaCoordinates];
newData.pop();
// if(this.toJavaCoordinates.length == 0){
......@@ -183,6 +183,7 @@ export default {
let allObj = {};
allObj.name = text;
allObj.zuobiao = newData;
allObj.color = color;
this.toJavaCoordinates = [];
//console.log(allObj);
//发送添加电子围栏请求
......
......@@ -146,6 +146,9 @@ export default {
name: [
{required: true, message: '请输入区域名称', trigger: 'blur' }
],
areaclass: [
{required: true, message: '请选择所属类别', trigger: 'change' }
],
},
}
......@@ -270,6 +273,14 @@ export default {
},
//新增区域信息
reqAddItem(form, item){
let areaclass1 = item.areaclass;
let areaColor = '';
this.RegionalTypeData.forEach((obj1)=>{
if(obj1.classname == areaclass1){
areaColor = obj1.color;
}
})
let panduan1 = this.tableData.find((obj,index)=>{
return obj.name == item.name;
})
......@@ -284,7 +295,7 @@ export default {
}else{
let lastData = {...item};
lastData.card = this.picFileName;
this.$refs.mars3dViewerMapMethod.uploaded(lastData.name);
//this.$refs.mars3dViewerMapMethod.uploaded(lastData.name);
HttpReq.truckDispatching.RegionalInformationAdd(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
......@@ -295,7 +306,7 @@ export default {
});
this.loadData();
this.$nextTick(()=>{
this.$refs.mars3dViewerMapMethod.uploaded(lastData.name);
this.$refs.mars3dViewerMapMethod.uploaded(lastData.name,areaColor);
})
}else{
this.$notify({
......
......@@ -13,7 +13,7 @@
<div class="content">
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName">
<el-table-column prop="classname" label="区域类别名称" align="center"></el-table-column>
<el-table-column prop="color" label="区域遮罩层颜色" align="center"></el-table-column>
<el-table-column prop="color" label="区域遮罩层颜色" align="center" :formatter="colorChange"></el-table-column>
<el-table-column prop="createTime" label="日期" align="center"></el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
......@@ -38,10 +38,10 @@
</el-form-item>
<el-form-item label="区域遮罩层颜色" prop="color">
<el-select v-model="form.item.color" placeholder="请选择区域遮罩层颜色" style="width:280px;">
<el-option label="蓝色" value="蓝色"></el-option>
<el-option label="绿色" value="绿色"></el-option>
<el-option label="红色" value="红色"></el-option>
<el-option label="黄色" value="黄色"></el-option>
<el-option label="蓝色" value="blue"></el-option>
<el-option label="绿色" value="green"></el-option>
<el-option label="红色" value="red"></el-option>
<el-option label="黄色" value="yellow"></el-option>
</el-select>
</el-form-item>
</el-form>
......@@ -234,6 +234,10 @@ export default {
this.loadData();
})
},
//颜色转换
colorChange(row){
return row.color == 'blue' ? '蓝色' : row.color == 'green' ? '绿色' :row.color == 'red' ? '红色' : row.color == 'yellow' ? '黄色' : '';
},
}
}
</script>
......
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