朱鑫波 4 anni fa
parent
commit
f6f9e67ac0

+ 13 - 0
src/filters.js

@@ -243,6 +243,19 @@ const filters = {
     sizeShow(value) {
         return (value / 1024).toFixed(2)
     },
+    //预警计算符号
+    conditionName(val) {
+        var data = {
+            equal: '=',//'等于',
+            not_equal: '≠',//不等于,
+            greater: '>',//大于
+            less: '<',//小于
+            greater_equal: '≥',//大于等于
+            less_equal: '≤',//小于等于
+        }
+
+        return data[val]
+    },
 }
 
 // 获取当前月的第一天

+ 2 - 2
src/views/modules/earlyWarningRules/configRules.vue

@@ -221,10 +221,10 @@
                                                         </div>
 
 
-                                                        <div class="rules-list-item-subject" v-if="ele.dataType=='number'">
+                                                        <!-- <div class="rules-list-item-subject" v-if="ele.dataType=='number'">
                                                             <a-input-number :min="0" style="width:100%" :max="9999999.99" :step="1" v-model="ele.threshold" placeholder="请输入" :disabled="!!ele.ruleId" />
                                                             <span style="margin-left:8px;line-height:32px">{{ele.dataUnit }}</span>
-                                                        </div>
+                                                        </div> -->
                                                         <div class="rules-list-item-subject" >
                                                             <a-form-model-item ref="isUnlimited"  prop="isUnlimited">
                                                                 <a-select   v-model="ele.isUnlimited" placeholder="是否必填" :disabled="!!ele.ruleId">

+ 343 - 0
src/views/modules/earlyWarningRules/historyWarning.vue

