上传图片

wp1.0
fanluyan 1 year ago
parent 8ff60d0a52
commit bbed91b05e

@ -702,5 +702,8 @@ export function uploadPicApi(data) {
url: "/api/upload", url: "/api/upload",
method: "post", method: "post",
data, data,
headers: {
"Content-Type": "multipart/form-data", // set the content type to multipart/form-data
},
}); });
} }

@ -13,7 +13,7 @@
<el-input v-model="form.cmdid"></el-input> <el-input v-model="form.cmdid"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="装置Id"> <el-form-item label="装置Id">
<el-input v-model="form.id"></el-input> <el-input v-model="form.termid"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="通道选择"> <el-form-item label="通道选择">
<el-select v-model="form.channel" placeholder="选择通道"> <el-select v-model="form.channel" placeholder="选择通道">
@ -70,11 +70,12 @@ export default {
display(data) { display(data) {
console.log(data); console.log(data);
this.$set(this.form, "cmdid", data.cmdid); this.$set(this.form, "cmdid", data.cmdid);
this.$set(this.form, "id", data.id); this.$set(this.form, "termid", data.id);
this.isShow = true; this.isShow = true;
}, },
handleclose() { handleclose() {
this.isShow = false; this.isShow = false;
this.fileList = [];
}, },
handlesure() { handlesure() {
this.isShow = false; this.isShow = false;
@ -84,6 +85,13 @@ export default {
uploadPicApi(this.form) uploadPicApi(this.form)
.then((res) => { .then((res) => {
console.log(res); console.log(res);
this.$message({
duration: 1500,
showClose: true,
message: "上传成功",
type: "success",
});
this.fileList = [];
}) })
.catch((err) => {}); .catch((err) => {});
}, },

Loading…
Cancel
Save