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

Commit 734bb0fe by 李严凡

创建任务修改

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