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

Commit d1ee5d09 by 李景熙

Merge branch 'develop' of https://gitlab.redhtc.com/Berlincen/DA-Platform into develop

parents 1fccb91f 79fadde8
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
data () { data () {
return { return {
task: null, task: null,
isCheck: '1', // isCheck: '1', 暂时没有用
dialogVisible: false, dialogVisible: false,
executors: [], executors: [],
file: undefined, file: undefined,
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
relationId: executor.relation_id, relationId: executor.relation_id,
executor, executor,
piece, piece,
operationSign:1,//作为审核任务标识 operationSign: 1 // 作为审核任务标识
} }
function goto (path) { function goto (path) {
self.$router.push({ name: path, params }) self.$router.push({ name: path, params })
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<p>发布者:{{task.creator}}</p> <p>发布者:{{task.creator}}</p>
<p>发布时间:{{task.date|formatDate}}</p> <p>发布时间:{{task.date|formatDate}}</p>
<el-divider></el-divider> <el-divider></el-divider>
<pieces-table :task-id="task.id" :userId="$store.state.userInfo.userId"> <pieces-table :task-id="task.id" withExecutor>
<template v-slot:option="slotProps"> <template v-slot:option="slotProps">
<el-button <el-button
type="primary" type="primary"
...@@ -29,8 +29,8 @@ export default { ...@@ -29,8 +29,8 @@ export default {
}, },
data () { data () {
return { return {
task: null, task: null
isCheck: '0' // isCheck: '0' 暂时没有用
} }
}, },
beforeMount () { beforeMount () {
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
task: this.task, task: this.task,
relationId: file.relation_id, relationId: file.relation_id,
piece, piece,
operationSign:0,//作为审核任务标识 operationSign: 0 // 作为审核任务标识
} }
function goto (path) { function goto (path) {
self.$router.push({ name: path, params }) self.$router.push({ name: path, params })
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<p>发布者:{{task.creator}}</p> <p>发布者:{{task.creator}}</p>
<p>发布时间:{{task.date|formatDate}}</p> <p>发布时间:{{task.date|formatDate}}</p>
<el-divider></el-divider> <el-divider></el-divider>
<pieces-table :task-id="task.id" showProgress> <pieces-table :task-id="task.id" showProgress withExecutor>
<template v-slot:option="slotProps"> <template v-slot:option="slotProps">
<el-button v-if="!slotProps.file.state" type="primary" size="mini" plain <el-button v-if="!slotProps.file.state" type="primary" size="mini" plain
@click="doOption(slotProps.file,slotProps.piece)" @click="doOption(slotProps.file,slotProps.piece)"
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
task: this.task, task: this.task,
relationId: file.relation_id, relationId: file.relation_id,
piece, piece,
operationSign:0,//作为标注任务标识 operationSign: 0 // 作为标注任务标识
} }
function goto (path) { function goto (path) {
self.$router.push({ name: path, params }) self.$router.push({ name: path, params })
......
...@@ -51,6 +51,10 @@ export default { ...@@ -51,6 +51,10 @@ export default {
showProgress: { showProgress: {
type: Boolean, type: Boolean,
default: false default: false
},
withExecutor: {
type: Boolean,
default: false
} }
}, },
data () { data () {
...@@ -113,7 +117,7 @@ export default { ...@@ -113,7 +117,7 @@ export default {
}, },
getFiles (pieceId) { getFiles (pieceId) {
var params = { pieceId } var params = { pieceId }
if (this.showProgress && !this.isCheck) params.executor = this.userId if (this.withExecutor) params.executor = this.userId
var self = this var self = this
this.axios.get('/file/getFiles', { this.axios.get('/file/getFiles', {
params params
......
...@@ -460,10 +460,7 @@ ...@@ -460,10 +460,7 @@
alert("加载错误!!!"); alert("加载错误!!!");
} }
}) })
if(this.ins == '1'){ if(this.ins == 2){
//设置
}
else if(this.ins == 2){
this.taskId = this.$route.params.taskId, this.taskId = this.$route.params.taskId,
this.axios({ this.axios({
method:'post', method:'post',
...@@ -491,7 +488,10 @@ ...@@ -491,7 +488,10 @@
} }
}) })
} }
else{
this.dynamicValidateForm.layerDomains[0].fileList.push({name:"默认文件",url:"默认路径",size:2333});
console.log(this.dynamicValidateForm.layerDomains[0].fileList);
}
},200); },200);
}, },
computed:{ computed:{
...@@ -687,6 +687,12 @@ ...@@ -687,6 +687,12 @@
}) })
}, },
handleRemoveL(file,fileList){ handleRemoveL(file,fileList){
if(file.url == "默认路径"){
alert("该文件系统备用,不可删除");
console.log(this.dynamicValidateForm.layerDomains)
return;
}
console.log("inin");
var flag = 0; var flag = 0;
for(var i = 0 ; i < this.dynamicValidateForm.layerDomains.length && flag == 0 ;i++){ for(var i = 0 ; i < this.dynamicValidateForm.layerDomains.length && flag == 0 ;i++){
for(var j = 0 ; j < this.dynamicValidateForm.layerDomains[i].fileList.length ; j++){ for(var j = 0 ; j < this.dynamicValidateForm.layerDomains[i].fileList.length ; j++){
...@@ -814,7 +820,7 @@ ...@@ -814,7 +820,7 @@
//添加图层分片 //添加图层分片
else if(ptype == 3){ else if(ptype == 3){
this.dynamicValidateForm.layerDomains.push({ this.dynamicValidateForm.layerDomains.push({
fileList:new Array(), fileList:[{name:"默认文件",url:"默认路径",size:2333}],
description:'', description:'',
key: Date.now() key: Date.now()
}); });
......
...@@ -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">
...@@ -53,6 +55,7 @@ ...@@ -53,6 +55,7 @@
</template> </template>
<script> <script>
import FileSaver from 'file-saver';
export default { export default {
data() { data() {
return { return {
...@@ -105,6 +108,7 @@ export default { ...@@ -105,6 +108,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 +121,7 @@ export default { ...@@ -117,7 +121,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 +239,24 @@ export default { ...@@ -235,6 +239,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">
...@@ -97,6 +99,7 @@ ...@@ -97,6 +99,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,
...@@ -307,6 +311,23 @@ export default { ...@@ -307,6 +311,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();
......
...@@ -160,6 +160,13 @@ def create_layers(layer_list): ...@@ -160,6 +160,13 @@ def create_layers(layer_list):
return res return res
# 根据 relationId 删除图层
def delete_layer(relation_id):
obj = Layer.objects(relationId=relation_id)
if obj:
obj.delete()
# 地标实体 # 地标实体
class LandmarkEntity(db.EmbeddedDocument): class LandmarkEntity(db.EmbeddedDocument):
landmarkId = db.IntField(required=True) landmarkId = db.IntField(required=True)
......
参加过一次软院心理讲座,但是未录入
有博雅记录的一共4次
总共5次博雅
\ No newline at end of file
参加过一次软院心理讲座,但是未录入
有博雅记录的一共4次
总共5次博雅
\ No newline at end of file
...@@ -70,8 +70,26 @@ def save_layer(): ...@@ -70,8 +70,26 @@ def save_layer():
'message': ret.message, 'message': ret.message,
'data': ret.data 'data': ret.data
} }
if ret.code != 0:
rid = layer_info['relationId']
if not Relation.set_result_pic(rid):
res['code'] = 0
res['message'] = '保存失败,更改标注关系状态失败,不存在此标注任务'
Image.delete_layer(rid)
return json.dumps(res, ensure_ascii=False) return json.dumps(res, ensure_ascii=False)
import views.uploadDownload as upd
@image.route("/image/exportImage/<relationId>", methods=['GET'])
def export_image(relationId):
img = Image.objects(relationId=relationId)
image_url = img['imageUrl'].split('/')[-1]
upd.download('')
return False
# 保存图片标注结果的测试数据 # 保存图片标注结果的测试数据
# { # {
# "imageList": [ # "imageList": [
......
...@@ -224,3 +224,18 @@ def getExcelContent(): ...@@ -224,3 +224,18 @@ def getExcelContent():
data.update({"content": statement}) data.update({"content": statement})
return_dict["result"] = data return_dict["result"] = data
return json.dumps(return_dict, ensure_ascii=False) return json.dumps(return_dict, ensure_ascii=False)
# 下载文本
@uploadDownload.route('/downloadContent', methods=['POST'])
def downloadContent():
get_Data = request.get_data()
get_Data = json.loads(get_Data)
documentId = get_Data.get('documentId')
result = mongodbApi.findOne(collectionTest, {"documentId": documentId})
url = result.get('textUrl')
file_dir = os.path.join(basedir, UPLOAD_FOLDER, url)
return send_file(file_dir, as_attachment=True, attachment_filename=url)
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