|
@@ -72,7 +72,8 @@
|
|
|
<a-upload-dragger
|
|
|
name="file"
|
|
|
:multiple="true"
|
|
|
- action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
|
|
+ :customRequest="customRequest"
|
|
|
+ action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
@change="changeImage"
|
|
|
>
|
|
|
<p class="icon-image">
|
|
@@ -192,6 +193,7 @@ import Swatches from "vue-swatches";
|
|
|
import bus from "@/bus";
|
|
|
import "vue-swatches/dist/vue-swatches.css";
|
|
|
import { ItemColor } from "@saga-web/big/lib";
|
|
|
+import { uploadImg } from "@/api/editer.js";
|
|
|
export default {
|
|
|
name: "attr_select",
|
|
|
props: ["type", "focusItemList"],
|
|
@@ -286,8 +288,23 @@ export default {
|
|
|
changebackColor(color){
|
|
|
bus.$emit("changebackColor", color);
|
|
|
},
|
|
|
+ customRequest(info){
|
|
|
+ let formData = new FormData()
|
|
|
+ formData.append('file', info.file)
|
|
|
+ let postParams = formData;
|
|
|
+ uploadImg({ postParams }).then(res => {
|
|
|
+ if (res.Result == 'success') {
|
|
|
+ console.log(res);
|
|
|
+ // this.$set(this.ruleForm, 'Url', res.EntityList[0])
|
|
|
+ this.$message.success(`${info.file.name} file uploaded successfully.`);
|
|
|
+ }else{
|
|
|
+ this.$message.error(`${info.file.name} file upload failed.`);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
changeImage(info) {
|
|
|
const status = info.file.status;
|
|
|
+ console.log(status);
|
|
|
if (status !== "uploading") {
|
|
|
console.log(info.file, info.fileList);
|
|
|
}
|