configuration-modal.vue 135 KB

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