Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg28_drag
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
dg28_drag
Commits
8f522f36
Commit
8f522f36
authored
Dec 14, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文本高亮完成
parent
f80ce26d
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
200 additions
and
235 deletions
+200
-235
.DS_Store
.DS_Store
+0
-0
ComponentBase.ts
form/src/app/form/ComponentBase.ts
+4
-2
form.component.html
form/src/app/form/form.component.html
+165
-100
form.component.ts
form/src/app/form/form.component.ts
+31
-133
No files found.
.DS_Store
View file @
8f522f36
No preview for this file type
form/src/app/form/ComponentBase.ts
View file @
8f522f36
...
...
@@ -66,12 +66,14 @@ export class ComponentBase {
* 储存音频数据
* @param e
*/
onAudioUploadSuccess
(
e
,
key
,
it
=
this
.
item
)
{
onAudioUploadSuccess
(
e
,
key
,
it
=
this
.
item
,
audioName
=
null
)
{
let
url
=
e
.
url
;
let
sp
=
url
.
split
(
"
.mp3
"
);
let
u
=
sp
[
0
]
+
"
_l.mp3
"
;
it
[
key
]
=
u
;
it
[
"
audioName
"
]
=
e
.
name
||
""
;
if
(
!
audioName
)
audioName
=
key
+=
"
Name
"
it
.
audioName
=
e
.
name
||
""
;
console
.
log
(
e
.
name
,
audioName
)
this
.
save
();
}
...
...
form/src/app/form/form.component.html
View file @
8f522f36
This diff is collapsed.
Click to expand it.
form/src/app/form/form.component.ts
View file @
8f522f36
...
...
@@ -13,122 +13,24 @@ let replaceAll = function (str, s1, s2) {
})
export
class
FormComponent
extends
ComponentBase
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
saveKey
=
"
wood_input
"
;
// 1.猫动画可替换。
// 2.文本内容可替换。//字体随内容缩小。
// 3.语音替换。
// 4.背景可替换
// 5.3~10选项内容。
// 6.配置对应的坐标。
customTypeGroupArr
=
[
// {
// name: '发音动画',
// rect: true,
// animaSmall: true,
// audio: true,
// },
// {
// name: '发音图片',
// pic: true,
// audio: true,
// },
// {
// name: '发音区块',
// rect: true,
// audio: true,
// },
// {
// name: '变化文本',
// action: {
// type: 'text',
// option: [
// ['fontColor', '#000000'],
// ['fontSize', '100'],
// ['opacity', '0', '100']
// ]
// },
// },
// {
// name: '变化图片',
// action: {
// type: 'pic',
// option: [
// // ['scale', '1'],
// ['opacity', '0', '100']
// ]
// },
// },
// {
// name: '变化动画',
// action: {
// type: 'anima',
// option: [
// // ['scale', '1'],
// ['opacity', '0', '100']
// ]
// },
// },
{
name
:
'
选项图片
'
,
drag
:
true
,
pic
:
true
,
// audio: true,
},
// {
// name: '选项文本',
// drag: true,
// audio: true,
// action: {
// type: 'text',
// option: [
// ['fontColor', '#000000'],
// ['fontSize', '100'],
// ]
// },
// },
// {
// name: '拖拽结束区',
// rect: true,
// }
]
saveKey
=
"
dg28_drag
"
;
item
=
{
imgAni
:
{
ske
:
{},
tex
:
{},
png
:
{}
},
tipSwitch
:
1
,
//提示功能开关
tipType
:
"
page
"
,
tipBg
:
''
,
tipPage
:
[{
title
:
''
,
audio
:
''
}],
title
:
""
,
audio
:
""
,
audioName
:
""
,
image
:
''
,
jumpIdx
:
''
,
endImgAni
:
{
ske
:
{},
tex
:
{},
png
:
{}
},
endImgTitle
:
""
,
// 开始音频
auidoStart
:
""
,
auidoStartName
:
""
,
// 结束音频
auidoEnd
:
""
,
auidoEndName
:
""
,
// 肉饼引导音频
auidoMeet
:
""
,
auidoMeetName
:
""
,
// 蔬菜引导音频
auidoVegetable
:
""
,
auidoVegetableName
:
""
,
// 第一次完成音频
auidoFinish
:
""
,
auidoFinishName
:
""
,
points
:
""
,
tips
:
''
,
questionScore
:
0
,
//分数
questions
:
[],
questionText
:
""
,
...
...
@@ -158,7 +60,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
console
.
log
(
new
MetaFormCreator
().
create
());
if
(
this
.
item
.
questions
.
length
==
0
)
{
this
.
add
q
uestion
();
this
.
add
Q
uestion
();
}
}
...
...
@@ -187,14 +89,6 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
removePage
(
idx
)
{
this
.
item
.
tipPage
.
splice
(
idx
,
1
);
this
.
save
();
}
addPage
()
{
this
.
item
.
tipPage
.
push
({
title
:
""
,
audio
:
""
})
this
.
save
();
}
removequestion
(
idx
)
{
this
.
openDelete
(
"
确定删除题目?
"
,
()
=>
{
...
...
@@ -203,14 +97,15 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
})
}
addquestion
()
{
addQuestion
()
{
// 题目自带一堆东西不用添加选项部分
this
.
item
.
questions
.
push
({
options
:
[],
type
:
"
img
"
title
:
""
,
//大标题
mainType
:
""
,
//题干类型
mainText
:
""
,
//题干文字
mainTextArr
:
[],
//题干文字高亮
mainImage
:
""
,
//题干图片
});
while
(
this
.
item
.
questions
[
0
].
options
.
length
<
3
)
{
this
.
addoption
(
0
);
}
this
.
save
();
}
ngChange
(
i
,
j
)
{
...
...
@@ -229,10 +124,13 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
this
.
save
();
}
changeMain
()
{
changeMain
(
i
)
{
let
question
=
this
.
item
.
questions
[
i
]
//输出的数据可以识别到\n的换行符
let
arr
=
this
.
item
.
contentMain
.
split
(
"
"
);
let
oldArr
=
this
.
item
.
contentArr
.
concat
();
let
contentMain
=
question
.
mainText
;
let
contentArr
=
question
.
mainTextArr
||
[];
let
arr
=
contentMain
.
split
(
"
"
);
let
oldArr
=
contentArr
.
concat
();
let
contetArr
=
arr
.
map
(
ar
=>
{
let
obj
=
{
text
:
replaceAll
(
`
${
ar
}
`
,
"
\n
"
,
"
<br/>
"
),
...
...
@@ -249,7 +147,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
}
return
obj
;
})
this
.
item
.
conten
tArr
=
contetArr
;
question
.
mainTex
tArr
=
contetArr
;
console
.
log
(
contetArr
)
this
.
save
();
}
...
...
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