58 lines
1.7 KiB
JavaScript
58 lines
1.7 KiB
JavaScript
import { Query, QueryTask, QueryType, EditTask, EditType, Operator, CellsysType} from './cellsysUtil.js';
|
|
|
|
class CellsysTaskGeom {
|
|
constructor(params) {
|
|
this.cellsysType = CellsysType.TaskGeom;
|
|
if (!params) { params = {} };
|
|
this.id = params.id;
|
|
this.name = params.name;
|
|
this.orgId = params.org_id;
|
|
this.orgName = params.org_name;
|
|
this.description = params.description;
|
|
this.geometry = params.geometry;
|
|
this.geomType = null;
|
|
this.status = 1;
|
|
this.action = params.action;
|
|
this.bufferDistance = params.buffer_distance;
|
|
this.object = params.object;
|
|
this.objectIds = params.object_ids ? params.object_ids : [];
|
|
if(this.geometry) {
|
|
let geomType = null;
|
|
switch(this.geometry.type) {
|
|
case "Point":
|
|
geomType = 0;
|
|
break;
|
|
case "MultiPoint":
|
|
geomType = 0;
|
|
break;
|
|
case "LineString":
|
|
geomType = 1;
|
|
break;
|
|
case "MultiLineString":
|
|
geomType = 1;
|
|
break;
|
|
case "Polygon":
|
|
geomType = 2;
|
|
break;
|
|
case "MultiPolygon":
|
|
geomType = 2;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
this.geomType = geomType;
|
|
}
|
|
}
|
|
setId(value) {
|
|
this.id = value;
|
|
}
|
|
setName(value) {
|
|
this.name = value;
|
|
}
|
|
setDescription(value) {
|
|
this.description = value;
|
|
}
|
|
}
|
|
|
|
export default CellsysTaskGeom
|