12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153 |
- <template>
- <div class="autoLaunchReport">
- <div class="tabBody2" >
- <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-tabs>
- </div>
- <div class="topOptions">
- <span class="OptinItem ">
- <!-- reqUrl='/ctop/userAllocation/getAccountIdListByUserId' -->
- <!-- <Treeselect :appId.sync="accountIds" :multiple="true" request="2,4" reqUrl='/ctop/userAllocation/getAccountIdsByUserId' ref="treeSelect" style="margin-bottom:8px " /> -->
- <a-select
- v-model="accountIds"
- style="width: 400px"
- placeholder="请选择账户"
- :maxTagCount='1'
- allowClear
- @change="accountChange"
- show-search
- option-filter-prop="children"
- :filter-option="filterOption"
- >
- <a-select-option v-for="item in accountList" :key="item.account_id" :value='item.account_id'>
- {{ item.auth_name+'_('+(item.project_name||"无所属项目")+')' }}
- </a-select-option>
- </a-select>
- </span>
- <span class="OptinItem">
-
- <a-tree-select
- v-if="tabKey==1"
- v-model="directionalId"
- show-search
- style="width: 350px;height:30px"
- :dropdownMatchSelectWidth='true'
- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
- tree-checkable
- searchPlaceholder='选择策略以及出价'
- :show-checked-strategy="SHOW_PARENT"
- placeholder="选择策略以及出价"
- treeNodeFilterProp="title"
- :allowClear="true"
- @change="treeChange"
- :maxTagCount='1'
- :tree-data="treeData"
- :filterOption='filterOption'
- >
- </a-tree-select>
- <a-tree-select
- v-if="tabKey==2"
- v-model="materialId"
- show-search
- style="width: 350px;height:30px"
- :dropdownMatchSelectWidth='true'
- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
- tree-checkable
- searchPlaceholder='选择策略以及素材'
- :show-checked-strategy="SHOW_PARENT"
- placeholder="选择策略以及素材"
- treeNodeFilterProp="title"
- :allowClear="true"
- @change="materialTreeChange"
- :maxTagCount='1'
- :tree-data="materialTreeData"
- :filterOption='filterOption'
- >
- </a-tree-select>
- </span>
- <span class="OptinItem">
- <a-range-picker
- @change="dateChange"
- v-model="dateRange"
- :disabled-date="disabledDate"
- style="width:200px"
- />
- </span>
- <span class="optionBtn">
- <a-button type='primary' @click="search" class="searchBtn">查询</a-button>
- <!-- <a-button type='default' @click="reset">重置</a-button> -->
- </span>
- </div>
- <div class="chartBox">
- <div class="chartTop">
- <span>数据维度:</span>
- <a-radio-group v-model="value" @change="chartDataTypeChange">
- <a-radio :value="1">
- 消耗
- </a-radio>
- <a-radio :value="2">
- 封面曝光数
- </a-radio>
- <a-radio :value="3">
- 封面点击数
- </a-radio>
- <a-radio :value="4">
- 素材曝光数
- </a-radio>
- <!-- <a-radio :value="5">
- 转化数@
- </a-radio> -->
- </a-radio-group>
- </div>
- <a-spin :spinning="spinning">
- <div class="chartBody">
-
- <div id="mapEchart" style='width:30%;height:300px;border:1px solid #e0e0e0;padding:10px' ref="mapEchart">
- <a-empty style="position: relative; top: 50%; margin-top: -65px" />
- </div>
- <div id="sexEchart" style='width:30%;height:300px;border:1px solid #e0e0e0;padding:10px' ref="sexEchart">
- <a-empty style="position: relative; top: 50%; margin-top: -65px" />
- </div>
- <div id="ageEchart" style='width:30%;height:300px;border:1px solid #e0e0e0;padding:10px' ref="ageEchart">
- <a-empty style="position: relative; top: 50%; margin-top: -65px" />
- </div>
-
- </div>
- </a-spin>
- <div class="tableBox">
- <!-- <div class="tableTop">
- 关联出价
- </div> -->
- <div class="tableOpt">
- <span>表格类型:</span>
- <a-radio-group v-model="tableValue" @change="tableTypeChange">
- <a-radio :value="1">
- 地域
- </a-radio>
- <a-radio :value="2">
- 性别
- </a-radio>
- <a-radio :value="3">
- 年龄
- </a-radio>
-
- </a-radio-group>
- </div>
- <div class="tableBody">
- <a-table
- size="middle"
- :columns="columns"
- :dataSource="tableData"
- :pagination='true'
- bordered
- id="outTable"
- :loading="loading"
- style="word-break: break-all;font-size:16px;font-weight:600"
- :scroll="{'x':scrollX}"
-
- >
- <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
- <span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
- <span slot="clickMaterial" slot-scope="clickMaterial">{{ clickMaterial | formatCurrency }}</span>
- <span slot="showMaterial" slot-scope="showMaterial">{{ showMaterial | formatCurrency }}</span>
- <span slot="convertMaterial" slot-scope="convertMaterial">{{ convertMaterial | formatCurrency }}</span>
- <span slot="play25FeedBreak" slot-scope="play25FeedBreak">{{ play25FeedBreak | formatCurrency }}</span>
- <span slot="play50FeedBreak" slot-scope="play50FeedBreak">{{ play50FeedBreak | formatCurrency }}</span>
- <span slot="play75FeedBreak" slot-scope="play75FeedBreak">{{ play75FeedBreak | formatCurrency }}</span>
- <span slot="play100FeedBreak" slot-scope="play100FeedBreak">{{ play100FeedBreak | formatCurrency }}</span>
- <span slot="nextDayOpen" slot-scope="nextDayOpen">{{ nextDayOpen | formatCurrency }}</span>
- <span slot="downloadFinish" slot-scope="downloadFinish">{{ downloadFinish | formatCurrency }}</span>
- <span slot="downloadStart" slot-scope="downloadStart">{{ downloadStart | formatCurrency }}</span>
- <span slot="likeMaterial" slot-scope="likeMaterial">{{ likeMaterial | formatCurrency }}</span>
- <span slot="shareMaterial" slot-scope="shareMaterial">{{ shareMaterial | formatCurrency }}</span>
- <span slot="register" slot-scope="register">{{ register | formatCurrency }}</span>
- <span slot="follow" slot-scope="follow">{{ follow | formatCurrency }}</span>
- <span slot="formCount" slot-scope="formCount">{{ formCount | formatCurrency }}</span>
- <span slot="formCountCost" slot-scope="formCountCost">{{ formCountCost | decimalsHandle }}</span>
- <span slot="aClick" slot-scope="aClick">{{ aClick | formatCurrency }}</span>
- <span slot="photoShow" slot-scope="photoShow">{{ photoShow | formatCurrency }}</span>
- <span slot="photoClick" slot-scope="photoClick">{{ photoClick | formatCurrency }}</span>
- <span slot="bClick" slot-scope="bClick">{{ bClick | formatCurrency }}</span>
- <span slot="active" slot-scope="active">{{ active | formatCurrency }}</span>
- <span slot="submit" slot-scope="submit">{{ submit | formatCurrency }}</span>
- <span slot="nextDayOpen" slot-scope="nextDayOpen">{{ nextDayOpen | formatCurrency }}</span>
- <span slot="eventCreditGrantLandingPage" slot-scope="eventCreditGrantLandingPage">{{ eventCreditGrantLandingPage | formatCurrency }}</span>
- <span slot="submitCost" slot-scope="submitCost">{{ submitCost | decimalsHandle }}</span>
- <span slot="eventCreditGrantLandingPageCost" slot-scope="eventCreditGrantLandingPageCost">{{ eventCreditGrantLandingPageCost | decimalsHandle }}</span>
- <span slot="submitRate" slot-scope="submitRate">{{ submitRate | toPercentage }}</span>
- <span slot="eventCreditGrantLandingPageRate" slot-scope="eventCreditGrantLandingPageRate">{{ eventCreditGrantLandingPageRate | toPercentage }}</span>
- <span
- slot="play25FeedBreakRate"
- slot-scope="play25FeedBreakRate"
- >{{ play25FeedBreakRate | toPercentage }}</span>
- <span slot="playOverRate" slot-scope="playOverRate">{{ playOverRate | toPercentage }}</span>
- <!-- 新加数据 -->
- <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
- <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
- <span slot="cpc" slot-scope="cpc">{{ cpc | decimalsHandle }}</span>
- <span slot="cpm" slot-scope="cpm">{{ cpm | decimalsHandle }}</span>
- <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
- <span
- slot="installFinishRate"
- slot-scope="installFinishRate"
- >{{ installFinishRate | toPercentage }}</span>
- <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | toPercentage }}</span>
- <span slot="activePayCost" slot-scope="activePayCost">{{ activePayCost | decimalsHandle }}</span>
- <span slot="nextDayOpenCost" slot-scope="nextDayOpenCost">{{ nextDayOpenCost | decimalsHandle }}</span>
- <span slot="validPlayCost" slot-scope="validPlayCost">{{ validPlayCost | decimalsHandle }}</span>
- <span slot="activeCost" slot-scope="activeCost">{{ activeCost | decimalsHandle }}</span>
- <span slot="nextDayOpenCost" slot-scope="nextDayOpenCost">{{ nextDayOpenCost | decimalsHandle }}</span>
- <span
- slot="gameAddictionCost"
- slot-scope="gameAddictionCost"
- >{{ gameAddictionCost | decimalsHandle }}</span>
- <span
- slot="downloadFinishCost"
- slot-scope="downloadFinishCost"
- >{{ downloadFinishCost | decimalsHandle }}</span>
- <span
- slot="downloadStartCost"
- slot-scope="downloadStartCost"
- >{{ downloadStartCost | decimalsHandle }}</span>
- <span
- slot="installFinishCost"
- slot-scope="installFinishCost"
- >{{ installFinishCost | decimalsHandle }}</span>
- <span slot="convertCost" slot-scope="convertCost">{{ convertCost | decimalsHandle }}</span>
- <!-- -->
- <span
- slot="downloadStartRate"
- slot-scope="downloadStartRate"
- >{{ downloadStartRate | toPercentage }}</span>
- <span
- slot="downloadFinishRate"
- slot-scope="downloadFinishRate"
- >{{ downloadFinishRate | toPercentage }}</span>
- <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
- <span
- slot="activeRegisterRate"
- slot-scope="activeRegisterRate"
- >{{ activeRegisterRate | toPercentage }}</span>
- <span
- slot="gameAddictionRate"
- slot-scope="gameAddictionRate"
- >{{ gameAddictionRate | toPercentage }}</span>
- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
- <!-- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span> -->
- </a-table>
- </div>
- </div>
- <div class="tableBox">
- <div class="tableTop">
- {{tabKey==1?'关联素材':'关联出价'}}
- </div>
- <div class="tableOpt">
- <!-- <span>表格类型:</span>
- <a-radio-group v-model="tableValue" @change="tableTypeChange">
- <a-radio :value="1">
- 地域
- </a-radio>
- <a-radio :value="2">
- 性别
- </a-radio>
- <a-radio :value="3">
- 年龄
- </a-radio>
-
- </a-radio-group> -->
- </div>
- <div class="tableBody">
- <a-table
- size="middle"
- :columns="materialColumns"
- :dataSource="materialtableData"
- :pagination='materialipagination'
- bordered
- id="outTable"
- :loading="materialloading"
- style="word-break: break-all;font-size:16px;font-weight:600"
- :scroll="{'x':materialscrollX}"
- @change="materialTableChange"
- >
- <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
- <span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
- <span slot="clickMaterial" slot-scope="clickMaterial">{{ clickMaterial | formatCurrency }}</span>
- <span slot="showMaterial" slot-scope="showMaterial">{{ showMaterial | formatCurrency }}</span>
- <span slot="convertMaterial" slot-scope="convertMaterial">{{ convertMaterial | formatCurrency }}</span>
- <span slot="play25FeedBreak" slot-scope="play25FeedBreak">{{ play25FeedBreak | formatCurrency }}</span>
- <span slot="play50FeedBreak" slot-scope="play50FeedBreak">{{ play50FeedBreak | formatCurrency }}</span>
- <span slot="play75FeedBreak" slot-scope="play75FeedBreak">{{ play75FeedBreak | formatCurrency }}</span>
- <span slot="play100FeedBreak" slot-scope="play100FeedBreak">{{ play100FeedBreak | formatCurrency }}</span>
- <span slot="nextDayOpen" slot-scope="nextDayOpen">{{ nextDayOpen | formatCurrency }}</span>
- <span slot="downloadFinish" slot-scope="downloadFinish">{{ downloadFinish | formatCurrency }}</span>
- <span slot="downloadStart" slot-scope="downloadStart">{{ downloadStart | formatCurrency }}</span>
- <span slot="likeMaterial" slot-scope="likeMaterial">{{ likeMaterial | formatCurrency }}</span>
- <span slot="shareMaterial" slot-scope="shareMaterial">{{ shareMaterial | formatCurrency }}</span>
- <span slot="register" slot-scope="register">{{ register | formatCurrency }}</span>
- <span slot="follow" slot-scope="follow">{{ follow | formatCurrency }}</span>
- <span slot="formCount" slot-scope="formCount">{{ formCount | formatCurrency }}</span>
- <span slot="formCountCost" slot-scope="formCountCost">{{ formCountCost | decimalsHandle }}</span>
- <span slot="aClick" slot-scope="aClick">{{ aClick | formatCurrency }}</span>
- <span slot="photoShow" slot-scope="photoShow">{{ photoShow | formatCurrency }}</span>
- <span slot="photoClick" slot-scope="photoClick">{{ photoClick | formatCurrency }}</span>
- <span slot="bClick" slot-scope="bClick">{{ bClick | formatCurrency }}</span>
- <span slot="active" slot-scope="active">{{ active | formatCurrency }}</span>
- <span slot="submit" slot-scope="submit">{{ submit | formatCurrency }}</span>
- <span slot="nextDayOpen" slot-scope="nextDayOpen">{{ nextDayOpen | formatCurrency }}</span>
- <span slot="eventCreditGrantLandingPage" slot-scope="eventCreditGrantLandingPage">{{ eventCreditGrantLandingPage | formatCurrency }}</span>
- <span slot="submitCost" slot-scope="submitCost">{{ submitCost | decimalsHandle }}</span>
- <span slot="eventCreditGrantLandingPageCost" slot-scope="eventCreditGrantLandingPageCost">{{ eventCreditGrantLandingPageCost | decimalsHandle }}</span>
- <span slot="submitRate" slot-scope="submitRate">{{ submitRate | toPercentage }}</span>
- <span slot="eventCreditGrantLandingPageRate" slot-scope="eventCreditGrantLandingPageRate">{{ eventCreditGrantLandingPageRate | toPercentage }}</span>
- <span
- slot="play25FeedBreakRate"
- slot-scope="play25FeedBreakRate"
- >{{ play25FeedBreakRate | toPercentage }}</span>
- <span slot="playOverRate" slot-scope="playOverRate">{{ playOverRate | toPercentage }}</span>
- <!-- 新加数据 -->
- <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
- <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
- <span slot="cpc" slot-scope="cpc">{{ cpc | decimalsHandle }}</span>
- <span slot="cpm" slot-scope="cpm">{{ cpm | decimalsHandle }}</span>
- <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
- <span
- slot="installFinishRate"
- slot-scope="installFinishRate"
- >{{ installFinishRate | toPercentage }}</span>
- <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | toPercentage }}</span>
- <span slot="activePayCost" slot-scope="activePayCost">{{ activePayCost | decimalsHandle }}</span>
- <span slot="nextDayOpenCost" slot-scope="nextDayOpenCost">{{ nextDayOpenCost | decimalsHandle }}</span>
- <span slot="validPlayCost" slot-scope="validPlayCost">{{ validPlayCost | decimalsHandle }}</span>
- <span slot="activeCost" slot-scope="activeCost">{{ activeCost | decimalsHandle }}</span>
- <span slot="nextDayOpenCost" slot-scope="nextDayOpenCost">{{ nextDayOpenCost | decimalsHandle }}</span>
- <span
- slot="gameAddictionCost"
- slot-scope="gameAddictionCost"
- >{{ gameAddictionCost | decimalsHandle }}</span>
- <span
- slot="downloadFinishCost"
- slot-scope="downloadFinishCost"
- >{{ downloadFinishCost | decimalsHandle }}</span>
- <span
- slot="downloadStartCost"
- slot-scope="downloadStartCost"
- >{{ downloadStartCost | decimalsHandle }}</span>
- <span
- slot="installFinishCost"
- slot-scope="installFinishCost"
- >{{ installFinishCost | decimalsHandle }}</span>
- <span slot="convertCost" slot-scope="convertCost">{{ convertCost | decimalsHandle }}</span>
- <!-- -->
- <span
- slot="downloadStartRate"
- slot-scope="downloadStartRate"
- >{{ downloadStartRate | toPercentage }}</span>
- <span
- slot="downloadFinishRate"
- slot-scope="downloadFinishRate"
- >{{ downloadFinishRate | toPercentage }}</span>
- <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
- <span
- slot="activeRegisterRate"
- slot-scope="activeRegisterRate"
- >{{ activeRegisterRate | toPercentage }}</span>
- <span
- slot="gameAddictionRate"
- slot-scope="gameAddictionRate"
- >{{ gameAddictionRate | toPercentage }}</span>
- <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
-
- <span slot="coverUrl" slot-scope="text,record">
- <a-popover placement="right">
- <template slot="content">
-
- <video :src="record.videoId_dictText" style="width:250px" controls ></video>
- </template>
- <template slot="title">
-
- </template>
-
- <img :src="record.imageId_dictText" alt="" style="width:100px">
- </a-popover>
- </span>
- </a-table>
- </div>
- </div>
-
- </div>
- </div>
- </template>
- <script>
- import moment from 'moment';
- import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
- const SHOW_PARENT = TreeSelect.SHOW_PARENT;
- import { TreeSelect } from 'ant-design-vue';
- import qs from 'qs'
- // 引入基本模板
- var echarts = require('echarts')
- import 'echarts/map/js/china'
- // 引入柱状图组件
- require('echarts/lib/chart/bar')
- // require('echarts/lib/chart/pie')
- require('echarts/lib/chart/line')
- require('echarts/lib/chart/map')
- // 引入提示框和title组件
- require('echarts/lib/component/tooltip')
- require('echarts/lib/component/title')
- require('echarts/lib/component/graphic')
- require('echarts/lib/component/toolbox')
- require('echarts/lib/component/legend')
- let option = {
- color: ['#1890ff'],
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: 'line' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {
- left: '0%',
- right: '0%',
- bottom: '0%',
- top: '12%',
- containLabel: false,
-
- },
- xAxis: [
- {
- type: 'category',
- data: [],
- show: true,
-
- axisTick: {
- alignWithLabel: true
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- show: false
- }
- ],
- series: [
- {
- name: '',
- type: 'bar',
- barWidth: '40%',
- smooth: true,
- areaStyle:{},
- itemStyle: {
- color: new echarts.graphic.LinearGradient(
- 0, 0, 0, 1,
- [
- {offset: 0, color: '#1890ff'},
- {offset: 1, color: '#FFF'}
- ]
- )
- },
- data: []
- }
- ]
- }
- const regionColumns = [
- {
- title: '地域',
- dataIndex: 'region',
- key: 'region',
- align: 'center',
- scopedSlots: { customRender: 'region' },
- width:120,
- fixed: 'left' ,
- },
- ];
- const sexColumns = [
- {
- title: '性别',
- dataIndex: 'sex',
- key: 'sex',
- align: 'center',
- scopedSlots: { customRender: 'sex' },
- width:120,
- fixed: 'left' ,
- },
- ];
- const ageColumns = [
- {
- title: '年龄',
- dataIndex: 'age',
- key: 'age',
- align: 'center',
- scopedSlots: { customRender: 'age' },
- width:120,
- fixed: 'left' ,
- },
- ];
- const material = [
- {
- title: '素材',
- dataIndex: 'coverUrl',
- key: 'coverUrl',
- align: 'center',
- scopedSlots: { customRender: 'coverUrl' },
- width:120,
- fixed: 'left' ,
- },
- {
- title: '关联创意数',
- dataIndex: 'creativeCount',
- key: 'creativeCount',
- align: 'center',
- scopedSlots: { customRender: 'creativeCount' },
-
- },
- // {
- // title: '关联广告组数',
- // dataIndex: 'relativeGroup',
- // key: 'relativeGroup',
- // align: 'center',
- // scopedSlots: { customRender: 'relativeGroup' },
-
- // },
- {
- title: '广告场景',
- dataIndex: 'scenes',
- key: 'scenes',
- align: 'center',
- scopedSlots: { customRender: 'scenes' },
-
- },
- // {
- // title: '3s播放数',
- // dataIndex: '3',
- // key: '3',
- // align: 'center',
- // scopedSlots: { customRender: '3' },
-
- // },
- // {
- // title: '10s播放数',
- // dataIndex: '10',
- // key: '10',
- // align: 'center',
- // scopedSlots: { customRender: '10' },
-
- // },
- // {
- // title: '3s完播率',
- // dataIndex: 'playOver',
- // key: 'playOver',
- // align: 'center',
- // scopedSlots: { customRender: 'playOver' },
-
- // },
- // {
- // title: '10s完播率',
- // dataIndex: '10playOver',
- // key: '10playOver',
- // align: 'center',
- // scopedSlots: { customRender: '10playOver' },
-
- // },
- // {
- // title: '完播率',
- // dataIndex: 'playOverRate',
- // key: 'playOverRate',
- // align: 'center',
- // scopedSlots: { customRender: 'playOverRate' },
-
- // },
- ];
- const directional = [
- {
- title: '出价包名称',
- dataIndex: 'name',
- key: 'name',
- align: 'center',
- scopedSlots: { customRender: 'name' },
- width:200,
- flex:'left'
- },
- {
- title: '关联广告组数',
- dataIndex: 'group',
- key: 'group',
- align: 'center',
- scopedSlots: { customRender: 'group' },
-
- },
- {
- title: '覆盖人群',
- dataIndex: 'coverPoepele',
- key: 'coverPoepele',
- align: 'center',
- scopedSlots: { customRender: 'coverPoepele' },
-
- },
- {
- title: '地域分布',
- dataIndex: 'region',
- key: 'region',
- align: 'center',
- scopedSlots: { customRender: 'region' },
-
- },
- {
- title: '年龄分布',
- dataIndex: 'age',
- key: 'age',
- align: 'center',
- scopedSlots: { customRender: 'age' },
-
- },
- {
- title: '商业兴趣分布',
- dataIndex: 'url',
- key: 'url',
- align: 'center',
- scopedSlots: { customRender: 'url' },
-
- },
- {
- title: '性别分布',
- dataIndex: 'sex',
- key: 'sex',
- align: 'center',
- scopedSlots: { customRender: 'sex' },
-
- },
- ]
- const publicColumns = [
- {
- title: '消耗(元)',
- dataIndex: 'cost',
- width:150,
- tip: '广告在投放期间的花费总额',
- align: 'center',
- scopedSlots: { customRender: 'cost' },
- // sorter: () => {}
- },
- {
- title: '封面曝光数',
- dataIndex: 'photoShow',
- tip: '广告在瀑布流被观看次数',
- align: 'center',
- scopedSlots: { customRender: 'photoShow' },
- // sorter:() => {}
- },
- {
- title: '封面点击数',
- dataIndex: 'photoClick',
- tip: '用户点击封面进入视频播放页的次数(数据会进行反作弊去重)',
- align: 'center',
-
- scopedSlots: { customRender: 'photoClick' },
- // sorter: () => {}
- },
- {
- title: '素材曝光数',
- dataIndex: 'aclick',
- tip: '用户进入视频播放页观看的次数(数据会进行反作弊去重)',
- align: 'center',
-
- scopedSlots: { customRender: 'aClick' },
- // sorter:() => {}
- },
- {
- title: '行为数',
- dataIndex: 'bclick',
- tip: '用户在视频播放页单击转化按钮的次数/展示数*100%',
- align: 'center',
-
- scopedSlots: { customRender: 'bClick' },
- // sorter:() => {}
- },
- {
- title: '封面点击率',
- dataIndex: 'clickRate',
- tip: '封面点击数占封面展示数百分比',
- align: 'center',
- scopedSlots: { customRender: 'clickRate' },
- // sorter:() => {}
- },
- {
- title: '行为率',
- dataIndex: 'bClickRate',
- tip: '行为数占素材曝光数百分比',
- align: 'center',
- scopedSlots: { customRender: 'bClickRate' },
- // sorter:() => {}
- },
- {
- title: '平均千次封面曝光花费(元)',
- dataIndex: 'cpm',
- tip: '花费/封面曝光数*1000',
- align: 'center',
- scopedSlots: { customRender: 'cpm' },
- // sorter:() => {}
- },
- {
- title: '平均封面点击单价(元)',
- dataIndex: 'cpc',
- tip: '花费/封面点击数',
- align: 'center',
- scopedSlots: { customRender: 'cpc' },
- // sorter:() => {}
- },
-
- {
- title: '激活数',
- dataIndex: 'active',
- tip: '广告主回传的应用激活次数',
- align: 'center',
- scopedSlots: { customRender: 'active' },
- // sorter:() => {}
- },
- {
- title: '激活单价',
- dataIndex: 'activeCost',
- tip: '花费/激活数',
- align: 'center',
- scopedSlots: { customRender: 'activeCost' },
- // sorter:() => {}
- },
- {
- title: '下载完成激活率',
- dataIndex: 'activeRate',
- tip: '激活数/安卓下载完成数',
- align: 'center',
- scopedSlots: { customRender: 'activeRate' },
- // sorter:() => {}
- },
- {
- title: '注册数',
- dataIndex: 'register',
- tip: '付费金额/当日消耗',
- align: 'center',
- scopedSlots: { customRender: 'register' },
- // sorter:() => {}
- },
- {
- title: '注册成本',
- dataIndex: 'activeRegisterCost',
- tip: '当日消耗/当日回传注册数',
- align: 'center',
- scopedSlots: { customRender: 'activeRegisterCost' },
- // sorter:() => {}
- },
- {
- title: '注册率',
- dataIndex: 'activeRegisterRate',
- tip: '当日回传注册数/当日激活数',
- align: 'center',
- scopedSlots: { customRender: 'activeRegisterRate' },
- // sorter:() => {}
- },
- {
- title: '次留数',
- dataIndex: 'nextDayOpen',
- tip: '前一日激活用户在次日继续访问的PV',
- align: 'center',
- scopedSlots: { customRender: 'nextDayOpen' },
- // sorter:() => {}
- },
-
- {
- title: '次留率',
- dataIndex: 'nextDayOpenRate',
- tip: '前一日激活用户在次日继续访问的PV/前一日激活数',
- align: 'center',
- scopedSlots: { customRender: 'nextDayOpenRate' },
- // sorter:() => {}
- },
- ]
- export default {
- data() {
- return {
- analysisDirection:1,
- spinning:false,
- materialId:[],
- treeData: [],
- materialTreeData:[],
- SHOW_PARENT,
- userId:'',
- tabKey:1,
- loading:false,
- 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;
- }
- },
- tableValue:1,
- accountIds:undefined,
- accountList:[],
- directionalId:undefined,
- value:1,
- columns:[...regionColumns,...publicColumns],
- tableData:[],
- dateRange: [],
- topOption: JSON.parse(JSON.stringify(option)),
- scrollX:2500,
- materialipagination: {
- 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;
- }
- },
- materialColumns:[...material,...publicColumns],
- materialtableData:[],
- materialloading:false,
- materialscrollX:4000,
- age:[],
- gender:[],
- region:[],
- currentStrategy:{},
- }
- },
- methods: {
- filterOption(input, option) {
- return (
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- );
- },
- // //项目改变后的事件
- treeChange(val) {
- // console.log(this.treeData)
- console.log(val)
- this.directionalId = [];
- //选择一个后禁用其他
- if(val.length==1){
- if(val[0].indexOf('strategy')==-1){
- let selectindex=0
- this.treeData.forEach((ele,index)=>{
- if(ele.children){
- ele.children.map((item,ind)=>{
- if(item.value==val[0]){
- selectindex=index;
- }
- })
- }
- });
- // console.log(selectindex)
- if(selectindex ||selectindex==0){
- this.treeData.forEach((ele,index)=>{
- if(index!=selectindex){
- ele.disableCheckbox = true;
- if(ele.children){
- ele.children.map((item,ind)=>{
- item.disableCheckbox = true;
- })
- }
- }
- })
- }
-
- }else{
- // console.log(1)
- this.treeData.forEach((ele,index)=>{
- if(ele.value!=val[0]){
- ele.disableCheckbox = true;
-
- if(ele.children){
- ele.children.forEach((item,ind)=>{
- item.disableCheckbox = true;
- })
- }
- }
-
- })
- }
- // console.log(this.mediaId)
-
- }
- if(val.length==0){
- this.treeData.forEach((ele,index)=>{
- ele.disableCheckbox = false;
-
- if(ele.children){
- ele.children.forEach((item,ind)=>{
- item.disableCheckbox = false;
- })
- }
-
- });
-
- }
- if(val){
- val.forEach((ele,index)=>{
- if(ele.indexOf('strategy')==-1){
- this.directionalId.push(ele)
- }else{
- let projectArr=this.treeData.filter((item)=>{
- return item.value==ele
- });
- // console.log(projectArr)
- projectArr[0].children.forEach((element)=>{
- this.directionalId.push(element.value)
- })
- }
- })
- }
-
- console.log(this.directionalId);
- this.getRelativeData()
-
- },
-
- //请求项目和账户内容
- accountHttp(){
- this.treeData=[];
- this.directionalId=[];
- getAction('/ai/analyze/getStrategyAndTarget', {
- accountId:this.accountIds
- }).then(res => {
- if(res.success){
- // console.log(res);
- if(res.result){
- res.result.forEach((element,index) => {
- if(element){
- this.treeData.push({});
- this.treeData[index].title=element.strategy_name +'_('+ element.id +')';
- this.treeData[index].value='strategy'+element.id;
- this.treeData[index].key=element.id;
-
- this.treeData[index].children=[];
-
- if(element.targets.length&&element.targets[0]){
- element.targets.forEach((ele,i)=>{
- this.treeData[index].children.push({});
- this.treeData[index].children[i].title=ele.target_type+'_'+ele.target_content
- this.treeData[index].children[i].value=element.id+'_'+ele.id;
- this.treeData[index].children[i].key=element.id+'_'+ele.id;
- })
-
- }
- }
- });
- // console.log(this.treeData)
- this.directionalId=[this.treeData[0].children[0].value]
-
- }
- }
- })
- },
- accountMaterialHttp(){
- this.materialTreeData=[];
- this.materialId=[];
- getAction('/ai/analyze/getStrategyAndMaterial', {
- accountId:this.accountIds
- }).then(res => {
- if(res.success){
- // console.log(res);
- if(res.result){
- res.result.forEach((element,index) => {
- if(element){
- this.materialTreeData.push({});
- this.materialTreeData[index].title=element.strategy_name +'_('+ element.id +')';
- this.materialTreeData[index].value='strategy'+element.id;
- this.materialTreeData[index].key=element.id;
-
- this.materialTreeData[index].children=[];
-
- if(element.materials.length&&element.materials[0]){
- element.materials.forEach((ele,i)=>{
- this.materialTreeData[index].children.push({});
- this.materialTreeData[index].children[i].title=ele.material_name
- this.materialTreeData[index].children[i].value=element.id+'_'+ele.code;
- this.materialTreeData[index].children[i].key=element.id+'_'+ele.code;
- this.materialTreeData[index].children[i].coverUrl=ele.cover_url;
- })
-
- }
- }
- });
- // console.log(this.treeData)
- this.materialId=[this.materialTreeData[0].children[0].value]
- }
- }
- })
- },
- materialTreeChange(val){
- console.log(val)
- this.materialId = [];
- //选择一个后禁用其他
- if(val.length==1){
- if(val[0].indexOf('strategy')==-1){
- let selectindex=0
- this.materialTreeData.forEach((ele,index)=>{
- if(ele.children){
- ele.children.map((item,ind)=>{
- if(item.value==val[0]){
- selectindex=index;
- }
- })
- }
- });
- // console.log(selectindex)
- if(selectindex ||selectindex==0){
- this.materialTreeData.forEach((ele,index)=>{
- if(index!=selectindex){
- ele.disableCheckbox = true;
- if(ele.children){
- ele.children.map((item,ind)=>{
- item.disableCheckbox = true;
- })
- }
- }
- })
- }
-
- }else{
- // console.log(1)
- this.materialTreeData.forEach((ele,index)=>{
- if(ele.value!=val[0]){
- ele.disableCheckbox = true;
-
- if(ele.children){
- ele.children.forEach((item,ind)=>{
- item.disableCheckbox = true;
- })
- }
- }
-
- })
- }
- // console.log(this.mediaId)
-
- }
- if(val.length==0){
- this.materialTreeData.forEach((ele,index)=>{
- ele.disableCheckbox = false;
-
- if(ele.children){
- ele.children.forEach((item,ind)=>{
- item.disableCheckbox = false;
- })
- }
-
- });
-
- }
- if(val){
- val.forEach((ele,index)=>{
- if(ele.indexOf('strategy')==-1){
- this.materialId.push(ele)
- }else{
- let projectArr=this.materialTreeData.filter((item)=>{
- return item.value==ele
- });
- console.log(projectArr)
- projectArr[0].children.forEach((element)=>{
- this.materialId.push(element.value)
- })
- }
- })
- }
-
- console.log(this.materialId);
- this.getRelativeData()
- },
- accountChange(val){
- console.log(val);
- if(val){
- if(this.tabKey==1){
- this.accountHttp()
- }else if(this.tabKey==2){
- this.accountMaterialHttp()
- }
- }
-
-
- },
- disabledDate(current) {
- return current && current > moment()
- },
- dateChange(date, dateString) {
- // console.log(date,dateString)
- },
- chartDataTypeChange(e) {
- console.log('radio checked', e.target.value);
- this.getEchartData()
- },
- tableTypeChange(e){
- console.log('radio checked', e.target.value);
- if(e.target.value==2){
- this.columns=[...sexColumns,...publicColumns];
- this.tableData=this.gender
- }else if(e.target.value==1){
- this.columns=[...regionColumns,...publicColumns]
- this.tableData=this.region
- }else if(e.target.value==3){
- this.columns=[...ageColumns,...publicColumns]
- this.tableData=this.age
- }
- // this.getEchartData()
-
- },
- // directionalTableHttp(){
- // this.loading=true;
- // postAction('',{
- // }).then(res=>{
- // console.log(res)
- // })
- // },
- // materialTableHttp(){
- // this.loading=true;
- // postAction('',{
- // }).then(res=>{
- // console.log(res)
- // })
- // },
- directionalIdChange(val){
- console.log(val)
- },
- //获取echart的值
- initEchart(idName, optionName) {
- const chart = this.$refs[idName]
- // console.log(chart)
- if (chart) {
- const myChart = echarts.init(document.getElementById(idName))
- // myChart.showLoading({
- // text: "图表数据正在努力加载..."
- // });
-
- myChart.setOption(optionName)
- window.addEventListener('resize', function() {
- myChart.resize()
- })
- }
- },
- // province,data
- handlerMapEchartOption(province,data){
-
- var res = [];
- for (var j = 0; j < data.length; j++) {
- res.push({
- name: province[j],
- value: data[j]
- });
- }
- console.log(res)
- // res.sort(function(a, b) {
- // // console.log(a,b)
- // return a.value - b.value;
- // });
- // var res1 = [];
- // var res2 = [];
- // for (var t = 0; t < 10; t++) {
- // res1[t] = res[res.length - 1 - t].name;
- // res2[t] = res[res.length - 1 - t].value;
- // }
- var option = {
- title: {
- text: '省级地域分布',
- // subtext: '仅供参考',
- left: 'left',
- },
- tooltip: {
- show: true,
- formatter: function(params) {
- return params.name + ':' + params.value
- },
- },
- visualMap: {
- type: 'piecewise',
- // text: ['头', '尾'],
- pieces: [{
- min: 100000,
- color: '#73240D',
- },
- {
- min: 50000,
- max: 100000,
- color: '#BB0000',
- },
- {
- min: 30000,
- max: 50000,
- color: '#BD430A',
- },
- {
- min: 10000,
- max: 30000,
- color: '#E08150',
- },
- {
- min: 5000,
- max: 10000,
- color: '#E9B090',
- },
- {
- min: 1000,
- max: 5000,
- color: '#F2DDD2',
- },
- {
- value: 0,
- color: '#F1eeee',
- },
- ],
- orient: 'vertical',
- itemSymbol: 'circle',
- itemWidth: 20,
- itemHeight: 20,
- showLabel: true,
- seriesIndex: [0],
- textStyle: {
- color: '#7B93A7'
- },
- bottom: '10%',
- left: "5%",
- },
- grid: {
- right: '5%',
- top: '20%',
- left:'20%',
- bottom: '10%',
- width: '20%'
- },
- xAxis: {
- min: 0,
- // max: 4000,
- show: false
- },
-
- geo: {
- map: 'china',
- // right: '35%',
- left: '30%',
- label: {
- emphasis: {
- show: false,
- }
- },
- itemStyle: {
- emphasis: {
- areaColor: '#99FF99'
- }
- }
- },
- series: [{
- name: 'mapSer',
- type: 'map',
- map: 'china',
- roam: false,
- geoIndex: 0,
- label: {
- show: false,
- },
- data: res
- }
- ]
- };
- console.log(option)
- return option
- },
-
- handlerSexOption(data){
-
- var option = {
-
- color: ['#37a2da','#32c5e9','#9fe6b8','#ffdb5c','#ff9f7f','#fb7293','#e7bcf3','#8378ea'],
- tooltip : {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- toolbox: {
- show : true,
-
- },
- title: {
- text: '性别分布',
- // subtext: '仅供参考',
- left: 'left',
- },
- legend: {
-
- type:"scroll",
- orient: 'vertical',
- left:'2%',
- align:'left',
- top:'middle',
- textStyle: {
- color:'#8C8C8C'
- },
- height:100
- },
- series : [
- {
- name:'性别分布',
- type:'pie',
- radius : [0, 100],
-
-
- data,
- }
- ]
- };
- return option
- },
- handlerAgeOption(data){
- const colorList = ['#58D5FF', '#73ACFF', '#FDD56A', '#FDB36A', '#FD866A','#9E87FF']
- var option = {
- tooltip: {
- trigger: 'item',
- formatter: "{a} <br/>{b} : {c} ({d}%)"
- },
- toolbox: {
- show : true,
-
- },
- title: {
- text: '年龄分布',
- // subtext: '仅供参考',
- left: 'left',
- },
- // grid: {
- // right: '5%',
- // top: '20%',
- // left:'15%',
- // bottom: '10%',
- // width: '20%'
- // },
- legend: {
-
- type:"scroll",
- orient: 'vertical',
- left:'2%',
- align:'left',
- top:'middle',
- textStyle: {
- color:'#8C8C8C'
- },
- height:200
- },
- series: [{
- type: 'pie',
- // center: ['30%', '30%'],
- radius: ['30%', '60%'],
- minAngle: 10 ,
- avoidLabelOverlap: true,
- hoverOffset: 15,
- itemStyle: {
- color: (params) => {
- return colorList[params.dataIndex]
- }
- },
- label: {
- show: true,
- position: 'outer',
- alignTo: 'labelLine',
- // ·圆点
- backgroundColor: 'auto',//圆点颜色,auto:映射的系列色
- height: 0,
- width: 0,
- lineHeight: 0,
- // height,width.lineHeight必须为0
- distanceToLabelLine: 0,//圆点到labelline距离
- borderRadius: 2.5,
- padding: [2.5, -2.5, 2.5, -2.5],
- /*radius和padding为圆点大小,圆点半径为几radius和padding各项数值就为几
- 如:圆点半径为1
- borderRadius: 1,
- padding: [1, -1, 1, -1]
- */
- formatter: '{a|{b}:}{b|{d}%}',
- rich: {
- a: {
- padding: [0, 0, 0, 10]
- },
- b: {
- padding: [0, 10, 0, 0]
- }
- }
- },
- data,
- }, ]
- }
- return option
- },
- //点击分页
- // sort(pagination, filters, sorter, { currentDataSource }){
- // console.log(pagination)
- // this.ipagination.current=pagination.current;
- // this.ipagination.pageSize=pagination.pageSize;
- // this.getEchartData()
- // },
- materialTableChange(pagination, filters, sorter, { currentDataSource }){
- console.log(pagination)
- this.materialipagination.current=pagination.current;
- this.materialipagination.pageSize=pagination.pageSize;
- this.getRelativeData()
- },
- tabChange(key){
- console.log(key)
- this.accountIds=undefined;
- this.directionalId=[];
- this.materialId=[];
- if(key==1){
- this.materialColumns=[...material,...publicColumns]
- }else{
- this.materialColumns=[...directional,...publicColumns]
- }
- // this.getRelativeData()
- },
- getEchartData(){
-
- let params=this.handlerParams();
- params.dataType=this.value
- if(params.accountId&&(params.targetIds||params.codes)){
- this.spinning=true;
- this.loading=true
- postAction('/ai/analyze/chart/targetOrMaterial',params).then(res=>{
- console.log(res)
- this.spinning=false;
- this.loading=false
- if(res.success){
- this.age=res.result.age
- this.gender=res.result.gender
- this.region=res.result.region
- var province = ['北京', '广东', '浙江', '湖南', '河南', '安徽', '重庆', '山东', '江西', '四川', '江苏', '湖北', '福建', '上海', '广西', '河北', '陕西', '云南', '海南', '黑龙江', '辽宁', '山西', '天津', '甘肃', '内蒙古', '新疆', '宁夏', '吉林', '贵州', '青海', '西藏', '澳门', '香港', '台湾'];
-
- let params=this.handlerRegion(province,this.region)
- console.log(params)
- this.initEchart('mapEchart',this.handlerMapEchartOption(province,params))
-
-
- let genderData=this.handlerGender(this.gender)
- this.initEchart('sexEchart',this.handlerSexOption(ageData))
-
- let ageData=this.handlerAge(this.age)
- this.initEchart('ageEchart',this.handlerAgeOption(ageData))
- this.spinning=false
- if(this.tableValue==1){
- this.tableData=res.result.region
- }else if(this.tableValue==2){
- this.tableData=res.result.gender
- }else if(this.tableValue==3){
- this.tableData=res.result.age
- }
- }
- })
- }
- },
- handlerRegion(province,data){
-
- let value=[];
- switch (this.value) {
- case 1:
- province.forEach((ele,index)=>{
- value=data.map(item=>{
- if(item.province==ele){
- if(item.cost){
- return item.cost
- }else{
- return 0
- }
- }
-
- })
- })
-
- break;
- case 2:
- province.forEach((ele,index)=>{
- value=data.map(item=>{
- if(item.province==ele){
-
- if(item.photoShow){
- return item.photoShow
- }else{
- return 0
- }
- }
-
- })
- })
- break;
- case 3:
- province.forEach((ele,index)=>{
- value=data.map(item=>{
- if(item.province==ele){
- if(item.photoClick){
- return item.photoClick
- }else{
- return 0
- }
-
- }
-
- })
- })
- break;
- case 4:
- province.forEach((ele,index)=>{
- value=data.map(item=>{
- if(item.province==ele){
- if(item.aclick){
- return item.aclick
- }else{
- return 0
- }
- }
-
- })
- })
- break;
-
- default:
- break;
- }
- return value
- },
- handlerGender(data){
- let value=[];
- switch (this.value) {
- case 1:
-
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.cost,
- name:item.gender
- }
- }
-
- })
-
-
- break;
- case 2:
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.photoShow,
- name:item.gender
- }
- }
-
- })
-
- break;
- case 3:
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.photoClick,
- name:item.gender
- }
- }
-
- })
- break;
- case 4:
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.aclick,
- name:item.gender
- }
- }
-
- })
- break;
-
- default:
- break;
- }
- return value
- },
- handlerAge(data){
- let value=[];
- switch (this.value) {
- case 1:
-
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.cost,
- name:item.ageSegment
- }
- }
-
- })
-
-
- break;
- case 2:
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.photoShow,
- name:item.ageSegment
- }
- }
-
- })
-
- break;
- case 3:
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.photoClick,
- name:item.ageSegment
- }
- }
-
- })
- break;
- case 4:
- value=data.map(item=>{
-
- if(item.cost){
- return {
- value:item.aclick,
- name:item.ageSegment
- }
- }
-
- })
- break;
-
- default:
- break;
- }
- return value
- },
- getDetailTableData(){
-
- let params=this.handlerParams();
- if(params.accountId&&(params.targetIds||params.codes)){
- params.dataType=this.tableValue
- this.loading=true
- postAction('',params).then(res=>{
- console.log(res)
- this.loading=false
- this.tableData=res.result.list
- })
- }else{
-
- }
- },
- getRelativeData(){
-
- let params=this.handlerParams();
- // params.dataType=this.tableValue
- if(params.accountId&&(params.targetIds||params.codes)){
- this.materialloading=true
- postAction('/ai/analyze/report/targetOrMaterial',params).then(res=>{
- console.log(res)
- this.materialloading=false
- if(res.success){
- this.materialtableData=res.result.list
- this.ipagination.total=res.result.total;
- }else{
- this.$message.error('出错了')
- }
-
- })
- }else{
- this.$message.error('请选择账户、策略等信息')
- }
-
- },
- search(){
-
- this.getRelativeData()
-
- this.getEchartData()
- },
- handlerParams(){
- let params={};
- params.accountId=this.accountIds
- if(this.tabKey==1){
- if(this.directionalId&&this.directionalId.length){
- params.type='target'
- params.strategyId=this.directionalId[0].split('_')[0]
- params.targetIds=this.directionalId.map(item=>{
- return item.split('_')[1]
- })
- }
-
- }else{
- params.type='material'
- if(this.materialId&&this.materialId.length){
- params.strategyId=this.materialId[0].split('_')[0]
- params.codes=this.materialId.map(item=>{
- return item.split('_')[1]
- })
- }
-
- }
- if(this.dateRange&&this.dateRange.length>0){
- params.startDate=this.dateRange[0].format('YYYY-MM-DD')
- params.endDate=this.dateRange[1].format('YYYY-MM-DD')
- }
- params.pageNo=this.ipagination.current;
- params.pageSize=this.ipagination.pageSize
- return params
- },
- handlerInitData(currentStrategy){
- if(currentStrategy){
- this.currentStrategy=JSON.parse(currentStrategy)
- this.accountIds=this.currentStrategy.accountId;
-
- if(this.tabKey==1){
- this.treeData=[];
- this.directionalId=[];
- getAction('/ai/analyze/getStrategyAndTarget', {
- accountId:this.accountIds
- }).then(res => {
- if(res.success){
- // console.log(res);
- if(res.result){
- res.result.forEach((element,index) => {
- if(element){
- this.treeData.push({});
- this.treeData[index].title=element.strategy_name +'_('+ element.id +')';
- this.treeData[index].value='strategy'+element.id;
- this.treeData[index].key=element.id;
-
- this.treeData[index].children=[];
-
- if(element.targets.length&&element.targets[0]){
- element.targets.forEach((ele,i)=>{
- this.treeData[index].children.push({});
- this.treeData[index].children[i].title=ele.target_type+'_'+ele.target_content
- this.treeData[index].children[i].value=element.id+'_'+ele.id;
- this.treeData[index].children[i].key=element.id+'_'+ele.id;
- })
-
- }
- }
- });
- // console.log(this.treeData)
- // this.directionalId=[this.treeData[0].children[0].value]
- // this.treeData.map((item=>{
- // if(){
- // }
- // }))
- this.directionalId=[`strategy${this.currentStrategy.id}`]
- this.treeChange(this.directionalId)
- }
- }
- })
- }else if(this.tabKey==2){
- this.accountMaterialHttp()
- }
- }
- }
- },
-
- mounted() {
- // this.$nextTick(()=>{
- // var province = ['北京', '广东', '浙江', '湖南', '河南', '安徽', '重庆', '山东', '江西', '四川', '江苏', '湖北', '福建', '上海', '广西', '河北', '陕西', '云南', '海南', '黑龙江', '辽宁', '山西', '天津', '甘肃', '内蒙古', '新疆', '宁夏', '吉林', '贵州', '青海', '西藏', '澳门', '香港', '台湾'];
- // var data = [3554, 241, 296, 221, 206, 152, 147, 121, 109, 108, 99, 91, 80, 80, 58, 48, 56, 51, 43, 37, 34, 27, 24, 24, 16, 13, 12, 9, 9, 6, 0, 7, 8, 8]
- // this.initEchart('mapEchart',this.handlerMapEchartOption(province,data))
- // var data1=[
- // {value:20, name:'男'},
- // {value:30, name:'女'},
- // {value:25, name:'其他'},
-
- // ]
- // this.initEchart('sexEchart',this.handlerSexOption(data1))
- // var data2= [
- // {
- // name: 'first',
- // value: 1
- // }, {
- // name: 'second',
- // value: 2
- // }, {
- // name: 'third',
- // value: 3
- // }, {
- // name: 'fourth',
- // value: 4
- // }, {
- // name: 'fifth',
- // value: 5
- // }, {
- // name: 'sixth',
- // value: 6
- // }]
- // this.initEchart('ageEchart',this.handlerAgeOption(data2))
- // })
- let userInfo=localStorage.getItem('pro__Login_Userinfo');
- let currentStrategy=localStorage.getItem('currentStrategy');
- let userId=''
- if(userInfo){
- this.userId=JSON.parse(userInfo).value.id
- }
- this.handlerInitData(currentStrategy)
- getAction('/ctop/userAllocation/getAccountIdsByUserId',{
- userId:this.userId,
- }).then(res=>{
- console.log(res)
- if(res.success){
- this.accountList=res.result
- }
- })
-
- },
- filters: {
- toPercentage(val) {
- if(val){
- if(typeof val != 'string'){
- return (val * 100).toFixed(2) + '%'
- }else{
- return val
- }
- }else if(typeof val =='string'){
- return val
- }
- else{
- return 0
- }
- },
- //保留两位小数并且变成货币格式
- 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||val==0)&& typeof val !='string'){
- 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 if(typeof val =='string'){
- return val
- }
- else{
- return '-'
- }
-
- }
- }
- }
-
- </script>
- <style lang="scss">
- .autoLaunchReport{
- .ant-tooltip-inner,.ant-tooltip-arrow::before{
- background-color: #fff;
- color: #333;
- }
- .tabBody2{
- .ant-tabs-nav .ant-tabs-tab {
- position: relative;
- display: inline-block;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- height: 100%;
- margin: 0 ;
- padding: 10px 20px ;
- text-decoration: none;
- cursor: pointer;
- -webkit-transition: color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
- transition: color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
- font-size: 15px;
- }
- }
- }
-
- </style>
- <style lang="scss" scoped>
- .autoLaunchReport {
- background-color: #fff;
- padding: 10px 20px;
- position: relative;
- width: 100%;
- .OptinItem{
- display: inline-block;
- margin-right: 15px;
- margin-top: 15px;
- .ok{
- margin-right: 15px;
- }
- }
- .OptinItem:first-child{
- margin-right: 10px;
- }
- .topOptions{
- padding: 0px 10px 10px;
- margin-top: -9px;
- position: relative;
- .topOpt{
- width: 100%;
- margin-bottom: 10px;
- }
- }
- .optionBtn{
- // display: inline-block;
- // float: right;
- // margin-top: 10px;
- .searchBtn{
- // margin-right: 10px;
- position: absolute;
- right: 10px;
- bottom: 10px;
- }
- }
- .circul{
- width: 5px;
- height: 5px;
- border-radius: 50%;
- background-color: #32CD32;;
- }
- .show{
- // background-color: #fff;
- width: 100%;
- display: flex;
- justify-content: space-between;
- // padding: 0px 15px;
- box-sizing: border-box;
- .showBox {
- width: 19%;
- box-sizing: border-box;
- padding: 15px 15px;
- background-color: #fff;
-
- .title {
- color: #999;
- font-size: 16px;
- position: relative;
- text-align: center;
- .infotitle{
- padding: 8px 0;
- }
-
- span {
- font-size: 1rem;
- // color: #1890ff;
- position: absolute;
- top: 0;
- right: 0;
- cursor: pointer;
- }
-
- }
- .infoNum{
- padding:10px 0;
- text-align: center;
- font-weight: 600;
- font-size: 20px;
- span{
- font-weight: 600;
- font-size: 16px;
- }
- .red{
- font-size: 20px;
- font-weight: 600;
- color: red;
- }
- .green{
- display: block;
- text-align: center;
- margin-left: 0.2rem;
- font-size: 14px;
- font-weight: 700;
- color: #32CD32;
- .huanbi{
- // color:#999;
- font-weight: 400;
- font-size: 14px;
- }
- }
- }
-
- }
- }
- .chartBox{
- background-color: #fff;
- margin: 15px 0px;
- padding: 2px 10px 30px;
- .chartBody{
- margin-top: 20px;
- display: flex;
- justify-content: space-between;
- }
- }
- .tableBox{
- background-color: #fff;
- margin: 15px 0px;
- padding: 15px 0px;
- .tableTop{
- position: relative;
- padding: 20px 0;
- border-top: 1px solid #e0e0e0;
- font-size: 24px;
- color: black;
- .selectTime{
- margin-right: 20px;
- }
- .add{
- position: absolute;
- top: 0;
- right: 0;
- }
- }
- .tableOpt{
- margin-bottom: 20px;
- }
- }
-
- }
- </style>
|