소스 검색

修改素材池

朱鑫波 4 년 전
부모
커밋
176bba8d46

+ 16 - 0
src/filters.js

@@ -421,6 +421,22 @@ const filters = {
                 break;
         }
         return str
+    },
+    deviceBrand(str) {
+        var data = {
+            1:"OPPO",
+            2:"VIVO",
+            3:"华为",
+            4:"小米",
+            5:"荣耀",
+            6:"三星",
+            7:"金立",
+            8:"魅族",
+            9:"乐视",
+            10:"其他",
+            11:"苹果",
+        }
+        return data[str]
     }
 
 }

+ 2 - 2
src/utils/request.js

@@ -16,8 +16,8 @@ else if (process.env.NODE_ENV == 'debug') {
 else if (process.env.NODE_ENV == 'production') { 
   
   // axios.defaults.baseURL = 'http://apipre.tjyourong.com.cn/jeecg-boot';//预生产
-  // axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
-  axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
+  axios.defaults.baseURL = 'http://139.186.165.84:8806/jeecg-boot';     
+  // axios.defaults.baseURL = 'http://api.tjyourong.com.cn/jeecg-boot';//生产环境
 }
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url

+ 2 - 2
src/views/modules/autoLaunch/material-all/components/targetedPopulation.vue

@@ -239,7 +239,7 @@ li:hover {
         ]"
       >
         <a-radio :value="3">不限</a-radio>
-        <a-radio :value="4">4X+</a-radio>
+        <a-radio :value="4">4x+</a-radio>
         <a-radio :value="5">5x+</a-radio>
         <a-radio :value="6">6x+</a-radio>
         <a-radio :value="7">7x+</a-radio>
@@ -262,7 +262,7 @@ li:hover {
         ]"
       >
         <a-radio :value="6">不限</a-radio>
-        <a-radio :value="7">7X+</a-radio>
+        <a-radio :value="7">7x+</a-radio>
         <a-radio :value="8">8x+</a-radio>
         <a-radio :value="9">9x+</a-radio>
         <a-radio :value="10">10x+</a-radio>

+ 28 - 57
src/views/modules/autoLaunch/material-all/components/templateModal.vue

@@ -49,39 +49,9 @@
 }
 </style>
 <template>
-  <a-modal v-model="visible" :title="type === 'add' ? '新建定向包' : '修改定向包'" :width="1100" v-if="visible">
+  <a-modal v-model="visible" :title="type === 'add' ? '编辑素材指定定向包' : '编辑素材指定定向包'" :width="1100" v-if="visible">
     <a-spin :spinning="spinning">
       <a-form @submit="handleSubmit" :form="form">
-        <a-row :gutter="24">
-          <a-col :md="24" :sm="24" :xxl="24">
-            <selectTable
-              :projectId.sync="projectId"
-              :labelCol="labelCol"
-              :disabled="disabled"
-              :requireCheck="true"
-              v-if="!disabled"
-            ></selectTable>
-            <a-form-item
-              v-else
-              label="项目名称"
-              :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-              :wrapperCol="{ lg: { span: 12 }, sm: { span: 12 } }"
-              class="require-check"
-            >
-              <a-input v-model="projectName" :disabled="disabled"></a-input>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-form-item
-          label="定向包名称"
-          :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
-          :wrapperCol="{ lg: { span: 12 }, sm: { span: 12 } }"
-        >
-          <a-input
-            v-decorator="['templateName', { rules: [{ required: true, message: '模板名称必填' }] }]"
-            :disabled="type == 'look'"
-          ></a-input>
-        </a-form-item>
 
         <targeted-population ref="population" :populationData.sync="populationData" />
       </a-form>
@@ -133,6 +103,7 @@ export default {
       loading: false,
       labelCol: { lg: { span: 7 }, sm: { span: 7 } },
       disabled: false,
+      id:null
     }
   },
   computed: {},
