文档服务地址: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 {
data () {
return {
task: null,
isCheck: '1',
// isCheck: '1', 暂时没有用
dialogVisible: false,
executors: [],
file: undefined,
......@@ -73,7 +73,7 @@ export default {
relationId: executor.relation_id,
executor,
piece,
operationSign:1,//作为审核任务标识
operationSign: 1 // 作为审核任务标识
}
function goto (path) {
self.$router.push({ name: path, params })
......
......@@ -5,7 +5,7 @@
<p>发布者:{{task.creator}}</p>
<p>发布时间:{{task.date|formatDate}}</p>
<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">
<el-button
type="primary"
......@@ -29,8 +29,8 @@ export default {
},
data () {
return {
task: null,
isCheck: '0'
task: null
// isCheck: '0' 暂时没有用
}
},
beforeMount () {
......@@ -43,7 +43,7 @@ export default {
task: this.task,
relationId: file.relation_id,
piece,
operationSign:0,//作为审核任务标识
operationSign: 0 // 作为审核任务标识
}
function goto (path) {
self.$router.push({ name: path, params })
......
......@@ -5,7 +5,7 @@
<p>发布者:{{task.creator}}</p>
<p>发布时间:{{task.date|formatDate}}</p>
<el-divider></el-divider>
<pieces-table :task-id="task.id" showProgress>
<pieces-table :task-id="task.id" showProgress withExecutor>
<template v-slot:option="slotProps">
<el-button v-if="!slotProps.file.state" type="primary" size="mini" plain
@click="doOption(slotProps.file,slotProps.piece)"
......@@ -42,7 +42,7 @@ export default {
task: this.task,
relationId: file.relation_id,
piece,
operationSign:0,//作为标注任务标识
operationSign: 0 // 作为标注任务标识
}
function goto (path) {
self.$router.push({ name: path, params })
......
......@@ -51,6 +51,10 @@ export default {
showProgress: {
type: Boolean,
default: false
},
withExecutor: {
type: Boolean,
default: false
}
},
data () {
......@@ -113,7 +117,7 @@ export default {
},
getFiles (pieceId) {
var params = { pieceId }
if (this.showProgress && !this.isCheck) params.executor = this.userId
if (this.withExecutor) params.executor = this.userId
var self = this
this.axios.get('/file/getFiles', {
params
......
......@@ -460,10 +460,7 @@
alert("加载错误!!!");
}
})
if(this.ins == '1'){
//设置
}
else if(this.ins == 2){
if(this.ins == 2){
this.taskId = this.$route.params.taskId,
this.axios({
method:'post',
......@@ -491,7 +488,10 @@
}
})
}
else{
this.dynamicValidateForm.layerDomains[0].fileList.push({name:"默认文件",url:"默认路径",size:2333});
console.log(this.dynamicValidateForm.layerDomains[0].fileList);
}
},200);
},
computed:{
......@@ -687,6 +687,12 @@
})
},
handleRemoveL(file,fileList){
if(file.url == "默认路径"){
alert("该文件系统备用,不可删除");
console.log(this.dynamicValidateForm.layerDomains)
return;
}
console.log("inin");
var flag = 0;
for(var i = 0 ; i < this.dynamicValidateForm.layerDomains.length && flag == 0 ;i++){
for(var j = 0 ; j < this.dynamicValidateForm.layerDomains[i].fileList.length ; j++){
......@@ -814,7 +820,7 @@
//添加图层分片
else if(ptype == 3){
this.dynamicValidateForm.layerDomains.push({
fileList:new Array(),
fileList:[{name:"默认文件",url:"默认路径",size:2333}],
description:'',
key: Date.now()
});
......
......@@ -40,6 +40,8 @@
<br />
<div>
<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>
<!-- 弹窗-->
......@@ -67,6 +69,9 @@
</template>
<script>
import FileSaver from 'file-saver';
export default {
data() {
return {
......@@ -112,6 +117,7 @@ export default {
this.file = this.$route.params.file;
this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
},
methods: {
// 插入数据库
......@@ -124,7 +130,7 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: 1, // TODO 模板id
templateId: this.piece.template, // TODO 模板id
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
textUrl: this.file.url,
......@@ -220,7 +226,7 @@ export default {
method: "post",
url: "/textAnnotation/getOneTemplate",
data: {
templateId: 1, // TODO 待沟通,通用那边没给这个接口,还有这个在后端用str包了,这里用int就行,后期改成写了实体再自己取属性列表吧
templateId: this.piece.template, // TODO 待沟通,通用那边没给这个接口,还有这个在后端用str包了,这里用int就行,后期改成写了实体再自己取属性列表吧
creatorId: this.task.creator_id
}
}).then(res => {
......@@ -467,7 +473,26 @@ export default {
name: "ongoingtaskdetail",
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() {
this.insertDocument();
......
......@@ -34,6 +34,8 @@
<div class="button1">
<el-button type="primary" @click="commentScore = true">打分</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-form :model="scoreForm">
<el-form-item label="标注准确率" :label-width="formLabelWidth">
......@@ -53,6 +55,7 @@
</template>
<script>
import FileSaver from 'file-saver';
export default {
data() {
return {
......@@ -105,6 +108,7 @@ export default {
this.file = this.$route.params.file;
this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
},
methods: {
// 插入数据库
......@@ -117,7 +121,7 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: 1, // TODO 模板id
templateId: this.piece.template, // TODO 模板id
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
textUrl: this.file.url,
......@@ -235,6 +239,24 @@ export default {
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() {
alert("打分成功");
this.$router.push({ path: "/taskhall" });
......
......@@ -31,6 +31,8 @@
<br />
<div>
<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>
</el-main>
......@@ -39,6 +41,7 @@
</template>
<script>
import FileSaver from 'file-saver';
export default {
data() {
return {
......@@ -90,6 +93,7 @@ export default {
this.file = this.$route.params.file;
this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
},
methods: {
// 插入数据库
......@@ -102,7 +106,7 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: 1, // TODO 模板id
templateId: this.piece.template, // TODO 模板id
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
textUrl: this.file.url,
......@@ -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() {
this.$router.push({ path: "/taskhall" });
}
......
......@@ -75,6 +75,8 @@
<br />
<div>
<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>
<!-- 弹窗-->
......@@ -103,6 +105,7 @@
</template>
<script>
import FileSaver from 'file-saver';
export default {
data() {
return {
......@@ -162,6 +165,7 @@ export default {
this.file = this.$route.params.file;
this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
},
methods: {
// 插入数据库
......@@ -173,7 +177,7 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: 1, // TODO 模板id
templateId: this.piece.template, // TODO 模板id
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
textUrl: this.file.url,
......@@ -260,7 +264,7 @@ export default {
method: "post",
url: "/textAnnotation/getOneTemplate",
data: {
templateId: 1,
templateId: this.piece.template,
creatorId: this.task.creator_id
}
}).then(res => {
......@@ -515,7 +519,24 @@ export default {
name: "ongoingtaskdetail",
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() {
this.insertDocument();
......
......@@ -77,6 +77,8 @@
<!--div v-if="this.$route.query.isCheck == '1'"-->
<div>
<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>
</el-main>
......@@ -85,6 +87,7 @@
</template>
<script>
import FileSaver from 'file-saver';
export default {
data() {
return {
......@@ -150,6 +153,7 @@ export default {
this.file = this.$route.params.file;
this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
},
methods: {
// 插入数据库
......@@ -161,7 +165,7 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: 1, // TODO 模板id
templateId: this.piece.template, // TODO 模板id
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
textUrl: this.file.url,
......@@ -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() {
this.$router.push({ path: "/taskhall" });
......
......@@ -78,6 +78,8 @@
<div>
<el-button type="primary" @click="commentScore = true">打分</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-form :model="scoreForm">
<el-form-item label="标注准确率" :label-width="formLabelWidth">
......@@ -97,6 +99,7 @@
</template>
<script>
import FileSaver from 'file-saver';
export default {
data() {
return {
......@@ -162,6 +165,7 @@ export default {
this.file = this.$route.params.file;
this.task = this.$route.params.task;
this.relationId = this.$route.params.relationId;
this.piece = this.$route.params.piece;
},
methods: {
// 插入数据库
......@@ -173,7 +177,7 @@ export default {
method: "post",
url: "/textAnnotation/insertDocument",
data: {
templateId: 1, // TODO 模板id
templateId: this.piece.template, // TODO 模板id
annotatorId: this.$store.state.userInfo.userId,
creatorId: this.task.creator_id,
textUrl: this.file.url,
......@@ -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() {
this.insertDocument();
......
......@@ -160,6 +160,13 @@ def create_layers(layer_list):
return res
# 根据 relationId 删除图层
def delete_layer(relation_id):
obj = Layer.objects(relationId=relation_id)
if obj:
obj.delete()
# 地标实体
class LandmarkEntity(db.EmbeddedDocument):
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():
'message': ret.message,
'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)
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": [
......
......@@ -224,3 +224,18 @@ def getExcelContent():
data.update({"content": statement})
return_dict["result"] = data
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