Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OPW25
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
OPW25
Commits
eab02d17
Commit
eab02d17
authored
Nov 24, 2021
by
唐鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整后台显示内容
parent
ecde648a
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
467 deletions
+81
-467
form.component.css
form/src/app/form/form.component.css
+2
-2
form.component.html
form/src/app/form/form.component.html
+30
-353
form.component.ts
form/src/app/form/form.component.ts
+49
-112
No files found.
form/src/app/form/form.component.css
View file @
eab02d17
...
...
@@ -14,8 +14,8 @@
justify-content
:
center
;
flex-direction
:
column
;
padding
:
10px
;
padding-bottom
:
2vw
;
padding-top
:
3vw
;
/*
padding-bottom: 2vw;
padding-top: 3vw;
*/
}
.pic-sound-box
{
...
...
form/src/app/form/form.component.html
View file @
eab02d17
This diff is collapsed.
Click to expand it.
form/src/app/form/form.component.ts
View file @
eab02d17
...
...
@@ -8,7 +8,10 @@ import { Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, A
})
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
picArr
=
[];
picArr
=
{
audio_url
:
""
,
list
:
[],
};
_item
:
any
;
KEY
=
'
hw_006
'
;
errs
=
[];
...
...
@@ -77,42 +80,30 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
item
.
contentObj
.
picArr
=
this
.
picArr
;
}
console
.
log
(
'
item:
'
,
this
.
item
);
// this.picArr = this.getDefaultPicArr();
// this.item.contentObj.picArr = this.picArr;
// console.log('this.item:;', this.picArr);
}
cardItemData
()
{
return
{
cardId
:
""
,
left
:
{
title
:
""
,
pic_url
:
""
,
audio_url
:
""
},
right
:
{
radioValue
:
"
1
"
,
title
:
""
,
pic_url
:
""
,
audio_url
:
""
}
};
}
getDefaultPicArr
()
{
let
obj
:
any
=
{};
let
arr
=
[];
arr
[
0
]
=
[];
arr
[
0
][
0
]
=
[];
//在卡片组之上需要增加 两个组 0根->picArr 1题组->testlet 2页面->page 3卡片对->itemData
//默认 题组1 页面1 卡片对2个
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
for
(
let
i
=
0
;
i
<
6
;
i
++
)
{
let
item
=
this
.
cardItemData
();
arr
[
0
][
0
]
.
push
(
item
);
arr
.
push
(
item
);
}
// for (let index = 0; index < 4; index++) {
// let item = this.cardItemData();
// arr.push(item);
// }
return
arr
;
obj
.
list
=
arr
;
obj
.
audio_url
=
""
;
return
obj
;
}
...
...
@@ -134,60 +125,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this
.
save
();
}
//添加一对
addItem
(
m
,
n
)
{
//最多5对
if
(
this
.
picArr
[
m
][
n
].
length
<
5
)
{
let
item
=
this
.
cardItemData
();
this
.
picArr
[
m
][
n
].
push
(
item
);
this
.
saveItem
();
}
}
deleteItem
(
index
,
m
,
n
)
{
if
(
index
!==
-
1
)
{
this
.
picArr
[
m
][
n
].
splice
(
index
,
1
);
}
if
(
this
.
picArr
[
m
][
n
].
length
==
0
)
{
this
.
picArr
[
m
].
splice
(
n
,
1
)
}
if
(
this
.
picArr
[
m
].
length
==
0
)
{
this
.
picArr
.
splice
(
m
,
1
)
}
this
.
save
();
}
//添加一页
addPage
(
m
)
{
let
arr
=
[];
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
let
item
=
this
.
cardItemData
();
arr
.
push
(
item
);
}
this
.
picArr
[
m
].
push
(
arr
);
this
.
save
();
}
deletePage
(
m
,
n
)
{
console
.
log
(
"
删除页,
"
+
m
+
"
|
"
+
n
);
this
.
picArr
[
m
].
splice
(
n
,
1
)
if
(
this
.
picArr
[
m
].
length
==
0
)
{
this
.
picArr
.
splice
(
m
,
1
)
}
this
.
save
();
}
//添加题组
addTestlet
()
{
let
arr
=
[[]];
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
let
item
=
this
.
cardItemData
();
arr
[
0
].
push
(
item
);
}
this
.
picArr
.
push
(
arr
);
this
.
save
();
}
deleteTestlet
(
m
)
{
this
.
picArr
.
splice
(
m
,
1
)
this
.
save
();
}
radioClick
(
it
,
radioValue
)
{
it
.
radioValue
=
radioValue
;
this
.
saveItem
();
...
...
@@ -208,41 +145,41 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
check
()
{
if
(
!
this
.
picArr
)
return
;
let
picArr
=
this
.
picArr
;
function
tia
(
info
)
{
let
str
=
""
;
if
(
info
.
radioValue
==
"
A
"
)
{
if
(
!
info
.
title
)
str
+=
"
,图片
"
;
}
else
if
(
info
.
radioValue
==
"
B
"
)
{
if
(
!
info
.
pic_url
)
str
+=
"
,图片
"
;
}
else
if
(
info
.
radioValue
==
"
C
"
)
{
if
(
!
info
.
audio_url
)
str
+=
"
,音频
"
;
}
else
{
str
+=
"
卡片
"
}
if
(
str
)
str
+=
"
未上传
"
return
str
;
}
this
.
errs
.
length
=
0
;
for
(
let
m
=
0
;
m
<
picArr
.
length
;
m
++
)
{
for
(
let
n
=
0
;
n
<
picArr
[
m
].
length
;
n
++
)
{
if
(
picArr
[
m
][
n
].
length
<
2
)
{
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
卡片少于2个`
);
}
for
(
let
i
=
0
;
i
<
picArr
[
m
][
n
].
length
;
i
++
)
{
let
item
=
picArr
[
m
][
n
][
i
];
let
left
=
item
.
left
;
let
right
=
item
.
right
;
let
code0
=
tia
(
left
);
let
code1
=
tia
(
right
);
if
(
code0
)
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
第
${
i
+
1
}
个卡片 左侧
${
code0
}
`
);
if
(
code1
)
this
.
errs
.
push
(
`星-
${
m
+
1
}
页-
${
n
+
1
}
第
${
i
+
1
}
个卡片 右侧
${
code1
}
`
);
}
}
}
console
.
log
(
"
this.errs
"
);
console
.
log
(
this
.
errs
);
console
.
log
(
"
-------------------------
"
);
// let picArr = this.picArr.list
;
//
function tia(info) {
//
let str = "";
//
if (info.radioValue == "A") {
//
if (!info.title) str += ",图片";
//
} else if (info.radioValue == "B") {
//
if (!info.pic_url) str += ",图片";
//
} else if (info.radioValue == "C") {
//
if (!info.audio_url) str += ",音频";
//
} else {
//
str += "卡片"
//
}
//
if (str) str += "未上传"
//
return str;
//
}
//
this.errs.length = 0;
//
for (let m = 0; m < picArr.length; m++) {
//
for (let n = 0; n < picArr[m].length; n++) {
//
if (picArr[m][n].length < 2) {
//
this.errs.push(`星-${m + 1} 页-${n + 1} 卡片少于2个`);
//
}
//
for (let i = 0; i < picArr[m][n].length; i++) {
//
let item = picArr[m][n][i];
//
let left = item.left;
//
let right = item.right;
//
let code0 = tia(left);
//
let code1 = tia(right);
//
if (code0) this.errs.push(`星-${m + 1} 页-${n + 1} 第${i + 1}个卡片 左侧${code0}`);
//
if (code1) this.errs.push(`星-${m + 1} 页-${n + 1} 第${i + 1}个卡片 右侧${code1}`);
//
}
//
}
//
}
//
console.log("this.errs");
//
console.log(this.errs);
//
console.log("-------------------------");
}
...
...
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