Browse Source

[新增]新建单位没有信用代码时随机生成

zhuzhou
邵佳豪 4 years ago
parent
commit
61726910fe
  1. 3
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  2. 125
      src/app/ui/collection-tools-plan/collection-tools.component.ts

3
src/app/key-unit/key-unit-management/key-unit-management.component.ts

@ -825,10 +825,11 @@ export class CreateUnit {
}
onSubmit(value){
let myDate = new Date();
let usci = new Date().getTime() + '00000'
let body = {
id: "",
name: value.name,
usci: value.usci,
usci: value.usci || usci,
contacts: "",
phone: "",
address: "",

125
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -231,29 +231,38 @@ export class CollectionToolsPlanComponent implements OnInit {
assetWidthIunput() {
this.canvasAssetObj.Width = this.assetWidth
this.canvasData.isChange = true
if(!this.isGis){
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
}
//素材高度输入框改变
assetHeightIunput() {
this.canvasAssetObj.Height = this.assetHeight
this.canvasData.isChange = true
if(!this.isGis){
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
}
//素材角度输入框改变
assetAngleIunput() {
this.canvasAssetObj.Angle = this.sliderValue
this.canvasData.isChange = true
if(!this.isGis){
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
}
//素材厚度输入框改变
assetThicknessIunput() {
this.canvasAssetObj.Thickness = this.sliderValueThickness
this.canvasData.isChange = true
if(!this.isGis){
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
}
//素材是否高亮改变----->本地操作行为
assetHighLightIunput() {
@ -277,8 +286,10 @@ export class CollectionToolsPlanComponent implements OnInit {
}
this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value
this.canvasData.isChange = true
if(!this.isGis){
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
}
//动态属性素材布尔值框改变radio
assetRadioChange(i, boolean) {
@ -297,8 +308,10 @@ export class CollectionToolsPlanComponent implements OnInit {
this.selectedcolor = item + this.selectedcolor.substring(this.selectedcolor.length - 2)
this.canvasAssetObj.Color = this.selectedcolor
this.canvasData.isChange = true
if(!this.isGis){
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
}
//颜色选择滑竿的值
colorDivSliderValue
colorDivSliderChange() {
@ -311,8 +324,10 @@ export class CollectionToolsPlanComponent implements OnInit {
this.selectedcolor = replacepos(this.selectedcolor, 7, 8, colorOpacity.toString(16))
this.canvasAssetObj.Color = this.selectedcolor
this.canvasData.isChange = true
if(!this.isGis){
this.canvas.refreshIcon(this.canvasAssetObj.Id)
}
}
//上传素材图片
selectFile(e) {
@ -557,6 +572,26 @@ export class CollectionToolsPlanComponent implements OnInit {
// this.refurbishTreeData()
}
})
//点击marker关闭按钮
window.deleteMarker = () => {
this.canvasData.isChange = true
//清除地图标点
this.planDataMarkers.forEach((element, index) => {
if (element.id == this.clickId) {
this.planDataMarkers[index].setMap(null);
}
});
// 删除楼层数据
delete this.canvasData.originaleveryStoreyData.data[this.clickId];
// 删除建筑数据
delete this.canvasData.originalcompanyBuildingData.data[this.clickId];
console.log('originalcompanyBuildingData', this.canvasData.originalcompanyBuildingData)
console.log('originaleveryStoreyData', this.canvasData.originaleveryStoreyData)
}
}
//多选宽度共同改变
multipleAssetWidthInput() {
@ -1364,6 +1399,44 @@ export class CollectionToolsPlanComponent implements OnInit {
this.map.on('click', (e) => {
this.showInfoClick(e)
});
this.map.on("complete", () => {
for (const key in this.canvasData.originaleveryStoreyData.data) {
if (Object.prototype.hasOwnProperty.call(this.canvasData.originaleveryStoreyData.data, key)) {
const element = this.canvasData.originaleveryStoreyData.data[key];
let markerContent = '' +
'<div class="custom-content-marker" id="xxxx">' +
`<img src="${element.ImageUrl}">` +
`<div class="close-btn" onclick='deleteMarker()'>X</div>` +
'</div>';
// 将 icon 传入 marker
let startMarker = new AMap.Marker({
position: new AMap.LngLat(element.Point.x, element.Point.y),
// 将 html 传给 content
content: markerContent,
// 以 icon 的 [center bottom] 为原点
offset: new AMap.Pixel(-13, -30),
draggable: true,
});
startMarker.id = element.Id
startMarker.on('click', (e) => {
this.clickId = e.target.id
this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[e.target.id])
});
startMarker.on('dragend', (e) => {
// console.log('拖拽完成', e)
this.canvasData.isChange = true
this.clickId = e.target.id
this.canvasData.originaleveryStoreyData.data[e.target.id].Point = { x: e.lnglat.lng, y: e.lnglat.lat }
});
this.planDataMarkers.push(startMarker)
this.map.add(startMarker);
}
}
});
}
@ -1991,9 +2064,8 @@ export class CollectionToolsPlanComponent implements OnInit {
if (!this.selectImage.imageUrl) {
return
}
this.canvasData.isChange = true
let id = ObjectID.default.generate()
// console.log('点击了地图', e)
// 新增点标记
// 点标记显示内容,HTML要素字符串
let markerContent = '' +
@ -2015,59 +2087,32 @@ export class CollectionToolsPlanComponent implements OnInit {
startMarker.id = id
startMarker.on('click', (e) => {
this.clickId = e.target.id
for (let index = 0; index < this.planData.length; index++) {
const item = this.planData[index];
if (item.Id == e.target.id) {
this.setAssetsProperty(item)
return
}
}
this.setAssetsProperty(this.canvasData.originaleveryStoreyData.data[e.target.id])
});
startMarker.on('dragend', (e) => {
console.log('拖拽完成', e)
// console.log('拖拽完成', e)
this.canvasData.isChange = true
this.clickId = e.target.id
for (let index = 0; index < this.planData.length; index++) {
const item = this.planData[index];
if (item.Id == e.target.id) {
//修改最终坐标数据
item.point = { x: e.lnglat.lng, y: e.lnglat.lat }
return
}
}
this.canvasData.originaleveryStoreyData.data[e.target.id].Point = { x: e.lnglat.lng, y: e.lnglat.lat }
});
//将图标数据添加
let itemData = JSON.parse(JSON.stringify(this.selectImage))
itemData.id = id
itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat }
console.log(987,this.canvasData.deserialize(JSON.stringify(itemData)))
// console.log('originalcompanyBuildingData',this.canvasData.originalcompanyBuildingData)
// console.log('originaleveryStoreyData',this.canvasData.originaleveryStoreyData)
itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写
this.planData.push(itemData)
// 添加楼层数据
this.canvasData.originaleveryStoreyData.data[id] = itemData;
// 添加建筑数据
this.canvasData.originalcompanyBuildingData.data[id] = itemData;
console.log('originalcompanyBuildingData', this.canvasData.originalcompanyBuildingData)
console.log('originaleveryStoreyData', this.canvasData.originaleveryStoreyData)
//将marker点添加
this.planDataMarkers.push(startMarker)
this.map.add(startMarker);
//点击关闭按钮
window.deleteMarker = () => {
//清除地图标点
this.planDataMarkers.forEach((element, index) => {
if (element.id == this.clickId) {
this.planDataMarkers[index].setMap(null);
}
});
//删除指定数据
for (let index = 0; index < this.planData.length; index++) {
const item = this.planData[index];
if (item.id == this.clickId) {
this.planData.splice(index, 1)
return
}
}
}
}

Loading…
Cancel
Save