Commit a85f04b6 by xuewengang

up

parent b7822044
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
:on-change="handleChange" :on-change="handleChange"
:on-preview="handlePreview" :on-preview="handlePreview"
:on-remove="handleRemove" :on-remove="handleRemove"
:file-list="fileList" :file-list="fileLists"
:auto-upload="false"> :auto-upload="false">
<el-button slot="trigger" <el-button slot="trigger"
size="small" size="small"
...@@ -21,11 +21,14 @@ ...@@ -21,11 +21,14 @@
type="success" type="success"
@click="submitUpload">上传到服务器</el-button> @click="submitUpload">上传到服务器</el-button>
</el-upload> </el-upload>
<div @click="getcontent">huoqu</div>
</div> </div>
</template> </template>
<script> <script>
import { testLogin, testCode, testXss } from "@/api/test.js"; import { testLogin, testCode, testXs, testXss } from "@/api/test.js";
import axios from "axios";
import qs from "qs";
export default { export default {
name: "test", name: "test",
components: {}, components: {},
...@@ -34,11 +37,19 @@ export default { ...@@ -34,11 +37,19 @@ export default {
xs: { xs: {
xm: '1234' xm: '1234'
}, },
fileList: [] upFile: {},
fileLists: []
}; };
}, },
created () { }, created () { },
methods: { methods: {
getcontent () {
testXss({
shsexsbh: "X4302000000002020100045"
}).then(res => {
console.log(res);
})
},
submitUpload () { submitUpload () {
this.$refs.upload.submit(); this.$refs.upload.submit();
this.xss() this.xss()
...@@ -49,21 +60,23 @@ export default { ...@@ -49,21 +60,23 @@ export default {
//this.getPicturePicture() //this.getPicturePicture()
}, },
handleRemove (file, fileList) { handleRemove (file, fileList) {
console.log(file, fileList); this.fileLists = fileList
}, },
handlePreview (file) { handlePreview (file) {
console.log(file); console.log(file);
}, },
handleChange (file, fileList) { handleChange (file, fileList) {
console.log(file); this.upFile = file.raw
console.log(fileList); this.fileLists.push(file)
this.fileList.push(file.raw) console.log(this.fileLists);
}, },
xss () { xss () {
testXss({ var params = new FormData()
"xs.xm": "123", params.append("xs.xm", '123')
xsfj: this.fileList for (var i = 0; i < this.fileLists.length; i++) {
}).then(res => { params.append('xsfj', this.fileLists[i].raw)
}
axios.post("http://192.168.0.142:8080/shsexscj/addShsexscj", params).then(res => {
console.log(res); console.log(res);
}) })
}, },
......
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