Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP72
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
OP72
Commits
daa46f8c
Commit
daa46f8c
authored
Jan 11, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
e6ea94c9
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
209 additions
and
32 deletions
+209
-32
.DS_Store
.DS_Store
+0
-0
OP72.meta
assets/OP72.meta
+15
-1
OP72.js
assets/OP72/scene/OP72.js
+13
-1
Unit.ts
form/src/app/common/custom-hot-zone/Unit.ts
+46
-0
custom-hot-zone.component.ts
...c/app/common/custom-hot-zone/custom-hot-zone.component.ts
+78
-3
mult-rect.component.ts
form/src/app/common/mult-rect/mult-rect.component.ts
+4
-4
form.component.html
form/src/app/form/form.component.html
+25
-16
form.component.ts
form/src/app/form/form.component.ts
+28
-7
No files found.
.DS_Store
View file @
daa46f8c
No preview for this file type
assets/OP72.meta
View file @
daa46f8c
{"ver":"1.1.2","uuid":"5bbfa58c-397c-411f-b8e0-56870acd31fc","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "5bbfa58c-397c-411f-b8e0-56870acd31fc",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/OP72/scene/OP72.js
View file @
daa46f8c
This diff is collapsed.
Click to expand it.
form/src/app/common/custom-hot-zone/Unit.ts
View file @
daa46f8c
...
...
@@ -2141,6 +2141,52 @@ export class HotZoneItem extends MySprite {
}
}
export
class
HotZoneMultRect
extends
HotZoneItem
{
item
;
drawLine
()
{
if
(
!
this
.
item
)
{
return
;
}
this
.
ctx
.
save
();
const
rect
=
this
.
getBoundingBox
();
const
w
=
rect
.
width
;
const
h
=
rect
.
height
;
const
x
=
rect
.
x
//+ w / 2;
const
y
=
rect
.
y
//+ h / 2;
this
.
ctx
.
setLineDash
([
4
,
4
]);
this
.
ctx
.
lineWidth
=
1
;
this
.
ctx
.
strokeStyle
=
'
#ffa568
'
;
this
.
ctx
.
beginPath
();
this
.
ctx
.
moveTo
(
x
+
w
/
2
,
y
+
h
/
2
);
this
.
ctx
.
lineTo
(
this
.
item
.
x
,
this
.
item
.
y
);
// this.ctx.fill();
this
.
ctx
.
stroke
();
this
.
ctx
.
restore
();
}
draw
()
{
super
.
draw
();
if
(
this
.
lineDashFlag
)
{
this
.
drawLine
();
}
}
}
export
class
HotZoneImg
extends
MySprite
{
drawFrame
()
{
...
...
form/src/app/common/custom-hot-zone/custom-hot-zone.component.ts
View file @
daa46f8c
...
...
@@ -14,7 +14,7 @@ import {
}
from
'
@angular/core
'
;
import
{
Subject
}
from
'
rxjs
'
;
import
{
debounceTime
,
retryWhen
}
from
'
rxjs/operators
'
;
import
{
DragItem
,
EditorItem
,
HotZoneImg
,
HotZoneItem
,
HotZoneLabel
,
Label
,
MySprite
,
removeItemFromArr
,
ShapeCircle
,
ShapeRect
,
ShapeRectNew
}
from
'
./Unit
'
;
import
{
DragItem
,
EditorItem
,
HotZoneImg
,
HotZoneItem
,
HotZoneLabel
,
HotZoneMultRect
,
Label
,
MySprite
,
removeItemFromArr
,
ShapeCircle
,
ShapeRect
,
ShapeRectNew
}
from
'
./Unit
'
;
import
TWEEN
from
'
@tweenjs/tween.js
'
;
import
{
getMinScale
}
from
'
../../play/Unit
'
;
import
{
tar
}
from
'
compressing
'
;
...
...
@@ -500,9 +500,50 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
setItemMultRect
(
item
,
saveData
)
{
if
(
saveData
&&
saveData
.
itemMultRect
)
{
console
.
log
(
"
in setItemMultRect
"
)
if
(
saveData
&&
saveData
.
multRect
)
{
this
.
setItemMultRectByData
(
item
,
saveData
.
multRect
);
console
.
log
(
"
multRect ~
"
,
saveData
.
multRect
);
}
}
setItemMultRectByData
(
item
,
multRectArr
)
{
const
arr
=
[];
for
(
let
i
=
0
;
i
<
multRectArr
.
length
;
i
++
)
{
const
multRectData
=
multRectArr
[
i
];
const
multRect
=
new
HotZoneMultRect
(
this
.
ctx
);
multRect
.
showLineDash
();
multRect
.
setSize
(
multRectData
.
width
,
multRectData
.
height
);
multRect
.
anchorX
=
0.5
;
multRect
.
anchorY
=
0.5
;
multRect
.
rectEdgeColor
=
multRectData
.
color
;
multRect
.
showLabel
(
"
M-
"
+
(
i
+
1
));
multRect
.
item
=
item
;
multRect
.
visible
=
true
;
if
(
multRectData
.
x
==
-
1
&&
multRectData
.
y
==
-
1
)
{
multRect
.
x
=
item
.
x
+
multRect
.
width
*
i
*
0.3
;
multRect
.
y
=
item
.
y
+
multRect
.
width
*
i
*
0.3
;
}
else
{
multRect
.
x
=
multRectData
.
x
;
multRect
.
y
=
multRectData
.
y
;
}
this
.
renderArr
.
push
(
multRect
);
arr
.
push
(
multRect
);
}
item
.
multRectArr
=
arr
;
}
...
...
@@ -917,6 +958,22 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
}
// 检测多矩形
for
(
let
i
=
this
.
hotZoneArr
.
length
-
1
;
i
>=
0
;
i
--
)
{
const
item
=
this
.
hotZoneArr
[
i
];
if
(
item
&&
item
.
multRectArr
)
{
for
(
let
j
=
item
.
multRectArr
.
length
-
1
;
j
>=
0
;
j
--
)
{
if
(
this
.
checkClickTarget
(
item
.
multRectArr
[
j
]))
{
this
.
clickedMultRect
(
item
.
multRectArr
[
j
]);
return
;
}
}
}
}
for
(
let
i
=
this
.
hotZoneArr
.
length
-
1
;
i
>=
0
;
i
--
)
{
...
...
@@ -1801,6 +1858,23 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}
}
private
clickedMultRect
(
multRect
:
any
)
{
if
(
this
.
checkClickTarget
(
multRect
))
{
if
(
multRect
.
lineDashFlag
&&
this
.
checkClickTarget
(
multRect
.
arrow
))
{
this
.
changeItemSize
(
multRect
);
}
else
if
(
multRect
.
lineDashFlag
&&
this
.
checkClickTarget
(
multRect
.
arrowTop
))
{
this
.
changeItemTopSize
(
multRect
);
}
else
if
(
multRect
.
lineDashFlag
&&
this
.
checkClickTarget
(
multRect
.
arrowRight
))
{
this
.
changeItemRightSize
(
multRect
);
}
else
{
this
.
changeCurItem
(
multRect
);
}
return
;
}
}
clickedDragPoint
(
item
)
{
this
.
curItem
=
item
;
}
...
...
@@ -1855,6 +1929,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
onMultRectSave
(
e
,
item
)
{
console
.
log
(
'
in onMultRectSave:
'
,
e
);
item
.
multRect
=
e
;
this
.
setItemMultRectByData
(
item
,
item
.
multRect
);
}
...
...
form/src/app/common/mult-rect/mult-rect.component.ts
View file @
daa46f8c
...
...
@@ -65,10 +65,10 @@ export class MultRectComponent implements OnDestroy, OnChanges {
this
.
rectArr
.
push
(
{
color
:
this
.
colorArr
[
0
].
color
,
width
:
2
0
,
height
:
2
0
,
x
:
20
,
y
:
20
,
width
:
10
0
,
height
:
10
0
,
x
:
-
1
,
y
:
-
1
,
}
)
...
...
form/src/app/form/form.component.html
View file @
daa46f8c
...
...
@@ -282,25 +282,28 @@
</div>
</div>
<div
style=
"margin-top: 30px;"
></div>
<h2>
标记组合并识别设置(选填):
</h2>
<div
style=
"padding: 10px; border: 2px solid #ccc; border-radius: 10px; width: 350px;"
>
<div
*
ngIf=
"checkHasCombineGroup()"
style=
"position: relative;"
>
<button
nz-button
nzType=
"default"
nzShape=
"circle"
(
click
)="
addItemCombineGroup
()"
style=
"position: absolute; top: -40px; right: 0;"
>
<span
nz-icon
nzType=
"plus"
></span>
</button>
<div
style=
"margin-top: 40px;"
>
<div
*
ngFor=
"let cgItem of item.itemCombineGroup; let i = index"
style=
"width: 100%; padding-right: 50px; position: relative; margin-top: 10px;"
>
<nz-select
[(
ngModel
)]="
item
.
itemCombineGroup
[
i
]"
nzMode=
"multiple"
(
ngModelChange
)="
onItemCombineGroupChange
()"
nzPlaceHolder=
"Please select"
style=
"width: 100%;"
>
<nz-option
*
ngFor=
"let option of item.hotZoneItemArr2; let j = index"
[
nzLabel
]="'
sign-item-
'
+
(
j
+
1
)"
[
nzValue
]="
j
"
></nz-option>
</nz-select>
<button
nz-button
nzType=
"danger"
nzShape=
"circle"
(
click
)="
deleteItemCombineGroup
(
i
)"
style=
"position: absolute; right: 0;"
>
<span
nz-icon
nzType=
"delete"
></span>
</button>
<div
*
ngIf=
"hasCombineGroup"
>
<div
style=
"margin-top: 30px;"
></div>
<h2>
标记组合并识别设置(选填):
</h2>
<div
style=
"padding: 10px; border: 2px solid #ccc; border-radius: 10px; width: 350px;"
>
<div
*
ngIf=
"hasCombineGroup"
style=
"position: relative;"
>
<button
nz-button
nzType=
"default"
nzShape=
"circle"
(
click
)="
addItemCombineGroup
()"
style=
"position: absolute; top: -40px; right: 0;"
>
<span
nz-icon
nzType=
"plus"
></span>
</button>
<div
style=
"margin-top: 40px;"
>
<div
*
ngFor=
"let cgItem of item.itemCombineGroup; let i = index"
style=
"width: 100%; padding-right: 50px; position: relative; margin-top: 10px;"
>
<nz-select
[(
ngModel
)]="
item
.
itemCombineGroup
[
i
]"
nzMode=
"multiple"
(
ngModelChange
)="
onItemCombineGroupChange
()"
nzPlaceHolder=
"Please select"
style=
"width: 100%;"
>
<nz-option
*
ngFor=
"let option of item.hotZoneItemArr2; let j = index"
[
nzLabel
]="'
sign-item-
'
+
(
j
+
1
)"
[
nzValue
]="
j
"
></nz-option>
</nz-select>
<button
nz-button
nzType=
"danger"
nzShape=
"circle"
(
click
)="
deleteItemCombineGroup
(
i
)"
style=
"position: absolute; right: 0;"
>
<span
nz-icon
nzType=
"delete"
></span>
</button>
</div>
</div>
</div>
</div>
</div>
<div
style=
"margin-top: 30px;"
></div>
...
...
@@ -352,7 +355,13 @@
</div>
<div
style=
"margin-top: 30px; width: 300px; border: 1px solid #ccc ; border-radius: 5px;"
>
<div
style=
"display: flex; justify-content: center; align-items: center; height: 50px"
>
<span
style=
"width: 120px; margin-right: 10px;"
align=
"right"
>
帮助提示间隔(秒):
</span>
<input
type=
"text"
nz-input
[(
ngModel
)]="
item
.
helpTime
"
(
blur
)="
save
()"
style=
"margin-right: 15px; width: 100px "
>
</div>
</div>
<div
style=
"margin-top: 30px; width: 300px; height: 50px; border: 1px solid #ccc ; border-radius: 5px; display: flex; align-items: center; "
>
<div
style=
"display: flex; align-items: center; margin: 30px;"
>
...
...
form/src/app/form/form.component.ts
View file @
daa46f8c
...
...
@@ -171,8 +171,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
{
name
:
'
画圈区域
'
,
rect
:
true
,
isCopy
:
true
//
multRect : true
isCopy
:
true
,
multRect
:
true
},
{
...
...
@@ -216,6 +216,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
]
typeArr
=
[];
hasCombineGroup
=
false
;
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
...
...
@@ -277,6 +278,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
this
.
item
.
circleSize
=
'
1
'
;
}
if
(
this
.
item
.
helpTime
==
null
)
{
this
.
item
.
helpTime
=
10
;
}
this
.
checkHasCombineGroup
();
}
getAllGroupType
()
{
...
...
@@ -328,16 +333,28 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
}
checkHasCombineGroup
()
{
let
count
=
0
;
console
.
log
(
"
this.hasCombineGroup :
"
+
this
.
hasCombineGroup
);
this
.
hasCombineGroup
=
false
;
if
(
!
this
.
item
?.
hotZoneItemArr
)
{
return
false
;
return
;
}
let
count
=
0
;
this
.
item
.
hotZoneItemArr
.
forEach
(
item
=>
{
item
.
gIdx
==
'
4
'
;
count
++
;
if
(
item
.
gIdx
==
'
4
'
)
{
count
++
;
}
});
return
count
>
1
;
if
(
count
>=
1
)
{
this
.
hasCombineGroup
=
true
;
}
console
.
log
(
"
2 this.hasCombineGroup :
"
+
this
.
hasCombineGroup
);
}
onItemCombineGroupChange
()
{
...
...
@@ -429,8 +446,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
this
.
item
.
itemCombineGroup
=
[];
this
.
getAllGroupType
();
this
.
checkHasCombineGroup
();
this
.
save
();
}
saveHotZone2
(
group
,
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment