文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit c590d05c by 郭婉茹

文本标注页面跳转

parent b1f7eb99
...@@ -79,8 +79,8 @@ export default { ...@@ -79,8 +79,8 @@ export default {
} }
switch (type) { switch (type) {
case '文本': case '文本':
if (file.url.endsWith('xlsx')) { goto('table') } if (file.url.endsWith('xlsx')) { goto('tabledCheck') }
if (file.url.endsWith('txt')) { goto('SelectedText') } if (file.url.endsWith('txt')) { goto('SelectedCheck') }
break break
case '图片': goto('imageshow'); break case '图片': goto('imageshow'); break
case '图层': goto('layershow') case '图层': goto('layershow')
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
} }
switch (type) { switch (type) {
case '文本': case '文本':
if (file.url.endsWith('xlsx')) { goto('table') } if (file.url.endsWith('xlsx')) { goto('tabled') }
if (file.url.endsWith('txt')) { goto('SelectedText') } if (file.url.endsWith('txt')) { goto('SelectedText') }
break break
case '图片': goto('imageshow'); break case '图片': goto('imageshow'); break
......
...@@ -15,10 +15,7 @@ ...@@ -15,10 +15,7 @@
class="tokenList" class="tokenList"
v-for="it in tokenList" v-for="it in tokenList"
:key="it" :key="it"
style="user-select:none; float: left;width:220px; style="user-select:none; float: left;"
white-space: nowrap;
text-overflow: ellipsis;
overflow:hidden;"
> >
<el-tag <el-tag
size="small" size="small"
...@@ -27,7 +24,7 @@ overflow:hidden;" ...@@ -27,7 +24,7 @@ overflow:hidden;"
:disable-transitions="false" :disable-transitions="false"
@close="deleteToken(it)" @close="deleteToken(it)"
> >
<div class="token" v-html="it.word"></div> <div class="token" v-html="it.word"></div>
</el-tag> </el-tag>
<br /> <br />
</div> </div>
...@@ -127,7 +124,7 @@ export default { ...@@ -127,7 +124,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/insertDocument", url: "/textAnnotation/insertDocument",
data: { data: {
templateId: 6, // TODO 模板id templateId: 1, // TODO 模板id
annotatorId: this.$store.state.userInfo.userId, annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id, creatorId: this.task.creator_id,
textUrl: this.file.url, textUrl: this.file.url,
...@@ -223,8 +220,8 @@ export default { ...@@ -223,8 +220,8 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/getOneTemplate", url: "/textAnnotation/getOneTemplate",
data: { data: {
templateId: 6, // TODO 待沟通,通用那边没给这个接口,还有这个在后端用str包了,这里用int就行,后期改成写了实体再自己取属性列表吧 templateId: 1, // TODO 待沟通,通用那边没给这个接口,还有这个在后端用str包了,这里用int就行,后期改成写了实体再自己取属性列表吧
creatorId: this.task.creator_id, creatorId: this.task.creator_id
} }
}).then(res => { }).then(res => {
if (res.return_code == 200) { if (res.return_code == 200) {
...@@ -244,28 +241,28 @@ export default { ...@@ -244,28 +241,28 @@ export default {
// 定位原文token // 定位原文token
select() { select() {
if (window.getSelection().toString() != "") { if (window.getSelection().toString() != "") {
// 禁止重复标注,沾边的也不行 // // 禁止重复标注,沾边的也不行
for (var i = 0; i < this.tokenList.length; i++) { // for (var i = 0; i < this.tokenList.length; i++) {
if ( // if (
window.getSelection().anchorOffset >= this.tokenList[i].begin && // window.getSelection().anchorOffset >= this.tokenList[i].begin &&
window.getSelection().anchorOffset < this.tokenList[i].end // window.getSelection().anchorOffset < this.tokenList[i].end
) { // ) {
this.$message({ // this.$message({
message: "选中区域头部存在重叠", // message: "选中区域头部存在重叠",
type: "info" // type: "info"
}); // });
return; // return;
} else if ( // } else if (
window.getSelection().focusOffset > this.tokenList[i].begin && // window.getSelection().focusOffset > this.tokenList[i].begin &&
window.getSelection().focusOffset <= this.tokenList[i].end // window.getSelection().focusOffset <= this.tokenList[i].end
) { // ) {
this.$message({ // this.$message({
message: "选中区域尾部存在重叠", // message: "选中区域尾部存在重叠",
type: "info" // type: "info"
}); // });
return; // return;
} // }
} // }
console.log(" token select" + JSON.stringify(this.token)); console.log(" token select" + JSON.stringify(this.token));
this.token.word = window.getSelection().toString(); this.token.word = window.getSelection().toString();
this.token.begin = window.getSelection().anchorOffset; //开始位置 this.token.begin = window.getSelection().anchorOffset; //开始位置
...@@ -404,7 +401,7 @@ export default { ...@@ -404,7 +401,7 @@ export default {
// 修改实体属性=删除+添加(如果选择属性弹窗没有点提交直接关掉的话会删除,也就是双击直接删除,也许这里后期需要改) // 修改实体属性=删除+添加(如果选择属性弹窗没有点提交直接关掉的话会删除,也就是双击直接删除,也许这里后期需要改)
changeToken(tag) { changeToken(tag) {
this.ifAlert = true; this.ifAlert = true;
this.token = tag this.token = tag;
// this.tokenList.splice(this.tokenList.indexOf(tag), 1); // this.tokenList.splice(this.tokenList.indexOf(tag), 1);
console.log("deleteToken"); console.log("deleteToken");
this.axios({ this.axios({
...@@ -528,9 +525,9 @@ export default { ...@@ -528,9 +525,9 @@ export default {
margin-top: 15px; margin-top: 15px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.sidebar-box1{ .sidebar-box1 {
position:fixed; position: fixed;
width:260px; width: 260px;
} }
.img-list-title1 { .img-list-title1 {
line-height: 40px; line-height: 40px;
...@@ -555,10 +552,10 @@ export default { ...@@ -555,10 +552,10 @@ export default {
//margin-bottom: 9px; //margin-bottom: 9px;
} }
.token { .token {
width:150px; // width: 150px;
white-space: nowrap; // white-space: nowrap;
text-overflow: ellipsis; // text-overflow: ellipsis;
overflow:hidden; // overflow: hidden;
font-size: 18px; font-size: 18px;
} }
</style> </style>
...@@ -260,7 +260,7 @@ export default { ...@@ -260,7 +260,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/getOneTemplate", url: "/textAnnotation/getOneTemplate",
data: { data: {
templateId: 6, templateId: 1,
creatorId: this.task.creator_id creatorId: this.task.creator_id
} }
}).then(res => { }).then(res => {
...@@ -293,6 +293,7 @@ export default { ...@@ -293,6 +293,7 @@ export default {
this.row = row; this.row = row;
this.column = column; this.column = column;
this.token.word = row[column.property]; this.token.word = row[column.property];
// TODO rowindex似乎有错
this.token.begin = column.property; this.token.begin = column.property;
this.token.entityId = row[1]; this.token.entityId = row[1];
console.log(JSON.stringify(row)); console.log(JSON.stringify(row));
...@@ -314,36 +315,24 @@ export default { ...@@ -314,36 +315,24 @@ export default {
console.log(" tokenList select" + JSON.stringify(this.tokenList)); console.log(" tokenList select" + JSON.stringify(this.tokenList));
this.ifAlert = true; // 打开标注弹窗 this.ifAlert = true; // 打开标注弹窗
}, },
// tableRowClassName({ row, column, rowIndex, columnIndex }) { // tableRowClassName({ row, rowIndex }) {
// if (columnIndex === 0) { // if (rowIndex === 0) {
// console.log("columnIndex"); // return "success-row";
// console.log(columnIndex);
// return "warning-row";
// } else if (rowIndex === 3) { // } else if (rowIndex === 3) {
// console.log("columnIndex");
// return "success-row"; // return "success-row";
// } // }
// return ""; // return "";
// }, // },
// tableRowClassName({ row, rowIndex }) {
// console.log(this.tokenList);
// let self = this;
// for (let i = 0; i < self.tokenList.length; i++) {
// console.log(self.tokenList[i].begin)
// if (rowIndex === self.tokenList[i].begin) {
// return "warning-row";
// }
// }
// },
// // TODO 表格标注颜色bug // // TODO 表格标注颜色bug
// cellStyle() { // cellStyle({row, column, rowIndex, columnIndex}) {
// this.tokenList.forEach(item => { // for(var i = 0; i < this.tokenList.length; i++){
// if (item.word == row[column.property]) { // console.log("this.tokenList["+i+"].begin"+this.tokenList[i].begin)
// //this.$refs.singleTable.setCurrentRow(row); // if(rowIndex == this.tokenList[i].begin){
// return "warning-row";
// //return 'success-row'; // console.log("111111111"+this.tokenList[i].word)
// return "success-row";
// } // }
// }); // }
// }, // },
// 添加标注 // TODO 大于段落的标注还是无法渲染 // 添加标注 // TODO 大于段落的标注还是无法渲染
uploadToken() { uploadToken() {
......
...@@ -15,6 +15,9 @@ import checkdetail from '../components/CheckDetail' ...@@ -15,6 +15,9 @@ import checkdetail from '../components/CheckDetail'
import SelectText from '../components/textAnnotation/SelectText' import SelectText from '../components/textAnnotation/SelectText'
import SelectedText from '../components/textAnnotation/SelectedText' import SelectedText from '../components/textAnnotation/SelectedText'
import Table from '../components/textAnnotation/Table' import Table from '../components/textAnnotation/Table'
import Tabled from '../components/textAnnotation/Tabled'
import SelectedCheck from '../components/textAnnotation/SelectedCheck'
import TabledCheck from '../components/textAnnotation/TabledCheck'
import imageAnnotiation from '../components/imageAnnotation/imageAnnotiation' import imageAnnotiation from '../components/imageAnnotation/imageAnnotiation'
import layerAnnotation from '../components/imageAnnotation/layerAnnotation' import layerAnnotation from '../components/imageAnnotation/layerAnnotation'
import layerShow from '../components/imageAnnotation/layerShow' import layerShow from '../components/imageAnnotation/layerShow'
...@@ -86,7 +89,7 @@ export default new Router({ ...@@ -86,7 +89,7 @@ export default new Router({
component: checkdetail component: checkdetail
}, },
{ {
path: '/select/:file/:task/:relationId', path: '/select/:file/:task/:relationId/:executor',
name: 'SelectText', name: 'SelectText',
component: SelectText component: SelectText
}, },
...@@ -96,28 +99,43 @@ export default new Router({ ...@@ -96,28 +99,43 @@ export default new Router({
component: SelectedText component: SelectedText
}, },
{ {
path: '/selectedCheck/:file/:task/:relationId/:executor',
name: 'SelectedCheck',
component: SelectedCheck
},
{
path: '/table/:file/:task/:relationId/:executor', path: '/table/:file/:task/:relationId/:executor',
name: 'table', name: 'table',
component: Table component: Table
}, },
{ {
path: '/image/:file/:task/:relationId', path: '/tabled/:file/:task/:relationId/:executor',
name: 'tabled',
component: Tabled
},
{
path: '/tabledCheck/:file/:task/:relationId/:executor',
name: 'tabledCheck',
component: TabledCheck
},
{
path: '/image/:file/:task/:relationId/:executor',
name: 'image', name: 'image',
component: imageAnnotiation component: imageAnnotiation
}, },
{ {
path: '/layer/:file/:task/:relationId', path: '/layer/:file/:task/:relationId/:executor',
name: 'layer', name: 'layer',
component: layerAnnotation component: layerAnnotation
}, },
{ {
path: '/imageshow/:file/:task/:relationId/:executor', path: '/imageshow',
name: 'imageshow', name: 'images',
component: imageShow component: imageShow
}, },
{ {
path: '/layershow/:file/:task/:relationId/:executor', path: '/layershow',
name: 'layershow', name: 'layers',
component: layerShow component: layerShow
} }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment