Browse Source

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-vue

魏志佳 4 years ago
parent
commit
ed87ad72ed

+ 24 - 9
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -135,7 +135,7 @@
             </a-popconfirm>
             <a-divider type="vertical" />
             <a @click="realTimedata(record)">查看实时数据</a>
-            <!-- <a-divider type="vertical" />
+            <a-divider type="vertical" />
             <a-popconfirm @confirm="getInfo(record, 'allUnit')">
               <div slot="title">
                 <div>
@@ -143,9 +143,9 @@
                   <a-input placeholder="请输入" v-model="refuseReason" style="display: inline-block; width: 500px" />
                 </div>
               </div>
-          
+
               <a @click="setData(record)">复制此计划下所有组</a>
-            </a-popconfirm> -->
+            </a-popconfirm>
           </span>
           <span slot="campaignType" slot-scope="text">
             {{ text | typeStatus }}
@@ -284,7 +284,7 @@
         </a-radio-group>
       </a-form-item>
 
-      <copyAllUnit ref="copyAllUnit" v-show="editUnit == '1'" @getUnitData="getUnitData" />
+      <copyAllUnit ref="copyAllUnit" v-if="editUnit == '1'" @getUnitData="getUnitDataAll" />
       <template slot="footer">
         <a-button key="submit" type="primary" @click="handleEditAllUnit"> 确定 </a-button>
       </template>
@@ -626,7 +626,7 @@ export default {
       oldCampaignId: '',
       oldCampaignName: '',
       newCampaignId: '',
-      campaignType:'',
+      campaignType: '',
     }
   },
   filters: {
@@ -834,17 +834,22 @@ export default {
           newCampaignId: this.newCampaignId,
           campaignType: this.campaignType,
         }
-        this.$refs.copyAllUnit.handleOk(params)
+        this.$nextTick(() => {
+          this.$refs.copyAllUnit.handleOk(params)
+        })
       }
     },
-    getUnitData() {
+    getUnitDataAll() {
       this.addUser()
       this.allUnitCopy = false
       this.editUnit = '2'
+      this.$message.success('复制成功,异步创建中,请稍后')
     },
     handleEditAllUnit(e) {
       if (this.editUnit == '1') {
-        this.$refs.copyAllUnit.handleSubmit(e)
+        this.$nextTick(() => {
+          this.$refs.copyAllUnit.handleSubmit(e)
+        })
       } else {
         postAction('/kuaishouCampaignCopyData/add', {
           accountId: this.appId,
@@ -855,6 +860,10 @@ export default {
           if (res.success) {
             this.addUser()
             this.allUnitCopy = false
+            this.$message.success(res.message)
+          } else {
+            this.allUnitCopy = false
+            this.$message.error(res.message)
           }
         })
       }
@@ -1182,7 +1191,13 @@ export default {
       })
     },
   },
-  watch: {},
+  watch: {
+    allUnitCopy:function(n,o){
+      if(!n){
+        this.editUnit = '2'
+      }
+    }
+  },
 
   computed: {},
   activated() {

+ 6 - 6
src/views/modules/kuaishouapp/account/copyAllUnit.vue

@@ -48,11 +48,11 @@
             {{ appModel.templateName }}
           </a-select-option>
         </a-select>
-        <a-button type="primary" @click="getTemplate(null)" :loading="templateLoading"> 刷新模板</a-button>
+        <a-button type="primary" @click="getTemplate(accountId)" :loading="templateLoading"> 刷新模板</a-button>
         <br />
-        <a style="margin: 0 10px 0 0" @click="addTemplate(null)">新增模板</a>
+        <a style="margin: 0 10px 0 0" @click="addTemplate(accountId)">新增模板</a>
         <a
-          @click="lookTemplate(null, getData('templateId'))"
+          @click="lookTemplate(accountId, getData('templateId'))"
           :disabled="getData('templateId') == '' || getData('templateId') == null"
           >查看模板</a
         >
@@ -692,10 +692,10 @@ export default {
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
 
     lookTemplate(accountId, templateId) {
-      this.$refs.templateModal.handleOk(localStorage.getItem('campaignAccountId'), templateId, 'look')
+      this.$refs.templateModal.handleOk(accountId, templateId, 'look')
     },
     addTemplate(accountId) {
-      this.$refs.templateModal.create(localStorage.getItem('campaignAccountId'), 'add')
+      this.$refs.templateModal.create(accountId, 'add')
     },
     getTemplate(accountId) {
       var data = null
@@ -703,7 +703,7 @@ export default {
         data = accountId
       } else {
         this.templateLoading = true
-        data = localStorage.getItem('campaignAccountId')
+        data = accountId
       }
       getAction('/batch/kuaishouTemplate/getTemplateByAccountId', {
         accountId: data,

+ 4 - 2
src/views/modules/kuaishouapp/batchCreation/campaignList.vue

@@ -217,7 +217,7 @@
         </a-radio-group>
       </a-form-item>
 
-      <copyAllUnit ref="copyAllUnit" v-show="editUnit == '1'" @getUnitData="getUnitData" />
+      <copyAllUnit ref="copyAllUnit" v-if="editUnit == '1'" @getUnitData="getUnitData" />
       <template slot="footer">
         <a-button key="submit" type="primary" @click="handleEditAllUnit"> 确定 </a-button>
       </template>
@@ -701,7 +701,9 @@ export default {
           newCampaignId: this.newCampaignId,
           campaignType: this.campaignType,
         }
-        this.$refs.copyAllUnit.handleOk(params)
+        this.$nextTick(() => {
+          this.$refs.copyAllUnit.handleOk(params)
+        })
       }
     },
     disabledDate(current) {

+ 12 - 3
src/views/modules/kuaishouapp/populationAnalysis/index.vue

@@ -392,6 +392,10 @@ export default {
         })
       }
     },
+    clearEchart(idName) {
+      const myChart = echarts.init(document.getElementById(idName))
+      myChart.dispose()
+    },
     // province,data
     handlerMapEchartOption(province, data) {
       var res = []
@@ -597,7 +601,6 @@ export default {
         },
         series: [
           {
-            name: '性别分布',
             type: 'pie',
             radius: [0, 100],
 
@@ -944,12 +947,18 @@ export default {
           this.systemData = res.result.client
           this.initEchart('systemEchart', this.handlerSystemOption(this.systemData))
         } else {
-          this.$message.error('出错了')
+          this.$message.error(res.message)
+          this.province = []
           this.provinceData = []
           this.sexData = []
           this.ageData = []
-          this.businessData =[]
+          this.businessData = []
           this.systemData = []
+          this.initEchart('mapEchart', this.handlerMapEchartOption(this.province, this.provinceData))
+          this.initEchart('sexEchart', this.handlerSexOption(this.sexData))
+          this.initEchart('ageEchart', this.handlerAgeOption(this.ageData))
+          this.initEchart('businessEchart', this.handlerBusinessOption(this.businessData))
+          this.initEchart('systemEchart', this.handlerSystemOption(this.systemData))
         }
       })
     },