Commit 4997ebff authored by rencs's avatar rencs

1.11 upload

parent e7aff3e1
...@@ -57,9 +57,11 @@ ...@@ -57,9 +57,11 @@
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="BASE_API + '/api/datacenter/bg/gtdata/upload'" :action="BASE_API + '/api/datacenter/bg/gtdata/upload'"
:before-upload="showLoading"
:on-success="handleDataUpSuccess" :on-success="handleDataUpSuccess"
:headers="getHeaderWithToken" :headers="getHeaderWithToken"
:show-file-list="false" :show-file-list="false"
v-loading.fullscreen.lock="fullscreenLoading"
> >
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
...@@ -290,6 +292,7 @@ export default { ...@@ -290,6 +292,7 @@ export default {
} }
}; };
return { return {
fullscreenLoading: false,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
//1--影像美图 2--专题图 3--遥感成果图 //1--影像美图 2--专题图 3--遥感成果图
imageTypes: { imageTypes: {
...@@ -404,7 +407,11 @@ export default { ...@@ -404,7 +407,11 @@ export default {
}); });
}); });
}, },
showLoading() {
this.fullscreenLoading = true;
},
handleDataUpSuccess(res, file) { handleDataUpSuccess(res, file) {
this.fullscreenLoading = false;
this.ruleForm.imageInfoRelationList.push({ this.ruleForm.imageInfoRelationList.push({
url: res.data.path, url: res.data.path,
price: 0, price: 0,
......
...@@ -160,9 +160,11 @@ ...@@ -160,9 +160,11 @@
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="BASE_API + '/api/datacenter/bg/gtdata/upload'" :action="BASE_API + '/api/datacenter/bg/gtdata/upload'"
:before-upload="showLoading"
:on-success="handleDataUpSuccess" :on-success="handleDataUpSuccess"
:headers="getHeaderWithToken" :headers="getHeaderWithToken"
:show-file-list="false" :show-file-list="false"
v-loading.fullscreen.lock="fullscreenLoading"
> >
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
...@@ -304,6 +306,7 @@ export default { ...@@ -304,6 +306,7 @@ export default {
currentFirstType: "", currentFirstType: "",
secondTypes: [], secondTypes: [],
currentSecondType: "", currentSecondType: "",
fullscreenLoading: false,
}; };
}, },
watch: { watch: {
...@@ -365,7 +368,11 @@ export default { ...@@ -365,7 +368,11 @@ export default {
this.$bus.$emit("hideThreeRoute", true); this.$bus.$emit("hideThreeRoute", true);
}, },
methods: { methods: {
showLoading() {
this.fullscreenLoading = true;
},
handleDataUpSuccess(res, file) { handleDataUpSuccess(res, file) {
this.fullscreenLoading = false;
this.form.sourceFile = res.data.path; this.form.sourceFile = res.data.path;
}, },
// 获取所有应用类型 // 获取所有应用类型
......
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