@@ -0,0 +1,343 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="24">
+          <a-col :md="6" :sm="8">
+            <a-form-item label="产品名称">
+              <a-input placeholder="请输入产品名称" v-model="productName"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+            <a-form-item label="广告主名称">
+              <a-input placeholder="请输入广告主名称" v-model="advertiserName"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a> -->
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+    </div>
+
+    <!-- table区域-begin -->
+    <!-- 供应商 -->
+    <div>
+
+      <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
+        :pagination="ipagination" :loading="loading" @change="handleTableChange"
+        style="word-break: break-all;font-size:16px;font-weight:600">
+        <span slot="mediaId"
+          slot-scope="mediaId">{{ mediaId == 1 ? '头条' :mediaId == 2? '快手':mediaId == 3?'头条内广':'快手内广' }}</span>
+        <span slot="projectList" slot-scope="text">
+          <span v-for="(item,index) in text"
+            :key="index">{{index+1}}.{{item.projectName}}{{index==(text.length-1)?'':';'}}</span>
+        </span>
+        <span slot="yunyingList" slot-scope="text">
+          <span v-for="(item,index) in text" :key="index">{{item.realname}}{{index==(text.length-1)?'':','}}</span>
+        </span>
+        <span slot="saleList" slot-scope="text">
+          <span v-for="(item,index) in text" :key="index">{{item.saleName}}{{index==(text.length-1)?'':','}}</span>
+        </span>
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleAddList(record)">绑定项目</a>
+
+          <a-divider type="vertical" />
+
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+
+          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
+        </span>
+      </a-table>
+    </div>
+    <a-modal title="项目展示" :width="800" :visible="visible" :footer="null" @cancel="handleCancel" destroyOnClose
+      cancelText="关闭">
+      <a-button @click="handleProjectAdd" type="primary" icon="plus" style="margin:20px 0">新增</a-button>
+      <a-list bordered :data-source="dataList">
+        <a-list-item slot="renderItem" slot-scope="item, index">
+          {{ item.projectName }}
+          <div slot="actions">
+            <a @click="removeTitleCun(item,index)">删除</a>
+          </div>
+        </a-list-item>
+
+        <!-- <div slot="header">
+          Header
+        </div>
+        <div slot="footer">
+          Footer
+        </div> -->
+      </a-list>
+    </a-modal>
+    <a-modal title="新增项目" :width="800" :visible="visibleAdd" :confirmLoading="confirmLoading" @ok="handleOk"
+      destroyOnClose cancelText="关闭" @cancel="handleCancelAdd">
+      <a-select optionFilterProp="children" showSearch :filterOption="filterOption" mode="multiple" v-model="projectIds"
+        style="width:100%">
+        <a-select-option :value="item.id" v-for="(item, index) of supplierList" :key="index">{{
+              item.projectName
+            }}</a-select-option>
+      </a-select>
+    </a-modal>
+  </a-card>
+</template>
+
+<script>
+  import JTreeSelect from '@/components/jeecg/JTreeSelect'
+  import {
+    httpAction,
+    getAction,
+    postAction,
+    deleteAction
+  } from '@/api/manage'
+  import {
+    JeecgListMixin
+  } from '@/mixins/ipagination'
+
+  export default {
+    name: 'ProjectList',
+    mixins: [JeecgListMixin],
+    components: {
+      JTreeSelect
+    },
+    data() {
+      return {
+        description: '产品管理页面',
+        loading: false,
+        visible: false,
+        visibleAdd: false,
+        dataList: [],
+        productIdDelete: null,
+        confirmLoading: false,
+        projectIds: [],
+        supplierList: [],
+        advertiserId: null,
+        // 表头
+        columns: [
+
+          {
+            title: '媒体',
+            align: 'center',
+            dataIndex: 'mediaId',
+            scopedSlots: {
+              customRender: 'mediaId'
+            },
+            width: 100
+          }, {
+            title: '产品名称',
+            align: 'center',
+            dataIndex: 'productName',
+            width: 200
+          },
+          {
+            title: '广告主名称',
+            align: 'center',
+            dataIndex: 'advertiserName',
+            width: 200
+          },
+          {
+            title: '项目名称',
+            align: 'center',
+            dataIndex: 'projectList',
+            scopedSlots: {
+              customRender: 'projectList'
+            },
+          },
+          {
+            title: '运营',
+            align: 'center',
+            dataIndex: 'yunyingList',
+            scopedSlots: {
+              customRender: 'yunyingList'
+            },
+            width: 120,
+
+          },
+          {
+            title: '销售',
+            align: 'center',
+            dataIndex: 'saleList',
+            scopedSlots: {
+              customRender: 'saleList'
+            },
+            width: 120
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align: 'center',
+            scopedSlots: {
+              customRender: 'action'
+            },
+            width: 300
+          }
+        ],
+        dataSource: [],
+        url: {
+          list: '/ctop/product/getProductList',
+          delete: '/ctop/product/deleteProduct',
+          deleteBatch: '/ctop/project/deleteBatch',
+          exportXlsUrl: 'ctop/project/exportXls',
+          importExcelUrl: 'ctop/project/importExcel'
+        },
+        options: [],
+        advertiserName: null,
+        productName: null,
+      }
+    },
+    computed: {},
+    watch: {
+      'ipagination.current': function (n, o) {
+        console.log(n, o)
+        if (n != o) {
+          this.tableHttp()
+        }
+
+      }
+    },
+    methods: {
+      searchQuery() {
+        this.tableHttp()
+      },
+      searchReset() {
+        this.advertiserName = null
+        this.productName = null
+        this.tableHttp()
+      },
+      handleTableChange() {
+
+      },
+      handleDelete: function (id) {
+        if (!this.url.delete) {
+          this.$message.error("请设置url.delete属性!")
+          return
+        }
+        var that = this;
+        postAction(that.url.delete, {
+          productId: id
+        }).then((res) => {
+          if (res.success) {
+            that.$message.success(res.message);
+            this.ipagination.current = 1
+            this.tableHttp()
+          } else {
+            that.$message.warning(res.message);
+          }
+        });
+      },
+      handleProjectAdd() {
+        this.visibleAdd = true
+        // this.supplierList = 
+        postAction('/ctop/product/getProjectListByAdvertiserId', {
+          "advertiserId": this.advertiserId
+        }).then(res => {
+          if (res.success) {
+            this.supplierList = res.result
+            this.projectIds = this.dataList.map(item => {
+              return item.projectId
+            })
+          }
+        })
+      },
+      handleCancelAdd() {
+        this.visibleAdd = false
+      },
+      handleOk() {
+        this.confirmLoading = true
+        postAction('/ctop/product/insertProductProjectMap', {
+          "productId": this.productIdDelete,
+          "projectIds": this.projectIds
+        }).then(res => {
+          if (res.success) {
+            this.confirmLoading = false
+            this.visibleAdd = false
+            this.handleCancel()
+          } else {
+            this.confirmLoading = false
+            this.$message.error(res.message)
+          }
+        })
+      },
+      removeTitleCun(item, index) {
+        postAction('/ctop/product/deleteByProjectIdAndProductId', {
+          "projectId": item.projectId,
+          "productId": this.productIdDelete
+        }).then(res => {
+          if (res.success) {
+            this.dataList.splice(index, 1)
+            this.tableHttp()
+          }
+        })
+      },
+      handleCancel() {
+        this.visible = false
+        this.tableHttp()
+      },
+
+      handleAddList(record) {
+        this.visible = true
+        this.dataList = record.projectList
+        this.productIdDelete = record.id
+        this.advertiserId = record.advertiserId
+      },
+      handleEdit: function (record) {
+        console.log(record)
+        this.$refs.modalForm.edit(record);
+        this.$refs.modalForm.title = "编辑";
+        this.$refs.modalForm.disableSubmit = false;
+      },
+      handleAdd: function () {
+        this.$refs.modalForm.add();
+        this.$refs.modalForm.title = "新增";
+        this.$refs.modalForm.disableSubmit = false;
+      },
+      modalFormOk() {
+        this.ipagination.current = 1
+        this.tableHttp()
+      },
+      filterOption(input, option) {
+        return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+      },
+      tableHttp() {
+        this.loading = true;
+        this.dataSource = []
+        var params = {}
+        params.pageNum = this.ipagination.current
+        params.pageSize = this.ipagination.pageSize
+        params.advertiserName = this.advertiserName
+        params.productName = this.productName
+        // {"pageNum":1,"pageSize":10,"advertiserName":"","productName":""}
+        postAction('/ctop/product/getProductList', params).then(res => {
+          if (res.success) {
+            // console.log(res)
+            this.loading = false;
+            this.ipagination.total = res.result.total
+            this.dataSource = res.result.list
+          }
+        })
+      },
+    },
+    mounted() {
+      this.tableHttp()
+    },
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 2 - 2
src/views/modules/earlyWarningRules/index.vue

@@ -9,8 +9,8 @@
                 <a-input v-model="templateName" placeholder="模板名字" style="width:250px;margin-right:40px"/>
             </div>
             <div>
-                <span>模板id:</span>
-                <a-input v-model="templateId" placeholder="模板id" style="width:250px"/>
+                <span>模板ID:</span>
+                <a-input v-model="templateId" placeholder="模板ID" style="width:250px"/>
             </div>
             
 

+ 10 - 0
src/views/modules/earlyWarningRules/ruleModule.vue

@@ -60,6 +60,9 @@
                         trigger: value.dataType == 'array' ? 'change' : 'blur',
                       }"
                     >
