朱鑫波 преди 4 години
родител
ревизия
6d7ff58993

+ 10 - 6
src/components/formComponents/checkBoxGroup.vue

@@ -134,7 +134,7 @@
         :value="item.value"
         :class="{
           item: true && userButton,
-          selection: selectedVal.indexOf(item.value) > -1 && userButton,
+          selection: selectedVal && selectedVal.indexOf(item.value) > -1 && userButton,
           bgcolor: item.disabled,
         }"
         >{{ item.label }}</a-checkbox
@@ -176,7 +176,7 @@ export default {
     },
     value: {
       // v-model绑定值
-      type: [Array, String],
+      type: [Number, Array, String],
       default() {
         return []
       },
@@ -255,10 +255,14 @@ export default {
             }
           })
           if (this.allValue) {
-            data.unshift({ label: '不', value: 'unlimited' })
-            if (this.value == '' || this.value.length == 0 || this.value == null) {
+            data.unshift({ label: '不检查', value: 'unlimited' })
+            if (this.value == '' || this.value == '' || this.value == null || this.value.length == 0) {
               this.selectedVal = ['unlimited']
             }
+          } else {
+            if (this.value == '' || this.value == '' || this.value == null || this.value.length == 0) {
+              this.selectedVal = []
+            }
           }
           this.selectOption.push(...data)
         }
@@ -285,7 +289,7 @@ export default {
         this.$emit('input', retrunData)
         this.$emit('update:label', label)
         this.$emit('change', val)
-        this.consoleFun('VALUE: ', val, 'LABEL:', label)
+        // this.consoleFun('VALUE: ', val, 'LABEL:', label)
       } else {
         // 模拟单选radio效果
         let selectVal = []
@@ -308,7 +312,7 @@ export default {
         this.$emit('input', selectVal)
         this.$emit('update:label', label)
         this.$emit('change', selectVal)
-        this.consoleFun('VALUE: ', selectVal, 'LABEL:', label)
+        // this.consoleFun('VALUE: ', selectVal, 'LABEL:', label)
       }
     },
     emitChange(...args) {

+ 0 - 1
src/components/formComponents/toutiaoTime.vue

@@ -183,7 +183,6 @@
             return 0
           }
         })
-        console.log(this.dataString.join(''))
         this.$emit('update:scheduleTime', this.dataString.join(''))
         this.selectFlag = false
         this.max = {

+ 1 - 0
src/views/modules/advertiser/modules/projectListModal.vue

@@ -106,6 +106,7 @@
                 <a-select-option :value="190">付费出价</a-select-option>
                 <a-select-option :value="191">首日ROI</a-select-option>
                 <a-select-option :value="396">注册优化目标</a-select-option>
+                <a-select-option :value="717">广告观看事件</a-select-option>
               </a-select>
             </a-form-item>
           </div>

+ 65 - 39
src/views/modules/earlyWarningRules/ruleModule.vue

@@ -27,10 +27,12 @@
       />
       {{ form }} -->
       <div v-if="current == 0">
-        <div class="toolbox-automate-rules-create-content_title"><h3>预警值填写</h3></div>
+        <div class="toolbox-automate-rules-create-content_title">
+          <h3>预警值{{ editShow ? '填写' : '表单预览' }}</h3>
+        </div>
         <a-spin :spinning="spinLoading">
           <div class="toolbox-automate-rules-create-content">
-            <a-form-model ref="ruleForm" :model="form" layout="horizontal" v-bind="allCol">
+            <a-form-model ref="ruleForm" :model="form" layout="horizontal">
               <div class="moduler">
                 <template v-for="(item, index) of form.ruleList">
                   <div class="row-item" v-if="item.ruleType == 'base' && item.isCopy == 0">
@@ -61,13 +63,17 @@
                         <a-input-number
                           v-model="value.threshold"
                           :min="0"
-                          style="width: 300px;margin-right:5px"
+                          style="width: 100px; margin-right: 5px"
                           v-if="value.modelType == 'numberText'"
                         />
-                        <a-input v-model="value.threshold" style="width: 300px;margin-right:5px" v-else-if="value.modelType == 'text'" />
+                        <a-input
+                          v-model="value.threshold"
+                          style="width: 300px; margin-right: 5px"
+                          v-else-if="value.modelType == 'text'"
+                        />
                         <selectGroup
                           v-model="value.threshold"
-                          style="width: 300px;margin-right:5px"
+                          style="width: 300px; margin-right: 5px"
                           :code="value.dictId"
                           :multiple="value.dataType == 'string' ? false : true"
                           v-else-if="value.modelType == 'select'"
@@ -80,9 +86,9 @@
                     /> -->
                         <checkBoxGroup
                           v-model="value.threshold"
-                          style="width: 300px;margin-right:5px"
+                          style="width: 100%; margin-right: 5px"
                           :code="value.dictId"
-                          :allValue="value.dataType == 'string' ? true : false"
+                          :allValue="true"
                           :radioStyle="value.dataType == 'string' ? true : false"
                           v-else-if="value.modelType == 'checkBox'"
                         />
@@ -128,6 +134,8 @@
                               </div> -->
                                   <div class="input-item">
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
@@ -138,11 +146,13 @@
                                       }"
                                       v-if="value.modelType == 'numberText'"
                                     >
