瀏覽代碼

项目配置完成提测

朱鑫波 3 年之前
父節點
當前提交
157c890169

+ 2 - 2
src/utils/request.js

@@ -16,8 +16,8 @@ else if (process.env.NODE_ENV == 'debug') {
 else if (process.env.NODE_ENV == 'production') { 
 else if (process.env.NODE_ENV == 'production') { 
   
   
   // axios.defaults.baseURL = 'http://apipre.tjyourong.com.cn/jeecg-boot';//预生产
   // 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({
 const service = axios.create({
 //   baseURL: '/jeecg-boot', // api base_url
 //   baseURL: '/jeecg-boot', // api base_url

+ 535 - 63
src/views/modules/autoLaunch/configProject/creatConfig.vue

@@ -239,7 +239,16 @@ li.chouzhen.first:before {
                         <a-form layout="horizontal" v-bind="formItemLayout" :form="formProject" hide-required-mark>
                         <a-form layout="horizontal" v-bind="formItemLayout" :form="formProject" hide-required-mark>
                             <a-row :gutter="16">
                             <a-row :gutter="16">
                                 <a-col :span="16">
                                 <a-col :span="16">
+                                    <a-form-item
+                                        label="项目名称"
+                                        :labelCol="formItemLayout.labelCol"
+                                        class="require-check"
+                                        v-if="$route.query.id"
+                                    >
+                                        <a-input v-model="projectName" disabled></a-input>
+                                    </a-form-item>
                                     <selectTable
                                     <selectTable
+                                        v-else
                                         :labelCol="formItemLayout.labelCol"
                                         :labelCol="formItemLayout.labelCol"
                                         :projectId.sync="projectId"
                                         :projectId.sync="projectId"
                                         ref="selectTable"
                                         ref="selectTable"
@@ -444,17 +453,18 @@ li.chouzhen.first:before {
                                     <a-collapse expand-icon-position="right">
                                     <a-collapse expand-icon-position="right">
                                         <a-collapse-panel key="1" :header="item.appName">
                                         <a-collapse-panel key="1" :header="item.appName">
                                             <a-descriptions>
                                             <a-descriptions>
-                                                <a-descriptions-item label="应用标识">
+                                                <a-descriptions-item label="应用标识" :span="2">
                                                     {{ item.appVersion }}
                                                     {{ item.appVersion }}
                                                 </a-descriptions-item>
                                                 </a-descriptions-item>
-                                                <a-descriptions-item label="投放系统">
-                                                    {{ item.platform | platform }}
-                                                </a-descriptions-item>
+
                                                 <a-descriptions-item label="覆盖账户">
                                                 <a-descriptions-item label="覆盖账户">
                                                     {{ item.count }}
                                                     {{ item.count }}
                                                 </a-descriptions-item>
                                                 </a-descriptions-item>
-                                                <a-descriptions-item label="调起链接">
-                                                    {{ item.schemaUri ? item.schemaUri : '无' }}
+                                                <a-descriptions-item label="投放系统" :span="3">
+                                                    {{ item.platform | platform }}
+                                                </a-descriptions-item>
+                                                <a-descriptions-item label="调起链接" :span="3">
+                                                    {{ appDetail.schemaUri ? appDetail.schemaUri : '无' }}
                                                 </a-descriptions-item>
                                                 </a-descriptions-item>
                                             </a-descriptions>
                                             </a-descriptions>
                                         </a-collapse-panel>
                                         </a-collapse-panel>
@@ -486,6 +496,7 @@ li.chouzhen.first:before {
                                             :disabled="!projectId"
                                             :disabled="!projectId"
                                             >选择定向包 ></a-button
                                             >选择定向包 ></a-button
                                         >
                                         >
+                                        <p v-if="$route.query.id" style="margin:0">重新选择定向包将会重新选取</p>
                                     </div>
                                     </div>
                                 </a-form-item>
                                 </a-form-item>
                                 <a-form-item label="" v-bind="tailFormItemLayout">
                                 <a-form-item label="" v-bind="tailFormItemLayout">
@@ -870,7 +881,6 @@ li.chouzhen.first:before {
                         </a-row>
                         </a-row>
                     </a-card>
                     </a-card>
                     <a-card class="search-box step-jump" title="优化目标">
                     <a-card class="search-box step-jump" title="优化目标">
-                        <a-button type="primary" slot="extra" @click="test">提交</a-button>
                         <a-form layout="horizontal" v-bind="formItemLayout" :form="formOptimize">
                         <a-form layout="horizontal" v-bind="formItemLayout" :form="formOptimize">
                             <a-row :gutter="16">
                             <a-row :gutter="16">
                                 <a-col :span="16">
                                 <a-col :span="16">
@@ -932,6 +942,7 @@ li.chouzhen.first:before {
                                         <a-select
                                         <a-select
                                             style="width:300px"
                                             style="width:300px"
                                             size="default"
                                             size="default"
+                                            allowClear
                                             v-decorator="['deepConversionType']"
                                             v-decorator="['deepConversionType']"
                                         >
                                         >
                                             <a-select-option :value="3">
                                             <a-select-option :value="3">
@@ -981,20 +992,24 @@ li.chouzhen.first:before {
                                             ]"
                                             ]"
                                         >
                                         >
                                         </a-input>
                                         </a-input>
+                                        <br>
+                                        <span style="color:red"
+                                            >单出价请输入单数字,阶梯出价请用/隔开 例如10/12,区间出价请用-链接
+                                            例如20-25</span
+                                        >
                                     </a-form-item>
                                     </a-form-item>
                                 </a-col>
                                 </a-col>
                             </a-row>
                             </a-row>
+                            <!-- { rules: [{ validator: deepBidValid }] } -->
                             <a-row :gutter="16">
                             <a-row :gutter="16">
                                 <a-col :span="16">
                                 <a-col :span="16">
                                     <a-form-item label="深度转化出价">
                                     <a-form-item label="深度转化出价">
-                                        <a-input
-                                            style="width:300px"
-                                            v-decorator="[
-                                                'deepConversionBid',
-                                                { rules: [{ validator: deepBidValid }] }
-                                            ]"
+                                        <a-input style="width:300px" v-decorator="['deepConversionBid']"> </a-input>
+                                         <br>
+                                        <span style="color:red"
+                                            >单出价请输入单数字,阶梯出价请用/隔开 例如10/12,区间出价请用-链接
+                                            例如20-25</span
                                         >
                                         >
-                                        </a-input>
                                     </a-form-item>
                                     </a-form-item>
                                 </a-col>
                                 </a-col>
                             </a-row>
                             </a-row>
@@ -1007,8 +1022,8 @@ li.chouzhen.first:before {
                         <a-form-item v-bind="tailFormItemLayoutElse" style="margin-left:1.15%">
                         <a-form-item v-bind="tailFormItemLayoutElse" style="margin-left:1.15%">
                             <a-descriptions>
                             <a-descriptions>
                                 <a-descriptions-item label="创意制作方式">
                                 <a-descriptions-item label="创意制作方式">
-                                    <span v-if="showCreativeData && showCreativeData.openProgramCreate">
-                                        {{ showCreativeData.openProgramCreate | openProgramCreate }}
+                                    <span v-if="showCreativeData">
+                                        {{ showCreativeData.unitType | unitType }}
                                     </span>
                                     </span>
                                     <span v-else>-</span>
                                     <span v-else>-</span>
                                 </a-descriptions-item>
                                 </a-descriptions-item>
@@ -1063,14 +1078,7 @@ li.chouzhen.first:before {
                                     </span>
                                     </span>
                                     <span v-else>-</span>
                                     <span v-else>-</span>
                                 </a-descriptions-item>
                                 </a-descriptions-item>
-                                <a-descriptions-item label="广告语">
-                                    <span v-if="showCreativeData">
-                                        <span v-for="(item, index) in descriptionList" :key="index">
-                                            {{ item.value }}{{ index === descriptionList.length - 1 ? '' : ',' }}
-                                        </span>
-                                    </span>
-                                    <span v-else>-</span>
-                                </a-descriptions-item>
+
                                 <a-descriptions-item label="创意分类">
                                 <a-descriptions-item label="创意分类">
                                     <span v-if="showCreativeData && showCreativeData.creativeCategory">
                                     <span v-if="showCreativeData && showCreativeData.creativeCategory">
                                         <a-cascader
                                         <a-cascader
@@ -1085,7 +1093,7 @@ li.chouzhen.first:before {
                                 </a-descriptions-item>
                                 </a-descriptions-item>
                                 <a-descriptions-item label="行动号召">
                                 <a-descriptions-item label="行动号召">
                                     <span v-if="showCreativeData && showCreativeData.actionBarText">
                                     <span v-if="showCreativeData && showCreativeData.actionBarText">
-                                        {{ showCreativeData.actionBarText }}
+                                        {{ showCreativeData.actionBarText.join() }}
                                     </span>
                                     </span>
                                     <span v-else>-</span>
                                     <span v-else>-</span>
                                 </a-descriptions-item>
                                 </a-descriptions-item>
@@ -1095,6 +1103,14 @@ li.chouzhen.first:before {
                                     </span>
                                     </span>
                                     <span v-else>-</span>
                                     <span v-else>-</span>
                                 </a-descriptions-item>
                                 </a-descriptions-item>
+                                <a-descriptions-item label="广告语" :span="3">
+                                    <span v-if="showCreativeData">
+                                        <span v-for="(item, index) in descriptionList" :key="index">
+                                            {{ item.value }}{{ index === descriptionList.length - 1 ? '' : ';' }}
+                                        </span>
+                                    </span>
+                                    <span v-else>-</span>
+                                </a-descriptions-item>
                             </a-descriptions>
                             </a-descriptions>
                         </a-form-item>
                         </a-form-item>
                     </a-card>
                     </a-card>
@@ -1167,6 +1183,20 @@ li.chouzhen.first:before {
                             </a-row>
                             </a-row>
                         </a-form>
                         </a-form>
                     </a-card>
                     </a-card>
+                    <div style="display: flex; justify-content: flex-end; margin-bottom: 100px">
+                        <div>
+                            <a-button
+                                type="primary"
+                                style="margin-right: 15px"
+                                @click="handleSubmit"
+                                :loading="sumbitLoading"
+                                :disabled="disabled"
+                            >
+                                创建
+                            </a-button>
+                            <a-button @click="clearAllData"> 取消 </a-button>
+                        </div>
+                    </div>
                 </a-col>
                 </a-col>
             </a-row>
             </a-row>
         </div>
         </div>
@@ -1179,7 +1209,11 @@ li.chouzhen.first:before {
                 <a-row :gutter="16">
                 <a-row :gutter="16">
                     <a-col :span="16">
                     <a-col :span="16">
                         <a-form-item label="系统平台">
                         <a-form-item label="系统平台">
-                            <a-radio-group v-decorator="['platformOs', { initialValue: 1 }]" button-style="solid">
+                            <a-radio-group
+                                v-decorator="['platformOs', { initialValue: 2 }]"
+                                button-style="solid"
+                                @change="changeType"
+                            >
                                 <!-- <a-radio-button :value="0">不限</a-radio-button> -->
                                 <!-- <a-radio-button :value="0">不限</a-radio-button> -->
                                 <a-radio-button :value="1">Android</a-radio-button>
                                 <a-radio-button :value="1">Android</a-radio-button>
                                 <a-radio-button :value="2">IOS</a-radio-button>
                                 <a-radio-button :value="2">IOS</a-radio-button>
@@ -1243,6 +1277,7 @@ li.chouzhen.first:before {
                                 :dataSource="multipleBidDataDrawer"
                                 :dataSource="multipleBidDataDrawer"
                                 :pagination="false"
                                 :pagination="false"
                                 style="width:180%"
                                 style="width:180%"
+                                :scroll="{ x: 1200 }"
                             >
                             >
                                 <a-table-column
                                 <a-table-column
                                     key="appName"
                                     key="appName"
@@ -1309,6 +1344,36 @@ li.chouzhen.first:before {
                                         />
                                         />
                                     </template>
                                     </template>
                                 </a-table-column>
                                 </a-table-column>
+                                <a-table-column
+                                    width="20%"
+                                    key="actionbarClickUrl"
+                                    data-index="actionbarClickUrl"
+                                    title="第三方点击按钮监测链接"
+                                    align="center"
+                                    :ellipsis="true"
+                                >
+                                    <template slot-scope="text, record">
+                                        <editable-cell
+                                            :text="text"
+                                            @change="onCellChange(record.id, 'actionbarClickUrl', $event)"
+                                        />
+                                    </template>
+                                </a-table-column>
+                                <a-table-column
+                                    width="20%"
+                                    key="adPhotoPlayedT3sUrl"
+                                    data-index="adPhotoPlayedT3sUrl"
+                                    title="第三方有效播放监测链接"
+                                    align="center"
+                                    :ellipsis="true"
+                                >
+                                    <template slot-scope="text, record">
+                                        <editable-cell
+                                            :text="text"
+                                            @change="onCellChange(record.id, 'adPhotoPlayedT3sUrl', $event)"
+                                        />
+                                    </template>
+                                </a-table-column>
                             </a-table>
                             </a-table>
                         </a-form-item>
                         </a-form-item>
                     </a-col>
                     </a-col>
@@ -1377,7 +1442,7 @@ li.chouzhen.first:before {
             @close="closePerson"
             @close="closePerson"
         >
         >
             <!-- @close="closeUnit('createForm')" -->
             <!-- @close="closeUnit('createForm')" -->
-            <h2 slot="title" style="margin-bottom: 0">定向包选择 已选择({{ sumContent }})</h2>
+            <h2 slot="title" style="margin-bottom: 0">定向包选择</h2>
             <div style="display: flex">
             <div style="display: flex">
                 <a-input placeholder="输入定向包名称关键词" style="width:60%" v-model="searchTemplate" />
                 <a-input placeholder="输入定向包名称关键词" style="width:60%" v-model="searchTemplate" />
                 <a-button type="primary" :style="{ marginRight: '8px', marginLeft: '8px' }" @click="getTargetPerson()">
                 <a-button type="primary" :style="{ marginRight: '8px', marginLeft: '8px' }" @click="getTargetPerson()">
@@ -1392,6 +1457,7 @@ li.chouzhen.first:before {
                 >
                 >
                     重置
                     重置
                 </a-button>
                 </a-button>
+                <div style="line-height: 32px;font-weight: 700;margin-left: 50px;">已选择({{ sumContent }})</div>
             </div>
             </div>
             <a-checkbox-group v-model="checkPerson" style="width: 100%;" @change="setVideoData">
             <a-checkbox-group v-model="checkPerson" style="width: 100%;" @change="setVideoData">
                 <div class="card-person-drawer info-detail">
                 <div class="card-person-drawer info-detail">
@@ -1704,8 +1770,9 @@ li.chouzhen.first:before {
                         <a-form-item label="创意制作方式">
                         <a-form-item label="创意制作方式">
                             <a-radio-group
                             <a-radio-group
                                 button-style="solid"
                                 button-style="solid"
+                                @change="unitTypeCheck"
                                 v-decorator="[
                                 v-decorator="[
-                                    'openProgramCreate',
+                                    'unitType',
                                     {
                                     {
                                         rules: [
                                         rules: [
                                             {
                                             {
@@ -1713,13 +1780,13 @@ li.chouzhen.first:before {
                                                 message: '创意制作方式必选'
                                                 message: '创意制作方式必选'
                                             }
                                             }
                                         ],
                                         ],
-                                        initialValue: 2
+                                        initialValue: 0
                                     }
                                     }
                                 ]"
                                 ]"
                             >
                             >
-                                <a-radio-button :value="2">不限</a-radio-button>
-                                <a-radio-button :value="0">自定义</a-radio-button>
-                                <a-radio-button :value="1">程序化</a-radio-button>
+                                <a-radio-button :value="0">不限</a-radio-button>
+                                <a-radio-button :value="4">自定义</a-radio-button>
+                                <a-radio-button :value="7">程序化</a-radio-button>
                             </a-radio-group>
                             </a-radio-group>
                         </a-form-item>
                         </a-form-item>
                     </a-col>
                     </a-col>
@@ -1756,7 +1823,7 @@ li.chouzhen.first:before {
                         <a-form-item label="关联封面数">
                         <a-form-item label="关联封面数">
                             <a-input-number
                             <a-input-number
                                 style="width:200px"
                                 style="width:200px"
-                                :max="15"
+                                :max="imageCntMax"
                                 :step="1"
                                 :step="1"
                                 :min="1"
                                 :min="1"
                                 v-decorator="[
                                 v-decorator="[
@@ -1768,7 +1835,7 @@ li.chouzhen.first:before {
                         </a-form-item>
                         </a-form-item>
                     </a-col>
                     </a-col>
                 </a-row>
                 </a-row>
-                <a-row :gutter="16" v-if="getFormData('formOriginality', 'openProgramCreate') != 1">
+                <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 7">
                     <a-col :span="16">
                     <a-col :span="16">
                         <a-form-item label="自定义组上限">
                         <a-form-item label="自定义组上限">
                             <a-input-number
                             <a-input-number
@@ -1784,7 +1851,7 @@ li.chouzhen.first:before {
                         </a-form-item>
                         </a-form-item>
                     </a-col>
                     </a-col>
                 </a-row>
                 </a-row>
-                <a-row :gutter="16" v-if="getFormData('formOriginality', 'openProgramCreate') != 0">
+                <a-row :gutter="16" v-if="getFormData('formOriginality', 'unitType') != 4">
                     <a-col :span="16">
                     <a-col :span="16">
                         <a-form-item label="程序化组上限">
                         <a-form-item label="程序化组上限">
                             <a-input-number
                             <a-input-number
@@ -1819,7 +1886,7 @@ li.chouzhen.first:before {
                         <a-form-item label="素材挖掘">
                         <a-form-item label="素材挖掘">
                             <a-radio-group
                             <a-radio-group
                                 button-style="solid"
                                 button-style="solid"
-                                v-decorator="['assetMining', { rules: [{ required: true }], initialValue: 0 }]"
+                                v-decorator="['assetMining', { rules: [{ required: true }], initialValue: 1 }]"
                             >
                             >
                                 <a-radio-button :value="1">开启</a-radio-button>
                                 <a-radio-button :value="1">开启</a-radio-button>
                                 <a-radio-button :value="0">关闭</a-radio-button>
                                 <a-radio-button :value="0">关闭</a-radio-button>
@@ -1832,7 +1899,7 @@ li.chouzhen.first:before {
                         <a-form-item label="智能抽帧">
                         <a-form-item label="智能抽帧">
                             <a-radio-group
                             <a-radio-group
                                 button-style="solid"
                                 button-style="solid"
-                                v-decorator="['smartCover', { rules: [{ required: true }], initialValue: 0 }]"
+                                v-decorator="['smartCover', { rules: [{ required: true }], initialValue: 1 }]"
                             >
                             >
                                 <a-radio-button :value="1">开启</a-radio-button>
                                 <a-radio-button :value="1">开启</a-radio-button>
                                 <a-radio-button :value="0">关闭</a-radio-button>
                                 <a-radio-button :value="0">关闭</a-radio-button>
@@ -1844,6 +1911,7 @@ li.chouzhen.first:before {
                     <a-col :span="16">
                     <a-col :span="16">
                         <a-form-item label="行动号召">
                         <a-form-item label="行动号召">
                             <a-select
                             <a-select
+                                mode="multiple"
                                 v-decorator="[
                                 v-decorator="[
                                     'actionBarText',
                                     'actionBarText',
                                     { rules: [{ required: true, message: '请选择行动号召按钮文案' }] }
                                     { rules: [{ required: true, message: '请选择行动号召按钮文案' }] }
@@ -1981,8 +2049,6 @@ import moment from 'moment'
 import selectCheckAll from '@/components/formComponents/toutiaoTime'
 import selectCheckAll from '@/components/formComponents/toutiaoTime'
 import checkBoxGroup from '@/components/formComponents/checkBoxGroup'
 import checkBoxGroup from '@/components/formComponents/checkBoxGroup'
 import uploadFile from '@/components/uploadFileMd5Push.vue'
 import uploadFile from '@/components/uploadFileMd5Push.vue'
-import BMF from 'browser-md5-file'
-import templateModal from '@/views/modules/kuaishouapp/crossAccount/templateModal'
 import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
 import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
 import selectTable from '@/views/modules/Statistics/components/selectPagination.vue'
 import selectTable from '@/views/modules/Statistics/components/selectPagination.vue'
 import EditableCell from './editablCell'
 import EditableCell from './editablCell'
@@ -2016,7 +2082,6 @@ export default {
         selectCheckAll,
         selectCheckAll,
         checkBoxGroup,
         checkBoxGroup,
         uploadFile,
         uploadFile,
-        templateModal,
         selectTable,
         selectTable,
         EditableCell
         EditableCell
     },
     },
@@ -2051,10 +2116,12 @@ export default {
             formOptimize: this.$form.createForm(this), //优化目标表单
             formOptimize: this.$form.createForm(this), //优化目标表单
             formOriginality: this.$form.createForm(this), //创意表单
             formOriginality: this.$form.createForm(this), //创意表单
             formMaterial: this.$form.createForm(this), //素材表单
             formMaterial: this.$form.createForm(this), //素材表单
+            sumbitLoading: false,
             //基本信息参数
             //基本信息参数
             budgetType: '1',
             budgetType: '1',
             dayBudgetType: '1',
             dayBudgetType: '1',
             projectId: null,
             projectId: null,
+            projectName: null,
             //目标应用参数
             //目标应用参数
             targetAppVisible: false,
             targetAppVisible: false,
             appList: [], //分平台数据,从总数据中筛选,避免多次请求接口
             appList: [], //分平台数据,从总数据中筛选,避免多次请求接口
@@ -2104,6 +2171,7 @@ export default {
             programUnitCnt: 60,
             programUnitCnt: 60,
             customUnitCnt: 400,
             customUnitCnt: 400,
             customUnitCntMax: 400,
             customUnitCntMax: 400,
+            imageCntMax: 15,
             actionBarTextList: [],
             actionBarTextList: [],
             descriptionList: [{ value: '' }],
             descriptionList: [{ value: '' }],
             fieldNames: {
             fieldNames: {
@@ -2165,19 +2233,56 @@ export default {
                         offset: 5
                         offset: 5
                     }
                     }
                 }
                 }
-            }
+            },
+            disabled: false
         }
         }
     },
     },
     computed: {},
     computed: {},
-    watch: {},
+    watch: {
+        projectId: function(n, o) {
+            if (this.$route.query.id) {
+                return
+            } else {
+                if (n) {
+                    this.getAction('/kuaishouProjectStrategy/checkProjectisOpen', { projectId: n }).then(res => {
+                        console.log(res)
+                        if (res.success) {
+                            if (res.result === 1) {
+                                this.disabled = false
+                            } else {
+                                this.$message.error('此项目有开启的配置,无法新建配置')
+                                this.disabled = true
+                            }
+                        }
+                    })
+                    this.formProject.resetFields()
+                    this.formInformation.resetFields()
+                    this.formOptimize.resetFields()
+                    this.formMaterial.resetFields()
+                    this.multipleBidData = []
+                    this.appDetail = {}
+                    this.showCheckPerson = []
+                    this.checkPerson = []
+                    this.checkPersonAll = []
+                    this.showCreativeData = null
+                    this.description = [{ value: '' }]
+                }
+            }
+        }
+    },
     mounted() {
     mounted() {
         this.$nextTick(function() {
         this.$nextTick(function() {
             // this.accountId = 23212
             // this.accountId = 23212
+
             this.getDataType('APP_INTEREST', 'optionsAppActive')
             this.getDataType('APP_INTEREST', 'optionsAppActive')
             this.getDataType('BUSINESS_INTEREST', 'businessOptions')
             this.getDataType('BUSINESS_INTEREST', 'businessOptions')
             this.getDataType('FANS_STAR', 'fansStarOptions')
             this.getDataType('FANS_STAR', 'fansStarOptions')
             this.getDataType('INTEREST_VIDEO', 'interestVideoOptions')
             this.getDataType('INTEREST_VIDEO', 'interestVideoOptions')
             this.getActionBarText()
             this.getActionBarText()
+
+            if (this.$route.query.id) {
+                this.getQueryById(this.$route.query.id)
+            }
             window.addEventListener('scroll', this.onScroll)
             window.addEventListener('scroll', this.onScroll)
             const that = this
             const that = this
             window.onresize = () => {
             window.onresize = () => {
@@ -2189,11 +2294,11 @@ export default {
         })
         })
     },
     },
     filters: {
     filters: {
-        openProgramCreate(val) {
+        unitType(val) {
             let data = {
             let data = {
-                0: '自定义',
-                1: '程序化',
-                2: '不限'
+                4: '自定义',
+                7: '程序化',
+                0: '不限'
             }
             }
             return data[val]
             return data[val]
         },
         },
@@ -2254,7 +2359,6 @@ export default {
             })[0].tagName
             })[0].tagName
         }
         }
     },
     },
-    watch: {},
     methods: {
     methods: {
         moment,
         moment,
         test() {
         test() {
@@ -2277,6 +2381,320 @@ export default {
             //             formOriginality: this.$form.createForm(this), //创意表单
             //             formOriginality: this.$form.createForm(this), //创意表单
             //             formMaterial: this.$form.createForm(this), //素材表单
             //             formMaterial: this.$form.createForm(this), //素材表单
         },
         },
+        getQueryById(id) {
+            this.getAction('/kuaishouProjectStrategy/queryById', { id }).then(res => {
+                if (res.success) {
+                    this.getActionBarText()
+                    this.getAction('/ctop/userAllocation/getAccountListByProjectId', {
+                        projectId: res.result.projectId
+                    }).then(res => {
+                        if (res.success) {
+                            this.getAction('/kuaishou/batch/getCreativeCategory', {
+                                accountId: res.result[0].accountId
+                            }).then(result => {
+                                if (result.success) {
+                                    //console.log(res)
+                                    this.createOptions = result.result
+                                }
+                            })
+                        }
+                    })
+                    this.$nextTick(() => {
+                        let data = res.result
+                        this.projectName = data.projectName
+                        this.projectId = data.projectId
+                        this.formProject.setFieldsValue(pick(data, 'campaignType'))
+                        this.formInformation.setFieldsValue(pick(data, 'campaignName', 'groupName'))
+                        if (data.campaignDayBudget && data.campaignDayBudget > 0) {
+                            this.budgetType = '2'
+                            data.campaignDayBudget = data.campaignDayBudget / 1000
+                            setTimeout(() => {
+                                this.formInformation.setFieldsValue(pick(data, 'campaignDayBudget'))
+                            }, 100)
+                        } else {
+                            this.budgetType = '1'
+                        }
+                        if (data.unitDayBudget && data.unitDayBudget > 0) {
+                            this.dayBudgetType = '2'
+                            data.unitDayBudget = data.unitDayBudget / 1000
+                            setTimeout(() => {
+                                this.formInformation.setFieldsValue(pick(data, 'unitDayBudget'))
+                            }, 100)
+                        } else {
+                            this.dayBudgetType = '1'
+                        }
+
+                        if (data.deepConversionType && data.deepConversionBid && data.deepConversionBid == '0') {
+                            if (res.result.deepConversionBid.includes('/')) {
+                                let bidArr = res.result.deepConversionBid.split('/')
+                                for (let index = 0; index < bidArr.length; index++) {
+                                    bidArr[index] = bidArr[index] / 1000
+                                }
+                                data.deepConversionBid = bidArr.join('/')
+                            } else if (res.result.deepConversionBid.includes('-')) {
+                                let bidArr = res.result.deepConversionBid.split('-')
+                                for (let index = 0; index < bidArr.length; index++) {
+                                    bidArr[index] = bidArr[index] / 1000
+                                }
+                                data.deepConversionBid = bidArr.join('-')
+                            } else {
+                                data.deepConversionBid = res.result.deepConversionBid / 1000 + ''
+                            }
+                        } else {
+                            data.deepConversionType = undefined
+                            data.deepConversionBid = undefined
+                        }
+
+                        if (data.cpaBid.includes('/')) {
+                            let bidArr = data.cpaBid.split('/')
+                            for (let index = 0; index < bidArr.length; index++) {
+                                bidArr[index] = bidArr[index] / 1000
+                            }
+                            data.cpaBid = bidArr.join('/')
+                        } else if (data.cpaBid.includes('-')) {
+                            let bidArr = data.cpaBid.split('-')
+                            for (let index = 0; index < bidArr.length; index++) {
+                                bidArr[index] = bidArr[index] / 1000
+                            }
+                            data.cpaBid = bidArr.join('-')
+                        } else {
+                            data.cpaBid = data.cpaBid / 1000 + ''
+                        }
+                        this.formOptimize.setFieldsValue(
+                            pick(data, 'bidType', 'ocpxActionType', 'deepConversionType', 'cpaBid', 'deepConversionBid')
+                        )
+                        res.result.sourceMaterial = JSON.parse(res.result.sourceMaterial)
+                        this.formMaterial.setFieldsValue(pick(data, 'sourceMaterial', 'matchingLogic'))
+                        if (res.result.creativeCategory) {
+                            // let arr=[];
+                            if (res.result.creativeCategory > 10000) {
+                                res.result.creativeCategory = res.result.creativeCategory
+                                    ? [
+                                          parseInt(res.result.creativeCategory / 10000),
+                                          parseInt(res.result.creativeCategory / 100),
+                                          res.result.creativeCategory
+                                      ]
+                                    : []
+                            } else if (res.result.creativeCategory > 100) {
+                                res.result.creativeCategory = res.result.creativeCategory
+                                    ? [parseInt(res.result.creativeCategory / 100), res.result.creativeCategory]
+                                    : []
+                            } else {
+                                res.result.creativeCategory = res.result.creativeCategory
+                                    ? [res.result.creativeCategory]
+                                    : []
+                            }
+                        }
+                        res.result.creativeTag = res.result.creativeTag ? JSON.parse(res.result.creativeTag) : []
+                        this.descriptionList =
+                            res.result.description.charAt(0) === '['
+                                ? eval(res.result.description).map(item => {
+                                      return { value: item }
+                                  })
+                                : [{ value: res.result.description }]
+                        res.result.sceneId = JSON.parse(res.result.sceneId)
+                        data.actionBarText = data.actionBarText.split(',')
+                        this.showCreativeData = pick(
+                            data,
+                            'unitType',
+                            'sceneId',
+                            'imageCnt',
+                            'customUnitCnt',
+                            'programUnitCnt',
+                            'channelType',
+                            'assetMining',
+                            'smartCover',
+                            'actionBarText',
+                            'creativeCategory',
+                            'creativeTag'
+                        )
+                        // this.appDetail = { platformOs: data.platformOs, singleAppid: 1 }
+                        this.postDataAction('/kuaishouAppPackage/getAppsDetail', {
+                            apptemIds: JSON.parse(data.appIdArray)
+                        }).then(result => {
+                            if (result.success) {
+                                this.multipleBidData = result.result
+                                this.appDetail = {
+                                    platformOs: result.result[0].platform < 3 ? 1 : 2,
+                                    singleAppid: 1,
+                                    appId: { key: result.result[0].apptemId },
+                                    schemaUri: res.result.schemaUri
+                                }
+                            }
+                        })
+                        this.checkPerson = JSON.parse(data.templateIdArray)
+                        this.checkPersonAll = [JSON.parse(data.templateIdArray)]
+                        this.postDataAction('/kuaishouDirectionalPackage/getProjectTargetByIds', {
+                            ids: this.checkPerson
+                        }).then(res => {
+                            if (res.success) {
+                                this.showCheckPerson = res.result.map(item => {
+                                    return {
+                                        ...item,
+                                        regionName: []
+                                    }
+                                })
+
+                                for (let i = 0; i < this.showCheckPerson.length; i++) {
+                                    if (
+                                        this.showCheckPerson[i] &&
+                                        (this.showCheckPerson[i].region == '' ||
+                                            this.showCheckPerson[i].region == null ||
+                                            JSON.parse(this.showCheckPerson[i].region).length == 0)
+                                    ) {
+                                    } else {
+                                        // this.showRegion(this.personList[i].region, this.personList[i].regionName)
+                                        let that = this
+                                        new Promise((resolve, reject) => {
+                                            this.postDataAction('/kuaishou/batch/getRegionDetail', {
+                                                regionArr: that.showCheckPerson[i].region
+                                            }).then(res => {
+                                                if (res.success) {
+                                                    //   this.populationData.allForm.region = res.result
+                                                    that.showCheckPerson[i].regionName = res.result.map(item => {
+                                                        return item.label
+                                                    })
+                                                }
+                                            })
+                                        })
+                                    }
+                                }
+                            }
+                        })
+                    })
+                }
+            })
+        },
+        handleSubmit() {
+            let formProjectData = new Promise((resolve, reject) => {
+                this.formProject.validateFields((err, values) => {
+                    if (!err) {
+                        if (this.projectId) {
+                            resolve({ ...values, projectId: this.projectId })
+                        }
+                    } else {
+                        reject('选择项目表单出错')
+                    }
+                })
+            })
+            let formInformationData = new Promise((resolve, reject) => {
+                this.formInformation.validateFields((err, values) => {
+                    if (!err) {
+                        resolve({ ...values })
+                    } else {
+                        reject('基本信息出错')
+                    }
+                })
+            })
+            let formOptimizeData = new Promise((resolve, reject) => {
+                this.formOptimize.validateFields((err, values) => {
+                    console.log(values, err)
+                    if (!err) {
+                        resolve({ ...values })
+                    } else {
+                        reject('优化目标出错')
+                    }
+                })
+            })
+            let formMaterialData = new Promise((resolve, reject) => {
+                this.formMaterial.validateFields((err, values) => {
+                    if (!err) {
+                        resolve({ ...values })
+                    } else {
+                        reject('出错')
+                    }
+                })
+            })
+            Promise.all([formProjectData, formInformationData, formOptimizeData, formMaterialData])
+                .then(res => {
+                    if (!this.showCreativeData || this.checkPerson.length === 0 || this.multipleBidData.length === 0) {
+                        this.$message.error('请填写完整')
+                        return
+                    }
+                    this.sumbitLoading = true
+                    let params = { ...res[0], ...res[1], ...res[2], ...res[3], ...this.showCreativeData }
+                    if (this.budgetType === '2') {
+                        params.campaignDayBudget = params.campaignDayBudget * 1000
+                    } else {
+                        params.campaignDayBudget = 0
+                    }
+                    if (this.dayBudgetType === '2') {
+                        params.unitDayBudget = params.unitDayBudget * 1000
+                    } else {
+                        params.unitDayBudget = 0
+                    }
+                    if (params.cpaBid) {
+                        if ((params.cpaBid + '').includes('/')) {
+                            let bidArr = params.cpaBid.split('/')
+                            for (let index = 0; index < bidArr.length; index++) {
+                                bidArr[index] = bidArr[index] * 1000
+                            }
+                            params.cpaBid = bidArr.join('/')
+                        } else if ((params.cpaBid + '').includes('-')) {
+                            let bidArr = params.cpaBid.split('-')
+                            for (let index = 0; index < bidArr.length; index++) {
+                                bidArr[index] = bidArr[index] * 1000
+                            }
+                            params.cpaBid = bidArr.join('-')
+                        } else {
+                            params.cpaBid = params.cpaBid * 1000
+                        }
+                    } else {
+                        params.cpaBid = 0
+                    }
+                    if (params.deepConversionBid && params.deepConversionBid != 0) {
+                        if ((params.deepConversionBid + '').includes('/')) {
+                            let bidArr = params.deepConversionBid.split('/')
+                            for (let index = 0; index < bidArr.length; index++) {
+                                bidArr[index] = bidArr[index] * 1000
+                            }
+                            params.deepConversionBid = bidArr.join('/')
+                        } else if ((params.deepConversionBid + '').includes('-')) {
+                            let bidArr = params.deepConversionBid.split('-')
+                            for (let index = 0; index < bidArr.length; index++) {
+                                bidArr[index] = bidArr[index] * 1000
+                            }
+                            params.deepConversionBid = bidArr.join('-')
+                        } else {
+                            params.deepConversionBid = params.deepConversionBid * 1000
+                        }
+                    } else {
+                        params.deepConversionBid = 0
+                    }
+                    if (params.creativeCategory && params.creativeCategory.length > 0) {
+                        params.creativeCategory = params.creativeCategory[params.creativeCategory.length - 1]
+                    } else {
+                        params.creativeCategory = undefined
+                    }
+                    params.creativeTag = params.creativeTag ? JSON.stringify(params.creativeTag) : undefined
+                    params.appIdArray = this.multipleBidData.map(res => {
+                        return res.apptemId
+                    })
+                    params.templateIdArray = this.checkPerson
+                    params.description = JSON.stringify(
+                        this.descriptionList.map(item => {
+                            return item.value
+                        })
+                    )
+                    params.singleAppid = 1
+                    params.actionBarText = params.actionBarText.join()
+                    if (this.$route.query.id) {
+                        params.id = this.$route.query.id
+                    }
+                    this.postDataAction('/kuaishouProjectStrategy/createProjectStrategy', params).then(res => {
+                        if (res.success) {
+                            this.sumbitLoading = false
+                            window.close()
+                        }
+                    })
+                })
+                .catch(err => {
+                    this.$message.error('请填写完整')
+                })
+        },
+        clearAllData() {
+            window.close()
+        },
         descriptionchange(val, index) {
         descriptionchange(val, index) {
             let data = val
             let data = val
             this.$nextTick(() => {
             this.$nextTick(() => {
@@ -2305,15 +2723,22 @@ export default {
         },
         },
         closeCreative() {
         closeCreative() {
             this.optimizeVisible = false
             this.optimizeVisible = false
+            this.customUnitCntMax = 400
+            this.imageCntMax = 15
             this.formOriginality.resetFields()
             this.formOriginality.resetFields()
         },
         },
         submitCreative() {
         submitCreative() {
             this.formOriginality.validateFields((err, values) => {
             this.formOriginality.validateFields((err, values) => {
-                if(!err) {
-
-                   
+                if (!err) {
+                    let isNotComplete = this.descriptionList.findIndex(item => {
+                        return item.value === ''
+                    })
+                    if (isNotComplete > -1) {
+                        this.$message.error('请正确填写必填项目,广告语未填')
+                        return
+                    }
                     this.showCreativeData = JSON.parse(JSON.stringify(values))
                     this.showCreativeData = JSON.parse(JSON.stringify(values))
-                     console.log(values,this.showCreativeData)
+                    console.log(values, this.showCreativeData)
                     this.optimizeVisible = false
                     this.optimizeVisible = false
                     // this.closeCreative()
                     // this.closeCreative()
                 }
                 }
@@ -2338,6 +2763,14 @@ export default {
                 data.splice(0, data.length - 1)
                 data.splice(0, data.length - 1)
             }
             }
         },
         },
+        unitTypeCheck(e) {
+            console.log(e.target.value)
+            if (e.target.value === 1) {
+                this.imageCntMax = 8
+            } else {
+                this.imageCntMax = 15
+            }
+        },
         setImageCnt(e) {
         setImageCnt(e) {
             this.customUnitCntMax = e ? Math.floor(2000 / e) : 2000
             this.customUnitCntMax = e ? Math.floor(2000 / e) : 2000
         },
         },
@@ -2357,7 +2790,7 @@ export default {
             let z = /-/g
             let z = /-/g
             let a = /\//g
             let a = /\//g
             let d = /\./g
             let d = /\./g
-            if (value === '' || value === undefined) {
+            if (value === '' || value === undefined || value === 0 || value === '0') {
                 callback('出价必须填写')
                 callback('出价必须填写')
             } else if (value.startsWith('.') || value.endsWith('.')) {
             } else if (value.startsWith('.') || value.endsWith('.')) {
                 callback('请填写正确出价')
                 callback('请填写正确出价')
@@ -2375,16 +2808,12 @@ export default {
             let z = /-/g
             let z = /-/g
             let a = /\//g
             let a = /\//g
             let d = /\./g
             let d = /\./g
-            if (value === '' || value === undefined) {
+            if (value === '' || value === undefined || value == 0 || value == '0') {
                 callback()
                 callback()
-
-                return
             } else if (value.startsWith('.') || value.endsWith('.')) {
             } else if (value.startsWith('.') || value.endsWith('.')) {
                 callback('请填写正确出价')
                 callback('请填写正确出价')
-                return
             } else if (value.startsWith('-') || value.endsWith('-')) {
             } else if (value.startsWith('-') || value.endsWith('-')) {
                 callback('请填写正确出价')
                 callback('请填写正确出价')
-                return
             } else if (value.match(a) && value.match(z)) {
             } else if (value.match(a) && value.match(z)) {
                 callback('不允许出现除"-"和"/"之外的所有字符,并且二者不可同时出现')
                 callback('不允许出现除"-"和"/"之外的所有字符,并且二者不可同时出现')
             } else if (value.match(/[^0-9+-\/]/g)) {
             } else if (value.match(/[^0-9+-\/]/g)) {
@@ -2472,13 +2901,18 @@ export default {
         //目标应用编辑
         //目标应用编辑
         targetAppEdit() {
         targetAppEdit() {
             this.targetAppVisible = true
             this.targetAppVisible = true
-            this.getAppList()
+
             if (this.appDetail) {
             if (this.appDetail) {
+                if (this.appDetail.schemaUri) {
+                    this.uriCheck = true
+                }
                 this.$nextTick(() => {
                 this.$nextTick(() => {
                     this.formTargetApp.setFieldsValue({ ...this.appDetail })
                     this.formTargetApp.setFieldsValue({ ...this.appDetail })
+
                     this.multipleBidDataDrawer = JSON.parse(JSON.stringify(this.multipleBidData))
                     this.multipleBidDataDrawer = JSON.parse(JSON.stringify(this.multipleBidData))
                 })
                 })
             }
             }
+            this.getAppList()
         },
         },
         submitApp() {
         submitApp() {
             this.formTargetApp.validateFields((err, values) => {
             this.formTargetApp.validateFields((err, values) => {
@@ -2502,6 +2936,7 @@ export default {
         appIdChange(val) {
         appIdChange(val) {
             // this.siteList = []
             // this.siteList = []
             // this.getPageList(val)
             // this.getPageList(val)
+            this.multipleBidDataDrawer = []
             if (this.getFormData('formTargetApp', 'singleAppid') == 0) {
             if (this.getFormData('formTargetApp', 'singleAppid') == 0) {
                 if (val && val.findIndex(item => item.key === 0) > -1) {
                 if (val && val.findIndex(item => item.key === 0) > -1) {
                     let appidArr = this.appList.map(item => {
                     let appidArr = this.appList.map(item => {
@@ -2558,7 +2993,7 @@ export default {
                         // this.multipleBidDataDrawer = this.appList.filter(item => {
                         // this.multipleBidDataDrawer = this.appList.filter(item => {
                         //     return item.id === val.key
                         //     return item.id === val.key
                         // })
                         // })
-                        this.postDataAction('/kuaishouAppPackage/getAppsDetail', { ids: [val.key] }).then(res => {
+                        this.postDataAction('/kuaishouAppPackage/getAppsDetail', { apptemIds: [val.key] }).then(res => {
                             if (res.success) {
                             if (res.success) {
                                 this.multipleBidDataDrawer = res.result
                                 this.multipleBidDataDrawer = res.result
                             }
                             }
@@ -2575,9 +3010,37 @@ export default {
             if (target) {
             if (target) {
                 target[dataIndex] = value
                 target[dataIndex] = value
                 this.multipleBidDataDrawer = dataSource
                 this.multipleBidDataDrawer = dataSource
+                let params = { id: key }
+                if (dataIndex == 'impressionUrl') {
+                    params.impressionUrl = value
+                } else if (dataIndex == 'tracUrl') {
+                    params.tracUrl = value
+                }
+                this.postDataAction('/kuaishouAppPackage/edit', params).then(res => {
+                    if (res.success) {
+                        console.log(res)
+                    }
+                })
             }
             }
         },
         },
         addApplication() {},
         addApplication() {},
+        changeType(e) {
+            console.log(e.target.value)
+            this.appList = []
+            if (e.target.value === 1) {
+                this.appList = this.appListAll.filter(item => {
+                    return item.platform == 1 || item.platform == 2
+                })
+                this.formTargetApp.setFieldsValue({ appId: undefined })
+                this.multipleBidDataDrawer = []
+            } else if (e.target.value === 2) {
+                this.appList = this.appListAll.filter(item => {
+                    return item.platform == 3 || item.platform == 4
+                })
+                this.formTargetApp.setFieldsValue({ appId: undefined })
+                this.multipleBidDataDrawer = []
+            }
+        },
         getAppList() {
         getAppList() {
             let params = {}
             let params = {}
             params.projectId = this.projectId
             params.projectId = this.projectId
@@ -2605,6 +3068,8 @@ export default {
         //目标人群选择
         //目标人群选择
         targetPersonCheck() {
         targetPersonCheck() {
             this.checkPerson = this.checkPersonAll[0]
             this.checkPerson = this.checkPersonAll[0]
+            this.ipagination.current = 1
+            this.sumContent = this.showCheckPerson.length
             this.targetPersonVisible = true
             this.targetPersonVisible = true
             this.getTargetPerson()
             this.getTargetPerson()
         },
         },
@@ -2654,14 +3119,15 @@ export default {
                 })
                 })
             } else if (this.checkPerson.length > 20) {
             } else if (this.checkPerson.length > 20) {
                 this.personLoading = false
                 this.personLoading = false
-                this.$message.error('最多选择20个定向')
+                this.$message.error('最多选择20个定向')
             } else {
             } else {
                 this.personLoading = false
                 this.personLoading = false
-                this.$message.error('请选择定向')
+                this.$message.error('请选择定向')
             }
             }
         },
         },
         closePerson(form) {
         closePerson(form) {
             this.targetPersonVisible = false
             this.targetPersonVisible = false
+            this.checkPerson = []
         },
         },
         getTargetPerson() {
         getTargetPerson() {
             let params = {}
             let params = {}
@@ -2738,6 +3204,14 @@ export default {
                     }
                     }
                 }
                 }
             )
             )
+            this.$nextTick(() => {
+                if (this.showCreativeData.unitType === 1) {
+                    this.imageCntMax = 8
+                } else {
+                    this.imageCntMax = 15
+                }
+                this.formOriginality.setFieldsValue(this.showCreativeData)
+            })
         },
         },
         //设置通配符
         //设置通配符
         getChangeAll(type, form, field) {
         getChangeAll(type, form, field) {
@@ -2920,6 +3394,4 @@ $height: 59px;
     height: $height;
     height: $height;
     line-height: $height;
     line-height: $height;
 }
 }
-
-/* update_end author:scott date:20190220 for: 缩小首页布局顶部的高度*/
 </style>
 </style>

+ 142 - 29
src/views/modules/autoLaunch/configProject/index.vue

@@ -181,13 +181,14 @@
                 <a-form layout="inline" :form="form" hide-required-mark :selfUpdate="true" @submit="handleQueryList">
                 <a-form layout="inline" :form="form" hide-required-mark :selfUpdate="true" @submit="handleQueryList">
                     <a-row :gutter="24" v-if="tabKey === 1">
                     <a-row :gutter="24" v-if="tabKey === 1">
                         <a-col :md="8" :sm="8" :xxl="6">
                         <a-col :md="8" :sm="8" :xxl="6">
-                            <a-form-item label="项目名称">
+                            <!-- <a-form-item label="项目名称">
                                 <a-input
                                 <a-input
                                     v-decorator="['projectName']"
                                     v-decorator="['projectName']"
                                     type="text"
                                     type="text"
                                     placeholder="请输入需要搜索的项目名称"
                                     placeholder="请输入需要搜索的项目名称"
                                 />
                                 />
-                            </a-form-item>
+                            </a-form-item> -->
+                            <selectTable :projectId.sync="projectIdAll" ref="selectTable"></selectTable>
                         </a-col>
                         </a-col>
 
 
                         <a-col :md="8" :sm="8" :xxl="6">
                         <a-col :md="8" :sm="8" :xxl="6">
@@ -215,14 +216,30 @@
                                 <a-range-picker
                                 <a-range-picker
                                     :disabled-date="disabledDate"
                                     :disabled-date="disabledDate"
                                     format="YYYY-MM-DD"
                                     format="YYYY-MM-DD"
-                                    v-decorator="[
-                                        'timeRange',
-                                        { initialValue: [moment().subtract(6, 'months'), moment()] }
-                                    ]"
+                                    v-decorator="['timeRange', { initialValue: [moment(), moment()] }]"
                                 />
                                 />
                             </a-form-item>
                             </a-form-item>
                         </a-col>
                         </a-col>
                         <a-col :md="8" :sm="8" :xxl="6">
                         <a-col :md="8" :sm="8" :xxl="6">
+                            <a-form-item label="状态">
+                                <a-select
+                                    v-decorator="['dataStatus', { initialValue: 'null' }]"
+                                    placeholder="请选择"
+                                    allow-clear
+                                >
+                                    <a-select-option key="null">
+                                        不限
+                                    </a-select-option>
+                                    <a-select-option :key="1">
+                                        启动
+                                    </a-select-option>
+                                    <a-select-option :key="0">
+                                        关闭
+                                    </a-select-option>
+                                </a-select>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :md="8" :sm="8" :xxl="6">
                             <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
                             <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" icon="search" @click="handleQueryList">查询</a-button>
                                 <a-button type="primary" @click="handleResetForm" icon="reload" class="middle-button"
                                 <a-button type="primary" @click="handleResetForm" icon="reload" class="middle-button"
@@ -252,10 +269,7 @@
                                 <a-range-picker
                                 <a-range-picker
                                     :disabled-date="disabledDate"
                                     :disabled-date="disabledDate"
                                     format="YYYY-MM-DD"
                                     format="YYYY-MM-DD"
-                                    v-decorator="[
-                                        'timeRange',
-                                        { initialValue: [moment().subtract(6, 'months'), moment()] }
-                                    ]"
+                                    v-decorator="['timeRange', { initialValue: [moment(), moment()] }]"
                                 />
                                 />
                             </a-form-item>
                             </a-form-item>
                         </a-col>
                         </a-col>
@@ -290,12 +304,21 @@
                     >
                     >
                         <span slot="dataStatus" slot-scope="text, record">
                         <span slot="dataStatus" slot-scope="text, record">
                             <a-switch
                             <a-switch
-                                :checked="text == 0"
-                                @change="onChangeStatus(text, record)"
+                                :checked="text == 1"
+                                @change="onChangeStatus(text, record, 'dataStatus')"
                                 :loading="spinning"
                                 :loading="spinning"
                                 v-if="record.projectName !== '-'"
                                 v-if="record.projectName !== '-'"
                             />
                             />
                         </span>
                         </span>
+                        <span slot="projectStrategy" slot-scope="text, record">
+                            <a-switch
+                                :checked="text == 1"
+                                @change="onChangeStatus(text, record, 'projectStrategy')"
+                                :loading="spinning"
+                                v-if="record.projectName !== '-'"
+                            />
+                        </span>
+
                         <span slot="statDate" slot-scope="text, record">
                         <span slot="statDate" slot-scope="text, record">
                             {{ record.projectName !== '-' ? text : '-' }}
                             {{ record.projectName !== '-' ? text : '-' }}
                         </span>
                         </span>
@@ -310,7 +333,7 @@
                             <div v-if="record.projectName !== '-'">
                             <div v-if="record.projectName !== '-'">
                                 <a @click="editPrice(record)">出价</a>
                                 <a @click="editPrice(record)">出价</a>
                                 <a-divider type="vertical" />
                                 <a-divider type="vertical" />
-                                <a>编辑</a>
+                                <a @click="newCreat(record.id)">编辑</a>
                                 <a-divider type="vertical" />
                                 <a-divider type="vertical" />
                                 <a @click="matchingAccount(record)">匹配</a>
                                 <a @click="matchingAccount(record)">匹配</a>
                             </div>
                             </div>
@@ -412,6 +435,9 @@
                 size="middle"
                 size="middle"
                 style="word-break: break-all;font-size:16px;font-weight:600"
                 style="word-break: break-all;font-size:16px;font-weight:600"
             >
             >
+                <span slot="authStatus" slot-scope="text">
+                    {{ text === 0 ? '失败' : '成功' }}
+                </span>
             </a-table>
             </a-table>
         </a-modal>
         </a-modal>
     </div>
     </div>
@@ -558,10 +584,10 @@ let TTcolumns = [
 let KScolumns = [
 let KScolumns = [
     {
     {
         title: '开关',
         title: '开关',
-        dataIndex: 'dataStatus',
-        scopedSlots: { customRender: 'dataStatus' },
+        dataIndex: 'projectStrategy',
+        scopedSlots: { customRender: 'projectStrategy' },
         align: 'center',
         align: 'center',
-        key: 'dataStatus'
+        key: 'projectStrategy'
     },
     },
     {
     {
         title: '账户名称',
         title: '账户名称',
@@ -585,6 +611,15 @@ let KScolumns = [
         align: 'center',
         align: 'center',
         key: 'projectName'
         key: 'projectName'
     },
     },
+
+    {
+        title: '开始投放日期',
+        dataIndex: 'statDate',
+        scopedSlots: { customRender: 'statDate' },
+        align: 'center',
+        key: 'statDate',
+        sorter: () => {}
+    },
     {
     {
         title: '消耗',
         title: '消耗',
         dataIndex: 'charge',
         dataIndex: 'charge',
@@ -676,6 +711,7 @@ export default {
 
 
     data() {
     data() {
         return {
         return {
+            indexAll: 0,
             spinning: false,
             spinning: false,
             form: this.$form.createForm(this),
             form: this.$form.createForm(this),
             priceForm: this.$form.createForm(this),
             priceForm: this.$form.createForm(this),
@@ -747,9 +783,10 @@ export default {
 
 
             openOptions: false,
             openOptions: false,
 
 
-            target: 'charge',
+            target: 'createTime',
             order: 'descend',
             order: 'descend',
             projectId: undefined,
             projectId: undefined,
+            projectIdAll: undefined,
             dataLoading: false,
             dataLoading: false,
             url: '/kuaishouProjectStrategy/queryProjectList',
             url: '/kuaishouProjectStrategy/queryProjectList',
             modifyPriceVisible: false,
             modifyPriceVisible: false,
@@ -775,10 +812,16 @@ export default {
                 },
                 },
                 {
                 {
                     title: '失败原因',
                     title: '失败原因',
-                    dataIndex: 'dataStatus',
-                    scopedSlots: { customRender: 'dataStatus' },
+                    dataIndex: 'resultText',
+                    customRender(t) {
+                        if (t === 'success') {
+                            return '-'
+                        } else {
+                            return t
+                        }
+                    },
                     align: 'center',
                     align: 'center',
-                    key: 'dataStatus'
+                    key: 'resultText'
                 }
                 }
             ]
             ]
         }
         }
@@ -947,11 +990,13 @@ export default {
         matchingAccount(item) {
         matchingAccount(item) {
             this.accountVisible = true
             this.accountVisible = true
             this.accountProjectDetail = { id: item.id, projectName: item.projectName }
             this.accountProjectDetail = { id: item.id, projectName: item.projectName }
-            getAction('/kuaishouProjectStrategy/queryMatchResult', { id: item.id }).then(res => {
-                if (res.success) {
-                    this.accountProjectList = res.result
+            getAction('/kuaishouProjectStrategy/queryMatchResult', { projectId: item.projectId, pageSize: 100 }).then(
+                res => {
+                    if (res.success) {
+                        this.accountProjectList = res.result.list
+                    }
                 }
                 }
-            })
+            )
         },
         },
         getDataSource(current, pageSize) {
         getDataSource(current, pageSize) {
             // 切换分页时的回调,
             // 切换分页时的回调,
@@ -961,7 +1006,68 @@ export default {
             const paramsData = this.form.getFieldsValue()
             const paramsData = this.form.getFieldsValue()
             this.handleGetTableList(paramsData)
             this.handleGetTableList(paramsData)
         },
         },
-        onChangeStatus(text, rescord) {},
+        onChangeStatus(text, rescord, type) {
+            let status = text === 0 ? 1 : 0
+            let url = ''
+            let params = {}
+            if (status === 0) {
+                if (type === 'dataStatus') {
+                    params.id = rescord.id
+                    params.dataStatus = status
+                    url = '/kuaishouProjectStrategy/updateProjectStrategy'
+                } else if (type === 'projectStrategy') {
+                    params.accountId = rescord.accountId
+                    params.projectStrategy = status
+                    url = '/kuaishouProjectStrategy/updateAccountStatus'
+                }
+                this.postDataAction(url, params).then(res => {
+                    if (res.success) {
+                        const paramsData = this.form.getFieldsValue()
+                        this.handleGetTableList(paramsData)
+                    } else {
+                        this.$message.error(res.message)
+                    }
+                })
+            } else {
+                if (type === 'dataStatus') {
+                    this.getAction('/kuaishouProjectStrategy/checkProjectisOpen', {
+                        projectId: rescord.projectId
+                    }).then(res => {
+                        console.log(res)
+                        if (res.success) {
+                            if (res.result === 1) {
+                                params.id = rescord.id
+                                params.dataStatus = status
+                                url = '/kuaishouProjectStrategy/updateProjectStrategy'
+                                this.postDataAction(url, params).then(res => {
+                                    if (res.success) {
+                                        const paramsData = this.form.getFieldsValue()
+                                        this.handleGetTableList(paramsData)
+                                    } else {
+                                        this.$message.error(res.message)
+                                    }
+                                })
+                            } else {
+                                this.$message.error('此项目有开启的配置,无法开启')
+                                return
+                            }
+                        }
+                    })
+                } else if (type === 'projectStrategy') {
+                    params.accountId = rescord.accountId
+                    params.projectStrategy = status
+                    url = '/kuaishouProjectStrategy/updateAccountStatus'
+                    this.postDataAction(url, params).then(res => {
+                        if (res.success) {
+                            const paramsData = this.form.getFieldsValue()
+                            this.handleGetTableList(paramsData)
+                        } else {
+                            this.$message.error(res.message)
+                        }
+                    })
+                }
+            }
+        },
         handleQueryList(event) {
         handleQueryList(event) {
             this.ipagination.current = 1
             this.ipagination.current = 1
             event.preventDefault()
             event.preventDefault()
@@ -973,18 +1079,18 @@ export default {
             this.form.resetFields()
             this.form.resetFields()
             if (this.tabKey == 1) {
             if (this.tabKey == 1) {
                 this.projectId = undefined
                 this.projectId = undefined
+                this.$refs.selectTable.keyValue = undefined
+                this.$refs.selectTable.getData()
+                this.projectIdAll = undefined
             }
             }
-
             const paramsData = this.form.getFieldsValue()
             const paramsData = this.form.getFieldsValue()
             this.handleGetTableList(paramsData)
             this.handleGetTableList(paramsData)
-            this.$refs.selectTable.keyValue = ''
-            this.$refs.selectTable.getData()
         },
         },
         handleGetTableList(data) {
         handleGetTableList(data) {
             let paramsData = {
             let paramsData = {
                 projectName: data.projectName,
                 projectName: data.projectName,
                 authName: data.authName,
                 authName: data.authName,
-                projectId: this.projectId ? this.projectId.id : null,
+                dataStatus: data.dataStatus == 'null' ? null : data.dataStatus,
                 userId: data.userId,
                 userId: data.userId,
                 startTime:
                 startTime:
                     data.timeRange && data.timeRange.length === 2
                     data.timeRange && data.timeRange.length === 2
@@ -1008,6 +1114,11 @@ export default {
                 paramsData.sortCode = this.target
                 paramsData.sortCode = this.target
                 paramsData.sortType = this.order == 'descend' ? 'DESC' : 'ASC'
                 paramsData.sortType = this.order == 'descend' ? 'DESC' : 'ASC'
             }
             }
+            if (this.tabKey === 1) {
+                paramsData.projectId = this.projectIdAll
+            } else {
+                paramsData.projectId = this.projectId ? this.projectId.id : null
+            }
             this.dataSource = []
             this.dataSource = []
             this.dataLoading = true
             this.dataLoading = true
             postAction(this.url, paramsData)
             postAction(this.url, paramsData)
@@ -1044,6 +1155,7 @@ export default {
                     : '/kuaishouProjectStrategy/queryAccountList'
                     : '/kuaishouProjectStrategy/queryAccountList'
             this.$nextTick(() => {
             this.$nextTick(() => {
                 this.columns = this.tabKey == 1 ? [...TTcolumns] : [...KScolumns]
                 this.columns = this.tabKey == 1 ? [...TTcolumns] : [...KScolumns]
+                this.target = this.tabKey == 1 ? 'createTime' : 'statDate'
                 const paramsData = this.form.getFieldsValue()
                 const paramsData = this.form.getFieldsValue()
                 this.handleGetTableList(paramsData)
                 this.handleGetTableList(paramsData)
             })
             })
@@ -1069,6 +1181,7 @@ export default {
                 this.tabKey == 1
                 this.tabKey == 1
                     ? '/kuaishouProjectStrategy/queryProjectList'
                     ? '/kuaishouProjectStrategy/queryProjectList'
                     : '/kuaishouProjectStrategy/queryAccountList'
                     : '/kuaishouProjectStrategy/queryAccountList'
+            this.target = this.tabKey == 1 ? 'createTime' : 'statDate'
             this.projectId = undefined
             this.projectId = undefined
             const paramsData = this.form.getFieldsValue()
             const paramsData = this.form.getFieldsValue()
             this.handleGetTableList(paramsData)
             this.handleGetTableList(paramsData)

+ 1 - 1
src/views/user/Login.vue

@@ -441,7 +441,7 @@ export default {
     loginSuccess() {
     loginSuccess() {
       this.loginBtn = false
       this.loginBtn = false
       this.$router.push({
       this.$router.push({
-        name: 'dashboard',
+        path: '/dashboard/analysis',
       })
       })
       this.$notification.success({
       this.$notification.success({
         message: '欢迎',
         message: '欢迎',

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