+                      <span style="color: red;font-size:16px;font-weight:500" v-if="value.modelType == 'numberText'">
+                        {{ value.ruleCondition | conditionName }}
+                      </span>
                       <a-input-number
                         :disabled="!editShow"
                         v-model="value.threshold"
@@ -189,6 +192,10 @@
                                     }"
                                     v-if="value.modelType == 'numberText'"
                                   >
+                                    <span style="color: red;font-size:16px;font-weight:500">
+                                      {{ value.ruleCondition | conditionName }}
+                                    </span>
+
                                     <a-input-number
                                       :disabled="!editShow"
                                       style="width: 100px; margin-right: 5px"
@@ -331,6 +338,9 @@
                                     }"
                                     v-if="value.modelType == 'numberText'"
                                   >
+                                    <span style="color: red;font-size:16px;font-weight:500">
+                                      {{ value.ruleCondition | conditionName }}
+                                    </span>
                                     <a-input-number
                                       :disabled="!editShow"
                                       style="width: 100px; margin-right: 5px"

+ 92 - 33
src/views/modules/earlyWarningRules/useRuleList.vue

@@ -8,7 +8,8 @@
     <div class="tabBody">
       <a-tabs v-model="tabKey" @change="tabChange">
         <a-tab-pane key="1" tab="模板列表"></a-tab-pane>
-        <a-tab-pane key="2" tab="我的模板"></a-tab-pane>
+        <a-tab-pane key="2" tab="我的模板"> </a-tab-pane>
+        <a-button slot="tabBarExtraContent" type="link"> 预警历史 </a-button>
       </a-tabs>
     </div>
     <div class="tableBody">
@@ -25,6 +26,29 @@
           @search="onSearch"
         />
       </div> -->
+      <div class="table-page-search-wrapper" v-if="tabKey == '2'">
+        <a-form layout="inline">
+          <a-row :gutter="24">
+            <a-col :md="6" :sm="8">
+              <a-form-item label="账户名称">
+                <Treeselect :appId.sync="projectId" :multiple="false" ref="treeSelect" style="width: 100%" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="8">
+              <a-form-item label="绑定人">
+                <a-input placeholder="请输入绑定的运营" v-model="userName"></a-input>
+              </a-form-item>
+            </a-col>
+
+            <a-col :md="6" :sm="8">
+              <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
+                <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
       <div class="table">
         <a-table
           size="middle"
@@ -49,9 +73,9 @@
             {{ text | handleMediaType }}
           </span>
           <span slot="accountStatus" slot-scope="text">
-              <span class="bohui" v-if="text==1"></span>
-              <span class="shenhe" v-if="text==0"></span>
-              {{text?'暂停':'投放中'}}
+            <span class="bohui" v-if="text == 1"></span>
+            <span class="shenhe" v-if="text == 0"></span>
+            {{ text ? '暂停' : '投放中' }}
           </span>
           <span slot="processMethod" slot-scope="text">
             {{ text == 'SEND' ? '仅发送通知' : '发送并关停组' }}
@@ -72,7 +96,14 @@
       </div>
     </div>
     <!-- pushRuleVisible -->
-    <a-modal v-model="pushRuleVisible" title="推送账户选择" @ok="handleOk" @cancel='cancelPush' :confirmLoading="confirmLoading" width="60%">
+    <a-modal
+      v-model="pushRuleVisible"
+      title="推送账户选择"
+      @ok="handleOk"
+      @cancel="cancelPush"
+      :confirmLoading="confirmLoading"
+      width="60%"
+    >
       <a-form layout="inline" class="rule-tree-select">
         <a-form-item
           label="请选择账户"
@@ -89,7 +120,7 @@
 <script>
 import moment from 'moment'
 import Treeselect from './pushTreeSelect.vue'
