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

Commit cb7b643f by 郭婉茹

Json显示

parent 1591e93f
......@@ -67,8 +67,7 @@
</template>
<script>
import FileSaver from 'file-saver';
import FileSaver from "file-saver";
export default {
data() {
......@@ -88,7 +87,7 @@ export default {
begin: 0,
end: 0,
entityId: "",
attribute: []
attribute: [],
},
token: {
tokenId: "",
......@@ -96,7 +95,7 @@ export default {
begin: 0,
end: 0,
entityId: "",
attribute: []
attribute: [],
},
// 实体属性列表
tokenList: [],
......@@ -106,8 +105,8 @@ export default {
treeData: [],
defaultProps: {
children: "children",
label: "label"
}
label: "label",
},
};
},
beforeMount() {
......@@ -128,15 +127,15 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: this.piece.template, // TODO 模板id
templateId: this.piece.template,
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
relationId: this.relationId,
textUrl: this.file.url,
type: "text",
fileId: this.file.id
}
}).then(res => {
fileId: this.file.id,
},
}).then((res) => {
if (res.return_code == 200) {
this.documentId = res.result;
//console.log("this.documentId: " + this.documentId);
......@@ -146,7 +145,7 @@ export default {
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
......@@ -160,9 +159,9 @@ export default {
method: "post",
url: "/files/getFileContent",
data: {
documentId: this.documentId
}
}).then(res => {
documentId: this.documentId,
},
}).then((res) => {
if (res.return_code == 200) {
// console.log(" getContent: " + res.result);
this.content = res.result;
......@@ -173,7 +172,7 @@ export default {
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
......@@ -187,11 +186,11 @@ export default {
method: "post",
url: "/textAnnotation/getTokenList",
data: {
documentId: this.documentId
}
}).then(res => {
documentId: this.documentId,
},
}).then((res) => {
if (res.return_code == 200) {
res.result.forEach(element => {
res.result.forEach((element) => {
this.tokenInit = element;
console.log(" token: " + JSON.stringify(this.tokenInit));
this.tokenList.push(this.tokenInit);
......@@ -213,7 +212,7 @@ export default {
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
......@@ -225,10 +224,10 @@ export default {
method: "post",
url: "/textAnnotation/getOneTemplate",
data: {
templateId: this.piece.template, // TODO 待沟通,通用那边没给这个接口,还有这个在后端用str包了,这里用int就行,后期改成写了实体再自己取属性列表吧
creatorId: this.task.creator_id
}
}).then(res => {
templateId: this.piece.template,
creatorId: this.task.creator_id,
},
}).then((res) => {
if (res.return_code == 200) {
//console.log(res.result)
// 实体
......@@ -238,7 +237,7 @@ export default {
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
......@@ -282,13 +281,13 @@ export default {
this.ifAlert = false;
let res = this.$refs.tree.getCheckedNodes();
let arr = [];
res.forEach(item => {
res.forEach((item) => {
arr.push(item.label); // 属性
});
if (arr == []) {
this.$message({
message: "未选择属性",
type: "info"
type: "info",
});
} else {
// 保存token
......@@ -302,10 +301,10 @@ export default {
begin: this.token.begin,
end: this.token.end,
entityId: this.token.entityId,
attribute: arr
}
}
}).then(res => {
attribute: arr,
},
},
}).then((res) => {
if (res.return_code == 200) {
// 渲染文本
let replaceReg = new RegExp(this.token.word, "g"); // 匹配关键字正则
......@@ -328,7 +327,7 @@ export default {
begin: this.token.begin,
end: this.token.end,
entityId: this.token.entityId,
attribute: arr
attribute: arr,
};
this.tokenList.push(token);
console.log(" token uploadToken" + JSON.stringify(token));
......@@ -338,12 +337,12 @@ export default {
);
this.$message({
message: "已保存",
type: "success"
type: "success",
});
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
......@@ -363,19 +362,19 @@ export default {
url: "/textAnnotation/deleteToken",
data: {
documentId: this.documentId,
tokenId: tag.tokenId
}
}).then(res => {
tokenId: tag.tokenId,
},
}).then((res) => {
if (res.return_code == 200) {
this.$message({
type: "info",
message: "已删除"
message: "已删除",
});
this.tokenList.splice(this.tokenList.indexOf(tag), 1);
this.content = this.contentWithoutColor;
console.log(" this.tokenList: " + JSON.stringify(this.tokenList));
console.log(" this.content: " + this.content);
this.tokenList.forEach(element => {
this.tokenList.forEach((element) => {
console.log(" token: " + JSON.stringify(element));
let replaceReg = new RegExp(element.word, "g"); // 匹配关键字正则
let replaceString =
......@@ -394,7 +393,7 @@ export default {
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
......@@ -414,15 +413,15 @@ export default {
url: "/textAnnotation/deleteToken",
data: {
documentId: this.documentId,
tokenId: tag.tokenId
}
}).then(res => {
tokenId: tag.tokenId,
},
}).then((res) => {
if (res.return_code == 200) {
this.tokenList.splice(this.tokenList.indexOf(tag), 1);
this.content = this.contentWithoutColor;
console.log(" this.tokenList: " + JSON.stringify(this.tokenList));
console.log(" this.content: " + this.content);
this.tokenList.forEach(element => {
this.tokenList.forEach((element) => {
console.log(" token: " + JSON.stringify(element));
let replaceReg = new RegExp(element.word, "g"); // 匹配关键字正则
let replaceString =
......@@ -441,42 +440,42 @@ export default {
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
},
// 提交已标注文档 // TODO 跳转到我的任务,已标注文档标注按钮消失,然后判定整个任务都标注完成后跳转到已完成任务界面,这个就交给通用的大佬们了
// 提交已标注文档
submit() {
// console.log("hello" + JSON.stringify(this.task))
this.axios({
method: "post",
url: "/textAnnotation/revDocumentState",
data: {
documentId: this.documentId
}
}).then(res => {
documentId: this.documentId,
},
}).then((res) => {
if (res.return_code == 200) {
this.$message({
message: "已保存",
type: "success"
type: "success",
});
} else {
this.$message({
message: res.return_info,
type: "error"
type: "error",
});
}
});
this.$router.replace({
name: "ongoingtaskdetail",
params: { task: encodeURIComponent(JSON.stringify(this.task)) }
params: { task: encodeURIComponent(JSON.stringify(this.task)) },
});
},
},
mounted: function() {
mounted: function () {
this.insertDocument();
}
},
};
</script>
......
......@@ -18,6 +18,7 @@ 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 Json from '../components/textAnnotation/Json'
import imageAnnotiation from '../components/imageAnnotation/imageAnnotiation'
import layerAnnotation from '../components/imageAnnotation/layerAnnotation'
import layerShow from '../components/imageAnnotation/layerShow'
......@@ -119,6 +120,11 @@ export default new Router({
component: TabledCheck
},
{
path: '/Json',
name: 'json',
component: Json
},
{
path: '/image/:file/:task/:relationId/:piece',
name: 'image',
component: imageAnnotiation
......
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