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