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

Commit 734bb0fe by 李严凡

创建任务修改

parent e7f3c96d
......@@ -18,19 +18,19 @@
:key="domain.key"
:prop="'domains.' + index + '.value'">
<el-collapse-item
:title="'文本任务分片'+(++index)"
:title="'文本任务分片'+(1+index)"
:name="index" style="border-bottom: 1px solid;border-bottom-color:white;font-size: 14px">
<!-- 上传图片-->
<el-row :gutter="20" >
<el-col span="8">
<el-upload
class="upload-demo"
action="http:://localhost:9100/api/files/upload"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreviewF"
:on-remove="handleRemoveF"
:on-success="uploadSuccessF"
multiple
:http-request="uploadFile"
:limit="7"
:data="'3:'+(index)"
:on-exceed="handleExceed"
......@@ -76,19 +76,20 @@
:key="domain.key"
:prop="'domains.' + index + '.value'">
<el-collapse-item
:title="'图片任务分片'+(++index)"
:title="'图片任务分片'+(1+index)"
:name="index" style="border-bottom: 1px solid;border-bottom-color:white;font-size: 14px">
<!-- 上传图片-->
<el-row :gutter="20" >
<el-col span="6">
<el-upload
class="upload-demo"
action="http:://localhost:9100/api/files/upload"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="removeSuccess"
:before-remove="beforeRemove"
:on-success="uploadSuccessP"
:data="'3:'+(index)"
:http-request="uploadFile"
multiple
:limit="7"
:on-exceed="handleExceed"
......@@ -120,11 +121,11 @@
<el-form-item>
<!-- 采用手风琴实现折叠-->
<el-collapse v-model="activeName" accordion>
<el-form-item v-for="(domain, index) in dynamicValidateForm.layerDoamins"
<el-form-item v-for="(domain, index) in dynamicValidateForm.layerDomains"
:key="domain.key"
:prop="'domains.' + index + '.value'">
<el-collapse-item
:title="'图层任务分片'+(++index)"
:title="'图层任务分片'+(1+index)"
:name="index" style="border-bottom: 1px solid;border-bottom-color:white;font-size: 14px;">
<!-- 上传图片-->
<el-row :gutter="20" >
......@@ -132,11 +133,11 @@
<!-- 上传文件传参3表示图层分片,index表示第几个分片,用“:”分割-->
<el-upload
class="upload-demo"
action="http:://localhost:9100/api/files/upload"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:on-success="uploadSuccessL"
:http-request="uploadFile"
multiple
:data="'3:'+(index)"
:limit="7"
......@@ -215,20 +216,7 @@
</div>
</template>
<script>
// export default {
// }
export default {
methods: {
handleRemove (file, fileList) {
console.log(file, fileList)
},
handlePreview (file) {
console.log(file)
}
}
}
</script>
<style scope lang="scss">
@import '../assets/scss/config.scss';
......@@ -358,6 +346,7 @@ export default {
data: JSON.parse(JSON.stringify(data)),
data: JSON.parse(JSON.stringify(data)),
fName:'',
url:'',
taskName:''
};
},
......@@ -367,29 +356,58 @@ export default {
}
},
methods: {
uploadFile(fileObj){
let formData = new FormData();
formData.set("file",fileObj.file);
this.axios({
method:'post',
url:'http:://localhost:9100/api/files/upload',
params:formData,
headers:{
"Content-type":"multipart/form-data"
}
}).then(res=>{
if(res.code == 0)
alert("文件上传失败,请重新上传");
else{
console(res.data.url);
}
})
},
setIndex(index){
this.Index = index;
},
//上传文件
uploadSuccessF(response,file,fileList){
this.fName=file.name;
this.dynamicValidateForm.domains[this.Index - 1].fileName.push(this.fName);
this.url=file.url;
this.dynamicValidateForm.domains[this.Index ].fileName.push({name:this.fName,url:this.url});
//console.log(this.fName);
//console.log(this.taskName);
// console.log(this.dynamicValidateForm.domains[this.Index].fileName);
},
uploadSuccessP(response,file,fileList){
this.fName=file.name;
this.dynamicValidateForm.pictureDomains[this.Index - 1].fileName.push(this.fName);
this.url=file.url;
this.dynamicValidateForm.pictureDomains[this.Index ].fileName.push({name:this.fName,url:this.url});
//console.log(this.fName);
//console.log(this.taskName);
},
uploadSuccessL(response,file,fileList){
this.fName=file.name;
this.dynamicValidateForm.layerDoamins[this.Index - 1].fileName.push(this.fName);
this.url=file.url;
this.dynamicValidateForm.layerDoamins[this.Index ].fileName.push({name:this.fName,url:this.url});
// console.log(this.fName);
// console.log(this.dynamicValidateForm.layerDoamins[this.Index].fileName);
},
removeSuccess(file,fileList){
console.log("del:"+file.name);
//删除上传的文件
handleRemoveF(file,fileList){
},
handleRemoveP(file,fileList){
},
handleRemoveL(file,fileList){
},
submitForm(formName) {
console.log(this.dynamicValidateForm);
......@@ -461,8 +479,9 @@ export default {
key: Date.now()
});
}
//添加图层分片
else if(ptype == 3){
this.dynamicValidateForm.layerDoamins.push({
this.dynamicValidateForm.layerDomains.push({
fileName:new Array(),
textarea:'',
key: Date.now()
......
from flask import Flask
from flask_cors import CORS
# from views.uploadDownload import uploadDownload
# from views.textAnnotation import textAnnotation
from views.user import user
......
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