Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP53
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
OP53
Commits
8eb85009
Commit
8eb85009
authored
Feb 02, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表单数据刷新
parent
b81c6c74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
form.component.html
form/src/app/form/form.component.html
+2
-1
form.component.ts
form/src/app/form/form.component.ts
+54
-1
No files found.
form/src/app/form/form.component.html
View file @
8eb85009
...
@@ -183,7 +183,8 @@
...
@@ -183,7 +183,8 @@
<div
style=
"margin-right: 20px;width: 150px;text-align: right;"
>
<div
style=
"margin-right: 20px;width: 150px;text-align: right;"
>
<span
style=
"line-height: 55px;"
>
文字分组
</span>
<span
style=
"line-height: 55px;"
>
文字分组
</span>
</div>
</div>
<div
style=
"display: flex; justify-items: center; padding-top: 10px"
>
<div
*
ngIf=
"item.titleGroup.length<item.title.length"
style=
"display: flex; justify-items: center; padding-top: 10px"
>
<button
style=
"margin-bottom: 10px;"
nz-button
nzType=
"default"
(
click
)="
addGroup
(
i
)"
>
<button
style=
"margin-bottom: 10px;"
nz-button
nzType=
"default"
(
click
)="
addGroup
(
i
)"
>
<span>
增加分组
</span>
<span>
增加分组
</span>
</button>
</button>
...
...
form/src/app/form/form.component.ts
View file @
8eb85009
...
@@ -186,19 +186,72 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
...
@@ -186,19 +186,72 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
deleteGroup
(
i
,
n
)
{
deleteGroup
(
i
,
n
)
{
let
item
=
this
.
picArr
.
list
[
i
];
let
item
=
this
.
picArr
.
list
[
i
];
item
.
titleGroup
.
splice
(
n
,
1
);
item
.
titleGroup
.
splice
(
n
,
1
);
let
delArr
=
item
.
titleGroupUseWord
[
n
];
item
.
titleGroupUseWord
.
forEach
((
arr
,
index
)
=>
{
if
(
index
==
n
)
return
;
for
(
let
m
=
0
;
m
<
delArr
.
length
;
m
++
)
{
if
(
delArr
[
m
]
==
0
)
arr
[
m
]
=
0
;
}
})
item
.
titleGroupUseWord
.
splice
(
n
,
1
);
let
lastArr
=
[];
item
.
titleGroupUseWord
.
forEach
((
arr
,
index
)
=>
{
for
(
let
m
=
0
;
m
<
arr
.
length
;
m
++
)
{
if
(
arr
[
m
]
==
1
)
{
lastArr
[
m
]
=
1
;
}
else
{
if
(
lastArr
[
m
]
!=
1
)
{
lastArr
[
m
]
=
0
;
}
}
}
})
item
.
titleGroupUseWord
.
push
(
lastArr
);
if
(
item
.
titleGroup
.
length
==
0
)
item
.
titleGroupUseWord
.
length
=
0
;
this
.
save
();
this
.
save
();
}
}
onChoseGroup
(
arr
,
i
,
val
,
item
,
n
)
{
onChoseGroup
(
arr
,
i
,
val
,
item
,
n
)
{
console
.
log
(
arr
);
console
.
log
(
arr
);
arr
[
i
]
=
val
;
arr
[
i
]
=
val
;
for
(
let
index
=
0
;
index
<
item
.
title
.
split
(
""
).
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
item
.
title
.
split
(
""
).
length
;
index
++
)
{
if
(
n
==
index
)
continue
;
if
(
n
==
index
)
{
if
(
!
item
.
titleGroupUseWord
[
index
])
item
.
titleGroupUseWord
[
index
]
=
[];
item
.
titleGroupUseWord
[
index
][
i
]
=
0
;
console
.
log
(
item
.
titleGroupUseWord
[
index
])
continue
;
}
if
(
!
item
.
titleGroupUseWord
[
index
])
item
.
titleGroupUseWord
[
index
]
=
[];
if
(
!
item
.
titleGroupUseWord
[
index
])
item
.
titleGroupUseWord
[
index
]
=
[];
item
.
titleGroupUseWord
[
index
][
i
]
=
val
;
item
.
titleGroupUseWord
[
index
][
i
]
=
val
;
}
}
this
.
save
();
this
.
save
();
}
}
// refreshUserWord(item) {
// let tg = item.titleGroup;
// tg.forEach((t, n) => {
// let inx = t.index;
// if (inx.length < item.title.split("").length) inx.length = item.title.split("").length;
// for (let i = 0; i < inx.length; i++) {
// let u = inx[i];
// this.updateUserWord(u, i, item)
// }
// })
// }
// updateUserWord(num, pos, item) {
// let uw = item.titleGroupUseWord;
// for (let i = 0; i < uw.length; i++) {
// let u = uw[i];
// if (!u) u = [];
// for (let j = 0; j < u.length; j++) {
// if (j == pos) {
// u[j] = num || 0;
// break;
// }
// }
// }
// }
...
...
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