-                                      <a-input-number style="width: 95%;" v-model="value.threshold" :min="0" />{{
+                                      <a-input-number style="width: 100px; margin-right: 5px" v-model="value.threshold" :min="0" />{{
                                         value.dataUnit
                                       }}
                                     </a-form-model-item>
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
@@ -153,9 +163,11 @@
                                       }"
                                       v-else-if="value.modelType == 'text'"
                                     >
-                                      <a-input v-model="value.threshold" style="width: 95%;" />
+                                      <a-input v-model="value.threshold" style="width: 95%" />
                                     </a-form-model-item>
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
@@ -175,6 +187,8 @@
                                       />
                                     </a-form-model-item>
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
@@ -187,7 +201,7 @@
                                     >
                                       <a-select
                                         mode="tags"
-                                        style="width: 100%"
+                                        style="width: 95%"
                                         placeholder="按回车生成标签"
                                         v-model="value.threshold"
                                         dropdownClassName="display-none-selset"
@@ -231,6 +245,8 @@
                               </div> -->
                                   <div class="input-item">
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="
@@ -249,11 +265,13 @@
                                       }"
                                       v-if="value.modelType == 'numberText'"
                                     >
-                                      <a-input-number style="width: 95%;" v-model="value.threshold" :min="0" />{{
+                                      <a-input-number style="width:100px; margin-right: 5px" v-model="value.threshold" :min="0" />{{
                                         value.dataUnit
                                       }}
                                     </a-form-model-item>
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="
@@ -275,6 +293,8 @@
                                       <a-input v-model="value.threshold" style="width: 95%" />
                                     </a-form-model-item>
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="
@@ -302,6 +322,8 @@
                                       />
                                     </a-form-model-item>
                                     <a-form-model-item
+                                      :label-col="{ span: 6 }"
+                                      :wrapper-col="{ span: 18 }"
                                       :label="value.name"
                                       :ref="value.indicatorCode + valueIndex"
                                       :prop="
@@ -322,7 +344,7 @@
                                     >
                                       <a-select
                                         mode="tags"
-                                        style="width: 100%"
+                                        style="width: 95%"
                                         placeholder="按回车生成标签"
                                         v-model="value.threshold"
                                         dropdownClassName="display-none-selset"
@@ -350,8 +372,15 @@
               </div>
               <div class="moduler">
                 <div class="opt">
-                  <a-button type="default" style="margin-right: 15px" @click="goBack">{{editShow?'取消':'返回'}}</a-button>
-                  <a-button type="primary" style="margin-right: 15px" @click="saveHandler" :loading="saveLoading" v-if="editShow"
+                  <a-button type="default" style="margin-right: 15px" @click="goBack">{{
+                    editShow ? '取消' : '返回'
+                  }}</a-button>
+                  <a-button
+                    type="primary"
+                    style="margin-right: 15px"
+                    @click="saveHandler"
+                    :loading="saveLoading"
+                    v-if="editShow"
                     >下一步</a-button
                   >
                 </div>
@@ -473,13 +502,13 @@ export default {
   },
   data() {
     return {
-      editShow:false,
+      editShow: false,
       current: 0,
       spinLoading: false,
-      allCol: {
-        labelCol: { span: 6 },
-        wrapperCol: { span: 18 },
-      },
+      // allCol: {
+      //   labelCol: { span: 6 },
+      //   wrapperCol: { span: 18 },
+      // },
       wrapperCol: { span: 14 },
       ceshi: [],
       ceshi2: [],
@@ -672,7 +701,6 @@ export default {
   },
   methods: {
     addData(valueElse, value, index) {
-      console.log(valueElse, value)
       // alert(1)
       if (index == 0) {
         var data = JSON.parse(JSON.stringify(value))
@@ -686,7 +714,6 @@ export default {
     },
     // 应用方式改变
     applyRangeChange(e) {
-      console.log(e.target.value)
       this.checkedList = []
       this.checkAll = false
       this.indeterminate = false
@@ -704,7 +731,6 @@ export default {
         pageNo: 1,
         pageSize: 100000,
       }).then((res) => {
-        console.log(res)
         this.plainOptions = []
         this.spinning = false
         if (res.success) {
@@ -730,7 +756,6 @@ export default {
         pageNo: 1,
         pageSize: 100000,
       }).then((res) => {
-        console.log(res)
         this.plainOptions = []
         this.spinning = false
         if (res.success) {
@@ -746,7 +771,7 @@ export default {
     },
 
     inputCheck(val) {
-      console.log(val)
+      // console.log(val)
     },
 
     isCost(val) {
@@ -760,12 +785,10 @@ export default {
     },
 
     handleChange(value) {
-      console.log(value, this.metricValueCode)
       let rulesList = {}
       rulesList = this.rulesFieldList.filter((item) => {
         return item.metricValueCode == value
       })[0]
-      console.log(rulesList)
       this.rulesList = []
       rulesList.childs.forEach((ele, index) => {
         this.rulesList.push({
@@ -878,8 +901,13 @@ export default {
               ...item,
               ruleDetail: item.ruleDetail.map((end) => {
                 if (isArray(end)) {
-                  end.threshold = isArray(end.threshold) ? JSON.stringify(end.threshold) : end.threshold
-                  return [...end]
+                  var data = end.map((c) => {
+                    return {
+                      ...c,
+                      threshold: isArray(c.threshold) ? JSON.stringify(c.threshold) : end.threshold,
+                    }
+                  })
+                  return [...data]
                 } else {
                   return {
                     ...end,
@@ -896,6 +924,7 @@ export default {
             accountId: JSON.parse(localStorage.getItem('getRuleDetail')).accountId,
           }
           this.saveLoading = true
+
           postAction('/ruleAccountThreshold/fillThreshold', params).then((res) => {
             if (res.success) {
               this.saveLoading = false
@@ -1083,7 +1112,7 @@ export default {
       display: flex;
       justify-content: flex-start;
       align-items: center;
-      margin-bottom: 32px;
+      margin-bottom: 15px;
     }
     .row-item:last-of-type {
       margin-bottom: 0;
@@ -1103,11 +1132,11 @@ export default {
       line-height: 20px;
       height: 20px;
       margin-top: 10px;
-      width: 105px;
-      min-width: 105px;
+      width: 140px;
+      min-width: 140px;
       .text-item {
         font-size: 14px;
-        width: 100px;
+        width: 120px;
       }
     }
     .row-item .required-item {
@@ -1143,9 +1172,9 @@ export default {
     }
   }
 
-  .toolbox-automate-rules-create-content_rules-and-condition_rules {
-    margin-bottom: 24px;
-  }
+  // .toolbox-automate-rules-create-content_rules-and-condition_rules {
+  //   // margin-bottom: 24px;
+  // }
   .toolbox-automate-rules-create-content_rules-and-condition_rules,
   .toolbox-automate-rules-create-content_rules-and-condition_condition {
     width: 1138px;
@@ -1171,8 +1200,6 @@ export default {
       }
     }
     .content {
-      padding: 24px;
-
       .add-rule {
         cursor: pointer;
 
@@ -1196,10 +1223,9 @@ export default {
       .rules-list-item {
         box-sizing: border-box;
         width: 100%;
-        padding: 24px;
+        padding: 10px;
         background: #f8f9fa;
         border-radius: 4px;
-        margin-bottom: 16px;
         display: flex;
         align-items: center;
         position: relative;

+ 4 - 4
src/views/modules/earlyWarningRules/useRuleList.vue

@@ -56,10 +56,6 @@
             <a href="javascript:;" @click="editRule(record)">预览模板</a>
             <a-divider type="vertical" />
             <a href="javascript:;" @click="pushRule(record)">推送模板</a>
-            <a-divider type="vertical" />
-            <a-popconfirm :title="`当前模板关联账户个数为${relationCount},确定删除吗?`" @confirm="deleteRule(record)">
-              <a href="javascript:;" @click.stop="showRelativeCount(record)">删除模板</a>
-            </a-popconfirm>
           </span>
           <span slot="optionsTwo" slot-scope="text, record">
             <a href="javascript:;" @click="editRule(record)">编辑模板</a>
@@ -285,6 +281,10 @@ export default {
               this.$router.push('/earlyWarningRules/ruleModule')
               this.confirmLoading = false
             })
+          } else {
+            this.accountId = ''
+            this.$message.error(res.message)
+            this.confirmLoading = false
           }
         } else {
           this.accountId = ''