12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673 |
- <style lang="scss" scoped>
- .search-bar {
- display: flex;
- align-items: center;
- }
- .search-box p {
- display: inline-block;
- border: 1px solid #f2f2f2;
- border-radius: 5px;
- margin-right: 10px;
- padding: 5px 10px;
- cursor: pointer;
- }
- .card-person-drawer {
- width: 100%;
- height: 90%;
- overflow: hidden;
- padding: 10px 0px;
- display: flex;
- flex-wrap: wrap;
- margin-right: -10px;
- justify-content: space-between;
- ::v-deep .ant-card-body {
- padding: 0;
- }
- ::v-deep .ant-card-head {
- padding: 0 5px;
- }
- .card-item {
- width: calc(25% - 10px);
- margin-bottom: 10px;
- float: left;
- }
- .card-item-else {
- width: calc(20% - 10px);
- margin-bottom: 10px;
- float: left;
- }
- }
- </style>
- <style scoped>
- .showNumBox {
- margin: 10px 0;
- }
- .showNumBox .ant-card-body {
- display: flex;
- justify-content: center;
- }
- .showNumBox p,
- .showNumBox span {
- text-align: center;
- line-height: 40px;
- font-size: 30px;
- font-weight: 600;
- color: red;
- margin: 0;
- }
- .search-box .ant-card-body {
- padding: 5px 15px;
- }
- .showNumBox .ant-card-body .styleElse {
- line-height: 60px;
- height: 40px;
- font-size: 16px;
- font-weight: 400;
- margin-left: 10px;
- }
- .ant-modal-wrap .yincang .ant-modal-content .ant-modal-footer {
- display: none !important;
- }
- .yincang .ant-col-6 p {
- text-align: left;
- color: red;
- font-size: 16px;
- font-weight: 500;
- }
- .ant-table-thead div {
- font-weight: 700;
- }
- .tool-tip {
- position: absolute;
- top: 65px;
- right: 10px;
- }
- </style>
- <style lang="less" scoped>
- .ant-card-head .ant-tabs-bar {
- padding: 0;
- }
- .search-box .ant-card-body {
- padding: 5px 15px;
- }
- .search-box {
- padding: 15px 10px;
- }
- .search-box p {
- display: inline-block;
- border: 1px solid #f2f2f2;
- border-radius: 5px;
- margin-right: 10px;
- padding: 5px 10px;
- cursor: pointer;
- }
- .statistics .ant-col-6 .ant-card-body .styleElse {
- line-height: 60px;
- height: 40px;
- font-size: 16px;
- font-weight: 400;
- margin-left: 10px;
- }
- .ant-modal-wrap .yincang .ant-modal-content .ant-modal-footer {
- display: none !important;
- }
- .yincang .ant-col-6 p {
- text-align: left;
- color: red;
- font-size: 16px;
- font-weight: 500;
- }
- .ant-table-thead div {
- font-weight: 700;
- }
- .tool-tip {
- position: absolute;
- top: 65px;
- right: 10px;
- }
- .statistics {
- .ant-card-bordered {
- border: none;
- }
- .ant-card-head .ant-tabs {
- clear: both;
- margin-bottom: -13px;
- color: rgba(0, 0, 0, 0.65);
- font-weight: normal;
- font-size: 14px;
- }
- .duibi {
- position: absolute;
- right: 24px;
- top: 15px;
- }
- p {
- margin-bottom: 0;
- }
- }
- </style>
- <style lang="less" scoped>
- .middle-button {
- margin: 0 8px;
- }
- .newPlanStatic {
- .divider {
- height: 62px;
- }
- .showNumBox {
- background: white;
- overflow: hidden;
- margin: 15px 0;
- padding: 30px 0;
- text-align: center;
- .ant-card-body {
- padding-top: 0;
- }
- .title {
- font-size: 14px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #999999;
- line-height: 22px;
- display: inline-block;
- }
- }
- .tabbody {
- background: white;
- padding: 0 24px;
- margin-bottom: 15px;
- .ant-tabs-bar {
- margin: 0;
- }
- }
- .chartBox {
- background: white;
- padding: 20px 0;
- }
- .tableBody {
- background: white;
- padding: 20px;
- }
- }
- </style>
- <template>
- <div class="newPlanStatic config-project">
- <div class="tabbody">
- <a-tabs v-model="tabKey" @change="tabChange">
- <a-tab-pane :key="1" tab="素材测试配置信息"> </a-tab-pane>
- <!-- <a-tab-pane :key="2" tab="账户"> </a-tab-pane> -->
- <a-button slot="tabBarExtraContent" type="primary" @click="newCreat(null)">
- 创建投放策略
- </a-button>
- </a-tabs>
- </div>
- <a-card>
- <div class="table-page-search-wrapper">
- <a-form layout="inline" :form="form" hide-required-mark :selfUpdate="true" @submit="handleQueryList">
- <a-row :gutter="24" v-if="tabKey === 1">
- <a-col :md="8" :sm="8" :xxl="6">
- <a-form-item label="策略名称">
- <a-input
- v-decorator="['strategyName']"
- type="text"
- placeholder="请输入需要搜索的策略名称"
- />
- </a-form-item>
- </a-col>
- <!-- -->
- <a-col :md="8" :sm="8" :xxl="6">
- <a-form-item label="数据周期">
- <a-range-picker
- :disabled-date="disabledDate"
- format="YYYY-MM-DD"
- v-decorator="['timeRange', { initialValue: [moment(), moment()] }]"
- />
- </a-form-item>
- </a-col>
- <a-col :md="8" :sm="8" :xxl="6">
- <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
- <a-button type="primary" icon="search" @click="handleQueryList">查询</a-button>
- <a-button type="primary" @click="handleResetForm" icon="reload" class="middle-button"
- >重置</a-button
- >
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- </a-card>
- <a-row style="margin-bottom:15px;margin-top:12px">
- <a-col :span="24">
- <div class="tableBody" style="min-height:200px;padding-bottom: 50px">
- <a-table
- :columns="columns"
- :dataSource="dataSource"
- :pagination="false"
- :loading="dataLoading"
- bordered
- @change="tableChange"
- :scroll="{ x: 2500 }"
- size="middle"
- style="word-break: break-all;font-size:16px;font-weight:600"
- id="outTable"
- ref="accountTable"
- >
- <span slot="strategyStatus" slot-scope="text, record">
- <a-switch :checked="text == 0" @change="onChangeStatus(text, record, 'strategyStatus')" />
- </span>
- <span slot="statDate" slot-scope="text, record">
- {{ record.projectName !== '-' ? text : '-' }}
- </span>
- <span slot="projectName" slot-scope="text, record">
- <a @click="toAccountDetail(record)" v-if="tabKey === 1 && text !== '-'">{{ text }}</a>
- <span v-else> {{ text }} </span>
- </span>
- <span slot="allAccountCount" slot-scope="text, record">
- {{ record.successCount + '/' + text }}
- </span>
- <span slot="action" slot-scope="text, record">
- <div v-if="record.projectName !== '-'">
- <a @click="editPrice(record)">出价</a>
- <a-divider type="vertical" />
- <a @click="newCreat(record.id)">编辑</a>
- <a-divider type="vertical" />
- <a @click="matchingAccount(record)">变量条件</a>
- <a-divider type="vertical" />
- <a @click="selectMaterial(record)">选择素材</a>
- <a-divider type="vertical" />
- <a @click="lookPreview(record)">预览</a>
- </div>
- <div v-else>
- -
- </div>
- </span>
- <span slot="charge" slot-scope="text, record">{{
- record.reportData.charge | decimalsHandle
- }}</span>
- <span slot="play3sRate" slot-scope="text, record">{{ record.reportData.play3sRate }}</span>
- <span slot="impression1kCost" slot-scope="text, record">{{
- record.reportData.impression1kCost
- }}</span>
- <span slot="photoClick" slot-scope="text, record">{{
- record.reportData.photoClick | formatCurrency
- }}</span>
- <span slot="bclick" slot-scope="text, record">{{
- record.reportData.bclick | formatCurrency
- }}</span>
- <span slot="eventRegister" slot-scope="text, record">{{
- record.reportData.eventRegister | decimalsHandle
- }}</span>
- <span slot="bclickPrice" slot-scope="text, record">{{
- record.reportData.bclickPrice | decimalsHandle
- }}</span>
- <span slot="photoShow" slot-scope="text, record">{{
- record.reportData.photoShow | formatCurrency
- }}</span>
- <span slot="aclick" slot-scope="text, record">{{
- record.reportData.aclick | formatCurrency
- }}</span>
- <span slot="activation" slot-scope="text, record">{{ record.reportData.activation }}</span>
- <span slot="eventRegisterPrice" slot-scope="text, record">{{
- record.reportData.eventRegisterPrice | decimalsHandle
- }}</span>
- <span slot="bclickRate" slot-scope="text, record">{{ record.reportData.bclickRate }}</span>
- </a-table>
- <a-pagination
- size="small"
- :showTotal="ipagination.showTotal"
- style="float: right;margin-top:10px"
- v-if="dataSource.length > 0"
- showQuickJumper
- :pageSize.sync="ipagination.pageSize"
- :total="ipagination.total"
- v-model="ipagination.current"
- @change="getDataSource"
- />
- </div>
- </a-col>
- </a-row>
- <!-- 修改出价 -->
- <a-modal
- title="修改出价"
- v-if="modifyPriceVisible"
- :visible="modifyPriceVisible"
- :confirm-loading="modifyPriceLoading"
- dialog-class="push-modal"
- @ok="handleOkPrice"
- @cancel="handleCancelPrice"
- >
- <a-form
- :form="priceForm"
- :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
- :wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }"
- v-if="modifyPriceDetail"
- >
- <a-form-item label="策略名称"> {{ modifyPriceDetail.strategyName }} </a-form-item>
- <a-form-item label="优化目标">
- <a-button type="primary">{{ modifyPriceDetail.bidType | bidType }}</a-button></a-form-item
- >
- <a-form-item label="转化目标"> {{ modifyPriceDetail.ocpxActionType | ocpxActionType }}</a-form-item>
- <a-form-item label="计费方式">
- <a-button type="primary">{{
- modifyPriceDetail.bidType === 2 ? '点击计费(CPC)' : '按展示付费(oCPM)'
- }}</a-button>
- </a-form-item>
- <a-form-item label="转化目标出价">
- <a-input
- style="width:200px;ime-mode:disabled"
- v-decorator="['cpaBid', { rules: [{ required: true, validator: cpaBidValid }] }]"
- >
- </a-input>
- <br />
- <span style="color:red"
- >单出价请输入单数字,阶梯出价请用/隔开 例如10/12,区间出价请用-链接 例如20-25</span
- >
- </a-form-item>
- <a-form-item
- label="深度转化出价"
- v-if="modifyPriceDetail.deepConversionBid && modifyPriceDetail.deepConversionBid != ''"
- ><a-input
- style="width:200px;ime-mode:disabled"
- v-decorator="['deepConversionBid', { rules: [{ required: true, validator: cpaBidValid }] }]"
- >
- </a-input>
- <br />
- <span style="color:red"
- >单出价请输入单数字,阶梯出价请用/隔开 例如10/12,区间出价请用-链接 例如20-25</span
- >
- </a-form-item>
- </a-form>
- </a-modal>
- <a-modal
- title="变量条件"
- :width="800"
- v-if="accountVisible"
- :visible="accountVisible"
- @ok="handleOkVariable"
- @cancel="accountVisible = false"
- dialog-class="push-modal"
- :confirm-loading="variableLoading"
- >
- <div style="height:600px;overflow:auto">
- <a-form
- :form="variableForm"
- :labelCol="{ lg: { span: 5 }, sm: { span: 5 } }"
- :wrapperCol="{ lg: { span: 19 }, sm: { span: 19 } }"
- v-if="accountProjectDetail"
- >
- <a-form-item label="策略名称">{{ accountProjectDetail.strategyName }} </a-form-item>
- <a-form-item label="地区">
- <checkBoxGroup
- :options="regionData"
- v-decorator="[
- 'region',
- {
- rules: [{ required: true, message: '地区必选' }],
- initialValue: ['unlimited']
- }
- ]"
- @change="setData($event, 'region')"
- />
- </a-form-item>
- <a-form-item label="年龄">
- <checkBoxGroup
- :options="ageData"
- v-decorator="[
- 'agesRange',
- { rules: [{ required: true, message: '年龄必选' }], initialValue: ['unlimited'] }
- ]"
- @change="setData($event, 'agesRange')"
- />
- </a-form-item>
- <a-form-item label="性别">
- <checkBoxGroup
- :options="[
- { label: '不限', value: 'unlimited' },
- { label: '女', value: '1' },
- { label: '男', value: '2' }
- ]"
- v-decorator="[
- 'gender',
- { rules: [{ required: true, message: '性别必选' }], initialValue: ['unlimited'] }
- ]"
- @change="setData($event, 'gender')"
- />
- </a-form-item>
- <a-form-item label="行为意向">
- <checkBoxGroup
- :options="[
- { label: '不限', value: 'unlimited' },
- { label: '系统优选', value: '1' }
- ]"
- v-decorator="[
- 'intentionTarget',
- { rules: [{ required: true, message: '行为意向必选' }], initialValue: ['unlimited'] }
- ]"
- />
- </a-form-item>
- <a-form-item label="APP行为">
- <checkBoxGroup
- :options="[
- { label: '不限', value: 'unlimited' },
- { label: '按App名称', value: '1' }
- ]"
- v-decorator="[
- 'appIds',
- { rules: [{ required: true, message: 'APP行为必选' }], initialValue: ['unlimited'] }
- ]"
- @change="setData($event, 'appIds')"
- />
- <el-select
- v-if="getElseData('appIds') ? getElseData('appIds').includes('1') : false"
- v-model="appIds"
- multiple
- filterable
- remote
- reserve-keyword
- placeholder="请输入关键词"
- :remote-method="remoteMethod"
- style="margin-top:10px"
- >
- <el-option
- v-for="item in appOptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </a-form-item>
- <a-form-item label="智能扩量">
- <!-- {
- label: '不可突破年龄',
- value: '2',
- disabled: getElseData('agesRange')
- ? getElseData('agesRange').includes('18') ||
- getElseData('agesRange').includes('24') ||
- getElseData('agesRange').includes('31') ||
- getElseData('agesRange').includes('41') ||
- getElseData('agesRange').includes('50')
- ? false
- : true
- : true
- },
- {
- label: '不可突破性别',
- value: '3',
- disabled: getElseData('gender')
- ? getElseData('gender').includes('0') || getElseData('gender').includes('1')
- ? false
- : true
- : true
- },
- {
- label: '不可突破地域',
- value: '4',
- disabled: getElseData('region')
- ? getElseData('region').includes('1') || getElseData('region').includes('2')
- ? false
- : true
- : true
- } -->
- <checkBoxGroup
- :options="[
- { label: '关闭', value: '0' },
- { label: '开启', value: '1' }
- ]"
- v-decorator="[
- 'intelliExtend',
- { rules: [{ required: true, message: '智能扩量必选' }], initialValue: ['0'] }
- ]"
- />
- </a-form-item>
- <a-form-item label="投放时段">
- <a-button type="primary" @click="addSchedule">新增变量</a-button>
- </a-form-item>
- <div style="width:100%">
- <div v-for="(item, index) in scheduleTimeData" style="margin-bottom:15px;display:flex">
- <selectCheckAll
- style="width:100%;margin-right:5px"
- :scheduleTime.sync="item.scheduleTime"
- ref="selectCheck"
- />
- <a-icon type="delete" v-if="scheduleTimeData.length > 1" @click="deleteSchedule(index)" />
- </div>
- </div>
- </a-form>
- </div>
- </a-modal>
- <!-- 选择素材 -->
- <a-modal
- title="选择素材"
- :width="1000"
- v-if="materialVisible"
- :visible="materialVisible"
- :confirm-loading="materialLoading"
- dialog-class="push-modal"
- @ok="handleOkMaterial"
- @cancel="
- materialVisible = false
- checkPersonElse = []
- checkVideo = []
- checkPersonOne = ''
- sumContent = 0
- "
- >
- <div style="width:100%;display:flex; justify-content: space-between;">
- <span>已选择:{{ sumContent }}</span>
- <a-button slot="tabBarExtraContent" type="primary" @click="tongbu()" :loading="tongbuLoading">
- 刷新素材</a-button
- >
- </div>
- <a-spin :spinning="spinning">
- <a-checkbox-group v-model="checkVideo" style="width: 100%;" @change="setVideoDataAll">
- <div class="card-person-drawer info-detail">
- <a-card class="card-person card-item" v-for="(item, index) in dataVideoList" :key="index">
- <div
- slot="title"
- style=" overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;"
- >
- {{ item.photoName }}
- </div>
- <div slot="extra">
- <a-checkbox :value="item.photoId" @change="setVideoData(item.photoId)"></a-checkbox>
- </div>
- <div style="width:100%;border: 1px solid #f2f2f2;position:relative">
- <img :src="item.coverUrl" style="width:100%" alt="" />
- <a-tag
- color="blue"
- v-if="item.useStatus == 0"
- style="position:absolute;top:5px;right:0px"
- >
- 已测试
- </a-tag>
- </div>
- </a-card>
- </div>
- </a-checkbox-group>
- <div style="text-align:right">
- <a-pagination
- size="small"
- :showTotal="ipaginationVideo.showTotal"
- style="float:right"
- v-if="dataVideoList.length > 0"
- showQuickJumper
- :pageSize.sync="ipaginationVideo.pageSize"
- :total="ipaginationVideo.total"
- v-model="ipaginationVideo.current"
- @change="getDataVideo"
- />
- </div>
- </a-spin>
- </a-modal>
- </div>
- </template>
- <script>
- import { TreeSelect } from 'ant-design-vue'
- const SHOW_PARENT = TreeSelect.SHOW_PARENT
- import ARow from 'ant-design-vue/es/grid/Row'
- import ACol from 'ant-design-vue/es/grid/Col'
- import moment from 'moment'
- import pick from 'lodash.pick'
- import { getKsAccountReport, getKsDetail, getReportList } from '@api/video.js'
- import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
- import checkBoxGroup from '@/components/formComponents/checkBoxGroup'
- import selectCheckAll from '@/views/modules/kuaishouapp/account/stepForm/stepModule/test'
- import qs from 'qs'
- function tqFun(qcArr1) {
- var tempArr = []
- function bbFun(qcArr) {
- for (var i = 0; i < qcArr.length; i++) {
- if (qcArr[i] instanceof Array) {
- bbFun(qcArr[i])
- } else {
- tempArr.push(qcArr[i])
- }
- }
- return tempArr
- }
- return bbFun(qcArr1)
- }
- let TTcolumns = [
- {
- title: '开关',
- dataIndex: 'strategyStatus',
- scopedSlots: { customRender: 'strategyStatus' },
- align: 'center',
- key: 'strategyStatus'
- },
- {
- title: '策略名称',
- dataIndex: 'strategyName',
- scopedSlots: { customRender: 'strategyName' },
- align: 'center',
- key: 'strategyName'
- },
- {
- title: '策略日期',
- dataIndex: 'createTime',
- scopedSlots: { customRender: 'createTime' },
- align: 'center',
- key: 'createTime'
- },
- {
- title: '操作',
- dataIndex: 'action',
- scopedSlots: { customRender: 'action' },
- align: 'center',
- key: 'action',
- width: '300px'
- },
- {
- title: '消耗',
- dataIndex: 'charge',
- scopedSlots: { customRender: 'charge' },
- align: 'center',
- key: 'charge',
- sorter: () => {}
- },
- {
- title: '封面曝光数',
- dataIndex: 'photoShow',
- scopedSlots: { customRender: 'photoShow' },
- align: 'center',
- key: 'photoShow',
- sorter: () => {}
- },
- {
- title: '封面点击数',
- dataIndex: 'photoClick',
- scopedSlots: { customRender: 'photoClick' },
- align: 'center',
- key: 'photoClick',
- sorter: () => {}
- },
- {
- title: '素材曝光数',
- dataIndex: 'aclick',
- scopedSlots: { customRender: 'aclick' },
- align: 'center',
- key: 'aclick',
- sorter: () => {}
- },
- {
- title: '行为数',
- dataIndex: 'bclick',
- scopedSlots: { customRender: 'bclick' },
- align: 'center',
- key: 'bclick',
- sorter: () => {}
- },
- {
- title: '行为率',
- dataIndex: 'bclickRate',
- scopedSlots: { customRender: 'bclickRate' },
- align: 'center',
- key: 'bclickRate',
- sorter: () => {}
- },
- {
- title: '平均千次封面曝光花费(元)',
- dataIndex: 'impression1kCost',
- scopedSlots: { customRender: 'impression1kCost' },
- align: 'center',
- key: 'impression1kCost',
- sorter: () => {}
- },
- {
- title: '平均行为单价(元)',
- dataIndex: 'bclickPrice',
- scopedSlots: { customRender: 'bclickPrice' },
- align: 'center',
- key: 'bclickPrice',
- sorter: () => {}
- },
- {
- title: '注册数',
- dataIndex: 'eventRegister',
- scopedSlots: { customRender: 'eventRegister' },
- align: 'center',
- key: 'eventRegister',
- sorter: () => {}
- },
- {
- title: '注册单价',
- dataIndex: 'eventRegisterPrice',
- scopedSlots: { customRender: 'eventRegisterPrice' },
- align: 'center',
- key: 'eventRegisterPrice',
- sorter: () => {}
- }
- ]
- let KScolumns = []
- export default {
- components: {
- ACol,
- ARow,
- checkBoxGroup,
- selectCheckAll
- },
- data() {
- return {
- tongbuLoading: false,
- appIds: [],
- appOptions: [],
- materialVisible: false,
- materialLoading: false,
- scheduleTimeData: [{ scheduleTime: '' }],
- indexAll: 0,
- spinning: false,
- form: this.$form.createForm(this),
- priceForm: this.$form.createForm(this),
- variableForm: this.$form.createForm(this),
- variableLoading: false,
- exportloading: false,
- dateRange: [moment().subtract(1, 'weeks'), moment()],
- noImg: require('@/assets/noImg.png'),
- validationRules: {
- bid: [
- {
- required: true,
- message: '出价信息必须填写'
- // validator: this.validateBid,
- }
- ]
- },
- 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
- }
- },
- ipaginationVideo: {
- current: 1,
- pageSize: 8,
- id: '',
- accountId: '',
- // pageSizeOptions: ['10', '20', '30'],
- showTotal: (total, range) => {
- return range[0] + '-' + range[1] + ' 共' + total + '条'
- },
- showQuickJumper: true,
- // showSizeChanger: true,
- total: 0,
- onChange: current => {
- // 切换分页时的回调,
- // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
- this.ipaginationVideo.current = current
- }
- },
- value: 'valid',
- KSaccountList: [],
- TTaccountList: [],
- KSdesignList: [],
- TTdesignList: [],
- operateDisabled: false,
- duration: 1000,
- //treeselect的参数
- treeValue: [],
- treeData: [],
- SHOW_PARENT,
- type: 3,
- dateValue: [moment().subtract(7, 'days'), moment()],
- operate: '',
- designList: [],
- tabKey: 1,
- loading: false,
- TTcolumns,
- KScolumns,
- columns: [...TTcolumns],
- dataSource: [],
- dataVideoList: [],
- checkVideo: [],
- checkPersonOne: '',
- checkPersonElse: [],
- sumContent: 0,
- tableTab: 1,
- newPlan: 0,
- effectPlan: 0,
- openOptions: false,
- target: 'createTime',
- order: 'descend',
- projectId: undefined,
- projectIdAll: undefined,
- dataLoading: false,
- url: '/kuaishouProjectStrategy/queryProjectList',
- modifyPriceVisible: false,
- modifyPriceLoading: false,
- modifyPriceDetail: null,
- accountVisible: false,
- againLoading: false,
- accountProjectDetail: null,
- regionData: [{ label: '不限', value: 'unlimited' }],
- ageData: [{ label: '不限', value: 'unlimited' }]
- }
- },
- methods: {
- moment,
- tongbu() {
- this.tongbuLoading = true
- this.getAction('/kuaishou/batch/syncVideo', {
- accountId: this.ipaginationVideo.accountId
- }).then(res => {
- if (res.success) {
- this.$message.success(res.message)
- this.tongbuLoading = false
- postAction('/dimension/kuaiShouDimensionMaterial/getVideoList', {
- id: this.ipaginationVideo.id,
- accountId: this.ipaginationVideo.accountId,
- pageSize: this.ipaginationVideo.pageSize,
- pageNo: this.ipaginationVideo.current
- }).then(resNei => {
- if (resNei.success) {
- this.materialVisible = true
- this.dataVideoList = resNei.result.list
- this.ipaginationVideo.total = resNei.result.total
- }
- })
- } else {
- this.$message.error(res.message)
- this.tongbuLoading = false
- }
- })
- },
- setData(e, type) {
- if (type == 'region') {
- if (e.includes('1') || e.includes('2')) {
- } else {
- let region = this.getElseData('intelliExtend')
- let regionIndex = region.findIndex(item => item === '4')
- if (regionIndex > -1) {
- region.splice(regionIndex, 1)
- this.variableForm.setFieldsValue({ intelliExtend: region })
- }
- }
- } else if (type == 'agesRange') {
- if (e.includes('18') || e.includes('24') || e.includes('31') || e.includes('41') || e.includes('50')) {
- } else {
- let agesRange = this.getElseData('intelliExtend')
- let agesRangeIndex = agesRange.findIndex(item => item === '2')
- if (agesRangeIndex > -1) {
- agesRange.splice(agesRangeIndex, 1)
- this.variableForm.setFieldsValue({ intelliExtend: agesRange })
- }
- }
- } else if (type == 'gender') {
- if (e.includes('1') || e.includes('0')) {
- } else {
- let gender = this.getElseData('intelliExtend')
- let genderIndex = gender.findIndex(item => item === '3')
- if (genderIndex > -1) {
- gender.splice(genderIndex, 1)
- this.variableForm.setFieldsValue({ intelliExtend: gender })
- }
- }
- } else if (type == 'appIds') {
- if (e.includes('1')) {
- } else {
- this.appIds = []
- }
- }
- },
- newCreat(id) {
- if (id) {
- this.$router.push({
- path: '/autoLaunch/creatMaterialTest?id=' + id
- })
- } else {
- // window.open('/creat-material-test', '_blank')
- this.$router.push({
- path: '/autoLaunch/creatMaterialTest'
- })
- }
- },
- remoteMethod(query) {
- if (query !== '') {
- getAction('/kuaishou/batch/getAppSearch', {
- accountId: this.accountProjectDetail.accountId,
- appName: query
- }).then(res => {
- if (res.result) {
- this.appOptions = res.result.map(item => {
- return {
- value: item.appId,
- label: item.appName
- }
- })
- } else {
- }
- })
- } else {
- this.appOptions = []
- }
- },
- addSchedule() {
- this.scheduleTimeData.push({ scheduleTime: '' })
- },
- deleteSchedule(index) {
- this.scheduleTimeData.splice(index, 1)
- },
- handleOkVariable() {
- this.variableForm.validateFields((err, values) => {
- if (!err) {
- this.variableLoading = true
- let params = { ...values }
- params.agesRange = JSON.stringify(values.agesRange)
- values.appIds = values.appIds.includes('unlimited') ? ['unlimited'] : []
- params.appIds =
- this.appIds.length > 0
- ? JSON.stringify([values.appIds, this.appIds])
- : JSON.stringify([values.appIds])
- params.gender = JSON.stringify(values.gender)
- params.intelliExtend = JSON.stringify(values.intelliExtend)
- params.intentionTarget = JSON.stringify(values.intentionTarget)
- params.region = JSON.stringify(values.region)
- params.scheduleTime = JSON.stringify(
- this.scheduleTimeData.map(item => {
- return item.scheduleTime
- })
- )
- if (this.accountProjectDetail.editId) {
- params.id = this.accountProjectDetail.editId
- this.postDataAction('/dimension/kuaiShouDimensionVariable/edit', params).then(res => {
- console.log(res)
- if (res.success) {
- this.accountVisible = false
- this.variableLoading = false
- this.variableForm.resetFields()
- this.scheduleTimeData = [{ scheduleTime: '' }]
- } else {
- this.variableLoading = false
- this.$message.error('修改失败')
- }
- })
- } else {
- params.strategyId = this.accountProjectDetail.id
- this.postDataAction('/dimension/kuaiShouDimensionVariable/add', params).then(res => {
- console.log(res)
- if (res.success) {
- this.accountVisible = false
- this.variableLoading = false
- this.variableForm.resetFields()
- this.scheduleTimeData = [{ scheduleTime: '' }]
- } else {
- this.variableLoading = false
- this.$message.error('添加失败')
- }
- })
- }
- }
- })
- },
- editPrice(item) {
- this.modifyPriceVisible = true
- this.modifyPriceDetail = { ...item }
- this.$nextTick(() => {
- let cpaBid = ''
- let changeBid =
- this.modifyPriceDetail.bidType === 2 ? this.modifyPriceDetail.bid : this.modifyPriceDetail.cpaBid
- if ((changeBid + '').includes('/')) {
- let bidArr = changeBid.split('/')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] / 1000
- }
- cpaBid = bidArr.join('/')
- } else if ((changeBid + '').includes('-')) {
- let bidArr = changeBid.split('-')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] / 1000
- }
- cpaBid = bidArr.join('-')
- } else {
- cpaBid = changeBid / 1000
- }
- let deepConversionBid = undefined
- if (this.modifyPriceDetail.deepConversionBid && this.modifyPriceDetail.deepConversionBid != '') {
- if ((this.modifyPriceDetail.deepConversionBid + '').includes('/')) {
- let bidArr = this.modifyPriceDetail.deepConversionBid.split('/')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] / 1000
- }
- deepConversionBid = bidArr.join('/')
- } else if ((this.modifyPriceDetail.deepConversionBid + '').includes('-')) {
- let bidArr = this.modifyPriceDetail.deepConversionBid.split('-')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] / 1000
- }
- deepConversionBid = bidArr.join('-')
- } else {
- deepConversionBid = this.modifyPriceDetail.deepConversionBid / 1000
- }
- }
- this.priceForm.setFieldsValue({
- cpaBid: cpaBid,
- deepConversionBid: deepConversionBid
- })
- })
- },
- handleOkPrice() {
- this.priceForm.validateFields((err, values) => {
- //console.log(values)
- if (!err) {
- this.modifyPriceLoading = true
- if (values.cpaBid) {
- if ((values.cpaBid + '').includes('/')) {
- let bidArr = values.cpaBid.split('/')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] * 1000
- }
- values.cpaBid = bidArr.join('/')
- } else if ((values.cpaBid + '').includes('-')) {
- let bidArr = values.cpaBid.split('-')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] * 1000
- }
- values.cpaBid = bidArr.join('-')
- } else {
- values.cpaBid = values.cpaBid * 1000
- }
- } else {
- values.cpaBid = 0
- }
- if (values.deepConversionBid) {
- if ((values.deepConversionBid + '').includes('/')) {
- let bidArr = values.deepConversionBid.split('/')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] * 1000
- }
- values.deepConversionBid = bidArr.join('/')
- } else if ((values.deepConversionBid + '').includes('-')) {
- let bidArr = values.deepConversionBid.split('-')
- for (let index = 0; index < bidArr.length; index++) {
- bidArr[index] = bidArr[index] * 1000
- }
- values.deepConversionBid = bidArr.join('-')
- } else {
- values.deepConversionBid = values.deepConversionBid * 1000
- }
- } else {
- values.deepConversionBid = 0
- }
- // this.modifyPriceDetail
- let params = {}
- if (this.modifyPriceDetail.bidType === 2) {
- params.bid = values.cpaBid
- if (values.deepConversionBid) {
- params.deepConversionBid = values.deepConversionBid
- }
- } else {
- params = { ...values }
- }
- postAction('/dimension/kuaiShouDimensionStrategy/edit', {
- ...params,
- id: this.modifyPriceDetail.id
- }).then(res => {
- this.modifyPriceLoading = false
- if (res.success) {
- this.handleCancelPrice()
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- } else {
- this.$message.error(res.message)
- }
- })
- } else {
- this.$message.error('请正确填写必填项目')
- }
- })
- },
- handleCancelPrice() {
- this.priceForm.resetFields()
- this.modifyPriceVisible = false
- },
- cpaBidValid(rule, value, callback) {
- let z = /-/g
- let a = /\//g
- let d = /\./g
- if (value === '' || value === undefined) {
- callback('出价必须填写')
- } else if (value.startsWith('.') || value.endsWith('.')) {
- callback('请填写正确出价')
- } else if (value.startsWith('-') || value.endsWith('-')) {
- callback('请填写正确出价')
- } else if (value.match(a) && value.match(z)) {
- callback('不允许出现除"-"和"/"之外的所有字符,并且二者不可同时出现')
- } else if (value.match(/[^0-9+-\/]/g)) {
- callback('请填写正确出价')
- } else {
- callback()
- }
- },
- btKeyUp(e) {
- //没有显示‘破折号’和 '.' 需要的可以手动加上
- // this.priceForm.setFieldsValue({
- // cpaBid: e.target.value.replace(/[^0-9+-\/]/g, '')
- // })
- // (
- // /[\u4e00-\u9fa5/\s+/]|[`~!@#$%^&*() \+ =<>?"{}|, \/ ;' \\ [ \] ·~!@#¥%……&*()—— \+ ={}|《》?:“”【】、;‘’,。、]/g,
- // ''
- // )
- },
- getData(className) {
- return this.priceForm.getFieldValue(className)
- },
- getElseData(className) {
- return this.variableForm.getFieldValue(className)
- },
- againAccount() {
- this.againLoading = true
- this.getAction('/ai/projectCreate/projectAutomaticCreates', {
- id: this.accountProjectDetail.id,
- operationType: 1
- }).then(res => {
- this.againLoading = false
- if (res.success) {
- this.$message.success('重新匹配成功')
- } else {
- this.$message.error(res.message)
- }
- })
- },
- matchingAccount(item) {
- this.accountVisible = true
- this.accountProjectDetail = { ...item }
- getAction('/dimension/kuaiShouDimensionAccount/getStrategyBindAccount', {
- strategyId: item.id
- }).then(res => {
- console.log(res)
- if (res.success) {
- this.accountProjectDetail.accountId = res.result
- } else {
- this.accountProjectDetail.accountId = null
- }
- })
- getAction('/dimension/kuaiShouDimensionVariable/selectVariableByStrategyId', { strategyId: item.id }).then(
- res => {
- if (res.success) {
- getAction('/dimension/kuaiShouDimensionVariable/queryByStrategyId', {
- strategyId: item.id
- }).then(res => {
- if (res.success) {
- if (res.result) {
- this.accountProjectDetail.editId = res.result.id
- let data = {}
- data.region = JSON.parse(res.result.region)
- data.agesRange = JSON.parse(res.result.agesRange)
- data.gender = JSON.parse(res.result.gender)
- data.intentionTarget = JSON.parse(res.result.intentionTarget)
- data.appIds = tqFun(JSON.parse(res.result.appIds))
- if (data.appIds.length >= 1) {
- this.appIds = tqFun(JSON.parse(res.result.appIds))
- let index = this.appIds.findIndex(item => item == 'unlimited')
- if (index > -1) {
- this.appIds.splice(index, 1)
- if (this.appIds.length > 0) {
- data.appIds = ['unlimited', '1']
- } else {
- data.appIds = ['unlimited']
- }
- } else {
- data.appIds = ['1']
- }
- } else if (data.appIds.length == 0) {
- data.appIds = ['unlimited']
- }
- data.intelliExtend = JSON.parse(res.result.intelliExtend)
- this.$nextTick(() => {
- this.scheduleTimeData = JSON.parse(res.result.scheduleTime).map(item => {
- return { scheduleTime: item }
- })
- this.variableForm.setFieldsValue(
- pick(
- data,
- 'region',
- 'agesRange',
- 'gender',
- 'intentionTarget',
- 'appIds',
- 'intelliExtend'
- )
- )
- })
- }
- } else {
- this.accountProjectDetail.editId = null
- }
- })
- }
- }
- )
- },
- selectMaterial(item) {
- getAction('/dimension/kuaiShouDimensionAccount/getStrategyBindAccount', {
- strategyId: item.id
- }).then(res => {
- if (res.success) {
- this.ipaginationVideo.id = item.id
- this.ipaginationVideo.accountId = res.result
- this.ipaginationVideo.current = 1
- postAction('/dimension/kuaiShouDimensionMaterial/getVideoList', {
- id: this.ipaginationVideo.id,
- accountId: this.ipaginationVideo.accountId,
- pageSize: this.ipaginationVideo.pageSize,
- pageNo: this.ipaginationVideo.current
- }).then(resNei => {
- if (resNei.success) {
- this.materialVisible = true
- this.dataVideoList = resNei.result.list
- this.ipaginationVideo.total = resNei.result.total
- }
- })
- } else {
- }
- })
- },
- lookPreview(item) {
- this.$router.push({
- path: '/autoLaunch/lookPreview?id=' + item.id
- })
- // getAction('/dimension/kuaiShouDimensionUnit/previewByStrategyId', { strategyId: item.id }).then(res => {})
- },
- getDataVideo(current, pageSize) {
- // 切换分页时的回调,
- // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
- this.spinning = true
- this.ipaginationVideo.current = current
- this.ipaginationVideo.pageSize = pageSize
- this.checkVideo = this.checkPersonElse
- this.dataVideoList = []
- postAction('/dimension/kuaiShouDimensionMaterial/getVideoList', {
- id: this.ipaginationVideo.id,
- accountId: this.ipaginationVideo.accountId,
- pageSize: this.ipaginationVideo.pageSize,
- pageNo: this.ipaginationVideo.current
- }).then(resNei => {
- this.spinning = false
- if (resNei.success) {
- this.dataVideoList = resNei.result.list
- this.ipaginationVideo.total = resNei.result.total
- }
- })
- },
- getDataSource(current, pageSize) {
- // 切换分页时的回调,
- // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
- this.ipagination.current = current
- this.ipagination.pageSize = pageSize
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- },
- handleOkMaterial() {
- let dataAll = this.checkPersonElse
- this.checkVideo = dataAll
- this.materialLoading = true
- this.postDataAction('/dimension/kuaiShouDimensionStrategy/create', {
- id: this.ipaginationVideo.id,
- materialArray: this.checkVideo
- }).then(res => {
- this.materialLoading = false
- if (res.success) {
- this.materialVisible = false
- this.checkPersonElse = []
- this.checkVideo = []
- this.checkPersonOne = ''
- this.sumContent = 0
- }
- })
- },
- setVideoData(data) {
- this.checkPersonOne = data
- },
- setVideoDataAll(data) {
- // checkPerson: [],
- // checkPersonAll: [],
- if (data.findIndex(item => item === this.checkPersonOne) > -1) {
- this.checkPersonElse.push(...data)
- this.checkPersonElse = [...new Set(this.checkPersonElse)]
- } else {
- data.findIndex(item => item === this.checkPersonOne) > -1
- this.checkPersonElse.splice(
- this.checkPersonElse.findIndex(item => item === this.checkPersonOne),
- 1
- )
- }
- this.sumContent = this.checkPersonElse.length
- // var dataCount = 20
- // if (this.sumContent > dataCount) {
- // this.$message.error('最多选择' + dataCount + '个定向')
- // this.checkPerson.pop()
- // this.checkPersonElse.splice(
- // this.checkPersonElse.findIndex(item => item === this.checkPersonOne),
- // 1
- // )
- // this.sumContent--
- // // this.checkPersonAll[this.ipagination.current - 1] = this.checkPerson
- // }
- },
- onChangeStatus(text, rescord, type) {
- let status = text === 0 ? 1 : 0
- let url = ''
- let params = {}
- params.id = rescord.id
- params.strategyStatus = status
- url = '/dimension/kuaiShouDimensionStrategy/edit'
- 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) {
- this.ipagination.current = 1
- event.preventDefault()
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- },
- handleResetForm() {
- this.ipagination.current = 1
- this.form.resetFields()
- if (this.tabKey == 1) {
- this.projectId = undefined
- this.projectIdAll = undefined
- }
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- },
- handleGetTableList(data) {
- let paramsData = {
- strategyName: data.strategyName,
- startDate:
- data.timeRange && data.timeRange.length === 2
- ? moment(data.timeRange[0]).format('YYYY-MM-DD')
- : null,
- endDate:
- data.timeRange && data.timeRange.length === 2
- ? moment(data.timeRange[1]).format('YYYY-MM-DD')
- : null,
- pageNo: this.ipagination.current,
- pageSize: this.ipagination.pageSize
- }
- this.dataSource = []
- this.dataLoading = true
- this.getAction('/dimension/kuaiShouDimensionStrategy/list', paramsData)
- .then(result => {
- this.dataLoading = false
- if (result.success) {
- this.dataSource = result.result.records || []
- // if (result.result.total) {
- // this.dataSource.unshift(result.result.total)
- // }
- this.ipagination.total = result.result.total || 0
- // result.result.total
- } else {
- this.$message.error(result.message)
- }
- })
- .catch(error => {
- this.dataLoading = false
- console.log(error, 'eeee')
- })
- },
- getAccountNoProject() {
- this.projectId = undefined
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- },
- toAccountDetail(item) {
- this.tabKey = 2
- this.projectId = { id: item.projectId, name: item.projectName }
- this.url =
- this.tabKey == 1
- ? '/kuaishouProjectStrategy/queryProjectList'
- : '/kuaishouProjectStrategy/queryAccountList'
- this.$nextTick(() => {
- this.columns = this.tabKey == 1 ? [...TTcolumns] : [...KScolumns]
- this.target = this.tabKey == 1 ? 'createTime' : 'statDate'
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- })
- },
- disabledDate(current) {
- // Can not select days before today and today
- return current && current > moment().endOf('day')
- },
- dateChange(date, dateString) {
- // console.log(date,dateString)
- },
- filterOption(input, option) {
- // console.log(input, option)
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- },
- // 快手头条的切换
- tabChange(key) {
- this.ipagination.current = 1
- this.columns = this.tabKey == 1 ? [...TTcolumns] : [...KScolumns]
- this.url =
- this.tabKey == 1
- ? '/kuaishouProjectStrategy/queryProjectList'
- : '/kuaishouProjectStrategy/queryAccountList'
- this.target = this.tabKey == 1 ? 'createTime' : 'statDate'
- this.projectId = undefined
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- },
- operateChange(value) {
- console.log(value)
- if (value) {
- this.accountDisabled = true
- this.accountId = ''
- } else {
- this.accountDisabled = false
- }
- },
- tableChange(pagination, filters, sorter, { currentDataSource }) {
- this.ipagination.current = pagination.current
- this.ipagination.pageSize = pagination.pageSize
- if (sorter.order) {
- this.order = sorter.order ? sorter.order : 'descend'
- this.target = sorter.columnKey
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList({
- ...paramsData,
- target: sorter.columnKey,
- order: sorter.order ? sorter.order : 'descend'
- })
- }
- },
- // table区域的tab切换
- tableTabChange(key) {
- if (key == 1) {
- this.columns = this.tabKey == 1 ? [...TTcolumns] : [...KScolumns]
- this.target = 'new'
- } else {
- this.columns = this.tabKey == 1 ? [...TTcolumns] : [...KScolumns]
- this.target = 'valid'
- }
- },
- // 获取所有运营
- getAllOperator(key) {
- let url = '/sys/user/getAllUserListV1'
- this.designList = []
- getAction(url, {}).then(res => {
- if (res.success) {
- this.designList = res.result
- }
- })
- }
- },
- watch: {
- dateValue(newName, oldName) {
- this.search()
- }
- },
- computed: {
- newDate() {
- var myDate = new Date()
- myDate.getYear() //获取当前年份(2位)
- var n = myDate.getFullYear() //获取完整的年份(4位,1970-????)
- var m = myDate.getMonth() //获取当前月份(0-11,0代表1月)
- var d = myDate.getDate() //获取当前日(1-31)
- var day = myDate.getHours()
- return day
- }
- },
- mounted() {
- const paramsData = this.form.getFieldsValue()
- this.handleGetTableList(paramsData)
- this.getAllOperator()
- this.getAction('/dimension/kuaiShouDimensionRegionConfig/list').then(res => {
- if (res.success) {
- let data = res.result.map(item => {
- return {
- label: item.regionGroupName,
- value: item.regionGroupId
- }
- })
- this.regionData.push(...data)
- }
- })
- this.getAction('/dimension/kuaiShouDimensionAgeConfig/list').then(res => {
- if (res.success) {
- let data = res.result.map(item => {
- return {
- label: item.ageGroupName,
- value: item.ageGroupId
- }
- })
- this.ageData.push(...data)
- }
- })
- },
- activated: function() {},
- filters: {
- toPercentage(val) {
- if (typeof val != 'string') {
- return (val * 100).toFixed(2) + '%'
- } else {
- return val
- }
- },
- //保留两位小数并且变成货币格式
- decimalsHandle(val) {
- if (val && typeof val != 'string') {
- if (val >= 0) {
- val = parseFloat(val).toFixed(2)
- let numberStr = val.toString()
- let str = numberStr.split('.')
- let str0 = str[0].split('').reverse()
- for (let i = 0; i < str0.length; i++) {
- if ((i + 1) % 4 === 0) {
- str0.splice(i, 0, ',')
- }
- }
- str0.reverse()
- let handleResult = ''
- for (let j = 0; j < str0.length; j++) {
- handleResult += str0[j]
- }
- return handleResult + '.' + str[1]
- } else {
- val = parseFloat(val).toFixed(2)
- let numberStr = val.toString()
- let str = numberStr.split('.')
- let str0 = str[0]
- .substr(1)
- .split('')
- .reverse()
- for (let i = 0; i < str0.length; i++) {
- if ((i + 1) % 4 === 0) {
- str0.splice(i, 0, ',')
- }
- }
- str0.reverse()
- let handleResult = ''
- for (let j = 0; j < str0.length; j++) {
- handleResult += str0[j]
- }
- return '-' + handleResult + '.' + str[1]
- }
- } else if (typeof val == 'string') {
- return val
- } else {
- return 0
- }
- },
- //变成货币格式
- formatCurrency(val) {
- if (val) {
- let numberStr = val.toString()
- let str = numberStr.split('').reverse()
- for (let i = 0; i < str.length; i++) {
- if ((i + 1) % 4 === 0) {
- str.splice(i, 0, ',')
- }
- }
- str.reverse()
- let handleResult = ''
- for (let j = 0; j < str.length; j++) {
- handleResult += str[j]
- }
- return handleResult
- } else {
- return '-'
- }
- }
- }
- }
- </script>
|