Browse Source

Merge branch 'master' into work-materialPool

朱鑫波 4 năm trước cách đây
mục cha
commit
f473723bdf
26 tập tin đã thay đổi với 4231 bổ sung805 xóa
  1. BIN
      src/assets/img/spLbLAbh.jpg
  2. 1 0
      src/views/modules/account-config/account-config-server.js
  3. 97 1
      src/views/modules/account-config/components/configuration-modal.less
  4. 350 54
      src/views/modules/account-config/components/configuration-modal.vue
  5. 54 37
      src/views/modules/autoLaunch/application/directional-service.js
  6. 8 3
      src/views/modules/autoLaunch/application/directional.less
  7. 814 374
      src/views/modules/autoLaunch/application/application.vue
  8. 652 0
      src/views/modules/autoLaunch/application/components/creatApplication.vue
  9. 602 0
      src/views/modules/autoLaunch/application/components/editApplication.vue
  10. 6 0
      src/views/modules/autoLaunch/application/components/tree-select.less
  11. 56 25
      src/views/modules/autoLaunch/application/components/tree-select.vue
  12. 365 0
      src/views/modules/autoLaunch/application/components/uploadFile.vue
  13. 1 0
      src/views/modules/autoLaunch/directional/components/tree-select.vue
  14. 1 0
      src/views/modules/autoLaunch/directional/directional.vue
  15. 4 4
      src/views/modules/autoLaunch/material-pool/material.vue
  16. 1 0
      src/views/modules/autoLaunch/url/components/tree-select.vue
  17. 343 67
      src/views/modules/creative-copywrit/creative-copywrit.vue
  18. 1 0
      src/views/modules/crowd-control/components/tree-select/tree-select.vue
  19. 33 3
      src/views/modules/crowd-control/crowd-control.vue
  20. 2 2
      src/views/modules/headline-view/headline-view-server.js
  21. 266 182
      src/views/modules/headline-view/headline-view.vue
  22. 51 7
      src/views/modules/material/accountCheck.vue
  23. 3 3
      src/views/modules/material/accountCheckBytedance.vue
  24. 423 0
      src/views/modules/material/comment/selectTable.vue
  25. 96 42
      src/views/modules/material/videoMaterial.vue
  26. 1 1
      vue.config.js

BIN
src/assets/img/spLbLAbh.jpg


+ 1 - 0
src/views/modules/account-config/account-config-server.js

@@ -7,3 +7,4 @@ export const urlAcount = 'http://118.24.244.213:8080'; // 线上
 // export const urlAcount = 'http://apipre.tjyourong.com.cn'; // 预生产
 // export const urlAcount = 'http://192.168.1.43:8080'; // 子安
 // export const urlAcount = 'http://139.186.165.84:8080'; // 测试
+// export const urlAcount = 'http://192.168.1.8:8080'; // 学超

+ 97 - 1
src/views/modules/account-config/components/configuration-modal.less

@@ -81,6 +81,29 @@
                 margin-left: 40px !important;
             }
             .select-orientation-class {
+                // /deep/ .ant-select-selection--single .ant-select-selection__rendered {
+                //     display: flex;
+                //     justify-content: space-between;
+                // }
+                // /deep/ .ant-select-selection-selected-value {
+                //     clear: both;
+                //     width: 320px;
+                // }
+                .orient-list {
+                    display: flex;
+                    justify-content: space-between;
+                    width: 240px;
+                    .orient-option-left {
+                        float: left;
+                        // width: 150px;
+                        // white-space: nowrap;
+                        // overflow: hidden;
+                        // text-overflow: ellipsis;
+                    }
+                    .orient-option-right {
+                        float: right;
+                    }
+                }
                 .ant-form-item-label {
                     width: 200px;
                 }
@@ -121,7 +144,7 @@
                 display: inline-block;
                 .ant-form-item-label {
                     width: 160px;
-                    margin-left: 73px;
+                    margin-left: 53px;
                 }
                 .ant-form-item-control-wrapper {
                     width: 110px;
@@ -211,6 +234,25 @@
             .adver-position-radio {
                 margin-left: 140px;
                 margin-bottom: 15px;
+                .create-web-url-class {
+                    width: 320px;
+                    height: 110px;
+                    background-color: #f9f8f8;
+                    display: flex;
+                    .web-url-img {
+                        width: 53px;
+                        img {
+                            width: 100%;
+                        }
+                    }
+                    .web-url-content {
+                        margin-top: 10px;
+                        margin-left: 10px;
+                        .url-content-id {
+                            margin-top: 10px;
+                        }
+                    }
+                }
                 .creative-label-content {
                     width: 400px;
                     height: 200px;
@@ -246,4 +288,58 @@
             }
         }
     }
+}
+.web-url-modal {
+    width: 1000px !important;
+    .mater-viedo-content {
+        .viedo-header-class {
+            display: flex;
+            justify-content: space-between;
+            border-bottom: 1px solid #eee;
+            .refush-btn-mat {
+                margin-left: 20px;
+            }
+        }
+        .viedo-serach-class {
+            margin-top: 20px;
+        }
+        .viedo-content-class {
+            .viedo-content-group {
+                display: flex;
+                flex-wrap: wrap;
+            }
+            .no-data-group {
+                height: 200px;
+                line-height: 200px;
+                text-align: center;
+            }
+            .content-modal-li {
+                border: 1px solid #e4e4e4;
+                width: 180px;
+                height: 425px;
+                text-align: center;
+                position: relative;
+                margin: 0 10px 10px 0;
+                .checkbox-select-show,
+                .checkbox-select-time {
+                    text-align: left;
+                    margin-top: 14px;
+                    padding-left: 10px;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                }
+                img {
+                    width: 90%;
+                    margin-top: 20px;
+                }
+                .viedo-content-checkbox {
+                    position: absolute;
+                    z-index: 100;
+                    left: 0;
+                    top: 0;
+                }
+            }
+        }
+    }
 }

+ 350 - 54
src/views/modules/account-config/components/configuration-modal.vue

@@ -74,7 +74,16 @@
                         @blur="handleAccountBudget"
                     /> 元
                 </a-form-model-item>
-                <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;margin-left: 140px;">单次修改预算幅度, 不能低于100.0元</div>
+                <!-- <a-form-model-item v-if="configForm.accountBudgetMode === '2'" label="账户日预算" prop="accountBudget">
+                    <a-input-number
+                        v-model="configForm.accountBudget"
+                        :min="1000"
+                        :max="9999999.99"
+                        :step="0.01"
+                        @blur="handleAccountBudget"
+                    /> 元
+                </a-form-model-item> -->
+                <!-- <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;margin-left: 140px;">单次修改预算幅度, 不能低于100.0元</div> -->
             </div>
             <div class="separate-module-con">
                 <p class="rock-title">广告组信息</p>
@@ -97,10 +106,21 @@
                 <a-form-model-item label="广告组名称" prop="campaignName">
                     <a-input
                         class="common-input-long"
+                        id="campaignName"
                         v-model="configForm.campaignName"
                         allow-clear
                         placeholder="请输入广告组名称"
                     />
+                    <!-- <div>
+                        <a-tag
+                            v-for="item in campaignTags"
+                            :key="item"
+                            color="#1890ff"
+                            @click="handleGetChangeAll(item, 'campaignName', 'campaignName')"
+                        >
+                            + {{ item }}
+                        </a-tag>
+                    </div> -->
                 </a-form-model-item>
                 <a-form-model-item label="广告计划名称" prop="adName">
                     <a-input
@@ -115,7 +135,7 @@
                             v-for="item in adNameTags"
                             :key="item"
                             color="#1890ff"
-                            @click="handleGetChangeAll(item, 'groupName')"
+                            @click="handleGetChangeAll(item, 'groupName', 'adName')"
                         >
                             + {{ item }}
                         </a-tag>
@@ -192,6 +212,29 @@
                         allow-clear
                     />
                 </a-form-model-item>
+                <a-form-model-item v-if="platformLoadingType === 'APP_ANDROID'" label="应用下载详情页" prop="creativeWebUrl">
+                    <a-input
+                        class="common-input-long"
+                        v-model="configForm.creativeWebUrl"
+                        placeholder="请输入应用下载详情页"
+                        :disabled="modalTitle === 'edit'"
+                        allow-clear
+                        @change="handleCreativeWebUrl"
+                    />
+                    <span style="margin-left: 10px;"><a :disabled="modalTitle === 'edit'" @click="handleHaveWebUrl">使用已有</a></span>
+                </a-form-model-item>
+                <div v-if="platformLoadingType === 'APP_ANDROID'" class="adver-position-radio">
+                    <div class="create-web-url-class">
+                        <div class="web-url-img">
+                            <img v-if="landingPageShowData.thumbnail" :src="landingPageShowData.thumbnail"/>
+                            <img v-else src="@/assets/noImg.png"/>
+                        </div>
+                        <div class="web-url-content">
+                            <div class="url-content-name"><a>{{ landingPageShowData.name }}</a></div>
+                            <div class="url-content-id">ID:{{ landingPageShowData.siteId || '暂无' }}</div>
+                        </div>
+                    </div>
+                </div>
                 <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="优先应用商店下载">
                     <a-radio-group
                         v-model="configForm.adDownloadMode"
@@ -264,7 +307,7 @@
                     </div>
                     <div v-if="configForm.adverPosition === 'b'" class="position-radio-change">
                         <p>位置选择</p>
-                        <a-checkbox-group v-model="configForm.checkboxChangeValue">
+                        <a-checkbox-group v-model="configForm.checkboxChangeValue" @change="NewCheckboxChangeValue">
                             <a-checkbox :style="radioStyle" value="INVENTORY_FEED">今日头条</a-checkbox>
                             <a-checkbox :style="radioStyle" value="INVENTORY_VIDEO_FEED">西瓜视频</a-checkbox>
                             <a-checkbox :style="radioStyle" value="INVENTORY_HOTSOON_FEED">抖音火山版</a-checkbox>
@@ -502,6 +545,7 @@
                         <a-form-model-item class="select-orientation-class" label="选择已有定向包" :prop="configForm.adDirectionalFlag === 'choice' ? 'adAudiencePackageId' : ''">
                             <a-select
                                 class="common-input-long"
+                                style="width: 320px;"
                                 v-model="configForm.adAudiencePackageId"
                                 allow-clear
                                 placeholder="请选择已有定向包名称"
@@ -513,7 +557,10 @@
                                     :key="index"
                                     :value="item.audience_package_id"
                                 >
-                                    {{ item.name }}
+                                    <div class="orient-list">
+                                        <span class="orient-option-left" style="display: inline-block;width: 150px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.name }}</span>
+                                        <span class="orient-option-right" style="display: inline-block;width: 150px;text-align:right;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.changeName }}</span>
+                                    </div>
                                 </a-select-option>
                             </a-select>
                             <span style="margin-left: 20px;">
@@ -591,7 +638,12 @@
                     </a-input-group>
                 </a-form-model-item>
                 <a-form-model-item label="投放时间">
-                    <a-radio-group :disabled="modalTitle === 'edit'" v-model="configForm.adScheduleType" button-style="solid" @change="handleAdScheduleType">
+                    <a-radio-group
+                        :disabled="modalTitle === 'edit' || configForm.adBudgetMode === 'BUDGET_MODE_TOTAL'"
+                        v-model="configForm.adScheduleType"
+                        button-style="solid"
+                        @change="handleAdScheduleType"
+                    >
                         <a-radio-button value="SCHEDULE_FROM_NOW">从今天起长期投放</a-radio-button>
                         <a-radio-button value="SCHEDULE_START_END">设置开始和结束日期</a-radio-button>
                     </a-radio-group>
@@ -720,13 +772,13 @@
             </div>
             <div class="separate-module-con">
                 <p class="rock-title">创意信息</p>
-                <a-form-model-item label="创意方式">
+                <a-form-model-item v-if="isTomatoStatus" label="创意方式">
                     <a-radio-group v-model="configForm.creativeMaterialMode" button-style="solid">
                         <a-radio-button value="STATIC_ASSEMBLE" :disabled="modalTitle === 'edit'">程序化创意</a-radio-button>
                         <a-radio-button value="NONE" :disabled="modalTitle === 'edit'">自定义创意</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <a-form-model-item label="创意内容">
+                <a-form-model-item v-if="isTomatoStatus" label="创意内容">
                     <a-radio-group v-model="configForm.creativeImageMode" button-style="solid">
                         <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO_VERTICAL">竖版视频</a-radio-button>
                         <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO">横版视频</a-radio-button>
@@ -735,7 +787,7 @@
                         <a-radio-button value="CREATIVE_IMAGE_MODE_LARGE_VERTICAL">大图竖图</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <a-form-model-item label="卡片主图">
+                <a-form-model-item v-if="isTAwemeStatus" label="卡片主图">
                     <a-upload
                         name="avatar"
                         list-type="picture-card"
@@ -759,7 +811,7 @@
                     </a-upload>
                     <span class="especial-label">*</span>
                 </a-form-model-item>
-                <a-form-model-item label="卡片标题" prop="creativeProductDescription">
+                <a-form-model-item v-if="isTAwemeStatus" label="卡片标题" prop="creativeProductDescription">
                     <a-input
                         class="common-input-long"
                         placeholder="请输入卡片标题"
@@ -767,13 +819,13 @@
                         allow-clear
                     />
                 </a-form-model-item>
-                <a-form-model-item label="推广卖点">
+                <a-form-model-item v-if="isTAwemeStatus" label="推广卖点">
                     <a-button type="primary" @click="handleAddOrigin">
                         <a-icon type="plus" />推广卖点
                     </a-button>
                     <span class="especial-label">*</span>
                 </a-form-model-item>
-                <div class="adver-position-radio">
+                <div v-if="isTAwemeStatus" class="adver-position-radio">
                     <a-form-model-item
                         v-for="(item, index) in configForm.defaultFormList"
                         :key="item.id"
@@ -788,14 +840,14 @@
                         <a-icon class="examin-form-icon" type="delete" @click="handleDelOrigin(item)"/>
                     </a-form-model-item>
                 </div>
-                <a-form-model-item label="行动号召">
+                <a-form-model-item v-if="isTAwemeStatus" label="行动号召">
                     <a-radio-group v-model="configForm.creativeEnablePersonalAction" button-style="solid">
                         <a-radio-button :value="true">开启智能优选</a-radio-button>
                         <a-radio-button :value="false">关闭智能优选</a-radio-button>
                     </a-radio-group>
                     <span class="especial-label">*</span>
                 </a-form-model-item>
-                <div class="adver-position-radio">
+                <div v-if="isTAwemeStatus" class="adver-position-radio">
                     <a-form-model-item prop="creativeCallToAction">
                         <a-select
                             class="common-input-long"
@@ -811,7 +863,7 @@
                         </a-select>
                     </a-form-model-item>
                 </div>
-                <a-form-model-item label="来源" :prop="getSource">
+                <a-form-model-item v-if="isTomatoStatus" label="来源" :prop="getSource">
                     <a-input
                         class="common-input-long"
                         placeholder="请输入来源"
@@ -830,7 +882,7 @@
                 <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL' && platformLoadingType === 'APP_ANDROID'" label="副标题">
                     <a-input
                         class="common-input-long"
-                        placeholder="请输入来源"
+                        placeholder="请输入副标题"
                         v-model="configForm.creativeSubTitle"
                         allow-clear
                         @blur="handleCreativeSubTitleBlur"
@@ -849,32 +901,32 @@
                         <a-radio-button :value="1">启用</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <a-form-model-item label="广告评论">
+                <a-form-model-item v-if="isTomatoStatus" label="广告评论">
                     <a-radio-group v-model="configForm.creativeIsCommentDisable" button-style="solid">
                         <a-radio-button :value="1">关闭</a-radio-button>
                         <a-radio-button :value="0">开启</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <a-form-model-item label="客户端下载视频">
+                <a-form-model-item v-if="isTomatoStatus" label="客户端下载视频">
                     <a-radio-group v-model="configForm.creativeDownloadStatus" button-style="solid">
                         <a-radio-button :value="1">关闭</a-radio-button>
                         <a-radio-button :value="0">开启</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <a-form-model-item label="创意展现">
+                <a-form-model-item v-if="isTomatoStatus" label="创意展现">
                     <a-radio-group v-model="configForm.creativeDisplayMode" button-style="solid">
                         <a-radio-button value="CREATIVE_DISPLAY_MODE_CTR">优选模式</a-radio-button>
                         <a-radio-button value="CREATIVE_DISPLAY_MODE_RANDOM">轮播模式</a-radio-button>
                     </a-radio-group>
                 </a-form-model-item>
-                <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_CTR'" class="adver-position-radio">
+                <div v-if="isTomatoStatus && configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_CTR'" class="adver-position-radio">
                     选择优选模式,系统会自动对效果好的创意进行展示量倾斜,创意效果越好展示量越高
                 </div>
-                <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_RANDOM'" class="adver-position-radio">
+                <div v-if="isTomatoStatus && configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_RANDOM'" class="adver-position-radio">
                     使用创意轮播,系统将平分各创意展现机会,便于广告主比较各创意投放效果
                 </div>
             </div>
-            <div class="separate-module-con">
+            <div v-if="isTomatoStatus" class="separate-module-con">
                 <p class="rock-title">创意分类</p>
                 <a-form-model-item label="创意分类" prop="creativeThirdIndustryIds">
                     <a-cascader
@@ -921,6 +973,46 @@
             </div>
         </a-form-model>
     </div>
+    <a-modal
+        v-if="isWebUrl"
+        title="使用落地页"
+        :visible="isWebUrl"
+        dialog-class="web-url-modal"
+        :footer="false"
+        @cancel="handleCancelAll"
+    >
+        <div class="mater-viedo-content">
+            <a-row class="viedo-serach-class" :gutter="24">
+                <a-col :span="9">
+                    <a-form-item label="落地页名称" :labelCol="modalCol" :wrapperCol="modalWrapper">
+                        <a-input v-model="weburlModel" placeholder="请输入落地页名称关键字"/>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="8">
+                    <a-button type="primary" style="position: relative;top: 4px;" @click="handleWebUrlSearch">搜索</a-button>
+                    <a-button type="primary" style="position: relative;top: 4px;margin-left: 15px;" @click="handleWebUrlUpdate">重置</a-button>
+                </a-col>
+            </a-row>
+            <div class="viedo-content-class">
+                <div v-if="viedoDefaultList.length" class="viedo-content-group">
+                    <li
+                        class="content-modal-li"
+                        v-for="(item, index) in viedoDefaultList"
+                        :key="index"
+                        @click="handleViedoListClick(item)"
+                    >
+                        <img v-if="item.thumbnail" :src="item.thumbnail"/>
+                        <img v-else src="@/assets/noImg.png"/>
+                        <div class="checkbox-select-show"><a>{{ item.name }}</a></div>
+                        <div class="checkbox-select-time">ID:{{ item.siteId }}</div>
+                    </li>
+                </div>
+                <div v-else class="no-data-group">
+                    暂无数据
+                </div>
+            </div>
+        </div>
+    </a-modal>
 </div>
 </template>
 <script>
@@ -1025,8 +1117,28 @@ export default {
                     callback();
                 }
             }
