123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286 |
- <template>
- <div class="configuration-modal">
- <div>
- <a-form-model
- ref="ruleForm"
- class="config-form-modal"
- :model="configForm"
- :rules="rules"
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- >
- <p class="separate-title-header">{{ modalTitle === 'add' ? '新增' : '编辑'}}配置信息</p>
- <div class="separate-module-con">
- <a-form-model-item label="广告账户">
- <acount-search
- class="acount-search-class"
- :disabled="modalTitle === 'edit'"
- :appId.sync="configForm.accountId"
- :multiple="false"
- request="1,3"
- >
- </acount-search>
- </a-form-model-item>
- <a-form-model-item label="dp链接">
- <a-radio-group
- :disabled="modalTitle === 'edit'"
- v-model="configForm.dpLinkIndexUsed"
- button-style="solid"
- @change="handleDpLinkIndexUsed"
- >
- <a-radio-button :value="0">关闭</a-radio-button>
- <a-radio-button :value="1">开启</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <div v-if="configForm.dpLinkIndexUsed === 1">
- <a-form-model-item label="dp链接范围" class="dp-link-start" prop="dpLinkStartIndex">
- <a-input-number
- class="common-input"
- v-model="configForm.dpLinkStartIndex"
- :disabled="modalTitle === 'edit'"
- :min="1"
- placeholder="请输入"
- @change="handleDplinkStart"
- />
- <span>~</span>
- </a-form-model-item>
- <a-form-model-item class="dp-link-end" prop="dpLinkEndIndex">
- <a-input-number
- class="common-input"
- v-model="configForm.dpLinkEndIndex"
- :disabled="modalTitle === 'edit'"
- :min="getEndIndex"
- placeholder="请输入"
- @change="handleDplinkEnd"
- />
- </a-form-model-item>
- </div>
- <a-form-model-item label="预算方式">
- <a-radio-group
- v-model="configForm.accountBudgetMode"
- button-style="solid"
- @change="handleAccountMode"
- >
- <a-radio-button value="1">不限预算</a-radio-button>
- <a-radio-button value="2">指定预算</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item v-if="configForm.accountBudgetMode === '2'" label="账户日预算" prop="accountBudget">
- <a-input-number
- v-model="configForm.accountBudget"
- :min="1000"
- :max="9999999.99"
- :step="0.01"
- @blur="handleAccountBudget"
- /> 元
- </a-form-model-item>
- <div v-if="adBudgetShowTitle" style="width: 500px;color: #f00;margin-left: 140px;">单次修改预算幅度, 不能低于100.0元</div>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">广告组信息</p>
- <a-form-model-item label="推广目标">
- <a-radio-group :disabled="modalTitle === 'edit'" v-model="configForm.campaignLandingType" button-style="solid">
- <a-radio-button value="APP">应用</a-radio-button>
- <a-radio-button value="LINK" disabled>销售线索收集</a-radio-button>
- <a-radio-button value="SHOP" disabled>电商店铺推广</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="广告类型">
- <a-radio-group :disabled="modalTitle === 'edit'" v-model="configForm.advertisingType" button-style="solid">
- <a-radio-button value="1">信息流广告</a-radio-button>
- <a-radio-button value="2">搜索广告</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">基础信息</p>
- <a-form-model-item label="广告组名称" prop="campaignName">
- <a-input
- class="common-input-long"
- v-model="configForm.campaignName"
- allow-clear
- placeholder="请输入广告组名称"
- />
- </a-form-model-item>
- <a-form-model-item label="广告计划名称" prop="adName">
- <a-input
- class="common-input-long"
- id="groupName"
- v-model="configForm.adName"
- allow-clear
- placeholder="请输入广告计划名称"
- />
- <div>
- <a-tag
- v-for="item in adNameTags"
- :key="item"
- color="#1890ff"
- @click="handleGetChangeAll(item, 'groupName')"
- >
- + {{ item }}
- </a-tag>
- </div>
- </a-form-model-item>
- <a-form-model-item label="创建数量: 广告组数量" class="campaign-cnt-class" prop="campaignCnt">
- <a-input-number v-model="configForm.campaignCnt" :min="1" @change="handleCampaignCnt" :disabled="configForm.dpLinkIndexUsed === 0"/>
- <a-tooltip placement="top">
- <template slot="title">
- <span>输入的数量为每天所创建的广告组数量</span>
- <span>以及每个广告组创建的广告计划数量</span>
- </template>
- <a-icon class="form-itrm-icon" type="smile-o"/>
- </a-tooltip>
- <div v-if="campaignStatus" style="width: 500px;color: #f00;">单账号每天创建计划上限500个</div>
- </a-form-model-item>
- <a-form-model-item label="广告计划数量" class="campaign-ad-class" prop="campaignAdCnt">
- <a-input-number v-model="configForm.campaignAdCnt" :min="1" @change="handleCampaignAdCnt"/>
- </a-form-model-item>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">投放内容</p>
- <a-form-model-item label="投放目标">
- <a-radio-group :disabled="modalTitle === 'edit'" v-model="configForm.launchTarget" button-style="solid">
- <a-radio-button value="OCPM">转化量</a-radio-button>
- <a-radio-button value="CPC" disabled>点击量</a-radio-button>
- <a-radio-button value="CPM" disabled>展示量</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="下载方式">
- <a-radio-group
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adDownloadType"
- button-style="solid"
- @change="handleAdDownLoadType"
- >
- <a-radio-button value="DOWNLOAD_URL">下载链接</a-radio-button>
- <a-radio-button value="EXTERNAL_URL">落地页</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item v-if="configForm.adDownloadType === 'EXTERNAL_URL'" label="落地页链接" prop="adExternalUrl">
- <a-input
- class="common-input-long"
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adExternalUrl"
- placeholder="请输入落地页链接"
- allow-clear
- />
- </a-form-model-item>
- <a-form-model-item v-if="configForm.adDownloadType === 'EXTERNAL_URL'" label="直达链接内容">
- <a-input
- class="common-input-long"
- v-model="configForm.adOpenUrl"
- placeholder="请输入直达链接内容"
- allow-clear
- />
- </a-form-model-item>
- <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="下载链接" prop="adDownloadUrl">
- <a-input
- class="common-input-long"
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adDownloadUrl"
- placeholder="请输入下载链接"
- allow-clear
- @change="handleDownloadLink"
- />
- </a-form-model-item>
- <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用包名" prop="adPackage">
- <a-input
- class="common-input-long"
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adPackage"
- placeholder="请输入应用包名"
- allow-clear
- />
- </a-form-model-item>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">优化目标</p>
- <a-form-model-item label="转化跟踪方式" :prop="configForm.launchTarget === 'OCPM' ? 'adConvertType' : ''">
- <a-select
- class="common-input-long"
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adConvertType"
- placeholder="请选择"
- @change="handleConvertTypeChange"
- >
- <a-select-option value="AD_CONVERT_SOURCE_TYPE_APP_DOWNLOAD">应用下载API</a-select-option>
- <a-select-option value="AD_CONVERT_SOURCE_TYPE_SDK">应用下载SDK</a-select-option>
- <a-select-option value="AD_CONVERT_SOURCE_TYPE_OPEN_URL">应用直达API(应用直达链接)</a-select-option>
- <a-select-option value="AD_CONVERT_SOURCE_TYPE_NORMAL_APP_DOWNLOAD">普通应用下载</a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="优化目标" :prop="configForm.launchTarget === 'OCPM' ? 'adConvertId' : ''">
- <a-select
- class="common-input-long"
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adConvertId"
- placeholder="请选择"
- @change="handleConvertChange"
- >
- <a-select-option
- v-for="(item, index) in optimizationOption"
- :key="index"
- :value="item.convert_id"
- >
- {{ item.external_name }}
- </a-select-option>
- </a-select>
- </a-form-model-item>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">设置投放位置</p>
- <a-form-model-item label="广告位置">
- <a-radio-group
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adverPosition"
- button-style="solid"
- @change="handleAdverPosition"
- >
- <a-radio-button value="a">系统优选广告位</a-radio-button>
- <a-radio-button value="b">按媒体指定位置</a-radio-button>
- <a-radio-button value="c">按场景指定位置</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <div class="adver-position-radio">
- <p v-if="configForm.adverPosition === 'a'">
- 系统将根据您设置的定向,选择预估效果最好的广告位进行投放,并触达尽可能多的目标用户
- </p>
- <div v-if="configForm.adverPosition === 'c'" class="position-radio-change">
- <p>位置选择</p>
- <a-radio-group v-model="configForm.radioChangeValue">
- <a-radio :style="radioStyle" value="VIDEO_SCENE">沉浸式竖版视频场景</a-radio>
- <a-radio :style="radioStyle" value="FEED_SCENE">信息流场景</a-radio>
- <a-radio :style="radioStyle" value="TAIL_SCENE">视频后贴和尾帧场景</a-radio>
- </a-radio-group>
- </div>
- <div v-if="configForm.adverPosition === 'b'" class="position-radio-change">
- <p>位置选择</p>
- <a-checkbox-group v-model="configForm.checkboxChangeValue">
- <a-checkbox :style="radioStyle" value="INVENTORY_FEED">今日头条</a-checkbox>
- <a-checkbox :style="radioStyle" value="INVENTORY_VIDEO_FEED">西瓜视频</a-checkbox>
- <a-checkbox :style="radioStyle" value="INVENTORY_HOTSOON_FEED">抖音火山版</a-checkbox>
- <a-checkbox :style="radioStyle" value="INVENTORY_AWEME_FEED">抖音短视频</a-checkbox>
- <a-checkbox :style="radioStyle" value="INVENTORY_UNION_SLOT">穿山甲</a-checkbox>
- <a-checkbox :style="radioStyle" value="UNION_BOUTIQUE_GAME">ohayoo精品游戏</a-checkbox>
- <a-checkbox :style="radioStyle" value="INVENTORY_TOMATO_NOVEL">番茄小说</a-checkbox>
- </a-checkbox-group>
- </div>
- </div>
- </div>
- <div class="separate-module-con">
- <a-tabs v-model="selectPackageTabs" @change="handleSelectPackageTabs">
- <a-tab-pane key="1" tab="新建定向">
- <p class="rock-title">用户定向</p>
- <a-form-model-item label="地域">
- <a-radio-group v-model="configForm.adDistrict" button-style="solid">
- <a-radio-button value="NONE">不限</a-radio-button>
- <a-radio-button value="CITY">按省市</a-radio-button>
- <a-radio-button value="COUNTY" disabled>按区县</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <div v-if="configForm.adDistrict === 'CITY'" class="adver-position-radio selected-city-arr">
- <link-multi-select
- title="省份"
- :listArr="listArr"
- :maxLayers="2"
- :listUrl="regionCityListUrl"
- @getSelectedArr="getSelectedCityArr"
- @checkedShowList="handleCheckedShowList"
- >
- </link-multi-select>
- <a-radio-group class="city-arr-radio-group" v-model="configForm.adLocationType">
- <a-radio value="HOME">居住在该地区的用户</a-radio>
- <a-radio value="TRAVEL"> 到该地区旅行的用户</a-radio>
- <a-radio value="ALL">该地区内的所有用户</a-radio>
- <a-radio value="CURRENT">正在该地区的用户</a-radio>
- </a-radio-group>
- </div>
- <a-form-model-item label="性别">
- <a-radio-group v-model="configForm.adGender" button-style="solid">
- <a-radio-button value="NONE">不限</a-radio-button>
- <a-radio-button value="GENDER_MALE">男</a-radio-button>
- <a-radio-button value="GENDER_FEMALE">女</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="年龄">
- <radio-check v-model="configForm.adSelectAge" :options="ageArr" @change="getAgeSelect"></radio-check>
- </a-form-model-item>
- <a-form-model-item label="自定义人群">
- <a-radio-group v-model="configForm.customPerson" button-style="solid" @change="handleCustomPerson">
- <a-radio-button value="NONE">不限</a-radio-button>
- <a-radio-button value="a">自定义人群</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item v-if="configForm.customPerson === 'a'" label="定向逻辑">
- <a-radio-group v-model="configForm.adRetargetingTagsType" button-style="solid" @change="handleDirectionalLogic">
- <a-radio-button value="1">定向</a-radio-button>
- <a-radio-button value="2">排除</a-radio-button>
- <a-radio-button value="3">同时定向排除</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '1'" class="adver-position-radio">
- <div style="width: 60%;">
- <directional-logic
- ref="direct"
- packtype="directional"
- multitype="alone"
- :defaultlist="directionalData"
- :valueids="configForm.adRetargetingTagsType"
- :updatelistinclude="configForm.updateGetingInclude" @selection-alone-event="handleSelectionAloneEvent"
- @clearlist="handleClearlist"
- >
- </directional-logic>
- </div>
- </div>
- <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '2'" class="adver-position-radio">
- <div style="width: 60%;">
- <directional-logic
- ref="exclude"
- packtype="exclude"
- multitype="alone"
- :defaultlist="directionalData"
- :valueids="configForm.adRetargetingTagsType"
- :updatelistexclude="configForm.updateGetingExclude" @selection-alone-event="handleSelectionAloneEvent"
- @clearlist="handleClearlist"
- >
- </directional-logic>
- </div>
- </div>
- <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '3'" class="adver-position-radio">
- <div style="width: 60%;">
- <directional-logic
- ref="twoway"
- packtype="twoway"
- multitype="all"
- :defaultlist="directionalData"
- :valueids="configForm.adRetargetingTagsType"
- :updatelistinclude="configForm.updateGetingInclude"
- :updatelistexclude="configForm.updateGetingExclude" @selection-direct-event="handleDirectEvent"
- @selection-exclude-event="handleExcludeEvent"
- @clearlist="handleClearlist"
- >
- </directional-logic>
- </div>
- </div>
- <a-form-model-item label="媒体定向">
- <a-radio-group v-model="configForm.adSuperiorPopularityType" button-style="solid">
- <a-radio-button value="NONE">不限</a-radio-button>
- <a-radio-button value="GAME" disabled>游戏优质媒体</a-radio-button>
- <a-radio-button value="b" disabled>自定义</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="平台">
- <a-radio-group v-model="configForm.adPlatform" button-style="solid">
- <a-radio-button value="NONE" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">不限</a-radio-button>
- <a-radio-button value="IOS" :disabled="platformLoadingType === 'APP_ANDROID'">IOS</a-radio-button>
- <a-radio-button value="ANDROID" :disabled="platformLoadingType === 'APP_IOS'">Andriod</a-radio-button>
- <a-radio-button value="PC" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">PC</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="设备类型">
- <radio-check v-model="configForm.adDeviceSelectType" :options="deviceTypeList" @change="getAgeSelect"></radio-check>
- </a-form-model-item>
- <a-form-model-item v-if="configForm.adDownloadUrl" label="安卓版本">
- <a-radio-group v-model="configForm.adAndroidVersion" button-style="solid" @change="handleAndroidVersion">
- <a-radio-button value="NONE">不限</a-radio-button>
- <a-radio-button value="a">自定义</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <div class="adver-position-radio">
- <div v-if="configForm.adDownloadUrl && configForm.adAndroidVersion === 'a'" class="position-radio-change">
- <p>安卓版本</p>
- <a-radio-group v-model="configForm.androidChangeValue">
- <a-radio :style="radioStyle" value="9.0">Andriod 9.0及以上</a-radio>
- <a-radio :style="radioStyle" value="8.1">Andriod 8.1及以上</a-radio>
- <a-radio :style="radioStyle" value="8.0">Andriod 8.0及以上</a-radio>
- <a-radio :style="radioStyle" value="7.1">Andriod 7.1及以上</a-radio>
- <a-radio :style="radioStyle" value="7.0">Andriod 7.0及以上</a-radio>
- <a-radio :style="radioStyle" value="6.0">Andriod 6.0及以上</a-radio>
- <a-radio :style="radioStyle" value="5.1">Andriod 5.1及以上</a-radio>
- </a-radio-group>
- </div>
- </div>
- <a-form-model-item label="网络">
- <radio-check v-model="configForm.adSelectAc" :options="adAcList" @change="getAgeSelect"></radio-check>
- </a-form-model-item>
- <a-form-model-item label="已安装用户">
- <a-radio-group v-model="configForm.adHideIfExists" button-style="solid">
- <a-radio-button value="0">不限</a-radio-button>
- <a-radio-button value="1">过滤</a-radio-button>
- <a-radio-button value="2">定向</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item v-if="configForm.adConvertType" label="过滤已转化用户">
- <a-radio-group v-model="configForm.adHideIfConverted" button-style="solid">
- <a-radio-button
- v-for="item in adHideIfConvertedDataOption"
- :key="item.id"
- :value="item.id"
- >
- {{ item.name }}
- </a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="智能放量">
- <a-radio-group v-model="configForm.adAutoExtendEnabled" button-style="solid">
- <a-radio-button value="0">不开启</a-radio-button>
- <a-radio-button value="1">开启</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- </a-tab-pane>
- <a-tab-pane key="2" tab="选择定向包">
- <a-form-model-item class="select-orientation-class" label="选择已有定向包" :prop="selectPackageTabs === '2' ? 'adAudiencePackageId' : ''">
- <a-select
- class="common-input-long"
- v-model="configForm.adAudiencePackageId"
- allow-clear
- placeholder="请选择已有定向包名称"
- :disabled="selectOrientPlaceholder !== 'able'"
- @change="handleSelectiveOrientation"
- >
- <a-select-option
- v-for="(item, index) in selectiveList"
- :key="index"
- :value="item.audience_package_id"
- >
- {{ item.name }}
- </a-select-option>
- </a-select>
- <span style="margin-left: 20px;">
- <a-button :disabled="selectOrientPlaceholder !== 'able'" type="primary" @click="handleAsyncPackage">同步定向包</a-button>
- </span>
- <a-tooltip placement="top">
- <template slot="title">
- <span>已有定向包只展示当前推广目的和投放范围下,定向功能升级后仍可用的定向包</span>
- </template>
- <a-icon class="form-itrm-icon orientation-icon" type="smile-o"/>
- </a-tooltip>
- </a-form-model-item>
- <span v-if="selectOrientPlaceholder !== 'able'" style="color: #f00; margin-left: 198px;">{{ selectOrientPlaceholder }}</span>
- <div class="select-orientation-content">
- <p class="orientation-header-title">已选定向信息</p>
- <div v-if="packageMessageDetail.length" class="orientation-content-substance">
- <div class="content-substance-singal">
- <span class="singal-spn">定向人群包:</span>
- <span class="singal-content">{{ packageMessageDetail[0].description }}</span>
- </div>
- <div class="content-substance-singal">
- <span class="singal-spn">地域:</span>
- <span class="singal-content">{{ packageMessageDetail[0].replaceCitys }}</span>
- </div>
- <div class="content-substance-singal">
- <span class="singal-spn">性别:</span>
- <span class="singal-content">{{ packageMessageDetail[0].replaceSex }}</span>
- </div>
- <div class="content-substance-singal">
- <span class="singal-spn">年龄:</span>
- <span class="singal-content">{{ packageMessageDetail[0].replaceAge }}</span>
- </div>
- <div class="content-substance-singal">
- <span class="singal-spn">平台:</span>
- <span class="singal-content">{{ packageMessageDetail[0].replacePlate }}</span>
- </div>
- <div class="content-substance-singal">
- <span class="singal-spn">智能放量:</span>
- <span class="singal-content">{{ packageMessageDetail[0].replaceEnabled }}</span>
- </div>
- </div>
- <div v-else class="orientation-content-msg">
- <div class="icon"><a-icon type="container"/></div>
- <div>请在上方选择一个已有定向包</div>
- </div>
- </div>
- </a-tab-pane>
- </a-tabs>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">预算与出价</p>
- <a-form-model-item label="投放场景">
- <a-radio-group v-model="configForm.adSmartBidType" button-style="solid">
- <a-radio-button value="SMART_BID_CUSTOM" :disabled="modalTitle === 'edit'">常规投放</a-radio-button>
- <a-radio-button value="SMART_BID_CONSERVATIVE" disabled>放量投放</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="预算">
- <a-input-group compact>
- <a-select
- :disabled="modalTitle === 'edit'"
- v-model="configForm.adBudgetMode"
- @change="handleBudgetMode"
- >
- <a-select-option value="BUDGET_MODE_DAY">日预算</a-select-option>
- <a-select-option value="BUDGET_MODE_TOTAL">总预算</a-select-option>
- </a-select>
- <a-input-number
- class="common-input"
- v-model="configForm.adBudget"
- :min="adBudgetNum"
- :step="0.01"
- @blur="handleAdBudgetBlur"
- />
- </a-input-group>
- </a-form-model-item>
- <a-form-model-item label="投放时间">
- <a-radio-group :disabled="modalTitle === 'edit'" v-model="configForm.adScheduleType" button-style="solid" @change="handleAdScheduleType">
- <a-radio-button value="SCHEDULE_FROM_NOW">从今天起长期投放</a-radio-button>
- <a-radio-button value="SCHEDULE_START_END">设置开始和结束日期</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <div class="adver-position-radio">
- <div v-if="configForm.adScheduleType === 'SCHEDULE_START_END'" class="position-radio-change">
- <a-range-picker
- v-model="configForm.launchDateRange"
- :disabled="modalTitle === 'edit'"
- format="YYYY-MM-DD"
- @change="handleLaunchData"
- />
- </div>
- </div>
- <a-form-model-item label="投放时段">
- <a-radio-group v-model="configForm.launchTimeInterval" button-style="solid" @change="handleLaunchTimeInterval">
- <a-radio-button value="buxian">不限</a-radio-button>
- <a-radio-button value="a">指定时间段</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <div class="adver-position-radio">
- <div v-if="configForm.launchTimeInterval === 'a'" class="position-radio-change">
- <selectCheckAll
- style="width:100%"
- :scheduleTime.sync="configForm.scheduleTimeData"
- ref="selectCheck"
- />
- </div>
- </div>
- <a-form-model-item label="付费方式">
- <a-radio-group v-model="configForm.adPricing" button-style="solid">
- <a-radio-button value="PRICING_OCPM" :disabled="modalTitle === 'edit'">按展示付费(oCPM)</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="出价方式">
- <a-radio-group v-model="configForm.adBidCreateType" button-style="solid" @change="handleBiddingMethod">
- <a-radio-button value="FIX">固定出价</a-radio-button>
- <a-radio-button value="RAND">随机出价</a-radio-button>
- <a-radio-button value="STEP">阶梯出价</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item v-if="configForm.adBidCreateType === 'FIX'" label="目标转化出价" :prop="configForm.launchTarget === 'OCPM' ? 'adCpaBid' : ''">
- <a-input-number
- class="common-input"
- v-model="configForm.adCpaBid"
- :min="0.1"
- :step="0.01"
- @blur="handleAdCpaBidBlur"
- /> 元
- <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;">{{ adCpaBidBlurTxt }}</div>
- </a-form-model-item>
- <div v-if="configForm.adBidCreateType === 'RAND'">
- <a-form-model-item label="目标转化出价"
- class="dp-link-start" prop="adMinBid">
- <a-input-number
- class="common-input"
- v-model="configForm.adMinBid"
- :min="0.1"
- :max="10000"
- :step="0.01"
- placeholder="请输入"
- @blur="handleAdMinBidBlur"
- />
- <span>~</span>
- </a-form-model-item>
- <a-form-model-item class="dp-link-end" prop="adMaxBid">
- <a-input-number
- class="common-input"
- v-model="configForm.adMaxBid"
- :min="0.1"
- :max="10000"
- :step="0.01"
- placeholder="请输入"
- @blur="handleAdMaxBidBlur"
- /> 元
- </a-form-model-item>
- <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px;">{{ adCpaBidBlurTxt }}</div>
- </div>
- <div v-if="configForm.adBidCreateType === 'STEP'">
- <a-form-model-item label="目标转化出价" class="dp-link-start" prop="adMinBid">
- <a-input-number
- class="common-input"
- v-model="configForm.adMinBid"
- :min="0.1"
- :max="10000"
- :step="0.01"
- placeholder="请输入"
- @blur="handleAdMinBidBlur"
- />
- <span>~</span>
- </a-form-model-item>
- <a-form-model-item class="dp-link-end" prop="adMaxBid">
- <a-input-number
- class="common-input"
- v-model="configForm.adMaxBid"
- :min="0.1"
- :max="10000"
- :step="0.01"
- placeholder="请输入"
- @blur="handleAdMaxBidBlur"
- /> 元
- </a-form-model-item>
- <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px">{{ adCpaBidBlurTxt }}</div>
- <a-form-model-item label="浮动间隔" prop="adStepBid">
- <a-input-number
- class="common-input"
- v-model="configForm.adStepBid"
- :step="0.01"
- placeholder="请输入"
- @blur="handleFloatingInterval"
- /> 元
- </a-form-model-item>
- </div>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">第三方检测链接</p>
- <a-form-model-item label="点击监测">
- <a-input
- class="common-input-long"
- placeholder="请输入链接地址"
- v-model="configForm.creativeActionTrackUrl"
- allow-clear
- />
- </a-form-model-item>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">创意信息</p>
- <a-form-model-item label="创意方式">
- <a-radio-group v-model="configForm.creativeMaterialMode" button-style="solid">
- <a-radio-button value="STATIC_ASSEMBLE" :disabled="modalTitle === 'edit'">程序化创意</a-radio-button>
- <a-radio-button value="NONE" :disabled="modalTitle === 'edit'">自定义创意</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="创意内容">
- <a-radio-group v-model="configForm.creativeImageMode" button-style="solid">
- <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO_VERTICAL">竖版视频</a-radio-button>
- <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO">横版视频</a-radio-button>
- <a-radio-button value="CREATIVE_IMAGE_MODE_LARGE">大图横图</a-radio-button>
- <a-radio-button value="CREATIVE_IMAGE_MODE_SMALL">小图</a-radio-button>
- <a-radio-button value="CREATIVE_IMAGE_MODE_LARGE_VERTICAL">大图竖图</a-radio-button>
- </a-radio-group>
- </a-form-model-item>
- <a-form-model-item label="卡片主图">
- <a-upload
- name="avatar"
- list-type="picture-card"
- class="avatar-uploader"
- :show-upload-list="false"
- :before-upload="beforeUpload"
- >
- <div v-if="imageUrl" class="upload-img-class" @mouseover="handleChangeActive">
- <div class="img-flex-url">
- <img :src="imageUrl" alt="avatar"/>
- </div>
- <!-- TODO 划过图片显示覆盖层 -->
- <!-- <div v-if="isCoverImgDiv" class="cover-img-div" @mouseleave="handleRemoveActive">
- <a-icon class="delete-icon-class" type="delete" @click.stop="handleDeleteImg"/>
- </div> -->
- </div>
- <div v-else>
- <a-icon type="plus" style="margin-top: 10px;"/>
- <div class="ant-upload-text">Upload</div>
- </div>
- </a-upload>
- <span class="especial-label">*</span>
- </a-form-model-item>
- <a-form-model-item label="卡片标题" prop="creativeProductDescription">
- <a-input
- class="common-input-long"
- placeholder="请输入卡片标题"
- v-model="configForm.creativeProductDescription"
- allow-clear
- />
- </a-form-model-item>
- <a-form-model-item label="推广卖点">
- <a-button type="primary" @click="handleAddOrigin">
- <a-icon type="plus" />推广卖点
- </a-button>
- <span class="especial-label">*</span>
- </a-form-model-item>
- <div class="adver-position-radio">
- <a-form-model-item
- v-for="(item, index) in configForm.defaultFormList"
- :key="item.id"
- class="examin-form-model"
- :prop="'defaultFormList.' + index + '.value'"
- :rules="[
- {required: true, message: '请输入', trigger: 'blur'},
- {min: 6, max: 9, message: '请输入6-9个字', trigger: 'blur'},
- ]"
- >
- <a-input class="common-input-long" v-model="item.value" placeholder="请输入" allow-clear/>
- <a-icon class="examin-form-icon" type="delete" @click="handleDelOrigin(item)"/>
- </a-form-model-item>
- </div>
- <a-form-model-item label="行动号召">
- <a-radio-group v-model="configForm.creativeEnablePersonalAction" button-style="solid">
- <a-radio-button :value="true">开启智能优选</a-radio-button>
- <a-radio-button :value="false">关闭智能优选</a-radio-button>
- </a-radio-group>
- <span class="especial-label">*</span>
- </a-form-model-item>
- <div class="adver-position-radio">
- <a-form-model-item prop="creativeCallToAction">
- <a-select
- class="common-input-long"
- v-model="configForm.creativeCallToAction"
- >
- <a-select-option
- v-for="(item, index) in configForm.creativeOptions"
- :key="index + 1"
- :value="item"
- >
- {{ item }}
- </a-select-option>
- </a-select>
- </a-form-model-item>
- </div>
- <a-form-model-item label="来源" :prop="getSource">
- <a-input
- class="common-input-long"
- placeholder="请输入来源"
- v-model="configForm.creativeSource"
- allow-clear
- />
- </a-form-model-item>
- </div>
- <div class="separate-module-con">
- <p class="rock-title">创意分类</p>
- <a-form-model-item label="创意分类" prop="creativeThirdIndustryIds">
- <a-cascader
- v-model="configForm.creativeThirdIndustryIds"
- class="common-input-long"
- :options="createOptions"
- :fieldNames="fieldNames"
- placeholder="请选择创意分类"
- />
- </a-form-model-item>
- <a-form-model-item label="创意标签">
- <a-select
- v-model="configForm.creativeLabel"
- :token-separators="[',', ' ', ',']"
- mode="tags"
- style="width: 320px"
- placeholder="按回车生成标签"
- dropdownClassName="display-none-selset"
- @change="handleEnterChang"
- >
- </a-select>
- <span class="especial-label">*</span>
- </a-form-model-item>
- <div class="adver-position-radio">
- <div class="creative-label-content">
- <p>已选:{{ creativeTag.length || 0 }}</p>
- <div class="label-content-select-tag">
- <a-tag
- v-for="item in creativeTag"
- :key="item"
- :closable="true"
- class="tag-select-class"
- @close="handleTagsClose(item)"
- >
- {{ item }}
- </a-tag>
- </div>
- </div>
- </div>
- </div>
- <div class="separate-module-con btn-Unique-con">
- <a-button class="sure-btn" type="primary" @click="handleRelaxSure">确定</a-button>
- <a-button class="cancel-btn" @click="handleRelaxCancel">取消</a-button>
- </div>
- </a-form-model>
- </div>
- </div>
- </template>
- <script>
- import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
- import SelectCheckAll from '../../BatchCreate/toutiaoTime';
- import radioCheck from '@/components/formComponents/checkBoxGroup';
- import linkMultiSelect from '@/views/modules/BatchCreate/linkMultiSelect';
- import DirectionalLogic from './directional-logic/directional-logic';
- import moment from 'moment';
- import BMF from 'browser-md5-file';
- import {urlAcount} from '../account-config-server.js';
- import {getAction, postAction, putAction} from '@/api/manage';
- import {mapGetters} from 'vuex';
- let COS = require('cos-js-sdk-v5');
- let cos = new COS({
- SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
- SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9'
- });
- let str = '';
- for (let i = 0; i < 7 * 48; i++) {
- str += '0';
- }
- export default {
- name: 'configuration-modal',
- props: {
- visible: {
- type: Boolean,
- default: false
- }
- },
- components: {
- AcountSearch,
- SelectCheckAll,
- radioCheck,
- linkMultiSelect,
- DirectionalLogic
- },
- data() {
- let handleConfirmValue = (rule, value, callback) => {
- const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
- if (urlregex.test(value)) {
- callback();
- }
- else {
- callback('请输入正确的格式');
- }
- };
- let handleCharacterLen100 = (rule, value, callback) => {
- this.handleExportRules(value, 1, 100, callback);
- };
- let handleCharacterLen20 = (rule, value, callback) => {
- this.handleExportRules(value, 4, 20, callback);
- };
- let floatingIntervalValidator = (rule, value, callback) => {
- const finallyResult = Number(this.configForm.adMinBid) + Number(value);
- if (finallyResult < Number(this.configForm.adMaxBid)) {
- callback();
- }
- else {
- callback('最低出价+浮动间隔<最高出价');
- }
- };
- let adMinBidValidator = (rule, value, callback) => {
- const finallyResult = Number(this.configForm.adMaxBid);
- if (finallyResult && value && Number(value) < finallyResult) {
- this.$refs['ruleForm'].clearValidate(['adMaxBid']);
- callback();
- }
- else {
- callback('最低出价不能高于最高出价');
- }
- };
- let adMaxBidValidator = (rule, value, callback) => {
- const finallyResult = Number(this.configForm.adMinBid);
- if (finallyResult && value && Number(value) > finallyResult) {
- this.$refs['ruleForm'].clearValidate(['adMinBid']);
- callback();
- }
- else {
- callback('最高出价不能低于最低出价');
- }
- };
- return {
- directionalData: [],
- platformLoadingType: '',
- selectPackageTabs: '1',
- deviceTypeList: [
- {
- value: 'NONE',
- label: '不限'
- },
- {
- value: 'MOBILE',
- label: '智能手机'
- },
- {
- value: 'PAD',
- label: '平板'
- }
- ],
- adAcList: [
- {
- value: 'NONE',
- label: '不限'
- },
- {
- value: 'WIFI',
- label: 'WI-FI'
- },
- {
- value: '2G',
- label: '2G'
- },
- {
- value: '3G',
- label: '3G'
- },
- {
- value: '4G',
- label: '4G'
- }
- ],
- adHideIfConvertedDataOption: [ // 过滤已转化用户option
- {
- id: 'NO_EXCLUDE',
- name: '不限'
- },
- {
- id: 'AD',
- name: '广告计划'
- },
- {
- id: 'CAMPAIGN',
- name: '广告组'
- },
- {
- id: 'ADVERTISER',
- name: '广告账户'
- },
- {
- id: 'CUSTOMER',
- name: '公司账户'
- },
- {
- id: 'APP',
- name: 'APP'
- }
- ],
- packageMessageDetail: [],
- selectiveList: [],
- isLadderBlur: false,
- ladderBlurTxt: '',
- isAdCpaBid11Blur: false,
- adCpaBid11BlurTxt: '',
- isAdCpaBidBlur: false,
- adCpaBidBlurTxt: '',
- listArr: [],
- regionCityListUrl: 'ctop/bytedanceAreaInfo/list',
- defaultAdBudget: '',
- adBudgetShowTitle: false,
- adBudgetNum: 1,
- campaignStatus: false,
- detailData: {},
- modalTitle: '',
- toolConvertList: [],
- optimizationOption: [],
- md5Result: '',
- urlResult: '',
- createOptions: [],
- adNameTags: ['出价方式', '素材名称', '日期', '创意方式'],
- fieldNames: {
- label: 'industryName',
- value: 'industryId',
- children: 'children'
- },
- ageArr: [
- {
- value: 'NONE',
- label: '不限'
- },
- {
- value: 'AGE_BETWEEN_18_23',
- label: '18-23岁'
- },
- {
- value: 'AGE_BETWEEN_24_30',
- label: '24-30岁'
- },
- {
- value: 'AGE_BETWEEN_31_40',
- label: '31-40岁'
- },
- {
- value: 'AGE_BETWEEN_41_49',
- label: '41-49岁'
- },
- {
- value: 'AGE_ABOVE_50',
- label: '50岁+'
- }
- ],
- fileList: [],
- isCoverImgDiv: false,
- imageUrl: '',
- creativeTag: [],
- radioStyle: {
- display: 'block',
- height: '30px',
- lineHeight: '30px',
- marginLeft: 0
- },
- labelCol: {span: 4},
- wrapperCol: {span: 14},
- rules: {
- adExternalUrl: [
- {required: true, message: '请输入', trigger: 'blur'},
- {validator: handleConfirmValue, trigger: 'blur'}
- ],
- adPackage: [
- {required: true, message: '请输入', trigger: 'blur'}
- ],
- adDownloadUrl: [
- {required: true, message: '请输入', trigger: 'blur'},
- {validator: handleConfirmValue, trigger: 'blur'}
- ],
- campaignCnt: [
- {required: true, message: '请输入', trigger: 'blur'}
- ],
- campaignAdCnt: [
- {required: true, message: '请输入', trigger: 'blur'}
- ],
- dpLinkStartIndex: [
- {required: true, message: '请输入', trigger: 'blur'}
- ],
- dpLinkEndIndex: [
- {required: true, message: '请输入', trigger: 'blur'}
- ],
- accountBudget: [
- {required: true, message: '请输入', trigger: 'blur'}
- ],
- campaignName: [
- {required: true, message: '请输入广告组名称', trigger: 'blur'},
- {validator: handleCharacterLen100, trigger: 'blur'}
- ],
- creativeSource: [
- {required: true, message: '请输入', trigger: 'blur'},
- {validator: handleCharacterLen20, trigger: 'blur'}
- ],
- adCpaBid: [
- {required: true, message: '请输入', trigger: 'blur'}
- ],
- adStepBid: [
- {required: true, message: '请输入', trigger: 'blur'},
- {validator: floatingIntervalValidator, trigger: 'blur'}
- ],
- adMinBid: [
- {required: true, message: '请输入最低出价', trigger: 'blur'},
- {validator: adMinBidValidator, trigger: 'blur'}
- ],
- adMaxBid: [
- {required: true, message: '请输入最高出价', trigger: 'blur'},
- {validator: adMaxBidValidator, trigger: 'blur'}
- ],
- adName: [
- {required: true, message: '请输入广告计划名称'},
- {validator: handleCharacterLen100, trigger: 'blur'}
- ],
- creativeProductDescription: [
- {required: true, message: '请输入', trigger: 'blur'},
- {min: 1, max: 7, message: '请输入1-7个字', trigger: 'blur'}
- ],
- adAudiencePackageId: [{required: true, message: '请选择', trigger: 'change'}],
- creativeCallToAction: [{required: true, message: '请选择', trigger: 'change'}],
- adConvertType: [{required: true, message: '请选择', trigger: 'change'}],
- adConvertId: [{required: true, message: '请选择', trigger: 'change'}],
- creativeThirdIndustryIds: [{required: true, message: '请选择', trigger: 'change'}]
- },
- configForm: {
- dpLinkIndexUsed: 0,
- adRetargetingTagsType: '',
- adAudiencePackageId: undefined,
- adStepBid: 0,
- ladderOne: '',
- ladderTwo: '',
- adMinBid: '',
- adMaxBid: '',
- adBidCreateType: 'FIX',
- creativeOptions: [],
- advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
- adLocationType: 'HOME',
- adCity: '',
- adSelectCity: [],
- defaultFormList: [],
- productSellingPoints: [], // 商品买点
- adBudgetMode: 'BUDGET_MODE_DAY', // 预算类型
- adDownloadUrl: '', // 下载链接
- accountBudget: 1000, // 账户日预算
- accountId: undefined, // 账户
- dpLinkStartIndex: 1,
- dpLinkEndIndex: 2,
- accountBudgetMode: '1', // 预算方式
- campaignLandingType: 'APP', // 推广目标
- advertisingType: '1', // 广告类型
- campaignName: '', // 广告组名称
- adName: '', // 广告计划名称
- campaignCnt: 1, // 广告组计划数量
- campaignAdCnt: 1, // 广告计划数量
- launchTarget: 'OCPM', // 投放目标
- adDownloadType: 'EXTERNAL_URL', // 下载方式
- adExternalUrl: '', // 落地页链接
- adOpenUrl: '', // 直达链接内容
- adPackage: '', // 应用包名
- adConvertType: '', // 转化跟踪方式
- adConvertId: '', // 优化目标 -- 走接口
- adverPosition: 'a', // 广告位置
- radioChangeValue: '', // 广告位置-按照场景指定位置
- checkboxChangeValue: [], // 广告位置-按照媒体指定位置
- adDistrict: 'NONE', // 定向-区域
- adGender: 'NONE', // 定向-性别
- adAge: '', // 定向-年龄
- adSelectAge: ['NONE'],
- customPerson: 'NONE', // 定向-自定义
- adSuperiorPopularityType: 'NONE', // 定向-媒体定向
- adPlatform: 'NONE', // 定向-平台
- adDeviceSelectType: ['NONE'],
- adSelectAc: ['NONE'],
- adAc: '', // 定向-网络
- adHideIfExists: '0', // 定向-已安装用户
- adHideIfConverted: 'NO_EXCLUDE', // 定向-已转化用户
- adAutoExtendEnabled: '0', // 定向-智能播放
- adAndroidVersion: 'NONE', // 定向-安卓版本
- androidChangeValue: '', // 安卓版本-自定义
- adSmartBidType: 'SMART_BID_CUSTOM', // 投放场景
- adBudget: 1, // 预算
- adScheduleType: 'SCHEDULE_FROM_NOW', // 投放时间
- launchDateRange: [], // 设置开始和结束时间
- launchTimeInterval: 'buxian', // 投放时段
- scheduleTimeData: str, // 指定时段选择
- adPricing: 'PRICING_OCPM', // 付费方式
- adCpaBid: 0.1, // 目标转化出价
- creativeActionTrackUrl: '', // 监测地址
- creativeMaterialMode: 'STATIC_ASSEMBLE', // 创意方式
- creativeImageMode: 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL', // 创意内容
- creativeProductDescription: '', // 卡片标题
- creativeEnablePersonalAction: true, // 智能优选
- creativeSource: '', // 来源
- creativeThirdIndustryId: '', // 创意分类
- creativeThirdIndustryIds: [], // 创意分类
- adKeywords: [], // 创意标签
- updateGetingInclude: [],
- updateGetingExclude: [],
- adRetargetingTagsInclude: '',
- adRetargetingTagsExclude: '',
- creativeCallToAction: '', // 行动号召
- creativeLabel: undefined // 倡议标签
- }
- };
- },
- computed: {
- selectOrientPlaceholder() {
- if (!this.configForm.accountId) {
- return '请选择账户';
- }
- else if (this.configForm.adDownloadType === 'DOWNLOAD_URL' && !this.platformLoadingType) {
- return '请填写投放内容';
- }
- else if (this.configForm.adDownloadType === 'EXTERNAL_URL' && !this.configForm.adExternalUrl) {
- return '请填写投放内容';
- }
- else {
- return 'able';
- }
- },
- getEndIndex() {
- return Number(this.configForm.dpLinkStartIndex) + 1;
- },
- getSource() {
- if (this.configForm.campaignLandingType !== 'APP' || (this.configForm.campaignLandingType === 'APP' && this.configForm.adDownloadType === 'EXTERNAL_URL')) {
- return 'creativeSource';
- }
- },
- NewAountId() {
- return this.configForm.accountId;
- },
- NewAdPackage() {
- return this.configForm.adPackage;
- },
- NewAdExternalUrl() {
- return this.configForm.adExternalUrl;
- }
- },
- watch: {
- NewAdExternalUrl(newVal, oldVal) {
- if (newVal && this.configForm.accountId) {
- const paramsData = {
- advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
- advertiserId: this.configForm.accountId,
- deliveryRange: 'DEFAULT',
- externalUrl: this.configForm.adExternalUrl,
- landingType: this.configForm.campaignLandingType,
- promotionContent: this.configForm.adDownloadType
- };
- this.handleGetOptimizationObjective(paramsData);
- this.handleGetAdAudiencePackage();
- }
- },
- NewAdPackage(newVal, oldVal) {
- if (newVal && this.configForm.accountId) {
- const paramsData = {
- advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
- advertiserId: this.configForm.accountId,
- appType: 'APP_ANDROID',
- deliveryRange: 'DEFAULT',
- externalUrl: this.configForm.adExternalUrl,
- landingType: this.configForm.campaignLandingType,
- packageName: this.configForm.adPackage,
- promotionContent: this.configForm.adDownloadType
- };
- this.handleGetOptimizationObjective(paramsData);
- }
- },
- platformLoadingType(newVal, oldVal) {
- if (newVal && this.configForm.accountId) {
- this.handleGetAdAudiencePackage();
- }
- },
- NewAountId(newVal, oldVal) {
- if (newVal && this.configForm.adPackage) {
- const paramsData = {
- advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
- advertiserId: this.configForm.accountId,
- appType: 'APP_ANDROID',
- deliveryRange: 'DEFAULT',
- externalUrl: this.configForm.adExternalUrl,
- landingType: this.configForm.campaignLandingType,
- packageName: this.configForm.adPackage,
- promotionContent: this.configForm.adDownloadType
- };
- this.handleGetOptimizationObjective(paramsData);
- }
- if (newVal && this.platformLoadingType) {
- this.handleGetAdAudiencePackage();
- }
- if (newVal) {
- this.handleGetCreativeClassification();
- this.handleGetAdvertiserStrategy();
- this.handleDirectionalList();
- }
- else {
- this.createOptions = [];
- this.creativeOptions = [];
- this.selectiveList = [];
- this.optimizationOption = [];
- }
- }
- },
- mounted() {
- const routeQuery = JSON.parse(localStorage.getItem('queryList'));
- if (routeQuery.accountModal === 'edit') {
- this.modalTitle = 'edit';
- this.handleGetDetailList();
- }
- else if (routeQuery.accountModal === 'add') {
- this.modalTitle = 'add';
- }
- },
- methods: {
- ...mapGetters(['nickname', 'avatar', 'userInfo']),
- moment,
- handleSelectPackageTabs(e) {
- if (this.modalTitle === 'add') {
- if (e === '1') {
- this.configForm.adAudiencePackageId = undefined;
- this.packageMessageDetail = [];
- }
- else if (e === '2') {
- this.configForm.adDistrict = 'NONE';
- this.listArr = [];
- this.configForm.adLocationType = 'HOME';
- this.configForm.adGender = 'NONE';
- this.configForm.adSelectAge = ['NONE'];
- this.configForm.customPerson = 'NONE';
- this.configForm.updateGetingInclude = [];
- this.configForm.adRetargetingTagsInclude = '';
- this.configForm.adRetargetingTagsExclude = '';
- this.configForm.updateGetingExclude = [];
- this.configForm.adRetargetingTagsType = '';
- if (!this.platformLoadingType) {
- this.configForm.adPlatform = 'NONE';
- this.platformLoadingType = '';
- }
- this.configForm.adDeviceSelectType = ['NONE'];
- this.configForm.adAndroidVersion = 'NONE';
- this.configForm.adSelectAc = ['NONE'];
- this.configForm.adHideIfExists = '0';
- this.configForm.adAutoExtendEnabled = '0';
- }
- }
- },
- handleCustomPerson(e) {
- const defaultValue = e.target.value;
- if (defaultValue === 'NONE') {
- this.configForm.updateGetingInclude = [];
- this.configForm.adRetargetingTagsInclude = '';
- this.configForm.adRetargetingTagsExclude = '';
- this.configForm.updateGetingExclude = [];
- this.configForm.adRetargetingTagsType = '';
- }
- else if (defaultValue === 'a') {
- this.configForm.adRetargetingTagsType = '1';
- }
- },
- handleAsyncPackage() {
- this.handleGetAdAudiencePackage();
- this.configForm.adAudiencePackageId = undefined;
- this.packageMessageDetail = [];
- },
- handleDpLinkIndexUsed(e) {
- const defaultId = e.target.value;
- if (defaultId === 0) {
- this.adNameTags.pop();
- this.configForm.dpLinkStartIndex = 1;
- this.configForm.dpLinkEndIndex = 2;
- this.configForm.campaignCnt = 1;
- }
- else if (defaultId === 1) {
- this.adNameTags.push('dp链接标识');
- }
- },
- handleDplinkStart(e) {
- this.configForm.dpLinkStartIndex = Math.round(e);
- },
- handleDplinkEnd(e) {
- this.configForm.dpLinkEndIndex = Math.round(e);
- },
- handleFloatingInterval(e) {
- this.configForm.adStepBid = Number(Number(e.target.value).toFixed(2));
- },
- handleAdMinBidBlur(e) {
- this.configForm.adMinBid = Number(Number(e.target.value).toFixed(2));
- },
- handleAdMaxBidBlur(e) {
- const defaultValue = e.target.value;
- this.configForm.adMaxBid = Number(Number(defaultValue).toFixed(2));
- if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
- this.isAdCpaBidBlur = true;
- this.adCpaBidBlurTxt = '出价不能大于预算';
- }
- else {
- this.isAdCpaBidBlur = false;
- }
- },
- handleDirectionalList() {
- const paramsData = {
- accountId: this.configForm.accountId
- };
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getDMPCustomAudience', paramsData).then(result => {
- if (result.code === 0) {
- result.result.forEach(item => {
- item.key = item.custom_audience_id;
- });
- this.directionalData = result.result;
- }
- else {
- this.$message.error(result.message);
- }
- }).catch(error => {
- console.log(error, 'eeee');
- });
- },
- handleSelectionAloneEvent(list) {
- if (this.configForm.adRetargetingTagsType === '1') {
- this.configForm.updateGetingInclude = list;
- this.configForm.adRetargetingTagsInclude = list && list.join(',');
- this.configForm.adRetargetingTagsExclude = '';
- this.configForm.updateGetingExclude = [];
- }
- else if (this.configForm.adRetargetingTagsType === '2') {
- this.configForm.updateGetingExclude = list;
- this.configForm.adRetargetingTagsExclude = list && list.join(',');
- this.configForm.updateGetingInclude = [];
- this.configForm.adRetargetingTagsInclude = '';
- }
- },
- handleClearlist() {
- this.configForm.updateGetingInclude = [];
- this.configForm.adRetargetingTagsInclude = '';
- this.configForm.adRetargetingTagsExclude = '';
- this.configForm.updateGetingExclude = [];
- },
- handleDirectEvent(list) {
- this.configForm.updateGetingInclude = list;
- this.configForm.adRetargetingTagsInclude = list && list.join(',');
- },
- handleExcludeEvent(list) {
- this.configForm.updateGetingExclude = list;
- this.configForm.adRetargetingTagsExclude = list && list.join(',');
- },
- handleDirectionalLogic(e) {
- const selectValue = e.target.value;
- this.handleDirectionalList();
- if (selectValue === '1') {
- this.$refs.exclude.aloneInput = '';
- this.$refs.twoway.directInput = '';
- this.$refs.twoway.excludeInput = '';
- }
- else if (selectValue === '2') {
- this.$refs.direct.aloneInput = '';
- this.$refs.twoway.directInput = '';
- this.$refs.twoway.excludeInput = '';
- }
- else if (selectValue === '3') {
- this.$refs.direct.aloneInput = '';
- this.$refs.exclude.aloneInput = '';
- }
- },
- handleGetAdAudiencePackage() {
- const params = {
- accountId: this.configForm.accountId,
- landingType: this.configForm.adDownloadType === 'DOWNLOAD_URL' ? this.platformLoadingType : 'EXTERNAL'
- };
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', params)
- .then(result => {
- if (result.code === 0) {
- this.selectiveList = result.result || [];
- }
- else {
- this.$message.error(result.message);
- }
- })
- .catch(error => {
- console.log(error, 'eeee');
- });
- },
- handleSelectiveOrientation(e) {
- const ageUpdateList = [];
- const defaultData = this.selectiveList.filter(item => item.audience_package_id === e);
- defaultData.forEach(item => {
- item.replaceSex = item.audience.gender === 'NONE' ? '不限' : item.audience.gender === 'GENDER_FEMALE' ? '女' : '男';
- item.replaceEnabled = item.audience.auto_extend_enabled === 1 ? '开启' : '不开启';
- item.replacePlate = item.audience.platform && item.audience.platform.length ? item.audience.platform.join(',') : '不限';
- item.replaceCitys = item.audience.cityNames && item.audience.cityNames.length ? item.audience.cityNames.join(',') : '不限';
- this.ageArr.forEach(val => {
- if (item.audience.age && item.audience.age.length && item.audience.age.includes(val.value)) {
- ageUpdateList.push(val.label);
- }
- });
- item.replaceAge = ageUpdateList.length ? ageUpdateList.join(',') : '不限';
- });
- this.packageMessageDetail = defaultData;
- },
- handleBiddingMethod(e) {
- this.configForm.adCpaBid = 0;
- this.configForm.adMinBid = '';
- this.configForm.adMaxBid = '';
- this.configForm.adStepBid = 0;
- this.isAdCpaBidBlur = false;
- this.$refs['ruleForm'].clearValidate(['adMinBid']);
- this.$refs['ruleForm'].clearValidate(['adMaxBid']);
- },
- handleAdCpaBidBlur(e) {
- const defaultValue = e.target.value;
- this.configForm.adCpaBid = Number(Number(defaultValue).toFixed(2));
- if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
- this.isAdCpaBidBlur = true;
- this.adCpaBidBlurTxt = '出价不能大于预算';
- }
- else if (defaultValue > 10000) {
- this.isAdCpaBidBlur = true;
- this.adCpaBidBlurTxt = '目标转化出价不少于0.1元,不超过10000元,请正确输入';
- }
- else {
- this.isAdCpaBidBlur = false;
- }
- },
- handleGetAdvertiserStrategy() {
- const params = {
- accountId: this.configForm.accountId,
- landingType: this.configForm.campaignLandingType,
- advancedCreativeType: 'ATTACHED_CREATIVE_NONE'
- };
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdActionText', params)
- .then(result => {
- if (result.code === 0) {
- this.configForm.creativeOptions = result.result;
- }
- else {
- this.$message.error(result.message);
- }
- })
- .catch(error => {
- console.log(error, 'eeee');
- });
- },
- // 获取选中的城市
- getSelectedCityArr(val) {
- setTimeout(() => {
- this.configForm.adSelectCity = val;
- }, 200);
- },
- handleCheckedShowList(val) {
- if (val.length) {
- this.configForm.adSelectCity = val.map(item => item.code);
- }
- else {
- this.configForm.adSelectCity = [];
- }
- },
- getAgeSelect(data) {
- if (data.length > 1 && data.findIndex(item => item === 'NONE') === 0) {
- data.splice(data.findIndex(item => item === 'NONE'), 1);
- }
- else if (data.length > 1 && data.findIndex(item => item === 'NONE') === data.length - 1) {
- data.splice(0, data.length - 1);
- }
- else if (data.length === 0) {
- data.push('NONE');
- }
- },
- handleAdBudgetBlur(e) {
- const adBudgetInput = e.target.value;
- this.configForm.adBudget = Number(Number(adBudgetInput).toFixed(2));
- if (this.configForm.adCpaBid > adBudgetInput) {
- this.isAdCpaBidBlur = true;
- this.adCpaBidBlurTxt = '出价不能大于预算';
- }
- else {
- this.isAdCpaBidBlur = false;
- }
- },
- handleAccountBudget(e) {
- const adBudgetInput = e.target.value;
- this.configForm.accountBudget = Number(Number(adBudgetInput).toFixed(2));
- if (this.modalTitle === 'edit') {
- if (Number(adBudgetInput) >= Number(this.defaultAdBudget) && Number(adBudgetInput) < (Number(this.defaultAdBudget) + 100)) {
- this.adBudgetShowTitle = true;
- }
- else if (Number(adBudgetInput) <= Number(this.defaultAdBudget) && Number(adBudgetInput) > (Number(this.defaultAdBudget) - 100)) {
- this.adBudgetShowTitle = true;
- }
- else {
- this.adBudgetShowTitle = false;
- }
- }
- },
- handleExportRules(value, min, max, callback) {
- let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
- let length = 0;
- let strArr = value.split('');
- strArr.forEach(item => {
- if (cnReg.test(item)) {
- length += 2;
- }
- else {
- length += 1;
- }
- });
- if (min <= length && length <= max) {
- callback();
- }
- else {
- callback(`只能输入${min}-${max}个字符`);
- }
- },
- handleGetPackage() {
- const params = {
- urlPath: this.configForm.adDownloadUrl
- };
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getPackageNameByUrl', params)
- .then(result => {
- if (result.code === 0) {
- this.configForm.adPackage = result.result.package || '';
- this.platformLoadingType = result.result.platform || '';
- if (result.result.platform && result.result.platform === 'APP_ANDROID') {
- this.configForm.adPlatform = 'ANDROID';
- }
- else if (result.result.platform && result.result.platform === 'APP_IOS') {
- this.configForm.adPlatform = 'IOS';
- }
- }
- else {
- this.$message.error(result.message);
- }
- })
- .catch(error => {
- console.log(error, 'eeee');
- });
- },
- handleAndroidVersion(e) {
- if (e.target.value === 'NONE') {
- this.configForm.androidChangeValue = '';
- }
- },
- handleAdScheduleType(e) {
- if (e.target.value === 'SCHEDULE_FROM_NOW') {
- this.configForm.launchDateRange = [];
- }
- },
- handleLaunchTimeInterval(e) {
- if (e.target.value === 'buxian') {
- this.configForm.scheduleTimeData = str;
- }
- },
- handleAdverPosition(e) {
- if (e.target.value === 'a') {
- this.configForm.radioChangeValue = '';
- this.configForm.checkboxChangeValue = [];
- }
- else if (e.target.value === 'b') {
- this.configForm.radioChangeValue = '';
- }
- else if (e.target.value === 'c') {
- this.configForm.checkboxChangeValue = [];
- }
- },
- handleAccountMode(e) {
- if (e.target.value === '1') {
- this.configForm.accountBudget = 0;
- }
- else if (e.target.value === '2') {
- this.configForm.accountBudget = 1000;
- }
- },
- handleAdDownLoadType(e) {
- this.optimizationOption = [];
- const defaultValue = e.target.value;
- if (defaultValue === 'DOWNLOAD_URL') {
- this.configForm.adExternalUrl = '';
- this.configForm.adOpenUrl = '';
- this.$refs.ruleForm.clearValidate(['adExternalUrl']);
- }
- else if (defaultValue === 'EXTERNAL_URL') {
- this.configForm.adDownloadUrl = '';
- this.configForm.adPackage = '';
- this.configForm.adConvertId = '';
- this.$refs.ruleForm.clearValidate(['adDownloadUrl']);
- this.$refs.ruleForm.clearValidate(['adPackage']);
- }
- },
- handleCampaignCnt(e) {
- const finallyResult = e * this.configForm.campaignAdCnt;
- if (finallyResult > 500) {
- this.campaignStatus = true;
- }
- else {
- this.campaignStatus = false;
- }
- },
- handleCampaignAdCnt(e) {
- const finallyResult = e * this.configForm.campaignCnt;
- if (finallyResult > 500) {
- this.campaignStatus = true;
- }
- else {
- this.campaignStatus = false;
- }
- },
- handleConvertChange(e) {
- const convertTitle = this.optimizationOption.filter(item => item.convert_id === e);
- this.configForm.creativeActionTrackUrl = convertTitle[0].action_track_url;
- },
- handleGetDetailList() {
- const routeQuery = JSON.parse(localStorage.getItem('queryList'));
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/queryById', {id: routeQuery.id})
- .then(result => {
- if (result.code === 0) {
- const detailData = result.result;
- this.configForm.accountId = detailData.accountId;
- if (detailData.adAudiencePackageId) {
- this.selectPackageTabs = '2';
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', {accountId: detailData.accountId})
- .then(result => {
- if (result.code === 0) {
- this.selectiveList = result.result || [];
- this.configForm.adAudiencePackageId = Number(detailData.adAudiencePackageId);
- this.handleSelectiveOrientation(Number(detailData.adAudiencePackageId));
- }
- else {
- this.$message.error(result.message);
- }
- })
- .catch(error => {
- console.log(error, 'eeee');
- });
- }
- else {
- this.selectPackageTabs = '1';
- }
- this.configForm.dpLinkStartIndex = detailData.dpLinkStartIndex;
- this.configForm.dpLinkEndIndex = detailData.dpLinkEndIndex;
- this.configForm.accountBudgetMode = detailData.accountBudgetMode;
- this.configForm.accountBudget = detailData.accountBudget;
- this.configForm.campaignLandingType = detailData.campaignLandingType;
- this.configForm.advertisingType = detailData.advertisingType || '1';
- this.configForm.campaignName = detailData.campaignName || '';
- this.configForm.dpLinkIndexUsed = detailData.dpLinkIndexUsed;
- if (detailData.dpLinkIndexUsed === 1) {
- this.adNameTags.push('dp链接标识');
- }
- this.configForm.adName = detailData.adName || '';
- this.configForm.campaignCnt = detailData.campaignCnt || '';
- this.configForm.campaignAdCnt = detailData.campaignAdCnt || '';
- this.configForm.launchTarget = detailData.launchTarget || 'OCPM';
- this.configForm.adDownloadType = detailData.adDownloadType;
- this.configForm.adPlatform = detailData.adPlatform;
- this.configForm.adExternalUrl = detailData.adExternalUrl || '';
- this.configForm.adOpenUrl = detailData.adOpenUrl || '';
- this.configForm.adDownloadUrl = detailData.adDownloadUrl || '';
- this.configForm.adPackage = detailData.adPackage || '';
- this.configForm.adConvertType = detailData.adConvertType || '';
- this.configForm.adDistrict = detailData.adDistrict || 'NONE';
- if (detailData.adDownloadType === 'DOWNLOAD_URL') {
- this.handleGetPackage();
- }
- setTimeout(() => {
- this.listArr = detailData.adCity.split(',');
- this.configForm.adSelectCity = detailData.adCity.split(',');
- }, 200);
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getDMPCustomAudience', {accountId: detailData.accountId}).then(result => {
- if (result.code === 0) {
- result.result.forEach(item => {
- item.key = item.custom_audience_id;
- });
- this.directionalData = result.result;
- this.configForm.adRetargetingTagsType = detailData.adRetargetingTagsType || '1';
- if (detailData.adRetargetingTagsType === '3') {
- this.configForm.customPerson = 'a';
- this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude;
- this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude;
- this.configForm.updateGetingExclude = detailData.adRetargetingTagsExclude ? detailData.adRetargetingTagsExclude.split(',').map(item => Number(item)) : [];
- this.configForm.updateGetingInclude = detailData.adRetargetingTagsInclude ? detailData.adRetargetingTagsInclude.split(',').map(item => Number(item)) : [];
- }
- else if (detailData.adRetargetingTagsType === '2') {
- this.configForm.customPerson = 'a';
- this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude;
- this.configForm.updateGetingExclude = detailData.adRetargetingTagsExclude.split(',').map(item => Number(item));
- this.configForm.updateGetingInclude = [];
- }
- else if (detailData.adRetargetingTagsType === '1') {
- this.configForm.customPerson = 'a';
- this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude;
- this.configForm.updateGetingExclude = [];
- this.configForm.updateGetingInclude = detailData.adRetargetingTagsInclude.split(',').map(item => Number(item));
- }
- else {
- this.configForm.customPerson = 'NONE';
- this.configForm.adRetargetingTagsExclude = '';
- this.configForm.updateGetingExclude = '';
- this.configForm.updateGetingInclude = [];
- this.configForm.updateGetingExclude = [];
- }
- }
- else {
- this.$message.error(result.message);
- }
- }).catch(error => {
- console.log(error, 'eeee');
- });
- this.configForm.adGender = detailData.adGender || 'NONE';
- this.configForm.adLocationType = detailData.adLocationType;
- this.configForm.adSelectAge = detailData.adAge.split(',');
- this.configForm.adSelectAc = detailData.adAc.split(',');
- this.configForm.adDeviceSelectType = detailData.adDeviceType.split(',');
- this.configForm.adSuperiorPopularityType = detailData.adSuperiorPopularityType;
- this.configForm.adAc = detailData.adAc;
- this.configForm.adHideIfExists = String(detailData.adHideIfExists);
- this.configForm.adHideIfConverted = detailData.adHideIfConverted;
- this.configForm.adAutoExtendEnabled = detailData.adAutoExtendEnabled;
- this.configForm.adSmartBidType = detailData.adSmartBidType;
- this.configForm.adBudgetMode = detailData.adBudgetMode;
- this.configForm.adBudget = detailData.adBudget;
- this.defaultAdBudget = detailData.accountBudget;
- this.configForm.adScheduleType = detailData.adScheduleType;
- this.configForm.launchDateRange[0] = detailData.adStartTime;
- this.configForm.launchDateRange[1] = detailData.adEndTime;
- this.configForm.adPricing = detailData.adPricing;
- this.configForm.adCpaBid = detailData.adCpaBid;
- this.configForm.creativeActionTrackUrl = detailData.creativeActionTrackUrl;
- this.configForm.creativeMaterialMode = detailData.creativeMaterialMode;
- this.configForm.creativeImageMode = detailData.creativeImageMode;
- this.configForm.creativeProductDescription = detailData.creativeProductDescription;
- this.configForm.creativeEnablePersonalAction = detailData.creativeEnablePersonalAction;
- this.configForm.creativeCallToAction = detailData.creativeCallToAction;
- this.configForm.creativeSource = detailData.creativeSource;
- this.configForm.adBidCreateType = detailData.adBidCreateType;
- this.configForm.adMinBid = detailData.adMinBid;
- this.configForm.adMaxBid = detailData.adMaxBid;
- this.configForm.adStepBid = detailData.adStepBid;
- this.configForm.adBidCreateType = detailData.adBidCreateType;
- this.configForm.creativeThirdIndustryIds[0] = detailData.creativeThirdIndustryId.substr(0, 4);
- this.configForm.creativeThirdIndustryIds[1] = detailData.creativeThirdIndustryId.substr(0, 6);
- this.configForm.creativeThirdIndustryIds[2] = detailData.creativeThirdIndustryId;
- this.imageUrl = detailData.imageUrl;
- this.urlResult = detailData.imageUrl;
- this.md5Result = detailData.creativeProductImageCode;
- if (detailData.adAndroidOsv !== 'NONE') {
- this.configForm.adAndroidVersion = 'a';
- this.configForm.androidChangeValue = detailData.adAndroidOsv;
- }
- else {
- this.configForm.adAndroidVersion = 'NONE';
- }
- if (detailData.productSellingPoints) {
- let productPointsList = [];
- const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
- detailData.productSellingPoints.forEach((item, index) => {
- productPointsList.push({
- id: randomNum + index,
- value: item
- });
- });
- this.configForm.defaultFormList = productPointsList;
- }
- if (detailData.adScheduleTime.indexOf(1) !== -1) {
- this.configForm.launchTimeInterval = 'a';
- this.configForm.scheduleTimeData = detailData.adScheduleTime;
- }
- else {
- this.configForm.launchTimeInterval = 'buxian';
- }
- if (detailData.creativeSceneInventory) {
- this.configForm.adverPosition = 'c';
- this.configForm.radioChangeValue = detailData.creativeSceneInventory;
- }
- else if (detailData.creativeInventoryType) {
- this.configForm.adverPosition = 'b';
- this.configForm.checkboxChangeValue = detailData.creativeInventoryType.split(',');
- }
- else {
- this.configForm.adverPosition = 'a';
- }
- if (detailData.adKeywords) {
- this.creativeTag = detailData.adKeywords;
- }
- let paramsData = {};
- if (this.configForm.adDownloadType === 'DOWNLOAD_URL') {
- paramsData = {
- advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
- advertiserId: this.configForm.accountId,
- appType: 'APP_ANDROID',
- deliveryRange: 'DEFAULT',
- externalUrl: this.configForm.adExternalUrl,
- landingType: this.configForm.campaignLandingType,
- packageName: this.configForm.adPackage,
- promotionContent: this.configForm.adDownloadType
- };
- }
- else if (this.configForm.adDownloadType === 'EXTERNAL_URL') {
- paramsData = {
- advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
- advertiserId: this.configForm.accountId,
- deliveryRange: 'DEFAULT',
- externalUrl: this.configForm.adExternalUrl,
- landingType: this.configForm.campaignLandingType,
- promotionContent: this.configForm.adDownloadType
- };
- }
- postAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getToolConvert', paramsData).then(result => {
- if (result.code === 0) {
- const updateResult = result.result.filter(item => item.external_actions.length > 0);
- this.configForm.adConvertType = updateResult[0].convert_type;
- this.optimizationOption = updateResult[0].external_actions;
- setTimeout(() => {
- this.configForm.adConvertId = detailData.adConvertId;
- }, 300);
- }
- else {
- this.$message.error(result.message);
- }
- }).catch(error => {
- console.log(error, 'eeee');
- });
- }
- else {
- this.$message.error(result.message);
- }
- })
- .catch(error => {
- console.log(error, 'eeee');
- });
- },
- handleConvertTypeChange(e) {
- this.configForm.adConvertId = '';
- this.toolConvertList.forEach(item => {
- if (item.convert_type === e) {
- this.optimizationOption = item.external_actions;
- }
- });
- },
- // 优化目标数据获取
- handleGetOptimizationObjective(paramsData) {
- postAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getToolConvert', paramsData).then(result => {
- if (result.code === 0) {
- this.toolConvertList = result.result;
- if (this.configForm.adConvertType) {
- this.handleConvertTypeChange(this.configForm.adConvertType);
- }
- }
- else {
- this.$message.error(result.message);
- }
- }).catch(error => {
- console.log(error, 'eeee');
- });
- },
- // 创意分类接口
- handleGetCreativeClassification() {
- const paramsData = {
- accountId: this.configForm.accountId
- };
- getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getIndustryList', paramsData).then(result => {
- if (result.code === 0) {
- this.createOptions = result.result;
- }
- else {
- this.$message.error(result.message);
- }
- }).catch(error => {
- console.log(error, 'eeee');
- });
- },
- handleAddList(data) {
- postAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/addBytedanceStrategy', data).then(result => {
- if (result.code === 0) {
- this.$message.success('创建成功');
- this.$router.replace('/account-config/account-config');
- this.$bus.$emit('remove', '/account-config/components/configuration-modal');
- }
- else {
- this.$message.error(result.message);
- }
- }).catch(error => {
- console.log(error, 'eeee');
- });
- },
- // 点击获取光标位置进行字段插入
- handleGetChangeAll(item, field) {
- let node = document.getElementById(field);
- let startPos = node.selectionStart; // input 第0个字符到选中的字符
- let endPos = node.selectionEnd; // 选中的字符到最后的字符
- let txt = node.value;
- if (startPos === 0 || endPos === 0) {
- this.configForm.adName += '-{{' + item + '}}-';
- }
- else {
- this.configForm.adName = txt.substring(0, startPos) + '-{{' + item + '}}-' + txt.substring(endPos);
- node.selectionStart = startPos + item.length + 6;
- node.selectionEnd = startPos + item.length + 6;
- }
- node.focus();
- node.blur();
- },
- handleLaunchData(date, dateString) {
- this.configForm.launchDateRange = dateString;
- },
- handleBudgetMode(e) {
- if (e === 'BUDGET_MODE_TOTAL') {
- this.configForm.adScheduleType = 'SCHEDULE_START_END';
- this.adBudgetNum = this.configForm.launchTarget === 'OCPM' ? 300 : 0;
- this.configForm.adBudget = 300;
- if (Number(this.configForm.adCpaBid) > Number(this.configForm.adBudget)) {
- this.isAdCpaBidBlur = true;
- this.adCpaBidBlurTxt = '出价不能大于预算';
- }
- else {
- this.isAdCpaBidBlur = false;
- this.adCpaBidBlurTxt = '';
- }
- this.$message.warning('请设置投放时间');
- }
- else if (e === 'BUDGET_MODE_DAY') {
- this.adBudgetNum = 0;
- this.configForm.adBudget = 0;
- }
- },
- handleDelOrigin(list) {
- let formData = this.configForm.defaultFormList;
- this.configForm.defaultFormList = formData.filter(item => list.id !== item.id);
- },
- handleAddOrigin() {
- if (this.configForm.defaultFormList.length >= 10) {
- this.$message.error('最多可以添加10个卖点');
- return;
- }
- const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
- this.$nextTick(() => {
- this.configForm.defaultFormList.push({
- id: randomNum,
- value: ''
- });
- });
- },
- handleDownloadLink(e) {
- this.handleGetPackage();
- },
- handleDeleteImg() {
- this.imageUrl = '';
- this.isCoverImgDiv = false;
- },
- handleChangeActive() {
- this.isCoverImgDiv = true;
- },
- handleRemoveActive() {
- this.isCoverImgDiv = false;
- },
- getBase64(img, callback) {
- const reader = new FileReader();
- reader.addEventListener('load', () => callback(reader.result));
- reader.readAsDataURL(img);
- },
- beforeUpload(info) {
- const isZip = info.type.includes('png') || info.type.includes('jpeg');
- const fileOvesize = info.size > (1024 * 1024);
- if (!isZip) {
- this.$message.error('请上传正确类型的图片');
- this.imageUrl = '';
- this.urlResult = '';
- this.md5Result = '';
- return;
- }
- if (fileOvesize) {
- this.$message.error('图片大小不能超过1M');
- this.imageUrl = '';
- this.urlResult = '';
- this.md5Result = '';
- return;
- }
- new Promise(function (resolve, reject) {
- let width = 108;
- let height = 108;
- let _URL = window.URL || window.webkitURL;
- let img = new Image();
- img.onload = function () {
- let valid = img.width === width && img.height === height;
- valid ? resolve() : reject();
- };
- img.src = _URL.createObjectURL(info);
- }).then(() => {
- this.handleMd5(info);
- this.getBase64(info, imageUrl => {
- this.imageUrl = imageUrl;
- });
- }, () => {
- this.$message.error('图片尺寸必须是108*108!');
- this.imageUrl = '';
- this.urlResult = '';
- this.md5Result = '';
- return Promise.reject();
- });
- },
- cosUpload(file) {
- let that = this;
- let date = new Date();
- let y = date.getFullYear();
- let MM = date.getMonth() + 1;
- MM = MM < 10 ? '0' + MM : MM;
- let d = date.getDate();
- d = d < 10 ? '0' + d : d;
- let timeElse = new Date().getTime();
- let arr = file.name.split('.');
- let str = '';
- for (let i = 0; i < arr.length; i++) {
- if (i === arr.length - 1) {
- }
- else {
- if (i === arr.length - 2) {
- str += arr[i];
- }
- else {
- str += arr[i] + '.';
- }
- }
- }
- cos.putObject(
- {
- Bucket: 'media-1301855440',
- Region: 'ap-chongqing',
- // 存储桶所在地域,必须字段
- Key: that.uploadType + '/' + y + '-' + MM + '-' + d + '/' + str + '-' + timeElse + '.' + arr[arr.length - 1],
- StorageClass: 'STANDARD',
- Body: file // 上传文件对象
- },
- function (err, data) {
- if (err) {
- that.$message.error('上传失败!!!' + err);
- return;
- }
- that.loadingElse = false;
- that.fileList.push({
- uid: file.name,
- name: file.name,
- status: 'done',
- url: '//' + data.Location
- });
- that.urlResult = '//' + data.Location;
- }
- );
- },
- handleMd5(file) {
- let bmf = new BMF();
- let that = this;
- return new Promise(function (resolve, reject) {
- bmf.md5(file, (err, md5) => {
- that.md5Result = md5;
- getAction('/file/imageCheck', {code: md5}).then(result => {
- if (result.code === -206) {
- that.cosUpload(file);
- resolve();
- }
- else {
- that.urlResult = result.url;
- // reject();
- }
- }).catch(error => {
- console.log(error, 'eeee');
- reject();
- });
- });
- });
- },
- handleRelaxSure() {
- let paramsFormData = this.configForm;
- if (this.adBudgetShowTitle) {
- return;
- }
- if (this.configForm.adDistrict === 'CITY') {
- if (!this.configForm.adSelectCity.length) {
- this.$message.error('请选择省市');
- return;
- }
- }
- if (this.selectPackageTabs === '2' && !this.configForm.adAudiencePackageId) {
- this.$message.error('请选择已有定向包');
- return;
- }
- if (paramsFormData.customPerson === 'a') {
- if (paramsFormData.adRetargetingTagsType === '1' && !paramsFormData.adRetargetingTagsInclude) {
- this.$message.error('请选择人群');
- return;
- }
- else if (paramsFormData.adRetargetingTagsType === '2' && !paramsFormData.adRetargetingTagsExclude) {
- this.$message.error('请选择人群');
- return;
- }
- else if (paramsFormData.adRetargetingTagsType === '3' && (!paramsFormData.adRetargetingTagsExclude || !paramsFormData.adRetargetingTagsInclude)) {
- this.$message.error('请选择人群');
- return;
- }
- }
- if (this.configForm.adScheduleType === 'SCHEDULE_START_END' && !this.configForm.launchDateRange.length) {
- this.$message.error('请选择投放时间');
- return;
- }
- if (this.configForm.launchTimeInterval === 'a' && this.configForm.scheduleTimeData === str) {
- this.$message.error('请选择投放时段');
- return;
- }
- if (!this.urlResult) {
- this.$message.error('请上传图片');
- return;
- }
- if (!this.configForm.defaultFormList.length) {
- this.$message.error('请添加卖点');
- return;
- }
- if (!this.creativeTag.length) {
- this.$message.error('请添加标签');
- return;
- }
- if (this.campaignStatus) {
- return;
- }
- if (this.configForm.adBudget < this.configForm.adCpaBid) {
- this.isAdCpaBidBlur = true;
- this.adCpaBidBlurTxt = '出价不能大于预算';
- return;
- }
- else {
- this.isAdCpaBidBlur = false;
- }
- if (paramsFormData.adverPosition === 'a') {
- paramsFormData.creativeSmartInventory = 1;
- }
- else if (paramsFormData.adverPosition === 'b') {
- paramsFormData.creativeInventoryTypes = paramsFormData.checkboxChangeValue;
- }
- else if (paramsFormData.adverPosition === 'c') {
- paramsFormData.creativeSceneInventory = paramsFormData.radioChangeValue;
- }
- if (paramsFormData.launchTimeInterval === 'buxian') {
- paramsFormData.adScheduleTime = '';
- }
- else if (paramsFormData.launchTimeInterval === 'a') {
- paramsFormData.adScheduleTime = paramsFormData.scheduleTimeData;
- }
- if (paramsFormData.adScheduleType === 'SCHEDULE_START_END') {
- paramsFormData.adStartTime = paramsFormData.launchDateRange[0];
- paramsFormData.adEndTime = paramsFormData.launchDateRange[1];
- }
- else if (paramsFormData.adScheduleType === 'SCHEDULE_FROM_NOW') {
- paramsFormData.adStartTime = '';
- paramsFormData.adEndTime = '';
- }
- if (paramsFormData.launchTimeInterval === 'buxian') {
- paramsFormData.adScheduleTime = str;
- }
- else if (paramsFormData.launchTimeInterval === 'a') {
- paramsFormData.adScheduleTime = paramsFormData.scheduleTimeData;
- }
- if (paramsFormData.adAndroidVersion === 'a') {
- paramsFormData.adAndroidOsv = paramsFormData.androidChangeValue;
- }
- else {
- paramsFormData.adAndroidOsv = 'NONE';
- }
- paramsFormData.adCity = paramsFormData.adSelectCity.join(',');
- paramsFormData.adAge = paramsFormData.adSelectAge.join(',');
- paramsFormData.adAc = paramsFormData.adSelectAc.join(',');
- paramsFormData.adDeviceType = paramsFormData.adDeviceSelectType.join(',');
- paramsFormData.productSellingPoints = this.configForm.defaultFormList && this.configForm.defaultFormList.map(item => item.value);
- paramsFormData.creativeThirdIndustryId = paramsFormData.creativeThirdIndustryIds[2];
- paramsFormData.creativeProductImageCode = this.md5Result;
- paramsFormData.imageUrl = this.urlResult;
- paramsFormData.adKeywords = this.creativeTag;
- paramsFormData.userId = this.userInfo().id;
- this.$refs.ruleForm.validate(valid => {
- if (valid) {
- if (this.modalTitle === 'add') {
- this.handleAddList(paramsFormData);
- }
- else if (this.modalTitle === 'edit') {
- this.handleEditList(paramsFormData);
- }
- }
- else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- handleEditList(data) {
- const queryData = data;
- const routeQuery = JSON.parse(localStorage.getItem('queryList'));
- queryData.id = routeQuery.id;
- putAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/edit', queryData).then(result => {
- if (result.code === 0) {
- this.$message.success(result.message);
- this.$router.replace('/account-config/account-config');
- this.$bus.$emit('remove', '/account-config/components/configuration-modal');
- }
- else {
- this.$message.error(result.message);
- }
- }).catch(error => {
- console.log(error, 'eeee');
- });
- },
- handleRelaxCancel() {
- this.$router.replace('/account-config/account-config');
- this.$bus.$emit('remove', '/account-config/components/configuration-modal');
- },
- handleEnterChang(value) {
- this.creativeTag.push(...value);
- this.creativeTag = [...new Set(this.creativeTag)];
- for (let i = 0; i < this.creativeTag.length; i++) {
- if (this.creativeTag[i].length > 10) {
- this.creativeTag.splice(i, 1);
- this.$message.error('创意标签最多只能十个字符,超过的已清除');
- }
- }
- this.configForm.creativeLabel = [];
- },
- handleTagsClose(removedTag) {
- const tags = this.creativeTag.filter(tag => tag !== removedTag);
- this.creativeTag = tags;
- }
- }
- };
- </script>
- <style lang="less">
- @import "configuration-modal";
- .display-none-selset {
- display: none !important;
- }
- </style>
|