邵佳豪 4 years ago
parent
commit
35f0ff29b1
  1. 1
      package.json
  2. 1
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  3. 31
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  4. 200
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  5. 644
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  6. 75
      src/app/plan-management/create-plan-online-five/yinyong.html
  7. 34
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  8. 3
      src/app/plan-management/plan-management.module.ts
  9. 29
      src/app/ui/plan-template/plan-template.component.ts
  10. 5
      src/app/ui/plan-template/upPlan.html
  11. 204
      src/app/working-area/model/axImageShape.ts
  12. BIN
      src/assets/images/yr.png

1
package.json

@ -5,6 +5,7 @@
"ng": "ng",
"start": "ng serve --proxy-config proxy.config.json --open",
"build": "ng build",
"build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod",
"publish": "ng build --prod --verbose",
"test": "ng test",
"lint": "ng lint",

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

@ -617,6 +617,7 @@ export class KeyUnitManagementComponent implements OnInit {
this.http.post(`/api/ContentVerifies/Batch`,this.deleteAudia).subscribe(data=>{
this.snackBar.open('操作成功','确定',config);
this.getAllKeyUnit()
this.deleteAll=[]
},err=>{
this.snackBar.open(err,'确定',config);
})

31
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -188,7 +188,7 @@
<div class="newBody">
<div class="search">
<div class="searchChoose">
<select [(ngModel)]="searchType">
<select [(ngModel)]="searchType" (change)='clearSearch()'>
<option value="0">自定义</option>
<option value="1">按机构</option>
</select>
@ -223,10 +223,32 @@
<input type="text" placeholder="请输入关键字" [(ngModel)]="zdysearch">
</div>
</div>
<div class="searImg">
<img src="../../../assets/images/search.png" >
<div class="searImg" (click)="searchYuan()">
<img src="../../../assets/images/search.png">
</div>
</div>
<div class="newBodycenter">
<div class="centerfen" *ngFor="let item of yinruData.items;let clicki=index">
<div class="tu" (click)='clickYinru(clicki)'>
<img src="../../../assets/images/yr.png">
</div>
<div class="org">
<span style="font-size: 15px;">{{item.organizationName}}</span>
</div>
<div class="lry">
<span style="color:#9EAAB4;font-size:14px">录入员:{{item.creatorName}}</span>
</div>
</div>
</div>
<div class="fenye">
<mat-paginator pageEvent [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="changePage($event)">
</mat-paginator>
</div>
</div>
</div>
@ -415,7 +437,7 @@
flex-direction: column;">
<div class="boxBodyHead" style="width: 100%;
height: 40pt;
background-color: #ffd91d;
background-color: #FFD91D;
text-align: center;">
<span style="font-size: 16px;
text-align: center;
@ -923,7 +945,6 @@
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[0].name" disabled></textarea> -->
</th>
<td style="border: 1px solid #999;
font-size: 16px;
text-align: center;">
{{parts.body[0].value}}

200
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -223,7 +223,7 @@
.leftnew{
position: fixed;
width: 14%;
height: 85%;
height: 90%;
background-color: white;
top: 66px;
min-width: 300px;
@ -340,6 +340,7 @@
.searImg{
width: 15%;
height: 100%;
cursor: pointer;
img{
position: relative;
top: 20%;
@ -347,6 +348,43 @@
}
}
}
.newBodycenter{
height: 86%;
width: 100%;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
overflow-y: auto;
//flex-direction: column;
.centerfen{
//width: 50%;
margin: 15px 0 12px 24px;
//height: 150px;
display: flex;
flex-direction: column;
.tu{
height: 100px;
width: 110px;
cursor: pointer;
img{
width: 110px;
height: 100px;
}
}
.org{
width: 110px;
}
.lry{
width: 110px;
}
span{
display: inline-block;
}
}
}
.fenye{
width: 100%;
}
}
}
.mainbox {
@ -1017,3 +1055,163 @@
}
}
.yinrubox{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.yinruboxHead{
width: 100%;
height:7%;
border-bottom:1px solid #8b8c8c;
span{
font-size: 18px;
color: #2196f3;
line-height: 40px;
}
button{
float: right;
}
}
.boxBody {
//height: 100%;
width: 100%;
overflow-y: auto;
display: flex;
flex-direction: column;
.boxBodyHead {
width: 100%;
height: 40px;
margin-top: 3%;
background-color: #ffd91d;
text-align: center;
span {
font-size: 16px;
text-align: center;
height: 40px;
line-height: 40px;
color: #b99a00;
}
img {
cursor: pointer;
width: 20px;
height: 20px;
float: right;
margin-top: 10px;
margin-right: 10px;
}
}
.body {
width: 100%;
//height: 100%;
thead {
width: 100%;
background-color: #e8e9e9;
}
table {
width: 100%;
border-collapse: collapse;
//background-color: #E8E9E9;
}
th {
//background-color: #E8E9E9;
border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;
input {
background-color: #e8e9e9;
text-align: center;
height: 100%;
width: 100%;
font-size: 16px;
border: none;
outline: none;
}
}
td {
border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;
input {
background-color: #ffffff;
text-align: center;
height: 100%;
width: 100%;
font-size: 16px;
border: none;
outline: none;
}
}
.inputtext {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
input {
//width: 100%;
height: 40px;
font-size: 16px;
border: none;
outline: none;
}
.inputj {
width: 100%;
//height: 100%;
display: flex;
}
}
.keyImg {
width: 100%;
height: 100%;
.keyImgImg {
.imgbox {
margin-top: 10px;
text-align: center;
position: relative;
img {
max-width: 100%;
width: auto;
height: auto;
}
.deleteImg {
display: none;
cursor: pointer;
position: absolute;
right: 0px;
top: 0px;
}
}
.imgbox:hover {
.deleteImg {
display: block;
}
}
.uploadBtn {
display: flex;
justify-content: center;
margin: 50px 0;
position: relative;
input {
width: 112px;
height: 36px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
opacity: 0;
cursor: pointer;
}
}
}
.addkeyImgItem {
display: flex;
justify-content: center;
margin: 10px 0;
}
}
}
}
}

