configuration-modal.vue 168 KB

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