Commit f08e5544 authored by lixy's avatar lixy

通用设置-多图上传

parent 529bf751
......@@ -40,3 +40,15 @@ export function delGeneral(id) {
});
}
export function uploadFiles(params) {
return fetch({
url: '/api/universal/file/app/unauth/uploadFiles',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
data: params
});
}
......@@ -75,6 +75,20 @@
<el-button v-else type="primary" @click="update('dialogFrom')">确 定</el-button>
</div>
</el-dialog>
<!--多图上传-->
<!--<el-upload-->
<!--:multiple="multiple"-->
<!--action="${pageContext.request.contextPath}/lookup/editEvidence/123"-->
<!--list-type="picture-card"-->
<!--:auto-upload="false"-->
<!--:http-request="uploadFile"-->
<!--ref="upload"-->
<!--&gt;-->
<!--<i class="el-icon-plus"></i>-->
<!--</el-upload>-->
<!--<el-button @click="subPicForm">提交上传</el-button>-->
</div>
</template>
<style>
......@@ -101,7 +115,8 @@
page,
addGeneral,
editGeneral,
delGeneral
delGeneral,
uploadFiles
} from 'api/base_info/general';
import rsCode from '../../utils/rsCode';
......@@ -126,6 +141,8 @@
},
data() {
return {
multiple:true,
formDate:"",
listQuery: {
page: 1,
limit: 20
......@@ -354,6 +371,24 @@
}
});
},
uploadFile(file){
this.formDate.append('files', file.file);
},
subPicForm(){
this.formDate = new FormData()
this.$refs.upload.submit();
this.formDate.append('WS_CODE', "12133");
let config = {
headers: {
'Content-Type': 'multipart/form-data'
}
}
uploadFiles(this.formDate).then( res => {
console.log(res)
}).catch( res => {
console.log(res)
})
}
}
}
</script>
......
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