页面分离修改

This commit is contained in:
2025-09-05 18:39:00 +08:00
parent 29629b9d43
commit 9e439f5229
14 changed files with 1146 additions and 888 deletions

View File

@ -1,12 +1,13 @@
import Dialog from '../../../BaseDialog';
import { html } from "./_element";
import Tools from "../../../Tools";
// import CreatePolygon from "./CreatePolygon";
import DrawPolygon from "../../../Draw/drawPolygon"
class CutFillAnalysis {
/**
* @constructor 填挖方分析
* @param sdk
* @param sdk
* **/
constructor(sdk, options = {}, _Dialog = {}) {
this.sdk = sdk;
@ -26,21 +27,20 @@ class CutFillAnalysis {
noArea: "",
}
this.entities = []
this.tools = new Tools(this.sdk)
this.Draw = new DrawPolygon(this.sdk)
YJ.Analysis.AnalysesResults.push(this)
CutFillAnalysis.EditBox(this)
// CutFillAnalysis.EditBox(this)
}
create() {
this.clean()
this.Draw.start((a, positions) => {
if(!positions || positions.length<3) {
if (!positions || positions.length < 3) {
let _error = '最少需要三个坐标!'
console.warn(_error)
window.ELEMENT && window.ELEMENT.Message({
message: _error,
this.tools.message({
text: _error,
type: 'warning',
duration: 1500
});
return
}
@ -52,6 +52,7 @@ class CutFillAnalysis {
this.createPolygonGeo(this.positions);
this.result = this.VolumeAnalysis();
this.viewer.scene.screenSpaceCameraController.enableCollisionDetection = false; //允许相机进入地下
this.clickCallBack()
})
// const $this = this;
// if (!this.cp) {
@ -336,6 +337,65 @@ class CutFillAnalysis {
});
}
get heights() {
return this.height
}
set heights(val) {
this.height = val
}
get precisions() {
return this.precision
}
set precisions(val) {
this.precision = val
}
get allArea() {
return Number(this.result.allArea.toFixed(4))
}
set allArea(val) {
this.result.allArea = val
}
get fillArea() {
return Number(this.result.fillArea.toFixed(4))
}
set fillArea(val) {
this.result.fillArea = val
}
get fillVolume() {
return Number(this.result.fillVolume.toFixed(4))
}
set fillVolume(val) {
this.result.fillVolume = val
}
get cutArea() {
return Number(this.result.cutArea.toFixed(4))
}
set cutArea(val) {
this.result.cutArea = val
}
get cutVolume() {
return Number(this.result.cutVolume.toFixed(4))
}
set cutVolume(val) {
this.result.cutVolume = val
}
get noArea() {
return Number(this.result.noArea.toFixed(4))
}
set noArea(val) {
this.result.noArea = val
}
get onEnd() {
return this.clickCallBack
}
set onEnd(val) {
if (val && typeof val !== 'function') {
console.error('val:', val, '不是一个function')
} else {
this.clickCallBack = val
}
}
clean() {
this.Draw && this.Draw.end()
for (let i = 0; i < this.entities.length; i++) {
@ -351,4 +411,4 @@ class CutFillAnalysis {
}
}
}
export default CutFillAnalysis;
export default CutFillAnalysis;