소스 검색

Merge branch 'feature/work-jyf' of http://git.tjyourong.com.cn/ctop/adsp-vue into feature/work-jyf

朱鑫波 4 년 전
부모
커밋
3875740e9b

+ 4 - 1
src/views/modules/Statistics/components/customColumn.vue

@@ -100,6 +100,7 @@ export default {
   methods: {
      //li展示里的关闭按钮 删除当前被选中的这一个列
     deleteCol(item, index) {
+      console.log(this.mylistNum, 'this.mylistNumthis.mylistNumthis.mylistNumthis.mylistNum');
       this.mylistNum = this.mylistNum.filter((item1, num) => {
         return num != index
       })
@@ -202,7 +203,9 @@ export default {
       }
     }
   },
-  mounted() {}
+  mounted() {
+    console.log(this.mylistNum, 'mylistNum');
+  }
 }
 </script>
 

+ 1 - 1
src/views/modules/Statistics/components/selectComponent.vue

@@ -120,7 +120,7 @@ export default {
     })
 
 
-    // console.log(this.customFields);
+    console.log(this.customFields, 'customFields-customFields');
     
   },
   methods: {

+ 6 - 4
src/views/modules/Statistics/videoStatics/KSvideoStatics.vue

@@ -642,6 +642,7 @@ export default {
             item.key = index
           })
           this.detailData = result
+          console.log(this.detailData, 'detail----detail');
         }
       })
     },