-import { getAction, postAction, downFile, downFilePost, deleteAction , putAction } from '@/api/manage'
+import { getAction, postAction, downFile, downFilePost, deleteAction, putAction } from '@/api/manage'
 let existColumns = [
   // {
   //     title: '运行/暂停',
@@ -134,14 +165,13 @@ let existColumns = [
 ]
 
 let recordsColumns = [
-
-    {
-      title: '运行/暂停',
-      dataIndex: 'status',
-      align: 'center',
-      width:100,
-      key: 'status',
-      scopedSlots: { customRender: 'status' }
+  {
+    title: '运行/暂停',
+    dataIndex: 'status',
+    align: 'center',
+    width: 100,
+    key: 'status',
+    scopedSlots: { customRender: 'status' },
   },
   {
     title: '模板名称',
@@ -201,6 +231,8 @@ export default {
   name: 'useRuleList',
   data() {
     return {
+      projectId: '',
+      userName: '',
       relationCount: 2,
       pushRuleVisible: false,
       confirmLoading: false,
@@ -251,12 +283,40 @@ export default {
     Treeselect,
   },
   methods: {
+    searchQuery() {
+      this.ipagination.current = 1
+      let url = ''
+      if (this.tabKey == '1') {
+        this.columns = [...existColumns]
+        url = '/ruleTemplate/list'
+      } else {
+        this.columns = [...recordsColumns]
+        url = '/ruleAccountTemplate/getTemplateApplied'
+      }
+      this.getTableListHttp(url)
+    },
+    searchReset() {
+      this.ipagination.current = 1
+      this.projectId = ''
+      this.userName = ''
+      let url = ''
+      if (this.tabKey == '1') {
+        this.columns = [...existColumns]
+        url = '/ruleTemplate/list'
+      } else {
+        this.columns = [...recordsColumns]
+        url = '/ruleAccountTemplate/getTemplateApplied'
+      }
+      this.getTableListHttp(url)
+    },
     moment,
     onSearch(value) {
       console.log(value)
     },
     tabChange(key) {
       console.log(key)
+      this.projectId = ''
+      this.userName = ''
       this.ipagination.current = 1
       let url = ''
       if (key == '1') {
@@ -298,8 +358,7 @@ export default {
     },
 
     handleOk() {
-      
-      if(this.accountId){
+      if (this.accountId) {
         this.confirmLoading = true
         getAction('/ruleAccountTemplate/checkAccountTemplate', { accountId: this.accountId }).then((res) => {
           console.log(res)
@@ -309,16 +368,15 @@ export default {
                 templateId: this.templateId,
                 accountId: this.accountId,
               }).then((r) => {
-                if(r.success){
+                if (r.success) {
                   var data = { id: this.templateId, edit: true, accountId: this.accountId }
                   localStorage.setItem('getRuleDetail', JSON.stringify(data))
                   this.$router.push('/earlyWarningRules/ruleModule')
                   this.confirmLoading = false
-                  this.accountId=undefined
-                }else{
+                  this.accountId = undefined
+                } else {
                   this.$message.error(r.message)
                 }
-                
               })
             } else {
               // this.accountId = ''
@@ -331,15 +389,12 @@ export default {
             this.confirmLoading = false
           }
         })
-      }else{
+      } else {
         this.$message.error('请选择需要推送的账户')
       }
-      
     },
-    cancelPush(){
-      
-      this.accountId=''
-      
+    cancelPush() {
+      this.accountId = ''
     },
     // recordsRule(record){
     //     console.log(record);
@@ -388,7 +443,7 @@ export default {
     },
     switchChange(text, record) {
       console.log(text, record)
-      if(record.accountStatus==0 || record.accountStatus==1&&text){
+      if (record.accountStatus == 0 || (record.accountStatus == 1 && text)) {
         record.spin = true
         let templateStatus = 0
         if (text) {
@@ -419,19 +474,24 @@ export default {
             // this.getTableListHttp()
           }
         })
-      }else{        
-          this.$message.error('当前账户已关停,预警规则不支持开启!')
+      } else {
+        this.$message.error('当前账户已关停,预警规则不支持开启!')
       }
-      
     },
 
     getTableListHttp(url) {
       this.data = []
       this.loading = true
       // let url='/alarm/alarmEventRule/list'
+      var params = {}
+      if (this.tabKey == '2') {
+        params.accountId = this.projectId
+        params.userName = this.userName
+      }
       getAction(url, {
         pageNo: this.ipagination.current,
         pageSize: this.ipagination.pageSize,
+        ...params,
       }).then((res) => {
         console.log(res)
         this.loading = false
@@ -519,7 +579,7 @@ export default {
       margin-bottom: 15px;
     }
 
-    .shenhe{
+    .shenhe {
       width: 6px;
       height: 6px;
       display: inline-block;
@@ -528,7 +588,7 @@ export default {
       position: relative;
       top: -2px;
     }
-    .bohui{
+    .bohui {
       width: 6px;
       height: 6px;
       display: inline-block;
@@ -538,6 +598,5 @@ export default {
       top: -2px;
     }
   }
-
 }
 </style>

+ 28 - 17
src/views/modules/kuaishouapp/account/copyAllUnit.vue

@@ -31,6 +31,16 @@
   <a-card :body-style="{ padding: '24px 32px' }" :bordered="false" class="group-creat">
     <a-form @submit="handleSubmit" :form="form">
       <a-form-item
+        label="投放范围"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+        <a-radio-group buttonStyle="solid" v-model="allForm.allianceAccount">
+          <a-radio-button value="1">默认</a-radio-button>
+          <a-radio-button value="2">联盟广告</a-radio-button>
+        </a-radio-group>
+      </a-form-item>
+      <a-form-item
         label="选择模板"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
         :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
@@ -152,6 +162,7 @@
         label="场景广告位"
         :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
         :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        v-if="allForm.allianceAccount == '1'"
       >
         <checkBoxGroup
           :options="[
@@ -660,22 +671,22 @@ export default {
         }
       })
 
-      //   getAction('/kuaishou/batch/getWhiteList', {
-      //     accountId: item.accountId,
-      //   }).then((res) => {
-      //     if (res.success) {
-      //       // console.log(res)
-      //       if (res.result) {
-      //         this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
-      //         this.allianceAccount = res.result.alliance_account == 1 ? true : false
-      //         this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
-      //       } else {
-      //         this.allianceAccount = false
-      //         this.creativeCategorySwitch = false
-      //         this.actionbarClickUrlSwitch = false
-      //       }
-      //     }
-      //   })
+        getAction('/kuaishou/batch/getWhiteList', {
+          accountId: item.accountId,
+        }).then((res) => {
+          if (res.success) {
+            // console.log(res)
+            if (res.result) {
+              // this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
+              this.allianceAccount = res.result.alliance_account == 1 ? true : false
+              // this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
+            } else {
+              this.allianceAccount = false
+              // this.creativeCategorySwitch = false
+              // this.actionbarClickUrlSwitch = false
+            }
+          }
+        })
       getAction('/kuaishou/batch/getProjectMaxBid', {
         accountId: item.accountId,
       }).then((res) => {
@@ -976,7 +987,7 @@ export default {
           }
           postAction('/kuaishouCampaignCopyData/add', params).then((res) => {
             if (res.success) {
-                this.$emit('getUnitData')
+              this.$emit('getUnitData')
             } else {
               this.$message.error(res.message)
             }

+ 3 - 3
src/views/modules/kuaishouapp/crossAccount/templateModal.vue

@@ -109,7 +109,7 @@ export default {
           this.populationData.interestVideo = dataJson.interestVideo ? JSON.parse(dataJson.interestVideo) : null
           this.populationData.deviceBrand = dataJson.deviceBrand ? JSON.parse(dataJson.deviceBrand) : null
 
-          this.populationData.age = dataJson.ageMin ? [dataJson.ageMin, dataJson.ageMax] : []
+          this.populationData.age = dataJson.min ? [dataJson.min, dataJson.max] : []
           this.populationData.agesRange = dataJson.agesRange ? JSON.parse(dataJson.agesRange) : []
           this.populationData.devicePrice = dataJson.devicePrice ? dataJson.devicePrice : null
           this.populationData.allForm = {}
@@ -127,7 +127,7 @@ export default {
           // })
 
           this.populationData.allForm.ageType =
-            dataJson.agesRange.length > 0 ? 'ageLimit' : dataJson.ageMin ? 'ageCustom' : 'noLimit'
+            dataJson.agesRange.length > 0 ? 'ageLimit' : dataJson.min ? 'ageCustom' : 'noLimit'
           this.populationData.allForm.device = dataJson.deviceBrand ? '1' : '0'
           this.populationData.allForm.price = dataJson.devicePrice ? '1' : '0'
           this.populationData.allForm.appType = dataJson.appInterest ? '1' : dataJson.appIds ? '2' : '0'
@@ -141,7 +141,7 @@ export default {
           this.populationData.allForm.noAreaBreak = dataJson.noAreaBreak + ''
           this.populationData.allForm.checkArr =
             this.populationData.allForm.appType == '2' ? JSON.parse(dataJson.appIds) : []
-          this.$nextTick(() => {
+          this.$nextTick(() => { 
             console.log(dataJson)
             this.form.setFieldsValue(pick(dataJson, ['templateName']))
             this.spinning = false