@@ -149,15 +120,16 @@ export default {
       this.spinning = true
       this.visible = true
       this.type = type
-      var params = {}
-      params.id = item.id
-      this.templateId = item.id
-      this.projectName = item.projectName
-      this.projectId = item.projectId
-      getAction('/kuaishouDirectionalPackage/queryById', params).then((res) => {
-        if (res.success) {
+      // var params = {}
+      // params.id = item.id
+      // this.templateId = item.id
+      // this.projectName = item.projectName
+      // this.projectId = item.projectId
+      // getAction('/kuaishouDirectionalPackage/queryById', params).then((res) => {
+      //   if (res.success) {
+          this.id = item.id;
           var dataJson = {
-            ...res.result,
+            ...item,
           }
 
           this.populationData = dataJson
@@ -221,12 +193,9 @@ export default {
           this.disabled = true
 
           this.$nextTick(() => {
-            console.log(dataJson)
-            this.form.setFieldsValue(pick(dataJson, ['templateName']))
             this.spinning = false
           })
-        }
-      })
+
     },
     handleCancel(e) {
       this.visible = false
@@ -234,28 +203,34 @@ export default {
     handleSubmit(e) {
       //   this.$refs.population.handleSubmit()
 
+      var data = JSON.parse(localStorage.getItem('materialDetail'))
       e.preventDefault()
       this.$refs.population.handleSubmit()
       this.$refs.population.formAll.validateFields((err, value) => {
-        if (this.populationData.allForm.appType == '2') {
-          if (this.populationData.appIds.length == 0) {
-            this.$message.error('APP名称未选择')
-          }
-        }
         if (!err) {
           this.form.validateFieldsAndScroll((err, values) => {
             if (!err) {
+              this.loading = true
               // this.loading = true
-              if (this.projectId) {
+
                 var params = {
                   ...this.populationData,
-                  templateName: values.templateName,
-                  projectId: this.projectId,
+                  videoGetId: data.id,
+                  signature: data.md5,
+                  id:this.id
                 }
                 params.label = JSON.stringify(params.behavior)
                 params.interestLabel = JSON.stringify(params.interest)
+                console.log(this.populationData)
+                if (this.populationData.allForm.regionType == 'limit') {
+                  if(this.populationData.allForm.region.length === 0) {
+                    this.$message.error('请选择地域');
+                    this.loading = false
+                    return
+                  }
+                }
                 if (this.type == 'add') {
-                  postAction('/kuaishouDirectionalPackage/createDirectionalPackage', params).then((res) => {
+                  postAction('/kuaishouVideoDirectionalPackage/saveOrUpdate', params).then((res) => {
                     if (res.success) {
                       this.visible = false
                       this.loading = false
@@ -266,8 +241,7 @@ export default {
                     }
                   })
                 } else if (this.type == 'edit') {
-                  params.id = this.templateId
-                  postAction('/kuaishouDirectionalPackage/updateDirectionalPackage', params).then((res) => {
+                  postAction('/kuaishouVideoDirectionalPackage/saveOrUpdate', params).then((res) => {
                     this.visible = false
                     if (res.success) {
                       this.loading = false
@@ -278,9 +252,6 @@ export default {
                     }
                   })
                 }
-              } else {
-                this.$message.error('请选择项目')
-              }
             }
           })
         }

+ 627 - 46
src/views/modules/autoLaunch/material-all/material-detail.vue

@@ -4,7 +4,7 @@
 }
 .directional-border {
     border: 1px solid #f2f2f2;
-    min-height: 300px;
+    min-height: 250px;
     width: 100%;
     padding: 20px;
     /deep/.title-border {
@@ -21,6 +21,7 @@
 }
 .flex-main {
     display: flex;
+    margin-bottom: 10px;
     p {
         color: black;
         font-weight: 600;
@@ -141,52 +142,94 @@
 
                     <div class="directional-border">
                         <a-row class="title-border">
-                            <a-col :span="24" class="flex-main" style="justify-content: space-between;">
+                            <a-col :span="24" class="flex-main" style="justify-content: space-between;margin-bottom:0">
                                 <div>
                                     <span class="ant-descriptions-item-label" style="color:black;font-weight:500"> 素材可用定向</span>
-                                    <a-radio-group name="radioGroup" v-model="useDirectional">
-                                        <a-radio value="noUse">
-                                        不使用定向包
-                                        </a-radio>
-                                        <a-radio value="use">
-                                        使用定向包
-                                        </a-radio>
-                                    </a-radio-group>
                                 </div>
-                                <a>{{ useDirectional==='noUse' ? '编辑' : '选择'}}</a>
+                                <a @click="addNewTemplate">编辑</a>
                             </a-col>
                         </a-row>
-                         <a-row>
+                        <a-row style="margin-top:10px">
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 地区:</span>
-                                <p title="-">-</p>
+                                <div v-if="directionalInfo">
+                                    <span v-if="directionalInfo.region == '' || directionalInfo.region == null||JSON.parse(directionalInfo.region).length==0"> 不限 </span>
+                                    <div v-else>
+                                        {{ region.join(',') }}
+                                    </div>
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 年龄:</span>
-                                <p title="-">-</p>
+                                <div v-if="directionalInfo">
+                                    <span v-if="
+                                    (directionalInfo.agesRange == '[]' || directionalInfo.agesRange == null) &&
+                                    (directionalInfo.min == -1 || directionalInfo.min == null) &&
+                                    (directionalInfo.max == -1 || directionalInfo.max == null)"> 不限 </span>
+                                    <div v-else>
+                                        <span v-if="directionalInfo.agesRange == '[]' || directionalInfo.agesRange == null">
+                                        {{ directionalInfo.min + '岁~' + directionalInfo.max + '岁' }}
+                                        </span>
+                                        <span v-else>
+                                            <span v-for="(item, index) in JSON.parse(directionalInfo.agesRange)" :key="index">
+                                                {{ item | kuaishouAge }}{{ index == JSON.parse(directionalInfo.agesRange).length - 1 ? '' : ',' }}
+                                            </span>
+                                        </span>
+                                    </div>
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                         </a-row>
                          <a-row>
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 性别:</span>
-                                <p title="-">-</p>
+                                <div v-if="directionalInfo">
+                                     {{ directionalInfo.gender == 1 ? '女' : directionalInfo.gender == 2 ? '男' : '不限' }}
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 最低版本:</span>
-                                <p title="-">-</p>
+                                <div v-if="directionalInfo">
+                                    {{ directionalInfo.platformOs == 1 
+                                    ? 'Android系统('+(directionalInfo.androidOsv==3?'不限)':directionalInfo.androidOsv+'x+)') : 
+                                    directionalInfo.platformOs == 2 ? 'IOS系统('+(directionalInfo.iosOsv==6?'不限)':directionalInfo.iosOsv+'x+)') : '不限' }}
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                         </a-row>
                          <a-row>
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 设备品牌:</span>
-                                <p title="-">-</p>
+                                <div v-if="directionalInfo">
+                                    <span v-if="directionalInfo.deviceBrand == '' || directionalInfo.deviceBrand == null ||JSON.parse(directionalInfo.deviceBrand).length == 0">
+                                        不限
+                                    </span>
+                                    <span v-else>
+                                        <span v-for="(item, index) in JSON.parse(directionalInfo.deviceBrand)" :key="index">
+                                            {{ item | deviceBrand }}{{ index == JSON.parse(directionalInfo.deviceBrand).length - 1 ? '' : ',' }}
+                                        </span>
+                                    </span>
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 设备价格:</span>
-                                <p title="-">-</p>
+                                <div v-if="directionalInfo">
+                                    <span v-if="directionalInfo.devicePrice == '' || directionalInfo.devicePrice == null ||JSON.parse(directionalInfo.devicePrice).length == 0">
+                                        不限
+                                    </span>
+                                    <span v-else>
+                                        <span v-for="(item, index) in JSON.parse(directionalInfo.devicePrice)" :key="index">
+                                            {{ item | kuaishouPrice }}{{ index == JSON.parse(directionalInfo.devicePrice).length - 1 ? '' : ',' }}
+                                        </span>
+                                    </span>
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                         </a-row>
-                         <a-row>
+                         <!-- <a-row>
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> APP行为:</span>
                                 <p title="-">-</p>
@@ -195,47 +238,125 @@
                                 <span class="ant-descriptions-item-label"> 商业兴趣:</span>
                                 <p title="-">-</p>
                             </a-col>
-                        </a-row>
+                        </a-row> -->
                          <a-row>
                             <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 网络环境:</span>
-                                <p title="-">-</p>
+                                <div v-if="directionalInfo">
+                                    {{ directionalInfo.network == 1 ? 'Wi-Fi' : directionalInfo.network == 2 ? '移动网络' : '不限' }}
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
-                            <a-col :xl="12" :md="24" class="flex-main">
-                                <span class="ant-descriptions-item-label"> 网红类别:</span>
-                                <p title="-">-</p>
+                             <a-col :xl="12" :md="24" class="flex-main">
+                                <span class="ant-descriptions-item-label"> 过滤已转换用户:</span>
+                                <div v-if="directionalInfo">
+                                    {{ directionalInfo.filterConvertedLevel | kuaishouFilterConvertedLevel }}
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                         </a-row>
                          <a-row>
-                            <a-col :xl="12" :md="24" class="flex-main">
+                            <!-- <a-col :xl="12" :md="24" class="flex-main">
                                 <span class="ant-descriptions-item-label"> 兴趣视频用户:</span>
                                 <p title="-">-</p>
-                            </a-col>
+                            </a-col> -->
                             <a-col :xl="12" :md="24" class="flex-main">
-                                <span class="ant-descriptions-item-label"> 过滤已转换用户:</span>
-                                <p title="-">-</p>
+                                <span class="ant-descriptions-item-label"> 智能扩量:</span>
+                                <div v-if="directionalInfo">
+                                    {{ directionalInfo.isOpen == 0 ? '关闭' : '开启' }}
+                                </div>
+                                <p title="-" v-else>-</p>
                             </a-col>
                         </a-row>
-                         <a-row>
-                            <a-col :xl="12" :md="24" class="flex-main">
-                                <span class="ant-descriptions-item-label"> 智能扩量:</span>
+                         <!-- <a-row>
+                             <a-col :xl="12" :md="24" class="flex-main">
+                                <span class="ant-descriptions-item-label"> 网红类别:</span>
                                 <p title="-">-</p>
                             </a-col>
-                        </a-row>
+                        </a-row> -->
                     </div>
                 </a-card>
                 <a-card style="min-height: 300px; margin: 10px 0">
-                    
+                    <div
+                        style="
+                        margin-bottom: 20px;
+                        color: rgba(0, 0, 0, 0.85);
+                        font-weight: bold;
+                        font-size: 16px;
+                        line-height: 1.5;
+                        "
+                    >
+                        素材已关联账户  
+                        <a-button type="primary" @click="lowerMaterial" :disabled="selectedRowKeysValue.length==0">下架素材</a-button>
+                    </div> 
+                    <a-table
+                        size="middle"
+                        :loading="loadingList"
+                        :columns="columns"
+                        :dataSource="dataList"
+                        bordered
+                        :scroll="{ x: 2000 }"
+                        :pagination="ipagination"
+                        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+                    >
+
+                    </a-table>
+                </a-card>
+                <a-card style="min-height: 300px; margin: 10px 0">
+                    <div
+                        style="
+                        margin-bottom: 20px;
+                        color: rgba(0, 0, 0, 0.85);
+                        font-weight: bold;
+                        font-size: 16px;
+                        line-height: 1.5;
+                        "
+                    >
+                        素材关联被拒创意 
+                        <a-button type="primary" @click="visibleAgain = true;type = 'all'" :disabled="selectedRowKeysCreative.length==0||accountId==''||accountId==null||accountId==undefined">批量重提</a-button>
+                        <a-select
+                            show-search
+                            placeholder="请选择账户"
+                            option-filter-prop="children"
+                            style="width: 200px;margin-left:20px"
+                            :filter-option="filterOption"
+                            v-model="accountId"
+                            @change="handleChange"
+                            allowClear
+                        >
+                            <a-select-option v-for="(item,index) in accountList" :key="index"
+                            :value="item.accountId">
+                            {{item.authName}}
+                            </a-select-option>
+                        </a-select>
+                    </div> 
+
+                    <a-table
+                        size="middle"
+                        :loading="loadingCreative"
+                        :columns="columnsCreative"
+                        :dataSource="creativeList"
+                        bordered
+                        :pagination="ipaginationCreative"
+                        :rowSelection="{ selectedRowKeys: selectedRowKeysCreative, onChange: onSelectChangeCreative }"
+                    >
+                        <span slot="action"  slot-scope="text, record">
+                            <a  @click="again(record)">重提</a>
+                        </span>
+                        <span slot="coverUrl" slot-scope="text, record">
+                            <img :src="text" alt="" style="width:100px">
+                        </span>
+                    </a-table>
                 </a-card>
             </a-col>
         </a-spin>
         <a-modal 
-        title="素材可用日期" 
-        v-model="timeVisible" 
-        :width="400" 
-        @ok="handleOk"
-        @cancel="timeVisible=false"
-        :confirmLoading="editTimeLoading"
+            title="素材可用日期" 
+            v-model="timeVisible" 
+            :width="400" 
+            @ok="handleOk"
+            @cancel="timeVisible=false"
+            :confirmLoading="editTimeLoading"
         >
             <a-form layout="inline">
                 <a-form-item label="选择日期">
@@ -254,6 +375,27 @@
                     </a-range-picker>
             </a-form>
         </a-modal>
+        <a-modal title="一键重提" @cancel="handleClose" :visible="visibleAgain" @ok="handleOkAgain"
+            :confirmLoading="againLoading"
+            :width="650">
+            <a-form :form="form">
+                <a-form-item label="是否修改" :labelCol="{ lg: { span: 4 }, sm: { span: 6 } }"
+                :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }">
+                <a-radio-group buttonStyle="solid" v-decorator="[
+                'type',
+                { initialValue: 0} ]">
+                    <a-radio-button :value="0">否</a-radio-button>
+                    <a-radio-button :value="1">是</a-radio-button>
+                </a-radio-group>
+                </a-form-item>
+                <a-form-item label="广告语" :labelCol="{ lg: { span: 4 }, sm: { span: 6 } }"
+                :wrapperCol="{ lg: { span: 18 }, sm: { span: 18 } }" v-if="getData('type')==1">
+                <a-input v-model="updateDescription" :max="10" :min="1" style="width:100%" @change="DescriptionChange">
+                </a-input>
+                </a-form-item>
+            </a-form>
+        </a-modal>
+        <templateModal ref="templateModal" @getData="getDirectionalInfo" />
     </a-row>
 </template>
 
@@ -265,11 +407,18 @@ import qs from 'qs'
 import UploadToAli from '@femessage/upload-to-ali'
 import uploadFile from '@/components/uploadFile.vue'
 import { mapActions, mapGetters, mapState } from 'vuex'
+import templateModal from './components/templateModal';
 var echarts = require('echarts')
 export default {
     name: 'online-training-list',
     data() {
         return {
+            accountId: undefined,
+            accountList: [],
+            type: 'one',
+            form: this.$form.createForm(this),
+            visibleAgain: false,
+            updateDescription: '',
             noImg: require('@/assets/noImg.png'),
             materialInfo: null,
             dataView: null,
@@ -284,16 +433,339 @@ export default {
             dateRange: [],
             editTimeLoading: false,
             useDirectional: 'noUse',
-            directionalInfo: null
+            directionalInfo: null,
+            region: [],
+            loadingList: false,
+            columns: [
+                {
+                    title: '账户名称',
+                    align: 'center',
+                    dataIndex: 'authName',
+                    fixed: 'left',
+                    width: 150,
+                    scopedSlots: {
+                        customRender: 'authName',
+                    },
+                },
+                {
+                    title: '账户id',
+                    align: 'center',
+                    dataIndex: 'accountId',
+                    fixed: 'left',
+                    width: 150,
+                    scopedSlots: {
+                        customRender: 'accountId',
+                    },
+                },
+                {
+                    title: '被拒创意',
+                    align: 'center',
+                    dataIndex: 'rejectCount',
+                    scopedSlots: {
+                        customRender: 'rejectCount',
+                    },
+                },
+                {
+                    title: '同步时间',
+                    align: 'center',
+                    dataIndex: 'statDate',
+                    scopedSlots: {
+                        customRender: 'statDate',
+                    },
+                },
+                {
+                    title: '关联创意数',
+                    align: 'center',
+                    dataIndex: 'creativeCount',
+                    scopedSlots: {
+                        customRender: 'creativeCount',
+                    },
+                },
+                {
+                    title: '消耗',
+                    align: 'center',
+                    dataIndex: 'charge',
+                    scopedSlots: {
+                        customRender: 'charge',
+                    },
+                },
+                {
+                    title: '封面曝光数',
+                    align: 'center',
+                    dataIndex: 'photoShow',
+                    scopedSlots: {
+                        customRender: 'photoShow',
+                    },
+                },
+                {
+                    title: '封面点击数',
+                    align: 'center',
+                    dataIndex: 'photoClick',
+                    scopedSlots: {
+                        customRender: 'photoClick',
+                    },
+                },
+                {
+                    title: '素材曝光数',
+                    align: 'center',
+                    dataIndex: 'aclick',
+                    scopedSlots: {
+                        customRender: 'aclick',
+                    },
+                },
+                {
+                    title: '行为数',
+                    align: 'center',
+                    dataIndex: 'bclick',
+                    scopedSlots: {
+                        customRender: 'bclick',
+                    },
+                },
+                {
+                    title: '封面点击率',
+                    align: 'center',
+                    dataIndex: 'photoClickRatio',
+                    scopedSlots: {
+                        customRender: 'photoClickRatio',
+                    },
+                },
+                {
+                    title: '行为率',
+                    align: 'center',
+                    dataIndex: 'actionRatio',
+                    scopedSlots: {
+                        customRender: 'actionRatio',
+                    },
+                },
+                {
+                    title: '平均千次封面曝光花费(元)',
+                    align: 'center',
+                    dataIndex: 'impression1kCost',
+                    scopedSlots: {
+                        customRender: 'impression1kCost',
+                    },
+                },
+                {
+                    title: '平均封面点击单价(元)',
+                    align: 'center',
+                    dataIndex: 'photoClickCost',
+                    scopedSlots: {
+                        customRender: 'photoClickCost',
+                    },
+                },
+                {
+                    title: '平均行为单价(元)',
+                    align: 'center',
+                    dataIndex: 'actionCost',
+                    scopedSlots: {
+                        customRender: 'actionCost',
+                    },
+                }
+
+            ],
+            dataList: [],
+            selectedRowKeys: [],
+            selectedRowKeysValue: [],
+            ipagination: {
+                current: 1,
+                pageSize: 10,
+                //   pageSizeOptions: ['10', '20', '30'],
+                showTotal: (total, range) => {
+                return range[0] + '-' + range[1] + ' 共' + total + '条'
+                },
+                showQuickJumper: true,
+                // showSizeChanger: true,
+                // pageSizeOptions: ['10', '30', '50'],
+                total: 0,
+                onChange: (current, pageSize) => {
+                    // 切换分页时的回调,
+                    // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
+                    this.ipagination.current = current
+                    this.ipagination.pageSize = pageSize
+                    this.getAccountVideo();
+                },
+                total: 0,
+            },
+
+            creativeList: [],
+            loadingCreative: false,
+            columnsCreative: [
+                {
+                    title: '账户名称',
+                    align: 'center',
+                    dataIndex: 'authName',
+                    scopedSlots: {
+                        customRender: 'authName',
+                    },
+                },
+                {
+                    title: '账户ID',
+                    align: 'center',
+                    dataIndex: 'accountId',
+                    width:100,
+                    scopedSlots: {
+                        customRender: 'accountId',
+                    },
+                },
+                {
+                    title: '关联创意ID',
+                    align: 'center',
+                    dataIndex: 'creativeId',
+                    scopedSlots: {
+                        customRender: 'creativeId',
+                    },
+                },
+                {
+                    title: '创意名称',
+                    align: 'center',
+                    dataIndex: 'creativeName',
+                    scopedSlots: {
+                        customRender: 'creativeName',
+                    },
+                },
+                {
+                    title: '素材封面',
+                    align: 'center',
+                    dataIndex: 'coverUrl',
+                    scopedSlots: {
+                        customRender: 'coverUrl',
+                    },
+                },
+                {
+                    title: '广告语',
+                    align: 'center',
+                    dataIndex: 'description',
+                    scopedSlots: {
+                        customRender: 'description',
+                    },
+                },
+                {
+                    title: '被拒理由',
+                    align: 'center',
+                    dataIndex: 'reviewDetail',
+                    width:120,
+                    scopedSlots: {
+                        customRender: 'reviewDetail',
+                    },
+                },
+                {
+                    title: '操作',
+                    align: 'center',
+                    dataIndex: 'action',
+                    width: 50,
+                    scopedSlots: {
+                        customRender: 'action',
+                    },
+                },
+            ],
+            selectedRowKeysCreative: [],
+            selectedRowKeysValueCreative: [],
+            selectedOneKeysValueCreative: [],
+            againLoading: false,
+            ipaginationCreative: {
+                current: 1,
+                pageSize: 10,
+                //   pageSizeOptions: ['10', '20', '30'],
+                showTotal: (total, range) => {
+                return range[0] + '-' + range[1] + ' 共' + total + '条'
+                },
+                showQuickJumper: true,
+                // showSizeChanger: true,
+                // pageSizeOptions: ['10', '30', '50'],
+                total: 0,
+                onChange: (current, pageSize) => {
+                    // 切换分页时的回调,
+                    // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
+                    this.ipaginationCreative.current = current
+                    this.ipaginationCreative.pageSize = pageSize
+                    this.getCreativeByVideo({})
+                },
+                total: 0,
+            },
+
         }
     },
     components: {
         UploadToAli,
         uploadFile,
+        templateModal
     },
     watch: {
     },
     methods: {
+        filterOption(input, option) {
+            return (
+                option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+            );
+        },
+        getData(className) {
+            return this.form.getFieldValue(className)
+        },
+        onSelectChange(selectedRowKeys, selectionRows) {
+            this.selectedRowKeys = selectedRowKeys
+            this.selectedRowKeysValue = selectionRows.map((item) => {
+                return item.accountId
+            })
+            //    this.selectedRowKeysValue.length > 0 ? this.selectedRowKeysValue :
+        },
+        onSelectChangeCreative(selectedRowKeys, selectionRows) {
+            this.selectedRowKeysCreative = selectedRowKeys
+            this.selectedRowKeysValueCreative = selectionRows.map((item) => {
+                return {
+                    description: item.description,
+                    creativeId: item.creativeId
+                }
+            })
+            //    this.selectedRowKeysValue.length > 0 ? this.selectedRowKeysValue :
+        },
+        getAccountVideo() {
+            this.loadingList = true;
+            var data = JSON.parse(localStorage.getItem('materialDetail'))
+            let params = {};
+            params.signature = data.md5;
+            params.projectId = data.projectId;
+            params.pageNo = this.ipagination.current;
+            params.pageSize = this.ipagination.pageSize;
+            this.getAction('/kuaishouProjectVideoGet/getAccountVideos', params).then(res => {
+                this.loadingList = false;
+                if(res.success) {
+                    this.dataList = res.result.list;
+                    this.ipagination.total = res.result.total;
+                }
+                else {
+                    this.dataList = [];
+                }
+            })
+        },
+        getCreativeByVideo() {
+            this.loadingCreative = true;
+            var data = JSON.parse(localStorage.getItem('materialDetail'))
+            let params = {};
+            params.signature = data.md5;
+            params.projectId = data.projectId;
+            params.pageNo = this.ipaginationCreative.current;
+            params.pageSize = this.ipaginationCreative.pageSize;
+            params.accountId = this.accountId;
+            this.getAction('/kuaishouProjectVideoGet/queryCreativeByVideo', params).then(res => {
+                this.loadingCreative = false;
+                if(res.success) {
+                    this.creativeList = res.result.list;
+                    this.ipaginationCreative.total = res.result.total;
+                }
+                else {
+                    this.creativeList = [];
+                }
+            })
+        },
+        addNewTemplate() {
+            if(this.directionalInfo) {
+                this.$refs.templateModal.handleOk(this.directionalInfo, 'edit')
+            }
+            else {
+                this.$refs.templateModal.create(null, 'add')
+            }
+           
+        },
         disabledDate(current) {
             // Can not select days before today and today
             return current && current < moment().subtract(1, 'days')
@@ -320,22 +792,47 @@ export default {
         getDirectionalInfo() {
             var data = JSON.parse(localStorage.getItem('materialDetail'))
             var params = {
-                photoId: data.photoId,
+                signature: data.md5,
                 id: data.id
             }
             this.getAction('/kuaishouVideoDirectionalPackage/queryDirctional', params).then((res) => {
-                if (res.success) {
+                if (res.success&&res.result) {
                     this.directionalInfo = res.result;
+                    if (res.result&&(res.result.region == '' || res.result.region == null||JSON.parse(res.result.region).length==0)) {
+                    } else {
+                        this.showRegion(res.result.region)
+                    }
                 }
                  else {
                     this.$message.error(res.message);
                 }
             })
         },
+        showRegion(data) {
+            return new Promise((resolve, reject) => {
+                this.postDataAction('/kuaishou/batch/getRegionDetail', {
+                    regionArr: data,
+                }).then((res) => {
+                    if (res.success) {
+                        //   this.populationData.allForm.region = res.result
+                        this.region = res.result.map((item) => {
+                            return item.label
+                        })
+                    }
+                })
+            })
+        },
         handleScroll() {
             var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
             this.scrollTop = scrollTop
         },
+        handleChange() {
+            this.ipaginationCreative.current = 1;
+            this.selectedOneKeysValueCreative = [];
+            this.selectedRowKeysValueCreative = [];
+            this.selectedRowKeysCreative = [];
+            this.getCreativeByVideo();
+        },
         selectTime(item) {
             if(item) {
                 if(item.putStartTime!='') {
@@ -364,6 +861,11 @@ export default {
                 params.putEndTime = '';
             }
             else {
+                if(this.dateRange.length === 0) {
+                    this.$message.error('请选择指定日期');
+                    this.editTimeLoading = false;
+                    return
+                }
                 params.putStartTime = moment(this.dateRange[0]).format('YYYY-MM-DD');
                 params.putEndTime = moment(this.dateRange[1]).format('YYYY-MM-DD');;
             }
@@ -379,17 +881,96 @@ export default {
                     this.$message.error(res.message);
                 }
             })
+        },
+        lowerMaterial() {
+            let data = JSON.parse(localStorage.getItem('materialDetail'))
+            let params = {};
+            params.projectId = data.projectId;
+            params.accountId = this.selectedRowKeysValue;
+            params.signature = data.md5;
+            this.postDataAction('/kuaishouProjectVideoGet/offShelfVideos', params).then(res => {
+                if(res.success) {
+                    this.getAccountVideo();
+                    this.selectedRowKeysValue = [];
+                    this.selectedRowKeys = []
+                }
+            })
+            // /kuaishouProjectVideoGet/offShelfVideos
+        },
+        again(item) {
+            this.visibleAgain = true;
+            this.type = "one"
+            this.selectedOneKeysValueCreative = [{
+                description: item.description,
+                creativeId: item.creativeId,
+                accountId: item.accountId
+            }]
+        },
+        DescriptionChange(e) {
+            if (e.target.value.length > 30) {
+                this.$message.error('广告语最多30字!')
+            }
+        },
+        handleClose(e) {
+            this.visibleAgain = false;
+            this.form.resetFields();
+        },
+        getAccountList() {
+            let data = JSON.parse(localStorage.getItem('materialDetail'))
+            let params = {};
+            params.projectId = data.projectId;
+            this.getAction('/ctop/userAllocation/queryAccountIdsByProjectId', params).then(res => {
+                if(res.success) {
+                    this.accountList = res.result;
+                }
+            })
+        },
+        handleOkAgain() {
+            if (this.updateDescription.length > 30 && this.getData('type') == 1) {
+                this.$message.error('广告语最多30个字,请修正后再次提交!')
+            } else {
+                this.againLoading = true
+                this.form.validateFields((err, values) => {
+                    if (!err) {
+                    values.updateDescription = this.updateDescription;
+                    var params = {
+                        ...values,
+                        accountId: this.type=='one'?this.selectedOneKeysValueCreative[0].accountId:this.accountId,
+                        creativeArr: this.type=='one'?this.selectedOneKeysValueCreative:this.selectedRowKeysValueCreative
+                    }
+                    this.postDataAction('/MaterialRefuse/batchUpdateCreative', params).then(res => {
+                        if (res.success) {
+                            // this.visibleFail = true
+                            this.visibleAgain = false;
+                            this.selectedOneKeysValueCreative = [];
+                            this.selectedRowKeysValueCreative = [];
+                            this.selectedRowKeysCreative = [];
+                            this.ipaginationCreative.current = 1;
+                            this.getCreativeByVideo();
+                            this.againLoading = false;
+                            this.$message.success(res.message);
+                        } else {
+                            this.againLoading = false
+                            this.$message.error(res.message)
+                        }
+                    })
+                    }
+                })
+            }
         }
     },
     mounted() {
         this.$nextTick(() => {
             //   this.mediaId = JSON.parse(localStorage.getItem('videoInfo')).mediaId
-            window.addEventListener('scroll', this.handleScroll)
-            this.clientWidth = document.documentElement.clientWidth - 224
+            window.addEventListener('scroll', this.handleScroll);
+            this.clientWidth = document.documentElement.clientWidth - 224;
             //   this.$route.query.mediaId
             //   this.$route.query.md5
-            this.getMaterialInfo()
-            this.getDirectionalInfo()
+            this.getMaterialInfo();
+            this.getDirectionalInfo();
+            this.getAccountVideo();
+            this.getCreativeByVideo();
+            this.getAccountList()
 
         })
     },

+ 1 - 1
src/views/modules/autoLaunch/material-all/material.less

@@ -154,7 +154,7 @@
         }
         .bottom-details {
             width: 100%;
-            height: 35%;
+            height: 37%;
             background: rgba(0, 0, 0, .7);
             position: absolute;
             bottom: 0;

+ 24 - 16
src/views/modules/autoLaunch/material-all/material.vue

@@ -41,7 +41,7 @@
                                 allow-clear
                             >
                                 <a-select-option :value="''">不限</a-select-option>
-                                <a-select-option :value="0">自产</a-select-option>
+                                <a-select-option :value="0">内部</a-select-option>
                                 <a-select-option :value="1">素造</a-select-option>
                             </a-select>
                         </a-form-item>
@@ -121,11 +121,11 @@
                         <img :src="items.coverUrl" alt="">
                         <div class="bottom-details">
                             <div class="bottom-title">
-                                <h3>{{ items.photoName ? items.photoName : '-' }}</h3>
-                                <a @click.stop="lowerMaterial(items)">下架素材</a>
+                                <h3 :title="items.photoName">{{ items.photoName ? items.photoName : '-' }}</h3>
+                                <a @click.stop="lowerMaterial(items)" :disabled="items.status === 1">下架素材</a>
                             </div>
-                            <p>素材来源:{{ items.channelType === 0 ? '自产' : '素造' }}</p>
-                            <p>上传日期:{{ items.statDate }}</p>
+                            <p>素材来源:{{ items.channelType === 0 ? '内部' : '素造' }}</p>
+                            <p :title="items.statDate">上传日期:{{ items.statDate }}</p>
                             <p>素材状态:{{ items.status === 0 ? '可用' : '删除' }}</p>
                             <p></p>
                         </div>
@@ -210,22 +210,30 @@ export default {
     methods: {
         lowerMaterial(item) {
             let params = {};
-            params.projectId = item.projectId;
-            params.photoIds = [item.photoId];
-            this.postDataAction('/kuaishouProjectVideoGet/offShelfVideos', params).then(res => {
-                if(res.success) {
-                    this.$message.success('下架成功')
-                    this.handleGetTableList({})
-                }
-                else {
-                    this.$message.error(res.message)
+            params.id = item.id;
+            let that = this
+            this.$confirm({
+                title: '下架提示',
+                content: '是否下架此素材?',
+                onOk() {
+                    that.postDataAction('/kuaishouProjectVideoGet/offShelfVideo', params).then(result => {
+                        if(result.success) {
+                            that.$message.success('下架成功')
+                            that.handleGetTableList({})
+                        }
+                        else {
+                            that.$message.error(result.message)
+                        }
+                    }).catch(error => {
+                        console.log(error, 'eeee');
+                    });
                 }
-            })
+            });
         },
         lookView(item) {
             // this.visibleVideo = true
             // this.videoUrlShow = item.url
-            var params = { md5: item.signature, url:item.url, id:item.id, photoId:item.photoId }
+            var params = { md5: item.signature, url:item.url, id:item.id, photoId:item.photoId, projectId:item.projectId }
             localStorage.setItem('materialDetail', JSON.stringify(params))
             this.$router.push({
                 path: '/autoLaunch/material-all/material-detail',

+ 2 - 2
vue.config.js

@@ -77,7 +77,7 @@ module.exports = {
         // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.43:8806', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        target: 'http://192.168.1.219:8081', //请求本地 需要jeecg-boot后台项目  赵西安
+        // target: 'http://192.168.1.219:8081', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要jeecg-boot后台项目  李煜一
         //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
@@ -88,7 +88,7 @@ module.exports = {
         // target:'http://118.24.244.213:8804',
         // target: 'http://192.168.1.43:8080', // 子安
         // target: 'http://192.168.1.8:8806', // 学超
-      //  target:'http://139.186.165.84:8806', //测试
+       target:'http://139.186.165.84:8806', //测试
         // target:'http://apipre.tjyourong.com.cn', //预生产
 
         ws: false,