Prechádzať zdrojové kódy

全局引入promiseFinally组件,解决提交结束窗口不关闭问题

syh 5 rokov pred
rodič
commit
11fae53aeb

+ 2 - 0
src/main.js

@@ -21,6 +21,8 @@ import preview from 'vue-photo-preview'
 import 'vue-photo-preview/dist/skin.css'
 
 import VuePreview from 'vue-preview';
+import promiseFinally from 'promise.prototype.finally';
+promiseFinally.shim();
 
 import {
   ACCESS_TOKEN,

+ 6 - 3
src/views/modules/bytedance/model/InternalModel.vue

@@ -283,7 +283,7 @@
 
       <a-form-item :wrapperCol="{ span: 24 }"
                    style="text-align: center">
-        <a-button htmlType="submit" type="primary">提交</a-button>
+        <a-button htmlType="submit" type="primary" :loading="loading">提交</a-button>
         <a-button style="margin-left: 8px">保存</a-button>
       </a-form-item>
 
@@ -305,6 +305,8 @@
     components: {AFormItem},
     data() {
       return {
+        loading:false,
+        templateName:'',
         title: "操作",
         visible: false,
         model: {},
@@ -363,7 +365,6 @@
         showOpenUrlCreateMode: false,
         openUrlCreateMode: 'hand_create',
         name: '',
-        confirmLoading: false,
         showDateFlowRange: false,
         showDateQuantumRange: false,
         price: 0,
@@ -574,6 +575,7 @@
         params.pricing = this.pricing;
         params.convertPrice = this.convertPrice;
         params.itratorNum = this.itratorNum;
+        params.templateName = this.templateName;
         if (this.time != [] && this.time.length == 2) {
           params.startDate = moment(this.time[0]).format('YYYY-MM-DD HH:mm')
           params.endDate = moment(this.time[1]).format('YYYY-MM-DD HH:mm')
@@ -600,6 +602,7 @@
             params.convertPrice = this.convertPrice;
             params.filterType = this.filterType;
             params.dateQuantumRange = this.dateQuantumRange;*/
+            this.loading = true;
             console.log(params)
              postAction(this.url.insertUrl, params).then((res) => {
                console.log(res)
@@ -610,7 +613,7 @@
                } else {
                  this.$message.warning(res.message);
                }
-               this.confirmLoading = false;
+               this.loading = false;
 
              });
           }

+ 1 - 4
src/views/template/creative/create.vue

@@ -449,7 +449,6 @@
     </a-form>
   </a-card>
 </template>
-<Spin3 :spinning="loader" tip="创建中"></Spin3>
 
 <script>
   import UploadToAli from '@femessage/upload-to-ali';
@@ -471,7 +470,6 @@
           xs: { span: 24 },
           sm: { span: 16 },
         },
-        loader:false,
         fileList:[],
         activeConvertList:[],
         showConvertTarget:false,
@@ -694,7 +692,7 @@
         this.form.validateFields((err, values) => {
           if (!err) {
             console.log('Received values of form: ', values);
-            this.loader = true;
+
             let params = {};
             params.campaignId = this.campaignId;
             params.deliveryRange = this.deliveryRange;
@@ -734,7 +732,6 @@
 
             console.log(params)
             postAction(this.url.insertUrl,params).then((res)=>{
-              this.loader = false;
               console.log(res)
               if(res.success){
                 alert("广告创意批量创建成功");