Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Berlin
DA-Platform
Commits
b3f9849d
Commit
b3f9849d
authored
May 23, 2020
by
郭婉茹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
弹框实体属性
parent
c0e4d848
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
5 deletions
+47
-5
SelectText.vue
...atform-front/src/components/textAnnotation/SelectText.vue
+20
-3
SelectedText.vue
...form-front/src/components/textAnnotation/SelectedText.vue
+27
-2
No files found.
DAPlatform-front/src/components/textAnnotation/SelectText.vue
View file @
b3f9849d
...
...
@@ -13,8 +13,8 @@
</ul>
</div>
<div>
<el-button
type=
"primary"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"s
ave
()"
>
提交
</el-button>
<el-button
type=
"primary"
@
click=
"save()"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"s
ubmit
()"
>
提交
</el-button>
</div>
<!-- 弹窗-->
<el-dialog
title=
"请标注"
:visible
.
sync=
"ifAlert"
>
...
...
@@ -186,19 +186,36 @@ export default {
},
highlight
()
{
this
.
ifAlert
=
true
;
const
search
=
window
.
getSelection
().
toString
();
var
search
;
if
(
window
.
getSelection
)
{
search
=
window
.
getSelection
().
toString
();
}
else
{
search
=
document
.
selection
.
createRange
().
search
;
}
this
.
msg
=
this
.
msg
.
map
(
item
=>
{
let
replaceReg
=
new
RegExp
(
search
,
"g"
);
// 匹配关键字正则
let
replaceString
=
'<span class="highlights-text">'
+
search
+
'</span>'
;
// 高亮替换v-html值
return
item
.
replace
(
replaceReg
,
replaceString
);
});
if
(
search
){
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
});
}
},
save
()
{
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
});
},
submit
()
{
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
});
this
.
$router
.
replace
(
"/completed"
);
}
}
...
...
DAPlatform-front/src/components/textAnnotation/SelectedText.vue
View file @
b3f9849d
...
...
@@ -3,6 +3,8 @@
<el-container
class=
"filter-container"
>
<el-main
style=
"background-color: #FFFFFF"
>
<div
style=
"overflow-y:auto;height:100%;"
>
<span
id=
"demo1"
>
实体: 属性:
</span>
<span
id=
"demo2"
>
实体:属性:
</span>
<div
@
mouseup=
"highlight()"
>
<!--
<div
@
mouseup=
"highlight()"
>
-->
<ul
class=
"list"
>
...
...
@@ -13,8 +15,8 @@
</ul>
</div>
<div>
<el-button
type=
"primary"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"s
ave
()"
>
提交
</el-button>
<el-button
type=
"primary"
@
click=
"save()"
>
保存
</el-button>
<el-button
type=
"primary"
@
click=
"s
ubmit
()"
>
提交
</el-button>
</div>
<!-- 弹窗-->
<el-dialog
title=
"请标注"
:visible
.
sync=
"ifAlert"
>
...
...
@@ -198,6 +200,12 @@ export default {
message
:
'保存成功!'
,
type
:
'success'
});
},
submit
()
{
this
.
$message
({
message
:
'保存成功!'
,
type
:
'success'
});
this
.
$router
.
replace
(
"/completed"
);
}
}
...
...
@@ -250,4 +258,20 @@ export default {
margin-top
:
15px
;
margin-bottom
:
10px
;
}
#demo1
{
width
:
140px
;
height
:
20px
;
background-color
:
rgba
(
255
,
255
,
0
,
0.47
);
position
:
absolute
;
left
:
320px
;
top
:
150px
;
}
#demo2
{
width
:
140px
;
height
:
20px
;
background-color
:
rgb
(
50
,
205
,
50
);
position
:
absolute
;
left
:
175px
;
top
:
180px
;
}
</
style
>
\ No newline at end of file
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