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

Commit a9ff8f43 by wyy

文本导出

parent d7c6ee91
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
<br /> <br />
<div> <div>
<el-button class="button1" type="primary" @click="submit()">提交</el-button> <el-button class="button1" type="primary" @click="submit()">提交</el-button>
<el-button class="button2" type="primary" @click="exportContent()">导出文本</el-button>
<el-button class="button3" type="primary" @click="exportTokenList()">导出标注</el-button>
</div> </div>
<!-- 弹窗--> <!-- 弹窗-->
...@@ -67,6 +69,9 @@ ...@@ -67,6 +69,9 @@
</template> </template>
<script> <script>
import FileSaver from 'file-saver';
export default { export default {
data() { data() {
return { return {
...@@ -112,6 +117,7 @@ export default { ...@@ -112,6 +117,7 @@ export default {
this.file = this.$route.params.file; this.file = this.$route.params.file;
this.task = this.$route.params.task; this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId; this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
}, },
methods: { methods: {
// 插入数据库 // 插入数据库
...@@ -124,7 +130,7 @@ export default { ...@@ -124,7 +130,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/insertDocument", url: "/textAnnotation/insertDocument",
data: { data: {
templateId: 1, // TODO 模板id templateId: this.piece.template, // 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,
...@@ -220,7 +226,7 @@ export default { ...@@ -220,7 +226,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/getOneTemplate", url: "/textAnnotation/getOneTemplate",
data: { data: {
templateId: 1, // TODO 待沟通,通用那边没给这个接口,还有这个在后端用str包了,这里用int就行,后期改成写了实体再自己取属性列表吧 templateId: this.piece.template, // TODO 待沟通,通用那边没给这个接口,还有这个在后端用str包了,这里用int就行,后期改成写了实体再自己取属性列表吧
creatorId: this.task.creator_id creatorId: this.task.creator_id
} }
}).then(res => { }).then(res => {
...@@ -467,7 +473,26 @@ export default { ...@@ -467,7 +473,26 @@ export default {
name: "ongoingtaskdetail", name: "ongoingtaskdetail",
params: { task: encodeURIComponent(JSON.stringify(this.task)) } params: { task: encodeURIComponent(JSON.stringify(this.task)) }
}); });
} },
exportContent() {
this.axios({
method: "post",
url: "/files/downloadContent",
data: {
// documentId: "9aa2d69cc66411ea879e54e1ad87433a"
documentId:this.documentId
}
}).then(res => {
console.log(res)
// let blob = new Blob([res], {type : 'application/octet-stream'});
let blob = new Blob([res], {type : 'text/plain'});
FileSaver.saveAs(blob);
});
},
exportTokenList() {
let blob = new Blob([JSON.stringify(this.tokenList)], {type : 'application/json'});
FileSaver.saveAs(blob);
},
}, },
mounted: function() { mounted: function() {
this.insertDocument(); this.insertDocument();
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
<div class="button1"> <div class="button1">
<el-button type="primary" @click="commentScore = true">打分</el-button> <el-button type="primary" @click="commentScore = true">打分</el-button>
<el-button type="primary" @click="submit()">提交</el-button> <el-button type="primary" @click="submit()">提交</el-button>
<el-button class="button2" type="primary" @click="exportContent()">导出文本</el-button>
<el-button class="button3" type="primary" @click="exportTokenList()">导出标注</el-button>
<el-dialog title="请打分" :visible.sync="commentScore" width="400px"> <el-dialog title="请打分" :visible.sync="commentScore" width="400px">
<el-form :model="scoreForm"> <el-form :model="scoreForm">
<el-form-item label="标注准确率" :label-width="formLabelWidth"> <el-form-item label="标注准确率" :label-width="formLabelWidth">
...@@ -105,6 +107,7 @@ export default { ...@@ -105,6 +107,7 @@ export default {
this.file = this.$route.params.file; this.file = this.$route.params.file;
this.task = this.$route.params.task; this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId; this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
}, },
methods: { methods: {
// 插入数据库 // 插入数据库
...@@ -117,7 +120,7 @@ export default { ...@@ -117,7 +120,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/insertDocument", url: "/textAnnotation/insertDocument",
data: { data: {
templateId: 1, // TODO 模板id templateId: this.piece.template, // 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,
...@@ -235,6 +238,24 @@ export default { ...@@ -235,6 +238,24 @@ export default {
this.$message("打分成功"); this.$message("打分成功");
} }
}, },
exportContent() {
this.axios({
method: "post",
url: "/files/downloadContent",
data: {
documentId:this.documentId
}
}).then(res => {
console.log(res)
// let blob = new Blob([res], {type : 'application/octet-stream'});
let blob = new Blob([res], {type : 'text/plain'});
FileSaver.saveAs(blob);
});
},
exportTokenList() {
let blob = new Blob([JSON.stringify(this.tokenList)], {type : 'application/json'});
FileSaver.saveAs(blob);
},
submit() { submit() {
alert("打分成功"); alert("打分成功");
this.$router.push({ path: "/taskhall" }); this.$router.push({ path: "/taskhall" });
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
<br /> <br />
<div> <div>
<el-button class="button1" type="primary" @click="submit()">提交</el-button> <el-button class="button1" type="primary" @click="submit()">提交</el-button>
<el-button class="button2" type="primary" @click="exportContent()">导出文本</el-button>
<el-button class="button3" type="primary" @click="exportTokenList()">导出标注</el-button>
</div> </div>
</div> </div>
</el-main> </el-main>
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
</template> </template>
<script> <script>
import FileSaver from 'file-saver';
export default { export default {
data() { data() {
return { return {
...@@ -90,6 +93,7 @@ export default { ...@@ -90,6 +93,7 @@ export default {
this.file = this.$route.params.file; this.file = this.$route.params.file;
this.task = this.$route.params.task; this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId; this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
}, },
methods: { methods: {
// 插入数据库 // 插入数据库
...@@ -102,7 +106,7 @@ export default { ...@@ -102,7 +106,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/insertDocument", url: "/textAnnotation/insertDocument",
data: { data: {
templateId: 1, // TODO 模板id templateId: this.piece.template, // 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,
...@@ -190,6 +194,24 @@ export default { ...@@ -190,6 +194,24 @@ export default {
} }
}); });
}, },
exportContent() {
this.axios({
method: "post",
url: "/files/downloadContent",
data: {
documentId:this.documentId
}
}).then(res => {
console.log(res)
// let blob = new Blob([res], {type : 'application/octet-stream'});
let blob = new Blob([res], {type : 'text/plain'});
FileSaver.saveAs(blob);
});
},
exportTokenList() {
let blob = new Blob([JSON.stringify(this.tokenList)], {type : 'application/json'});
FileSaver.saveAs(blob);
},
submit() { submit() {
this.$router.push({ path: "/taskhall" }); this.$router.push({ path: "/taskhall" });
} }
......
...@@ -75,6 +75,8 @@ ...@@ -75,6 +75,8 @@
<br /> <br />
<div> <div>
<el-button type="primary" @click="submit()">提交</el-button> <el-button type="primary" @click="submit()">提交</el-button>
<el-button class="button2" type="primary" @click="exportContent()">导出文本</el-button>
<el-button class="button3" type="primary" @click="exportTokenList()">导出标注</el-button>
</div> </div>
<!-- 弹窗--> <!-- 弹窗-->
...@@ -103,6 +105,7 @@ ...@@ -103,6 +105,7 @@
</template> </template>
<script> <script>
import FileSaver from 'file-saver';
export default { export default {
data() { data() {
return { return {
...@@ -162,6 +165,7 @@ export default { ...@@ -162,6 +165,7 @@ export default {
this.file = this.$route.params.file; this.file = this.$route.params.file;
this.task = this.$route.params.task; this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId; this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
}, },
methods: { methods: {
// 插入数据库 // 插入数据库
...@@ -173,7 +177,7 @@ export default { ...@@ -173,7 +177,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/insertDocument", url: "/textAnnotation/insertDocument",
data: { data: {
templateId: 1, // TODO 模板id templateId: this.piece.template, // 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,
...@@ -260,7 +264,7 @@ export default { ...@@ -260,7 +264,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/getOneTemplate", url: "/textAnnotation/getOneTemplate",
data: { data: {
templateId: 1, templateId: this.piece.template,
creatorId: this.task.creator_id creatorId: this.task.creator_id
} }
}).then(res => { }).then(res => {
...@@ -515,7 +519,24 @@ export default { ...@@ -515,7 +519,24 @@ export default {
name: "ongoingtaskdetail", name: "ongoingtaskdetail",
params: { task: encodeURIComponent(JSON.stringify(this.task)) } params: { task: encodeURIComponent(JSON.stringify(this.task)) }
}); });
} },
exportContent() {
this.axios({
method: "post",
url: "/files/downloadContent",
data: {
documentId:this.documentId
},
responseType: "blob"
}).then(res => {
let blob = new Blob([res], {type : 'application/vnd.ms-excel;charset=utf-8',});
FileSaver.saveAs(blob,"download.xlsx");
});
},
exportTokenList() {
let blob = new Blob([JSON.stringify(this.tokenList)], {type : 'application/json'});
FileSaver.saveAs(blob);
},
}, },
mounted: function() { mounted: function() {
this.insertDocument(); this.insertDocument();
......
...@@ -77,6 +77,8 @@ ...@@ -77,6 +77,8 @@
<!--div v-if="this.$route.query.isCheck == '1'"--> <!--div v-if="this.$route.query.isCheck == '1'"-->
<div> <div>
<el-button type="primary" @click="submit()">提交</el-button> <el-button type="primary" @click="submit()">提交</el-button>
<el-button class="button2" type="primary" @click="exportContent()">导出文本</el-button>
<el-button class="button3" type="primary" @click="exportTokenList()">导出标注</el-button>
</div> </div>
</div> </div>
</el-main> </el-main>
...@@ -85,6 +87,7 @@ ...@@ -85,6 +87,7 @@
</template> </template>
<script> <script>
import FileSaver from 'file-saver';
export default { export default {
data() { data() {
return { return {
...@@ -150,6 +153,7 @@ export default { ...@@ -150,6 +153,7 @@ export default {
this.file = this.$route.params.file; this.file = this.$route.params.file;
this.task = this.$route.params.task; this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId; this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
}, },
methods: { methods: {
// 插入数据库 // 插入数据库
...@@ -161,7 +165,7 @@ export default { ...@@ -161,7 +165,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/insertDocument", url: "/textAnnotation/insertDocument",
data: { data: {
templateId: 1, // TODO 模板id templateId: this.piece.template, // 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,
...@@ -241,6 +245,23 @@ export default { ...@@ -241,6 +245,23 @@ export default {
} }
}); });
}, },
exportContent() {
this.axios({
method: "post",
url: "/files/downloadContent",
data: {
documentId:this.documentId
},
responseType: "blob"
}).then(res => {
let blob = new Blob([res], {type : 'application/vnd.ms-excel;charset=utf-8',});
FileSaver.saveAs(blob,"download.xlsx");
});
},
exportTokenList() {
let blob = new Blob([JSON.stringify(this.tokenList)], {type : 'application/json'});
FileSaver.saveAs(blob);
},
submit() { submit() {
this.$router.push({ path: "/taskhall" }); this.$router.push({ path: "/taskhall" });
......
...@@ -78,6 +78,8 @@ ...@@ -78,6 +78,8 @@
<div> <div>
<el-button type="primary" @click="commentScore = true">打分</el-button> <el-button type="primary" @click="commentScore = true">打分</el-button>
<el-button type="primary" @click="submit()">提交</el-button> <el-button type="primary" @click="submit()">提交</el-button>
<el-button class="button2" type="primary" @click="exportContent()">导出文本</el-button>
<el-button class="button3" type="primary" @click="exportTokenList()">导出标注</el-button>
<el-dialog title="请打分" :visible.sync="commentScore" width="400px"> <el-dialog title="请打分" :visible.sync="commentScore" width="400px">
<el-form :model="scoreForm"> <el-form :model="scoreForm">
<el-form-item label="标注准确率" :label-width="formLabelWidth"> <el-form-item label="标注准确率" :label-width="formLabelWidth">
...@@ -162,6 +164,7 @@ export default { ...@@ -162,6 +164,7 @@ export default {
this.file = this.$route.params.file; this.file = this.$route.params.file;
this.task = this.$route.params.task; this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId; this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
}, },
methods: { methods: {
// 插入数据库 // 插入数据库
...@@ -173,7 +176,7 @@ export default { ...@@ -173,7 +176,7 @@ export default {
method: "post", method: "post",
url: "/textAnnotation/insertDocument", url: "/textAnnotation/insertDocument",
data: { data: {
templateId: 1, // TODO 模板id templateId: this.piece.template, // 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,
...@@ -307,6 +310,23 @@ export default { ...@@ -307,6 +310,23 @@ export default {
} }
}) })
}, },
exportContent() {
this.axios({
method: "post",
url: "/files/downloadContent",
data: {
documentId:this.documentId
},
responseType: "blob"
}).then(res => {
let blob = new Blob([res], {type : 'application/vnd.ms-excel;charset=utf-8',});
FileSaver.saveAs(blob,"download.xlsx");
});
},
exportTokenList() {
let blob = new Blob([JSON.stringify(this.tokenList)], {type : 'application/json'});
FileSaver.saveAs(blob);
}
}, },
mounted: function() { mounted: function() {
this.insertDocument(); this.insertDocument();
......
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