|
|
@ -39,6 +39,8 @@ import Overlay from "ol/Overlay"; |
|
|
|
|
|
|
|
import guangdongJson from "./guangdong.json"; |
|
|
|
|
|
|
|
import { listInfo } from "@/api/build/projectInfo"; |
|
|
|
|
|
|
|
export default { |
|
|
|
props: { |
|
|
|
potMsg: { type: Array }, |
|
|
@ -70,9 +72,25 @@ export default { |
|
|
|
lat: null, |
|
|
|
}, |
|
|
|
viewCenter: [113.36502, 22.9787], |
|
|
|
|
|
|
|
// 重大项目字典 |
|
|
|
zd_projectTypeOptions: [], |
|
|
|
// 面上项目字典 |
|
|
|
ms_projectTypeOptions: [], |
|
|
|
// 建设性质字典 |
|
|
|
constructionNatureOptions: [], |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getDicts("major_project").then((response) => { |
|
|
|
this.zd_projectTypeOptions = response.data; |
|
|
|
}); |
|
|
|
this.getDicts("general_project").then((response) => { |
|
|
|
this.ms_projectTypeOptions = response.data; |
|
|
|
}); |
|
|
|
this.getDicts("CONSTRUCTION_NATURE").then((response) => { |
|
|
|
this.constructionNatureOptions = response.data; |
|
|
|
}); |
|
|
|
if (this.potMsg.length > 0 || this.lineMsg.length > 0) { |
|
|
|
this.all_point_coords = [...this.potMsg]; |
|
|
|
this.all_line_coords = [...this.lineMsg]; |
|
|
@ -81,6 +99,7 @@ export default { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.initMap(); |
|
|
|
this.getProjectInfo(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/** |
|
|
@ -504,57 +523,93 @@ export default { |
|
|
|
that.map.addLayer(vectorLayer); |
|
|
|
}, |
|
|
|
|
|
|
|
// 回显坐标点 |
|
|
|
ProjectCoordinatePoint(data = []) { |
|
|
|
data = [ |
|
|
|
{ |
|
|
|
id: "706cf8d0b46345a5b8663389a07914d5", |
|
|
|
projectName: "test新增专题项目", |
|
|
|
pointLatitudeLongitudeList: |
|
|
|
"[[113.2857,22.9062],[113.2905,22.9038],[113.2929,22.9082],[113.2892,22.9109]]", |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: "b9bdec758a3a4394bde8fc3ceb93ba0e", |
|
|
|
projectName: "清林径水库巡逻哨所工程", |
|
|
|
pointLatitudeLongitudeList: |
|
|
|
"[[114.23961891846892,22.766099930804188]]", |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: "937c6726536e4f87abc1e60b3ff2b409", |
|
|
|
projectName: "深圳市西丽水库除险加固工程", |
|
|
|
pointLatitudeLongitudeList: |
|
|
|
"[[113.95333747585406,22.594931238307186]]", |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: "8c52ba26999d4204970d7b15a02f9648", |
|
|
|
projectName: |
|
|
|
"铁岗、石岩、西丽、长岭皮水库2018年版一级水源保护区调整新增围网工程", |
|
|
|
pointLatitudeLongitudeList: |
|
|
|
"[[113.8929221476539,22.62227051357431],[113.95036032139922,22.600084872053458],[113.90267358885954,22.693537929579115],[114.00273672489836,22.61127967377137]]", |
|
|
|
// 获取工程项目信息 |
|
|
|
getProjectInfo() { |
|
|
|
this.loading = true; |
|
|
|
listInfo({ |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 1000, |
|
|
|
ids: null, |
|
|
|
data: { |
|
|
|
isMajor: null, |
|
|
|
projectName: null, |
|
|
|
unitLeader: null, |
|
|
|
projectLegalPerson: null, |
|
|
|
projectLegalUnit: null, |
|
|
|
projectLegalPhone: null, |
|
|
|
engineeringGrade: null, |
|
|
|
engineeringPurposes: null, |
|
|
|
workCategory: null, |
|
|
|
constructionAddress: null, |
|
|
|
constructionMode: null, |
|
|
|
constructionNature: null, |
|
|
|
constructionContent: null, |
|
|
|
adcd: null, |
|
|
|
basin: null, |
|
|
|
projectType: null, |
|
|
|
// fundingSource: null, |
|
|
|
|
|
|
|
centralArrangedFunds: null, |
|
|
|
centralArrangedFundsRate: null, |
|
|
|
provincialFunding: null, |
|
|
|
provincialFundingRate: null, |
|
|
|
cityLevelFunds: null, |
|
|
|
cityLevelFundsRate: null, |
|
|
|
countyLevelFunds: null, |
|
|
|
countyLevelFundsRate: null, |
|
|
|
townshipInvestments: null, |
|
|
|
townshipInvestmentsRate: null, |
|
|
|
|
|
|
|
isMajorProject: null, |
|
|
|
investmentSubject: null, |
|
|
|
constructionPhase: null, |
|
|
|
fundingNumber: null, |
|
|
|
proCode: null, |
|
|
|
proNo: null, |
|
|
|
createUid: null, |
|
|
|
createTime: null, |
|
|
|
updateUid: null, |
|
|
|
updateTime: null, |
|
|
|
owerDept: null, |
|
|
|
isKeyProject: null, |
|
|
|
isPierceProject: null, |
|
|
|
projectKinds: null, |
|
|
|
}, |
|
|
|
{ |
|
|
|
id: "607bc8bc38ed487d83ea906def4f5659", |
|
|
|
projectName: "沙湾河深圳水库截排工程项目施工总承包Ⅲ标段", |
|
|
|
pointLatitudeLongitudeList: "[[111,22],[114.16831,22.61232]]", |
|
|
|
// 排序方式 |
|
|
|
params: { |
|
|
|
// 按哪个字段排序 |
|
|
|
orderBy: "create_time", |
|
|
|
// desc降序,升序asc |
|
|
|
sortBy: "desc", |
|
|
|
}, |
|
|
|
]; |
|
|
|
}).then((response) => { |
|
|
|
console.log("response", response); |
|
|
|
this.ProjectCoordinatePoint(response.records); |
|
|
|
}); |
|
|
|
|
|
|
|
// this.ProjectCoordinatePoint(); |
|
|
|
}, |
|
|
|
|
|
|
|
// 回显坐标点 |
|
|
|
ProjectCoordinatePoint(data = []) { |
|
|
|
let TestPointVectorSource = new VectorSource({}); |
|
|
|
|
|
|
|
// 处理点数据 |
|
|
|
data.forEach((pointItem) => { |
|
|
|
pointItem.pointLatitudeLongitudeList = JSON.parse( |
|
|
|
pointItem.pointLatitudeLongitudeList |
|
|
|
); |
|
|
|
pointItem.pointLatitudeLongitudeList.forEach((item) => { |
|
|
|
let obj = new Feature({ |
|
|
|
geometry: new Point(item), |
|
|
|
pointData: pointItem, |
|
|
|
name: "test", |
|
|
|
data |
|
|
|
.filter((item) => item.pointLatitudeLongitudeList != null || "") |
|
|
|
.forEach((pointItem) => { |
|
|
|
pointItem.pointLatitudeLongitudeList = JSON.parse( |
|
|
|
pointItem.pointLatitudeLongitudeList |
|
|
|
); |
|
|
|
pointItem.pointLatitudeLongitudeList.forEach((item) => { |
|
|
|
let obj = new Feature({ |
|
|
|
geometry: new Point(item), |
|
|
|
pointData: pointItem, |
|
|
|
name: "test", |
|
|
|
}); |
|
|
|
TestPointVectorSource.addFeature(obj); |
|
|
|
}); |
|
|
|
TestPointVectorSource.addFeature(obj); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
let TestClusterSource = new Cluster({ |
|
|
|
distance: 25, |
|
|
@ -662,7 +717,13 @@ export default { |
|
|
|
|
|
|
|
const contentHtml = ` |
|
|
|
|
|
|
|
<div><span>项目名:</span>${data.projectName}</div> |
|
|
|
<div style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;"> |
|
|
|
<span>项目名:${data.projectName}</span> |
|
|
|
<span>项目编码:${data.proCode}</span> |
|
|
|
<span>项目类型:${this.projectTypeFormat(data)}</span> |
|
|
|
<span>建设性质:${this.constructionNatureFormat(data)}</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
`; |
|
|
|
content.innerHTML = contentHtml; |
|
|
@ -706,6 +767,30 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 项目类型字典翻译 |
|
|
|
projectTypeFormat(row, column) { |
|
|
|
if (row.isMajor == "zd") { |
|
|
|
return this.selectDictLabel( |
|
|
|
this.zd_projectTypeOptions, |
|
|
|
row.projectType |
|
|
|
); |
|
|
|
} else if (row.isMajor == "ms") { |
|
|
|
return this.selectDictLabel( |
|
|
|
this.ms_projectTypeOptions, |
|
|
|
row.projectType |
|
|
|
); |
|
|
|
} else if (row.isMajor != null) { |
|
|
|
return "其他"; |
|
|
|
} |
|
|
|
}, |
|
|
|
// 建设性质字典 |
|
|
|
constructionNatureFormat(row, column) { |
|
|
|
return this.selectDictLabel( |
|
|
|
this.constructionNatureOptions, |
|
|
|
row.constructionNature |
|
|
|
); |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除 |
|
|
|
handleDelect() { |
|
|
|
let that = this; |
|
|
|