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
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
e1750c9c
Commit
e1750c9c
authored
Sep 05, 2020
by
renqing122
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标注选中优化
parent
94b61719
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
18 deletions
+104
-18
SelectText.vue
...atform-front/src/components/textAnnotation/SelectText.vue
+48
-8
SelectedCheck.vue
...orm-front/src/components/textAnnotation/SelectedCheck.vue
+56
-10
No files found.
DAPlatform-front/src/components/textAnnotation/SelectText.vue
View file @
e1750c9c
...
...
@@ -39,9 +39,16 @@
</div>
</el-aside>
<!-- 文本界面 -->
<el-main
class=
"filter-container1"
style=
"background-color: #FFFFFF"
>
<el-main
class=
"filter-container1"
style=
"background-color: #FFFFFF"
>
<div
style=
"overflow-y:auto;height:100%;"
>
<div
class=
"content1"
@
mouseup=
"select()"
v-html=
"content"
></div>
<div
class=
"content1"
@
mouseup=
"select()"
v-html=
"content"
></div>
<div
class=
"content_left"
>
<div
class=
"tokenList1"
...
...
@@ -56,7 +63,10 @@
:disable-transitions=
"false"
@
close=
"deleteToken(it)"
>
<a
class=
"token1"
v-html=
"it.word"
></a>
<a
class=
"token1"
v-html=
"it.word"
></a>
</el-tag>
</div>
</div>
...
...
@@ -107,6 +117,7 @@ export default {
children
:
"children"
,
label
:
"label"
,
},
treeToArray
:
[],
};
},
beforeMount
()
{
...
...
@@ -238,6 +249,12 @@ export default {
this
.
token
.
entityId
=
res
.
result
.
templateName
;
// 属性
this
.
treeData
=
res
.
result
.
entityList
;
for
(
var
i
=
0
;
i
<
this
.
treeData
.
length
;
i
++
)
{
this
.
treeToArray
.
push
({
"id"
:
this
.
treeData
[
i
].
id
,
"label"
:
this
.
treeData
[
i
].
label
});
// 属性
if
(
this
.
treeData
[
i
].
children
!=
[])
{
this
.
transfer
(
this
.
treeData
[
i
].
children
);
}
}
}
else
{
this
.
$message
({
message
:
res
.
return_info
,
...
...
@@ -254,6 +271,7 @@ export default {
this
.
token
.
word
=
window
.
getSelection
().
toString
();
this
.
token
.
begin
=
window
.
getSelection
().
anchorOffset
;
//开始位置
this
.
token
.
end
=
window
.
getSelection
().
focusOffset
;
//结束位置
this
.
$refs
.
tree
.
setCheckedNodes
([]);
//console.log(" token select" + JSON.stringify(this.token));
//console.log(" tokenList select" + JSON.stringify(this.tokenList));
}
...
...
@@ -304,11 +322,12 @@ export default {
if
(
res
.
return_code
==
200
)
{
this
.
tokenList
=
[];
this
.
getTokenList
();
console
.
log
(
" token uploadToken"
+
JSON
.
stringify
(
token
));
console
.
log
(
" token uploadToken"
+
JSON
.
stringify
(
this
.
token
));
console
.
log
(
" tokenList uploadToken"
+
JSON
.
stringify
(
this
.
tokenList
)
);
// console.log(" token uploadToken" + JSON.stringify(token));
// console.log(" token uploadToken" + JSON.stringify(this.token));
// console.log(
// " tokenList uploadToken" + JSON.stringify(this.tokenList)
// );
this
.
$refs
.
tree
.
setCheckedNodes
([]);
this
.
$message
({
message
:
"已保存"
,
type
:
"success"
,
...
...
@@ -378,6 +397,27 @@ export default {
this
.
token
.
begin
=
tag
.
begin
;
this
.
token
.
end
=
tag
.
end
;
this
.
token
.
entityId
=
tag
.
entityId
;
let
res
=
[];
for
(
var
i
=
0
;
i
<
this
.
treeToArray
.
length
;
i
++
)
{
res
[
i
]
=
{};
for
(
var
j
=
0
;
j
<
this
.
treeToArray
.
length
;
j
++
)
{
if
(
this
.
treeToArray
[
j
].
label
==
tag
.
attribute
[
i
])
{
res
[
i
].
id
=
this
.
treeToArray
[
j
].
id
;
break
;
}
}
}
this
.
$refs
.
tree
.
setCheckedNodes
(
res
);
},
transfer
(
children
)
{
if
(
children
==
[])
return
;
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
this
.
treeToArray
.
push
({
"id"
:
children
[
i
].
id
,
"label"
:
children
[
i
].
label
});
if
(
children
[
i
]
!=
[])
{
this
.
transfer
(
children
[
i
].
children
);
}
}
},
// 提交已标注文档
submit
()
{
...
...
DAPlatform-front/src/components/textAnnotation/SelectedCheck.vue
View file @
e1750c9c
...
...
@@ -39,9 +39,16 @@
</div>
</el-aside>
<!-- 文本界面 -->
<el-main
class=
"filter-container3"
style=
"background-color: #FFFFFF"
>
<el-main
class=
"filter-container3"
style=
"background-color: #FFFFFF"
>
<div
style=
"overflow-y:auto;height:100%;"
>
<div
class=
"content3"
@
mouseup=
"select()"
v-html=
"content"
></div>
<div
class=
"content3"
@
mouseup=
"select()"
v-html=
"content"
></div>
<div
class=
"content_left1"
>
<div
...
...
@@ -57,11 +64,20 @@
:disable-transitions=
"false"
@
close=
"deleteToken(it)"
>
<a
style=
"font-size: 18px;"
v-html=
"it.word"
></a>
<a
style=
"font-size: 18px;"
v-html=
"it.word"
></a>
<a
style=
"font-size: 14px;"
>
: 实体
</a>
<a
style=
"font-size: 14px;"
v-html=
"it.entityId"
></a>
<a
style=
"font-size: 14px;"
v-html=
"it.entityId"
></a>
<a
style=
"font-size: 14px;"
>
属性
</a>
<a
style=
"font-size: 14px;"
v-html=
"it.attribute"
></a>
<a
style=
"font-size: 14px;"
v-html=
"it.attribute"
></a>
<el-button
style=
"margin-left: auto;font-size: 12px"
@
click=
"countScore()"
...
...
@@ -132,6 +148,7 @@ export default {
computeScore
:
0
,
allScore
:
1
,
rightScore
:
0
,
treeToArray
:
[],
};
},
beforeMount
()
{
...
...
@@ -271,6 +288,12 @@ export default {
this
.
token
.
entityId
=
res
.
result
.
templateName
;
// 属性
this
.
treeData
=
res
.
result
.
entityList
;
for
(
var
i
=
0
;
i
<
this
.
treeData
.
length
;
i
++
)
{
this
.
treeToArray
.
push
({
"id"
:
this
.
treeData
[
i
].
id
,
"label"
:
this
.
treeData
[
i
].
label
});
// 属性
if
(
this
.
treeData
[
i
].
children
!=
[])
{
this
.
transfer
(
this
.
treeData
[
i
].
children
);
}
}
}
else
{
this
.
$message
({
message
:
res
.
return_info
,
...
...
@@ -287,6 +310,7 @@ export default {
this
.
token
.
word
=
window
.
getSelection
().
toString
();
this
.
token
.
begin
=
window
.
getSelection
().
anchorOffset
;
//开始位置
this
.
token
.
end
=
window
.
getSelection
().
focusOffset
;
//结束位置
this
.
$refs
.
tree
.
setCheckedNodes
([]);
//console.log(" token select" + JSON.stringify(this.token));
//console.log(" tokenList select" + JSON.stringify(this.tokenList));
}
...
...
@@ -337,11 +361,12 @@ export default {
if
(
res
.
return_code
==
200
)
{
this
.
tokenList
=
[];
this
.
getTokenList
();
console
.
log
(
" token uploadToken"
+
JSON
.
stringify
(
token
));
console
.
log
(
" token uploadToken"
+
JSON
.
stringify
(
this
.
token
));
console
.
log
(
" tokenList uploadToken"
+
JSON
.
stringify
(
this
.
tokenList
)
);
// console.log(" token uploadToken" + JSON.stringify(token));
// console.log(" token uploadToken" + JSON.stringify(this.token));
// console.log(
// " tokenList uploadToken" + JSON.stringify(this.tokenList)
// );
this
.
$refs
.
tree
.
setCheckedNodes
([]);
this
.
$message
({
message
:
"已保存"
,
type
:
"success"
,
...
...
@@ -411,6 +436,27 @@ export default {
this
.
token
.
begin
=
tag
.
begin
;
this
.
token
.
end
=
tag
.
end
;
this
.
token
.
entityId
=
tag
.
entityId
;
let
res
=
[];
for
(
var
i
=
0
;
i
<
this
.
treeToArray
.
length
;
i
++
)
{
res
[
i
]
=
{};
for
(
var
j
=
0
;
j
<
this
.
treeToArray
.
length
;
j
++
)
{
if
(
this
.
treeToArray
[
j
].
label
==
tag
.
attribute
[
i
])
{
res
[
i
].
id
=
this
.
treeToArray
[
j
].
id
;
break
;
}
}
}
this
.
$refs
.
tree
.
setCheckedNodes
(
res
);
},
transfer
(
children
)
{
if
(
children
==
[])
return
;
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
this
.
treeToArray
.
push
({
"id"
:
children
[
i
].
id
,
"label"
:
children
[
i
].
label
});
if
(
children
[
i
]
!=
[])
{
this
.
transfer
(
children
[
i
].
children
);
}
}
},
save
()
{
alert
(
"打分成功"
);
...
...
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