+            else if (this.modalTitle === 'add') {
+                callback();
+            }
         };
         return {
+            landingPageShowData: {},
+            weburlModel: '',
+            modalCol: {
+                lg: {span: 6},
+                sm: {span: 6},
+                xs: {span: 6},
+                md: {span: 6}
+            },
+            modalWrapper: {
+                lg: {span: 18},
+                sm: {span: 18},
+                xs: {span: 14},
+                md: {span: 14}
+            },
+            viedoDefaultList: [],
+            viedoDefaultListUpdate: [],
+            isWebUrl: false,
             sureLoading: false,
             subTitleMsgStatus: false,
             subTitleMsg: '',
@@ -1146,7 +1258,7 @@ export default {
             listArr: [],
             regionCityListUrl: 'ctop/bytedanceAreaInfo/list',
             defaultAdBudget: '',
-            adBudgetShowTitle: false,
+            // adBudgetShowTitle: false,/
             adBudgetNum: 300,
             campaignStatus: false,
             detailData: {},
@@ -1156,12 +1268,51 @@ export default {
             md5Result: '',
             urlResult: '',
             createOptions: [],
+            campaignTags: ['序号', '日期'],
             adNameTags: ['出价方式', '素材名称', '日期', '创意方式'],
             fieldNames: {
                 label: 'industryName',
                 value: 'industryId',
                 children: 'children'
             },
+            promotionTypeList: [
+                {
+                    value: 'EXTERNAL',
+                    label: '落地页'
+                },
+                {
+                    value: 'ARTICLE',
+                    label: '文章推广'
+                },
+                {
+                    value: 'GOODS',
+                    label: '商品推广'
+                },
+                {
+                    value: 'DPA',
+                    label: '商品目录'
+                },
+                {
+                    value: 'STORE',
+                    label: '门店推广'
+                },
+                {
+                    value: 'AWEME',
+                    label: '抖音号推广'
+                },
+                {
+                    value: 'SHOP',
+                    label: '店铺直投'
+                },
+                {
+                    value: 'APP_ANDROID',
+                    label: '应用下载-安卓'
+                },
+                {
+                    value: 'APP_IOS',
+                    label: '应用下载-IOS'
+                }
+            ],
             ageArr: [
                 {
                     value: 'NONE',
@@ -1256,13 +1407,17 @@ export default {
                     {validator: adMaxBidValidator, trigger: 'blur'}
                 ],
                 adName: [
-                    {required: true, message: '请输入广告计划名称'},
+                    {required: true, message: '请输入广告计划名称', trigger: 'blur'},
                     {validator: handleCharacterLen100, trigger: 'blur'}
                 ],
                 creativeProductDescription: [
                     {required: true, message: '请输入', trigger: 'blur'},
                     {min: 1, max: 7, message: '请输入1-7个字', trigger: 'blur'}
                 ],
+                creativeWebUrl: [
+                    {required: true, message: '请输入', trigger: 'blur'},
+                    {validator: handleConfirmValue, trigger: 'blur'}
+                ],
                 adAudiencePackageId: [{required: true, message: '请选择', trigger: 'change'}],
                 creativeCallToAction: [{required: true, message: '请选择', trigger: 'change'}],
                 adConvertType: [{required: true, message: '请选择', trigger: 'change'}],
@@ -1270,6 +1425,8 @@ export default {
                 creativeThirdIndustryIds: [{required: true, message: '请选择', trigger: 'change'}]
             },
             configForm: {
+                creativeWebUrl: '',
+                adAppType: '',
                 adDirectionalFlag: 'add',
                 adInterestActionMode: 'UNLIMITED',
                 creativeDisplayMode: 'CREATIVE_DISPLAY_MODE_CTR',
@@ -1360,7 +1517,9 @@ export default {
                 adAutoExtendTargets: '',
                 creativeCallToAction: '', // 行动号召
                 creativeLabel: undefined // 倡议标签
-            }
+            },
+            isTomatoStatus: true,
+            isTAwemeStatus: true
         };
     },
     computed: {
@@ -1368,12 +1527,6 @@ export default {
             if (!this.configForm.accountId) {
                 return '请选择账户';
             }
-            else if (this.configForm.adDownloadType === 'DOWNLOAD_URL' && !this.platformLoadingType) {
-                return '请填写投放内容';
-            }
-            else if (this.configForm.adDownloadType === 'EXTERNAL_URL' && !this.configForm.adExternalUrl) {
-                return '请填写投放内容';
-            }
             else {
                 return 'able';
             }
@@ -1394,9 +1547,41 @@ export default {
         },
         NewAdExternalUrl() {
             return this.configForm.adExternalUrl;
+        },
+        NewPlatformLoadingType() {
+            return this.platformLoadingType;
+        },
+        NewIsTAwemeStatus() {
+            return this.isTAwemeStatus;
         }
     },
     watch: {
+        NewIsTAwemeStatus(newVal) {
+            if (!newVal) {
+                this.md5Result = '';
+                this.urlResult = '';
+                this.imageUrl = '';
+                this.configForm.creativeProductDescription = '';
+                this.configForm.defaultFormList = [];
+                this.configForm.creativeEnablePersonalAction = '';
+                this.configForm.creativeCallToAction = '';
+            }
+            else {
+                this.configForm.creativeEnablePersonalAction = true;
+            }
+        },
+        NewPlatformLoadingType(newVal, oldVal) {
+            if (newVal) {
+                this.configForm.adAppType = newVal;
+            }
+            if (newVal && this.configForm.accountId) {
+                this.handleGetChengZiSite();
+            }
+            else {
+                this.landingPageShowData = {};
+                this.configForm.creativeWebUrl = '';
+            }
+        },
         NewAdExternalUrl(newVal, oldVal) {
             if (newVal && this.configForm.accountId) {
                 const paramsData = {
@@ -1408,7 +1593,6 @@ export default {
                     promotionContent: this.configForm.adDownloadType
                 };
                 this.handleGetOptimizationObjective(paramsData);
-                this.handleGetAdAudiencePackage();
             }
         },
         NewAdPackage(newVal, oldVal) {
@@ -1426,11 +1610,6 @@ export default {
                 this.handleGetOptimizationObjective(paramsData);
             }
         },
-        platformLoadingType(newVal, oldVal) {
-            if (newVal && this.configForm.accountId) {
-                this.handleGetAdAudiencePackage();
-            }
-        },
         NewAountId(newVal, oldVal) {
             if (newVal && this.configForm.adPackage) {
                 const paramsData = {
@@ -1446,12 +1625,17 @@ export default {
                 this.handleGetOptimizationObjective(paramsData);
             }
             if (newVal && this.platformLoadingType) {
-                this.handleGetAdAudiencePackage();
+                this.handleGetChengZiSite();
+            }
+            else {
+                this.landingPageShowData = {};
+                this.configForm.creativeWebUrl = '';
             }
             if (newVal) {
                 this.handleGetCreativeClassification();
                 this.handleGetAdvertiserStrategy();
                 this.handleDirectionalList();
+                this.handleGetAdAudiencePackage();
             }
             else {
                 this.createOptions = [];
@@ -1474,11 +1658,69 @@ export default {
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
         moment,
+        NewCheckboxChangeValue(newVal) {
+            if (newVal.length) {
+                if (newVal.includes('INVENTORY_AWEME_FEED')) {
+                    this.isTAwemeStatus = true;
+                }
+                else {
+                    this.isTAwemeStatus = false;
+                }
+            }
+            else {
+                this.isTAwemeStatus = true;
+            }
+        },
+        handleGetChengZiSite() {
+            const paramsData = {
+                accountId: this.configForm.accountId
+            };
+            getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getChengZiSite', paramsData).then(result => {
+                if (result.code === 0) {
+                    this.viedoDefaultList = result.result;
+                    this.viedoDefaultListUpdate = result.result;
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
+        handleViedoListClick(data) {
+            this.landingPageShowData = data;
+            this.configForm.creativeWebUrl = data.creativeWebUrl;
+            this.weburlModel = '';
+            this.isWebUrl = false;
+        },
+        handleWebUrlSearch() {
+            let defaultList = [];
+            this.viedoDefaultListUpdate.forEach(item => {
+                if (item.name && item.name.indexOf(this.weburlModel) !== -1) {
+                    defaultList.push(item);
+                }
+            });
+            this.viedoDefaultList = defaultList;
+        },
+        handleWebUrlUpdate() {
+            this.viedoDefaultList = [...this.viedoDefaultListUpdate];
+            this.weburlModel = '';
+        },
+        handleCancelAll() {
+            this.handleWebUrlUpdate();
+            this.isWebUrl = false;
+        },
+        handleHaveWebUrl() {
+            this.isWebUrl = true;
+        },
         handleAdhideConver(e) {
             const defaultValue = e.target.value;
             if (defaultValue === 'CUSTOMER' || defaultValue === 'APP') {
                 this.configForm.adConvertedTimeDuration = 'THREE_MONTH';
             }
+            else {
+                this.configForm.adConvertedTimeDuration = '';
+            }
         },
         handleAdAutoExtend(e) {
             const defaultValue = e.target.value;
@@ -1671,13 +1913,20 @@ export default {
         },
         handleGetAdAudiencePackage() {
             const params = {
-                accountId: this.configForm.accountId,
-                landingType: this.configForm.adDownloadType === 'DOWNLOAD_URL' ? this.platformLoadingType : 'EXTERNAL'
+                accountId: this.configForm.accountId
             };
             getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', params)
                 .then(result => {
                     if (result.code === 0) {
-                        this.selectiveList = result.result || [];
+                        const defaultList = result.result;
+                        this.promotionTypeList.forEach(item => {
+                            defaultList.forEach(val => {
+                                if (item.landing_type === val.value) {
+                                    val.changeName = item.label;
+                                }
+                            });
+                        });
+                        this.selectiveList = defaultList;
                     }
                     else {
                         this.$message.error(result.message);
@@ -1860,12 +2109,14 @@ export default {
             if (e.target.value === 'a') {
                 this.configForm.radioChangeValue = '';
                 this.configForm.checkboxChangeValue = [];
+                this.isTAwemeStatus = true;
             }
             else if (e.target.value === 'b') {
                 this.configForm.radioChangeValue = '';
             }
             else if (e.target.value === 'c') {
                 this.configForm.checkboxChangeValue = [];
+                this.isTAwemeStatus = true;
             }
         },
         handleAccountMode(e) {
@@ -1878,6 +2129,9 @@ export default {
         },
         handleAdDownLoadType(e) {
             this.optimizationOption = [];
+            this.landingPageShowData = {};
+            this.configForm.creativeWebUrl = '';
+            this.platformLoadingType = '';
             const defaultValue = e.target.value;
             if (defaultValue === 'DOWNLOAD_URL') {
                 this.configForm.adExternalUrl = '';
@@ -1888,6 +2142,7 @@ export default {
                 this.configForm.adDownloadUrl = '';
                 this.configForm.adPackage = '';
                 this.configForm.adConvertId = '';
+                this.configForm.adAppType = '';
                 this.$refs.ruleForm.clearValidate(['adDownloadUrl']);
                 this.$refs.ruleForm.clearValidate(['adPackage']);
             }
@@ -1966,6 +2221,23 @@ export default {
                         this.configForm.adPackage = detailData.adPackage || '';
                         this.configForm.adConvertType = detailData.adConvertType || '';
                         this.configForm.adDistrict = detailData.adDistrict || 'NONE';
+                        this.configForm.adAppType = detailData.adAppType;
+                        getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getChengZiSite', {accountId: detailData.accountId}).then(result => {
+                            if (result.code === 0) {
+                                const defaultResult = result.result;
+                                defaultResult.forEach(item => {
+                                    if (item.creativeWebUrl === detailData.creativeWebUrl) {
+                                        this.landingPageShowData = item;
+                                    }
+                                });
+                                this.configForm.creativeWebUrl = detailData.creativeWebUrl;
+                            }
+                            else {
+                                this.$message.error(result.message);
+                            }
+                        }).catch(error => {
+                            console.log(error, 'eeee');
+                        });
                         if (detailData.adDownloadType === 'DOWNLOAD_URL') {
                             this.handleGetPackage();
                         }
@@ -2003,7 +2275,7 @@ export default {
                                 this.optimizationOption = updateResult[0].external_actions;
                                 setTimeout(() => {
                                     this.configForm.adConvertId = detailData.adConvertId;
-                                }, 1000);
+                                }, 1500);
                             }
                             else {
                                 this.$message.error(result.message);
@@ -2082,9 +2354,9 @@ export default {
                         this.configForm.adMaxBid = detailData.adMaxBid;
                         this.configForm.adStepBid = detailData.adStepBid;
                         this.configForm.adBidCreateType = detailData.adBidCreateType;
-                        this.configForm.creativeThirdIndustryIds[0] = detailData.creativeThirdIndustryId.substr(0, 4);
-                        this.configForm.creativeThirdIndustryIds[1] = detailData.creativeThirdIndustryId.substr(0, 6);
-                        this.configForm.creativeThirdIndustryIds[2] = detailData.creativeThirdIndustryId;
+                        this.configForm.creativeThirdIndustryIds[0] = detailData.creativeThirdIndustryId && detailData.creativeThirdIndustryId.substr(0, 4);
+                        this.configForm.creativeThirdIndustryIds[1] = detailData.creativeThirdIndustryId && detailData.creativeThirdIndustryId.substr(0, 6);
+                        this.configForm.creativeThirdIndustryIds[2] = detailData.creativeThirdIndustryId && detailData.creativeThirdIndustryId;
                         this.imageUrl = detailData.imageUrl;
                         this.urlResult = detailData.imageUrl;
                         this.md5Result = detailData.creativeProductImageCode;
@@ -2120,6 +2392,12 @@ export default {
                         else if (detailData.creativeInventoryType) {
                             this.configForm.adverPosition = 'b';
                             this.configForm.checkboxChangeValue = detailData.creativeInventoryType.split(',');
+                            if (this.configForm.checkboxChangeValue.includes('INVENTORY_AWEME_FEED')) {
+                                this.isTAwemeStatus = true;
+                            }
+                            else {
+                                this.isTAwemeStatus = false;
+                            }
                         }
                         else {
                             this.configForm.adverPosition = 'a';
@@ -2205,16 +2483,16 @@ export default {
             });
         },
         // 点击获取光标位置进行字段插入
-        handleGetChangeAll(item, field) {
+        handleGetChangeAll(item, field, type) {
             let node = document.getElementById(field);
             let startPos = node.selectionStart; // input 第0个字符到选中的字符
             let endPos = node.selectionEnd; // 选中的字符到最后的字符
             let txt = node.value;
             if (startPos === 0 || endPos === 0) {
-                this.configForm.adName += '-{{' + item + '}}-';
+                this.configForm[type] += '-{{' + item + '}}-';
             }
             else {
-                this.configForm.adName = txt.substring(0, startPos) + '-{{' + item + '}}-' + txt.substring(endPos);
+                this.configForm[type] = txt.substring(0, startPos) + '-{{' + item + '}}-' + txt.substring(endPos);
                 node.selectionStart = startPos + item.length + 6;
                 node.selectionEnd = startPos + item.length + 6;
             }
@@ -2261,8 +2539,19 @@ export default {
                 });
             });
         },
+        handleCreativeWebUrl(e) {
+            const defaultValue = e.target.value;
+            this.landingPageShowData = {};
+        },
         handleDownloadLink(e) {
-            this.handleGetPackage();
+            const defaultValue = e.target.value;
+            if (defaultValue) {
+                this.handleGetPackage();
+            }
+            else {
+                this.platformLoadingType = '';
+                this.configForm.adPackage = '';
+            }
         },
         handleDeleteImg() {
             this.imageUrl = '';
@@ -2391,9 +2680,6 @@ export default {
         },
         handleRelaxSure() {
             let paramsFormData = this.configForm;
-            if (this.adBudgetShowTitle) {
-                return;
-            }
             if (this.configForm.adDistrict === 'CITY') {
                 if (!this.configForm.adSelectCity.length) {
                     this.$message.error('请选择省市');
@@ -2430,15 +2716,17 @@ export default {
                 this.$message.error('请选择投放时段');
                 return;
             }
-            if (!this.urlResult) {
+            // this.isTomatoStatus = true;
+            // this.isTAwemeStatus = true;
+            if (this.isTAwemeStatus && !this.urlResult) {
                 this.$message.error('请上传图片');
                 return;
             }
-            if (!this.configForm.defaultFormList.length) {
+            if (this.isTAwemeStatus && !this.configForm.defaultFormList.length) {
                 this.$message.error('请添加卖点');
                 return;
             }
-            if (!this.creativeTag.length) {
+            if (this.isTomatoStatus && !this.creativeTag.length) {
                 this.$message.error('请添加标签');
                 return;
             }
@@ -2460,9 +2748,17 @@ export default {
                 paramsFormData.creativeSmartInventory = 1;
             }
             else if (paramsFormData.adverPosition === 'b') {
+                if (!paramsFormData.checkboxChangeValue.length) {
+                    this.$message.error('请选择媒体指定位置');
+                    return;
+                }
                 paramsFormData.creativeInventoryTypes = paramsFormData.checkboxChangeValue;
             }
             else if (paramsFormData.adverPosition === 'c') {
+                if (!paramsFormData.radioChangeValue) {
+                    this.$message.error('请选择场景指定位置');
+                    return;
+                }
                 paramsFormData.creativeSceneInventory = paramsFormData.radioChangeValue;
             }
             if (paramsFormData.launchTimeInterval === 'buxian') {

+ 54 - 37
src/views/modules/autoLaunch/application/directional-service.js

@@ -11,44 +11,56 @@
         return [
             {
                 title: '账户名称',
-                dataIndex: 'accountName',
-                width: '30%'
+                dataIndex: 'authName',
+                width: '50%',
+                align: 'center'
             },
+           
             {
-                title: '所属项目',
-                dataIndex: 'projectName',
-                width: '30%'
+                title: '应用数量',
+                dataIndex: 'appCount',
+                width: '50%',
+                align: 'center'
             },
-            {
-                title: '人群包数量',
-                dataIndex: 'count',
-                width: '20%'
-            },
-            {
-                title: '状态',
-                dataIndex: 'statusStr',
-                width: '20%'
-            }
         ]
+            
     }
 
     // 原因的table列表
     setCauseColumns() {
         return [
             {
-                title: '项目名称',
-                dataIndex: 'projectName',
-                width: '30%'
+                title: '账户名称',
+                dataIndex: 'authName',
+                width: '25%',
+                align: 'center'
             },
             {
-                title: '账户名称',
-                dataIndex: 'accountName',
-                width: '30%'
+                title: '推送结果',
+                dataIndex: 'result',
+                width: '25%',
+                align: 'center'
             },
             {
-                title: '原因',
+                title: '失败原因',
                 dataIndex: 'message',
-                width: '40%'
+                width: '25%',
+                align: 'center',
+                customRender(t) {
+                    if(t === 'OK') {
+                        return '-';
+                    }
+                    else {
+                        return t;
+                    }
+                }
+            },
+            {
+                title: '操作',
+                dataIndex: 'action',
+                scopedSlots: {customRender: 'action'},
+                width: '25%',
+                align: 'center'
             }
         ]
     }
@@ -57,19 +69,16 @@
     setDepColumns() {
         return [
             {
-                title: '项目名称',
-                dataIndex: 'projectName',
-                width: '40%'
+                title: '广告组名称',
+                dataIndex: 'unitName',
+                width: '50%',
+                align: 'center'
             },
             {
-                title: '账户数量',
-                dataIndex: 'accountCount',
-                width: '20%'
-            },
-            {
-                title: '人群包数量',
-                dataIndex: 'count',
-                width: '20%'
+                title: '所属账户',
+                dataIndex: 'authName',
+                width: '50%',
+                align: 'center'
             }
         ]
     }
@@ -78,16 +87,24 @@
     setPlatform() {
         return [
             {
-                label: 0,
+                label: '',
                 value: '不限'
             },
             {
                 label: 1,
-                value: 'Android'
+                value: 'Android 应用下载'
             },
             {
                 label: 2,
-                value: 'IOS'
+                value: 'Android 网页游戏'
+            },
+            {
+                label: 3,
+                value: 'iOS 应用下载'
+            },
+            {
+                label: 4,
+                value: 'iOS 网页游戏'
             }
         ]
     }

+ 8 - 3
src/views/modules/autoLaunch/application/directional.less

@@ -1,8 +1,11 @@
 .directional-content {
     background: #fff;
-    height: calc(100vh - 137px);
+    // height: calc(100vh - 137px);
     padding: 20px;
     overflow-y: auto;
+    .middle-button {
+        margin: 0 8px;
+    }
     .control-con-header {
         margin-bottom: 20px;
         position: relative;
@@ -92,8 +95,10 @@
         height: 40px;
         line-height: 40px;
         .acount-title-left {
-            margin-right: 20px;
-            width: 100px;
+            width: 80px;
+        }
+        .acount-title-left::after {
+            content: " : ";
         }
     }
     .push-plate {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 814 - 374
src/views/modules/autoLaunch/application/application.vue


+ 652 - 0
src/views/modules/autoLaunch/application/components/creatApplication.vue

@@ -0,0 +1,652 @@
+<style lang="less" scoped>
+.require-class {
+  /deep/ .ant-form-item-label {
+    label::before {
+      display: inline-block;
+      margin-right: 4px;
+      color: #f5222d;
+      font-size: 14px;
+      font-family: SimSun, sans-serif;
+      line-height: 1;
+      content: '*';
+    }
+  }
+}
+</style>
+<template>
+  <div>
+    <a-modal
+      title="添加应用"
+      :visible="application"
+      @ok="handleOk"
+      :confirmLoading="confirmLoading"
+      @cancel="handleCancel"
+      width="800px"
+    >
+      <a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
+        <a-form :form="form">
+          <selectTable :projectId.sync="projectId" ref="selectTable" :requireCheck="true"></selectTable>
+          <a-form-item
+            label="设备类型"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-radio-group v-model="appType" @change="changePlatform">
+              <a-radio-button value="android">安卓</a-radio-button>
+              <a-radio-button value="ios">IOS</a-radio-button>
+            </a-radio-group>
+          </a-form-item>
+          <!-- <a-form-item v-if="appType == 'android'"> -->
+          <a-form-item
+            label="推广类型"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-radio-group v-model="platform" @change="changeShowUploadType">
+              <a-radio value="1">应用下载</a-radio>
+              <a-radio value="2">网页游戏</a-radio>
+            </a-radio-group>
+          </a-form-item>
+
+          <a-form-item
+            label="上传应用"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-radio-group v-model="uploadType" @change="changeShowUpload">
+              <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
+            v-if="uploadType == '2'"
+            label="下载链接"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-input
+              placeholder="请填写应用下载链接"
+              v-decorator="[
+                'url',
+                {
+                  rules: [{ required: true, validator: handleConfirmValue }],
+                },
+              ]"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="应用包名"
+            v-if="uploadType == '2' && appType == 'android'"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-input
+              v-decorator="[
+                'packageName',
+                {
+                  rules: [{ required: true, message: '请填写正确的应用包名称' }],
+                },
+              ]"
+              placeholder="请填写包名称,如com.smile.gifmaker"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="应用名称"
+            v-if="uploadType == '2'"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-input
+              v-decorator="[
+                'appName',
+                {
+                  rules: [{ required: true, message: '请填写应用名称' }],
+                },
+              ]"
+              placeholder="请填写应用名称"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="上传图标"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 19 } }"
+            v-if="application"
+            class="require-class"
+          >
+            <uploadFile
+              v-if="application"
+              :value.sync="fileUrl"
+              :multiple="false"
+              :fileCount="1"
+              uploadType="image"
+              @overUpload="overUpload"
+              :size="100"
+            ></uploadFile>
+            <p class="upload-txt-rules">文件格式:支持上传png/jpg/jpeg图片,尺寸450*450,小于100kb</p>
+          </a-form-item>
+          <a-form-item
+            label="上传文件"
+            v-if="uploadType == '1'"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            class="require-class fileUpload"
+            id="fileUpload"
+          >
+            <!-- <a-upload name="file" :file-list="fileList" :before-upload="beforeUpload" @change="handleChange">
+              <a-button><a-icon type="upload" />文件上传</a-button>
+            </a-upload> -->
+            <!-- :action="uploadAction" -->
+            <a-upload
+              name="file"
+              :multiple="false"
+              :headers="tokenHeader"
+              :file-list="fileList"
+              :showUploadList="false"
+              :beforeUpload="beforeUpload"
+              @change="handleChange"
+              style="margin-right: 20px"
+            >
+              <a-button :disabled="fileUrl == '' && !projectId">
+                <a-icon type="upload" />
+                {{ loadDisabled ? '上传中,请稍后' : '文件上传' }}
+              </a-button>
+            </a-upload>
+            <a @click="downLoadFile">文件格式下载</a>
+          </a-form-item>
+          <a-form-item
+            label="应用标记"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            v-if="uploadType == '2'"
+          >
+            <a-input
+              v-decorator="[
+                'appVersion',
+                {
+                  rules: [{ required: true, message: ' ' }, { validator: checkAppVersion }],
+                },
+              ]"
+              placeholder="请填写应用标记,必填且不可重复,如快手-5.6.1.66"
+            />
+          </a-form-item>
+          <!-- <a-form-item>
+            <a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
+              <a-button htmlType="submit" type="primary">提交</a-button>
+              <a-button style="margin-left: 8px">保存</a-button>
+            </a-form-item>
+          </a-form-item> -->
+          <a-form-item
+            label=""
+            :labelCol="{ span: 5 }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 }, offset: 5 }"
+            v-if="uploadType == '2' && appType == 'android'"
+          >
+            <!-- <a-radio-group
+              v-decorator="[
+                'useSdk',
+                {
+                  rules: [{ required: true }],
+                  initialValue: '0',
+                },
+              ]"
+            >
+              <a-radio value="0">未接入</a-radio>
+              <a-radio value="1">已接入</a-radio>
+            </a-radio-group> -->
+            <a-checkbox-group
+              v-decorator="[
+                'useSdk',
+                {
+                  rules: [{ message: '安卓应用已接入快手广告监测SDK必选' }],
+                },
+              ]"
+            >
+              <a-checkbox :value="0"> 该应用已接入快手广告监测SDK </a-checkbox>
+            </a-checkbox-group>
+          </a-form-item>
+          <a-form-item
+            label="隐私政策链接"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            v-if="uploadType == '2' && appType == 'android'"
+          >
+            <a-input
+              v-decorator="[
+                'appPrivacyUrl',
+                {
+                  rules: [{ required: true, message: '请填写隐私政策链接' }, { validator: handleConfirmValue }],
+                },
+              ]"
+              placeholder="请填写隐私政策链接"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="监测链接"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            v-if="uploadType == '2' && appType == 'android'"
+          >
+            <a-input v-decorator="['trackUrl']" placeholder="请填写监测链接" />
+          </a-form-item>
+        </a-form>
+      </a-card>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { deleteAction, postAction, getAction, downFilePost, downFile } from '@/api/manage'
+import uploadFile from './uploadFile.vue'
+import { mapActions, mapGetters } from 'vuex'
+import BMF from 'browser-md5-file'
+import selectTable from '@/views/modules/Statistics/components/selectPagination.vue'
+import $ from 'jquery'
+const fileSuffix = ['xlsx', 'xls', 'zip']
+export default {
+  name: 'BaseForm',
+  components: {
+    uploadFile,
+    selectTable,
+  },
+  data() {
+    return {
+      useSdk: [],
+      loadDisabled: false,
+      projectId: '',
+      accountId: '',
+      fileList: [],
+      fileUrl: '',
+      accountList: {},
+      appType: 'android', //设备类型
+      platform: '1', //应用类型   : 1 Android 应用下载,2: Android 网页游戏,3: iOS 应用下载, 4:iOS 网页游戏
+      uploadType: '1', //上传类型 1 本地上传 2 填写链接
+      appVersion: '', //应用标记
+      appName: '', // 应用名称
+      packageName: '', //应用包名
+      file: '', // 上传文件
+      imageUrl: '', // 上传图标链接链接
+      downloadUrl: '', //下载链接
+      showUploadFile: true,
+      showDownLoad: false,
+      showUpload: true,
+      showAndroid: true,
+      showIOS: false,
+      customDomain: '',
+      acceptVideo: '/*.apk,/*.png,/*.jpg,/*.jpeg,/*.mp4',
+      accessKeyId: 'LTAIbNbqWzSOklQV',
+      accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
+      region: 'oss-cn-beijing',
+      bucket: 'ctop-media',
+      form: this.$form.createForm(this),
+      url: {
+        insertTemplateUrl: '/kuaishouAppPackage/fillInLink',
+        userAllocationList: '/ctop/userAllocation/list',
+      },
+      application: false,
+      confirmLoading: false,
+      imageToken: '',
+      // uploadAction: '/kuaishouAppPackage/importAppExcel',
+      tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
+      okCreated: false,
+      dataFile: null,
+    }
+  },
+  methods: {
+    checkAppVersion(rule, value, callback) {
+      if (value != '') {
+        if (this.projectId) {
+          let params = {}
+          params.projectId = this.projectId
+          params.appVersion = value
+          getAction('/kuaishouAppPackage/checkAppVersion', params).then((res) => {
+            if (res.success) {
+              callback()
+            } else {
+              callback(res.message)
+            }
+          })
+        }
+      } else {
+        callback('应用标记必填')
+      }
+    },
+    overUpload(file) {},
+    downLoadFile() {
+      downFile('/kuaishouAppPackage/exportAppTemplate').then((res) => {
+        let blob = new Blob([res], {
+          type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+        })
+        let downloadElement = document.createElement('a')
+        let href = window.URL.createObjectURL(blob) //创建下载的链接
+        downloadElement.href = href
+        downloadElement.download = '应用模板' //下载后文件名
+        document.body.appendChild(downloadElement)
+        downloadElement.click() //点击下载
+        document.body.removeChild(downloadElement) //下载完成移除元素
+        window.URL.revokeObjectURL(href) //释放掉blob对象
+      })
+    },
+    handleChange(info) {
+      // let fileList = [...info.fileList]
+
+      // // 1. Limit the number of uploaded files
+      // //    Only to show two recent uploaded files, and old ones will be replaced by the new
+      // fileList = fileList.slice(-2)
+
+      // // 2. read from response and show file link
+      // fileList = fileList.map((file) => {
+      //   if (file.response) {
+      //     // Component will show file.url as link
+      //     file.url = file.response.url
+      //   }
+      //   return file
+      // })
+      // if (fileList.length > 0) {
+      //   this.fileList = [
+      //     {
+      //       ...fileList[fileList.length - 1],
+      //     },
+      //   ]
+      // } else {
+      //   this.fileList = []
+      // }
+      this.loadDisabled = false
+      this.$message.success('文件导入成功')
+      // if (info.file.status !== 'uploading') {
+      //   console.log(info.file, info.fileList)
+      // }
+      // if (info.file.status === 'done') {
+      //   this.loadDisabled = false
+      //   if (info.file.response.code == 200) {
+      //     // this.application = true
+      //     // this.$emit('getDataList')
+      //     this.okCreated = true
+      //     this.$message.success(info.file.response.message)
+      //   } else {
+      //     this.okCreated = false
+      //     this.$message.error(info.file.response.message)
+      //   }
+      // } else if (info.file.status === 'error') {
+      //   this.$message.error(`${info.file.name}上传失败`)
+      //   this.loadDisabled = false
+      // }
+
+      // console.log(this.form)
+    },
+    beforeUpload(file) {
+      // this.cosUpload(file)
+      // if (process.env.NODE_ENV == 'development') {
+      //   this.uploadAction = `/jeecg-boot/kuaishouAppPackage/importAppExcel?projectId=${this.projectId}&platform=${
+      //     this.appType == 'ios' ? +this.platform + 2 : +this.platform
+      //   }&imageUrl=${this.fileUrl}`
+      // } else if (process.env.NODE_ENV == 'debug') {
+      // } else if (process.env.NODE_ENV == 'production') {
+      //   this.uploadAction = `${this.axios.defaults.baseURL}/kuaishouAppPackage/importAppExcel?projectId=${
+      //     this.projectId
+      //   }&platform=${this.appType == 'ios' ? +this.platform + 2 : +this.platform}&imageUrl=${this.fileUrl}`
+      // }
+      // this.dataFile = file
+      this.dataFile = $('.fileUpload').eq(0).find('input')[0].files[0]
+      this.loadDisabled = true
+      const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
+      const fileName = file.name
+      const fileStrArr = fileName.split('.')
+      const suffix = fileStrArr[fileStrArr.length - 1]
+
+      let result = fileSuffix.some((item) => {
+        return item === suffix
+      })
+
+      if (!result) {
+        this.$message.error('不支持该文件类型')
+        this.loadDisabled = false
+        return false
+      }
+    },
+    cosUpload(file) {
+      let that = this
+      let date = new Date()
+      let y = date.getFullYear()
+      let MM = date.getMonth() + 1
+      MM = MM < 10 ? '0' + MM : MM
+      let d = date.getDate()
+      d = d < 10 ? '0' + d : d
+      let timeElse = new Date().getTime()
+      let arr = file.name.split('.')
+      let str = ''
+      for (let i = 0; i < arr.length; i++) {
+        if (i === arr.length - 1) {
+        } else {
+          if (i === arr.length - 2) {
+            str += arr[i]
+          } else {
+            str += arr[i] + '.'
+          }
+        }
+      }
+      cos.putObject(
+        {
+          Bucket: 'media-1301855440',
+          Region: 'ap-chongqing',
+          // 存储桶所在地域,必须字段
+          Key: that.appType + '/' + y + '-' + MM + '-' + d + '/' + str + '-' + timeElse + '.' + arr[arr.length - 1],
+          StorageClass: 'STANDARD',
+          Body: file, // 上传文件对象
+        },
+        function (err, data) {
+          if (err) {
+            that.$message.error('上传失败!!!' + err)
+            return
+          }
+          that.loadingElse = false
+          that.fileList.push({
+            uid: file.name,
+            name: file.name,
+            status: 'done',
+            url: '//' + data.Location,
+          })
+          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)
+        }
+      )
+    },
+    handleMd5(file) {
+      let bmf = new BMF()
+      let that = this
+      return new Promise(function (resolve, reject) {
+        bmf.md5(file, (err, md5) => {
+          // getAction('kuaishouPopulationPackage/checkPopulationPackage', { signature: md5 })
+          //   .then((result) => {
+          //     if (result.code === 200) {
+          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()
+          // })
+        })
+      })
+    },
+    handleOk() {
+      this.handleSubmit()
+    },
+    handleCancel() {
+      this.dataFile = null
+      this.appType = 'android'
+      this.okCreated = false
+      this.form.resetFields()
+      this.fileUrl = ''
+      this.projectId = undefined
+      this.$refs.selectTable.keyValue = ''
+      this.$refs.selectTable.getData()
+      this.file = ''
+      this.platform = '1'
+      this.application = false
+      this.uploadType = '1'
+    },
+    showApplication() {
+      this.application = true
+    },
+    handleConfirmValue(rule, value, callback) {
+      if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value != '') {
+        callback()
+      } else {
+        callback('链接不能为空且开头为http://或https://')
+      }
+    },
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    changePlatform() {
+      this.form.resetFields()
+      if (this.appType == 'android') {
+        this.showAndroid = true
+        this.showIOS = false
+        this.platform = '1'
+      } else {
+        this.showAndroid = false
+        this.showIOS = true
+        this.showDownLoad = true
+        this.platform = '1'
+      }
+    },
+    changeShowUpload() {
+      this.form.resetFields()
+      this.fileUrl = ''
+    },
+    changeShowUploadType() {
+      this.form.resetFields()
+      if (this.platform == '2') {
+        this.showUpload = false
+        this.showUploadFile = false
+        this.showDownLoad = true
+        this.uploadType = '1'
+      } else {
+        this.showUpload = true
+        this.showUploadFile = true
+        this.showDownLoad = false
+      }
+    },
+
+    handleSubmit() {
+      //   console.log('设备类型:' + this.appType)
+      //   console.log('应用类型:' + this.platform)
+      //   console.log('上传类型:' + this.uploadType)
+      //   console.log('应用标记:' + this.appVersion)
+      //   console.log('应用名称:' + this.appName)
+      //   console.log('包名称:' + this.packageName)
+      //   console.log('文件地址:' + this.file)
+      //   console.log('图片地址:' + this.imageUrl)
+      //   e.preventDefault()
+
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          if (this.fileUrl && this.projectId) {
+            this.confirmLoading = true
+            let params = {}
+            params.projectId = this.projectId
+            if (this.uploadType == '1') {
+              // var file = document.getElementById('fileId').files[0] //获取文件流
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/importAppExcel'
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
+              params.imageUrl = this.fileUrl
+              if (this.dataFile) {
+                let formData = new FormData()
+                formData.append('file', this.dataFile)
+                formData.append('projectId', this.projectId)
+                formData.append('platform', this.appType == 'ios' ? +this.platform + 2 : +this.platform)
+                formData.append('imageUrl', this.fileUrl)
+                // if (process.env.NODE_ENV == 'development') {
+                //   this.uploadAction = `/jeecg-boot/kuaishouAppPackage/importAppExcel?projectId=${
+                //     this.projectId
+                //   }&platform=${this.appType == 'ios' ? +this.platform + 2 : +this.platform}&imageUrl=${this.fileUrl}`
+                // } else if (process.env.NODE_ENV == 'debug') {
+                // } else if (process.env.NODE_ENV == 'production') {
+                //   this.uploadAction = `${this.axios.defaults.baseURL}/kuaishouAppPackage/importAppExcel?projectId=${
+                //     this.projectId
+                //   }&platform=${this.appType == 'ios' ? +this.platform + 2 : +this.platform}&imageUrl=${this.fileUrl}`
+                // }
+
+                postAction('/kuaishouAppPackage/importAppExcel', formData).then((res) => {
+                  this.confirmLoading = false
+                  if (res.code === 200) {
+                    this.$message.success('创建成功')
+                    this.handleCancel()
+                    this.$emit('getDataList')
+                  } else {
+                    this.$message.error(res.message)
+                  }
+                })
+              } else {
+                this.$message.error('请上传文件')
+              }
+
+              return
+            } else {
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
+              params = { ...values }
+              params.useSdk = params.useSdk ? (params.useSdk.length > 0 ? 1 : 0) : null
+              params.projectId = this.projectId
+              params.appIconUrl = this.fileUrl
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
+            }
+
+            postAction(this.url.insertTemplateUrl, params).then((res) => {
+              this.confirmLoading = false
+              if (res.success) {
+                this.$message.success('创建成功')
+                this.handleCancel()
+                this.$emit('getDataList')
+              } else {
+                this.$message.error(res.message)
+              }
+            })
+          } else {
+            this.$message.error('请填写必填项')
+          }
+        }
+      })
+    },
+
+    onChange(value) {},
+  },
+  created: function () {
+    let params = {}
+    params.pageSize = '1000'
+    params.mediaId = '2'
+    params.userId = this.userInfo().id
+    getAction(this.url.userAllocationList, params).then((res) => {
+      if (res.success) {
+        this.accountList = res.result.records
+      }
+    })
+  },
+}
+</script>

+ 602 - 0
src/views/modules/autoLaunch/application/components/editApplication.vue

@@ -0,0 +1,602 @@
+<template>
+  <div>
+    <a-modal
+      title="编辑应用"
+      :visible="application"
+      @ok="handleOk"
+      :confirmLoading="confirmLoading"
+      @cancel="handleCancel"
+      width="800px"
+    >
+      <a-card :body-style="{ padding: '24px 32px' }" :bordered="false">
+        <a-form :form="form">
+          <!-- <selectTable :projectId.sync="projectId" ref="selectTable" :requireCheck="true"></selectTable> -->
+          <a-form-item
+            label="项目名称"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-input
+              disabled
+              v-decorator="[
+                'projectName',
+                {
+                  rules: [{ required: true }],
+                },
+              ]"
+            />
+          </a-form-item>
+          <a-form-item
+            label="设备类型"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-radio-group v-model="appType" @change="changePlatform" disabled>
+              <a-radio-button value="android">安卓</a-radio-button>
+              <a-radio-button value="ios">IOS</a-radio-button>
+            </a-radio-group>
+          </a-form-item>
+          <!-- <a-form-item v-if="appType == 'android'"> -->
+          <a-form-item
+            label="推广类型"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-radio-group v-model="platform" disabled>
+              <a-radio value="1">应用下载</a-radio>
+              <a-radio value="2">网页游戏</a-radio>
+            </a-radio-group>
+          </a-form-item>
+
+          <a-form-item
+            label="上传应用"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-radio-group v-model="uploadType">
+              <a-radio-button value="1" disabled>本地上传</a-radio-button>
+              <a-radio-button value="2">填写链接</a-radio-button>
+            </a-radio-group>
+          </a-form-item>
+
+          <a-form-item
+            label="上传文件"
+            v-if="uploadType == '1'"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <!-- <a-upload name="file" :file-list="fileList" :before-upload="beforeUpload" @change="handleChange">
+              <a-button><a-icon type="upload" />文件上传</a-button>
+            </a-upload> -->
+            <a-upload
+              name="file"
+              :multiple="false"
+              :action="uploadAction"
+              :headers="tokenHeader"
+              :file-list="fileList"
+              :showUploadList="false"
+              :beforeUpload="beforeUpload"
+              @change="handleChange"
+              style="margin-right: 20px"
+            >
+              <a-button :disabled="(!projectId && !fileUrl) || loadDisabled">
+                <a-icon type="upload" />
+                {{ loadDisabled ? '上传中,请稍后' : '文件上传' }}
+              </a-button>
+            </a-upload>
+            <a @click="downLoadFile">文件格式下载</a>
+          </a-form-item>
+
+          <a-form-item
+            v-if="uploadType == '2'"
+            label="下载链接"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-input
+              placeholder="请填写应用下载链接"
+              v-decorator="[
+                'url',
+                {
+                  rules: [{ required: true, validator: handleConfirmValue }],
+                },
+              ]"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="应用包名"
+            v-if="uploadType == '2' && appType == 'android'"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-input
+              v-decorator="[
+                'packageName',
+                {
+                  rules: [{ required: true, message: '请填写正确的应用包名称' }],
+                },
+              ]"
+              placeholder="请填写包名称,如com.smile.gifmaker"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="应用名称"
+            v-if="uploadType == '2'"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+          >
+            <a-input
+              v-decorator="[
+                'appName',
+                {
+                  rules: [{ required: true, message: '请填写应用名称' }],
+                },
+              ]"
+              placeholder="请填写应用名称"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="上传图标"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 19 } }"
+            v-if="application"
+          >
+            <uploadFile
+              v-if="application"
+              :value.sync="fileUrl"
+              :multiple="false"
+              :fileCount="1"
+              uploadType="image"
+              @overUpload="overUpload"
+              :size="100"
+            ></uploadFile>
+            <p class="upload-txt-rules">文件格式:支持上传png/jpg/jpeg图片,尺寸450*450,小于100kb</p>
+          </a-form-item>
+
+          <a-form-item
+            label="应用标记"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            v-if="uploadType == '2'"
+          >
+            <a-input
+              v-decorator="[
+                'appVersion',
+                {
+                  rules: [{ required: true, message: ' ' }, { validator: checkAppVersion }],
+                },
+              ]"
+              placeholder="请填写应用标记,必填且不可重复,如快手-5.6.1.66"
+            />
+          </a-form-item>
+          <!-- <a-form-item>
+            <a-form-item :wrapperCol="{ span: 24 }" style="text-align: center">
+              <a-button htmlType="submit" type="primary">提交</a-button>
+              <a-button style="margin-left: 8px">保存</a-button>
+            </a-form-item>
+          </a-form-item> -->
+          <a-form-item
+            label=""
+            :labelCol="{ span: 5 }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 }, offset: 5 }"
+            v-if="uploadType == '2' && appType == 'android'"
+          >
+            <a-checkbox-group v-decorator="['useSdk']">
+              <a-checkbox :value="0"> 该应用已接入快手广告监测SDK </a-checkbox>
+            </a-checkbox-group>
+          </a-form-item>
+          <a-form-item
+            label="隐私政策链接"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            v-if="uploadType == '2' && appType == 'android'"
+          >
+            <a-input
+              v-decorator="[
+                'appPrivacyUrl',
+                {
+                  rules: [{ required: true, message: '请填写隐私政策链接' }, { validator: handleConfirmValue }],
+                },
+              ]"
+              placeholder="请填写隐私政策链接"
+            />
+          </a-form-item>
+
+          <a-form-item
+            label="监测链接"
+            :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+            :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+            v-if="uploadType == '2' && appType == 'android'"
+          >
+            <a-input v-decorator="['trackUrl']" placeholder="请填写监测链接" />
+          </a-form-item>
+        </a-form>
+      </a-card>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { deleteAction, postAction, getAction, downFilePost, downFile } from '@/api/manage'
+import uploadFile from './uploadFile.vue'
+import { mapActions, mapGetters } from 'vuex'
+import BMF from 'browser-md5-file'
+import selectTable from '@/views/modules/Statistics/components/selectPagination.vue'
+import pick from 'lodash.pick'
+const fileSuffix = ['xlsx', 'xls', 'zip']
+export default {
+  name: 'BaseForm',
+  components: {
+    uploadFile,
+    selectTable,
+  },
+  data() {
+    return {
+      loadDisabled: false,
+      projectId: '',
+      accountId: '',
+      fileList: [],
+      fileUrl: '',
+      accountList: {},
+      appType: 'android', //设备类型
+      platform: '1', //应用类型   : 1 Android 应用下载,2: Android 网页游戏,3: iOS 应用下载, 4:iOS 网页游戏
+      uploadType: '2', //上传类型 1 本地上传 2 填写链接
+      appVersion: '', //应用标记
+      appName: '', // 应用名称
+      packageName: '', //应用包名
+      file: '', // 上传文件
+      imageUrl: '', // 上传图标链接链接
+      downloadUrl: '', //下载链接
+      showUploadFile: true,
+      showDownLoad: false,
+      showUpload: true,
+      showAndroid: true,
+      showIOS: false,
+      customDomain: '',
+      acceptVideo: '/*.apk,/*.png,/*.jpg,/*.jpeg,/*.mp4',
+      accessKeyId: 'LTAIbNbqWzSOklQV',
+      accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
+      region: 'oss-cn-beijing',
+      bucket: 'ctop-media',
+      form: this.$form.createForm(this),
+      url: {
+        insertTemplateUrl: '/kuaishouAppPackage/fillInLink',
+        userAllocationList: '/ctop/userAllocation/list',
+      },
+      application: false,
+      confirmLoading: false,
+      imageToken: '',
+      uploadAction: '/kuaishouAppPackage/importAppExcel',
+      tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
+      appId: null,
+    }
+  },
+  methods: {
+    checkAppVersion(rule, value, callback) {
+      if (value != '') {
+        if (this.projectId) {
+          let params = {}
+          params.projectId = this.projectId
+          params.appVersion = value
+          getAction('/kuaishouAppPackage/checkAppVersion', params).then((res) => {
+            if (res.success) {
+              callback()
+            } else {
+              callback(res.message)
+            }
+          })
+        }
+      } else {
+        callback('应用标记必填')
+      }
+    },
+    overUpload(file) {
+      console.log(file)
+    },
+    downLoadFile() {
+      downFile('/kuaishouAppPackage/exportAppTemplate').then((res) => {
+        let blob = new Blob([res], {
+          type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+        })
+        let downloadElement = document.createElement('a')
+        let href = window.URL.createObjectURL(blob) //创建下载的链接
+        downloadElement.href = href
+        downloadElement.download = '应用模板' //下载后文件名
+        document.body.appendChild(downloadElement)
+        downloadElement.click() //点击下载
+        document.body.removeChild(downloadElement) //下载完成移除元素
+        window.URL.revokeObjectURL(href) //释放掉blob对象
+      })
+    },
+    handleChange(info) {
+      console.log(info)
+      let fileList = [...info.fileList]
+
+      // 1. Limit the number of uploaded files
+      //    Only to show two recent uploaded files, and old ones will be replaced by the new
+      fileList = fileList.slice(-2)
+
+      // 2. read from response and show file link
+      fileList = fileList.map((file) => {
+        if (file.response) {
+          // Component will show file.url as link
+          file.url = file.response.url
+        }
+        return file
+      })
+      if (fileList.length > 0) {
+        this.fileList = [
+          {
+            ...fileList[fileList.length - 1],
+          },
+        ]
+      } else {
+        this.fileList = []
+      }
+      // this.loadDisabled = false
+      // this.$message.success('文件导入成功,异步创建中,请稍后查看...')
+      if (info.file.status !== 'uploading') {
+        console.log(info.file, info.fileList)
+      }
+      if (info.file.status === 'done') {
+        this.loadDisabled = false
+        if (info.file.response.code == 200) {
+          this.application = true
+          this.$emit('getDataList')
+          this.$message.success(info.file.response.message)
+        } else {
+          this.$message.error(info.file.response.message)
+        }
+      } else if (info.file.status === 'error') {
+        this.$message.error(`${info.file.name}上传失败`)
+        this.loadDisabled = false
+      }
+
+      // console.log(this.form)
+    },
+    beforeUpload(file) {
+      // this.cosUpload(file)
+      if (process.env.NODE_ENV == 'development') {
+        this.uploadAction = `/jeecg-boot/kuaishouAppPackage/importAppExcel?projectId=${this.projectId}&platform=${
+          this.appType == 'ios' ? +this.platform + 2 : +this.platform
+        }&imageUrl=${this.fileUrl}`
+      } else if (process.env.NODE_ENV == 'debug') {
+      } else if (process.env.NODE_ENV == 'production') {
+        this.uploadAction = `${this.axios.defaults.baseURL}/kuaishouAppPackage/importAppExcel?projectId=${
+          this.projectId
+        }&platform=${this.appType == 'ios' ? +this.platform + 2 : +this.platform}&imageUrl=${this.fileUrl}`
+      }
+      this.loadDisabled = true
+      const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
+      const fileName = file.name
+      const fileStrArr = fileName.split('.')
+      const suffix = fileStrArr[fileStrArr.length - 1]
+
+      let result = fileSuffix.some((item) => {
+        return item === suffix
+      })
+
+      if (!result) {
+        this.$message.error('不支持该文件类型')
+        this.loadDisabled = false
+        return false
+      }
+    },
+    cosUpload(file) {
+      let that = this
+      let date = new Date()
+      let y = date.getFullYear()
+      let MM = date.getMonth() + 1
+      MM = MM < 10 ? '0' + MM : MM
+      let d = date.getDate()
+      d = d < 10 ? '0' + d : d
+      let timeElse = new Date().getTime()
+      let arr = file.name.split('.')
+      let str = ''
+      for (let i = 0; i < arr.length; i++) {
+        if (i === arr.length - 1) {
+        } else {
+          if (i === arr.length - 2) {
+            str += arr[i]
+          } else {
+            str += arr[i] + '.'
+          }
+        }
+      }
+      cos.putObject(
+        {
+          Bucket: 'media-1301855440',
+          Region: 'ap-chongqing',
+          // 存储桶所在地域,必须字段
+          Key: that.appType + '/' + y + '-' + MM + '-' + d + '/' + str + '-' + timeElse + '.' + arr[arr.length - 1],
+          StorageClass: 'STANDARD',
+          Body: file, // 上传文件对象
+        },
+        function (err, data) {
+          if (err) {
+            that.$message.error('上传失败!!!' + err)
+            return
+          }
+          that.loadingElse = false
+          that.fileList.push({
+            uid: file.name,
+            name: file.name,
+            status: 'done',
+            url: '//' + data.Location,
+          })
+          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)
+        }
+      )
+    },
+    handleMd5(file) {
+      let bmf = new BMF()
+      let that = this
+      return new Promise(function (resolve, reject) {
+        bmf.md5(file, (err, md5) => {
+          // getAction('kuaishouPopulationPackage/checkPopulationPackage', { signature: md5 })
+          //   .then((result) => {
+          //     if (result.code === 200) {
+          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()
+          // })
+        })
+      })
+    },
+    handleOk() {
+      this.handleSubmit()
+    },
+    handleCancel() {
+      this.form.resetFields()
+      this.imageUrl = ''
+      this.fileUrl = ''
+      this.platform = '1'
+      this.application = false
+      this.uploadType = '2'
+    },
+    showApplication(val) {
+      this.application = true
+      this.appId = val.id
+      getAction('/kuaishouAppPackage/queryById', { id: val.id }).then((res) => {
+        //   'appIconUrl',
+        if (res.success) {
+          this.fileUrl = res.result.appIconUrl
+          this.appType = res.result.platform > 2 ? 'ios' : 'android'
+          this.platform = res.result.platform > 2 ? res.result.platform - 2 + '' : res.result.platform + ''
+          res.result.useSdk = res.result.useSdk ? (res.result.useSdk == 0 ? [] : [0]) : null
+          this.projectId = res.result.projectId
+          if (this.appType == 'android') {
+            this.$nextTick(() => {
+              this.form.setFieldsValue(
+                pick(res.result, 'url', 'packageName', 'appPrivacyUrl', 'useSdk', 'trackUrl', 'appName', 'projectName')
+              )
+              setTimeout(() => {
+                this.form.setFieldsValue(pick(res.result, 'appVersion'))
+              }, 150)
+            })
+          } else {
+            setTimeout(() => {
+              this.form.setFieldsValue(pick(res.result, 'url', 'appVersion', 'projectName'))
+            }, 100)
+            setTimeout(() => {
+              this.form.setFieldsValue(pick(res.result, 'appName'))
+            }, 150)
+          }
+        }
+      })
+    },
+    handleConfirmValue(rule, value, callback) {
+      if (/(http|https):\/\/([\w.]+\/?)\S*/.test(value) && value != '') {
+        callback()
+      } else {
+        callback('链接不能为空且开头为http://或https://')
+      }
+    },
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    changePlatform() {
+      // this.form.resetFields()
+      // if (this.appType == 'android') {
+      //   this.showAndroid = true
+      //   this.showIOS = false
+      //   this.platform = '1'
+      // } else {
+      //   this.showAndroid = false
+      //   this.showIOS = true
+      //   this.showDownLoad = true
+      //   this.platform = '1'
+      // }
+    },
+
+    handleSubmit() {
+      //   console.log('设备类型:' + this.appType)
+      //   console.log('应用类型:' + this.platform)
+      //   console.log('上传类型:' + this.uploadType)
+      //   console.log('应用标记:' + this.appVersion)
+      //   console.log('应用名称:' + this.appName)
+      //   console.log('包名称:' + this.packageName)
+      //   console.log('文件地址:' + this.file)
+      //   console.log('图片地址:' + this.imageUrl)
+      //   e.preventDefault()
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          if (this.fileUrl && this.projectId) {
+            this.confirmLoading = true
+            let params = {}
+            params.projectId = this.projectId
+            if (this.uploadType == '1') {
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/importAppExcel'
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
+              params.imageUrl = this.fileUrl
+            } else {
+              this.url.insertTemplateUrl = '/kuaishouAppPackage/fillInLink'
+              params = { ...values }
+              params.useSdk = params.useSdk ? (params.useSdk.length > 0 ? 1 : 0) : null
+              params.id = this.appId
+              params.projectId = this.projectId
+              params.appIconUrl = this.fileUrl
+              params.platform = this.appType == 'ios' ? +this.platform + 2 : +this.platform
+            }
+            postAction(this.url.insertTemplateUrl, params).then((res) => {
+              this.confirmLoading = false
+              if (res.success) {
+                this.$message.success('修改成功')
+                this.handleCancel()
+                this.$emit('getDataList')
+              } else {
+                this.$message.error(res.message)
+              }
+            })
+          } else {
+            this.$message.error('请填写必填项')
+          }
+        }
+      })
+    },
+
+    onChange(value) {
+      console.log(value)
+    },
+  },
+  created: function () {
+    let params = {}
+    params.pageSize = '1000'
+    params.mediaId = '2'
+    params.userId = this.userInfo().id
+    getAction(this.url.userAllocationList, params).then((res) => {
+      if (res.success) {
+        this.accountList = res.result.records
+      }
+    })
+  },
+}
+</script>

+ 6 - 0
src/views/modules/autoLaunch/application/components/tree-select.less

@@ -21,6 +21,12 @@
             .class-left-content {
                 overflow-y: auto;
                 height: 340px;
+                position: relative;
+                .pagin-table-class {
+                    position: absolute;
+                    bottom: 0;
+                    right: 0;
+                }
             }
             .example {
                 text-align: center;

+ 56 - 25
src/views/modules/autoLaunch/application/components/tree-select.vue

@@ -16,6 +16,14 @@
                             @check="onCheck"
                             @expand="onExpand"
                         />
+                        <!-- <a-pagination
+                            class="pagin-table-class"
+                            :total="totalAll"
+                            :show-total="total => `共 ${totalAll} 条`"
+                            size="small"
+                            @change="onShowSizeChange"
+                            @showSizeChange="onShowSizeChange"
+                        /> -->
                     </template>
                     <div class="example">
                         <a-spin :spinning="spinning"/>
@@ -54,12 +62,33 @@
 </template>
 <script>
 import {mapGetters} from 'vuex';
-import {postAction} from '@/api/manage';
+import {postAction,getAction} from '@/api/manage';
 
 export default {
     name: 'tree-select',
+    props: {
+        projectId: {
+            type: [String,Number],
+            default() {
+                return null
+            },
+        },
+        templateId: {
+            type: [String,Number],
+            default() {
+                return null
+            },
+        },
+        httpSrc: {
+            type: String,
+            default() {
+                return '/kuaishouDirectionalPackage/getAccountByProjectId'
+            }
+        }
+    },
     data() {
         return {
+            totalAll: 20,
             expandedKeys: [],
             autoExpandParent: true,
             checkedKeys: [],
@@ -69,7 +98,11 @@ export default {
             applyTypeOption: [],
             selectRightData: new Set(),
             spinning: true,
-            leftTreeNoData: false
+            leftTreeNoData: false,
+            tablePag: {
+                page: 1,
+                size: 100
+            },
         };
     },
     mounted() {
@@ -77,36 +110,32 @@ export default {
     },
     methods: {
         ...mapGetters(['userInfo']),
+        onShowSizeChange(current, pageSize) {
+            this.tablePag = {
+                page: current,
+                size: pageSize
+            };
+            this.getAccountId();
+        },
         getAccountId() {
-            postAction('/ctop/projectMember/participateListByMediaId', {
-                userId: this.userInfo().id,
-                type: 'kuaishou'
+            getAction(this.httpSrc, {
+                projectId: this.projectId,
+                id: this.templateId,
+                pageNo: this.tablePag.page,
+                pageSize: this.tablePag.size
             }).then(result => {
-                if (result.result.length) {
+                if (result.result.list.length) {
                     this.spinning = false;
-                    this.treeData = result.result.map(item => {
+                    this.treeData = result.result.list.map(item => {
                         return {
-                            key: item.projectId + 'projectId',
-                            title: item.projectName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item.advertiserName,
-                            children: item.accountList
-                            ? item.accountList.map(i => {
-                                return {
-                                    key: i.accountId,
-                                    title:
-                                    (i.userName.length === 2
-                                        ? i.userName + '\xa0\xa0\xa0\xa0\xa0'
-                                        : i.userName.length === 3
-                                        ? i.userName + '\xa0\xa0\xa0\xa0'
-                                        : i.userName)
-                                        + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0'
-                                        + i.accountId
-                                        + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0'
-                                        + i.authName
-                                };
-                            }) : []
+                            key: item.accountId,
+                            title: item.authName,
+                            disabled: item.state === 1,
+                            children: null
                         };
                     });
                     this.updateTreeData = [...this.treeData];
+                    this.totalAll = result.result.total || 0;
                 }
                 else {
                     this.spinning = false;
@@ -142,6 +171,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;
@@ -231,6 +261,7 @@ export default {
         },
         onCheck(checkedKeys) {
             // this.checkedKeys = checkedKeys;
+            console.log(checkedKeys)
             this.nodes(this.treeData, checkedKeys);
             const filterCheckKey = this.checkedKeys.filter(item=>typeof item ==='number');
             let filterCheckKeySet = new Set(filterCheckKey);

+ 365 - 0
src/views/modules/autoLaunch/application/components/uploadFile.vue

@@ -0,0 +1,365 @@
+<style>
+</style>
+<style lang="scss" scoped>
+</style>
+<template>
+  <div class="upload-file">
+    <a-upload
+      name="file"
+      :multiple="multiple"
+      list-type="picture-card"
+      class="avatar-uploader"
+      action="https://media-1301855440.cos.ap-chongqing.myqcloud.com/"
+      :before-upload="beforeUpload"
+      @change="handleChange"
+      :accept="uploadType + '/' + (uploadType == 'image' ? 'jpeg,image/*' : 'mp4')"
+      :file-list="fileList"
+      :remove="removeFile"
+      @preview="handlePreview"
+      :disabled="loadingElse || disabled"
+    >
+      <div v-if="fileList.length < fileCount || fileList.length < 1">
+        <a-progress v-if="loadingElse" :percent="percent" :show-info="false" />
+        <div class="ant-upload-text">点击上传</div>
+      </div>
+    </a-upload>
+    <!-- <div style="color: red" v-if="sizeCheck">
+      {{ uploadType == 'image' ? '请上传jpg格式的图片,并且大小在2m之内' : '请上传mp4格式,大小在'+(size/1024)+'m之内' }}
+    </div> -->
+    <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
+      <img alt="example" style="width: 100%" :src="previewImage" v-if="uploadType == 'image'" />
+      <video :src="previewImage" v-else style="width: 100%" controls="controls">您的浏览器不支持 video 标签。</video>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
+import { mapGetters } from 'vuex'
+import moment from 'moment'
+
+import BMF from 'browser-md5-file'
+
+import qs from 'qs'
+var COS = require('cos-js-sdk-v5')
+var cos = new COS({
+  SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
+  SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9',
+})
+var i = 0
+const oneKB = 1024
+
+function getBase64(file) {
+  return new Promise((resolve, reject) => {
+    const reader = new FileReader()
+    reader.readAsDataURL(file)
+    reader.onload = () => resolve(reader.result)
+    reader.onerror = (error) => reject(error)
+  })
+}
+export default {
+  name: 'upload-file',
+  components: {},
+  props: {
+    uploadType: {
+      //上传类型  值为  image/video,同时目录名称也是这样
+      type: String,
+      default() {
+        return 'image'
+      },
+    },
+    multiple: {
+      // true 可以批量上传  false 不可以
+      type: Boolean,
+      default() {
+        return true
+      },
+    },
+    fileCount: {
+      //最大上传数量
+      type: Number,
+      default() {
+        return 10
+      },
+    },
+    checkFile: {
+      //返回promise方法,判读文件是否上传过,进行上传拦截
+      type: Function,
+      default() {
+        return Promise.resolve()
+      },
+    },
+    disabled: {
+      type: Boolean,
+      default() {
+        return false
+      },
+    },
+    value: {
+      required: true,
+      default() {
+        return ''
+      },
+    },
+    size: {
+      type: Number,
+      default() {
+        if (this.sizeCheck) {
+          if (this.uploadType == 'image') {
+            return 2048
+          } else {
+            return 102400
+          }
+        }
+      },
+    },
+    sizeCheck: {
+      type: Boolean,
+      default() {
+        return true
+      },
+    },
+    onOversize: {
+      type: Function,
+      default() {
+        alert(`请选择${this.size}KB内的文件!`)
+      },
+    },
+  },
+  data() {
+    return {
+      fileList: [],
+      loadingElse: false,
+      imageUrl: '',
+      percent: 0,
+      previewVisible: false,
+      previewImage: '',
+    }
+  },
+  filters: {},
+  computed: {},
+  mounted() {},
+  watch: {
+    //    fileListAll
+    value: {
+      immediate: true,
+      handler(n, o) {
+        this.$nextTick(() => {
+          if (this.fileList && this.fileList.length == 0) {
+            if (typeof n == 'object') {
+              this.fileList = n.map((item, index) => {
+                return {
+                  uid: index + 1,
+                  name: index + 1,
+                  status: 'done',
+                  url: item,
+                }
+              })
+            } else {
+              if (n === '') {
+                this.fileList = []
+              } else {
+                this.fileList = []
+                var data = {
+                  uid: 1,
+                  name: '回显',
+                  status: 'done',
+                  url: n,
+                }
+                this.fileList.push(data)
+              }
+            }
+          } else {
+            if (n.length == 0 || n == '') {
+              this.clearAll()
+            }
+          }
+        })
+      },
+      deep: true,
+    },
+  },
+  methods: {
+    handleCancel() {
+      closeAllVideoFun()
+      this.previewVisible = false
+    },
+    handleChange(info) {
+      if (info.file.status === 'uploading') {
+        this.loading = true
+        return
+      }
+      if (info.file.status === 'done') {
+        // Get this url from response in real world.
+        getBase64(info.file.originFileObj, (imageUrl) => {
+          this.imageUrl = imageUrl
+          this.loading = false
+        })
+      }
+    },
+    removeFile(file) {
+      // console.log(file)
+      var index = this.fileList.findIndex((v) => v.uid === file.uid)
+      this.fileList.splice(index, 1)
+      this.$emit('removeUpload', file)
+    },
+    async handlePreview(file) {
+      if (!file.url && !file.preview) {
+        file.preview = await getBase64(file.originFileObj)
+      }
+      this.previewImage = file.url || file.preview
+      this.previewVisible = true
+    },
+    beforeUpload(file) {
+      this.percent = 0
+      this.loadingElse = true
+      const fileOvesize = file.size > this.size * oneKB
+      console.log(file)
+      var image = new Image()
+      var reader = new FileReader()
+      var height = 0
+      var width = 0
+      reader.readAsDataURL(file)
+      //文件读取结束时间
+      reader.onload = function (e) {
+        image.src = reader.result
+      }
+      var that = this
+      //图片读取事件
+      image.onload = function () {
+        height = image.naturalHeight
+        width = image.naturalWidth
+      }
+      if (image.complete) {
+        height = image.naturalHeight
+        width = image.naturalWidth
+      }
+
+      setTimeout(() => {
+        if (height != 450 || width != 450) {
+          that.$message.error('请上传450*450大小的图片')
+          this.loadingElse = false
+          return
+        }
+        // console.log(fileOvesize)
+        if (fileOvesize && this.sizeCheck) {
+          this.onOversize()
+          this.loadingElse = false
+          return
+        } else {
+          if (file.type.includes('jpg') || file.type.includes('png') || file.type.includes('jpeg')) {
+            this.checkFile(file)
+              .then((res) => {
+                this.cosUpload(file)
+              })
+              .catch(() => {
+                this.loadingElse = false
+              })
+          } else {
+            this.$message.error('请上传正确格式')
+            this.loadingElse = false
+          }
+
+          return new Promise(function (resolve, reject) {
+            reject()
+          })
+        }
+      }, 200)
+    },
+    clearAll() {
+      this.fileList = []
+    },
+    cosUpload(file) {
+      var that = this
+      let date = new Date()
+      let y = date.getFullYear()
+      let MM = date.getMonth() + 1
+      MM = MM < 10 ? '0' + MM : MM
+      let d = date.getDate()
+      d = d < 10 ? '0' + d : d
+      var timeElse = new Date().getTime()
+      var arr = file.name.split('.')
+
+      var str = ''
+      for (let i = 0; i < arr.length; i++) {
+        if (i == arr.length - 1) {
+        } else {
+          if (i == arr.length - 2) {
+            str += arr[i]
+          } else {
+            str += arr[i] + '.'
+          }
+        }
+      }
+      // console.log(str + '-' + timeElse + '.' + arr[arr.length - 1])
+      cos.putObject(
+        {
+          Bucket: 'media-1301855440',
+          /* 必须 */
+          Region: 'ap-chongqing',
+          /* 存储桶所在地域,必须字段 */
+          Key: that.uploadType + '/' + y + '-' + MM + '-' + d + '/' + str + '-' + timeElse + '.' + arr[arr.length - 1],
+          /* 必须 */
+          StorageClass: 'STANDARD',
+          Body: file, // 上传文件对象
+          onProgress: function (progressData) {
+            //进度条方法
+
+            that.percent = progressData.percent * 100
+          },
+          onTaskReady: function (tid) {
+            // console.log('onTaskReady', tid);
+          },
+          onTaskStart: function (info) {
+            //开始上传
+            // console.log('onTaskStart', info);
+          },
+        },
+        function (err, data) {
+          if (err) {
+            that.loadingElse = false
+            that.$message.error('上传失败!!!' + err)
+            return
+          }
+          // alert('成功')
+          that.loadingElse = false
+          if (that.fileList.length < that.fileCount) {
+            that.fileList.push({
+              uid: file.name,
+              name: file.name,
+              status: 'done',
+              url: '//' + data.Location,
+            })
+
+            // that.$emit('overUpload', that.fileList.map(item => {
+            //                 return item.url
+            //               }))
+            that.$emit('overUpload', that.fileList)
+
+            if (that.multiple) {
+              that.$emit(
+                'update:value',
+                that.fileList.map((item) => {
+                  return item.url
+                })
+              )
+            } else {
+              that.$emit(
+                'update:value',
+                that.fileList.map((item) => {
+                  return item.url
+                })[0]
+              )
+            }
+          } else {
+            that.$message.error('上传已达上限' + that.fileCount + '张')
+          }
+        }
+      )
+    },
+  },
+}
+</script>
+<style scoped>
+@import '~@assets/less/common.less';
+</style>

+ 1 - 0
src/views/modules/autoLaunch/directional/components/tree-select.vue

@@ -171,6 +171,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;

+ 1 - 0
src/views/modules/autoLaunch/directional/directional.vue

@@ -502,6 +502,7 @@ export default {
                     title: '操作',
                     dataIndex: 'action',
                     align: 'center',
+                    width: 150,
                     scopedSlots: {customRender: 'action'}
                 },
                 {

+ 4 - 4
src/views/modules/autoLaunch/material-pool/material.vue

@@ -37,10 +37,10 @@ export default {
                     key: 'url',
                     tab: '落地页管理',
                 },
-                // {
-                //     key: 'application',
-                //     tab: '应用包管理',
-                // },
+                {
+                    key: 'application',
+                    tab: '应用包管理',
+                },
             ], 
         }
     },

+ 1 - 0
src/views/modules/autoLaunch/url/components/tree-select.vue

@@ -142,6 +142,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;

+ 343 - 67
src/views/modules/creative-copywrit/creative-copywrit.vue

@@ -313,7 +313,7 @@
             <a-form layout="inline" :selfUpdate="true">
                 <a-row :gutter="24">
                     <a-col :md="8" :sm="8">
-                        <selectTable :projectId.sync="queryParam.projectId"></selectTable>
+                        <selectTable :projectId.sync="queryParam.productId" ref="selectTable"></selectTable>
                     </a-col>
                     <a-col :md="8" :sm="8">
                         <a-form-item label="素材名称">
@@ -346,7 +346,7 @@
                     </a-col>
                     <a-col :md="8" :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="handleSubmit" icon="search">查询</a-button>
                             <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
                         </span>
                     </a-col>
@@ -368,7 +368,7 @@
             <a-button
                 @click="onCheckAllChange"
                 v-if="
-                queryParam.projectId &&
+                queryParam.productId &&
                 active == '1' &&
                 (role.roleCode == 'operator' ||
                     role.roleCode == 'kuaishouOperationManager' ||
@@ -381,7 +381,7 @@
             </a-button>
             <a-button
                 v-if="
-                queryParam.projectId &&
+                queryParam.productId &&
                 active == '1' &&
                 (role.roleCode == 'operator' ||
                     role.roleCode == 'kuaishouOperationManager' ||
@@ -390,9 +390,24 @@
                     role.roleCode == 'touTiaoOperationManager')
                 "
                 :disabled="checkArr.length == 0"
-                @click="tongbu"
+                @click="tongbu('1')"
             >
-                一键同步
+                一键同步头条
+            </a-button>
+            <a-button
+                v-if="
+                queryParam.productId &&
+                active == '1' &&
+                (role.roleCode == 'operator' ||
+                    role.roleCode == 'kuaishouOperationManager' ||
+                    role.roleCode == 'admin' ||
+                    role.roleCode == 'operationAssistant' ||
+                    role.roleCode == 'touTiaoOperationManager')
+                "
+                :disabled="checkArr.length == 0"
+                @click="tongbu('3')"
+            >
+                一键同步头条内广
             </a-button>
             <!-- &&  -->
             <a-button v-if="checkArr.length && active !== '0'" type="primary" @click="handleFodderWind">素材下线</a-button>
@@ -1476,6 +1491,7 @@
                     <div class="acount-title-left">创意标题</div>
                     <div class="acount-title-right">
                         <a-button type="primary" @click="handleAddOrigin"><a-icon type="plus" />创意标题</a-button>
+                        <!-- TODO 暂时功能隐藏 -->
                         <!-- <a-button class="examin-select-title" @click="handleSelectTitle">选标题</a-button> -->
                         <span style="margin-left: 20px;">已填:{{ titleFiledResult.length || 0 }}</span>
                     </div>
@@ -1495,17 +1511,41 @@
                                 <a-input
                                     v-decorator="[
                                         item.name,
-                                        { rules: [
-                                            {required: true, message: '请输入创意标题', trigger: 'blur'},
-                                            {min: 5, max: 30, message: '创意标题5-30个字', trigger: 'blur'}
+                                        {rules: [
+                                            {validator: validatePass, trigger: 'blur'}
                                         ]}
                                     ]"
                                     class="examin-form-input"
+                                    :id="item.name"
                                     placeholder="请输入"
-                                    @change="handleFormInputChang($event, item)"
+                                    @change="handleFormInputChang($event, item.name, item.id)"
                                 />
-                                <span class="examin-form-num">{{ handleFilterName(item.name) }}/30</span>
+                                <span class="examin-form-num">{{ item.lenSize }}/30</span>
                                 <a-icon class="examin-form-icon" type="delete" @click="handleDelOrigin(item)"/>
+                                <div class="ad-name-tags-class">
+                                    <div v-if="item.tabStatus === 'alone'" class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in item.updateTagsList"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleGetChangeAll(val.name, item.name, item.id)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div v-if="item.tabStatus === 'all'" class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in item.defaultTagsList"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleGetChangeAll(val.name, item.name, item.id)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div v-if="item.tabStatus === 'alone'"><a @click="handleMoreTagsShow(item.id, 'more')">更多</a></div>
+                                    <div v-if="item.tabStatus === 'all'"><a @click="handleMoreTagsShow(item.id, 'little')">收起</a></div>
+                                </div>
                             </a-form-item>
                         </a-form>
                     </div>
@@ -1534,6 +1574,7 @@
                     <div class="acount-title-left">创意标题</div>
                     <div class="acount-title-right">
                         <a-button type="primary" @click="handleAddOrigin"><a-icon type="plus" />创意标题</a-button>
+                        <!-- TODO 暂时功能隐藏 -->
                         <!-- <a-button class="examin-select-title" @click="handleSelectTitle">选标题</a-button> -->
                         <span style="margin-left: 20px;">已填:{{ titleFiledResult.length || 0 }}</span>
                     </div>
@@ -1554,16 +1595,39 @@
                                     v-decorator="[
                                         item.name,
                                         { rules: [
-                                            {required: true, message: '请输入创意标题', trigger: 'blur'},
-                                            {min: 5, max: 30, message: '创意标题5-30个字', trigger: 'blur'}
+                                            {validator: validatePass, trigger: 'blur'}
                                         ]}
                                     ]"
                                     class="examin-form-input"
                                     placeholder="请输入"
-                                    @change="handleFormInputChang($event, item)"
+                                    @change="handleFormInputChang($event, item.name, item.id)"
                                 />
-                                <span class="examin-form-num">{{ handleFilterName(item.name) }}/30</span>
+                                <span class="examin-form-num">{{ item.lenSize }}/30</span>
                                 <a-icon class="examin-form-icon" type="delete" @click="handleDelOrigin(item)"/>
+                                <div class="ad-name-tags-class">
+                                    <div v-if="item.tabStatus === 'alone'" class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in item.updateTagsList"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleGetChangeAll(val.name, item.name, item.id)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div v-if="item.tabStatus === 'all'" class="name-tags-left">
+                                        <a-tag
+                                            v-for="val in item.defaultTagsList"
+                                            :key="val.id"
+                                            color="#1890ff"
+                                            @click="handleGetChangeAll(val.name, item.name, item.id)"
+                                        >
+                                            + {{ val.name }}
+                                        </a-tag>
+                                    </div>
+                                    <div v-if="item.tabStatus === 'alone'"><a @click="handleMoreTagsShow(item.id, 'more')">更多</a></div>
+                                    <div v-if="item.tabStatus === 'all'"><a @click="handleMoreTagsShow(item.id, 'little')">收起</a></div>
+                                </div>
                             </a-form-item>
                         </a-form>
                     </div>
@@ -1577,7 +1641,7 @@ import PermissionModal from '@/views/modules/material/modules/DepartModal';
 import {JeecgListMixin} from '@/mixins/JeecgListMixin';
 import JEllipsis from '@/components/jeecg/JEllipsis';
 import UploadToAli from '@femessage/upload-to-ali';
-import selectTable from '@/views/modules/Statistics/components/selectPagination.vue';
+import selectTable from '@/views/modules/material/comment/selectTable.vue';
 import {fileCheck, fileEdit, fileEditAll, fileInsertV2, fileEditUpdate, fileEditUpdateBatch} from '@/api/actor';
 import {deleteAction, getAction, postAction, putAction} from '@/api/manage';
 import uploadFile from '@/components/uploadFile.vue';
@@ -1604,6 +1668,7 @@ export default {
     },
     data() {
         return {
+            adNameTags: [],
             materTitltStatus: false,
             accountMaster: {
                 height: '35px',
@@ -1881,6 +1946,7 @@ export default {
             }
         });
         this.getHangye();
+        this.handleGetCreativeWord();
     },
     watch: {
         $route(n, o) {
@@ -1891,7 +1957,7 @@ export default {
                 this.loadData();
             }
         },
-        'queryParam.projectId'(n, o) {
+        'queryParam.productId'(n, o) {
             if (n !== '') {
                 this.getList(n);
             }
@@ -1933,6 +1999,141 @@ export default {
     },
     methods: {
         ...mapGetters(['nickname', 'avatar', 'userInfo']),
+        handleSubmit() {
+            this.searchQuery();
+            this.checkArr = [];
+        },
+        handleMoreTagsShow(val, type) {
+            if (type === 'more') {
+                this.defaultFormList.forEach(item => {
+                    if (item.id === val) {
+                        item.tabStatus = 'all';
+                    }
+                });
+            }
+            else if (type === 'little') {
+                this.defaultFormList.forEach(item => {
+                    if (item.id === val) {
+                        item.tabStatus = 'alone';
+                    }
+                });
+            }
+        },
+        handleGetCreativeWord() {
+            getAction('/ctop/ByteDanceCreativeWordPackage/list').then(result => {
+                if (result.code === 0) {
+                    this.adNameTags = result.result.records;
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
+        validatePass(rule, value, callback) {
+            this.$nextTick(() => {
+                let finallyLenList = this.handleJudgeExec(value);
+                console.log(finallyLenList, 'finallyLenList---finallyLenList--finallyLenList');
+                let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
+                console.log(updateFinallyResult, '000000000000');
+                let resultSelectSize = 0;
+                if (finallyLenList.length) {
+                    const inputDefaultLen = value.length;
+                    let tagsLen = finallyLenList.length * 4;
+                    let tagsSureLen = 0;
+                    this.adNameTags.forEach(item => {
+                        finallyLenList.forEach(val => {
+                            if (item.name === val) {
+                                tagsSureLen += item.maxWordLen;
+                            }
+                        });
+                    });
+                    finallyLenList.forEach(item => {
+                        tagsLen += item.length;
+                    });
+                    resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                }
+                else {
+                    resultSelectSize = value.length;
+                }
+                if (resultSelectSize === 0) {
+                    callback(new Error('请输入'));
+                }
+                else if (resultSelectSize > 30 || resultSelectSize < 5) {
+                    callback(new Error('创意标题5-30个字'));
+                }
+                else if (updateFinallyResult.length > 2) {
+                    callback(new Error('最多选择两个词包'));
+                }
+                else {
+                    callback();
+                }
+            });
+        },
+        handleJudgeExec(item) {
+            let re = /\{\{(.+?)\}\}/g;
+            let array = [];
+            let temp;
+            while ((temp = re.exec(item))) {
+                array.push(temp[1]);
+            };
+            return array;
+        },
+        // 点击获取光标位置进行字段插入
+        handleGetChangeAll(item, field, formId) {
+            let node = document.getElementById(field);
+            let startPos = node.selectionStart; // input 第0个字符到选中的字符
+            let endPos = node.selectionEnd; // 选中的字符到最后的字符
+            let txt = node.value;
+            this.$nextTick(() => {
+                let finallyLenList = this.handleJudgeExec(txt);
+                let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
+                if (updateFinallyResult.length >= 2) {
+                    this.$message.error('最多选择两个词包');
+                    return;
+                }
+                if (startPos === 0 || endPos === 0) {
+                    txt += '{{' + item + '}}';
+                    this.examinForm.setFieldsValue({[field]: txt});
+                }
+                else {
+                    this.examinForm.setFieldsValue({[field]: txt.substring(0, startPos) + '{{' + item + '}}' + txt.substring(endPos)});
+                    node.selectionStart = startPos + item.length + 6;
+                    node.selectionEnd = startPos + item.length + 6;
+                }
+                node.focus();
+                node.blur();
+            });
+            this.$nextTick(() => {
+                const dynamicWordPackIds = [];
+                let changeData = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
+                let updateChangeData = this.adNameTags.filter(item => changeData.includes(item.name)).map(val => val.name);
+                const inputDefaultLen = this.examinForm.getFieldsValue()[field].length;
+                let tagsLen = updateChangeData.length * 4;
+                let tagsSureLen = 0;
+                let resultSelectSize = 0;
+                this.adNameTags.forEach(item => {
+                    updateChangeData.forEach(val => {
+                        if (item.name === val) {
+                            tagsSureLen += item.maxWordLen;
+                            dynamicWordPackIds.push(item.creativeWordId);
+                        }
+                    });
+                });
+                updateChangeData.forEach(item => {
+                    tagsLen += item.length;
+                });
+                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                this.defaultFormList.forEach(item => {
+                    if (item.id === formId) {
+                        item.lenSize = resultSelectSize;
+                        item.value = this.examinForm.getFieldsValue()[field];
+                        item.wordPackId = dynamicWordPackIds;
+                    }
+                });
+            });
+        },
         handleMaterTitleClick() {
             this.materTitltStatus = !this.materTitltStatus;
             if (this.materTitltStatus) {
@@ -1967,7 +2168,11 @@ export default {
                 this.defaultFormList.push({
                     id: randomNum,
                     name: 'username' + randomNum,
-                    value: ''
+                    value: '',
+                    lenSize: 0,
+                    tabStatus: 'alone',
+                    defaultTagsList: this.adNameTags,
+                    updateTagsList: this.adNameTags.slice(0, 4)
                 });
             }
         },
@@ -1979,7 +2184,7 @@ export default {
             let changeSlogan = this.defaultFormList;
             changeSlogan.forEach(item => {
                 item.title = item.value;
-                item.creative_word_ids = [];
+                item.creative_word_ids = item.wordPackId;
             });
             let params = {
                 ids: this.modalShowBatchList.map(item => item.id) || [],
@@ -2003,7 +2208,6 @@ export default {
             });
         },
         handleBatchCancel() {
-            console.log('批量取消按钮');
             this.batchVisible = false;
         },
         handleFodderWind() {
@@ -2051,7 +2255,6 @@ export default {
                     this.showUrlWater = res.result.watermarkUrl;
                     this.name = res.result.watermarkCode;
                     this.materialName = res.result.materialName;
-                    // 0317淘特除螨仪.mp4     0317幸福里 没钱 高清版.mp4    0316幸福里来北京五年 高清  大妈和美女2高清.mp4  WIFIAQZS2004JYL.mp4
                     res.result.slogans.forEach(item => {
                         item.name = 'username' + item.id;
                     });
@@ -2111,10 +2314,10 @@ export default {
                 this.solganForm.setFieldsValue({[data.name]: data.slogan});
             });
         },
-        handleFormInputChang(e, data) {
+        handleFormInputChang(e, field, formId) {
             const changeFiled = [];
             this.defaultFormList.forEach(item => {
-                if (item.id === data.id) {
+                if (item.id === formId) {
                     item.value = e.target.value;
                 }
             });
@@ -2123,7 +2326,34 @@ export default {
                     changeFiled.push(item.value);
                 }
             });
-            this.titleFiledResult = changeFiled;
+            this.$nextTick(() => {
+                const dynamicWordPackIds = [];
+                let finallyLenList = this.handleJudgeExec(this.examinForm.getFieldsValue()[field]);
+                let updateFinallyResult = this.adNameTags.filter(item => finallyLenList.includes(item.name)).map(val => val.name);
+                const inputDefaultLen = this.defaultFormList.filter(item => item.id === formId)[0].value.length;
+                let tagsLen = updateFinallyResult.length * 4;
+                let tagsSureLen = 0;
+                let resultSelectSize = 0;
+                this.adNameTags.forEach(item => {
+                    updateFinallyResult.forEach(val => {
+                        if (item.name === val) {
+                            tagsSureLen += item.maxWordLen;
+                            dynamicWordPackIds.push(item.creativeWordId);
+                        }
+                    });
+                });
+                updateFinallyResult.forEach(item => {
+                    tagsLen += item.length;
+                });
+                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                this.defaultFormList.forEach(item => {
+                    if (item.id === formId) {
+                        item.lenSize = resultSelectSize;
+                        item.wordPackId = dynamicWordPackIds;
+                    }
+                });
+                this.titleFiledResult = changeFiled;
+            });
         },
         handleCheckBoxChang(data) {
             this.applyTypeOption = data;
@@ -2181,7 +2411,10 @@ export default {
                 this.defaultFormList.push({
                     id: dateTime,
                     name: name,
-                    value: item
+                    value: item,
+                    tabStatus: 'alone',
+                    defaultTagsList: this.adNameTags,
+                    updateTagsList: this.adNameTags.slice(0, 4)
                 });
             });
             this.titleResult = [];
@@ -2204,7 +2437,11 @@ export default {
             this.defaultFormList.push({
                 id: randomNum,
                 name: 'username' + randomNum,
-                value: ''
+                value: '',
+                lenSize: 0,
+                tabStatus: 'alone',
+                defaultTagsList: this.adNameTags,
+                updateTagsList: this.adNameTags.slice(0, 4)
             });
         },
         handleDelOrigin(list) {
@@ -2219,15 +2456,40 @@ export default {
                 if (res.success) {
                     if (res.result.slogans.length) {
                         res.result.slogans.forEach(item => {
+                            let finallyLenList = this.handleJudgeExec(item.slogan);
+                            let resultSelectSize = 0;
+                            if (finallyLenList.length) {
+                                const inputDefaultLen = item.slogan.length;
+                                let tagsLen = finallyLenList.length * 4;
+                                let tagsSureLen = 0;
+                                this.adNameTags.forEach(item => {
+                                    finallyLenList.forEach(val => {
+                                        if (item.name === val) {
+                                            tagsSureLen += item.maxWordLen;
+                                        }
+                                    });
+                                });
+                                finallyLenList.forEach(item => {
+                                    tagsLen += item.length;
+                                });
+                                resultSelectSize = inputDefaultLen - tagsLen + tagsSureLen;
+                            }
+                            else {
+                                resultSelectSize = item.slogan.length;
+                            }
                             item.name = 'username' + item.id;
                             item.value = item.slogan;
+                            item.lenSize = resultSelectSize;
+                            item.tabStatus = 'alone';
+                            item.defaultTagsList = this.adNameTags;
+                            item.updateTagsList = this.adNameTags.slice(0, 4);
                         });
                         this.defaultFormList = res.result.slogans;
-                        this.$nextTick(() => {
-                            this.defaultFormList.forEach(item => {
-                                this.defaultFormList.setFieldsValue({[item.name]: item.slogan});
-                            });
-                        });
+                        // this.$nextTick(() => {
+                        //     this.defaultFormList.forEach(item => {
+                        //         this.defaultFormList.setFieldsValue({[item.name]: item.slogan});
+                        //     });
+                        // });
                     }
                     else {
                         for (let i = 0; i < 3; i++) {
@@ -2235,7 +2497,11 @@ export default {
                             this.defaultFormList.push({
                                 id: randomNum,
                                 name: 'username' + randomNum,
-                                value: ''
+                                value: '',
+                                lenSize: 0,
+                                tabStatus: 'alone',
+                                defaultTagsList: this.adNameTags,
+                                updateTagsList: this.adNameTags.slice(0, 4)
                             });
                         }
                     }
@@ -2249,6 +2515,7 @@ export default {
             this.causeVisible = true;
             this.recommendVisible = false;
             this.titleResult = [];
+            this.checkArr = [];
         },
         handleCauseCancel() {
             this.causeVisible = false;
@@ -2262,7 +2529,7 @@ export default {
             let changeSlogan = this.defaultFormList;
             changeSlogan.forEach(item => {
                 item.title = item.value;
-                item.creative_word_ids = [];
+                item.creative_word_ids = item.wordPackId;
             });
             let params = {
                 id: this.currentPageOnlyList.id,
@@ -2500,23 +2767,29 @@ export default {
             return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
         },
         moment,
-        tongbu() {
-            getAction('/ctop/project/queryById', {id: this.queryParam.projectId}).then(res => {
-                if (res.success) {
-                    if (res.result.mediaId === '1' || res.result.mediaId === '3') {
-                        this.$refs.check.getData('/ctop/userAllocation/getAccountListByProjectId', {
-                            userId: this.userInfo().id,
-                            projectId: this.queryParam.projectId
-                        });
-                    }
-                    else if (res.result.mediaId === '2' || res.result.mediaId === '4') {
-                        this.$refs.accountCheckBytedance.getParticipateList(this.queryParam.projectId);
-                    }
-                }
-                else {
-                    this.$message.error('网络波动,请稍后再试');
-                }
-            });
+        tongbu(value) {
+            // getAction('/ctop/project/queryById', {id: this.queryParam.projectId}).then(res => {
+            //     if (res.success) {
+            //         if (res.result.mediaId === '1' || res.result.mediaId === '3') {
+            //             this.$refs.check.getData('/ctop/userAllocation/getAccountListByProjectId', {
+            //                 userId: this.userInfo().id,
+            //                 projectId: this.queryParam.projectId
+            //             });
+            //         }
+            //         else if (res.result.mediaId === '2' || res.result.mediaId === '4') {
+            //             this.$refs.accountCheckBytedance.getParticipateList(this.queryParam.projectId);
+            //         }
+            //     }
+            //     else {
+            //         this.$message.error('网络波动,请稍后再试');
+            //     }
+            // });
+            this.mediaId = value
+            this.$refs.check.getData('/ctop/userAllocation/getAccountListByUserIdAndProductId', {
+                userId: this.userInfo().id,
+                productId: this.queryParam.productId,
+                mediaId: value,
+            })
         },
         implement(data) {
             let params = {};
@@ -2599,22 +2872,26 @@ export default {
             this.queryParam = {
                 type: 'VIDEO',
                 userId: this.userInfo().id,
-                status: this.active
-            };
+                status: this.active,
+                productId: ''
+            }
+            this.$refs.selectTable.keyValue = "";
+            this.$refs.selectTable.getData()
             this.labelValue = [];
             this.loadData(1);
+            this.checkArr = [];
         },
         getList(value) {
-            if (value) {
-                getAction('/ctop/projectMember/participateListV2', {
-                    userId: this.userInfo().id,
-                    projectId: value
-                }).then(res => {
-                    if (res.code === 0) {
-                        this.mediaId = res.result.records[0].mediaId;
-                    };
-                });
-            }
+            // if (value) {
+            //     getAction('/ctop/projectMember/participateListV2', {
+            //         userId: this.userInfo().id,
+            //         projectId: value
+            //     }).then(res => {
+            //         if (res.code === 0) {
+            //             this.mediaId = res.result.records[0].mediaId;
+            //         };
+            //     });
+            // }
             this.loadData();
         },
         onChangeCheckImage(checkedList) {
@@ -2623,8 +2900,6 @@ export default {
             }
         },
         onChangeCheck(checkedList, data) {
-            console.log(data, 'data--data');
-            console.log(checkedList, this.checkArr, this.dataSource, '-------');
             if (data.value === '0') {
                 this.showTabsTitle = '0';
             }
@@ -2835,7 +3110,8 @@ export default {
                         this.visibleDetail = false;
                         closeAllVideoFun();
                     });
-                } else {
+                }
+                else {
                     fileEdit({
                         id: this.id,
                         status: editStatus,
@@ -3111,7 +3387,7 @@ export default {
                     type: 'VIDEO',
                     userId: this.userInfo().id,
                     status: key,
-                    projectId: this.queryParam.projectId
+                    productId: this.queryParam.productId
                 }
                 if (this.labelValue.length >= 1) {
                     this.queryParam.tagCode = this.labelValue[this.labelValue.length - 1];
@@ -3119,7 +3395,7 @@ export default {
                 else {
                     this.queryParam.tagCode = '';
                 }
-                if (this.form.getFieldValue('projectId')) {
+                if (this.form.getFieldValue('productId')) {
                     this.form.setFieldsValue({
                         projectId: ''
                     });

+ 1 - 0
src/views/modules/crowd-control/components/tree-select/tree-select.vue

@@ -143,6 +143,7 @@ export default {
             }
             defaultCheckKey.splice(value, 1);
             this.checkedKeys = defaultCheckKey;
+            this.$emit('applyType', this.applyTypeOption);
         },
         onChange(e) {
             const value = e.target.value;

+ 33 - 3
src/views/modules/crowd-control/crowd-control.vue

@@ -25,9 +25,12 @@
                         <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                             <a-button type="primary" icon="search" @click="handleQueryList">查询</a-button>
                             <a-button type="primary" @click="handleResetForm" icon="reload" class="middle-button">重置</a-button>
-                             <a-button type="primary" @click="handleUploadPerson">
+                             <a-button type="primary" @click="handleUploadPerson" class="middle-button">
                                 上传人群包
                             </a-button>
+                             <!-- <a-button type="primary" @click="handleUpdatePerson" v-if="realShow" :loading="realLoading">
+                                更新人群
+                            </a-button> -->
                            
                         </span>
                         
@@ -243,7 +246,7 @@ import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
 import selectTable from '@/views/modules/Statistics/components/selectPagination.vue';
 import AppMarketService from './crowd-control-service';
 import BMF from 'browser-md5-file';
-
+import { mapGetters } from 'vuex';
 let COS = require('cos-js-sdk-v5');
 let cos = new COS({
     SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
@@ -394,6 +397,8 @@ export default {
                     this.handleAcountRelax(this.relaxStatus  ,this.acountRelaxDetail)
                 }
             },
+            realShow: false,
+            realLoading: false
         };
     },
     watch: {
@@ -407,9 +412,18 @@ export default {
         this.form = this.$form.createForm(this);
     },
     mounted() {
+        // this.realShow = this.userInfo().realname === '管理员' ? true : false
+        // if(!this.realShow) {
+        //     getAction('/kuaishou/batch/syncUserPopulationList',{ userId:this.userInfo().id, type:1}).then(res => {
+        //         if(res.success) {
+
+        //         }
+        //     })
+        // }
         this.handleGetTableList({});
     },
     methods: {
+        ...mapGetters(['nickname', 'avatar', 'userInfo']),
         handleAgian(val) {
             let params = {};
             params.id = val.id;
@@ -497,7 +511,7 @@ export default {
             let that = this;
             this.$confirm({
                 title: '删除提示',
-                content: '确定要删除这一条吗?',
+                content: '是否删除该人群包?',
                 onOk() {
                     getAction('/kuaishouPopulationPackage/delete', {id: data.id}).then(result => {
                         if (result.code === 200) {
@@ -726,6 +740,22 @@ export default {
         handleUploadPerson() {
             this.personVisible = true;
         },
+        handleUpdatePerson() {
+            if(this.realShow) {
+                this.realLoading = true;
+                getAction('/kuaishou/batch/syncUserPopulationList',{ userId:this.userInfo().id, type:0}).then(res => {
+                    if(res.success) {
+                        this.realLoading = false;
+                        this.$message.success('更新成功');
+                        this.handleResetForm();
+                    }
+                    else {
+                        this.realLoading = false;
+                        this.$message.error('更新失败');
+                    }
+                })
+            }
+        },
         handleOk() {
             this.$refs.ruleForm.validate(valid => {
                 if (valid) {

+ 2 - 2
src/views/modules/headline-view/headline-view-server.js

@@ -3,8 +3,8 @@
  * @author jiayufei
  */
 
-export const urlAcount = 'http://118.24.244.213:8080'; // 线上
+// export const urlAcount = 'http://118.24.244.213:8080'; // 线上
 // export const urlAcount = 'http://apipre.tjyourong.com.cn'; // 预生产
-// export const urlAcount = 'http://192.168.1.43:8080'; // 子安
+export const urlAcount = 'http://192.168.1.43:8080'; // 子安
 // export const urlAcount = 'http://139.186.165.84:8080'; // 测试
 // export const urlAcount = 'http://192.168.1.8:8080'; // 学超

+ 266 - 182
src/views/modules/headline-view/headline-view.vue

@@ -12,29 +12,35 @@
                                 :allowClear="false"
                                 format="YYYY-MM-DD"
                                 :disabled-date="disabledDate"
-                                @change="onChange"
+                                @change="handleCostTimeChange" 
                             />
                         </div>
                         <div class="costInfo">
                             <div class="yesterdayInfo">
-                                <div style="margin-bottom:8px">上阶段花费</div>
-                                <div style="font-size:14px;font-weight:600">{{ yearCostReportList.lastCost || 0 }}</div>
+                                <div style="margin-bottom:8px">昨日花费</div>
+                                <div style="font-size:14px;font-weight:600">{{ Number(yearCostReportList.lastCost) | decimalsHandle }}</div>
                             </div>
                             <a-divider type="vertical"/>
                             <div class="tongbi">
-                                <div style="margin-bottom:8px">
-                                    
+                                <div style="margin-bottom:8px;margin-left: 10px;">
+                                    
                                     <a-tooltip >
                                         <template slot="title">
-                                            <span>截止此时与上一阶段的花费同比</span>
+                                            <span>截止此时今日与昨日的花费同比</span>
                                         </template>
-                                        <a-icon type="question-circle" />
+                                        <a-icon type="question-circle"/>
                                     </a-tooltip>
                                 </div>
-                                <div style="font-size:14px;font-weight:600">{{ yearCostReportList.compare || 0 }}</div>
+                                <div style="font-size:14px;font-weight:600;text-align: end;">
+                                    <span class="sign">
+                                        <a-icon v-if="Number(yearCostReportList.compare) >= 0" type="rise" class="rise"/>
+                                        <a-icon v-if="Number(yearCostReportList.compare) < 0" type="fall" class="fall"/>
+                                    </span>
+                                    {{ yearCostReportList.compare ? yearCostReportList.compare + '%' : '-' }}
+                                </div>
                             </div>
                         </div>
-                        <div class="costNum">{{ yearCostReportList.nowCost || 0 }}</div>
+                        <div class="costNum">{{ Number(yearCostReportList.nowCost) | decimalsHandle }}</div>
                     </div>
                     <div class="accountBodyLeftCostRight">
                         <div
@@ -45,33 +51,36 @@
                         >
                             <a-empty/>
                         </div>
+                        <span class="cost-radio-tool">
+                            花费占比
+                            <a-tooltip>
+                                <template slot="title">
+                                    <span>花费占比指花费占账户预算的比例</span>
+                                </template>
+                                <a-icon type="question-circle"/>
+                            </a-tooltip>
+                        </span>
                     </div>
                 </div>
                 <div class="accountBodyLeftOther">
                     <div class="top">                       
                         <div class="item" v-for="item in throwColumns" :key="item.dataIndex">
                             <div class="todyCost">
-                                <span v-if="item.type === 'double'">{{ item.today }}</span>
-                                <span v-else-if="item.type === 'string'">{{ item.today }}</span>
-                                <span v-else-if="item.type === 'int'">{{ item.today }}</span>
+                                <span v-if="item.type === 'spend'">{{ Number(item.today) | decimalsHandle }}</span>
+                                <span v-else-if="item.type === 'double'">{{ Number(item.today) | decimalsHandle }}</span>
+                                <span v-else-if="item.type === 'string'">{{ Number(item.today) | decimalsHandle }}</span>
+                                <span v-else-if="item.type === 'int'">{{ item.today !== 0 ? item.today + '%' : 0 }}</span>
                                 <span class="sign">
                                     <a-icon type="rise" class="rise" v-show="item.today - item.yesterday > 0"/>
                                     <a-icon type="fall" class="fall" v-show="item.today - item.yesterday < 0" />
                                 </span>
                             </div>
                             <div class="yesterdayCost">
-                                <a-tooltip >
-                                    <template slot="title">
-                                    <span>
-                                        <!-- {{dateValue[0].format('YYYY-MM-DD') === dateValue[1].format('YYYY-MM-DD') ? moment(dateValue[0]).subtract(1,'days').format('YYYY-MM-DD') : dateStringShow}}
-                                        的{{item.title}} -->
-                                    </span>
-                                    </template>
-                                    <a-icon type="question-circle" />
-                                </a-tooltip>:
-                                <span v-if="item.type === 'double'">{{ item.yesterday }}</span>
-                                <span v-else-if="item.type === 'string'">{{ item.yesterday }}</span>
-                                <span v-else-if="item.type === 'int'">{{ item.yesterday }}</span>
+                                <span>/ 昨日: </span>
+                                <span v-if="item.type === 'spend'">{{ Number(item.yesterday) | decimalsHandle }}</span>
+                                <span v-else-if="item.type === 'double'">{{ Number(item.yesterday) | decimalsHandle }}</span>
+                                <span v-else-if="item.type === 'string'">{{ Number(item.yesterday) | decimalsHandle }}</span>
+                                <span v-else-if="item.type === 'int'">{{ item.yesterday !== 0 ? item.yesterday + '%' : 0 }}</span>
                             </div>
                             <span
                                 class="IndexName"
@@ -90,6 +99,9 @@
                         </div>
                     </div>
                     <div class="echart" style="margin-top:20px;position:relative">
+                        <div style="position:absolute;right:5px;top:-15px">
+                            更新时间:{{ yearCostReportList.updTime || '-' }}
+                        </div>
                         <a-spin :spinning="accountIndexEchartSpinning">
                             <div
                                 class="accountIndexEchart"
@@ -118,17 +130,12 @@
                 <div class="accountBodyRightInfo">
                     <div class="accountBodyRightInfoItem">
                         <span class="name">余额:</span>
-                        <span>{{ topAccountMsg.accountMap && topAccountMsg.accountMap.validBalance }}</span>
+                        <span>{{ topAccountMsg.accountMap && Number(topAccountMsg.accountMap.validBalance) | decimalsHandle }}</span>
                     </div>
                     <div class="accountBodyRightInfoItem">
                         <span class="name">投放状态:</span>
                         <span>{{ topAccountMsg.accountMap && topAccountMsg.accountMap.accountStatus === 0 ? '投放中' : '未投放' }}</span>
                     </div>
-                    <div class="accountBodyRightInfoItem createNum" @click="gorejectCreativePage">
-                        <span class="name">被拒创意数:</span>
-                        <span>0</span>
-                        <a-icon type="right" style="font-size:12px;position:absolute;right:10px;top:16px"/>
-                    </div>
                 </div>
             </div>
         </div>
@@ -137,6 +144,7 @@
                 <div class="title">
                     <div class="titleContext">
                         投放数据
+                        <span class="titleTip">更新时间:{{ planData.length ? planData[0].updateTime : '-' }}</span>
                     </div>
                     <div style="float: right;margin-top: -23px;">
                         <a-range-picker 
@@ -153,7 +161,7 @@
                         :columns="planColumns"
                         :data-source="planData"
                         :pagination="false"
-                        @change="handlePlaneSort"
+                        :scroll="{x: 1500}"
                     >
                     <span slot="optStatus" slot-scope="text, record">
                         <a-switch :checked="text === 'AD_STATUS_ENABLE'" @change="handleSwitchChang($event, record)"/>
@@ -196,14 +204,16 @@
                     />
                 </div>
             </div>
-            <div class="titleContext source-material"> 素材相关</div>
+            <div class="titleContext source-material">
+                素材相关
+                <span class="titleTip">更新时间:{{ materialData.length ? materialData[0].updateTime : '-' }}</span></div>
             <div class="materialBodyRight">
                 <div class="material-table-class">
                     <a-table
                         :columns="materialColumns"
                         :data-source="materialData"
                         :pagination="false"
-                        @change="materialChange"
+                        :scroll="{x: 1500}"
                     >
                         <span slot="posterUrl" slot-scope="text,record">
                             <div style="background:#e8e8e8;text-align:center;border-radius:3px">
@@ -212,15 +222,15 @@
                                         <video :src="record.videoUrl" style="width:250px" controls></video>
                                     </template>
                                     <img v-if="text" :src="text" style="width:20px">
-                                    <img v-if="!text" src="@/assets/feishu.png" style="width:20px">
+                                    <img v-if="!text" src="@/assets/noImg.png" style="width:20px">
                                 </a-popover>
                             </div>
                         </span>
                     </a-table>
                     <a-pagination
-                        class="pagin-table-class"
                         :total="materTotalAll"
                         :show-total="total => `共 ${materTotalAll} 条`"
+                        class="pagin-table-class"
                         size="small"
                         show-size-changer
                         show-quick-jumper
@@ -233,13 +243,19 @@
         <!-- 修改定向的modal -->
         <a-modal
             v-model="targetVisible"
-            title="修改定向"
+            title="修改定向"
             @ok="handleTargethandleOk"
             @cancel="handleTargethandleCancel"
         >
             <div class="linkBody">
                 <a-row>
                     <a-col :span="6">
+                        <div style="text-align:right">已优先定向:</div>
+                    </a-col>
+                    <a-col :span="16">{{ packageName }}</a-col>
+                </a-row>
+                <a-row style="margin-top: 20px;">
+                    <a-col :span="6">
                         <div style="text-align:right">修改定向包:</div>
                     </a-col>
                     <a-col :span="16">
@@ -282,8 +298,8 @@
             </div>
         </a-modal>
         <a-modal
-            title="修改调价"
             v-if="budgetVisible"
+            title="修改出价"
             :visible="budgetVisible"
             dialog-class="mode-modal-class"
             @ok="handleBudgetSure"
@@ -297,10 +313,8 @@
                     :label-col="labelCol"
                     :wrapper-col="wrapperCol"
                 >
-                    <a-form-model-item label="调价" prop="budget">
-                        <a-input-number
-                            v-model="budgetForm.budget"
-                        /> 元
+                    <a-form-model-item label="出价" prop="budget">
+                        <a-input-number v-model="budgetForm.budget"/> 元
                     </a-form-model-item>
                 </a-form-model>
             </div>
@@ -353,6 +367,14 @@ export default {
             accountVisible: false,
             throwColumns: [
                 {
+                    title: '花费',
+                    dataIndex: 'spendCost',
+                    key: 'spendCost',
+                    today: 0,
+                    yesterday: 0,
+                    type: 'spend'
+                },
+                {
                     title: '转化成本',
                     dataIndex: 'activationCost',
                     key: 'activationCost',
@@ -366,7 +388,7 @@ export default {
                     key: 'activation',
                     today: 0,
                     yesterday: 0,
-                    type: 'int'
+                    type: 'string'
                 },
                 {
                     title: '转化率',
@@ -388,9 +410,9 @@ export default {
             newLink: '',
             linkVisible: false,
             targetVisible: false,
-            isActive: 'activationCost',
+            isActive: 'spendCost',
             moment,
-            materialDate: [],
+            materialDate: [moment().subtract(1,'days').format('YYYY-MM-DD'), moment().subtract(1,'days').format('YYYY-MM-DD')],
             dateValue: [],
             planData: [],
             planPagin: {
@@ -403,80 +425,101 @@ export default {
                     dataIndex: 'adName',
                     key: 'adName',
                     align: 'center',
-                    width: 120,
-                    ellipsis: true
+                    width: 240
                 },
                 {
                     title: '花费',
                     dataIndex: 'cost',
                     key: 'cost',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.cost - b.cost
                 },
                 {
                     title: '出价',
-                    dataIndex: 'bid',
-                    key: 'bid',
-                    align: 'center'
+                    dataIndex: 'cpaBid',
+                    key: 'cpaBid',
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.cpaBid - b.cpaBid
                 },
                 {
                     title: '展示数',
                     dataIndex: 'showNum',
                     key: 'showNum',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.showNum - b.showNum
                 },
                 {
                     title: '平均千次展现费用',
                     dataIndex: 'averageShow',
                     key: 'averageShow',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.averageShow - b.averageShow
                 },
                 {
                     title: '点击数',
                     dataIndex: 'click',
                     key: 'click',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.click - b.click
                 },
                 {
                     title: '平均点击单价',
                     dataIndex: 'averageClick',
                     key: 'averageClick',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.averageClick - b.averageClick
                 },
                 {
                     title: '点击率',
                     dataIndex: 'clickRate',
                     key: 'clickRate',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.clickRate.split('%')[0] - b.clickRate.split('%')[0]
                 },
                 {
                     title: '转化数',
                     dataIndex: 'convertNum',
                     key: 'convertNum',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.convertNum - b.convertNum
                 },
                 {
                     title: '转化率',
                     dataIndex: 'converRate',
                     key: 'converRate',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.converRate.split('%')[0] - b.converRate.split('%')[0]
                 },
                 {
                     title: '转化成本',
                     dataIndex: 'conver',
                     key: 'conver',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.conver - b.conver
                 },
                 {
-                    title: '比',
+                    title: '比',
                     dataIndex: 'compare',
                     key: 'compare',
-                    align: 'center'
+                    align: 'center',
+                    width: 180
                 },
                 {
                     title: '状态',
                     dataIndex: 'optStatus',
                     key: 'optStatus',
                     align: 'center',
+                    width: 180,
                     scopedSlots: {customRender: 'optStatus'}
                 },
                 {
@@ -484,6 +527,8 @@ export default {
                     dataIndex: 'operator',
                     key: 'operator',
                     align: 'center',
+                    fixed: 'right',
+                    width: 200,
                     scopedSlots: {customRender: 'operator'}
                 }
             ],
@@ -505,66 +550,84 @@ export default {
                     title: '素材ID',
                     dataIndex: 'materialId',
                     key: 'materialId',
+                    width: 180,
                     align: 'center'
                 },
                 {
                     title: '花费',
                     dataIndex: 'cost',
                     align: 'center',
-                    sorter: () => {}
+                    width: 180,
+                    sorter: (a, b) => a.cost - b.cost
                 },
                 {
                     title: '展示数',
                     dataIndex: 'showMaterial',
                     key: 'showMaterial',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.showMaterial - b.showMaterial
                 },
                 {
                     title: '平均千次展现费用',
                     dataIndex: 'costPerThousandShow',
                     key: 'costPerThousandShow',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.costPerThousandShow - b.costPerThousandShow
                 },
                 {
                     title: '点击数',
                     dataIndex: 'click',
                     key: 'click',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.click - b.click
                 },
                 {
-                    title: '平均店家单价',
+                    title: '平均点击单价',
                     dataIndex: 'costPerClick',
                     key: 'costPerClick',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.costPerClick - b.costPerClick
                 },
                 {
                     title: '点击率',
                     dataIndex: 'clickRate',
                     key: 'clickRate',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.clickRate.split('%')[0] - b.clickRate.split('%')[0]
                 },
                 {
                     title: '转化数',
                     dataIndex: 'convertMaterial',
                     key: 'convertMaterial',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.convertMaterial - b.convertMaterial
                 },
                 {
                     title: '转化率',
                     dataIndex: 'convertRate',
                     key: 'convertRate',
-                    align: 'center'
+                    align: 'center',
+                    width: 180,
+                    sorter: (a, b) => a.convertRate.split('%')[0] - b.convertRate.split('%')[0]
                 },
                 {
                     title: '转化成本',
                     dataIndex: 'costConvert',
                     key: 'costConvert',
+                    width: 180,
                     align: 'center'
                 },
                 {
                     title: '关联创意数',
                     dataIndex: 'count',
                     key: 'count',
+                    width: 180,
                     align: 'center'
                 },
                 {
@@ -572,8 +635,8 @@ export default {
                     dataIndex: 'materialUploadTime',
                     key: 'photoShow',
                     align: 'center',
-                    scopedSlots: {customRender: 'photoShow'},
-                    sorter: () => {}
+                    width: 180,
+                    scopedSlots: {customRender: 'photoShow'}
                 }
             ],
             materialData: [],
@@ -589,7 +652,8 @@ export default {
             topCostList: {},
             yearCostReportList: {}, // 环比数据
             selectiveList: [],
-            currentUnit: {}
+            currentUnit: {},
+            packageName: ''
         };
     },
     mounted() {
@@ -599,10 +663,7 @@ export default {
         ...mapGetters(['userInfo']),
         // 获取所有的定向包的列表
         handleGetAdAudiencePackage(account) {
-            const params = {
-                accountId: account
-            };
-            getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', params)
+            getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', {accountId: account})
                 .then(result => {
                     if (result.code === 0) {
                         this.selectiveList = result.result || [];
@@ -637,7 +698,24 @@ export default {
                 console.log(error, 'eeee');
             });
         },
+        handleGetADAudiencePackageId(actId, id) {
+            const paramsData = {
+                accountId: actId,
+                adId: id
+            };
+            getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/getADAudiencePackageId', paramsData).then(result => {
+                if (result.code === 0) {
+                    this.packageName = result.result.packageId ? this.selectiveList.filter(item => item.audience_package_id === Number(result.result.packageId))[0].name : '暂无';
+                }
+                else {
+                    this.$message.error(result.message);
+                }
+            }).catch(error => {
+                console.log(error, 'eeee');
+            });
+        },
         handleUpdateDirectional(record) {
+            this.handleGetADAudiencePackageId(this.topAccountMsg.accountMap.accountId, record.adId);
             this.currentUnit = record;
             this.targetVisible = true;
         },
@@ -690,8 +768,10 @@ export default {
             };
             getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/getReportPlanCost', paramsData).then(result => {
                 if (result.code === 0) {
-                    console.log(result.result, '计划列表数据');
-                    this.planData = result.result.list;
+                    this.planData = result.result.list.map(item => {
+                        item.converRate = item.converRate + '%';
+                        return item;
+                    });
                     this.planTotalAll = result.result.total;
                 }
                 else {
@@ -712,15 +792,17 @@ export default {
                 if (result.code === 0) {
                     this.yearCostReportList = result.result;
                     this.initEchart('gaugeEchart', this.initGaugechart(result.result.costShare));
-                    this.initEchart('accountIndexEchart', this.initAccountIndexEchart(result.result, 'activationCost'));
-                    this.throwColumns[0].today = Number(result.result.nowMap.conver);
-                    this.throwColumns[0].yesterday = Number(result.result.lastMap.conver);
-                    this.throwColumns[1].today = Number(result.result.nowMap.converNum);
-                    this.throwColumns[1].yesterday = Number(result.result.lastMap.converNum);
-                    this.throwColumns[2].today = Number(result.result.nowMap.converRate);
-                    this.throwColumns[2].yesterday = Number(result.result.lastMap.converRate);
-                    this.throwColumns[3].today = Number(result.result.nowMap.averageShow);
-                    this.throwColumns[3].yesterday = Number(result.result.lastMap.averageShow);
+                    this.initEchart('accountIndexEchart', this.initAccountIndexEchart(result.result, 'spendCost'));
+                    this.throwColumns[0].today = Number(result.result.nowCost);
+                    this.throwColumns[0].yesterday = Number(result.result.lastCost);
+                    this.throwColumns[1].today = Number(result.result.nowMap.conver);
+                    this.throwColumns[1].yesterday = Number(result.result.lastMap.conver);
+                    this.throwColumns[2].today = Number(result.result.nowMap.converNum);
+                    this.throwColumns[2].yesterday = Number(result.result.lastMap.converNum);
+                    this.throwColumns[3].today = Number(result.result.nowMap.converRate);
+                    this.throwColumns[3].yesterday = Number(result.result.lastMap.converRate);
+                    this.throwColumns[4].today = Number(result.result.nowMap.averageShow);
+                    this.throwColumns[4].yesterday = Number(result.result.lastMap.averageShow);
                 }
                 else {
                     this.$message.error(result.message);
@@ -741,7 +823,6 @@ export default {
                     const defaultTime = [result.result.startTime, result.result.endTime];
                     this.dateValue = [...defaultTime];
                     this.planRangePicker = [...defaultTime];
-                    this.materialDate = [...defaultTime];
                     this.handleGetAccountMessage(result.result.account.accountId);
                     this.handleYearOnYearCost(result.result);
                     this.handleGetPlanTableList(result.result);
@@ -757,10 +838,7 @@ export default {
         },
         // 获取头部最右侧数据
         handleGetAccountMessage(value) {
-            const paramsData = {
-                accountId: value
-            };
-            getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/getAccountCost', paramsData).then(result => {
+            getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/getAccountCost', {accountId: value}).then(result => {
                 if (result.code === 0) {
                     this.topAccountMsg = result.result;
                 }
@@ -775,14 +853,18 @@ export default {
         handleGetmaterialData(data) {
             const paramsData = {
                 accountId: data.account.accountId,
-                startTime: data.startTime,
-                endTime: data.endTime,
+                startTime: this.materialDate[0],
+                endTime: this.materialDate[1],
                 pageNum: this.materPagin.page,
                 pageSize: this.materPagin.size
             };
             getAction(urlAcount + '/bytedance-api/advertiser/bytedanceReportController/selectMaterialDailyReport', paramsData).then(result => {
                 if (result.code === 0) {
-                    this.materialData = result.result.list;
+                    this.materialData = result.result.list.map(item => {
+                        item.clickRate = item.clickRate + '%';
+                        item.convertRate = item.convertRate + '%';
+                        return item;
+                    });
                     this.materTotalAll = result.result.total;
                 }
                 else {
@@ -820,6 +902,7 @@ export default {
         // 修改定向的取消按钮
         handleTargethandleCancel() {
             this.adAudiencePackageId = '';
+            this.packageName = '';
             this.targetVisible = false;
         },
         handleAccounthandleOk() {
@@ -827,8 +910,8 @@ export default {
                 account: {
                     accountId: this.selectaccountId
                 },
-                startTime: this.topCostList.startTime,
-                endTime: this.topCostList.startTime
+                startTime: this.dateValue[0],
+                endTime: this.dateValue[1]
             };
             this.topCostList = paramsData;
             this.handleGetAccountMessage(this.selectaccountId);
@@ -845,6 +928,7 @@ export default {
         },
         // 计划点击分页操作
         handleOnShowSizeChange(current, pageSize) {
+            console.log(current, pageSize, 'current, pageSize');
             this.planPagin = {
                 page: current,
                 size: pageSize
@@ -868,12 +952,12 @@ export default {
                 account: {
                     accountId: this.topCostList.account.accountId
                 },
-                startTime: this.planRangePicker[0],
-                endTime: this.planRangePicker[1]
+                startTime: this.materialDate[0],
+                endTime: this.materialDate[1]
             };
             this.handleGetmaterialData(paramsData);
         },
-        // have 跳转到拒审重提-创意页面
+        // TODO 暂时功能隐藏 跳转到拒审重提-创意页面
         gorejectCreativePage() {
             this.$router.push('/Statistics/refuseDataCreatNew');
         },
@@ -896,11 +980,8 @@ export default {
             };
             this.handleGetPlanTableList(paramsData);
         },
-        onChange(date, dateString) {
-            if (dateString.length > 0 && dateString[0] !== dateString[1]) {
-                let interval = date[1].diff(date[0], 'days');
-                this.dateStringShow = `${moment(date[0]).subtract(1 + interval, 'days').format('YYYY-MM-DD')}~${moment(date[0]).subtract(1, 'days').format('YYYY-MM-DD')}`;
-            }
+        handleCostTimeChange(date, dateString) {
+            this.dateValue = dateString;
             const paramsData = {
                 account: {
                     accountId: this.topCostList.account.accountId
@@ -940,6 +1021,7 @@ export default {
         },
         // 默认echarts
         initAccountIndexEchart(data, type) {
+            const LastX = data.lastMap.costList.map(item => item.time);
             const todayX = data.nowMap.costList.map(item => item.time);
             let specialIdentification = '';
             if (todayX.length && todayX[0].indexOf('-') !== -1) {
@@ -950,7 +1032,11 @@ export default {
             }
             let tadayShowY = [];
             let yestodayShowY = [];
-            if (type === 'activationCost') {
+            if (type === 'spendCost') {
+                tadayShowY = data.nowMap.costList.map(item => item.cost);
+                yestodayShowY = data.lastMap.costList.map(item => item.cost);
+            }
+            else if (type === 'activationCost') {
                 tadayShowY = data.nowMap.costList.map(item => item.conver);
                 yestodayShowY = data.lastMap.costList.map(item => item.conver);
             }
@@ -971,6 +1057,7 @@ export default {
                     trigger: 'axis',
                     formatter: params => {
                         let isType = '';
+                        let showBai = this.isActive === 'bclick' || this.isActive === 'formCount' ? '%' : '';
                         this.throwColumns.forEach(item => {
                             if (item.dataIndex === this.isActive) {
                                 isType = item.title;
@@ -978,7 +1065,8 @@ export default {
                         });
                         let option = isType + '<br/>';
                         for (let i = 0, length = params.length; i < length; i++) {
-                            option += `<span style="width:8px;height:8px;border-radius:50%;background:${params[i].color};display:inline-block;position:relative;top:-2px;margin-right:5px"></span>` + ' ' + params[i].axisValue + specialIdentification + '  ' + params[i].data + '<br />';
+                            const showTime = specialIdentification === '时' ? params[i].seriesName : '';
+                            option += `<span style="width:8px;height:8px;border-radius:50%;background:${params[i].color};display:inline-block;position:relative;top:-2px;margin-right:5px"></span>${showTime} ${params[i].axisValue}${specialIdentification} ${params[i].data}${showBai}<br />`;
                         }
                         return option;
                     }
@@ -1039,11 +1127,14 @@ export default {
                                 y: 0,
                                 x2: 0,
                                 y2: 1,
-                                colorStops: [{
-                                    offset: 0, color: '#2461F1' // 0% 处的颜色
-                                }, {
-                                    offset: 1, color: 'white' // 100% 处的颜色
-                                }]
+                                colorStops: [
+                                    {
+                                        offset: 0, color: '#2461F1' // 0% 处的颜色
+                                    },
+                                    {
+                                        offset: 1, color: 'white' // 100% 处的颜色
+                                    }
+                                ]
                             }
                         }
                     },
@@ -1063,12 +1154,28 @@ export default {
                             color: '#3CC6A5',
                             borderWidth: 2,
                             borderColor: '#fff'
+                        },
+                        areaStyle: {
+                            color: {
+                                type: 'linear',
+                                x: 0,
+                                y: 0,
+                                x2: 0,
+                                y2: 1,
+                                colorStops: [
+                                    {
+                                        offset: 0, color: '#3CC6A5' // 0% 处的颜色
+                                    }, {
+                                        offset: 1, color: 'white' // 100% 处的颜色
+                                    }
+                                ]
+                            }
                         }
                     }
                 ]
             };
             option.xAxis[0].data = todayX;
-            option.xAxis[1].data = todayX;
+            option.xAxis[1].data = LastX;
             option.series[0].data = tadayShowY;
             option.series[1].data = yestodayShowY;
             return option;
@@ -1139,10 +1246,12 @@ export default {
                                 fontFamily: 'PingFangSC'
                             }
                         },
-                        data: [{
-                            name: '花费占比',
-                            value: dataArr
-                        }],
+                        data: [
+                            {
+                                name: '',
+                                value: dataArr
+                            }
+                        ],
                         pointer: {
                             show: true,
                             length: '75%',
@@ -1226,44 +1335,12 @@ export default {
                 ]
             };
             return option;
-        },
-        // 投放点击排序功能
-        handlePlaneSort(pagination, filters, sorter, {currentDataSource}) {
-            if (sorter.order === 'descend') {
-                this.newDataSortType = 'DESC';
-                this.newDataSortCode = sorter.columnKey;
-            }
-            else if (sorter.order === 'ascend') {
-                this.newDataSortType = 'ASC';
-                this.newDataSortCode = sorter.columnKey;
-            }
-            else {
-                this.newDataSortType = 'DESC';
-                this.newDataSortCode = 'charge';
-            }
-            this.getLaunchData();
-        },
-        // 素材点击排序功能
-        materialChange(pagination, filters, sorter) {
-            console.log(sorter, 'v--sorter--sorter');
-            if (sorter.order === 'descend') {
-                this.materialSortType = 'DESC';
-                this.materialSortCode = sorter.columnKey;
-            }
-            else if (sorter.order === 'ascend') {
-                this.materialSortType = 'ASC';
-                this.materialSortCode = sorter.columnKey;
-            }
-            else {
-                this.materialSortType = 'DESC';
-                this.materialSortCode = 'charge';
-            }
         }
     }
 };
 </script>
 <style lang="scss">
-    .accountPage .accountBody{
+    .accountPage .accountBody {
         line-height: 1;
         .ant-input {
             -webkit-box-sizing: border-box;
@@ -1342,6 +1419,31 @@ export default {
         .common-input-long {
             width: 140px !important;
         }
+        .sign {
+            font-size: 18px;
+            .rise {
+                color: #F2637B;
+                width: 16px;
+                height: 16px;
+                text-align: center;
+                transform: rotate(-30deg);
+            }
+            .fall {
+                color: green;
+                width: 16px;
+                height: 16px;
+                text-align: center;
+                transform: rotate(30deg);
+            }
+            .up {
+                width: 16px;
+                height: 16px;
+                text-align: center;
+                background-color: #F2637B;
+                border-radius: 5px;
+                color: white;
+            }
+        }
         .pagin-table-class {
             display: flex;
             justify-content: flex-end;
@@ -1365,14 +1467,14 @@ export default {
             
         }
         .accountBodyLeft {
-            width: 75%;
+            width: 80%;
             margin-right: 26px;
             padding: 20px;
             display: flex;
             justify-content: space-between;
         }
         .accountBodyRight {
-            width: 25%;
+            width: 18%;
             padding: 25px;
         }
         .accountBodyLeft,.accountBodyRight {
@@ -1401,14 +1503,14 @@ export default {
             }
             .costInfo {
                 margin: 20px 0 0 0;
-                width: 70%;
+                width: 100%;
                 display: flex;
                 justify-content: space-between;    
             }
-            .yesterdayInfo {
-                width:50%;
-                flex-shrink: 0;
-            }
+            // .yesterdayInfo {
+            //     width:50%;
+            //     flex-shrink: 0;
+            // }
             .costNum{
                 width: 90%;
                 font-size: 26px;
@@ -1439,6 +1541,13 @@ export default {
         }
         .accountBodyLeftCostRight {
             width: 45%;
+            margin-left: 15px;
+            position: relative;
+            .cost-radio-tool {
+                position: absolute;
+                bottom: 34px;
+                left: 28%;
+            }
         }
         .accountBodyLeftOther {
             width: 60%;
@@ -1461,31 +1570,6 @@ export default {
                 margin-bottom: 10px;
                 width: 100%;
             }
-            .sign {
-                font-size: 18px;
-                .rise {
-                    color: #F2637B;
-                    width: 16px;
-                    height: 16px;
-                    text-align: center;
-                    transform: rotate(-30deg);
-                }
-                .fall {
-                    color: green;
-                    width: 16px;
-                    height: 16px;
-                    text-align: center;
-                    transform: rotate(30deg);
-                }
-                .up {
-                    width: 16px;
-                    height: 16px;
-                    text-align: center;
-                    background-color: #F2637B;
-                    border-radius: 5px;
-                    color: white;
-                }
-            }
             .yesterdayCost {
                 font-size: 0.89rem;
                 font-weight: 500;

+ 51 - 7
src/views/modules/material/accountCheck.vue

@@ -13,9 +13,19 @@
 <template>
   <div>
     <a-modal title="账户选择" v-model="showEdit" @ok="handleOk" @cancel="close" width="80%">
-      <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">全选</a-checkbox>
+      <!-- <a-checkbox :indeterminate="indeterminate" @change="onCheckAllChange" :checked="checkAll">全选</a-checkbox>
       <br />
-      <a-checkbox-group :options="showList" v-model="dataValue" class="checked-account" @change="onChange"/>
+      <a-checkbox-group :options="showList" v-model="dataValue" class="checked-account" @change="onChange" /> -->
+      <a-tree
+        v-model="checkedKeys"
+        checkable
+        :expanded-keys="expandedKeys"
+        :auto-expand-parent="autoExpandParent"
+        :selected-keys="selectedKeys"
+        :tree-data="treeData"
+        @expand="onExpand"
+        @select="onSelect"
+      />
     </a-modal>
   </div>
 </template>
@@ -30,19 +40,44 @@ export default {
 
   data: function () {
     return {
+      checkedKeys: [],
       showEdit: false,
       dataList: [],
       showList: null,
       dataValue: [],
       indeterminate: false,
       checkAll: false,
+      expandedKeys: [],
+      autoExpandParent: true,
+      selectedKeys: [],
+      treeData:[],
     }
   },
+  watch: {
+    checkedKeys(val) {
+      console.log('onCheck', val)
+    },
+  },
   methods: {
+    onExpand(expandedKeys) {
+      console.log('onExpand', expandedKeys)
+      // if not set autoExpandParent to false, if children expanded, parent can not collapse.
+      // or, you can remove all expanded children keys.
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    onCheck(checkedKeys) {
+      console.log('onCheck', checkedKeys)
+      this.checkedKeys = checkedKeys
+    },
+    onSelect(selectedKeys, info) {
+      console.log('onSelect', info)
+      this.selectedKeys = selectedKeys
+    },
     handleOk(e) {
       console.log(e)
       this.showEdit = false
-      this.$emit('synchro', this.dataValue)
+      this.$emit('synchro', this.checkedKeys)
     },
     close() {
       this.showEdit = false
@@ -72,17 +107,26 @@ export default {
       this.dataList = []
       this.showList = null
       this.dataValue = []
+      this.checkedKeys = []
       this.indeterminate = false
       this.checkAll = false
       console.log(url, item)
       getAction(url, item).then((res) => {
-        if (res.code == 0) {
-          this.showList = res.result.map((item) => {
+        if (res.success) {
+          let arrList = []
+          this.treeData = res.result.map(item=>{
             return {
-              label: item.authName,
-              value: item.accountId,
+              title: item.projectName,
+              key: item.projectId,
+              children:item.userAllocationList.map(i=>{
+                  return {
+                    title: i.authName+'\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0'+(i.userName?i.userName:'管理员'), 
+                    key: i.accountId
+                  }
+              })
             }
           })
+         
         }
         console.log(res)
       })

+ 3 - 3
src/views/modules/material/accountCheckBytedance.vue

@@ -289,12 +289,12 @@ export default {
         resolve(data)
       }
     },
-    getParticipateList(projectId) {
+    getParticipateList(productId) {
       //我参与的
       //   toutiaoParticipateList
       this.showEdit = true
-      getAction('/ctop/userAllocation/getUserIdListByProjectId', {
-        projectId: projectId,
+      getAction('/ctop/userAllocation/getUserIdListByProductId', {
+        productId: productId,
       }).then((res) => {
         if (res.code == 0) {
           console.log(res)

+ 423 - 0
src/views/modules/material/comment/selectTable.vue

@@ -0,0 +1,423 @@
+<style>
+.select-table .ant-table-thead > tr > th,
+.select-table .ant-table-tbody > tr > td {
+  padding: 0 !important;
+}
+.select-table .ant-table {
+  font-size: 12px;
+}
+.demo-infinite-container {
+  border: 1px solid #e8e8e8;
+  border-radius: 4px;
+  overflow: auto;
+  padding: 8px 24px;
+  height: 300px;
+}
+.demo-loading-container {
+  position: absolute;
+  bottom: 40px;
+  width: 100%;
+  text-align: center;
+}
+</style>
+<style lang="scss" scoped>
+.require-check {
+  /deep/ .ant-form-item-label {
+    label::before {
+      display: inline-block;
+      margin-right: 4px;
+      color: #f5222d;
+      font-size: 14px;
+      font-family: SimSun, sans-serif;
+      line-height: 1;
+      content: '*';
+    }
+  }
+}
+</style>
+<template>
+  <a-form-item
+    label="产品名称"
+    :label-col="labelCol"
+    :wrapper-col="wrapperCol"
+    v-clickoutside="handleClose"
+    style="width: 100%"
+    class="select-table"
+    :class="{'require-check':requireCheck} "
+  >
+    <a-input
+      placeholder="请选择产品名称"
+      @focus="topMiddle = true"
+      v-model="keyValue"
+      @change="getData"
+      :disabled="disabled"
+    />
+    <div
+      v-show="topMiddle"
+      v-infinite-scroll="handleInfiniteOnLoad"
+      style="
+        background: white;
+        padding: 10px;
+        box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
+        position: absolute;
+        z-index: 1000;
+        width: 100%;
+      "
+      class="demo-infinite-container"
+      :infinite-scroll-disabled="busy"
+      :infinite-scroll-distance="80"
+    >
+      <a-list :data-source="data">
+        <a-list-item slot="renderItem" slot-scope="item" @click="showProject(item)">
+          <a-list-item-meta :description="'广告主名称:' + item.advertiserName">
+            <a slot="title">产品名称:{{ item.productName }}</a>
+          </a-list-item-meta>
+          <!-- <div>
+            {{
+              item.mediaId == '1'
+                ? '头条'
+                : item.mediaId == '2'
+                ? '快手'
+                : item.mediaId == '3'
+                ? '头条内广'
+                : '快手内广'
+            }}
+          </div> -->
+        </a-list-item>
+        <div v-if="loading && !busy" class="demo-loading-container">
+          <a-spin />
+        </div>
+      </a-list>
+    </div>
+  </a-form-item>
+</template>
+
+<script>
+import { getAction, postAction } from '@/api/manage'
+import moment from 'moment'
+import { mapGetters } from 'vuex'
+import jq from 'jquery'
+import infiniteScroll from 'vue-infinite-scroll'
+const clickoutside = {
+  // 初始化指令
+  bind(el, binding, vnode) {
+    function documentHandler(e) {
+      // 这里判断点击的元素是否是本身,是本身,则返回
+      if (el.contains(e.target)) {
+        return false
+      }
+      // 判断指令中是否绑定了函数
+      if (binding.expression) {
+        // 如果绑定了函数 则调用那个函数,此处binding.value就是handleClose方法
+        binding.value(e)
+      }
+    }
+    // 给当前元素绑定个私有变量,方便在unbind中可以解除事件监听
+    el.__vueClickOutside__ = documentHandler
+    document.addEventListener('click', documentHandler)
+  },
+  update() {},
+  unbind(el, binding) {
+    // 解除事件监听
+    document.removeEventListener('click', el.__vueClickOutside__)
+    delete el.__vueClickOutside__
+  },
+}
+export default {
+  name: 'select-pagination',
+  components: {},
+  directives: { clickoutside, infiniteScroll },
+  props: {
+    projectId: {
+      type: [String, Number],
+      default() {
+        return ''
+      },
+    },
+    type: {
+      type: String,
+      default() {
+        return ''
+      },
+    },
+    labelCol: {
+      type: Object,
+      default() {
+        return {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        }
+      },
+    },
+    disabled: {
+      type: Boolean,
+      default() {
+        return false
+      },
+    },
+    requireCheck: {
+      type: Boolean,
+      default() {
+        return false
+      },
+    }
+  },
+
+  data() {
+    return {
+      taobaoSpecialOfferList: {
+        advertiserId: "fd41614705a047dd65ab0e34e9150cfe",
+        advertiserName: " 淘宝(中国)软件有限公司",
+        createTime: "2021-03-03 10:15:30",
+        designResponsibleName: "辛巴特",
+        id: 3660879,
+        maxBid: 30000,
+        mediaId: "1",
+        productId: 1410280,
+        productName: "头条-淘宝特价版",
+        projectId: 1530887,
+        projectName: "头条-淘宝特价版",
+        responsibleName: "董琪",
+        roleCode: "operator",
+        saleId: null,
+        saleName: null,
+        updateTime: "2021-03-03 21:23:04",
+        userId: "a0d58df3392c4583b55ce3b041792aa7",
+        userName: "王晓娟"
+      },
+      loading: false,
+      busy: false,
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 12 },
+      },
+      selectedRowKeys: [],
+      selectedRowKeysValue: [],
+      topMiddle: false,
+      keyValue: '',
+      data: [],
+      dataElse: [],
+      ipagination: {
+        current: 0,
+        pageSize: 20,
+      },
+      rowClick: (record, index) => ({
+        // 事件
+        on: {
+          click: () => {
+            // var str =
+            //   record.mediaId == '1'
+            //     ? '头条'
+            //     : record.mediaId == '2'
+            //     ? '快手'
+            //     : record.mediaId == '3'
+            //     ? '头条内广'
+            //     : '快手内广'
+            this.keyValue = record.productName
+            this.topMiddle = false
+            this.data = this.dataElse
+            this.$emit('update:projectId', record.id)
+          },
+        },
+      }),
+    }
+  },
+  computed: {},
+  filters: {},
+  methods: {
+    showProject(record) {
+      var str =
+        record.mediaId == '1'
+          ? '头条'
+          : record.mediaId == '2'
+          ? '快手'
+          : record.mediaId == '3'
+          ? '头条内广'
+          : '快手内广'
+      this.keyValue = record.productName
+      this.topMiddle = false
+      this.$emit('update:projectId', record.id)
+    },
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRowKeysValue = selectionRows.map((item) => {
+        return { orientationId: item.orientationId, orientationName: item.orientationName }
+      })
+    },
+    getData() {
+      if (this.keyValue == '') {
+        this.$emit('update:projectId', '')
+      }
+      this.ipagination.current = 1
+      getAction('/ctop/product/getUserProductList', {
+        userId: this.userInfo().id,
+        pageNo: this.ipagination.current,
+        productName: this.keyValue,
+      }).then((res) => {
+        if (res.code == 0) {
+          let defaultList = res.result.records.map((item, index) => {
+            return {
+              ...item,
+              productId: item.id + '',
+              key: index,
+            };
+          })
+          if (this.type === 'taobao') {
+            this.data = defaultList.filter(item => item.productId === 1410280);
+          }
+          else {
+            this.data = defaultList;
+          }
+          // this.dataElse = res.result.records.map((item, index) => {
+          //   return {
+          //     ...item,
+          //     projectId: item.projectId + '',
+          //     key: index,
+          //   }
+          // })
+        }
+      })
+    },
+    handleClose() {
+      this.topMiddle = false
+    },
+    // allData() {
+    //   getAction('/ctop/product/getUserProductList', {
+    //     userId: this.userInfo().id,
+    //     pageSize: this.ipagination.pageSize,
+    //     pageNo: this.ipagination.current,
+    //   }).then((res) => {
+    //     if (res.code == 0) {
+    //       this.data = res.result.records.map((item, index) => {
+    //         return {
+    //           ...item,
+    //           projectId: item.projectId + '',
+    //           key: index,
+    //         }
+    //       })
+    //       this.dataElse = res.result.records.map((item, index) => {
+    //         return {
+    //           ...item,
+    //           projectId: item.projectId + '',
+    //           key: index,
+    //         }
+    //       })
+    //     }
+    //   })
+    // },
+    handleInfiniteOnLoad() {
+      const data = this.data
+      this.loading = true
+      this.ipagination.current++
+      // this.fetchData((res) => {
+      //   this.data = data.concat(res.results)
+      //   this.loading = false
+      // })
+      getAction('/ctop/product/getUserProductList', {
+        userId: this.userInfo().id,
+        pageSize: this.ipagination.pageSize,
+        pageNo: this.ipagination.current,
+        productName: this.keyValue,
+      }).then((res) => {
+        if (res.code == 0) {
+          this.busy = true
+          let defaultList = res.result.records.map((item, index) => {
+              return {
+                ...item,
+                projectId: item.projectId + '',
+              }
+            })
+          this.data = data.concat(
+            
+          )
+          if (this.type === 'taobao') {
+            this.data = defaultList.filter(item => item.productId === 1410280);
+          }
+          else {
+            this.data = data.concat(defaultList);
+          }
+          // this.data = res.result.records.map((item, index) => {
+          //   return {
+          //     ...item,
+          //     projectId: item.projectId + '',
+          //     key: index,
+          //   }
+          // })
+          // this.dataElse = res.result.records.map((item, index) => {
+          //   return {
+          //     ...item,
+          //     projectId: item.projectId + '',
+          //     key: index,
+          //   }
+          // })
+        }
+      })
+    },
+  },
+  watch: {
+    projectId(n, o) {
+      if (n == '') {
+        this.keyValue = ''
+      } else {
+      }
+    },
+  },
+  mounted: function () {
+    // this.handleInfiniteOnLoad()
+  },
+}
+</script>
+
+<style type="text/css">
+.plug-timer-grid {
+  width: 100%;
+}
+
+.plug-timer-grid td,
+.plug-timer-grid th {
+  border: 1px solid #97b4d1;
+  text-align: center; /*cursor:pointer;*/
+  font-size: 10px;
+  line-height: 10px;
+}
+
+.Selected {
+  background-color: rgb(102, 162, 243);
+  opacity: 0.5;
+}
+
+.plug-timer-grid {
+  border-collapse: collapse;
+  z-index: 4;
+}
+
+.plug-timer-grid thead tr {
+  display: table-row;
+  vertical-align: inherit;
+  border-color: inherit;
+}
+
+.group-creat table td {
+  height: 20px;
+  max-width: 5px;
+  font-size: 12px;
+  text-align: center;
+  vertical-align: middle;
+  overflow: hidden;
+  transition: background 0.5s;
+  -webkit-transition: background 0.5s;
+}
+
+.plug-timer-grid tbody th {
+  width: 4%;
+}
+
+.plug-timer-grid tbody tr td {
+  width: 2%;
+}
+
+/*.clear{*/
+/*  margin:20px 0px 20px 0px;*/
+/*}*/
+</style>

+ 96 - 42
src/views/modules/material/videoMaterial.vue

@@ -356,7 +356,7 @@ a {
         <a-row :gutter="24">
           <a-col :md="8" :sm="8">
             <!-- <a-form-item label="项目名称"> -->
-            <selectTable :projectId.sync="queryParam.projectId"></selectTable>
+            <selectTable :projectId.sync="queryParam.productId" ref="selectTable"></selectTable>
           </a-col>
 
           <a-col :md="8" :sm="8">
@@ -418,7 +418,7 @@ a {
       <a-button
         @click="onCheckAllChange"
         v-if="
-          queryParam.projectId &&
+          queryParam.productId &&
           active == '1' &&
           (role.roleCode == 'operator' ||
             role.roleCode == 'kuaishouOperationManager' ||
@@ -430,7 +430,7 @@ a {
       >
       <a-button
         v-if="
-          queryParam.projectId &&
+          queryParam.productId &&
           active == '1' &&
           (role.roleCode == 'operator' ||
             role.roleCode == 'kuaishouOperationManager' ||
@@ -439,8 +439,50 @@ a {
             role.roleCode == 'touTiaoOperationManager')
         "
         :disabled="checkArr.length == 0"
-        @click="tongbu"
-        >一键同步</a-button
+        @click="tongbu('1')"
+        >一键同步头条</a-button
+      >
+      <a-button
+        v-if="
+          queryParam.productId &&
+          active == '1' &&
+          (role.roleCode == 'operator' ||
+            role.roleCode == 'kuaishouOperationManager' ||
+            role.roleCode == 'admin' ||
+            role.roleCode == 'operationAssistant' ||
+            role.roleCode == 'touTiaoOperationManager')
+        "
+        :disabled="checkArr.length == 0"
+        @click="tongbu('3')"
+        >一键同步头条内广</a-button
+      >
+      <a-button
+        v-if="
+          queryParam.productId &&
+          active == '1' &&
+          (role.roleCode == 'operator' ||
+            role.roleCode == 'kuaishouOperationManager' ||
+            role.roleCode == 'admin' ||
+            role.roleCode == 'operationAssistant' ||
+            role.roleCode == 'touTiaoOperationManager')
+        "
+        :disabled="checkArr.length == 0"
+        @click="tongbu('2')"
+        >一键同步快手</a-button
+      >
+      <a-button
+        v-if="
+          queryParam.productId &&
+          active == '1' &&
+          (role.roleCode == 'operator' ||
+            role.roleCode == 'kuaishouOperationManager' ||
+            role.roleCode == 'admin' ||
+            role.roleCode == 'operationAssistant' ||
+            role.roleCode == 'touTiaoOperationManager')
+        "
+        :disabled="checkArr.length == 0"
+        @click="tongbu('4')"
+        >一键同步快手内广</a-button
       >
     </div>
 
@@ -1667,7 +1709,7 @@ import qs from 'qs'
 import { mapGetters } from 'vuex'
 import moment from 'moment'
 
-import selectTable from '@/views/modules/Statistics/components/selectPagination.vue'
+import selectTable from './comment/selectTable.vue'
 
 import BMF from 'browser-md5-file'
 import uploadFile from '@/components/uploadFile.vue'
@@ -1950,9 +1992,10 @@ export default {
         this.loadData()
       }
     },
-    'queryParam.projectId': function (n, o) {
+    'queryParam.productId': function (n, o) {
       if (n != '') {
         this.getList(n)
+        this.checkArr = []
       }
     },
     visibleDetail: function (n, o) {
@@ -2189,33 +2232,40 @@ export default {
       return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
     },
     moment,
-    tongbu() {
-      getAction('/ctop/project/queryById', { id: this.queryParam.projectId }).then((res) => {
-        console.log(res)
-        if (res.success) {
-          if (res.result.mediaId == '1' || res.result.mediaId == '3') {
-            this.$refs.check.getData('/ctop/userAllocation/getAccountListByProjectId', {
-              userId: this.userInfo().id,
-              projectId: this.queryParam.projectId,
-            })
-          } else if (res.result.mediaId == '2' || res.result.mediaId == '4') {
-            this.$refs.accountCheckBytedance.getParticipateList(this.queryParam.projectId)
-          }
-        } else {
-          this.$message.error('网络波动,请稍后再试')
-        }
-      })
+    tongbu(value) {
+      this.mediaId = value
+      // getAction('/ctop/project/queryById', { id: this.queryParam.projectId }).then((res) => {
+      //   console.log(res)
+      //   if (res.success) {
+      if (value == '1' || value == '3') {
+        this.$refs.check.getData('/ctop/userAllocation/getAccountListByUserIdAndProductId', {
+          userId: this.userInfo().id,
+          productId: this.queryParam.productId,
+          mediaId: value,
+        })
+      } else if (value == '2' || value == '4') {
+        this.$refs.accountCheckBytedance.getParticipateList(this.queryParam.productId)
+        // this.$refs.check.getData('/ctop/userAllocation/getAccountListByUserIdAndProductId', {
+        //   userId: this.userInfo().id,
+        //   productId: this.queryParam.productId,
+        //   mediaId: value,
+        // })
+      }
+      //   } else {
+      //     this.$message.error('网络波动,请稍后再试')
+      //   }
+      // })
     },
     implement(data) {
       // {treeData:data,shieldBackwardSwitch:this.shieldBackwardSwitch}
       var params = {}
       params.mediaId = this.mediaId
       params.materialArray = JSON.stringify(this.checkArr)
-      params.accountArray = data.treeData?JSON.stringify(data.treeData):JSON.stringify(data)
-      if(this.mediaId == '2'){
+      params.accountArray = data.treeData ? JSON.stringify(data.treeData) : JSON.stringify(data)
+      if (this.mediaId == '2') {
         params.shieldBackwardSwitch = data.shieldBackwardSwitch
       }
-      
+
       postAction('/ctop/materialUpload/uploadAccount', params).then((res) => {
         if (res.code == 0) {
           this.checkArr = []
@@ -2294,27 +2344,30 @@ export default {
         type: 'VIDEO',
         userId: this.userInfo().id,
         status: this.active,
+        productId: ''
       }
+      this.$refs.selectTable.keyValue = "";
+      this.$refs.selectTable.getData()
       this.labelValue = []
 
       this.loadData(1)
     },
     getList(value) {
-      if (value) {
-        // this.mediaId = this.dataElse.filter(item => {
-        //   if (value == item.projectId) {
-        //     return item
-        //   }
-        // })[0].mediaId
-        getAction('/ctop/projectMember/participateListV2', {
-          userId: this.userInfo().id,
-          projectId: value,
-        }).then((res) => {
-          if (res.code == 0) {
-            this.mediaId = res.result.records[0].mediaId
-          }
-        })
-      }
+      // if (value) {
+      //   // this.mediaId = this.dataElse.filter(item => {
+      //   //   if (value == item.projectId) {
+      //   //     return item
+      //   //   }
+      //   // })[0].mediaId
+      //   getAction('/ctop/product/getUserProductList', {
+      //     userId: this.userInfo().id,
+      //     productId: value,
+      //   }).then((res) => {
+      //     if (res.code == 0) {
+      //       this.mediaId = res.result.records[0].mediaId
+      //     }
+      //   })
+      // }
       this.loadData()
     },
     onChangeCheckImage(checkedList) {
@@ -2801,6 +2854,7 @@ export default {
       this.checkAll = false
       this.checkArr = []
 
+
       if (key == '3') {
         this.url.list = '/ctop/materialInfo/effiMaterialInfo'
         this.queryParam = {}
@@ -2811,7 +2865,7 @@ export default {
           type: 'VIDEO',
           userId: this.userInfo().id,
           status: key,
-          projectId: this.queryParam.projectId,
+          productId: this.queryParam.productId,
         }
         if (this.labelValue.length >= 1) {
           this.queryParam.tagCode = this.labelValue[this.labelValue.length - 1]

+ 1 - 1
vue.config.js

@@ -72,7 +72,7 @@ module.exports = {
           // target: 'http://192.168.1.3:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.62:8088', //请求本地 需要jeecg-boot后台项目  英豪
-        // target: 'http://192.168.6.162:8806', //请求本地 需要jeecg-boot后台项目  祚云
+        // target: 'http://192.168.6.162:9806', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.43:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8806', //请求本地 需要jeecg-boot后台项目  毕洁泉