configuration-copy.vue 170 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308
  1. <template>
  2. <div class="configuration-modal">
  3. <div>
  4. <a-form-model
  5. ref="ruleForm"
  6. class="config-form-modal"
  7. :model="configForm"
  8. :rules="rules"
  9. :label-col="labelCol"
  10. :wrapper-col="wrapperCol"
  11. >
  12. <a-spin :spinning="spinning">
  13. <p class="separate-title-header">复制配置信息</p>
  14. <div class="separate-module-con">
  15. <a-form-model-item label="广告账户">
  16. <acount-search
  17. class="acount-search-class"
  18. :appId.sync="configForm.accountId"
  19. :multiple="false"
  20. request="1,3"
  21. @select-value="handleSelectValue"
  22. >
  23. </acount-search>
  24. </a-form-model-item>
  25. <a-form-model-item label="dp链接">
  26. <a-radio-group
  27. v-model="configForm.dpLinkIndexUsed"
  28. button-style="solid"
  29. @change="handleDpLinkIndexUsed"
  30. >
  31. <a-radio-button :value="0">关闭</a-radio-button>
  32. <a-radio-button :value="1">开启</a-radio-button>
  33. </a-radio-group>
  34. </a-form-model-item>
  35. <div v-if="configForm.dpLinkIndexUsed === 1">
  36. <a-form-model-item label="dp链接范围" class="dp-link-start" prop="dpLinkStartIndex">
  37. <a-input-number
  38. class="common-input"
  39. v-model="configForm.dpLinkStartIndex"
  40. :min="1"
  41. placeholder="请输入"
  42. @change="handleDplinkStart"
  43. />
  44. <span>~</span>
  45. </a-form-model-item>
  46. <a-form-model-item class="dp-link-end" prop="dpLinkEndIndex">
  47. <a-input-number
  48. class="common-input"
  49. v-model="configForm.dpLinkEndIndex"
  50. :min="getEndIndex"
  51. placeholder="请输入"
  52. @change="handleDplinkEnd"
  53. />
  54. </a-form-model-item>
  55. </div>
  56. <a-form-model-item label="预算方式">
  57. <a-radio-group
  58. v-model="configForm.accountBudgetMode"
  59. button-style="solid"
  60. @change="handleAccountMode"
  61. >
  62. <a-radio-button value="1">不限预算</a-radio-button>
  63. <a-radio-button value="2">指定预算</a-radio-button>
  64. </a-radio-group>
  65. </a-form-model-item>
  66. <a-form-model-item v-if="configForm.accountBudgetMode === '2'" label="账户日预算" prop="accountBudget">
  67. <a-input-number
  68. v-model="configForm.accountBudget"
  69. :min="1000"
  70. :max="9999999.99"
  71. :step="0.01"
  72. @blur="handleAccountBudget"
  73. /> 元
  74. </a-form-model-item>
  75. </div>
  76. <div class="separate-module-con">
  77. <p class="rock-title">广告组信息</p>
  78. <a-form-model-item label="推广目标">
  79. <a-radio-group v-model="configForm.campaignLandingType" button-style="solid">
  80. <a-radio-button value="APP">应用</a-radio-button>
  81. <a-radio-button value="LINK" disabled>销售线索收集</a-radio-button>
  82. <a-radio-button value="SHOP" disabled>电商店铺推广</a-radio-button>
  83. </a-radio-group>
  84. </a-form-model-item>
  85. <a-form-model-item label="广告类型">
  86. <a-radio-group v-model="configForm.advertisingType" button-style="solid">
  87. <a-radio-button value="1">信息流广告</a-radio-button>
  88. <a-radio-button value="2">搜索广告</a-radio-button>
  89. </a-radio-group>
  90. </a-form-model-item>
  91. </div>
  92. <div class="separate-module-con">
  93. <p class="rock-title">基础信息</p>
  94. <a-form-model-item label="广告组名称" prop="campaignName">
  95. <a-input
  96. class="common-input-long"
  97. id="campaignName"
  98. v-model="configForm.campaignName"
  99. allow-clear
  100. placeholder="请输入广告组名称"
  101. />
  102. <div>
  103. <a-tag
  104. v-for="item in campaignTags"
  105. :key="item"
  106. color="#1890ff"
  107. @click="handleGetChangeAll(item, 'campaignName', 'campaignName')"
  108. >
  109. + {{ item }}
  110. </a-tag>
  111. </div>
  112. </a-form-model-item>
  113. <a-form-model-item label="广告计划名称" prop="adName">
  114. <a-input
  115. class="common-input-long"
  116. id="groupName"
  117. v-model="configForm.adName"
  118. allow-clear
  119. placeholder="请输入广告计划名称"
  120. />
  121. <div>
  122. <a-tag
  123. v-for="item in adNameTags"
  124. :key="item"
  125. color="#1890ff"
  126. @click="handleGetChangeAll(item, 'groupName', 'adName')"
  127. >
  128. + {{ item }}
  129. </a-tag>
  130. </div>
  131. </a-form-model-item>
  132. <a-form-model-item label="创建数量: 广告组数量" class="campaign-cnt-class" prop="campaignCnt">
  133. <a-input-number
  134. v-model="configForm.campaignCnt"
  135. :min="1"
  136. @change="handleCampaignCnt"
  137. :disabled="configForm.dpLinkIndexUsed === 0"
  138. />
  139. <a-tooltip placement="top">
  140. <template slot="title">
  141. <span>输入的数量为每天所创建的广告组数量</span>
  142. <span>以及每个广告组创建的广告计划数量</span>
  143. </template>
  144. <a-icon class="form-itrm-icon" type="question-circle"/>
  145. </a-tooltip>
  146. <div v-if="campaignStatus" style="width: 500px;color: #f00;">单账号每天创建计划上限500个</div>
  147. </a-form-model-item>
  148. <a-form-model-item label="广告计划数量" class="campaign-ad-class" prop="campaignAdCnt">
  149. <a-input-number v-model="configForm.campaignAdCnt" :min="1" @change="handleCampaignAdCnt"/>
  150. </a-form-model-item>
  151. </div>
  152. <div class="separate-module-con">
  153. <p class="rock-title">投放内容</p>
  154. <a-form-model-item label="投放目标">
  155. <a-radio-group v-model="configForm.launchTarget" button-style="solid">
  156. <a-radio-button value="OCPM">转化量</a-radio-button>
  157. <a-radio-button value="CPC" disabled>点击量</a-radio-button>
  158. <a-radio-button value="CPM" disabled>展示量</a-radio-button>
  159. </a-radio-group>
  160. </a-form-model-item>
  161. <a-form-model-item label="下载链接" prop="adDownloadUrl">
  162. <a-input
  163. class="common-input-long"
  164. v-model="configForm.adDownloadUrl"
  165. placeholder="请输入下载链接"
  166. allow-clear
  167. @change="handleDownloadLink"
  168. />
  169. </a-form-model-item>
  170. <a-form-model-item label="应用包名" prop="adPackage">
  171. <a-input
  172. class="common-input-long"
  173. v-model="configForm.adPackage"
  174. placeholder="请输入应用包名"
  175. allow-clear
  176. />
  177. </a-form-model-item>
  178. <a-form-model-item label="下载方式">
  179. <a-radio-group
  180. v-model="configForm.adDownloadType"
  181. button-style="solid"
  182. @change="handleAdDownLoadType"
  183. >
  184. <a-radio-button value="DOWNLOAD_URL">下载链接</a-radio-button>
  185. <a-radio-button value="EXTERNAL_URL">落地页</a-radio-button>
  186. </a-radio-group>
  187. </a-form-model-item>
  188. <div v-if="configForm.adDownloadType === 'EXTERNAL_URL'">
  189. <a-form-model-item label="落地页链接" prop="adExternalUrl" key="arr">
  190. <a-input
  191. class="common-input-long"
  192. :disabled="modalTitle === 'edit'"
  193. v-model="configForm.adExternalUrl"
  194. placeholder="请输入落地页链接"
  195. allow-clear
  196. />
  197. </a-form-model-item>
  198. </div>
  199. <!-- <a-form-model-item v-if="configForm.adDownloadType === 'EXTERNAL_URL'" label="落地页链接" prop="adExternalUrl">
  200. <a-input
  201. class="common-input-long"
  202. v-model="configForm.adExternalUrl"
  203. placeholder="请输入落地页链接"
  204. allow-clear
  205. />
  206. </a-form-model-item> -->
  207. <!-- <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="下载链接" prop="adDownloadUrl">
  208. <a-input
  209. class="common-input-long"
  210. v-model="configForm.adDownloadUrl"
  211. placeholder="请输入下载链接"
  212. allow-clear
  213. @change="handleDownloadLink"
  214. />
  215. </a-form-model-item>
  216. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用包名" prop="adPackage">
  217. <a-input
  218. class="common-input-long"
  219. v-model="configForm.adPackage"
  220. placeholder="请输入应用包名"
  221. allow-clear
  222. />
  223. </a-form-model-item> -->
  224. <a-form-model-item label="直达链接内容">
  225. <a-input
  226. class="common-input-long"
  227. v-model="configForm.adOpenUrl"
  228. placeholder="请输入直达链接内容"
  229. allow-clear
  230. />
  231. </a-form-model-item>
  232. <a-form-model-item v-if="platformLoadingType === 'APP_ANDROID' && configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用下载详情页" prop="creativeWebUrl">
  233. <a-input
  234. class="common-input-long"
  235. v-model="configForm.creativeWebUrl"
  236. placeholder="请输入应用下载详情页"
  237. allow-clear
  238. @change="handleCreativeWebUrl"
  239. />
  240. <span style="margin-left: 10px;"><a @click="handleHaveWebUrl">使用已有</a></span>
  241. </a-form-model-item>
  242. <div v-if="platformLoadingType === 'APP_ANDROID' && configForm.adDownloadType === 'DOWNLOAD_URL'" class="adver-position-radio">
  243. <div class="create-web-url-class">
  244. <div class="web-url-img">
  245. <img v-if="landingPageShowData.thumbnail" :src="landingPageShowData.thumbnail"/>
  246. <img v-else src="@/assets/noImg.png"/>
  247. </div>
  248. <div class="web-url-content">
  249. <div class="url-content-name"><a>{{ landingPageShowData.name }}</a></div>
  250. <div class="url-content-id">ID:{{ landingPageShowData.siteId || '暂无' }}</div>
  251. </div>
  252. </div>
  253. </div>
  254. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="优先应用商店下载">
  255. <a-radio-group
  256. v-model="configForm.adDownloadMode"
  257. button-style="solid"
  258. >
  259. <a-radio-button value="DEFAULT">不启用</a-radio-button>
  260. <a-radio-button value="APP_STORE_DELIVERY">启用</a-radio-button>
  261. </a-radio-group>
  262. </a-form-model-item>
  263. </div>
  264. <div class="separate-module-con">
  265. <p class="rock-title">优化目标</p>
  266. <a-form-model-item label="转化跟踪方式" :prop="configForm.launchTarget === 'OCPM' ? 'adConvertType' : ''">
  267. <a-select
  268. class="common-input-long"
  269. v-model="configForm.adConvertType"
  270. placeholder="请选择"
  271. @change="handleConvertTypeChange"
  272. >
  273. <a-select-option value="AD_CONVERT_SOURCE_TYPE_APP_DOWNLOAD">应用下载API</a-select-option>
  274. <a-select-option value="AD_CONVERT_SOURCE_TYPE_SDK">应用下载SDK</a-select-option>
  275. <a-select-option value="AD_CONVERT_SOURCE_TYPE_OPEN_URL">应用直达API(应用直达链接)</a-select-option>
  276. <a-select-option value="AD_CONVERT_SOURCE_TYPE_NORMAL_APP_DOWNLOAD">普通应用下载</a-select-option>
  277. </a-select>
  278. </a-form-model-item>
  279. <a-form-model-item label="优化目标" :prop="configForm.launchTarget === 'OCPM' ? 'adConvertId' : ''">
  280. <a-select
  281. class="common-input-long"
  282. v-model="configForm.adConvertId"
  283. placeholder="请选择"
  284. @change="handleConvertChange"
  285. >
  286. <a-select-option
  287. v-for="(item, index) in optimizationOption"
  288. :key="index"
  289. :value="item.convert_id"
  290. >
  291. {{ item.external_name }}
  292. </a-select-option>
  293. </a-select>
  294. </a-form-model-item>
  295. </div>
  296. <div class="separate-module-con">
  297. <p class="rock-title">设置投放位置</p>
  298. <a-form-model-item label="广告位置">
  299. <a-radio-group
  300. v-model="configForm.adverPosition"
  301. button-style="solid"
  302. @change="handleAdverPosition"
  303. >
  304. <a-radio-button value="a">系统优选广告位</a-radio-button>
  305. <a-radio-button value="b">按媒体指定位置</a-radio-button>
  306. <a-radio-button value="c">按场景指定位置</a-radio-button>
  307. </a-radio-group>
  308. </a-form-model-item>
  309. <div class="adver-position-radio">
  310. <p v-if="configForm.adverPosition === 'a'">
  311. 系统将根据您设置的定向,选择预估效果最好的广告位进行投放,并触达尽可能多的目标用户
  312. </p>
  313. <div v-if="configForm.adverPosition === 'c'" class="position-radio-change">
  314. <p>位置选择</p>
  315. <a-radio-group v-model="configForm.radioChangeValue">
  316. <a-radio :style="radioStyle" value="VIDEO_SCENE">沉浸式竖版视频场景</a-radio>
  317. <a-radio :style="radioStyle" value="FEED_SCENE">信息流场景</a-radio>
  318. <a-radio :style="radioStyle" value="TAIL_SCENE">视频后贴和尾帧场景</a-radio>
  319. </a-radio-group>
  320. </div>
  321. <div v-if="configForm.adverPosition === 'b'" class="position-radio-change">
  322. <p>位置选择</p>
  323. <a-checkbox-group v-model="configForm.checkboxChangeValue" @change="NewCheckboxChangeValue">
  324. <a-checkbox :style="radioStyle" value="INVENTORY_FEED">今日头条</a-checkbox>
  325. <a-checkbox :style="radioStyle" value="INVENTORY_VIDEO_FEED">西瓜视频</a-checkbox>
  326. <a-checkbox :style="radioStyle" value="INVENTORY_HOTSOON_FEED">抖音火山版</a-checkbox>
  327. <a-checkbox :style="radioStyle" value="INVENTORY_AWEME_FEED">抖音短视频</a-checkbox>
  328. <a-checkbox :style="radioStyle" value="INVENTORY_UNION_SLOT">穿山甲</a-checkbox>
  329. <a-checkbox :style="radioStyle" value="UNION_BOUTIQUE_GAME">ohayoo精品游戏</a-checkbox>
  330. <a-checkbox :style="radioStyle" value="INVENTORY_TOMATO_NOVEL">番茄小说</a-checkbox>
  331. </a-checkbox-group>
  332. </div>
  333. </div>
  334. <a-form-model-item v-if="configForm.checkboxChangeValue.length === 1 && configForm.checkboxChangeValue[0] === 'INVENTORY_UNION_SLOT'" label="投放形式">
  335. <a-radio-group
  336. v-model="configForm.adUnionVideoType"
  337. button-style="solid"
  338. @change="handleAdUnionVideoType"
  339. >
  340. <a-radio-button value="REWARDED_VIDEO">
  341. 激励视频
  342. <a-tooltip placement="top">
  343. <template slot="title">
  344. <span>特定场景下用户通过观看视频广告以换取游戏/应用内虚拟奖励的广告</span>
  345. </template>
  346. <a-icon type="question-circle"/>
  347. </a-tooltip>
  348. </a-radio-button>
  349. <a-radio-button value="ORIGINAL_VIDEO">原生</a-radio-button>
  350. <a-radio-button value="SPLASH_VIDEO">开屏</a-radio-button>
  351. </a-radio-group>
  352. </a-form-model-item>
  353. </div>
  354. <div class="separate-module-con">
  355. <a-tabs v-model="configForm.adDirectionalFlag">
  356. <a-tab-pane key="add" tab="新建定向">
  357. <p class="rock-title">用户定向</p>
  358. <a-form-model-item label="地域">
  359. <a-radio-group
  360. v-model="configForm.adDistrict"
  361. button-style="solid"
  362. @change="handleAdDistrict"
  363. >
  364. <a-radio-button value="NONE">不限</a-radio-button>
  365. <a-radio-button value="CITY">按省市</a-radio-button>
  366. <a-radio-button value="COUNTY" disabled>按区县</a-radio-button>
  367. </a-radio-group>
  368. </a-form-model-item>
  369. <div v-if="configForm.adDistrict === 'CITY'" class="adver-position-radio selected-city-arr">
  370. <link-multi-select
  371. title="省份"
  372. :listArr="listArr"
  373. :maxLayers="2"
  374. :listUrl="regionCityListUrl"
  375. @getSelectedArr="getSelectedCityArr"
  376. @checkedShowList="handleCheckedShowList"
  377. >
  378. </link-multi-select>
  379. <a-radio-group class="city-arr-radio-group" v-model="configForm.adLocationType">
  380. <a-radio value="HOME">居住在该地区的用户</a-radio>
  381. <a-radio value="TRAVEL"> 到该地区旅行的用户</a-radio>
  382. <a-radio value="ALL">该地区内的所有用户</a-radio>
  383. <a-radio value="CURRENT">正在该地区的用户</a-radio>
  384. </a-radio-group>
  385. </div>
  386. <a-form-model-item label="性别">
  387. <a-radio-group v-model="configForm.adGender" button-style="solid">
  388. <a-radio-button value="NONE">不限</a-radio-button>
  389. <a-radio-button value="GENDER_MALE">男</a-radio-button>
  390. <a-radio-button value="GENDER_FEMALE">女</a-radio-button>
  391. </a-radio-group>
  392. </a-form-model-item>
  393. <a-form-model-item label="年龄">
  394. <radio-check v-model="configForm.adSelectAge" :options="ageArr" @change="getAgeSelect"></radio-check>
  395. </a-form-model-item>
  396. <a-form-model-item label="行为兴趣">
  397. <a-radio-group
  398. v-model="configForm.adInterestActionMode"
  399. button-style="solid"
  400. >
  401. <a-radio-button value="UNLIMITED">不限</a-radio-button>
  402. <a-radio-button value="RECOMMEND">
  403. 系统推荐
  404. <a-tooltip placement="top">
  405. <template slot="title">
  406. <span>若与自定义人群包同时使用,选择定向人群时系统推荐定向不生效</span>
  407. </template>
  408. <a-icon type="question-circle" />
  409. </a-tooltip>
  410. </a-radio-button>
  411. <a-radio-button value="CUSTOM" disabled>自定义</a-radio-button>
  412. </a-radio-group>
  413. </a-form-model-item>
  414. <a-form-model-item label="自定义人群">
  415. <a-radio-group
  416. v-model="configForm.customPerson"
  417. button-style="solid"
  418. @change="handleCustomPerson"
  419. >
  420. <a-radio-button value="NONE">不限</a-radio-button>
  421. <a-radio-button value="a">自定义人群</a-radio-button>
  422. </a-radio-group>
  423. </a-form-model-item>
  424. <a-form-model-item v-if="configForm.customPerson === 'a'" label="定向逻辑">
  425. <a-radio-group
  426. v-model="configForm.adRetargetingTagsType"
  427. button-style="solid"
  428. @change="handleDirectionalLogic"
  429. >
  430. <a-radio-button value="1">定向</a-radio-button>
  431. <a-radio-button value="2">排除</a-radio-button>
  432. <a-radio-button value="3">同时定向排除</a-radio-button>
  433. </a-radio-group>
  434. </a-form-model-item>
  435. <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '1'" class="adver-position-radio">
  436. <div style="width: 60%;">
  437. <directional-logic
  438. ref="direct"
  439. packtype="directional"
  440. multitype="alone"
  441. :defaultlist="directionalData"
  442. :valueids="configForm.adRetargetingTagsType"
  443. :updatelistinclude="configForm.updateGetingInclude" @selection-alone-event="handleSelectionAloneEvent"
  444. @clearlist="handleClearlist"
  445. @clear-table-alone="handleClearTableAlone"
  446. >
  447. </directional-logic>
  448. </div>
  449. </div>
  450. <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '2'" class="adver-position-radio">
  451. <div style="width: 60%;">
  452. <directional-logic
  453. ref="exclude"
  454. packtype="exclude"
  455. multitype="alone"
  456. :defaultlist="directionalData"
  457. :valueids="configForm.adRetargetingTagsType"
  458. :updatelistexclude="configForm.updateGetingExclude" @selection-alone-event="handleSelectionAloneEvent"
  459. @clearlist="handleClearlist"
  460. @clear-table-alone="handleClearTableLogic"
  461. >
  462. </directional-logic>
  463. </div>
  464. </div>
  465. <div v-if="configForm.customPerson === 'a' && configForm.adRetargetingTagsType === '3'" class="adver-position-radio">
  466. <div style="width: 60%;">
  467. <directional-logic
  468. ref="twoway"
  469. packtype="twoway"
  470. multitype="all"
  471. :defaultlist="directionalData"
  472. :valueids="configForm.adRetargetingTagsType"
  473. :updatelistinclude="configForm.updateGetingInclude"
  474. :updatelistexclude="configForm.updateGetingExclude" @selection-direct-event="handleDirectEvent"
  475. @selection-exclude-event="handleExcludeEvent"
  476. @clearlist="handleClearlist"
  477. @clear-table-direct="handleClearTableAlone"
  478. @clear-table-exclude="handleClearTableLogic"
  479. >
  480. </directional-logic>
  481. </div>
  482. </div>
  483. <a-form-model-item label="媒体定向">
  484. <a-radio-group v-model="configForm.adSuperiorPopularityType" button-style="solid">
  485. <a-radio-button value="NONE">不限</a-radio-button>
  486. <a-radio-button value="GAME" disabled>游戏优质媒体</a-radio-button>
  487. <a-radio-button value="b" disabled>自定义</a-radio-button>
  488. </a-radio-group>
  489. </a-form-model-item>
  490. <a-form-model-item label="平台">
  491. <!-- <check-more-plat
  492. v-model="configForm.updateAdPlatform"
  493. :options="adPlatformOption"
  494. @change="handlePlateSelect"
  495. >
  496. </check-more-plat> -->
  497. <a-radio-group v-model="configForm.adPlatform" button-style="solid">
  498. <a-radio-button value="NONE" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">不限</a-radio-button>
  499. <a-radio-button value="IOS" :disabled="platformLoadingType === 'APP_ANDROID'">IOS</a-radio-button>
  500. <a-radio-button value="ANDROID" :disabled="platformLoadingType === 'APP_IOS'">Andriod</a-radio-button>
  501. <a-radio-button value="PC" :disabled="platformLoadingType === 'APP_IOS' || platformLoadingType === 'APP_ANDROID'">PC</a-radio-button>
  502. </a-radio-group>
  503. </a-form-model-item>
  504. <a-form-model-item label="设备类型">
  505. <radio-check
  506. v-model="configForm.adDeviceSelectType"
  507. :options="deviceTypeList"
  508. @change="getAgeSelect"
  509. >
  510. </radio-check>
  511. </a-form-model-item>
  512. <a-form-model-item v-if="configForm.adDownloadUrl" label="安卓版本">
  513. <a-radio-group v-model="configForm.adAndroidVersion" button-style="solid" @change="handleAndroidVersion">
  514. <a-radio-button value="NONE">不限</a-radio-button>
  515. <a-radio-button value="a">自定义</a-radio-button>
  516. </a-radio-group>
  517. </a-form-model-item>
  518. <div class="adver-position-radio">
  519. <div v-if="configForm.adDownloadUrl && configForm.adAndroidVersion === 'a'" class="position-radio-change">
  520. <p>安卓版本</p>
  521. <a-radio-group v-model="configForm.androidChangeValue">
  522. <a-radio :style="radioStyle" value="9.0">Andriod 9.0及以上</a-radio>
  523. <a-radio :style="radioStyle" value="8.1">Andriod 8.1及以上</a-radio>
  524. <a-radio :style="radioStyle" value="8.0">Andriod 8.0及以上</a-radio>
  525. <a-radio :style="radioStyle" value="7.1">Andriod 7.1及以上</a-radio>
  526. <a-radio :style="radioStyle" value="7.0">Andriod 7.0及以上</a-radio>
  527. <a-radio :style="radioStyle" value="6.0">Andriod 6.0及以上</a-radio>
  528. <a-radio :style="radioStyle" value="5.1">Andriod 5.1及以上</a-radio>
  529. </a-radio-group>
  530. </div>
  531. </div>
  532. <a-form-model-item label="网络">
  533. <radio-check v-model="configForm.adSelectAc" :options="adAcList" @change="getAgeSelect"></radio-check>
  534. </a-form-model-item>
  535. <a-form-model-item label="已安装用户">
  536. <a-radio-group v-model="configForm.adHideIfExists" button-style="solid">
  537. <a-radio-button value="0">不限</a-radio-button>
  538. <a-radio-button value="1">过滤</a-radio-button>
  539. <a-radio-button value="2">定向</a-radio-button>
  540. </a-radio-group>
  541. </a-form-model-item>
  542. <a-form-model-item v-if="configForm.adConvertType" label="过滤已转化用户">
  543. <a-radio-group v-model="configForm.adHideIfConverted" button-style="solid" @change="handleAdhideConver">
  544. <a-radio-button
  545. v-for="item in adHideIfConvertedDataOption"
  546. :key="item.id"
  547. :value="item.id"
  548. >
  549. {{ item.name }}
  550. </a-radio-button>
  551. </a-radio-group>
  552. </a-form-model-item>
  553. <a-form-model-item v-if="configForm.adHideIfConverted === 'CUSTOMER' || configForm.adHideIfConverted === 'APP'" label="过滤时间">
  554. <a-radio-group v-model="configForm.adConvertedTimeDuration" button-style="solid">
  555. <a-radio-button value="ONE_MONTH">1个月</a-radio-button>
  556. <a-radio-button value="THREE_MONTH">3个月</a-radio-button>
  557. <a-radio-button value="SIX_MONTH">6个月</a-radio-button>
  558. <a-radio-button value="TWELVE_MONTH">12个月</a-radio-button>
  559. </a-radio-group>
  560. <a-tooltip placement="top">
  561. <template slot="title">
  562. <span>对已转化过的用户避免再次投放的时间</span>
  563. </template>
  564. <a-icon class="form-itrm-icon" style="left: -90px;" type="question-circle"/>
  565. </a-tooltip>
  566. </a-form-model-item>
  567. <a-form-model-item label="智能放量">
  568. <a-radio-group
  569. :disabled="!adAutoExtendList.length"
  570. v-model="configForm.adAutoExtendEnabled"
  571. button-style="solid"
  572. @change="handleAdAutoExtend"
  573. >
  574. <a-radio-button value="0">不开启</a-radio-button>
  575. <a-radio-button value="1">开启</a-radio-button>
  576. </a-radio-group>
  577. <a-tooltip placement="top">
  578. <template slot="title">
  579. <span>智能放量可以帮您逐步探索已选定向人群之外的目标人群,提升跑量。已选择定向建议放开</span>
  580. </template>
  581. <a-icon class="form-itrm-icon" style="left: -90px;" type="question-circle"/>
  582. </a-tooltip>
  583. </a-form-model-item>
  584. <div v-if="configForm.adAutoExtendEnabled === '1'" class="adver-position-radio" style="width: 70%;">
  585. <auto-select
  586. :defaultlist="adAutoExtendList"
  587. :editdata="AutoExtendEditSelect"
  588. @select-finally-result="handleSelectTxtend"
  589. >
  590. </auto-select>
  591. </div>
  592. </a-tab-pane>
  593. <a-tab-pane key="choice" tab="选择定向包">
  594. <a-form-model-item class="select-orientation-class" label="选择已有定向包" :prop="configForm.adDirectionalFlag === 'choice' ? 'adAudiencePackageId' : ''">
  595. <a-select
  596. class="common-input-long"
  597. style="width: 320px;"
  598. v-model="configForm.adAudiencePackageId"
  599. allow-clear
  600. placeholder="请选择已有定向包名称"
  601. :disabled="selectOrientPlaceholder !== 'able'"
  602. @change="handleSelectiveOrientation"
  603. >
  604. <a-select-option
  605. v-for="(item, index) in selectiveList"
  606. :key="index"
  607. :value="item.audience_package_id"
  608. >
  609. <div class="orient-list">
  610. <span class="orient-option-left" style="display: inline-block;width: 150px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.name }}</span>
  611. <span class="orient-option-right" style="display: inline-block;width: 150px;text-align:right;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{{ item.changeName }}</span>
  612. </div>
  613. </a-select-option>
  614. </a-select>
  615. <span style="margin-left: 20px;">
  616. <a-button :disabled="selectOrientPlaceholder !== 'able'" type="primary" @click="handleAsyncPackage">同步定向包</a-button>
  617. </span>
  618. <a-tooltip placement="top">
  619. <template slot="title">
  620. <span>已有定向包只展示当前推广目的和投放范围下,定向功能升级后仍可用的定向包</span>
  621. </template>
  622. <a-icon class="form-itrm-icon orientation-icon" type="question-circle"/>
  623. </a-tooltip>
  624. </a-form-model-item>
  625. <span v-if="selectOrientPlaceholder !== 'able'" style="color: #f00; margin-left: 198px;">{{ selectOrientPlaceholder }}</span>
  626. <div class="select-orientation-content">
  627. <p class="orientation-header-title">已选定向信息</p>
  628. <div v-if="packageMessageDetail.length" class="orientation-content-substance">
  629. <div class="content-substance-singal">
  630. <span class="singal-spn">定向人群包:</span>
  631. <span class="singal-content">{{ packageMessageDetail[0].description }}</span>
  632. </div>
  633. <div class="content-substance-singal">
  634. <span class="singal-spn">地域:</span>
  635. <span class="singal-content">{{ packageMessageDetail[0].replaceCitys }}</span>
  636. </div>
  637. <div class="content-substance-singal">
  638. <span class="singal-spn">性别:</span>
  639. <span class="singal-content">{{ packageMessageDetail[0].replaceSex }}</span>
  640. </div>
  641. <div class="content-substance-singal">
  642. <span class="singal-spn">年龄:</span>
  643. <span class="singal-content">{{ packageMessageDetail[0].replaceAge }}</span>
  644. </div>
  645. <div class="content-substance-singal">
  646. <span class="singal-spn">平台:</span>
  647. <span class="singal-content">{{ packageMessageDetail[0].replacePlate }}</span>
  648. </div>
  649. <div class="content-substance-singal">
  650. <span class="singal-spn">智能放量:</span>
  651. <span class="singal-content">{{ packageMessageDetail[0].replaceEnabled }}</span>
  652. </div>
  653. </div>
  654. <div v-else class="orientation-content-msg">
  655. <div class="icon"><a-icon type="container"/></div>
  656. <div>请在上方选择一个已有定向包</div>
  657. </div>
  658. </div>
  659. </a-tab-pane>
  660. </a-tabs>
  661. </div>
  662. <div class="separate-module-con">
  663. <p class="rock-title">预算与出价</p>
  664. <a-form-model-item label="投放场景">
  665. <a-radio-group v-model="configForm.adSmartBidType" button-style="solid">
  666. <a-radio-button value="SMART_BID_CUSTOM">常规投放</a-radio-button>
  667. <a-radio-button value="SMART_BID_CONSERVATIVE" disabled>放量投放</a-radio-button>
  668. </a-radio-group>
  669. </a-form-model-item>
  670. <a-form-model-item label="预算">
  671. <a-input-group compact>
  672. <a-select
  673. v-model="configForm.adBudgetMode"
  674. @change="handleBudgetMode"
  675. >
  676. <a-select-option value="BUDGET_MODE_DAY">日预算</a-select-option>
  677. <a-select-option value="BUDGET_MODE_TOTAL">总预算</a-select-option>
  678. </a-select>
  679. <a-input-number
  680. class="common-input"
  681. v-model="configForm.adBudget"
  682. :min="adBudgetNum"
  683. :step="0.01"
  684. @blur="handleAdBudgetBlur"
  685. />
  686. </a-input-group>
  687. </a-form-model-item>
  688. <a-form-model-item label="投放时间">
  689. <a-radio-group
  690. :disabled="configForm.adBudgetMode === 'BUDGET_MODE_TOTAL'"
  691. v-model="configForm.adScheduleType"
  692. button-style="solid"
  693. @change="handleAdScheduleType"
  694. >
  695. <a-radio-button value="SCHEDULE_FROM_NOW">从今天起长期投放</a-radio-button>
  696. <a-radio-button value="SCHEDULE_START_END">设置开始和结束日期</a-radio-button>
  697. </a-radio-group>
  698. </a-form-model-item>
  699. <div class="adver-position-radio">
  700. <div v-if="configForm.adScheduleType === 'SCHEDULE_START_END'" class="position-radio-change">
  701. <a-range-picker
  702. v-model="configForm.launchDateRange"
  703. format="YYYY-MM-DD"
  704. @change="handleLaunchData"
  705. />
  706. </div>
  707. </div>
  708. <a-form-model-item label="投放时段">
  709. <a-radio-group v-model="configForm.launchTimeInterval" button-style="solid" @change="handleLaunchTimeInterval">
  710. <a-radio-button value="buxian">不限</a-radio-button>
  711. <a-radio-button value="a">指定时间段</a-radio-button>
  712. </a-radio-group>
  713. </a-form-model-item>
  714. <div class="adver-position-radio">
  715. <div v-if="configForm.launchTimeInterval === 'a'" class="position-radio-change">
  716. <selectCheckAll
  717. style="width:100%"
  718. :scheduleTime.sync="configForm.scheduleTimeData"
  719. ref="selectCheck"
  720. />
  721. </div>
  722. </div>
  723. <a-form-model-item label="付费方式">
  724. <a-radio-group v-model="configForm.adPricing" button-style="solid">
  725. <a-radio-button value="PRICING_OCPM">按展示付费(oCPM)</a-radio-button>
  726. </a-radio-group>
  727. </a-form-model-item>
  728. <a-form-model-item label="出价方式">
  729. <a-radio-group v-model="configForm.adBidCreateType" button-style="solid" @change="handleBiddingMethod">
  730. <a-radio-button value="FIX">固定出价</a-radio-button>
  731. <a-radio-button value="RAND">随机出价</a-radio-button>
  732. <a-radio-button value="STEP">阶梯出价</a-radio-button>
  733. </a-radio-group>
  734. </a-form-model-item>
  735. <a-form-model-item v-if="configForm.adBidCreateType === 'FIX'" label="目标转化出价" :prop="configForm.launchTarget === 'OCPM' ? 'adCpaBid' : ''">
  736. <a-input-number
  737. class="common-input"
  738. v-model="configForm.adCpaBid"
  739. :min="0.1"
  740. :step="0.01"
  741. @blur="handleAdCpaBidBlur"
  742. /> 元
  743. <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;">{{ adCpaBidBlurTxt }}</div>
  744. </a-form-model-item>
  745. <div v-if="configForm.adBidCreateType === 'RAND'">
  746. <a-form-model-item label="目标转化出价" class="dp-link-start" prop="adMinBid">
  747. <a-input-number
  748. class="common-input"
  749. v-model="configForm.adMinBid"
  750. :min="0.1"
  751. :max="10000"
  752. :step="0.01"
  753. placeholder="请输入"
  754. @blur="handleAdMinBidBlur"
  755. />
  756. <span>~</span>
  757. </a-form-model-item>
  758. <a-form-model-item class="dp-link-end" prop="adMaxBid">
  759. <a-input-number
  760. class="common-input"
  761. v-model="configForm.adMaxBid"
  762. :min="0.1"
  763. :max="10000"
  764. :step="0.01"
  765. placeholder="请输入"
  766. @blur="handleAdMaxBidBlur"
  767. /> 元
  768. </a-form-model-item>
  769. <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px;">{{ adCpaBidBlurTxt }}</div>
  770. </div>
  771. <div v-if="configForm.adBidCreateType === 'STEP'">
  772. <a-form-model-item label="目标转化出价" class="dp-link-start" prop="adMinBid">
  773. <a-input-number
  774. class="common-input"
  775. v-model="configForm.adMinBid"
  776. :min="0.1"
  777. :max="10000"
  778. :step="0.01"
  779. placeholder="请输入"
  780. @blur="handleAdMinBidBlur"
  781. />
  782. <span>~</span>
  783. </a-form-model-item>
  784. <a-form-model-item class="dp-link-end" prop="adMaxBid">
  785. <a-input-number
  786. class="common-input"
  787. v-model="configForm.adMaxBid"
  788. :min="0.1"
  789. :max="10000"
  790. :step="0.01"
  791. placeholder="请输入"
  792. @blur="handleAdMaxBidBlur"
  793. /> 元
  794. </a-form-model-item>
  795. <div v-if="isAdCpaBidBlur" style="width: 500px;color: #f00;margin-left: 140px">{{ adCpaBidBlurTxt }}</div>
  796. <a-form-model-item label="浮动间隔" prop="adStepBid">
  797. <a-input-number
  798. class="common-input"
  799. v-model="configForm.adStepBid"
  800. :min="0"
  801. :step="0.01"
  802. placeholder="请输入"
  803. @blur="handleFloatingInterval"
  804. /> 元
  805. </a-form-model-item>
  806. </div>
  807. </div>
  808. <div class="separate-module-con">
  809. <p class="rock-title">第三方检测链接</p>
  810. <a-form-model-item label="点击监测">
  811. <a-input
  812. class="common-input-long"
  813. placeholder="请输入链接地址"
  814. v-model="configForm.creativeActionTrackUrl"
  815. allow-clear
  816. />
  817. </a-form-model-item>
  818. </div>
  819. <div class="separate-module-con">
  820. <p class="rock-title">创意信息</p>
  821. <a-form-model-item label="创意方式">
  822. <a-radio-group v-model="configForm.creativeMaterialMode" button-style="solid">
  823. <a-radio-button value="STATIC_ASSEMBLE">程序化创意</a-radio-button>
  824. <a-radio-button value="NONE" :disabled="originalityStatus">自定义创意</a-radio-button>
  825. </a-radio-group>
  826. </a-form-model-item>
  827. <div v-if="configForm.adUnionVideoType === 'REWARDED_VIDEO'">
  828. <a-form-model-item label="创意内容">
  829. <a-radio-group v-model="configForm.creativeImageMode" button-style="solid">
  830. <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO_VERTICAL">竖版视频</a-radio-button>
  831. <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO">横版视频</a-radio-button>
  832. </a-radio-group>
  833. </a-form-model-item>
  834. <a-form-model-item label="行动号召" prop="creativeActionText" key="REWARDED_VIDEO">
  835. <a-select
  836. class="common-input-long"
  837. v-model="configForm.creativeActionText"
  838. >
  839. <a-select-option
  840. v-for="(item, index) in configForm.creativeOptions"
  841. :key="index + 1"
  842. :value="item"
  843. >
  844. {{ item }}
  845. </a-select-option>
  846. </a-select>
  847. </a-form-model-item>
  848. <a-form-model-item label="来源" prop="creativeSource">
  849. <a-input
  850. class="common-input-long"
  851. placeholder="请输入来源"
  852. v-model="configForm.creativeSource"
  853. allow-clear
  854. />
  855. </a-form-model-item>
  856. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用名" prop="creativeAppName" key="creativeAppName26">
  857. <a-input
  858. class="common-input-long"
  859. placeholder="请输入应用名"
  860. v-model="configForm.creativeAppName"
  861. allow-clear
  862. />
  863. </a-form-model-item>
  864. <a-form-model-item label="搭配试玩">
  865. <a-radio-group v-model="configForm.collocationPlay" button-style="solid" disabled>
  866. <a-radio-button value="a">不启用</a-radio-button>
  867. <a-radio-button value="b">启用</a-radio-button>
  868. </a-radio-group>
  869. </a-form-model-item>
  870. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="自动生成视频素材">
  871. <a-radio-group v-model="configForm.creativeIsPresentedVideo" button-style="solid">
  872. <a-radio-button :value="0">不启用</a-radio-button>
  873. <a-radio-button :value="1">启用</a-radio-button>
  874. </a-radio-group>
  875. </a-form-model-item>
  876. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="最优创意衍生计划">
  877. <a-radio-group v-model="configForm.creativeGenerateDerivedAd" button-style="solid">
  878. <a-radio-button :value="0">不启用</a-radio-button>
  879. <a-radio-button :value="1">启用</a-radio-button>
  880. </a-radio-group>
  881. </a-form-model-item>
  882. <a-form-model-item label="创意展现">
  883. <a-radio-group v-model="configForm.creativeDisplayMode" button-style="solid">
  884. <a-radio-button value="CREATIVE_DISPLAY_MODE_CTR">优选模式</a-radio-button>
  885. <a-radio-button value="CREATIVE_DISPLAY_MODE_RANDOM">轮播模式</a-radio-button>
  886. </a-radio-group>
  887. </a-form-model-item>
  888. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_CTR'" class="adver-position-radio">
  889. 选择优选模式,系统会自动对效果好的创意进行展示量倾斜,创意效果越好展示量越高
  890. </div>
  891. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_RANDOM'" class="adver-position-radio">
  892. 使用创意轮播,系统将平分各创意展现机会,便于广告主比较各创意投放效果
  893. </div>
  894. </div>
  895. <div v-else-if="configForm.adUnionVideoType === 'ORIGINAL_VIDEO'">
  896. <a-form-model-item label="创意内容">
  897. <a-radio-group v-model="configForm.creativeImageMode" button-style="solid">
  898. <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO_VERTICAL">竖版视频</a-radio-button>
  899. <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO">横版视频</a-radio-button>
  900. <a-radio-button value="CREATIVE_IMAGE_MODE_LARGE">大图横图</a-radio-button>
  901. <a-radio-button value="CREATIVE_IMAGE_MODE_SMALL" disabled>小图</a-radio-button>
  902. <a-radio-button value="CREATIVE_IMAGE_MODE_LARGE_VERTICAL">大图竖图</a-radio-button>
  903. </a-radio-group>
  904. </a-form-model-item>
  905. <a-form-model-item label="行动号召" prop="creativeActionText" key="ORIGINAL_VIDEO">
  906. <a-select
  907. class="common-input-long"
  908. v-model="configForm.creativeActionText"
  909. >
  910. <a-select-option
  911. v-for="(item, index) in configForm.creativeOptions"
  912. :key="index + 1"
  913. :value="item"
  914. >
  915. {{ item }}
  916. </a-select-option>
  917. </a-select>
  918. </a-form-model-item>
  919. <a-form-model-item label="来源" prop="creativeSource">
  920. <a-input
  921. class="common-input-long"
  922. placeholder="请输入来源"
  923. v-model="configForm.creativeSource"
  924. allow-clear
  925. />
  926. </a-form-model-item>
  927. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用名" prop="creativeAppName" key="creativeAppName27">
  928. <a-input
  929. class="common-input-long"
  930. placeholder="请输入应用名"
  931. v-model="configForm.creativeAppName"
  932. allow-clear
  933. />
  934. </a-form-model-item>
  935. <a-form-model-item label="创意展现">
  936. <a-radio-group v-model="configForm.creativeDisplayMode" button-style="solid">
  937. <a-radio-button value="CREATIVE_DISPLAY_MODE_CTR">优选模式</a-radio-button>
  938. <a-radio-button value="CREATIVE_DISPLAY_MODE_RANDOM">轮播模式</a-radio-button>
  939. </a-radio-group>
  940. </a-form-model-item>
  941. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_CTR'" class="adver-position-radio">
  942. 选择优选模式,系统会自动对效果好的创意进行展示量倾斜,创意效果越好展示量越高
  943. </div>
  944. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_RANDOM'" class="adver-position-radio">
  945. 使用创意轮播,系统将平分各创意展现机会,便于广告主比较各创意投放效果
  946. </div>
  947. </div>
  948. <div v-else-if="configForm.adUnionVideoType === 'SPLASH_VIDEO'">
  949. <a-form-model-item label="创意内容">
  950. <a-radio-group v-model="configForm.creativeImageMode" button-style="solid">
  951. <a-radio-button value="CREATIVE_IMAGE_MODE_UNION_SPLASH">开屏图片</a-radio-button>
  952. </a-radio-group>
  953. </a-form-model-item>
  954. <a-form-model-item label="行动号召" prop="creativeActionText" key="SPLASH_VIDEO">
  955. <a-select
  956. class="common-input-long"
  957. v-model="configForm.creativeActionText"
  958. >
  959. <a-select-option
  960. v-for="(item, index) in configForm.creativeOptions"
  961. :key="index + 1"
  962. :value="item"
  963. >
  964. {{ item }}
  965. </a-select-option>
  966. </a-select>
  967. </a-form-model-item>
  968. <a-form-model-item label="来源" prop="creativeSource">
  969. <a-input
  970. class="common-input-long"
  971. placeholder="请输入来源"
  972. v-model="configForm.creativeSource"
  973. allow-clear
  974. />
  975. </a-form-model-item>
  976. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用名" prop="creativeAppName" key="creativeAppName28">
  977. <a-input
  978. class="common-input-long"
  979. placeholder="请输入应用名"
  980. v-model="configForm.creativeAppName"
  981. allow-clear
  982. />
  983. </a-form-model-item>
  984. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="自动生成视频素材">
  985. <a-radio-group v-model="configForm.creativeIsPresentedVideo" button-style="solid">
  986. <a-radio-button :value="0">不启用</a-radio-button>
  987. <a-radio-button :value="1">启用</a-radio-button>
  988. </a-radio-group>
  989. </a-form-model-item>
  990. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="最优创意衍生计划">
  991. <a-radio-group v-model="configForm.creativeGenerateDerivedAd" button-style="solid">
  992. <a-radio-button :value="0">不启用</a-radio-button>
  993. <a-radio-button :value="1">启用</a-radio-button>
  994. </a-radio-group>
  995. </a-form-model-item>
  996. <a-form-model-item label="创意展现">
  997. <a-radio-group v-model="configForm.creativeDisplayMode" button-style="solid">
  998. <a-radio-button value="CREATIVE_DISPLAY_MODE_CTR">优选模式</a-radio-button>
  999. <a-radio-button value="CREATIVE_DISPLAY_MODE_RANDOM">轮播模式</a-radio-button>
  1000. </a-radio-group>
  1001. </a-form-model-item>
  1002. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_CTR'" class="adver-position-radio">
  1003. 选择优选模式,系统会自动对效果好的创意进行展示量倾斜,创意效果越好展示量越高
  1004. </div>
  1005. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_RANDOM'" class="adver-position-radio">
  1006. 使用创意轮播,系统将平分各创意展现机会,便于广告主比较各创意投放效果
  1007. </div>
  1008. </div>
  1009. <div v-else>
  1010. <a-form-model-item label="创意内容">
  1011. <a-radio-group v-model="configForm.creativeImageMode" button-style="solid">
  1012. <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO_VERTICAL">竖版视频</a-radio-button>
  1013. <a-radio-button value="CREATIVE_IMAGE_MODE_VIDEO" :disabled="pictureStatus">横版视频</a-radio-button>
  1014. <a-radio-button value="CREATIVE_IMAGE_MODE_LARGE" :disabled="pictureStatus">大图横图</a-radio-button>
  1015. <a-radio-button value="CREATIVE_IMAGE_MODE_SMALL" disabled>小图</a-radio-button>
  1016. <a-radio-button value="CREATIVE_IMAGE_MODE_LARGE_VERTICAL" :disabled="pictureStatus">大图竖图</a-radio-button>
  1017. </a-radio-group>
  1018. </a-form-model-item>
  1019. <a-form-model-item v-if="isTAwemeStatus" label="卡片主图">
  1020. <a-upload
  1021. name="avatar"
  1022. list-type="picture-card"
  1023. class="avatar-uploader"
  1024. :show-upload-list="false"
  1025. :before-upload="beforeUpload"
  1026. >
  1027. <div v-if="imageUrl" class="upload-img-class" @mouseover="handleChangeActive">
  1028. <div class="img-flex-url">
  1029. <img :src="imageUrl" alt="avatar"/>
  1030. </div>
  1031. <!-- TODO 划过图片显示覆盖层 -->
  1032. <!-- <div v-if="isCoverImgDiv" class="cover-img-div" @mouseleave="handleRemoveActive">
  1033. <a-icon class="delete-icon-class" type="delete" @click.stop="handleDeleteImg"/>
  1034. </div> -->
  1035. </div>
  1036. <div v-else>
  1037. <a-icon type="plus" style="margin-top: 10px;"/>
  1038. <div class="ant-upload-text">Upload</div>
  1039. </div>
  1040. </a-upload>
  1041. <span class="especial-label">*</span>
  1042. </a-form-model-item>
  1043. <a-form-model-item v-if="isTAwemeStatus" label="卡片标题" prop="creativeProductDescription">
  1044. <a-input
  1045. class="common-input-long"
  1046. placeholder="请输入卡片标题"
  1047. v-model="configForm.creativeProductDescription"
  1048. allow-clear
  1049. />
  1050. </a-form-model-item>
  1051. <a-form-model-item v-if="isTAwemeStatus" label="推广卖点">
  1052. <a-button type="primary" @click="handleAddOrigin">
  1053. <a-icon type="plus" />推广卖点
  1054. </a-button>
  1055. <span class="especial-label">*</span>
  1056. </a-form-model-item>
  1057. <div v-if="isTAwemeStatus" class="adver-position-radio">
  1058. <a-form-model-item
  1059. v-for="(item, index) in configForm.defaultFormList"
  1060. :key="item.id"
  1061. class="examin-form-model"
  1062. :prop="'defaultFormList.' + index + '.value'"
  1063. :rules="[
  1064. {required: true, message: '请输入', trigger: 'blur'},
  1065. {min: 6, max: 9, message: '请输入6-9个字', trigger: 'blur'},
  1066. ]"
  1067. >
  1068. <a-input class="common-input-long" v-model="item.value" placeholder="请输入" allow-clear/>
  1069. <a-icon class="examin-form-icon" type="delete" @click="handleDelOrigin(item)"/>
  1070. </a-form-model-item>
  1071. </div>
  1072. <a-form-model-item v-if="isTomatoStatus" label="行动号召" prop="creativeActionText" key="SPLASH_VIDEO_ONE">
  1073. <a-select
  1074. class="common-input-long"
  1075. v-model="configForm.creativeActionText"
  1076. >
  1077. <a-select-option
  1078. v-for="(item, index) in creativeOptions"
  1079. :key="index + 1"
  1080. :value="item"
  1081. >
  1082. {{ item }}
  1083. </a-select-option>
  1084. </a-select>
  1085. </a-form-model-item>
  1086. <a-form-model-item v-if="isTAwemeStatus" label="行动号召">
  1087. <a-radio-group v-model="configForm.creativeEnablePersonalAction" button-style="solid">
  1088. <a-radio-button :value="true">开启智能优选</a-radio-button>
  1089. <a-radio-button :value="false">关闭智能优选</a-radio-button>
  1090. </a-radio-group>
  1091. <span class="especial-label">*</span>
  1092. </a-form-model-item>
  1093. <div v-if="isTAwemeStatus" class="adver-position-radio">
  1094. <a-form-model-item prop="creativeCallToAction">
  1095. <a-select
  1096. class="common-input-long"
  1097. v-model="configForm.creativeCallToAction"
  1098. >
  1099. <a-select-option
  1100. v-for="(item, index) in configForm.creativeOptions"
  1101. :key="index + 1"
  1102. :value="item"
  1103. >
  1104. {{ item }}
  1105. </a-select-option>
  1106. </a-select>
  1107. </a-form-model-item>
  1108. </div>
  1109. <a-form-model-item label="来源" :prop="getSource">
  1110. <a-input
  1111. class="common-input-long"
  1112. placeholder="请输入来源"
  1113. v-model="configForm.creativeSource"
  1114. allow-clear
  1115. />
  1116. </a-form-model-item>
  1117. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="应用名" prop="creativeAppName" key="creativeAppName29">
  1118. <a-input
  1119. class="common-input-long"
  1120. placeholder="请输入应用名"
  1121. v-model="configForm.creativeAppName"
  1122. allow-clear
  1123. />
  1124. </a-form-model-item>
  1125. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL' && platformLoadingType === 'APP_ANDROID'" label="副标题">
  1126. <a-input
  1127. class="common-input-long"
  1128. placeholder="请输入副标题"
  1129. v-model="configForm.creativeSubTitle"
  1130. allow-clear
  1131. @blur="handleCreativeSubTitleBlur"
  1132. />
  1133. </a-form-model-item>
  1134. <div v-if="subTitleMsgStatus" style="width: 500px;color: #f00;margin-left: 140px">{{ subTitleMsg }}</div>
  1135. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="自动生成视频素材">
  1136. <a-radio-group v-model="configForm.creativeIsPresentedVideo" button-style="solid">
  1137. <a-radio-button :value="0">不启用</a-radio-button>
  1138. <a-radio-button :value="1">启用</a-radio-button>
  1139. </a-radio-group>
  1140. </a-form-model-item>
  1141. <a-form-model-item v-if="configForm.adDownloadType === 'DOWNLOAD_URL'" label="最优创意衍生计划">
  1142. <a-radio-group v-model="configForm.creativeGenerateDerivedAd" button-style="solid">
  1143. <a-radio-button :value="0">不启用</a-radio-button>
  1144. <a-radio-button :value="1">启用</a-radio-button>
  1145. </a-radio-group>
  1146. </a-form-model-item>
  1147. <a-form-model-item label="广告评论">
  1148. <a-radio-group v-model="configForm.creativeIsCommentDisable" button-style="solid">
  1149. <a-radio-button :value="1">关闭</a-radio-button>
  1150. <a-radio-button :value="0">开启</a-radio-button>
  1151. </a-radio-group>
  1152. </a-form-model-item>
  1153. <a-form-model-item label="客户端下载视频">
  1154. <a-radio-group v-model="configForm.creativeDownloadStatus" button-style="solid">
  1155. <a-radio-button :value="1">关闭</a-radio-button>
  1156. <a-radio-button :value="0">开启</a-radio-button>
  1157. </a-radio-group>
  1158. </a-form-model-item>
  1159. <a-form-model-item label="创意展现">
  1160. <a-radio-group v-model="configForm.creativeDisplayMode" button-style="solid">
  1161. <a-radio-button value="CREATIVE_DISPLAY_MODE_CTR">优选模式</a-radio-button>
  1162. <a-radio-button value="CREATIVE_DISPLAY_MODE_RANDOM">轮播模式</a-radio-button>
  1163. </a-radio-group>
  1164. </a-form-model-item>
  1165. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_CTR'" class="adver-position-radio">
  1166. 选择优选模式,系统会自动对效果好的创意进行展示量倾斜,创意效果越好展示量越高
  1167. </div>
  1168. <div v-if="configForm.creativeDisplayMode === 'CREATIVE_DISPLAY_MODE_RANDOM'" class="adver-position-radio">
  1169. 使用创意轮播,系统将平分各创意展现机会,便于广告主比较各创意投放效果
  1170. </div>
  1171. </div>
  1172. </div>
  1173. <div class="separate-module-con">
  1174. <p class="rock-title">创意分类</p>
  1175. <a-form-model-item label="创意分类" prop="creativeThirdIndustryIds">
  1176. <a-cascader
  1177. v-model="configForm.creativeThirdIndustryIds"
  1178. class="common-input-long"
  1179. :options="createOptions"
  1180. :fieldNames="fieldNames"
  1181. placeholder="请选择创意分类"
  1182. />
  1183. </a-form-model-item>
  1184. <a-form-model-item label="创意标签">
  1185. <a-select
  1186. v-model="configForm.creativeLabel"
  1187. :token-separators="[',', ' ', ',']"
  1188. mode="tags"
  1189. style="width: 320px"
  1190. placeholder="按回车生成标签"
  1191. dropdownClassName="display-none-selset"
  1192. @change="handleEnterChang"
  1193. >
  1194. </a-select>
  1195. <span class="especial-label">*</span>
  1196. </a-form-model-item>
  1197. <div class="adver-position-radio">
  1198. <div class="creative-label-content">
  1199. <p>已选:{{ creativeTag.length || 0 }}</p>
  1200. <div class="label-content-select-tag">
  1201. <a-tag
  1202. v-for="item in creativeTag"
  1203. :key="item"
  1204. :closable="true"
  1205. class="tag-select-class"
  1206. @close="handleTagsClose(item)"
  1207. >
  1208. {{ item }}
  1209. </a-tag>
  1210. </div>
  1211. </div>
  1212. </div>
  1213. </div>
  1214. <div class="separate-module-con btn-Unique-con">
  1215. <a-button class="sure-btn" type="primary" :loading="sureLoading" @click="handleRelaxSure">确定</a-button>
  1216. <a-button class="cancel-btn" @click="handleRelaxCancel">取消</a-button>
  1217. </div>
  1218. </a-spin>
  1219. </a-form-model>
  1220. </div>
  1221. <a-modal
  1222. v-if="isWebUrl"
  1223. title="使用落地页"
  1224. :visible="isWebUrl"
  1225. dialog-class="web-url-modal"
  1226. :footer="false"
  1227. @cancel="handleCancelAll"
  1228. >
  1229. <div class="mater-viedo-content">
  1230. <a-row class="viedo-serach-class" :gutter="24">
  1231. <a-col :span="9">
  1232. <a-form-item label="落地页名称" :labelCol="modalCol" :wrapperCol="modalWrapper">
  1233. <a-input v-model="weburlModel" placeholder="请输入落地页名称关键字"/>
  1234. </a-form-item>
  1235. </a-col>
  1236. <a-col :span="8">
  1237. <a-button type="primary" style="position: relative;top: 4px;" @click="handleWebUrlSearch">搜索</a-button>
  1238. <a-button type="primary" style="position: relative;top: 4px;margin-left: 15px;" @click="handleWebUrlUpdate">重置</a-button>
  1239. </a-col>
  1240. </a-row>
  1241. <div class="viedo-content-class">
  1242. <div v-if="viedoDefaultList.length" class="viedo-content-group">
  1243. <li
  1244. class="content-modal-li"
  1245. v-for="(item, index) in viedoDefaultList"
  1246. :key="index"
  1247. @click="handleViedoListClick(item)"
  1248. >
  1249. <img v-if="item.thumbnail" :src="item.thumbnail"/>
  1250. <img v-else src="@/assets/noImg.png"/>
  1251. <div class="checkbox-select-show"><a>{{ item.name }}</a></div>
  1252. <div class="checkbox-select-time">ID:{{ item.siteId }}</div>
  1253. </li>
  1254. </div>
  1255. <div v-else class="no-data-group">
  1256. 暂无数据
  1257. </div>
  1258. </div>
  1259. </div>
  1260. </a-modal>
  1261. </div>
  1262. </template>
  1263. <script>
  1264. import AcountSearch from '@/views/modules/Statistics/components/Treeselect.vue';
  1265. import SelectCheckAll from '../../BatchCreate/toutiaoTime';
  1266. import radioCheck from '@/components/formComponents/checkBoxGroup';
  1267. import linkMultiSelect from '@/views/modules/BatchCreate/linkMultiSelect';
  1268. import DirectionalLogic from './directional-logic/directional-logic';
  1269. import AutoSelect from './tree-select/tree-select';
  1270. import CheckMorePlat from './check-more-plat/check-more-plat';
  1271. import moment from 'moment';
  1272. import BMF from 'browser-md5-file';
  1273. import {urlAcount} from '../account-config-server.js';
  1274. import {getAction, postAction, putAction} from '@/api/manage';
  1275. import {mapGetters} from 'vuex';
  1276. let COS = require('cos-js-sdk-v5');
  1277. let cos = new COS({
  1278. SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
  1279. SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9'
  1280. });
  1281. let str = '';
  1282. for (let i = 0; i < 7 * 48; i++) {
  1283. str += '0';
  1284. }
  1285. export default {
  1286. name: 'configuration-copy',
  1287. props: {
  1288. visible: {
  1289. type: Boolean,
  1290. default: false
  1291. }
  1292. },
  1293. components: {
  1294. AcountSearch,
  1295. SelectCheckAll,
  1296. radioCheck,
  1297. linkMultiSelect,
  1298. DirectionalLogic,
  1299. AutoSelect,
  1300. CheckMorePlat
  1301. },
  1302. data() {
  1303. let handleConfirmValue = (rule, value, callback) => {
  1304. 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.,?'\\+&%$#=~_-]+))*$/;
  1305. if (urlregex.test(value)) {
  1306. callback();
  1307. }
  1308. else {
  1309. callback('请输入正确的格式');
  1310. }
  1311. };
  1312. let handleCharacterLen100 = (rule, value, callback) => {
  1313. this.handleExportRules(value, 1, 100, callback);
  1314. };
  1315. let handleCharacterLen20 = (rule, value, callback) => {
  1316. this.handleExportRules(value, 4, 20, callback);
  1317. };
  1318. let handleCharacterLenCreativeApp = (rule, value, callback) => {
  1319. this.handleExportRules(value, 4, 20, callback);
  1320. };
  1321. let floatingIntervalValidator = (rule, value, callback) => {
  1322. const finallyResult = Number(this.configForm.adMinBid) + Number(value);
  1323. if (finallyResult < Number(this.configForm.adMaxBid)) {
  1324. callback();
  1325. }
  1326. else {
  1327. callback('最低出价+浮动间隔<最高出价');
  1328. }
  1329. };
  1330. let adMinBidValidator = (rule, value, callback) => {
  1331. const finallyResult = Number(this.configForm.adMaxBid);
  1332. if (finallyResult && value && Number(value) < finallyResult) {
  1333. this.$refs['ruleForm'].clearValidate(['adMaxBid']);
  1334. callback();
  1335. }
  1336. else {
  1337. callback('最低出价不能高于最高出价');
  1338. }
  1339. };
  1340. let adMaxBidValidator = (rule, value, callback) => {
  1341. const finallyResult = Number(this.configForm.adMinBid);
  1342. if (finallyResult && value && Number(value) > finallyResult) {
  1343. this.$refs['ruleForm'].clearValidate(['adMinBid']);
  1344. callback();
  1345. }
  1346. else {
  1347. callback('最高出价不能低于最低出价');
  1348. }
  1349. };
  1350. let budgetValidator = (rule, value, callback) => {
  1351. // if (this.modalTitle === 'edit') {
  1352. // if (Number(value) > Number(this.defaultAdBudget) && Number(value) < (Number(this.defaultAdBudget) + 100)) {
  1353. // callback('单次修改预算幅度, 不能低于100.0元');
  1354. // }
  1355. // else if (Number(value) < Number(this.defaultAdBudget) && Number(value) > (Number(this.defaultAdBudget) - 100)) {
  1356. // callback('单次修改预算幅度, 不能低于100.0元');
  1357. // }
  1358. // else {
  1359. // callback();
  1360. // }
  1361. // }
  1362. if (this.modalTitle === 'copy') {
  1363. callback();
  1364. }
  1365. };
  1366. return {
  1367. spinning: false,
  1368. landingPageShowData: {},
  1369. weburlModel: '',
  1370. modalCol: {
  1371. lg: {span: 6},
  1372. sm: {span: 6},
  1373. xs: {span: 6},
  1374. md: {span: 6}
  1375. },
  1376. modalWrapper: {
  1377. lg: {span: 18},
  1378. sm: {span: 18},
  1379. xs: {span: 14},
  1380. md: {span: 14}
  1381. },
  1382. viedoDefaultList: [],
  1383. viedoDefaultListUpdate: [],
  1384. isWebUrl: false,
  1385. sureLoading: false,
  1386. subTitleMsgStatus: false,
  1387. subTitleMsg: '',
  1388. AutoExtendEditSelect: [],
  1389. adPlatformOption: [
  1390. {
  1391. value: 'NONE',
  1392. label: '不限'
  1393. },
  1394. {
  1395. value: 'IOS',
  1396. label: 'IOS'
  1397. },
  1398. {
  1399. value: 'ANDROID',
  1400. label: 'ANDROID'
  1401. },
  1402. {
  1403. value: 'PC',
  1404. label: 'PC'
  1405. }
  1406. ],
  1407. adAutoExtendList: [],
  1408. directionalData: [],
  1409. platformLoadingType: '',
  1410. deviceTypeList: [
  1411. {
  1412. value: 'NONE',
  1413. label: '不限'
  1414. },
  1415. {
  1416. value: 'MOBILE',
  1417. label: '智能手机'
  1418. },
  1419. {
  1420. value: 'PAD',
  1421. label: '平板'
  1422. }
  1423. ],
  1424. adAcList: [
  1425. {
  1426. value: 'NONE',
  1427. label: '不限'
  1428. },
  1429. {
  1430. value: 'WIFI',
  1431. label: 'WI-FI'
  1432. },
  1433. {
  1434. value: '2G',
  1435. label: '2G'
  1436. },
  1437. {
  1438. value: '3G',
  1439. label: '3G'
  1440. },
  1441. {
  1442. value: '4G',
  1443. label: '4G'
  1444. }
  1445. ],
  1446. adHideIfConvertedDataOption: [ // 过滤已转化用户option
  1447. {
  1448. id: 'NO_EXCLUDE',
  1449. name: '不限'
  1450. },
  1451. {
  1452. id: 'AD',
  1453. name: '广告计划'
  1454. },
  1455. {
  1456. id: 'CAMPAIGN',
  1457. name: '广告组'
  1458. },
  1459. {
  1460. id: 'ADVERTISER',
  1461. name: '广告账户'
  1462. },
  1463. {
  1464. id: 'CUSTOMER',
  1465. name: '公司账户'
  1466. },
  1467. {
  1468. id: 'APP',
  1469. name: 'APP'
  1470. }
  1471. ],
  1472. packageMessageDetail: [],
  1473. selectiveList: [],
  1474. isLadderBlur: false,
  1475. ladderBlurTxt: '',
  1476. isAdCpaBid11Blur: false,
  1477. adCpaBid11BlurTxt: '',
  1478. isAdCpaBidBlur: false,
  1479. adCpaBidBlurTxt: '',
  1480. listArr: [],
  1481. regionCityListUrl: 'ctop/bytedanceAreaInfo/list',
  1482. defaultAdBudget: '',
  1483. adBudgetNum: 300,
  1484. campaignStatus: false,
  1485. detailData: {},
  1486. modalTitle: '',
  1487. toolConvertList: [],
  1488. optimizationOption: [],
  1489. md5Result: '',
  1490. urlResult: '',
  1491. createOptions: [],
  1492. campaignTags: ['序号', '日期'],
  1493. adNameTags: ['序号', '出价方式', '素材名称', '日期', '创意方式'],
  1494. fieldNames: {
  1495. label: 'industryName',
  1496. value: 'industryId',
  1497. children: 'children'
  1498. },
  1499. promotionTypeList: [
  1500. {
  1501. value: 'EXTERNAL',
  1502. label: '落地页'
  1503. },
  1504. {
  1505. value: 'ARTICLE',
  1506. label: '文章推广'
  1507. },
  1508. {
  1509. value: 'GOODS',
  1510. label: '商品推广'
  1511. },
  1512. {
  1513. value: 'DPA',
  1514. label: '商品目录'
  1515. },
  1516. {
  1517. value: 'STORE',
  1518. label: '门店推广'
  1519. },
  1520. {
  1521. value: 'AWEME',
  1522. label: '抖音号推广'
  1523. },
  1524. {
  1525. value: 'SHOP',
  1526. label: '店铺直投'
  1527. },
  1528. {
  1529. value: 'APP_ANDROID',
  1530. label: '应用下载-安卓'
  1531. },
  1532. {
  1533. value: 'APP_IOS',
  1534. label: '应用下载-IOS'
  1535. }
  1536. ],
  1537. ageArr: [
  1538. {
  1539. value: 'NONE',
  1540. label: '不限'
  1541. },
  1542. {
  1543. value: 'AGE_BETWEEN_18_23',
  1544. label: '18-23岁'
  1545. },
  1546. {
  1547. value: 'AGE_BETWEEN_24_30',
  1548. label: '24-30岁'
  1549. },
  1550. {
  1551. value: 'AGE_BETWEEN_31_40',
  1552. label: '31-40岁'
  1553. },
  1554. {
  1555. value: 'AGE_BETWEEN_41_49',
  1556. label: '41-49岁'
  1557. },
  1558. {
  1559. value: 'AGE_ABOVE_50',
  1560. label: '50岁+'
  1561. }
  1562. ],
  1563. fileList: [],
  1564. isCoverImgDiv: false,
  1565. imageUrl: '',
  1566. creativeTag: [],
  1567. radioStyle: {
  1568. display: 'block',
  1569. height: '30px',
  1570. lineHeight: '30px',
  1571. marginLeft: 0
  1572. },
  1573. labelCol: {span: 4},
  1574. wrapperCol: {span: 14},
  1575. rules: {
  1576. creativeAppName: [
  1577. {required: true, message: '请输入', trigger: 'blur'},
  1578. {validator: handleCharacterLenCreativeApp, trigger: 'blur'}
  1579. ],
  1580. adExternalUrl: [
  1581. {required: true, message: '请输入', trigger: 'blur'},
  1582. {validator: handleConfirmValue, trigger: 'blur'}
  1583. ],
  1584. adPackage: [
  1585. {required: true, message: '请输入', trigger: 'blur'}
  1586. ],
  1587. adDownloadUrl: [
  1588. {required: true, message: '请输入', trigger: 'blur'},
  1589. {validator: handleConfirmValue, trigger: 'blur'}
  1590. ],
  1591. campaignCnt: [
  1592. {required: true, message: '请输入', trigger: 'blur'}
  1593. ],
  1594. campaignAdCnt: [
  1595. {required: true, message: '请输入', trigger: 'blur'}
  1596. ],
  1597. dpLinkStartIndex: [
  1598. {required: true, message: '请输入', trigger: 'blur'}
  1599. ],
  1600. dpLinkEndIndex: [
  1601. {required: true, message: '请输入', trigger: 'blur'}
  1602. ],
  1603. accountBudget: [
  1604. {required: true, message: '请输入', trigger: 'blur'},
  1605. {validator: budgetValidator, trigger: 'blur'}
  1606. ],
  1607. campaignName: [
  1608. {required: true, message: '请输入广告组名称', trigger: 'blur'},
  1609. {validator: handleCharacterLen100, trigger: 'blur'}
  1610. ],
  1611. creativeSource: [
  1612. {required: true, message: '请输入', trigger: 'blur'},
  1613. {validator: handleCharacterLen20, trigger: 'blur'}
  1614. ],
  1615. adCpaBid: [
  1616. {required: true, message: '请输入', trigger: 'blur'}
  1617. ],
  1618. adStepBid: [
  1619. {required: true, message: '请输入', trigger: 'blur'},
  1620. {validator: floatingIntervalValidator, trigger: 'blur'}
  1621. ],
  1622. adMinBid: [
  1623. {required: true, message: '请输入最低出价', trigger: 'blur'},
  1624. {validator: adMinBidValidator, trigger: 'blur'}
  1625. ],
  1626. adMaxBid: [
  1627. {required: true, message: '请输入最高出价', trigger: 'blur'},
  1628. {validator: adMaxBidValidator, trigger: 'blur'}
  1629. ],
  1630. adName: [
  1631. {required: true, message: '请输入广告计划名称', trigger: 'blur'},
  1632. {validator: handleCharacterLen100, trigger: 'blur'}
  1633. ],
  1634. creativeProductDescription: [
  1635. {required: true, message: '请输入', trigger: 'blur'},
  1636. {min: 1, max: 7, message: '请输入1-7个字', trigger: 'blur'}
  1637. ],
  1638. creativeWebUrl: [
  1639. {required: true, message: '请输入', trigger: 'blur'},
  1640. {validator: handleConfirmValue, trigger: 'blur'}
  1641. ],
  1642. adAudiencePackageId: [{required: true, message: '请选择', trigger: 'change'}],
  1643. creativeCallToAction: [{required: true, message: '请选择', trigger: 'change'}],
  1644. creativeActionText: [{required: true, message: '请选择', trigger: 'change'}],
  1645. adConvertType: [{required: true, message: '请选择', trigger: 'change'}],
  1646. adConvertId: [{required: true, message: '请选择', trigger: 'change'}],
  1647. creativeThirdIndustryIds: [{required: true, message: '请选择', trigger: 'change'}]
  1648. },
  1649. configForm: {
  1650. collocationPlay: 'a',
  1651. adUnionVideoType: '',
  1652. creativeWebUrl: '',
  1653. adAppType: '',
  1654. adDirectionalFlag: 'add',
  1655. adInterestActionMode: 'UNLIMITED',
  1656. creativeDisplayMode: 'CREATIVE_DISPLAY_MODE_CTR',
  1657. creativeAppName: undefined,
  1658. creativeIsPresentedVideo: 0,
  1659. creativeGenerateDerivedAd: 0,
  1660. creativeIsCommentDisable: 0,
  1661. creativeDownloadStatus: 1,
  1662. creativeSubTitle: '',
  1663. adConvertedTimeDuration: 'THREE_MONTH',
  1664. adDownloadMode: 'DEFAULT',
  1665. dpLinkIndexUsed: 0,
  1666. adRetargetingTagsType: '',
  1667. adAudiencePackageId: undefined,
  1668. adStepBid: 0,
  1669. ladderOne: '',
  1670. ladderTwo: '',
  1671. adMinBid: '',
  1672. adMaxBid: '',
  1673. adBidCreateType: 'FIX',
  1674. creativeOptions: [],
  1675. advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
  1676. adLocationType: '',
  1677. adCity: '',
  1678. adSelectCity: [],
  1679. defaultFormList: [],
  1680. productSellingPoints: [], // 商品买点
  1681. adBudgetMode: 'BUDGET_MODE_DAY', // 预算类型
  1682. adDownloadUrl: '', // 下载链接
  1683. accountBudget: 0, // 账户日预算
  1684. accountId: undefined, // 账户
  1685. dpLinkStartIndex: 1,
  1686. dpLinkEndIndex: 2,
  1687. accountBudgetMode: '1', // 预算方式
  1688. campaignLandingType: 'APP', // 推广目标
  1689. advertisingType: '1', // 广告类型
  1690. campaignName: '', // 广告组名称
  1691. adName: '', // 广告计划名称
  1692. campaignCnt: 1, // 广告组计划数量
  1693. campaignAdCnt: 1, // 广告计划数量
  1694. launchTarget: 'OCPM', // 投放目标
  1695. adDownloadType: 'EXTERNAL_URL', // 下载方式
  1696. adExternalUrl: '', // 落地页链接
  1697. adOpenUrl: '', // 直达链接内容
  1698. adPackage: '', // 应用包名
  1699. adConvertType: '', // 转化跟踪方式
  1700. adConvertId: '', // 优化目标 -- 走接口
  1701. adverPosition: 'a', // 广告位置
  1702. radioChangeValue: '', // 广告位置-按照场景指定位置
  1703. checkboxChangeValue: [], // 广告位置-按照媒体指定位置
  1704. adDistrict: 'NONE', // 定向-区域
  1705. adGender: 'NONE', // 定向-性别
  1706. adAge: '', // 定向-年龄
  1707. adSelectAge: ['NONE'],
  1708. customPerson: 'NONE', // 定向-自定义
  1709. adSuperiorPopularityType: 'NONE', // 定向-媒体定向
  1710. adPlatform: 'NONE', // 定向-平台
  1711. updateAdPlatform: ['NONE'],
  1712. adDeviceSelectType: ['NONE'],
  1713. adSelectAc: ['NONE'],
  1714. adAc: '', // 定向-网络
  1715. adHideIfExists: '0', // 定向-已安装用户
  1716. adHideIfConverted: 'NO_EXCLUDE', // 定向-已转化用户
  1717. adAutoExtendEnabled: '0', // 定向-智能播放
  1718. adAndroidVersion: 'NONE', // 定向-安卓版本
  1719. androidChangeValue: '', // 安卓版本-自定义
  1720. adSmartBidType: 'SMART_BID_CUSTOM', // 投放场景
  1721. adBudget: 300, // 预算
  1722. adScheduleType: 'SCHEDULE_FROM_NOW', // 投放时间
  1723. launchDateRange: [], // 设置开始和结束时间
  1724. launchTimeInterval: 'buxian', // 投放时段
  1725. scheduleTimeData: str, // 指定时段选择
  1726. adPricing: 'PRICING_OCPM', // 付费方式
  1727. adCpaBid: 0.1, // 目标转化出价
  1728. creativeActionTrackUrl: '', // 监测地址
  1729. creativeMaterialMode: 'STATIC_ASSEMBLE', // 创意方式
  1730. creativeImageMode: 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL', // 创意内容
  1731. creativeProductDescription: '', // 卡片标题
  1732. creativeEnablePersonalAction: true, // 智能优选
  1733. creativeSource: '', // 来源
  1734. creativeThirdIndustryId: '', // 创意分类
  1735. creativeThirdIndustryIds: [], // 创意分类
  1736. adKeywords: [], // 创意标签
  1737. updateGetingInclude: [],
  1738. updateGetingExclude: [],
  1739. adRetargetingTagsInclude: '',
  1740. adRetargetingTagsExclude: '',
  1741. adAutoExtendTargets: '',
  1742. adDeliveryRange: '',
  1743. creativeCallToAction: undefined, // 行动号召
  1744. creativeActionText: undefined,
  1745. creativeLabel: undefined // 倡议标签
  1746. },
  1747. originalityStatus: true, // 创意状态
  1748. pictureStatus: false,
  1749. isTomatoStatus: false,
  1750. isTAwemeStatus: true
  1751. };
  1752. },
  1753. computed: {
  1754. selectOrientPlaceholder() {
  1755. if (!this.configForm.accountId) {
  1756. return '请选择账户';
  1757. }
  1758. else {
  1759. return 'able';
  1760. }
  1761. },
  1762. getEndIndex() {
  1763. return Number(this.configForm.dpLinkStartIndex) + 1;
  1764. },
  1765. getSource() {
  1766. if (this.configForm.campaignLandingType !== 'APP' || (this.configForm.campaignLandingType === 'APP' && this.configForm.adDownloadType === 'EXTERNAL_URL')) {
  1767. return 'creativeSource';
  1768. }
  1769. },
  1770. NewAountId() {
  1771. return this.configForm.accountId;
  1772. },
  1773. NewAdPackage() {
  1774. return this.configForm.adPackage;
  1775. },
  1776. NewAdExternalUrl() {
  1777. return this.configForm.adExternalUrl;
  1778. },
  1779. NewPlatformLoadingType() {
  1780. return this.platformLoadingType;
  1781. },
  1782. NewIsTAwemeStatus() {
  1783. return this.isTAwemeStatus;
  1784. },
  1785. NewAdSelectAge() {
  1786. return this.configForm.adSelectAge;
  1787. },
  1788. NewAdDistrict() {
  1789. return this.configForm.adDistrict;
  1790. },
  1791. NewAdGender() {
  1792. return this.configForm.adGender;
  1793. },
  1794. NewAdInterestActionMode() {
  1795. return this.configForm.adInterestActionMode;
  1796. },
  1797. NewCustomPerson() {
  1798. return this.configForm.customPerson;
  1799. },
  1800. NewAdAutoExtendList() {
  1801. return this.adAutoExtendList;
  1802. }
  1803. },
  1804. watch: {
  1805. NewAdAutoExtendList(newVal) {
  1806. if (!newVal.length) {
  1807. this.configForm.adAutoExtendEnabled = '0';
  1808. this.AutoExtendEditSelect = [];
  1809. }
  1810. },
  1811. NewCustomPerson(newVal) {
  1812. if (newVal !== 'NONE') {
  1813. this.adAutoExtendList.push({
  1814. value: 'CUSTOM_AUDIENCE',
  1815. label: '自定人群-定向'
  1816. });
  1817. }
  1818. else {
  1819. this.adAutoExtendList = this.adAutoExtendList.filter(item => item.value !== 'CUSTOM_AUDIENCE');
  1820. }
  1821. },
  1822. NewAdInterestActionMode(newVal) {
  1823. if (newVal !== 'UNLIMITED') {
  1824. this.adAutoExtendList.push({
  1825. value: 'INTEREST_ACTION',
  1826. label: '行为兴趣'
  1827. });
  1828. }
  1829. else {
  1830. this.adAutoExtendList = this.adAutoExtendList.filter(item => item.value !== 'INTEREST_ACTION');
  1831. }
  1832. },
  1833. NewAdGender(newVal) {
  1834. if (newVal !== 'NONE') {
  1835. if (!this.adAutoExtendList.find(item => item.value === 'GENDER')) {
  1836. this.adAutoExtendList.push({
  1837. value: 'GENDER',
  1838. label: '性别'
  1839. });
  1840. }
  1841. }
  1842. else {
  1843. this.adAutoExtendList = this.adAutoExtendList.filter(item => item.value !== 'GENDER');
  1844. }
  1845. },
  1846. NewAdDistrict(newVal) {
  1847. if (newVal !== 'NONE') {
  1848. this.adAutoExtendList.push({
  1849. value: 'REGION',
  1850. label: '地域'
  1851. });
  1852. }
  1853. else {
  1854. this.adAutoExtendList = this.adAutoExtendList.filter(item => item.value !== 'REGION');
  1855. }
  1856. },
  1857. NewAdSelectAge(newVal) {
  1858. if (newVal[0] !== 'NONE') {
  1859. if (!this.adAutoExtendList.find(item => item.value === 'AGE')) {
  1860. this.adAutoExtendList.push({
  1861. value: 'AGE',
  1862. label: '年龄'
  1863. });
  1864. }
  1865. }
  1866. else {
  1867. this.adAutoExtendList = this.adAutoExtendList.filter(item => item.value !== 'AGE');
  1868. }
  1869. },
  1870. NewIsTAwemeStatus(newVal) {
  1871. if (!newVal) {
  1872. this.md5Result = '';
  1873. this.urlResult = '';
  1874. this.imageUrl = '';
  1875. this.configForm.creativeProductDescription = '';
  1876. this.configForm.defaultFormList = [];
  1877. this.configForm.creativeEnablePersonalAction = '';
  1878. this.configForm.creativeCallToAction = '';
  1879. }
  1880. else {
  1881. this.configForm.creativeEnablePersonalAction = true;
  1882. }
  1883. },
  1884. NewPlatformLoadingType(newVal, oldVal) {
  1885. if (newVal) {
  1886. this.configForm.adAppType = newVal;
  1887. }
  1888. if (newVal && this.configForm.accountId) {
  1889. this.handleGetChengZiSite();
  1890. }
  1891. else {
  1892. this.landingPageShowData = {};
  1893. this.configForm.creativeWebUrl = '';
  1894. }
  1895. },
  1896. NewAdExternalUrl(newVal, oldVal) {
  1897. if (newVal && this.configForm.accountId) {
  1898. const paramsData = {
  1899. advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
  1900. advertiserId: this.configForm.accountId,
  1901. deliveryRange: 'DEFAULT',
  1902. externalUrl: this.configForm.adExternalUrl,
  1903. landingType: this.configForm.campaignLandingType,
  1904. promotionContent: this.configForm.adDownloadType
  1905. };
  1906. this.handleGetOptimizationObjective(paramsData);
  1907. }
  1908. },
  1909. NewAdPackage(newVal, oldVal) {
  1910. if (newVal && this.configForm.accountId) {
  1911. const paramsData = {
  1912. advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
  1913. advertiserId: this.configForm.accountId,
  1914. appType: 'APP_ANDROID',
  1915. deliveryRange: 'DEFAULT',
  1916. externalUrl: this.configForm.adExternalUrl,
  1917. landingType: this.configForm.campaignLandingType,
  1918. packageName: this.configForm.adPackage,
  1919. promotionContent: this.configForm.adDownloadType
  1920. };
  1921. this.handleGetOptimizationObjective(paramsData);
  1922. }
  1923. },
  1924. NewAountId(newVal, oldVal) {
  1925. if ((newVal && this.configForm.adPackage) || (newVal && this.configForm.adExternalUrl)) {
  1926. const paramsData = {
  1927. advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
  1928. advertiserId: this.configForm.accountId,
  1929. appType: 'APP_ANDROID',
  1930. deliveryRange: 'DEFAULT',
  1931. externalUrl: this.configForm.adExternalUrl,
  1932. landingType: this.configForm.campaignLandingType,
  1933. packageName: this.configForm.adPackage,
  1934. promotionContent: this.configForm.adDownloadType
  1935. };
  1936. this.handleGetOptimizationObjective(paramsData);
  1937. }
  1938. if (newVal && this.platformLoadingType) {
  1939. this.handleGetChengZiSite();
  1940. }
  1941. else {
  1942. this.landingPageShowData = {};
  1943. this.configForm.creativeWebUrl = '';
  1944. }
  1945. if (newVal) {
  1946. this.handleGetCreativeClassification();
  1947. this.handleGetAdvertiserStrategy();
  1948. this.handleDirectionalList();
  1949. // this.handleGetAdAudiencePackage();
  1950. }
  1951. else {
  1952. this.createOptions = [];
  1953. this.creativeOptions = [];
  1954. this.selectiveList = [];
  1955. this.optimizationOption = [];
  1956. }
  1957. }
  1958. },
  1959. mounted() {
  1960. const routeQuery = JSON.parse(localStorage.getItem('queryList'));
  1961. if (routeQuery.accountModal === 'copy') {
  1962. this.modalTitle = 'copy';
  1963. this.handleGetDetailList();
  1964. }
  1965. },
  1966. methods: {
  1967. ...mapGetters(['nickname', 'avatar', 'userInfo']),
  1968. moment,
  1969. handleSelectValue(data) {
  1970. this.configForm.accountId = data.id;
  1971. this.configForm.adConvertType = undefined;
  1972. this.configForm.adConvertId = undefined;
  1973. this.configForm.adAudiencePackageId = undefined;
  1974. this.packageMessageDetail = [];
  1975. this.toolConvertList = [];
  1976. this.optimizationOption = [];
  1977. this.handleClearlist();
  1978. this.handleGetAdAudiencePackage();
  1979. if (this.configForm.customPerson === 'a' && this.configForm.adRetargetingTagsType === '1') {
  1980. this.$refs.direct.selectRightData = [];
  1981. this.$refs.direct.tableSelectIds = [];
  1982. }
  1983. else if (this.configForm.customPerson === 'a' && this.configForm.adRetargetingTagsType === '2') {
  1984. this.$refs.exclude.selectRightData = [];
  1985. this.$refs.exclude.tableSelectIds = [];
  1986. }
  1987. else if (this.configForm.customPerson === 'a' && this.configForm.adRetargetingTagsType === '3') {
  1988. this.$refs.twoway.tableSelectDirectIds = [];
  1989. this.$refs.twoway.tableSelectDirectData = [];
  1990. this.$refs.twoway.tableSelectExcludeIds = [];
  1991. this.$refs.twoway.tableSelectExcludeData = [];
  1992. }
  1993. },
  1994. handleAdDistrict(e) {
  1995. const defaultValue = e.target.value;
  1996. if (defaultValue === 'NONE') {
  1997. this.listArr = [];
  1998. this.configForm.adLocationType = '';
  1999. }
  2000. else if (defaultValue === 'CITY') {
  2001. this.configForm.adLocationType = 'HOME';
  2002. }
  2003. },
  2004. handleAdUnionVideoType(e) {
  2005. this.$refs['ruleForm'].clearValidate(['creativeSource']);
  2006. if (e.target.value === 'SPLASH_VIDEO') {
  2007. this.configForm.creativeImageMode = 'CREATIVE_IMAGE_MODE_UNION_SPLASH';
  2008. }
  2009. else {
  2010. this.configForm.creativeImageMode = 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL';
  2011. }
  2012. },
  2013. NewCheckboxChangeValue(newVal) {
  2014. this.$refs['ruleForm'].clearValidate(['creativeSource']);
  2015. let selectiveListUpdate = [...this.selectiveList];
  2016. if (newVal.length) {
  2017. if (newVal.includes('INVENTORY_AWEME_FEED')) {
  2018. this.isTAwemeStatus = true;
  2019. }
  2020. else {
  2021. this.isTAwemeStatus = false;
  2022. }
  2023. if (newVal.length === 4 && newVal.includes('INVENTORY_FEED') && newVal.includes('INVENTORY_VIDEO_FEED') && newVal.includes('INVENTORY_HOTSOON_FEED') && newVal.includes('INVENTORY_AWEME_FEED')) {
  2024. this.originalityStatus = true;
  2025. this.pictureStatus = true;
  2026. }
  2027. else if (newVal.length === 1 && newVal[0] === 'INVENTORY_TOMATO_NOVEL') {
  2028. this.isTomatoStatus = true;
  2029. this.originalityStatus = true;
  2030. this.pictureStatus = true;
  2031. this.configForm.creativeImageMode = 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL';
  2032. }
  2033. else {
  2034. this.isTomatoStatus = false;
  2035. this.originalityStatus = false;
  2036. this.pictureStatus = false;
  2037. }
  2038. if (newVal.length === 1 && newVal[0] === 'INVENTORY_UNION_SLOT') {
  2039. this.configForm.adUnionVideoType = 'REWARDED_VIDEO';
  2040. // this.$nextTick(() => {
  2041. // this.configForm.creativeEnablePersonalAction = true;
  2042. // });
  2043. this.configForm.adAudiencePackageId = undefined;
  2044. this.packageMessageDetail = [];
  2045. this.selectiveList = selectiveListUpdate.filter(item => item.delivery_range === 'UNION');
  2046. }
  2047. else {
  2048. this.configForm.adUnionVideoType = '';
  2049. // this.configForm.creativeEnablePersonalAction = '';
  2050. this.configForm.adAudiencePackageId = undefined;
  2051. this.packageMessageDetail = [];
  2052. this.handleGetAdAudiencePackage();
  2053. }
  2054. }
  2055. else {
  2056. this.isTAwemeStatus = true;
  2057. this.isTomatoStatus = false;
  2058. this.configForm.adUnionVideoType = '';
  2059. this.configForm.adAudiencePackageId = undefined;
  2060. this.packageMessageDetail = [];
  2061. this.handleGetAdAudiencePackage();
  2062. }
  2063. },
  2064. handleGetChengZiSite() {
  2065. const paramsData = {
  2066. accountId: this.configForm.accountId
  2067. };
  2068. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getChengZiSite', paramsData).then(result => {
  2069. if (result.code === 0) {
  2070. this.viedoDefaultList = result.result;
  2071. this.viedoDefaultListUpdate = result.result;
  2072. }
  2073. else {
  2074. this.$message.error(result.message);
  2075. }
  2076. }).catch(error => {
  2077. console.log(error, 'eeee');
  2078. });
  2079. },
  2080. handleViedoListClick(data) {
  2081. this.landingPageShowData = data;
  2082. this.configForm.creativeWebUrl = data.creativeWebUrl;
  2083. this.weburlModel = '';
  2084. this.isWebUrl = false;
  2085. },
  2086. handleWebUrlSearch() {
  2087. let defaultList = [];
  2088. this.viedoDefaultListUpdate.forEach(item => {
  2089. if (item.name && item.name.indexOf(this.weburlModel) !== -1) {
  2090. defaultList.push(item);
  2091. }
  2092. });
  2093. this.viedoDefaultList = defaultList;
  2094. },
  2095. handleWebUrlUpdate() {
  2096. this.viedoDefaultList = [...this.viedoDefaultListUpdate];
  2097. this.weburlModel = '';
  2098. },
  2099. handleCancelAll() {
  2100. this.handleWebUrlUpdate();
  2101. this.isWebUrl = false;
  2102. },
  2103. handleHaveWebUrl() {
  2104. this.isWebUrl = true;
  2105. },
  2106. handleAdhideConver(e) {
  2107. const defaultValue = e.target.value;
  2108. if (defaultValue === 'CUSTOMER' || defaultValue === 'APP') {
  2109. this.configForm.adConvertedTimeDuration = 'THREE_MONTH';
  2110. }
  2111. else {
  2112. this.configForm.adConvertedTimeDuration = '';
  2113. }
  2114. },
  2115. handleAdAutoExtend(e) {
  2116. const defaultValue = e.target.value;
  2117. if (defaultValue === '0') {
  2118. this.AutoExtendEditSelect = [];
  2119. this.configForm.adAutoExtendTargets = '';
  2120. }
  2121. },
  2122. handleCreativeSubTitleBlur(e) {
  2123. const defaultValue = e.target.value;
  2124. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  2125. let length = 0;
  2126. let strArr = defaultValue.split('');
  2127. strArr.forEach(item => {
  2128. if (cnReg.test(item)) {
  2129. length += 2;
  2130. }
  2131. else {
  2132. length += 1;
  2133. }
  2134. });
  2135. if (4 <= length && length <= 24) {
  2136. this.subTitleMsgStatus = false;
  2137. this.subTitleMsg = '';
  2138. }
  2139. else if (!defaultValue) {
  2140. this.subTitleMsgStatus = false;
  2141. this.subTitleMsg = '';
  2142. }
  2143. else {
  2144. this.subTitleMsgStatus = true;
  2145. this.subTitleMsg = '只能输入4-24个字符';
  2146. }
  2147. },
  2148. handleSelectTxtend(list) {
  2149. this.configForm.adAutoExtendTargets = list && list.map(item => item.value).join(',');
  2150. },
  2151. handleCustomPerson(e) {
  2152. const defaultValue = e.target.value;
  2153. if (defaultValue === 'NONE') {
  2154. this.configForm.updateGetingInclude = [];
  2155. this.configForm.adRetargetingTagsInclude = '';
  2156. this.configForm.adRetargetingTagsExclude = '';
  2157. this.configForm.updateGetingExclude = [];
  2158. this.configForm.adRetargetingTagsType = '';
  2159. }
  2160. else if (defaultValue === 'a') {
  2161. this.configForm.adRetargetingTagsType = '1';
  2162. }
  2163. },
  2164. handleAsyncPackage() {
  2165. this.handleGetAdAudiencePackage();
  2166. this.configForm.adAudiencePackageId = undefined;
  2167. this.packageMessageDetail = [];
  2168. },
  2169. handleDpLinkIndexUsed(e) {
  2170. const defaultId = e.target.value;
  2171. if (defaultId === 0) {
  2172. this.adNameTags.pop();
  2173. this.configForm.dpLinkStartIndex = 1;
  2174. this.configForm.dpLinkEndIndex = 2;
  2175. this.configForm.campaignCnt = 1;
  2176. }
  2177. else if (defaultId === 1) {
  2178. this.adNameTags.push('dp链接标识');
  2179. }
  2180. },
  2181. handleDplinkStart(e) {
  2182. this.configForm.dpLinkStartIndex = Math.round(e);
  2183. },
  2184. handleDplinkEnd(e) {
  2185. this.configForm.dpLinkEndIndex = Math.round(e);
  2186. },
  2187. handleFloatingInterval(e) {
  2188. this.configForm.adStepBid = Number(Number(e.target.value).toFixed(2));
  2189. },
  2190. handleAdMinBidBlur(e) {
  2191. this.configForm.adMinBid = Number(Number(e.target.value).toFixed(2));
  2192. },
  2193. handleAdMaxBidBlur(e) {
  2194. const defaultValue = e.target.value;
  2195. this.configForm.adMaxBid = Number(Number(defaultValue).toFixed(2));
  2196. if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
  2197. this.isAdCpaBidBlur = true;
  2198. this.adCpaBidBlurTxt = '出价不能大于预算';
  2199. }
  2200. else {
  2201. this.isAdCpaBidBlur = false;
  2202. }
  2203. },
  2204. handleDirectionalList() {
  2205. const paramsData = {
  2206. accountId: this.configForm.accountId
  2207. };
  2208. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getDMPCustomAudience', paramsData).then(result => {
  2209. if (result.code === 0) {
  2210. result.result.forEach(item => {
  2211. item.key = item.custom_audience_id;
  2212. });
  2213. this.directionalData = result.result;
  2214. }
  2215. else {
  2216. this.directionalData = [];
  2217. this.$message.error(result.message);
  2218. }
  2219. }).catch(error => {
  2220. console.log(error, 'eeee');
  2221. });
  2222. },
  2223. handleSelectionAloneEvent(list) {
  2224. if (this.configForm.adRetargetingTagsType === '1') {
  2225. this.configForm.updateGetingInclude = list;
  2226. this.configForm.adRetargetingTagsInclude = list && list.join(',');
  2227. this.configForm.adRetargetingTagsExclude = '';
  2228. this.configForm.updateGetingExclude = [];
  2229. }
  2230. else if (this.configForm.adRetargetingTagsType === '2') {
  2231. this.configForm.updateGetingExclude = list;
  2232. this.configForm.adRetargetingTagsExclude = list && list.join(',');
  2233. this.configForm.updateGetingInclude = [];
  2234. this.configForm.adRetargetingTagsInclude = '';
  2235. }
  2236. },
  2237. handleClearTableAlone(list) {
  2238. this.configForm.updateGetingInclude = list;
  2239. this.configForm.adRetargetingTagsInclude = list && list.join(',');
  2240. },
  2241. handleClearTableLogic(list) {
  2242. this.configForm.updateGetingExclude = list;
  2243. this.configForm.adRetargetingTagsExclude = list && list.join(',');
  2244. },
  2245. handleClearlist() {
  2246. this.configForm.updateGetingInclude = [];
  2247. this.configForm.adRetargetingTagsInclude = '';
  2248. this.configForm.adRetargetingTagsExclude = '';
  2249. this.configForm.updateGetingExclude = [];
  2250. },
  2251. handleDirectEvent(list) {
  2252. this.configForm.updateGetingInclude = list;
  2253. this.configForm.adRetargetingTagsInclude = list && list.join(',');
  2254. },
  2255. handleExcludeEvent(list) {
  2256. this.configForm.updateGetingExclude = list;
  2257. this.configForm.adRetargetingTagsExclude = list && list.join(',');
  2258. },
  2259. handleDirectionalLogic(e) {
  2260. const selectValue = e.target.value;
  2261. this.handleDirectionalList();
  2262. if (selectValue === '1') {
  2263. this.$refs.exclude.aloneInput = '';
  2264. this.$refs.twoway.directInput = '';
  2265. this.$refs.twoway.excludeInput = '';
  2266. }
  2267. else if (selectValue === '2') {
  2268. this.$refs.direct.aloneInput = '';
  2269. this.$refs.twoway.directInput = '';
  2270. this.$refs.twoway.excludeInput = '';
  2271. }
  2272. else if (selectValue === '3') {
  2273. this.$refs.direct.aloneInput = '';
  2274. this.$refs.exclude.aloneInput = '';
  2275. }
  2276. },
  2277. handleGetAdAudiencePackage() {
  2278. const params = {
  2279. accountId: this.configForm.accountId
  2280. };
  2281. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', params)
  2282. .then(result => {
  2283. if (result.code === 0) {
  2284. const defaultList = result.result;
  2285. this.promotionTypeList.forEach(item => {
  2286. defaultList.forEach(val => {
  2287. if (val.landing_type === item.value) {
  2288. val.changeName = item.label;
  2289. }
  2290. });
  2291. });
  2292. if (this.configForm.checkboxChangeValue.length === 1 && this.configForm.checkboxChangeValue[0] === 'INVENTORY_UNION_SLOT') {
  2293. this.selectiveList = defaultList.filter(item => item.delivery_range === 'UNION');
  2294. }
  2295. else {
  2296. this.selectiveList = defaultList;
  2297. }
  2298. }
  2299. else {
  2300. this.$message.error(result.message);
  2301. }
  2302. })
  2303. .catch(error => {
  2304. console.log(error, 'eeee');
  2305. });
  2306. },
  2307. handleSelectiveOrientation(e) {
  2308. const ageUpdateList = [];
  2309. const defaultData = this.selectiveList.filter(item => item.audience_package_id === e);
  2310. defaultData.forEach(item => {
  2311. item.replaceSex = item.audience.gender === 'NONE' ? '不限' : item.audience.gender === 'GENDER_FEMALE' ? '女' : '男';
  2312. item.replaceEnabled = item.audience.auto_extend_enabled === 1 ? '开启' : '不开启';
  2313. item.replacePlate = item.audience.platform && item.audience.platform.length ? item.audience.platform.join(',') : '不限';
  2314. item.replaceCitys = item.audience.cityNames && item.audience.cityNames.length ? item.audience.cityNames.join(',') : '不限';
  2315. this.ageArr.forEach(val => {
  2316. if (item.audience.age && item.audience.age.length && item.audience.age.includes(val.value)) {
  2317. ageUpdateList.push(val.label);
  2318. }
  2319. });
  2320. item.replaceAge = ageUpdateList.length ? ageUpdateList.join(',') : '不限';
  2321. });
  2322. this.packageMessageDetail = defaultData;
  2323. },
  2324. handleBiddingMethod(e) {
  2325. this.configForm.adCpaBid = 0;
  2326. this.configForm.adMinBid = '';
  2327. this.configForm.adMaxBid = '';
  2328. this.configForm.adStepBid = 0;
  2329. this.isAdCpaBidBlur = false;
  2330. this.$refs['ruleForm'].clearValidate(['adMinBid']);
  2331. this.$refs['ruleForm'].clearValidate(['adMaxBid']);
  2332. },
  2333. handleAdCpaBidBlur(e) {
  2334. const defaultValue = e.target.value;
  2335. this.configForm.adCpaBid = Number(Number(defaultValue).toFixed(2));
  2336. if (this.configForm.adBudget > 0 && defaultValue > this.configForm.adBudget) {
  2337. this.isAdCpaBidBlur = true;
  2338. this.adCpaBidBlurTxt = '出价不能大于预算';
  2339. }
  2340. else if (defaultValue > 10000) {
  2341. this.isAdCpaBidBlur = true;
  2342. this.adCpaBidBlurTxt = '目标转化出价不少于0.1元,不超过10000元,请正确输入';
  2343. }
  2344. else {
  2345. this.isAdCpaBidBlur = false;
  2346. }
  2347. },
  2348. handleGetAdvertiserStrategy() {
  2349. const params = {
  2350. accountId: this.configForm.accountId,
  2351. landingType: this.configForm.campaignLandingType,
  2352. advancedCreativeType: 'ATTACHED_CREATIVE_NONE'
  2353. };
  2354. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdActionText', params)
  2355. .then(result => {
  2356. if (result.code === 0) {
  2357. this.configForm.creativeOptions = result.result;
  2358. }
  2359. else {
  2360. this.$message.error(result.message);
  2361. }
  2362. })
  2363. .catch(error => {
  2364. console.log(error, 'eeee');
  2365. });
  2366. },
  2367. // 获取选中的城市
  2368. getSelectedCityArr(val) {
  2369. setTimeout(() => {
  2370. this.configForm.adSelectCity = val;
  2371. }, 200);
  2372. },
  2373. handleCheckedShowList(val) {
  2374. if (val.length) {
  2375. this.configForm.adSelectCity = val.map(item => item.code);
  2376. }
  2377. else {
  2378. this.configForm.adSelectCity = [];
  2379. }
  2380. },
  2381. handlePlateSelect(data) {
  2382. if (data.length > 1 && data.findIndex(item => item === 'NONE') === 0) {
  2383. data.splice(data.findIndex(item => item === 'NONE'), 1);
  2384. }
  2385. else if (data.length > 1 && data.findIndex(item => item === 'NONE') === data.length - 1) {
  2386. data.splice(0, data.length - 1);
  2387. }
  2388. else if (data.length === 0) {
  2389. data.push('NONE');
  2390. }
  2391. },
  2392. getAgeSelect(data) {
  2393. if (data.length > 1 && data.findIndex(item => item === 'NONE') === 0) {
  2394. data.splice(data.findIndex(item => item === 'NONE'), 1);
  2395. }
  2396. else if (data.length > 1 && data.findIndex(item => item === 'NONE') === data.length - 1) {
  2397. data.splice(0, data.length - 1);
  2398. }
  2399. else if (data.length === 0) {
  2400. data.push('NONE');
  2401. }
  2402. },
  2403. handleAdBudgetBlur(e) {
  2404. const adBudgetInput = e.target.value;
  2405. this.configForm.adBudget = Number(Number(adBudgetInput).toFixed(2));
  2406. if (this.configForm.adCpaBid > adBudgetInput) {
  2407. this.isAdCpaBidBlur = true;
  2408. this.adCpaBidBlurTxt = '出价不能大于预算';
  2409. }
  2410. else {
  2411. this.isAdCpaBidBlur = false;
  2412. }
  2413. },
  2414. handleAccountBudget(e) {
  2415. const adBudgetInput = e.target.value;
  2416. this.configForm.accountBudget = Number(Number(adBudgetInput).toFixed(2));
  2417. },
  2418. handleExportRules(value, min, max, callback) {
  2419. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  2420. let length = 0;
  2421. let strArr = value.split('');
  2422. strArr.forEach(item => {
  2423. if (cnReg.test(item)) {
  2424. length += 2;
  2425. }
  2426. else {
  2427. length += 1;
  2428. }
  2429. });
  2430. if (min <= length && length <= max) {
  2431. callback();
  2432. }
  2433. else {
  2434. callback(`只能输入${min}-${max}个字符`);
  2435. }
  2436. },
  2437. handleGetPackage() {
  2438. const params = {
  2439. urlPath: this.configForm.adDownloadUrl
  2440. };
  2441. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getPackageNameByUrl', params)
  2442. .then(result => {
  2443. if (result.code === 0) {
  2444. this.configForm.adPackage = result.result.package || '';
  2445. this.platformLoadingType = result.result.platform || '';
  2446. if (result.result.platform && result.result.platform === 'APP_ANDROID') {
  2447. this.configForm.adPlatform = 'ANDROID';
  2448. }
  2449. else if (result.result.platform && result.result.platform === 'APP_IOS') {
  2450. this.configForm.adPlatform = 'IOS';
  2451. }
  2452. }
  2453. else {
  2454. this.$message.error(result.message);
  2455. }
  2456. })
  2457. .catch(error => {
  2458. console.log(error, 'eeee');
  2459. });
  2460. },
  2461. handleAndroidVersion(e) {
  2462. if (e.target.value === 'NONE') {
  2463. this.configForm.androidChangeValue = '';
  2464. }
  2465. },
  2466. handleAdScheduleType(e) {
  2467. if (e.target.value === 'SCHEDULE_FROM_NOW') {
  2468. this.configForm.launchDateRange = [];
  2469. }
  2470. },
  2471. handleLaunchTimeInterval(e) {
  2472. if (e.target.value === 'buxian') {
  2473. this.configForm.scheduleTimeData = str;
  2474. }
  2475. },
  2476. handleAdverPosition(e) {
  2477. this.$refs['ruleForm'].clearValidate(['creativeSource']);
  2478. if (e.target.value === 'a') {
  2479. this.configForm.radioChangeValue = '';
  2480. this.configForm.checkboxChangeValue = [];
  2481. this.isTAwemeStatus = true;
  2482. this.originalityStatus = true;
  2483. this.pictureStatus = false;
  2484. }
  2485. else if (e.target.value === 'b') {
  2486. this.configForm.radioChangeValue = '';
  2487. this.pictureStatus = true;
  2488. this.originalityStatus = true;
  2489. }
  2490. else if (e.target.value === 'c') {
  2491. this.configForm.checkboxChangeValue = [];
  2492. this.isTAwemeStatus = true;
  2493. this.originalityStatus = true;
  2494. this.pictureStatus = false;
  2495. }
  2496. this.configForm.adUnionVideoType = '';
  2497. this.configForm.creativeImageMode = 'CREATIVE_IMAGE_MODE_VIDEO_VERTICAL';
  2498. this.handleGetAdAudiencePackage();
  2499. },
  2500. handleAccountMode(e) {
  2501. if (e.target.value === '1') {
  2502. this.configForm.accountBudget = 0;
  2503. }
  2504. else if (e.target.value === '2') {
  2505. this.configForm.accountBudget = 1000;
  2506. }
  2507. },
  2508. handleAdDownLoadType(e) {
  2509. this.optimizationOption = [];
  2510. this.landingPageShowData = {};
  2511. this.configForm.creativeWebUrl = '';
  2512. // this.platformLoadingType = '';
  2513. const defaultValue = e.target.value;
  2514. if (defaultValue === 'DOWNLOAD_URL') {
  2515. this.configForm.adExternalUrl = '';
  2516. this.configForm.adOpenUrl = '';
  2517. // this.$refs.ruleForm.clearValidate(['adExternalUrl']);
  2518. }
  2519. else if (defaultValue === 'EXTERNAL_URL') {
  2520. // this.configForm.adDownloadUrl = '';
  2521. // this.configForm.adPackage = '';
  2522. this.configForm.adConvertId = '';
  2523. this.configForm.adAppType = '';
  2524. // this.$refs.ruleForm.clearValidate(['adDownloadUrl']);
  2525. // this.$refs.ruleForm.clearValidate(['adPackage']);
  2526. }
  2527. },
  2528. handleCampaignCnt(e) {
  2529. const finallyResult = e * this.configForm.campaignAdCnt;
  2530. if (finallyResult > 500) {
  2531. this.campaignStatus = true;
  2532. }
  2533. else {
  2534. this.campaignStatus = false;
  2535. }
  2536. },
  2537. handleCampaignAdCnt(e) {
  2538. const finallyResult = e * this.configForm.campaignCnt;
  2539. if (finallyResult > 500) {
  2540. this.campaignStatus = true;
  2541. }
  2542. else {
  2543. this.campaignStatus = false;
  2544. }
  2545. },
  2546. handleConvertChange(e) {
  2547. const convertTitle = this.optimizationOption.filter(item => item.convert_id === e);
  2548. this.configForm.creativeActionTrackUrl = convertTitle[0].action_track_url;
  2549. },
  2550. handleGetDetailList() {
  2551. const routeQuery = JSON.parse(localStorage.getItem('queryList'));
  2552. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/queryById', {id: routeQuery.id})
  2553. .then(result => {
  2554. if (result.code === 0) {
  2555. const detailData = result.result;
  2556. this.configForm.accountId = detailData.accountId;
  2557. let paramsData = {};
  2558. if (detailData.adDownloadType === 'DOWNLOAD_URL') {
  2559. paramsData = {
  2560. advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
  2561. advertiserId: detailData.accountId,
  2562. appType: 'APP_ANDROID',
  2563. deliveryRange: 'DEFAULT',
  2564. externalUrl: detailData.adExternalUrl,
  2565. landingType: detailData.campaignLandingType,
  2566. packageName: detailData.adPackage,
  2567. promotionContent: detailData.adDownloadType
  2568. };
  2569. }
  2570. else if (detailData.adDownloadType === 'EXTERNAL_URL') {
  2571. paramsData = {
  2572. advancedCreativeType: 'ATTACHED_CREATIVE_NONE',
  2573. advertiserId: detailData.accountId,
  2574. deliveryRange: 'DEFAULT',
  2575. externalUrl: detailData.adExternalUrl,
  2576. landingType: detailData.campaignLandingType,
  2577. promotionContent: detailData.adDownloadType
  2578. };
  2579. }
  2580. postAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getToolConvert', paramsData).then(result => {
  2581. if (result.code === 0) {
  2582. const updateResult = result.result.filter(item => item.external_actions.length > 0);
  2583. this.configForm.adConvertType = updateResult[0].convert_type;
  2584. this.optimizationOption = updateResult[0].external_actions;
  2585. setTimeout(() => {
  2586. this.configForm.adConvertId = detailData.adConvertId;
  2587. this.spinning = false;
  2588. }, 2000);
  2589. }
  2590. else {
  2591. this.$message.error(result.message);
  2592. }
  2593. }).catch(error => {
  2594. console.log(error, 'eeee');
  2595. });
  2596. if (detailData.adAudiencePackageId) {
  2597. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdAudiencePackage', {accountId: detailData.accountId})
  2598. .then(result => {
  2599. if (result.code === 0) {
  2600. let checkboxChangeValueList = detailData.creativeInventoryType ? detailData.creativeInventoryType.split(',') : [];
  2601. if (checkboxChangeValueList.length === 1 && checkboxChangeValueList[0] === 'INVENTORY_UNION_SLOT') {
  2602. this.selectiveList = result.result.filter(item => item.delivery_range === 'UNION');
  2603. }
  2604. else {
  2605. this.selectiveList = result.result || [];
  2606. }
  2607. this.configForm.adAudiencePackageId = Number(detailData.adAudiencePackageId);
  2608. this.handleSelectiveOrientation(Number(detailData.adAudiencePackageId));
  2609. }
  2610. else {
  2611. this.$message.error(result.message);
  2612. }
  2613. })
  2614. .catch(error => {
  2615. console.log(error, 'eeee');
  2616. });
  2617. }
  2618. this.configForm.dpLinkStartIndex = detailData.dpLinkStartIndex;
  2619. this.configForm.dpLinkEndIndex = detailData.dpLinkEndIndex;
  2620. this.configForm.accountBudgetMode = detailData.accountBudgetMode;
  2621. this.configForm.accountBudget = detailData.accountBudget;
  2622. this.configForm.adDirectionalFlag = detailData.adDirectionalFlag;
  2623. this.configForm.campaignLandingType = detailData.campaignLandingType;
  2624. this.configForm.advertisingType = detailData.advertisingType || '1';
  2625. this.configForm.campaignName = detailData.campaignName || '';
  2626. this.configForm.dpLinkIndexUsed = detailData.dpLinkIndexUsed;
  2627. if (detailData.dpLinkIndexUsed === 1) {
  2628. this.adNameTags.push('dp链接标识');
  2629. }
  2630. this.configForm.adName = detailData.adName || '';
  2631. this.configForm.campaignCnt = detailData.campaignCnt || '';
  2632. this.configForm.campaignAdCnt = detailData.campaignAdCnt || '';
  2633. this.configForm.launchTarget = detailData.launchTarget || 'OCPM';
  2634. this.configForm.adDownloadType = detailData.adDownloadType;
  2635. if (detailData.adDownloadType === 'DOWNLOAD_URL') {
  2636. this.$nextTick(() => {
  2637. this.configForm.creativeAppName = detailData.creativeAppName || undefined;
  2638. });
  2639. }
  2640. this.configForm.adPlatform = detailData.adPlatform;
  2641. this.configForm.adExternalUrl = detailData.adExternalUrl || '';
  2642. this.configForm.adOpenUrl = detailData.adOpenUrl || '';
  2643. this.configForm.adDownloadUrl = detailData.adDownloadUrl || '';
  2644. this.configForm.adPackage = detailData.adPackage || '';
  2645. this.configForm.adConvertType = detailData.adConvertType || '';
  2646. this.configForm.adDistrict = detailData.adDistrict || 'NONE';
  2647. this.configForm.adAppType = detailData.adAppType;
  2648. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getChengZiSite', {accountId: detailData.accountId}).then(result => {
  2649. if (result.code === 0) {
  2650. const defaultResult = result.result;
  2651. defaultResult.forEach(item => {
  2652. if (item.creativeWebUrl === detailData.creativeWebUrl) {
  2653. this.landingPageShowData = item;
  2654. }
  2655. });
  2656. this.configForm.creativeWebUrl = detailData.creativeWebUrl;
  2657. }
  2658. else {
  2659. this.$message.error(result.message);
  2660. }
  2661. }).catch(error => {
  2662. console.log(error, 'eeee');
  2663. });
  2664. if (detailData.adDownloadType === 'DOWNLOAD_URL') {
  2665. this.handleGetPackage();
  2666. }
  2667. setTimeout(() => {
  2668. this.listArr = detailData.adCity.split(',').map(item => Number(item));
  2669. this.configForm.adSelectCity = detailData.adCity.split(',');
  2670. }, 1000);
  2671. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getDMPCustomAudience', {accountId: detailData.accountId}).then(result => {
  2672. if (result.code === 0) {
  2673. result.result.forEach(item => {
  2674. item.key = item.custom_audience_id;
  2675. });
  2676. this.directionalData = result.result;
  2677. this.configForm.adRetargetingTagsType = detailData.adRetargetingTagsType;
  2678. if (detailData.adRetargetingTagsType === '3') {
  2679. this.configForm.customPerson = 'a';
  2680. this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude;
  2681. this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude;
  2682. this.configForm.updateGetingExclude = detailData.adRetargetingTagsExclude ? detailData.adRetargetingTagsExclude.split(',').map(item => Number(item)) : [];
  2683. this.configForm.updateGetingInclude = detailData.adRetargetingTagsInclude ? detailData.adRetargetingTagsInclude.split(',').map(item => Number(item)) : [];
  2684. }
  2685. else if (detailData.adRetargetingTagsType === '2') {
  2686. this.configForm.customPerson = 'a';
  2687. this.configForm.adRetargetingTagsExclude = detailData.adRetargetingTagsExclude;
  2688. this.configForm.updateGetingExclude = detailData.adRetargetingTagsExclude.split(',').map(item => Number(item));
  2689. this.configForm.updateGetingInclude = [];
  2690. }
  2691. else if (detailData.adRetargetingTagsType === '1') {
  2692. this.configForm.customPerson = 'a';
  2693. this.configForm.adRetargetingTagsInclude = detailData.adRetargetingTagsInclude;
  2694. this.configForm.updateGetingExclude = [];
  2695. this.configForm.updateGetingInclude = detailData.adRetargetingTagsInclude.split(',').map(item => Number(item));
  2696. }
  2697. else {
  2698. this.configForm.customPerson = 'NONE';
  2699. this.configForm.adRetargetingTagsExclude = '';
  2700. this.configForm.updateGetingExclude = '';
  2701. this.configForm.updateGetingInclude = [];
  2702. this.configForm.updateGetingExclude = [];
  2703. }
  2704. }
  2705. else {
  2706. this.$message.error(result.message);
  2707. }
  2708. }).catch(error => {
  2709. console.log(error, 'eeee');
  2710. });
  2711. this.configForm.adGender = detailData.adGender || 'NONE';
  2712. this.configForm.adLocationType = detailData.adLocationType;
  2713. this.configForm.adSelectAge = detailData.adAge.split(',');
  2714. this.configForm.adSelectAc = detailData.adAc.split(',');
  2715. this.configForm.adDeviceSelectType = detailData.adDeviceType.split(',');
  2716. this.configForm.adSuperiorPopularityType = detailData.adSuperiorPopularityType;
  2717. this.configForm.adAc = detailData.adAc;
  2718. this.configForm.adHideIfExists = String(detailData.adHideIfExists);
  2719. this.configForm.adHideIfConverted = detailData.adHideIfConverted;
  2720. this.configForm.adAutoExtendEnabled = detailData.adAutoExtendEnabled;
  2721. this.configForm.adSmartBidType = detailData.adSmartBidType;
  2722. this.configForm.adBudgetMode = detailData.adBudgetMode;
  2723. this.configForm.adBudget = detailData.adBudget;
  2724. this.defaultAdBudget = detailData.accountBudget;
  2725. this.configForm.adScheduleType = detailData.adScheduleType;
  2726. this.configForm.launchDateRange[0] = detailData.adStartTime;
  2727. this.configForm.launchDateRange[1] = detailData.adEndTime;
  2728. this.configForm.adPricing = detailData.adPricing;
  2729. this.configForm.adCpaBid = detailData.adCpaBid;
  2730. this.configForm.creativeActionTrackUrl = detailData.creativeActionTrackUrl;
  2731. this.configForm.creativeMaterialMode = detailData.creativeMaterialMode;
  2732. this.configForm.creativeImageMode = detailData.creativeImageMode;
  2733. this.configForm.creativeProductDescription = detailData.creativeProductDescription;
  2734. this.configForm.creativeEnablePersonalAction = detailData.creativeEnablePersonalAction;
  2735. const params = {
  2736. accountId: detailData.accountId,
  2737. landingType: detailData.campaignLandingType,
  2738. advancedCreativeType: 'ATTACHED_CREATIVE_NONE'
  2739. };
  2740. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getAdActionText', params)
  2741. .then(result => {
  2742. if (result.code === 0) {
  2743. this.configForm.creativeOptions = result.result;
  2744. this.configForm.creativeCallToAction = detailData.creativeCallToAction;
  2745. this.configForm.creativeActionText = detailData.creativeActionText;
  2746. }
  2747. else {
  2748. this.$message.error(result.message);
  2749. }
  2750. })
  2751. .catch(error => {
  2752. console.log(error, 'eeee');
  2753. });
  2754. this.configForm.creativeSource = detailData.creativeSource;
  2755. this.configForm.adBidCreateType = detailData.adBidCreateType;
  2756. this.configForm.adMinBid = detailData.adMinBid;
  2757. this.configForm.adMaxBid = detailData.adMaxBid;
  2758. this.configForm.adStepBid = detailData.adStepBid;
  2759. this.configForm.adBidCreateType = detailData.adBidCreateType;
  2760. this.configForm.creativeThirdIndustryIds[0] = detailData.creativeThirdIndustryId && detailData.creativeThirdIndustryId.substr(0, 4);
  2761. this.configForm.creativeThirdIndustryIds[1] = detailData.creativeThirdIndustryId && detailData.creativeThirdIndustryId.substr(0, 6);
  2762. this.configForm.creativeThirdIndustryIds[2] = detailData.creativeThirdIndustryId && detailData.creativeThirdIndustryId;
  2763. this.imageUrl = detailData.imageUrl;
  2764. this.urlResult = detailData.imageUrl;
  2765. this.md5Result = detailData.creativeProductImageCode;
  2766. if (detailData.adAndroidOsv !== 'NONE') {
  2767. this.configForm.adAndroidVersion = 'a';
  2768. this.configForm.androidChangeValue = detailData.adAndroidOsv;
  2769. }
  2770. else {
  2771. this.configForm.adAndroidVersion = 'NONE';
  2772. }
  2773. if (detailData.productSellingPoints) {
  2774. let productPointsList = [];
  2775. const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
  2776. detailData.productSellingPoints.forEach((item, index) => {
  2777. productPointsList.push({
  2778. id: randomNum + index,
  2779. value: item
  2780. });
  2781. });
  2782. this.configForm.defaultFormList = productPointsList;
  2783. }
  2784. if (detailData.adScheduleTime.indexOf(1) !== -1) {
  2785. this.configForm.launchTimeInterval = 'a';
  2786. this.configForm.scheduleTimeData = detailData.adScheduleTime;
  2787. }
  2788. else {
  2789. this.configForm.launchTimeInterval = 'buxian';
  2790. }
  2791. if (detailData.creativeSceneInventory) {
  2792. this.configForm.adverPosition = 'c';
  2793. this.configForm.radioChangeValue = detailData.creativeSceneInventory;
  2794. }
  2795. else if (detailData.creativeInventoryType) {
  2796. this.configForm.adverPosition = 'b';
  2797. this.configForm.checkboxChangeValue = detailData.creativeInventoryType.split(',');
  2798. if (this.configForm.checkboxChangeValue.includes('INVENTORY_AWEME_FEED')) {
  2799. this.isTAwemeStatus = true;
  2800. }
  2801. else {
  2802. this.isTAwemeStatus = false;
  2803. }
  2804. if (this.configForm.checkboxChangeValue.length === 1 && this.configForm.checkboxChangeValue[0] === 'INVENTORY_UNION_SLOT') {
  2805. this.configForm.adUnionVideoType = detailData.adUnionVideoType;
  2806. this.configForm.adDeliveryRange = 'UNION';
  2807. }
  2808. else {
  2809. this.configForm.adUnionVideoType = '';
  2810. this.configForm.adDeliveryRange = '';
  2811. }
  2812. this.NewCheckboxChangeValue(this.configForm.checkboxChangeValue);
  2813. }
  2814. else {
  2815. this.configForm.adverPosition = 'a';
  2816. }
  2817. if (detailData.adKeywords) {
  2818. this.creativeTag = detailData.adKeywords;
  2819. }
  2820. this.configForm.adInterestActionMode = detailData.adInterestActionMode;
  2821. this.configForm.creativeDisplayMode = detailData.creativeDisplayMode;
  2822. this.configForm.creativeIsPresentedVideo = detailData.creativeIsPresentedVideo;
  2823. this.configForm.creativeGenerateDerivedAd = detailData.creativeGenerateDerivedAd;
  2824. this.configForm.creativeIsCommentDisable = detailData.creativeIsCommentDisable;
  2825. this.configForm.creativeDownloadStatus = detailData.creativeDownloadStatus;
  2826. this.configForm.creativeSubTitle = detailData.creativeSubTitle;
  2827. this.configForm.adConvertedTimeDuration = detailData.adConvertedTimeDuration;
  2828. this.configForm.adDownloadMode = detailData.adDownloadMode;
  2829. this.configForm.adAutoExtendTargets = detailData.adAutoExtendTargets;
  2830. this.AutoExtendEditSelect = detailData.adAutoExtendTargets && detailData.adAutoExtendTargets.split(',');
  2831. }
  2832. else {
  2833. this.$message.error(result.message);
  2834. }
  2835. })
  2836. .catch(error => {
  2837. console.log(error, 'eeee');
  2838. });
  2839. },
  2840. handleConvertTypeChange(e) {
  2841. this.configForm.adConvertId = '';
  2842. this.optimizationOption = [];
  2843. this.toolConvertList.forEach(item => {
  2844. if (item.convert_type === e) {
  2845. this.optimizationOption = [...item.external_actions];
  2846. }
  2847. });
  2848. },
  2849. // 优化目标数据获取
  2850. handleGetOptimizationObjective(paramsData) {
  2851. postAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getToolConvert', paramsData).then(result => {
  2852. if (result.code === 0) {
  2853. this.toolConvertList = result.result;
  2854. if (this.configForm.adConvertType) {
  2855. this.handleConvertTypeChange(this.configForm.adConvertType);
  2856. }
  2857. }
  2858. else {
  2859. this.$message.error(result.message);
  2860. }
  2861. }).catch(error => {
  2862. console.log(error, 'eeee');
  2863. });
  2864. },
  2865. // 创意分类接口
  2866. handleGetCreativeClassification() {
  2867. const paramsData = {
  2868. accountId: this.configForm.accountId
  2869. };
  2870. getAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/getIndustryList', paramsData).then(result => {
  2871. if (result.code === 0) {
  2872. this.createOptions = result.result;
  2873. }
  2874. else {
  2875. this.$message.error(result.message);
  2876. }
  2877. }).catch(error => {
  2878. console.log(error, 'eeee');
  2879. });
  2880. },
  2881. handleAddList(data) {
  2882. postAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/addBytedanceStrategy', data).then(result => {
  2883. if (result.code === 0) {
  2884. this.$message.success(result.message);
  2885. this.sureLoading = false;
  2886. this.$router.replace('/account-config/account-config');
  2887. this.$bus.$emit('remove', '/account-config/components/configuration-copy');
  2888. }
  2889. else {
  2890. this.sureLoading = false;
  2891. this.$message.error(result.message);
  2892. }
  2893. }).catch(error => {
  2894. console.log(error, 'eeee');
  2895. });
  2896. },
  2897. // 点击获取光标位置进行字段插入
  2898. handleGetChangeAll(item, field, type) {
  2899. let node = document.getElementById(field);
  2900. let startPos = node.selectionStart; // input 第0个字符到选中的字符
  2901. let endPos = node.selectionEnd; // 选中的字符到最后的字符
  2902. let txt = node.value;
  2903. if (startPos === 0 || endPos === 0) {
  2904. this.configForm[type] += '-{{' + item + '}}-';
  2905. }
  2906. else {
  2907. this.configForm[type] = txt.substring(0, startPos) + '-{{' + item + '}}-' + txt.substring(endPos);
  2908. node.selectionStart = startPos + item.length + 6;
  2909. node.selectionEnd = startPos + item.length + 6;
  2910. }
  2911. node.focus();
  2912. node.blur();
  2913. },
  2914. handleLaunchData(date, dateString) {
  2915. this.configForm.launchDateRange = dateString;
  2916. },
  2917. handleBudgetMode(e) {
  2918. if (e === 'BUDGET_MODE_TOTAL') {
  2919. this.configForm.adScheduleType = 'SCHEDULE_START_END';
  2920. this.adBudgetNum = this.configForm.launchTarget === 'OCPM' ? 300 : 0;
  2921. this.configForm.adBudget = 300;
  2922. if (Number(this.configForm.adCpaBid) > Number(this.configForm.adBudget)) {
  2923. this.isAdCpaBidBlur = true;
  2924. this.adCpaBidBlurTxt = '出价不能大于预算';
  2925. }
  2926. else {
  2927. this.isAdCpaBidBlur = false;
  2928. this.adCpaBidBlurTxt = '';
  2929. }
  2930. this.$message.warning('请设置投放时间');
  2931. }
  2932. else if (e === 'BUDGET_MODE_DAY') {
  2933. this.adBudgetNum = 0;
  2934. this.configForm.adBudget = 300;
  2935. }
  2936. },
  2937. handleDelOrigin(list) {
  2938. let formData = this.configForm.defaultFormList;
  2939. this.configForm.defaultFormList = formData.filter(item => list.id !== item.id);
  2940. },
  2941. handleAddOrigin() {
  2942. if (this.configForm.defaultFormList.length >= 10) {
  2943. this.$message.error('最多可以添加10个卖点');
  2944. return;
  2945. }
  2946. const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
  2947. this.$nextTick(() => {
  2948. this.configForm.defaultFormList.push({
  2949. id: randomNum,
  2950. value: ''
  2951. });
  2952. });
  2953. },
  2954. handleCreativeWebUrl(e) {
  2955. const defaultValue = e.target.value;
  2956. this.landingPageShowData = {};
  2957. },
  2958. handleDownloadLink(e) {
  2959. const defaultValue = e.target.value;
  2960. if (defaultValue) {
  2961. this.handleGetPackage();
  2962. }
  2963. else {
  2964. this.platformLoadingType = '';
  2965. this.configForm.adPackage = '';
  2966. }
  2967. },
  2968. handleDeleteImg() {
  2969. this.imageUrl = '';
  2970. this.isCoverImgDiv = false;
  2971. },
  2972. handleChangeActive() {
  2973. this.isCoverImgDiv = true;
  2974. },
  2975. handleRemoveActive() {
  2976. this.isCoverImgDiv = false;
  2977. },
  2978. getBase64(img, callback) {
  2979. const reader = new FileReader();
  2980. reader.addEventListener('load', () => callback(reader.result));
  2981. reader.readAsDataURL(img);
  2982. },
  2983. beforeUpload(info) {
  2984. const isZip = info.type.includes('png') || info.type.includes('jpeg');
  2985. const fileOvesize = info.size > (1024 * 1024);
  2986. if (!isZip) {
  2987. this.$message.error('请上传正确类型的图片');
  2988. this.imageUrl = '';
  2989. this.urlResult = '';
  2990. this.md5Result = '';
  2991. return;
  2992. }
  2993. if (fileOvesize) {
  2994. this.$message.error('图片大小不能超过1M');
  2995. this.imageUrl = '';
  2996. this.urlResult = '';
  2997. this.md5Result = '';
  2998. return;
  2999. }
  3000. new Promise(function (resolve, reject) {
  3001. let width = 108;
  3002. let height = 108;
  3003. let _URL = window.URL || window.webkitURL;
  3004. let img = new Image();
  3005. img.onload = function () {
  3006. let valid = img.width === width && img.height === height;
  3007. valid ? resolve() : reject();
  3008. };
  3009. img.src = _URL.createObjectURL(info);
  3010. }).then(() => {
  3011. this.handleMd5(info);
  3012. this.getBase64(info, imageUrl => {
  3013. this.imageUrl = imageUrl;
  3014. });
  3015. }, () => {
  3016. this.$message.error('图片尺寸必须是108*108!');
  3017. this.imageUrl = '';
  3018. this.urlResult = '';
  3019. this.md5Result = '';
  3020. return Promise.reject();
  3021. });
  3022. },
  3023. cosUpload(file) {
  3024. let that = this;
  3025. let date = new Date();
  3026. let y = date.getFullYear();
  3027. let MM = date.getMonth() + 1;
  3028. MM = MM < 10 ? '0' + MM : MM;
  3029. let d = date.getDate();
  3030. d = d < 10 ? '0' + d : d;
  3031. let timeElse = new Date().getTime();
  3032. let arr = file.name.split('.');
  3033. let str = '';
  3034. for (let i = 0; i < arr.length; i++) {
  3035. if (i === arr.length - 1) {
  3036. }
  3037. else {
  3038. if (i === arr.length - 2) {
  3039. str += arr[i];
  3040. }
  3041. else {
  3042. str += arr[i] + '.';
  3043. }
  3044. }
  3045. }
  3046. cos.putObject(
  3047. {
  3048. Bucket: 'media-1301855440',
  3049. Region: 'ap-chongqing',
  3050. // 存储桶所在地域,必须字段
  3051. Key: that.uploadType + '/' + y + '-' + MM + '-' + d + '/' + str + '-' + timeElse + '.' + arr[arr.length - 1],
  3052. StorageClass: 'STANDARD',
  3053. Body: file // 上传文件对象
  3054. },
  3055. function (err, data) {
  3056. if (err) {
  3057. that.$message.error('上传失败!!!' + err);
  3058. return;
  3059. }
  3060. that.loadingElse = false;
  3061. that.fileList.push({
  3062. uid: file.name,
  3063. name: file.name,
  3064. status: 'done',
  3065. url: '//' + data.Location
  3066. });
  3067. that.urlResult = '//' + data.Location;
  3068. }
  3069. );
  3070. },
  3071. handleMd5(file) {
  3072. let bmf = new BMF();
  3073. let that = this;
  3074. return new Promise(function (resolve, reject) {
  3075. bmf.md5(file, (err, md5) => {
  3076. that.md5Result = md5;
  3077. getAction('/file/imageCheck', {code: md5}).then(result => {
  3078. if (result.code === -206) {
  3079. that.cosUpload(file);
  3080. resolve();
  3081. }
  3082. else {
  3083. that.urlResult = result.url;
  3084. // reject();
  3085. }
  3086. }).catch(error => {
  3087. console.log(error, 'eeee');
  3088. reject();
  3089. });
  3090. });
  3091. });
  3092. },
  3093. handleRelaxSure() {
  3094. let paramsFormData = this.configForm;
  3095. if (paramsFormData.adDirectionalFlag === 'add') {
  3096. paramsFormData.adAudiencePackageId = null;
  3097. this.packageMessageDetail = [];
  3098. }
  3099. else if (paramsFormData.adDirectionalFlag === 'choice') {
  3100. paramsFormData.adDistrict = 'NONE';
  3101. this.listArr = [];
  3102. paramsFormData.adLocationType = '';
  3103. paramsFormData.adGender = 'NONE';
  3104. paramsFormData.adSelectAge = ['NONE'];
  3105. paramsFormData.customPerson = 'NONE';
  3106. paramsFormData.updateGetingInclude = [];
  3107. paramsFormData.adRetargetingTagsInclude = '';
  3108. paramsFormData.adRetargetingTagsExclude = '';
  3109. paramsFormData.updateGetingExclude = [];
  3110. paramsFormData.adRetargetingTagsType = '';
  3111. paramsFormData.adSuperiorPopularityType = 'NONE';
  3112. paramsFormData.adInterestActionMode = 'UNLIMITED';
  3113. paramsFormData.adDeviceSelectType = ['NONE'];
  3114. paramsFormData.adAndroidVersion = 'NONE';
  3115. paramsFormData.adHideIfConverted = 'NO_EXCLUDE';
  3116. paramsFormData.adSelectAc = ['NONE'];
  3117. paramsFormData.adHideIfExists = '0';
  3118. paramsFormData.adAutoExtendEnabled = '0';
  3119. paramsFormData.adAutoExtendTargets = '';
  3120. paramsFormData.adSelectCity = [];
  3121. this.adAutoExtendList = [];
  3122. }
  3123. if (paramsFormData.adDistrict === 'CITY') {
  3124. if (!paramsFormData.adSelectCity.length) {
  3125. this.$message.error('请选择省市');
  3126. return;
  3127. }
  3128. }
  3129. if (paramsFormData.checkboxChangeValue.length === 1 && paramsFormData.checkboxChangeValue[0] === 'INVENTORY_UNION_SLOT') {
  3130. paramsFormData.adDeliveryRange = 'UNION';
  3131. }
  3132. else {
  3133. paramsFormData.adDeliveryRange = '';
  3134. }
  3135. if (paramsFormData.adDirectionalFlag === 'choice' && !paramsFormData.adAudiencePackageId) {
  3136. this.$message.error('请选择已有定向包');
  3137. return;
  3138. }
  3139. if (paramsFormData.customPerson === 'a') {
  3140. if (paramsFormData.adRetargetingTagsType === '1' && !paramsFormData.adRetargetingTagsInclude) {
  3141. this.$message.error('请选择人群');
  3142. return;
  3143. }
  3144. else if (paramsFormData.adRetargetingTagsType === '2' && !paramsFormData.adRetargetingTagsExclude) {
  3145. this.$message.error('请选择人群');
  3146. return;
  3147. }
  3148. else if (paramsFormData.adRetargetingTagsType === '3' && (!paramsFormData.adRetargetingTagsExclude || !paramsFormData.adRetargetingTagsInclude)) {
  3149. this.$message.error('请选择人群');
  3150. return;
  3151. }
  3152. }
  3153. if (paramsFormData.adAutoExtendEnabled === '1' && !paramsFormData.adAutoExtendTargets) {
  3154. this.$message.error('请选择可开放定向');
  3155. return;
  3156. }
  3157. if (paramsFormData.adScheduleType === 'SCHEDULE_START_END' && !paramsFormData.launchDateRange.length) {
  3158. this.$message.error('请选择投放时间');
  3159. return;
  3160. }
  3161. if (paramsFormData.launchTimeInterval === 'a' && paramsFormData.scheduleTimeData === str) {
  3162. this.$message.error('请选择投放时段');
  3163. return;
  3164. }
  3165. if (this.isTAwemeStatus && !this.urlResult) {
  3166. this.$message.error('请上传图片');
  3167. return;
  3168. }
  3169. if (this.isTAwemeStatus && !paramsFormData.defaultFormList.length) {
  3170. this.$message.error('请添加卖点');
  3171. return;
  3172. }
  3173. if (!this.creativeTag.length) {
  3174. this.$message.error('请添加标签');
  3175. return;
  3176. }
  3177. if (this.campaignStatus) {
  3178. return;
  3179. }
  3180. if (paramsFormData.adBudget < paramsFormData.adCpaBid) {
  3181. this.isAdCpaBidBlur = true;
  3182. this.adCpaBidBlurTxt = '出价不能大于预算';
  3183. return;
  3184. }
  3185. else {
  3186. this.isAdCpaBidBlur = false;
  3187. }
  3188. if (this.subTitleMsgStatus) {
  3189. return;
  3190. }
  3191. if (paramsFormData.adverPosition === 'a') {
  3192. paramsFormData.creativeSmartInventory = 1;
  3193. }
  3194. else if (paramsFormData.adverPosition === 'b') {
  3195. if (!paramsFormData.checkboxChangeValue.length) {
  3196. this.$message.error('请选择媒体指定位置');
  3197. return;
  3198. }
  3199. paramsFormData.creativeInventoryTypes = paramsFormData.checkboxChangeValue;
  3200. }
  3201. else if (paramsFormData.adverPosition === 'c') {
  3202. if (!paramsFormData.radioChangeValue) {
  3203. this.$message.error('请选择场景指定位置');
  3204. return;
  3205. }
  3206. paramsFormData.creativeSceneInventory = paramsFormData.radioChangeValue;
  3207. }
  3208. if (paramsFormData.launchTimeInterval === 'buxian') {
  3209. paramsFormData.adScheduleTime = '';
  3210. }
  3211. else if (paramsFormData.launchTimeInterval === 'a') {
  3212. paramsFormData.adScheduleTime = paramsFormData.scheduleTimeData;
  3213. }
  3214. if (paramsFormData.adScheduleType === 'SCHEDULE_START_END') {
  3215. paramsFormData.adStartTime = paramsFormData.launchDateRange[0];
  3216. paramsFormData.adEndTime = paramsFormData.launchDateRange[1];
  3217. }
  3218. else if (paramsFormData.adScheduleType === 'SCHEDULE_FROM_NOW') {
  3219. paramsFormData.adStartTime = '';
  3220. paramsFormData.adEndTime = '';
  3221. }
  3222. if (paramsFormData.launchTimeInterval === 'buxian') {
  3223. paramsFormData.adScheduleTime = str;
  3224. }
  3225. else if (paramsFormData.launchTimeInterval === 'a') {
  3226. paramsFormData.adScheduleTime = paramsFormData.scheduleTimeData;
  3227. }
  3228. if (paramsFormData.adAndroidVersion === 'a') {
  3229. paramsFormData.adAndroidOsv = paramsFormData.androidChangeValue;
  3230. }
  3231. else {
  3232. paramsFormData.adAndroidOsv = 'NONE';
  3233. }
  3234. paramsFormData.adCity = paramsFormData.adSelectCity.join(',');
  3235. paramsFormData.adAge = paramsFormData.adSelectAge.join(',');
  3236. paramsFormData.adAc = paramsFormData.adSelectAc.join(',');
  3237. paramsFormData.adDeviceType = paramsFormData.adDeviceSelectType.join(',');
  3238. paramsFormData.productSellingPoints = this.configForm.defaultFormList && this.configForm.defaultFormList.map(item => item.value);
  3239. paramsFormData.creativeThirdIndustryId = paramsFormData.creativeThirdIndustryIds[2];
  3240. paramsFormData.creativeProductImageCode = this.md5Result;
  3241. paramsFormData.imageUrl = this.urlResult;
  3242. paramsFormData.adKeywords = this.creativeTag;
  3243. paramsFormData.userId = this.userInfo().id;
  3244. this.$refs.ruleForm.validate(valid => {
  3245. if (valid) {
  3246. this.sureLoading = true;
  3247. if (this.modalTitle === 'copy') {
  3248. this.handleAddList(paramsFormData);
  3249. }
  3250. }
  3251. else {
  3252. console.log('error submit!!');
  3253. return false;
  3254. }
  3255. });
  3256. },
  3257. handleEditList(data) {
  3258. const queryData = data;
  3259. const routeQuery = JSON.parse(localStorage.getItem('queryList'));
  3260. queryData.id = routeQuery.id;
  3261. putAction(urlAcount + '/bytedance-api/advertiser/aiBytedanceAdvertiserStrategy/edit', queryData).then(result => {
  3262. if (result.code === 0) {
  3263. this.$message.success(result.message);
  3264. this.sureLoading = false;
  3265. this.$router.replace('/account-config/account-config');
  3266. this.$bus.$emit('remove', '/account-config/components/configuration-copy');
  3267. }
  3268. else {
  3269. this.sureLoading = false;
  3270. this.$message.error(result.message);
  3271. }
  3272. }).catch(error => {
  3273. console.log(error, 'eeee');
  3274. });
  3275. },
  3276. handleRelaxCancel() {
  3277. this.$router.replace('/account-config/account-config');
  3278. this.$bus.$emit('remove', '/account-config/components/configuration-copy');
  3279. },
  3280. handleEnterChang(value) {
  3281. this.creativeTag.push(...value);
  3282. this.creativeTag = [...new Set(this.creativeTag)];
  3283. for (let i = 0; i < this.creativeTag.length; i++) {
  3284. if (this.creativeTag[i].length > 10) {
  3285. this.creativeTag.splice(i, 1);
  3286. this.$message.error('创意标签最多只能十个字符,超过的已清除');
  3287. }
  3288. }
  3289. this.configForm.creativeLabel = [];
  3290. },
  3291. handleTagsClose(removedTag) {
  3292. const tags = this.creativeTag.filter(tag => tag !== removedTag);
  3293. this.creativeTag = tags;
  3294. }
  3295. }
  3296. };
  3297. </script>
  3298. <style lang="less">
  3299. @import "configuration-modal";
  3300. .display-none-selset {
  3301. display: none !important;
  3302. }
  3303. </style>