configuration-modal.vue 141 KB

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