Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
JM_MATH01
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
JM_MATH01
Commits
5c209d10
Commit
5c209d10
authored
Nov 20, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: custom formula input
parent
9744c8f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
formula-input.component.ts
src/app/common/formula-input/formula-input.component.ts
+13
-2
form.component.html
src/app/form/form.component.html
+3
-3
No files found.
src/app/common/formula-input/formula-input.component.ts
View file @
5c209d10
...
@@ -68,8 +68,19 @@ export class FormulaInputComponent implements OnInit, OnChanges, OnDestroy, Afte
...
@@ -68,8 +68,19 @@ export class FormulaInputComponent implements OnInit, OnChanges, OnDestroy, Afte
const
rect
=
this
.
inputEl
.
nativeElement
.
getBoundingClientRect
();
const
rect
=
this
.
inputEl
.
nativeElement
.
getBoundingClientRect
();
const
fb
=
document
.
getElementById
(
this
.
FB_id
);
const
fb
=
document
.
getElementById
(
this
.
FB_id
);
fb
.
style
.
position
=
'
absolute
'
;
fb
.
style
.
position
=
'
absolute
'
;
fb
.
style
.
left
=
rect
.
left
+
rect
.
width
+
'
px
'
;
let
left
=
rect
.
left
+
rect
.
width
;
fb
.
style
.
top
=
rect
.
top
+
'
px
'
;
let
top
=
rect
.
top
;
// @ts-ignore
const
padWidth
=
$
(
'
#
'
+
this
.
FB_id
).
outerWidth
()
*
.
8
;
// @ts-ignore
const
ww
=
$
(
window
).
innerWidth
();
if
((
left
+
padWidth
)
>
ww
)
{
left
=
ww
-
padWidth
;
top
=
top
+
rect
.
height
;
}
console
.
log
(
'
left
'
,
left
);
fb
.
style
.
left
=
left
+
'
px
'
;
fb
.
style
.
top
=
top
+
'
px
'
;
fb
.
style
.
visibility
=
'
visible
'
;
fb
.
style
.
visibility
=
'
visible
'
;
}
}
updateValue
(
val
)
{
updateValue
(
val
)
{
...
...
src/app/form/form.component.html
View file @
5c209d10
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<app-formula-input
[(
ngfModel
)]="
item
.
title
"
(
ngfBlur
)="
save
()"
></app-formula-input><br>
<app-formula-input
style=
"position: absolute;right:0;"
[(
ngfModel
)]="
item
.
title
"
(
ngfBlur
)="
save
()"
></app-formula-input><br>
<app-formula-input
[(
ngfModel
)]="
item
.
title
"
(
ngfBlur
)="
save
()"
></app-formula-input><br>
<app-formula-input
[(
ngfModel
)]="
item
.
title
"
(
ngfBlur
)="
save
()"
></app-formula-input><br>
<div
style=
"padding: 20px;"
>
<div
style=
"padding: 20px;"
>
...
@@ -182,8 +182,8 @@
...
@@ -182,8 +182,8 @@
</div>
</div>
</div>
</div>
<div
*
ngFor=
"let op of item.choice_obj.optionArr"
style=
"border: 1px solid #ccc; margin: 10px; padding: 10px; border-radius: 5px;"
>
<div
*
ngFor=
"let op of item.choice_obj.optionArr"
style=
"border: 1px solid #ccc; margin: 10px; padding: 10px; border-radius: 5px;"
>
<div
style=
"margin-top: 20px; display: flex; align-items: center; width: 500px;"
>
<div
style=
"margin-top: 20px; display: flex; align-items: center; width: 500px;"
>
<span
style=
"margin-right: 5px;"
>
{{op.id}}:
</span>
<span
style=
"margin-right: 5px;"
>
{{op.id}}:
</span>
...
...
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