@@ -854,6 +855,7 @@ export default {
     customColumns() {
       this.visible = true
       this.listNum = [...this.columns]
+      console.log(this.listNum, 'this.listNum-this.listNum');
     },
     
 
@@ -921,7 +923,7 @@ export default {
     // 获取设计人员
     getDesignList(){
       postAction('/ctop/kuaishou/videoReport/getDesignList').then(res=>{
-        console.log(res);
+        console.log(res, '设计人员');
         if(res.success){
             this.designList=res.result
         }
@@ -940,9 +942,9 @@ export default {
     postAction('/toutiao/videoReportDaily/getColumnJson', {
       columnType: 4
     }).then(res => {
-      // console.log(res)
+      console.log(res, 'activated--activated')
       if (res.success) {
-        // console.log(JSON.parse(res.result))
+        console.log(JSON.parse(res.result), '-------')
         if(res.result){
             let columns = JSON.parse(res.result)
             if (columns.length) {
@@ -1092,7 +1094,7 @@ filters: {
       this.getDesignList()
     //请求自定义列的数据
     postAction('/toutiao/videoReportDaily/videoInfoListTotalExportExcelPermission').then(res => {
-      console.log(res)
+      console.log(res, 'mounted-mounted')
       if (res.success) {
         if (res.result) {
           this.exportExcelIsOk = true

+ 4 - 3
src/views/modules/crowd-control/components/tree-select/tree-select.less

@@ -10,13 +10,14 @@
         .class-left-header {
             height: 50px;
             line-height: 50px;
-            background-color: #ccc;
+            background-color: #f9fafd;
+            border-bottom: 1px solid #eee;
             text-indent: 10px;
         }
         .select-class-left {
             width: 60%;
             height: 400px;
-            border: 1px solid #ccc;
+            border: 1px solid #eee;
             .class-left-content {
                 overflow-y: auto;
                 height: 340px;
@@ -29,7 +30,7 @@
         .select-class-right {
             width: 35%;
             height: 400px;
-            border: 1px solid #ccc;
+            border: 1px solid #eee;
             .class-left-content {
                 padding: 0 10px;
                 height: 348px;

+ 43 - 8
src/views/modules/crowd-control/components/tree-select/tree-select.vue

@@ -126,14 +126,21 @@ export default {
             }
             this.applyTypeOption = defaultTypeOption;
             this.selectRightData = new Set(defaultTypeOption);
-            for(let i = keysLen - 1; i >= 0; i--) {
-                if(defaultCheckKey[i] === list.key) {
-                    defaultCheckKey.splice(i, 1);
-                }
-            }
             const txt = this.handleDelFindId(this.treeData, list.key);
             const lastIndex = defaultCheckKey.findIndex(item => item === txt);
-            defaultCheckKey.splice(lastIndex, 1);
+            let value = null;
+            if (lastIndex > -1) {
+                value = defaultCheckKey.findIndex(item => item === txt);
+                for(let i = keysLen - 1; i >= 0; i--) {
+                    if(defaultCheckKey[i] === list.key) {
+                        defaultCheckKey.splice(i, 1);
+                    }
+                }
+            }
+            else {
+                value = defaultCheckKey.findIndex(item => item === list.key);
+            }
+            defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
         },
         onChange(e) {
@@ -203,10 +210,34 @@ export default {
             this.expandedKeys = expandedKeys;
             this.autoExpandParent = false;
         },
+        // 去重的方法
+        Es6duplicate(arr, type) {
+            if (!arr.length){
+                return arr;
+            }
+            else {
+                if (type) {
+                    let obj = {};
+                    let newArr = arr.reduce((cur, next) => {
+                        obj[next.key] ? '' : obj[next.key] = true && cur.push(next);
+                        return cur;
+                    }, []);
+                    return newArr;
+                }
+                else {
+                    return Array.from(new Set(arr));
+                }
+            }
+        },
         onCheck(checkedKeys) {
+            console.log(checkedKeys, 'checkedKeys-checkedKeys');
+            // this.checkedKeys = checkedKeys;
             this.nodes(this.treeData, checkedKeys);
-            this.applyTypeOption = [...this.selectRightData];
-            const changeSelectData = [...this.selectRightData].map(item => item.key);
+            console.log(this.selectRightData, 'this.selectRightData');
+            this.applyTypeOption = this.Es6duplicate([...this.selectRightData], 'key');
+            console.log(this.applyTypeOption, 'this.applyTypeOption');
+            const changeSelectData = this.applyTypeOption.map(item => item.key);
+            this.checkedKeys = changeSelectData;
             if (this.applyTypeOption.length > 100) {
                 const lastOptionKey = this.applyTypeOption[99].key;
                 const lastIndex = changeSelectData.findIndex(item => item === lastOptionKey);
@@ -216,6 +247,10 @@ export default {
             this.$emit('applyType', this.applyTypeOption);
         },
         nodes(data, checkedKeys) {
+            if (!checkedKeys.length) {
+                this.selectRightData = new Set();
+                return;
+            }
             data.forEach(item => {
                 if (item.children) {
                     this.nodes(item.children, checkedKeys);

+ 8 - 3
src/views/modules/crowd-control/crowd-control-service.js

@@ -10,19 +10,24 @@ class AppMarketService {
     setAcountColumns() {
         return [
             {
-                title: '项目名称',
+                title: '账户名称',
                 dataIndex: 'accountName',
-                width: '35%'
+                width: '30%'
             },
             {
                 title: '所属项目',
                 dataIndex: 'projectName',
-                width: '35%'
+                width: '30%'
             },
             {
                 title: '人群包数量',
                 dataIndex: 'count',
                 width: '20%'
+            },
+            {
+                title: '状态',
+                dataIndex: 'statusStr',
+                width: '20%'
             }
         ]
     }

+ 58 - 17
src/views/modules/crowd-control/crowd-control.vue

@@ -58,7 +58,7 @@
                 :pagination="false"
             >
                 <span slot="action" slot-scope="text, record">
-                    <a @click="handleEdit(record)">推送</a>
+                    <a @click="handleEdit(record)" :disabled="record.status !== 4">推送</a>
                     <a-divider type="vertical" />
                     <a @click="handleDelete(record)">删除</a>
                 </span>
@@ -101,7 +101,7 @@
                     :wrapper-col="wrapperCol"
                 >
                     <a-form-model-item label="匹配类型" prop="resource">
-                        <a-radio-group v-model="personForm.resource">
+                        <a-radio-group v-model="personForm.resource" :disabled="personResourceDisabled">
                             <a-radio v-for="item in mateTypeTasks" :key="item.label" :value="item.label">{{ item.value }}</a-radio>
                         </a-radio-group>
                     </a-form-model-item>
@@ -109,6 +109,7 @@
                         <a-input
                             v-model="personForm.name"
                             placeholder="请输入人群包名称"
+                            :disabled="personNameDisabled"
                         />
                     </a-form-model-item>
                     <a-form-model-item label="选择账户">
@@ -123,7 +124,9 @@
                         >
                             <a-button><a-icon type="upload" />文件上传</a-button>
                         </a-upload>
-                        <p class="upload-txt-rules">1、文件格式:支持上传*.txt(utf-8)文本;也支持将单个/多个*.txt文件经过Zip格式压缩上传</p>
+                        <p class="upload-txt-rules">
+                            1、文件格式:支持上传*.txt(utf-8)文本;也支持将单个/多个*.txt文件经过Zip格式压缩上传
+                        </p>
                         <p class="upload-txt-rules">2、文件大小:单个文件大小不能超过1G</p>
                         <p class="upload-txt-rules">3、内容编排:每行一条记录</p>
                     </a-form-model-item>
@@ -157,7 +160,7 @@
             </div>
         </a-modal>
         <a-modal
-            title="相关项目"
+            title="失败原因"
             v-if="causeVisible"
             :visible="causeVisible"
             :confirm-loading="causeConfirmLoading"
@@ -178,7 +181,7 @@
             </div>
         </a-modal>   
         <a-modal
-            title="相关项目"
+            :title="relaxStatus === 'dep' ? '相关项目' : '相关账户'"
             v-if="relaxVisible"
             :visible="relaxVisible"
             :confirm-loading="relaxConfirmLoading"
@@ -211,6 +214,7 @@ import TreeSelect from './components/tree-select/tree-select';
 import {getAction, postAction} from '@/api/manage';
 import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
 import AppMarketService from './crowd-control-service';
+import BMF from 'browser-md5-file';
 
 let COS = require('cos-js-sdk-v5');
 let cos = new COS({
@@ -226,6 +230,8 @@ export default {
     data() {
         let that = this;
         return {
+            personResourceDisabled: false,
+            personNameDisabled: false,
             totalAllCause: 0,
             acountId: undefined, // 搜索的账户ID
             uploadAcountIds: '',
@@ -388,6 +394,7 @@ export default {
                 onOk() {
                     getAction('/kuaishouCrowdPack/delete', {id: data.id}).then(result => {
                         if (result.code === 200) {
+                            this.$message.success('删除成功');
                             this.handleGetTableList({});
                         }
                         else {
@@ -471,7 +478,7 @@ export default {
         handlePushSure() {
             const paramsData = {
                 accountIds: this.finallyRightTree.map(item => item.key),
-                orientationId: this.tableSelectList.orientationId,
+                signature: this.tableSelectList.signature,
                 accountId: this.tableSelectList.accountId
             };
             postAction('/kuaishouCrowdPack/accountPush', paramsData).then(result => {
@@ -490,19 +497,35 @@ export default {
             this.pushVisible = false;
         },
         beforeUpload(file) {
-            const isZip = file.type.includes('zip') || file.type.includes('text');
-            const fileOvesize = file.size > (1024 * 1024 * 1024);
-            if (!isZip) {
-                this.fileList = [];
-                this.$message.error('只能上传zip格式的文件或者txt文件');
-                return false;
-            }
-            if (fileOvesize) {
-                this.$message.error('文件大小不能超过1G');
-                return;
-            }
             this.cosUpload(file);
         },
+        handleMd5(file) {
+            let bmf = new BMF();
+            let that = this;
+            return new Promise(function (resolve, reject) {
+                bmf.md5(file, (err, md5) => {
+                    getAction('/kuaishouCrowdPack/checkCrowdPackage', {signature: md5}).then(result => {
+                        if (result.code === 200) {
+                            that.$message.warning('人群包不存在,允许输入人群包名');
+                            that.personNameDisabled = false;
+                            that.personResourceDisabled = false;
+                            resolve();
+                        }
+                        else if (result.code === 201) {
+                            that.$message.error(result.message);
+                            that.personForm.name = result.result.orientationName;
+                            that.personForm.resource = result.result.type;
+                            that.personNameDisabled = true;
+                            that.personResourceDisabled = true;
+                            reject();
+                        }
+                    }).catch(error => {
+                        console.log(error, 'eeee');
+                        reject();
+                    });
+                })
+            })
+        },
         handleChange(info) {
             this.fileList = info.fileList;
         },
@@ -553,6 +576,17 @@ export default {
                     if (that.fileList.length > 1) {
                         that.fileList = that.fileList.slice(-1);
                     }
+                    const isZip = file.type.includes('zip') || file.type.includes('text');
+                    const fileOvesize = file.size > (1024 * 1024 * 1024);
+                    if (!isZip) {
+                        that.$message.error('只能上传zip格式的文件或者txt文件');
+                        return;
+                    }
+                    if (fileOvesize) {
+                        that.$message.error('文件大小不能超过1G');
+                        return;
+                    }
+                    that.handleMd5(file);
                 }
             );
         },
@@ -597,7 +631,11 @@ export default {
             postAction('/kuaishouCrowdPack/uploadCrowdPack', paramsData).then(result => {
                 if (result.code === 200) {
                     this.personVisible = false;
+                    this.personResourceDisabled = false;
+                    this.personNameDisabled = false;
+                    this.$message.error('上传成功');
                     this.handleGetTableList({});
+                    this.fileList = [];
                 }
                 else {
                     this.$message.error(result.message);
@@ -608,8 +646,11 @@ export default {
         },
         handleCancel() {
             this.personVisible = false;
+            this.personResourceDisabled = false;
+            this.personNameDisabled = false;
             this.$refs.ruleForm.resetFields();
             this.uploadAcountIds = '';
+            this.fileList = [];
         }
     }
 };

+ 3 - 8
src/views/modules/stockWatch/modules/custom-columns/custom-columns.vue

@@ -72,14 +72,6 @@
 export default {
     name: 'custom-columns',
     props: {
-        // treeData: {
-        //     type: Array,
-        //     default: () => []
-        // },
-        // searchValue: {
-        //     type: String,
-        //     default: ''
-        // },
         visible: {
             type: Boolean,
             default: false
@@ -97,6 +89,9 @@ export default {
             applyTypeOption: []
         };
     },
+    mounted() {
+
+    },
     methods: {
         handleDelTree(item) {
             console.log(item, 'item');

+ 1 - 0
src/views/modules/stockWatch/modules/keep-person/keep-person.vue

@@ -9,6 +9,7 @@
                         <span>今日消耗:</span>
                         <span>1000000</span>
                         <span class="left-title-radio"><img class="title-radio-img" src="@/assets/up.png" alt="">10.765%</span>
+                        <!-- TODO 这个是下降的样式,后续优化  -->
                         <!-- <span class="left-title-radio-down"><img class="title-radio-img" src="@/assets/down.png" alt="">10.765%</span> -->
                     </div>
                 </div>

+ 2 - 2
vue.config.js

@@ -80,13 +80,13 @@ module.exports = {
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要jeecg-boot后台项目  李煜一
-         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目 
         // target:'http://118.24.244.213:8804',
-      //  target:'http://139.186.165.84:8806', //测试
+       target:'http://139.186.165.84:8806', //测试
 
         ws: false,