644
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-06-16 13:56:54
* @LastEditors: sueRimn
* @LastEditTime: 2021-08-05 16:24:21
* @LastEditTime: 2021-08-12 14:14:20
*/
import { HttpClient } from '@angular/common/http';
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core';
@ -50,7 +50,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
paginator: MatPaginator;
length: any; //共多少条数据
pageSize: any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
pageSizeOptions: number[] = [6] //设置每页条数
PageNumber: any; //第几页
planLevel: string//预案级别
@ -67,7 +67,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.getOrganizations();
//this.getAllBuildings()
}
zdysearch
zdysearch=''
organizationName: any //当前单位组织机构名称
treedata: any //组织机构树型数据
newArr: any = []
@ -112,7 +112,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
});
});
this.http.get("/api/Account/Profiles").subscribe(
/* this.http.get("/api/Account/Profiles").subscribe(
(data: any) => {
this.organizationName = data.organizationName
if (this.organizationName) {
@ -125,7 +125,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.dataSource.data = this.tree.toTree(this.treedata);
}
}
)
) */
this.dataSource.data = this.tree.toTree(this.treedata);
}
//获得所有组织机构
@ -138,7 +139,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
)
}
//清空查询条件数据
clearSearch(){
this.zdysearch=''
this.js=''
}
//获得单位信息
@ -151,7 +156,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
data.items.forEach(element => {
if (element.id == this.route.snapshot.queryParams.companyId) {
this.unitData = element
console.log('单位列表信息', this.unitData)
//console.log('单位列表信息', this.unitData)
this.getTemplateData()
}
});
@ -161,6 +166,89 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
selectedItem: string = '封面'
async clickTitleItem(item) {
this.addNumber = -1
this.yinruData={
items:[]
}
this.yinJson={
//组织指挥
organizationCommands:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//社会联动
socialLinkages:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//勤务保障
serviceSupports:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//辅助决策
decisionSupports:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
}
this.js=''
this.zdysearch=''
this.selectedItem = item.groupName
if (this.selectedItem == '重点图示') {
this.getAllBuildings()
@ -168,6 +256,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.getRealPicture()
} else if (this.selectedItem == '单位概况') {
await this.getAllBuildings()
await this.getAllBuildingsInfo()
console.log(this.buildZong)
this.planTemplateData[1].building.forEach(element => {
element.body[0].attinf[0].olddata = this.unitData.usci
element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name
@ -175,6 +265,18 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
element.body[0].attinf[3].olddata = this.unitData.phone
element.body[0].attinf[4].olddata = this.unitData.organizationName
element.body[0].attinf[5].olddata = this.unitData.address
if(element.body[1].attinf!=undefined){
element.body[1].attinf.forEach(eBuild => {
this.buildZong.forEach(oldBuild => {
if(oldBuild.buildingBasicGroups.length>0){
oldBuild.buildingBasicGroups[0].propertyInfos.forEach(infodata => {
eBuild.olddata=infodata.propertyValue
});
}
});
});
}
});
this.planTemplateData[1].attribute[0].attinf[0].value=this.planTemplateData[1].attribute[0].attinf[0].olddata = this.unitData.usci
@ -183,6 +285,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData[1].attribute[0].attinf[3].value=this.planTemplateData[1].attribute[0].attinf[3].olddata = this.unitData.phone
this.planTemplateData[1].attribute[0].attinf[4].value=this.planTemplateData[1].attribute[0].attinf[4].olddata = this.unitData.organizationName
this.planTemplateData[1].attribute[0].attinf[5].value=this.planTemplateData[1].attribute[0].attinf[5].olddata = this.unitData.address
console.log(this.planTemplateData)
} /* else if (this.selectedItem == '单位概况') {
//this.getAllBuildings()
@ -191,6 +294,63 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
}
//获取建筑信息
buildingsData=[]
buildDataName
buildZong
//获得所有建筑信息
async getAllBuildingsInfo(){
const result = await new Promise((resolve) =>{
this.http.get("/api/Buildings",{
params:{
companyId:this.unitId
}
}).subscribe(async (data:any)=>{
this.buildDataName = data
for (let i = 0; i < data.length; i++){
this.http.get("/api/BuildingBasicInfos",{ // 循环请求当前单位建筑每一个建筑的信息保存到数组中
params:{
companyId :this.unitId,
buildingId:data[i].id,
buildingType:data[i].buildingTypes[0].id
}
}).subscribe((buildingsData:any)=>{
//console.log(buildingsData)
this.buildingsData.push(buildingsData[0])
resolve(this.buildingsData)
})
}
console.log(this.buildingsData)
if (this.planTemplateData[1].building == undefined) {
this.planTemplateData[1].building = []
if(this.planTemplateData[1].attribute[1].attinf!=undefined){
this.planTemplateData[1].attribute[1].attinf.forEach(pData => {
this.buildingsData.forEach((bDara,bi,bArr)=>{
if(bDara.buildingBasicGroups.length>0){
bDara.buildingBasicGroups[0].propertyInfos.forEach(bInfo => {
pData.propertyValue=pData.olddata=bInfo.propertyValue
});
}
})
});
}
for (var i = 0; i < this.buildDataName.length; i++) {
if (i == 0) {
this.planTemplateData[1].building.push({ name: this.buildDataName[i].name, body: this.planTemplateData[1].attribute, completed: true })
} else {
this.planTemplateData[1].building.push({ name: this.buildDataName[i].name, body: this.planTemplateData[1].attribute, completed: false })
}
}
}
})
})
//console.log(result)
this.buildZong=result
}
//获取当前单位的二维预案
TwoDPlanList: any
getTwoDPlanList() {
@ -205,10 +365,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
}
//获取实景图
allRealPicture
getRealPicture() {
@ -252,7 +408,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
//获得模板信息
getTemplateData() {
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
console.log('预案内容', data)
//console.log('预案内容', data)
this.planTemplateData = JSON.parse(data.webTextData).filter(item =>
item.completed == true
)
@ -317,7 +473,408 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
}
//引入数据json
yinJson={
//组织指挥
organizationCommands:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//社会联动
socialLinkages:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//勤务保障
serviceSupports:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//辅助决策
decisionSupports:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
}
async yinRu(type){
if(type==0){
this.yinJson={
//组织指挥
organizationCommands:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//社会联动
socialLinkages:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//勤务保障
serviceSupports:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
//辅助决策
decisionSupports:{
tableCount: {
totalCount: 0,
tables: [
]
},
inputCount: {
totalCount: 0,
inputs: [
]
},
textAreaCount: {
totalCount: 0
},
treeCount: {
totalCount: 0
}
},
}
var orgtableCount=0
var orginputCount=0
var orgtextAreaCount=0
var orgtreeCount=0
this.planTemplateData[4].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
orgtableCount++
this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgArr[orgi].tableth.length})
}else if(orgArr[orgi].level=='2'){
orginputCount++
this.yinJson.organizationCommands.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
orgtextAreaCount++
}else if(orgArr[orgi].level=='4'){
orgtreeCount++
}
});
this.yinJson.organizationCommands.tableCount.totalCount=orgtableCount
this.yinJson.organizationCommands.inputCount.totalCount=orginputCount
this.yinJson.organizationCommands.textAreaCount.totalCount=orgtextAreaCount
this.yinJson.organizationCommands.treeCount.totalCount=orgtreeCount
var shetableCount=0
var sheinputCount=0
var shetextAreaCount=0
var shetreeCount=0
this.planTemplateData[6].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
shetableCount++
//this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount})
}else if(orgArr[orgi].level=='2'){
sheinputCount++
this.yinJson.socialLinkages.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
shetextAreaCount++
}else if(orgArr[orgi].level=='4'){
shetreeCount++
}
});
this.yinJson.socialLinkages.tableCount.totalCount=shetableCount
this.yinJson.socialLinkages.inputCount.totalCount=sheinputCount
this.yinJson.socialLinkages.textAreaCount.totalCount=shetextAreaCount
this.yinJson.socialLinkages.treeCount.totalCount=shetreeCount
var qintableCount=0
var qininputCount=0
var qintextAreaCount=0
var qintreeCount=0
this.planTemplateData[7].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
qintableCount++
//this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount})
}else if(orgArr[orgi].level=='2'){
qininputCount++
this.yinJson.serviceSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
qintextAreaCount++
}else if(orgArr[orgi].level=='4'){
qintreeCount++
}
});
this.yinJson.serviceSupports.tableCount.totalCount=qintableCount
this.yinJson.serviceSupports.inputCount.totalCount=qininputCount
this.yinJson.serviceSupports.textAreaCount.totalCount=qintextAreaCount
this.yinJson.serviceSupports.treeCount.totalCount=qintreeCount
var futableCount=0
var fuinputCount=0
var futextAreaCount=0
var futreeCount=0
this.planTemplateData[9].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
futableCount++
//this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount})
}else if(orgArr[orgi].level=='2'){
fuinputCount++
this.yinJson.decisionSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
futextAreaCount++
}else if(orgArr[orgi].level=='4'){
futreeCount++
}
});
this.yinJson.decisionSupports.tableCount.totalCount=futableCount
this.yinJson.decisionSupports.inputCount.totalCount=fuinputCount
this.yinJson.decisionSupports.textAreaCount.totalCount=futextAreaCount
this.yinJson.decisionSupports.treeCount.totalCount=futreeCount
}
if(type==5){
var orgtableCount=0
var orginputCount=0
var orgtextAreaCount=0
var orgtreeCount=0
this.planTemplateData[4].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
orgtableCount++
this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgArr[orgi].tableth.length})
}else if(orgArr[orgi].level=='2'){
orginputCount++
this.yinJson.organizationCommands.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
orgtextAreaCount++
}else if(orgArr[orgi].level=='4'){
orgtreeCount++
}
});
this.yinJson.organizationCommands.tableCount.totalCount=orgtableCount
this.yinJson.organizationCommands.inputCount.totalCount=orginputCount
this.yinJson.organizationCommands.textAreaCount.totalCount=orgtextAreaCount
this.yinJson.organizationCommands.treeCount.totalCount=orgtreeCount
this.yinJson.decisionSupports=null
this.yinJson.serviceSupports=null
this.yinJson.socialLinkages=null
}if(type==7){
var orgtableCount=0
var orginputCount=0
var orgtextAreaCount=0
var orgtreeCount=0
this.planTemplateData[6].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
orgtableCount++
//this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount})
}else if(orgArr[orgi].level=='2'){
orginputCount++
this.yinJson.socialLinkages.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
orgtextAreaCount++
}else if(orgArr[orgi].level=='4'){
orgtreeCount++
}
});
this.yinJson.socialLinkages.tableCount.totalCount=orgtableCount
this.yinJson.socialLinkages.inputCount.totalCount=orginputCount
this.yinJson.socialLinkages.textAreaCount.totalCount=orgtextAreaCount
this.yinJson.socialLinkages.treeCount.totalCount=orgtreeCount
this.yinJson.serviceSupports=null
this.yinJson.organizationCommands=null
this.yinJson.decisionSupports=null
}if(type==8){
var orgtableCount=0
var orginputCount=0
var orgtextAreaCount=0
var orgtreeCount=0
this.planTemplateData[7].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
orgtableCount++
//this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount})
}else if(orgArr[orgi].level=='2'){
orginputCount++
this.yinJson.serviceSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
orgtextAreaCount++
}else if(orgArr[orgi].level=='4'){
orgtreeCount++
}
});
this.yinJson.serviceSupports.tableCount.totalCount=orgtableCount
this.yinJson.serviceSupports.inputCount.totalCount=orginputCount
this.yinJson.serviceSupports.textAreaCount.totalCount=orgtextAreaCount
this.yinJson.serviceSupports.treeCount.totalCount=orgtreeCount
this.yinJson.decisionSupports=null
this.yinJson.organizationCommands=null
this.yinJson.socialLinkages=null
}if(type==10){
var orgtableCount=0
var orginputCount=0
var orgtextAreaCount=0
var orgtreeCount=0
this.planTemplateData[9].attribute.forEach((orgvalue,orgi,orgArr) => {
if(orgArr[orgi].level=='1'){
orgtableCount++
//this.yinJson.organizationCommands.tableCount.tables.push({itemCount:orgtableCount})
}else if(orgArr[orgi].level=='2'){
orginputCount++
this.yinJson.decisionSupports.inputCount.inputs.push({colCount:orgArr[orgi].lieNumber,rowCount:orgArr[orgi].hNumber})
}else if(orgArr[orgi].level=='3'){
orgtextAreaCount++
}else if(orgArr[orgi].level=='4'){
orgtreeCount++
}
});
this.yinJson.decisionSupports.tableCount.totalCount=orgtableCount
this.yinJson.decisionSupports.inputCount.totalCount=orginputCount
this.yinJson.decisionSupports.textAreaCount.totalCount=orgtextAreaCount
this.yinJson.decisionSupports.treeCount.totalCount=orgtreeCount
this.yinJson.organizationCommands=null
this.yinJson.serviceSupports=null
this.yinJson.socialLinkages=null
}
console.log(this.yinJson)
}
//查询能引入的预案
yinruData={
items:[]
}
searchYuan(){
this.yinRu(this.selectedItem=='组织指挥'?5:this.selectedItem=='社会联动'?7:this.selectedItem=='勤务保障'?8:10)
//console.log(JSON.stringify(this.yinJson))
var urlbm=encodeURI(JSON.stringify(this.yinJson))
let paramsdata:any={
planCategory:this.planLevel,
buildingTypeId :this.route.snapshot.queryParams.unitTypeId,
OrganizationId:this.searchType=='0'?'':this.jsId,
CustomKeyword:this.searchType=='0'?this.zdysearch:'',
webTextStatistics:urlbm,
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
}
this.http.get("/api/PlanComponents/WebText",{params:paramsdata}).subscribe((data:any)=>{
this.yinruData=null
this.yinruData=data
if(this.yinruData.items.length==0){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无数据', '确定', config);
}
//console.log(this.yinruData)
})
}
//可引入预案点击事件
clickYinru(clicki){
const dialogRef = this.dialog.open(yinYong, {
width: '750px',
height: '700px',
//disableClose: true
data: {selectedItem:this.selectedItem,yinruData:this.yinruData.items[clicki].webTextData}
});
dialogRef.afterClosed().subscribe(result => {
console.log(result)
if(result!=undefined){
this.planTemplateData.forEach(element => {
if(element.groupName==this.selectedItem){
element.attribute=result
}
});
}
}
);
}
//分页事件
changePage(e) {
this.PageNumber = e.pageIndex + 1
this.searchYuan()
}
//重点图示增加分组
addkeyImgItem(item) {
@ -419,7 +976,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
})
})
this.allBuildings = data
if (this.planTemplateData[1].building == undefined) {
/* if (this.planTemplateData[1].building == undefined) {
this.planTemplateData[1].building = []
for (var i = 0; i < this.allBuildings.length; i++) {
if (i == 0) {
@ -429,10 +986,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}
}
}
//console.log(this.planTemplateData)
//this.buildingName=this.planTemplateData[1].building[0].name
} */
this.group = this.planTemplateData[1].building
//delete this.planTemplateData[0].attribute
@ -642,10 +1196,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.pattern = 'edit'
}
//提交
submit() {
console.log('提交信息', this.planTemplateData)
async submit() {
await this.yinRu(0)
//console.log('提交信息', this.planTemplateData)
let body = {
webTextData: JSON.stringify(this.planTemplateData)
webTextData: JSON.stringify(this.planTemplateData),
webTextStatistics:this.yinJson
}
this.http.put(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}`, body).subscribe(data => {
// console.log('提交成功',data)
@ -748,4 +1304,50 @@ export class OpenPlanToolDialog {
this.dialogRef.close()
}
}
//查看引用
@Component({
selector: 'yinYong',
templateUrl: './yinyong.html',
styleUrls: ['./create-plan-online-five.component.scss']
})
export class yinYong{
constructor(public http: HttpClient, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<yinYong>,
@Inject(MAT_DIALOG_DATA) public data, public dialog: MatDialog) { }
ngOnInit(){
this.selectedItem=this.data.selectedItem
this.planTemplateData=JSON.parse(this.data.yinruData)
this.yinData()
console.log(this.planTemplateData)
}
selectedItem//传来的组织指挥或者。。。
planTemplateData//传来的数据
selectData
xuanze:boolean
//imgUrl
//看看查的是哪个标题下的内容
yinData(){
this.planTemplateData.forEach((pvale,pi,parr) => {
if(pvale.groupName==this.selectedItem){
this.selectData=pvale.attribute
}
});
}
trackByFn(index) {
return index
}
//关闭弹窗
closeDiv() {
let isTrue = confirm('您确定要引用该条预案吗')
if(isTrue){
this.xuanze=true
this.dialogRef.close(this.selectData)
}
else{
this.xuanze=false
this.dialogRef.close()
}
}
}

75
src/app/plan-management/create-plan-online-five/yinyong.html

@ -0,0 +1,75 @@
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2021-08-10 14:15:43
* @LastEditors: sueRimn
* @LastEditTime: 2021-08-11 14:31:15
-->
<div class="yinrubox">
<div class="yinruboxHead">
<span>{{selectedItem}}</span>
<button mat-raised-button color="primary" (click)='closeDiv()'>引入</button>
</div>
<div class="boxBody" *ngFor="let element of selectData;let i=index" >
<div class="boxBodyHead" >
<span style="font-size: 16px;
text-align: center;
color: #b99a00;">{{element.headName}}</span>
</div>
<div class="body">
<table *ngIf="element.level==1" style="width: 100%;border-collapse: collapse;">
<thead>
<th *ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn" style="border: 1px solid #999;
height: 40px;
font-size: 16px;
text-align: center;">
{{element.tableth[tablethi]}}
</th>
</thead>
<tbody>
<tr *ngFor="let itemtr of element.tabletr">
<td
*ngFor="let itemtd of itemtr.tabletd;let tabletdi=index;TrackBy:trackByFn">
{{itemtr.tabletd[tabletdi]}}
</td>
</tr>
</tbody>
</table>
<textarea style="width: 99%;height: 100px;" *ngIf="element.level==3"
[value]="element.tableth" disabled></textarea>
<div class="inputtext" *ngIf="element.level==2">
<div class="inputj"
*ngFor="let itemth of element.tableth;let tablethi=index;TrackBy:trackByFn">
<div
*ngFor="let itemthj of element.tableth[tablethi];let tablethj=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容"
style="background-color: #E8E9E9;width: 40%;"
[(ngModel)]="itemthj.head" disabled>
<input type="text" placeholder="请输入内容" style="width: 60%;"
[(ngModel)]="itemthj.body" disabled>
</div>
</div>
</div>
<div class="keyImg" *ngIf="element.level==4">
<div class="keyImgImg">
<div style="margin-top: 10px;
text-align: center;
position: relative;" class="imgbox" *ngFor="let imgUrl of element.tableth.json;let imgkey = index">
<img style="max-width: 100%;
width: auto;
height: auto;" [src]="imgUrl" alt="">
</div>
</div>
</div>
</div>
</div>
</div>

34
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -106,7 +106,6 @@ export class EntryPlanLookComponent implements OnInit {
}
//查看预案
lookPlan(e) {
console.log(e)
if (e.planType == 16 || e.planType == 4 || e.planType == 8) {
if (e.planType == 16&&e.attachmentUrls == null){
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}&pattern=false`)
@ -161,7 +160,11 @@ export class EntryPlanLookComponent implements OnInit {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
window.open(`/planManagement/webLook`)
if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=false`)
} else {
window.open(`/planManagement/webLook`)
}
}
}
}
@ -203,8 +206,18 @@ export class EntryPlanLookComponent implements OnInit {
}
}
else {
else if (e.planType == 2) { //三维预案
if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`)
} else {
window.open(`/planManagement/webLook`)
}
}
} else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
}
} else {
@ -243,7 +256,18 @@ export class EntryPlanLookComponent implements OnInit {
}
}
else {
else if (e.planType == 2) { //三维预案
if (e.url.indexOf('app') == 0) {
window.location.href = e.url
} else {
sessionStorage.setItem("url", e.url)
if ((e.url as string).includes('gis/threeDimensionalHome')) { //三维预案
window.open(`${e.url}?unitId=${this.companyId}&unitName=${this.unitdata.unitname}&editMode=true`)
} else {
window.open(`/planManagement/webLook`)
}
}
} else {
this.snackBar.open('只有二维预案和文本预案可以编辑!', '确定', config);
}

3
src/app/plan-management/plan-management.module.ts

@ -69,11 +69,12 @@ import { CreatePlanOnlineThreeComponent } from './create-plan-online-three/creat
import { UiModule } from '../ui/ui.module';
import { TreeDiagramModule } from '../ui/ng-tree-diagram/src/ng-tree-diagram';
import { KeyUnitModule } from '../key-unit/key-unit.module';
import { yinYong } from './create-plan-online-five/create-plan-online-five.component'
@NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
WebLookComponent, OnetwoEntryPlanComponent, newunitComponent, MeetPlanComponent, newunitMeet, TypePlanComponent, newunitType, PsViewer, onetwoAuditResult, meetAuditResult,
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, OpenPlanToolDialog],
typeAuditResult, MaintainUpComponent, GkPsViewer, GkhtmlPsViewer, UnitInfo, ReinforcePlanComponent, state, ImgDetails, CreatePlanOnlineFiveComponent, CreatePlanOnlineThreeComponent, OpenPlanToolDialog,yinYong],
imports: [
CommonModule,
PlanManagementRoutingModule,

29
src/app/ui/plan-template/plan-template.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-31 10:40:01
* @LastEditors: sueRimn
* @LastEditTime: 2021-08-04 15:30:24
* @LastEditTime: 2021-08-07 15:21:06
*/
import { Component, Inject, OnInit,ViewEncapsulation } from '@angular/core';
@ -139,7 +139,7 @@ export class PlanTemplateComponent implements OnInit {
width: '340px',
height:'340px',
disableClose:true,
data:{item:item,plandata:this.newleftTabledata}
data:{item:item,plandata:this.newleftTabledata,operation}
});
dialogRef.afterClosed().subscribe(async result => {
console.log(result)
@ -867,16 +867,23 @@ getattinf(){
})
}else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){
this.addAttinfBuild=value.attinf
/* console.log(this.addAttinfBuild)
value.attinf.forEach((datavalue,index,dataarr) => {
this.addAttinfBuild.forEach((value,i,arr)=>{
if(dataarr[index].propertyName==arr[i].propertyName){
if(dataarr[index].completed==true&&arr[i].completed==false){
arr[i].completed= dataarr[index].completed
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId
}
this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{
this.addAttinfBuild=data[0].propertyInfos
this.addAttinfBuild.forEach((element,ei,earr) => {
value.attinf.forEach((elattinf,fi,farr) => {
if(earr[ei].propertyName==farr[fi].propertyName){
earr[ei].completed=farr[fi].completed
}
}
})
}); */
});
element.olddata=element.propertyValue
});
console.log(this.addAttinfBuild)
})
}else if(value.surveyName=='消防设施'&&value.attinf==undefined){
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId

5
src/app/ui/plan-template/upPlan.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-21 10:43:28
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-15 10:47:09
* @LastEditTime: 2021-08-07 15:04:56
-->
<!--
* @Descripttion:
@ -16,7 +16,8 @@
-->
<div class="box">
<div class="top">
<span style="font-size: 20px;">修改预案模板</span>
<span style="font-size: 20px;" *ngIf="data.operation=='edit'">修改预案模板</span>
<span style="font-size: 20px;" *ngIf="data.operation=='copy'">复制预案模板</span>
</div>
<!-- <div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>

204
src/app/working-area/model/axImageShape.ts

@ -93,7 +93,9 @@ export class AxImageShape extends AxShape {
this.up.on('pointerdown', event => {
this.upDrag = true;
this.image.anchor.set(0.5, 1);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
this.position.set(this.x, this.y + this.image.height * 0.5);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.up.on('pointermove', event => {
@ -104,6 +106,7 @@ export class AxImageShape extends AxShape {
var dY = Math.abs(pos.y - this.image.y);
this.assetData.Height = Math.abs(dY);
this.refresh();
this.text.y = this.image.y - this.image.height / 2;
AxMessageSystem.send(EVENT_IMAGE_RESIZE, this.assetData);
}
@ -112,14 +115,18 @@ export class AxImageShape extends AxShape {
if (this.upDrag) {
this.upDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x, this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.up.on('pointerupoutside', event => {
if (this.upDrag) {
this.upDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x, this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.up.visible = false;
@ -132,7 +139,9 @@ export class AxImageShape extends AxShape {
this.down.on('pointerdown', event => {
this.downDrag = true;
this.image.anchor.set(0.5, 0);
this.image.position.set(this.image.position.x, this.image.position.y - (this.image.height / 2));
this.position.set(this.x, this.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.down.on('pointermove', event => {
@ -151,14 +160,18 @@ export class AxImageShape extends AxShape {
if (this.downDrag) {
this.downDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
this.position.set(this.x, this.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.down.on('pointerupoutside', event => {
if (this.downDrag) {
this.downDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x, this.image.position.y + (this.image.height / 2));
this.position.set(this.x, this.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.down.visible = false;
@ -171,7 +184,9 @@ export class AxImageShape extends AxShape {
this.left.on('pointerdown', event => {
this.leftDrag = true;
this.image.anchor.set(1, 0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x + (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.left.on('pointermove', event => {
@ -190,14 +205,18 @@ export class AxImageShape extends AxShape {
if (this.leftDrag) {
this.leftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x - (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.left.on('pointerupoutside', event => {
if (this.leftDrag) {
this.leftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x - (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.left.visible = false;
@ -210,7 +229,9 @@ export class AxImageShape extends AxShape {
this.right.on('pointerdown', event => {
this.rightDrag = true;
this.image.anchor.set(0, 0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x - (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.right.on('pointermove', event => {
@ -229,14 +250,18 @@ export class AxImageShape extends AxShape {
if (this.rightDrag) {
this.rightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x + (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.right.on('pointerupoutside', event => {
if (this.rightDrag) {
this.rightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y);
this.position.set(this.position.x + (this.image.width / 2), this.position.y);
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.right.visible = false;
@ -249,7 +274,9 @@ export class AxImageShape extends AxShape {
this.upLeft.on('pointerdown', event => {
this.upLeftDrag = true;
this.image.anchor.set(1);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.upLeft.on('pointermove', event => {
@ -271,14 +298,18 @@ export class AxImageShape extends AxShape {
if (this.upLeftDrag) {
this.upLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upLeft.on('pointerupoutside', event => {
if (this.upLeftDrag) {
this.upLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upLeft.visible = false;
@ -291,7 +322,9 @@ export class AxImageShape extends AxShape {
this.upRight.on('pointerdown', event => {
this.upRightDrag = true;
this.image.anchor.set(0, 1);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.upRight.on('pointermove', event => {
@ -313,14 +346,18 @@ export class AxImageShape extends AxShape {
if (this.upRightDrag) {
this.upRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upRight.on('pointerupoutside', event => {
if (this.upRightDrag) {
this.upRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.upRight.visible = false;
@ -333,7 +370,9 @@ export class AxImageShape extends AxShape {
this.downLeft.on('pointerdown', event => {
this.downLeftDrag = true;
this.image.anchor.set(1, 0);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.downLeft.on('pointermove', event => {
@ -355,14 +394,18 @@ export class AxImageShape extends AxShape {
if (this.downLeftDrag) {
this.downLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downLeft.on('pointerupoutside', event => {
if (this.downLeftDrag) {
this.downLeftDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downLeft.visible = false;
@ -375,7 +418,9 @@ export class AxImageShape extends AxShape {
this.downRight.on('pointerdown', event => {
this.downRightDrag = true;
this.image.anchor.set(0, 0);
this.image.position.set(this.image.position.x - (this.image.width / 2), this.image.position.y - (this.image.height / 2));
this.position.set(this.position.x - (this.image.width / 2), this.position.y - (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
event.stopPropagation();
});
this.downRight.on('pointermove', event => {
@ -397,14 +442,18 @@ export class AxImageShape extends AxShape {
if (this.downRightDrag) {
this.downRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downRight.on('pointerupoutside', event => {
if (this.downRightDrag) {
this.downRightDrag = false;
this.image.anchor.set(0.5);
this.image.position.set(this.image.position.x + (this.image.width / 2), this.image.position.y + (this.image.height / 2));
this.position.set(this.position.x + (this.image.width / 2), this.position.y + (this.image.height / 2));
this.assetData.Point = new PIXI.Point(this.x, this.y);
this.drawBorder();
}
});
this.downRight.visible = false;
@ -422,7 +471,8 @@ export class AxImageShape extends AxShape {
* @param value
*/
public setPointVisiable(value: boolean) {
const rect = this.getLocalBounds();
const rect1 = this.image.getLocalBounds();
const rect = new Rectangle(rect1.x * this.image.scale.x, rect1.y * this.image.scale.y, rect1.width * this.image.scale.x, rect1.height * this.image.scale.y);
this.up.x = rect.right - rect.width / 2;
this.up.y = rect.top;
this.down.x = rect.right - rect.width / 2;
@ -452,28 +502,28 @@ export class AxImageShape extends AxShape {
*
* @param scale
*/
public drawBorder(scale: number) {
public drawBorder() {
const visible = this.upLeft.visible;
this.setPointVisiable(false);
const scale = this.assetData.FixedSize ? 1 : 1 / this.workingArea.backgroundImage.scale.x;
this.border.clear();
const rect1 = this.image.getLocalBounds();
const rect = new Rectangle(rect1.x * this.image.scale.x, rect1.y * this.image.scale.y, rect1.width * this.image.scale.x, rect1.height * this.image.scale.y);
const p1 = new PIXI.Point(rect.left, rect.top);
const p2 = new PIXI.Point(rect.right, rect.top);
const p3 = new PIXI.Point(rect.right, rect.bottom);
const p4 = new PIXI.Point(rect.left, rect.bottom);
this.border.lineStyle(scale * 1, 0x00a8ff);
const spaceLength = scale * 1;
const lineLenght = rect.width + 0.5 + 0.5;
const dashLength = scale * (lineLenght + spaceLength - Math.floor((rect.width + rect.height) / 2 / 4.1)) / Math.floor((rect.width + rect.height) / 2 / 4.1);
this.drawDash(this.border, p1.x - 0.5 * scale, p1.y, p2.x + 0.5 * scale, p2.y, dashLength, spaceLength);
this.drawDash(this.border, p2.x, p2.y - 0.5 * scale, p3.x, p3.y + 0.5 * scale, dashLength, spaceLength);
this.drawDash(this.border, p3.x + 0.5 * scale, p3.y, p4.x - 0.5 * scale, p4.y, dashLength, spaceLength);
this.drawDash(this.border, p4.x, p4.y + 0.5 * scale, p1.x, p1.y - 0.5 * scale, dashLength, spaceLength);
super.drawBorder(scale);
const rect = this.getLocalBounds();
this.up.x = rect.right - rect.width / 2;
this.up.y = rect.top;
this.down.x = rect.right - rect.width / 2;
this.down.y = rect.bottom;
this.left.x = rect.left;
this.left.y = rect.bottom - rect.height / 2;
this.right.x = rect.right;
this.right.y = rect.bottom - rect.height / 2;
this.upLeft.x = rect.left;
this.upLeft.y = rect.top;
this.upRight.x = rect.right;
this.upRight.y = rect.top;
this.downLeft.x = rect.left;
this.downLeft.y = rect.bottom;
this.downRight.x = rect.right;
this.downRight.y = rect.bottom;
this.setPointVisiable(visible);
}
public setItemScale(scale: number) {
@ -501,41 +551,41 @@ export class AxImageShape extends AxShape {
+ this.assetData.PropertyInfos?.find(item => item.PropertyName === '名称/编号')?.PropertyValue;
if (this.image.anchor.x == 0) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y - this.image.height / 2;
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x + this.image.width / 2;
this.text.y = this.image.y - this.image.height;
}
// if (this.image.anchor.x == 0) {
// if (this.image.anchor.y == 0) {
// this.text.x = this.image.x + this.image.width / 2;
// this.text.y = this.image.y;
// } else if (this.image.anchor.y == 0.5) {
// this.text.x = this.image.x + this.image.width / 2;
// this.text.y = this.image.y - this.image.height / 2;
// } else if (this.image.anchor.y == 1) {
// this.text.x = this.image.x + this.image.width / 2;
// this.text.y = this.image.y - this.image.height;
// }
} else if (this.image.anchor.x == 0.5) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
// } else if (this.image.anchor.x == 0.5) {
// if (this.image.anchor.y == 0) {
// this.text.x = this.image.x;
// this.text.y = this.image.y;
// } else if (this.image.anchor.y == 0.5) {
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x;
this.text.y = this.image.y - this.image.height;
}
} else if (this.image.anchor.x == 1) {
if (this.image.anchor.y == 0) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y;
} else if (this.image.anchor.y == 0.5) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y - this.image.height / 2;
} else if (this.image.anchor.y == 1) {
this.text.x = this.image.x - this.image.width / 2;
this.text.y = this.image.y - this.image.height;
}
}
// } else if (this.image.anchor.y == 1) {
// this.text.x = this.image.x;
// this.text.y = this.image.y - this.image.height;
// }
// } else if (this.image.anchor.x == 1) {
// if (this.image.anchor.y == 0) {
// this.text.x = this.image.x - this.image.width / 2;
// this.text.y = this.image.y;
// } else if (this.image.anchor.y == 0.5) {
// this.text.x = this.image.x - this.image.width / 2;
// this.text.y = this.image.y - this.image.height / 2;
// } else if (this.image.anchor.y == 1) {
// this.text.x = this.image.x - this.image.width / 2;
// this.text.y = this.image.y - this.image.height;
// }
// }
this.angle = -this.workingArea.backgroundImage.angle;
this.drawBorder(1 / this.workingArea.backgroundImage.scale.x);
this.drawBorder();
}
}

BIN
src/assets/images/yr.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Loading…
Cancel
Save