creatUnit.vue 99 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935
  1. <style>
  2. .display-none-selset {
  3. display: none !important;
  4. }
  5. #table_time_selected1 tr {
  6. border: 1px solid rgb(102, 162, 243);
  7. }
  8. .plug-timer-grid th {
  9. line-height: 25px;
  10. }
  11. .group-creat .ant-form-item-required::before {
  12. display: inline-block;
  13. margin-right: 4px;
  14. color: #f5222d;
  15. font-size: 14px;
  16. font-family: SimSun, sans-serif;
  17. line-height: 1;
  18. content: '';
  19. }
  20. .else-label .ant-form-item-label label::after {
  21. content: '';
  22. position: relative;
  23. top: -0.5px;
  24. margin: 0 8px 0 2px;
  25. }
  26. </style>
  27. <template>
  28. <a-card :body-style="{ padding: '24px 32px' }" :bordered="false" class="group-creat">
  29. <a-form @submit="handleSubmit" :form="form">
  30. <a-form-item
  31. label="今日已创建数"
  32. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  33. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  34. >
  35. <div style="color:red">
  36. {{getData('unitType') == '4' ? createCount.ctmCount : createCount.pgdCount }}
  37. </div>
  38. </a-form-item>
  39. <a-form-item
  40. label="创意制作方式"
  41. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  42. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  43. >
  44. <a-radio-group buttonStyle="solid" v-decorator="['unitType', { initialValue: '4' }]" @change="changeUnitType">
  45. <a-radio-button value="4">自定义</a-radio-button>
  46. <a-radio-button value="7">程序化</a-radio-button>
  47. </a-radio-group>
  48. </a-form-item>
  49. <a-form-item
  50. label="目标应用"
  51. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  52. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  53. v-if="campaignType == '2'||campaignType == '7'"
  54. >
  55. <a-select
  56. v-decorator="['appId', { rules: [{ required: true, message: '请选择目标应用' }] }]"
  57. showSearch
  58. allowClear
  59. placeholder="选择应用目标"
  60. optionFilterProp="children"
  61. style="width: 500px"
  62. @focus="handleFocus"
  63. @blur="handleBlur"
  64. @change="handleChange"
  65. :filterOption="filterOption"
  66. >
  67. <a-select-option value="0">请选择目标应用</a-select-option>
  68. <a-select-option v-for="appModel in appList" :key="appModel.appId" :value="appModel.appId">
  69. {{ appModel.appName }}&#12288;&nbsp;&#12288; {{ appModel.appVersion }}&#12288;&#12288;&#12288;{{
  70. appModel.platform | platform
  71. }}
  72. </a-select-option>
  73. </a-select>
  74. <!-- <a @click="addApplication" style="margin-left:10px">刷新应用</a> -->
  75. <a-button type="primary" @click="addApplication" :loading="tongbuLoading"> 刷新应用</a-button>
  76. </a-form-item>
  77. <a-form-item
  78. label="调起链接"
  79. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  80. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  81. v-if="campaignType == '2'||campaignType == '7'"
  82. >
  83. <a-switch default-checked v-model="uriCheck"/>
  84. <span style="color:red"> 需加白使用</span>
  85. <div v-if="uriCheck">
  86. <a-input placeholder="请填写链接" v-decorator="['schemaUri', { rules: [{ message:'链接不能为空'}] }]" />
  87. </div>
  88. </a-form-item>
  89. <a-form-item
  90. label="转化类型"
  91. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  92. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  93. v-if="campaignType == '3'"
  94. >
  95. <a-radio-group
  96. buttonStyle="solid"
  97. v-decorator="['urlType', { rules: [{ required: true, message: '请选择目标应用' }], initialValue: '1' }]"
  98. >
  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-item>
  103. <a-form-item
  104. :label="campaignType == 3 ? ' ' : campaignType == '7'?'H5链接':'链接'"
  105. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  106. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  107. v-if="campaignType == 3||campaignType == 4||campaignType == 5||campaignType == 6||campaignType == 7"
  108. :class="{ 'else-label': campaignType == 3 }"
  109. >
  110. <a-input
  111. placeholder="请填写链接"
  112. v-decorator="['url', { rules: [{ required: true, message: '链接不能为空' }] }]"
  113. />
  114. </a-form-item>
  115. <a-form-item
  116. label="转化目标"
  117. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  118. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  119. v-if="campaignType == 2 || campaignType == 4 || campaignType == 5"
  120. >
  121. <span v-if="convertId && !convert" style="display: block; font-size: 16px"
  122. >已选择转化目标: {{ convertId.label }}</span
  123. >
  124. <a-button type="primary" @click="showConvert">{{ convertId ? '更换转化目标' : '选择转化目标' }}</a-button>
  125. </a-form-item>
  126. <a-modal v-model="convert" title="选择转化目标">
  127. <template slot="footer">
  128. <a-button key="back" @click="convert = false">取消</a-button>
  129. <a-button key="submit" type="primary" @click="convertOk"> 确定 </a-button>
  130. </template>
  131. <a-form-item
  132. label="追踪方式"
  133. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  134. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  135. >
  136. <a-radio-group buttonStyle="solid" v-model="convertType" @change="convertChange">
  137. <a-radio-button value="1" v-show="campaignType == 4 || campaignType == 5">JS布玛</a-radio-button>
  138. <a-radio-button value="2" v-show="campaignType == 4 || campaignType == 5">Xpath</a-radio-button>
  139. <a-radio-button
  140. value="3"
  141. v-show="campaignType == 2 && (getPlatForm(getData('appId')) == 1 || getPlatForm(getData('appId')) == 2)"
  142. >应用-SDK
  143. </a-radio-button>
  144. <a-radio-button value="7" v-show="campaignType == 2">应用-API</a-radio-button>
  145. </a-radio-group>
  146. </a-form-item>
  147. <a-form-item
  148. label="选择转化"
  149. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  150. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  151. >
  152. <a-select allowClear labelInValue style="width: 100%" v-model="convertId" @focus="getConvertList">
  153. <a-select-option :value="item.convert_id" v-for="(item, index) in convertList" :key="item.convert_id">
  154. {{ item.convert_name }}</a-select-option
  155. >
  156. </a-select>
  157. </a-form-item>
  158. </a-modal>
  159. <a-form-item
  160. label=" "
  161. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  162. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  163. class="else-label"
  164. v-if="campaignType == '2' && (getPlatForm(getData('appId')) == '1' || getPlatForm(getData('appId')) == '2')"
  165. >
  166. <a-checkbox
  167. v-decorator="[
  168. 'useAppMarket',
  169. {
  170. valuePropName: 'checked',
  171. initialValue: false,
  172. },
  173. ]"
  174. >
  175. 优先从系统应用商店下载
  176. </a-checkbox>
  177. </a-form-item>
  178. <a-form-item
  179. label=" "
  180. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  181. :wrapperCol="{ lg: { span: 10 }, sm: { span: 16 } }"
  182. class="else-label"
  183. v-if="getData('useAppMarket')&&campaignType == '2' && (getPlatForm(getData('appId')) == '1' || getPlatForm(getData('appId')) == '2')"
  184. >
  185. 请勾选投放应用已上架的应用商店(默认全选)
  186. <a-checkbox-group v-model="allForm.appStore">
  187. <a-checkbox value="huawei">华为</a-checkbox>
  188. <a-checkbox value="oppo">OPPO</a-checkbox>
  189. <a-checkbox value="vivo">VIVO</a-checkbox>
  190. <a-checkbox value="xiaomi">小米</a-checkbox>
  191. <a-checkbox value="meizu">魅族</a-checkbox>
  192. <a-checkbox value="smartisan">锤子</a-checkbox>
  193. </a-checkbox-group>
  194. </a-form-item>
  195. <a-form-item label="投放范围" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  196. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  197. v-if="allianceAccount">
  198. <a-radio-group buttonStyle="solid" v-model="allForm.allianceAccount">
  199. <a-radio-button value="1">默认</a-radio-button>
  200. <a-radio-button value="2">联盟广告</a-radio-button>
  201. </a-radio-group>
  202. </a-form-item>
  203. <a-form-item
  204. label="创建数量"
  205. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  206. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  207. >
  208. <a-input-number
  209. v-decorator="[
  210. 'createCount',
  211. {
  212. rules: [{ required: true, message: '创建数量必填' }],
  213. initialValue: 1,
  214. },
  215. ]"
  216. style="width: 150px"
  217. >
  218. </a-input-number>
  219. </a-form-item>
  220. <div style="text-align: center; font-size: 16px; margin-bottom: 10px">目标人群</div>
  221. <a-form-item
  222. label="选择模板"
  223. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  224. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  225. >
  226. <a-select
  227. v-decorator="['templateId']"
  228. showSearch
  229. allowClear
  230. placeholder="选择定向模板"
  231. optionFilterProp="children"
  232. style="width: 500px"
  233. :filterOption="filterOption"
  234. >
  235. <a-select-option v-for="appModel in templateList" :key="appModel.templateId" :value="appModel.templateId">
  236. {{ appModel.templateName }}
  237. </a-select-option>
  238. </a-select>
  239. <a-button type="primary" @click="getTemplate(null)" :loading="templateLoading"> 刷新模板</a-button>
  240. <br>
  241. <a style="margin: 0 10px 0 0" @click="addTemplate(null)">新增模板</a>
  242. <a
  243. @click="lookTemplate(null, getData('templateId'))"
  244. :disabled="getData('templateId') == '' || getData('templateId') == null"
  245. >查看模板</a
  246. >
  247. </a-form-item>
  248. <div style="text-align: center; font-size: 16px">预算和排期</div>
  249. <a-form-item
  250. label="单日预算"
  251. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  252. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  253. >
  254. <a-radio-group buttonStyle="solid" v-model="allForm.dayBudget">
  255. <a-radio-button value="0">不限</a-radio-button>
  256. <a-radio-button value="1">统一预算</a-radio-button>
  257. </a-radio-group>
  258. </a-form-item>
  259. <a-form-item
  260. label=" "
  261. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  262. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  263. class="else-label"
  264. v-if="allForm.dayBudget == '1'"
  265. >
  266. <a-input
  267. placeholder="不小于100,不超过100000000,仅支持输入自然数"
  268. v-decorator="[
  269. 'dayBudget',
  270. {
  271. rules: [{ required: true, message: '请填写预算' }, { validator: budgetValue }],
  272. },
  273. ]"
  274. />
  275. </a-form-item>
  276. <a-form-item
  277. label="投放方式"
  278. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  279. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  280. >
  281. <a-radio-group buttonStyle="solid" v-decorator="['speed', { initialValue: '1' }]">
  282. <a-radio-button value="1">正常投放</a-radio-button>
  283. <a-radio-button value="2">平滑投放</a-radio-button>
  284. </a-radio-group>
  285. <br />
  286. <span>
  287. {{ getData('speed') == '2' ? '平滑匀速投放' : '尽快展示广告消耗预算' }}
  288. </span>
  289. </a-form-item>
  290. <a-form-item
  291. label="排期"
  292. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  293. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  294. >
  295. <a-radio-group buttonStyle="solid" v-model="allForm.time" @change="setTime">
  296. <a-radio-button value="1">从今天开始长期投放</a-radio-button>
  297. <a-radio-button value="2">设置开始和结束日期</a-radio-button>
  298. </a-radio-group>
  299. <br />
  300. <a-range-picker v-if="allForm.time == '2'" v-model="timeRange" format="YYYY-MM-DD" :allowClear="false" />
  301. </a-form-item>
  302. <a-form-item
  303. label="投放时段"
  304. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  305. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  306. >
  307. <a-radio-group buttonStyle="solid" v-model="allForm.scheduleTime" @change="setTimeAll">
  308. <a-radio-button value="1">全天</a-radio-button>
  309. <a-radio-button value="2">特定时间</a-radio-button>
  310. </a-radio-group>
  311. <br />
  312. <selectCheckAll
  313. style="width: 100%"
  314. v-show="allForm.scheduleTime == '2'"
  315. :scheduleTime.sync="allForm.scheduleTimeData"
  316. ref="selectCheck"
  317. />
  318. </a-form-item>
  319. <a-form-item
  320. label="创意展现方式"
  321. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  322. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  323. >
  324. <a-radio-group buttonStyle="solid" v-decorator="['showMode', { initialValue: '2' }]">
  325. <a-radio-button value="2">智能优选</a-radio-button>
  326. <a-radio-button value="1">随机轮播</a-radio-button>
  327. </a-radio-group>
  328. <br />
  329. <span>
  330. {{
  331. getData('showMode') == '1'
  332. ? '广告组包含的广告创意将随机展现'
  333. : '每一次展现的时候,系统会进行CTR预估,预估CTR高的会得到展现机会'
  334. }}
  335. </span>
  336. </a-form-item>
  337. <a-form-item
  338. label="场景广告位"
  339. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  340. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  341. >
  342. <checkBoxGroup
  343. :options="[
  344. { label: '优选广告位', value: 1 },
  345. { label: '上下滑大屏广告', value: 6 },
  346. { label: '视频播放页广告', value: 3 },
  347. ]"
  348. v-model="allForm.sceneId"
  349. @change="changeData"
  350. />
  351. </a-form-item>
  352. <!-- <a-form-item
  353. label="场景广告位"
  354. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  355. :wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }"
  356. v-if="allForm.allianceAccount == '1'"
  357. >
  358. <a-radio-group buttonStyle="solid" v-decorator="['sceneId', { initialValue: '1' }]">
  359. <a-radio-button value="1">优选广告位</a-radio-button>
  360. <a-radio-button value="2">按场景选择广告位</a-radio-button>
  361. </a-radio-group>
  362. <br />
  363. </a-form-item>
  364. <a-form-item
  365. label=" "
  366. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  367. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  368. class="else-label"
  369. v-if="getData('sceneId') == '2'"
  370. >
  371. <a-checkbox-group :defaultValue="[7]" v-model="allForm.sceneId">
  372. <a-checkbox :value="7">信息流广告</a-checkbox>
  373. <a-checkbox :value="6">上下滑大屏广告</a-checkbox>
  374. <a-checkbox :value="3">视频播放页广告</a-checkbox>
  375. </a-checkbox-group>
  376. </a-form-item> -->
  377. <div style="text-align: center; font-size: 16px">优化目标和计费</div>
  378. <div style="width: 100%" v-for="(item, index) of allForm.group" :key="index">
  379. <div style="clear: both"></div>
  380. <a-form-item
  381. label="优化目标"
  382. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  383. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  384. >
  385. <a-radio-group buttonStyle="solid" v-model="item.bidType" @change="resData(index)">
  386. <a-radio-button :value="1">点击数</a-radio-button>
  387. <a-radio-button :value="10">转化数</a-radio-button>
  388. </a-radio-group>
  389. </a-form-item>
  390. <a-form-item
  391. label="转化目标"
  392. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  393. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  394. v-if="item.bidType == 10"
  395. >
  396. <a-select v-model="item.ocpxActionType">
  397. <a-select-option :value="2">行为数</a-select-option>
  398. <a-select-option :value="180" v-if=" allForm.groupTypeData.isActivate == '1'"
  399. >激活</a-select-option
  400. >
  401. <a-select-option
  402. :value="53"
  403. v-if=" allForm.groupTypeData.isFormSubmit == '1'"
  404. >表单提交</a-select-option
  405. >
  406. <a-select-option :value="394" v-if="allForm.groupTypeData.isOrderSubmit == '1'">订单提交</a-select-option>
  407. <a-select-option :value="348" v-if="allForm.groupTypeData.isValidClue == '1'">使用有效线索</a-select-option>
  408. <a-select-option :value="383" v-if="allForm.groupTypeData.isCreditGrant == '1'">授信出价</a-select-option>
  409. <a-select-option :value="384" v-if="allForm.groupTypeData.isWanJian == '1'">完件出价</a-select-option>
  410. <a-select-option :value="190" v-if="allForm.groupTypeData.isPurchase == '1'">付费出价</a-select-option>
  411. <a-select-option :value="191" v-if="allForm.groupTypeData.isFirstdayRoi == '1'">首日ROI</a-select-option>
  412. <a-select-option :value="396" v-if="allForm.groupTypeData.isRegister == '1'">注册优化目标</a-select-option>
  413. <a-select-option :value="773" v-if="allForm.groupTypeData.isKeyAction == '1'">关键行为</a-select-option>
  414. </a-select>
  415. </a-form-item>
  416. <a-form-item
  417. label="深度转化目标"
  418. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  419. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  420. v-if="
  421. (item.ocpxActionType == 180 || item.ocpxActionType == 53) &&
  422. allForm.groupTypeData.deepConversionTypes.length > 0
  423. "
  424. >
  425. <a-select v-model="item.deepConversionType" allowClear>
  426. <a-select-option
  427. :value="items.deepConversionType"
  428. v-for="(items, index) of allForm.groupTypeData.deepConversionTypes"
  429. :key="index"
  430. >
  431. {{ items.desc }}</a-select-option
  432. >
  433. </a-select>
  434. </a-form-item>
  435. <a-form-item
  436. label="计费方式"
  437. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  438. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  439. >
  440. <a-radio-group defaultValue="1">
  441. <a-radio value="1">{{ item.bidType == 1 ? '点击计费' : '展示计费(oCPM)' }}</a-radio>
  442. </a-radio-group>
  443. </a-form-item>
  444. <a-form-item
  445. label="出价"
  446. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  447. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  448. v-if="item.bidType == 1"
  449. >
  450. <!-- v-model="item.bid" -->
  451. <a-input-number
  452. v-decorator="[
  453. 'bid',
  454. {
  455. rules: [{ required: true, message: '出价必填' }, {validator: bidCheck}],
  456. },
  457. ]"
  458. :style="{ borderColor: item.showTipCheck ? 'red' : '#d9d9d9' }"
  459. style="width: 100%"
  460. >
  461. </a-input-number>
  462. <!-- <span style="color: red" v-if="item.showTipCheck && item.ocpxActionType == 180"
  463. >不得低于0.2元,不得高于项目最高出价{{ maxBid }}元</span
  464. > -->
  465. </a-form-item>
  466. <a-form-item
  467. label="目标成本"
  468. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  469. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  470. v-else
  471. >
  472. <!-- v-model="item.cpaBid" -->
  473. <a-input-number
  474. v-decorator="[
  475. 'cpaBid',
  476. {
  477. rules: [{ required: true, message: '目标成本必填' }, {validator: cpaBidCheck}],
  478. },]"
  479. style="width: 100%"
  480. >
  481. </a-input-number>
  482. <!-- <span style="color: red" v-if="item.showTipCheck">{{
  483. item.bidType == 1
  484. ? '不得低于1元,不得高于项目最高出价' + maxBid + '元'
  485. : '不得低于1元,不得高于项目最高出价' + maxBid + '元'
  486. }}</span> -->
  487. <span
  488. style="color: red; font-weight: 700"
  489. v-if="item.ocpxActionType == 2 && getData('cpaBid') && getData('cpaBid') > 1"
  490. >
  491. 行为出价大于1元,请注意!!!
  492. </span>
  493. </a-form-item>
  494. <a-form-item
  495. label="深度转化出价"
  496. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  497. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  498. v-if="
  499. (item.ocpxActionType == 180 || item.ocpxActionType == 53) &&
  500. allForm.groupTypeData.deepConversionTypes.length > 0 &&
  501. item.deepConversionType != ''
  502. "
  503. >
  504. <a-input-number
  505. v-model="item.deepConversionBid"
  506. @change="deep_conversion_bidTip(index)"
  507. :style="{ borderColor: item.deepConversionBidCheck ? 'red' : '#d9d9d9' }"
  508. style="width: 100%"
  509. :disabled="getData('cpaBid')==null||getData('cpaBid') == ''"
  510. ></a-input-number>
  511. <span style="color: red" v-if="item.deepConversionBidCheck"
  512. >深度转化目标成本必须高于优化目标成本</span
  513. >
  514. </a-form-item>
  515. <a-form-item
  516. label="广告组名称"
  517. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  518. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  519. >
  520. <!-- v-model="item.unitName" -->
  521. <a-input v-decorator="[
  522. 'unitName',
  523. {
  524. rules: [{ required: true, message: '广告组必填' }, {validator: handleConfirmValue}],
  525. },]" @change="checkGroup($event, index)" id="unitName"></a-input>
  526. <span style="color: red" v-if="item.unitNameCheck">广告组名称重复</span>
  527. <a-tag color="#2db7f5" @click="getChangeAll('序号', 'form', 'unitName')">+序号</a-tag>
  528. </a-form-item>
  529. <a-form-item
  530. v-if="showNumber"
  531. label="序号开始值"
  532. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  533. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  534. >
  535. <a-input-number
  536. :min="0"
  537. v-decorator="[
  538. 'startNumber',
  539. {
  540. rules: [{ required: true, message: '序号开始值必填' }],
  541. initialValue: 0,
  542. },
  543. ]"
  544. style="width: 150px"
  545. >
  546. </a-input-number>
  547. </a-form-item>
  548. </div>
  549. <div style="text-align: center; font-size: 16px">创意素材</div>
  550. <a-form-item
  551. label="素材类型"
  552. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  553. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  554. >
  555. <a-radio-group
  556. buttonStyle="solid"
  557. v-decorator="['creativeMaterialType', { initialValue: '1' }]"
  558. @change="changeType()"
  559. >
  560. <a-radio-button value="1">竖版视频</a-radio-button>
  561. <a-radio-button value="2">横版视频</a-radio-button>
  562. <!-- <a-radio-button value="4" v-if="JSON.parse(pane.sceneId).indexOf(7)>0">便利贴创意</a-radio-button> -->
  563. </a-radio-group>
  564. </a-form-item>
  565. <a-form-item
  566. label="创意标题"
  567. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  568. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  569. >
  570. <a-input
  571. v-decorator="[
  572. 'creativeName',
  573. {
  574. rules: [{ required: true, message: '创意标题必填' }],
  575. initialValue: '自定义创意_竖版视频',
  576. },
  577. ]"
  578. ></a-input>
  579. </a-form-item>
  580. <a-form-item
  581. label="创建类型"
  582. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  583. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  584. v-if="getData('unitType')=='4'"
  585. >
  586. <a-radio-group
  587. buttonStyle="solid"
  588. v-decorator="['createType', { rules: [{ required: true, message: '请选择目标应用' }], initialValue: '0' }]"
  589. @change="getPageSize"
  590. >
  591. <a-radio-button value="0">单品</a-radio-button>
  592. <a-radio-button value="1">混搭</a-radio-button>
  593. </a-radio-group>
  594. </a-form-item>
  595. <a-form-item
  596. v-if="getData('unitType')=='7' || getData('createType')!='1'"
  597. :label="getData('unitType')=='7'?'视频数':'封面数'"
  598. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  599. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  600. >
  601. <a-input-number
  602. :max="getData('unitType')=='7'?10:15"
  603. :min="getData('unitType')=='7'?3:1"
  604. v-decorator="[
  605. 'imageCount',
  606. {
  607. rules: [{ required: true, message: '数量必填必填' }],
  608. initialValue: 5,
  609. },
  610. ]"
  611. style="width: 150px"
  612. >
  613. </a-input-number>
  614. </a-form-item>
  615. <a-form-item
  616. label="选择视频"
  617. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  618. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  619. >
  620. <a @click="getVideoList()">选择视频</a>
  621. {{ videoList.length + '/' + (getData('unitType')=='4'
  622. ?(getData('createType')=='0'?
  623. getData('createCount'):getData('createCount')*15)
  624. :getData('createCount')*getData('imageCount')) }}
  625. <br />
  626. <div v-if="videoList.length > 0 && showVideo" style="display:flex;flex-wrap:wrap">
  627. <span v-for="(item, index) of videoList" :key="index" style="position: relative" class="width-video">
  628. <a-icon type="close-circle" @click="deleteData(index, item)" style="position: absolute;right:0;color:red" />
  629. <img :src="item.coverUrl" controls="controls" style="width:100%" @click="matemalVideo(item)"></img>
  630. </span>
  631. </div>
  632. </a-form-item>
  633. <a-form-item
  634. label="广告语"
  635. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  636. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  637. >
  638. <!-- v-model.trim="allForm.description" -->
  639. <!-- @keyup="getData('description')?getData('description')=this.value.replace(/^ +| +$/g,'')" -->
  640. <!-- <a @click="showTitle()">推荐广告语</a> -->
  641. <div style="position:relative" v-for="(item, index) in descriptionList" :key="index">
  642. <a-textarea
  643. class="rending"
  644. placeholder="请输入广告语"
  645. @change="descriptionchange(item.value, index)"
  646. v-model="item.value"
  647. :autosize="{ minRows: 2, maxRows: 6 }"
  648. :max-length="30"
  649. style=" width: 80%;"
  650. ></a-textarea>
  651. <p
  652. style="
  653. font-size: 12px;
  654. color: #b6bbc7;
  655. letter-spacing: 0.3px;
  656. text-align: right;
  657. line-height: 30px;
  658. position: absolute;
  659. bottom: 0;
  660. left: 0;
  661. width: 80%;
  662. margin-bottom: 0;
  663. "
  664. >
  665. {{ item.value.length }}/30
  666. <!-- {{ getFormData('description').length }}/30 -->
  667. </p>
  668. <div style="position:absolute;right:0;top:-10px">
  669. <a-icon
  670. type="plus"
  671. @click="addDescription()"
  672. style="margin-right:15px"
  673. v-if="descriptionList.length < 10"
  674. />
  675. <a-icon
  676. type="minus"
  677. @click="removeDescription(index)"
  678. v-if="descriptionList.length > 1"
  679. />
  680. </div>
  681. </div>
  682. <a @click="cunTitle()">收藏</a>
  683. <a @click="showCunTitle()" style="margin-left: 10px">收藏列表</a>
  684. <!--
  685. <br />
  686. <a-tag v-for="(itemTag, indexTag) of tags" :key="indexTag" @click="getChange(item, itemTag, index)">{{
  687. itemTag.name
  688. }}</a-tag> -->
  689. </a-form-item>
  690. <a-form-item label="下载详情" v-if="showSite" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  691. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }">
  692. <a-select
  693. v-decorator="['siteId']"
  694. showSearch
  695. allowClear
  696. placeholder="选择应用下载详情页"
  697. optionFilterProp="children"
  698. :filterOption="filterOption"
  699. >
  700. <a-select-option v-for="appModel in siteList" :key="appModel.siteId" :value="appModel.siteId">
  701. {{ appModel.name }}
  702. </a-select-option>
  703. </a-select>
  704. </a-form-item>
  705. <a-form-item
  706. label="创意分类"
  707. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  708. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  709. v-if="creativeCategorySwitch"
  710. >
  711. <a-cascader
  712. :options="createOptions"
  713. v-decorator="['creativeCategory',{ rules: [{ required: true, message: '创意分类必选' }] }]"
  714. :fieldNames="fieldNames"
  715. placeholder="请选择创意分类"
  716. />
  717. </a-form-item>
  718. <a-form-item
  719. label="创意标签"
  720. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  721. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  722. v-if="creativeCategorySwitch"
  723. >
  724. <a-select
  725. mode="tags"
  726. style="width: 100%"
  727. placeholder="按回车生成标签"
  728. v-decorator="['creativeTag',{ rules: [{ required: true, message: '创意标签必填' }] }]"
  729. dropdownClassName="display-none-selset"
  730. :token-separators="[',', ' ', ',']"
  731. >
  732. </a-select>
  733. <span v-if="getData('creativeTag') && getData('creativeTag').length > 10" style="color: red"
  734. >创意标签最多填写10个,请删减</span>
  735. <br />
  736. <a-popconfirm @confirm="getInfo()">
  737. <div slot="title">
  738. <div>
  739. 分类名称:
  740. <a-input placeholder="请输入" v-model="tagName" style="display: inline-block; width: 300px" />
  741. </div>
  742. </div>
  743. <a style="margin-right: 10px" :disabled="!getData('creativeTag')">收藏</a>
  744. </a-popconfirm>
  745. <a @click="showCunTag('creativeTag')">收藏列表</a>
  746. </a-form-item>
  747. <a-form-item
  748. label="行动号召"
  749. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  750. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  751. >
  752. <a-select
  753. v-decorator="['actionBarText', { rules: [{ required: true, message: '行动号召按钮文案' }] }]"
  754. showSearch
  755. allowClear
  756. placeholder="选择行动号召按钮文案"
  757. optionFilterProp="children"
  758. :filterOption="filterOption"
  759. >
  760. <a-select-option v-for="appModel in actionBarTextList" :key="appModel.id" :value="appModel.actionBarText">
  761. {{ appModel.actionBarText }}
  762. </a-select-option>
  763. </a-select>
  764. </a-form-item>
  765. <a-form-item
  766. label="下载详情"
  767. v-if="showSite"
  768. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  769. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  770. >
  771. <a-select
  772. v-decorator="['siteId']"
  773. showSearch
  774. allowClear
  775. placeholder="选择应用下载详情页"
  776. optionFilterProp="children"
  777. :filterOption="filterOption"
  778. >
  779. <a-select-option v-for="appModel in siteList" :key="appModel.siteId" :value="appModel.siteId">
  780. {{ appModel.name }}
  781. </a-select-option>
  782. </a-select>
  783. </a-form-item>
  784. <a-form-item
  785. label="第三方点击监测链接"
  786. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  787. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  788. >
  789. <a-input v-decorator="['clickTrackUrl']" placeholder="请输入第三方检测链接"> </a-input>
  790. <a
  791. v-if="getData('clickTrackUrl')"
  792. @click="
  793. clickTrackUrlShow = true
  794. clickTrackUrlShowType == '1'
  795. "
  796. style="margin-right: 10px"
  797. >收藏监测链接</a
  798. >
  799. <a
  800. @click="
  801. getClickTrackUrlList('1')
  802. clickTrackUrlShowType = '1'
  803. "
  804. >监测链接列表</a
  805. >
  806. </a-form-item>
  807. <a-form-item
  808. label="第三方ActionBar点击监控链接"
  809. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  810. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  811. v-if="actionbarClickUrlSwitch"
  812. >
  813. <a-input v-decorator="['actionbarClickUrl']" placeholder="请输入第三方点击监控链接"> </a-input>
  814. <span style="color: red; position: relative; top: -10px">仅加白使用</span>
  815. <br />
  816. <a
  817. v-if="getData('actionbarClickUrl')"
  818. @click="
  819. clickTrackUrlShow = true
  820. clickTrackUrlShowType = '2'
  821. "
  822. style="margin-right: 10px; position: relative; top: -20px"
  823. >收藏监测链接</a
  824. >
  825. <a
  826. @click="
  827. getClickTrackUrlList('2')
  828. clickTrackUrlShowType = '2'
  829. "
  830. style="margin-right: 10px; position: relative; top: -20px"
  831. >监测链接列表</a
  832. >
  833. </a-form-item>
  834. <a-form-item :wrapperCol="{ span: 20 }" style="text-align: center">
  835. <a-button htmlType="submit" type="primary" :loading="loading">确定</a-button>
  836. <!-- <a-button style="margin-left: 8px" @click="prevStep" v-show="step == 1">上一步</a-button> -->
  837. </a-form-item>
  838. </a-form>
  839. <a-modal v-model="visible" title="广告组创建信息">
  840. <div>创建成功:{{ allForm.success }}条</div>
  841. <template slot="footer">
  842. <a-button key="submit" type="primary" @click="handleOk"> 返回列表 </a-button>
  843. </template>
  844. </a-modal>
  845. <templateModal ref="templateModal" @getData="getTemplateList" />
  846. <a-modal title="查看视频" v-model="visibleVideo" :width="400" :footer="null">
  847. <video class="video" :src="videoUrlShow" controls="controls" style="width: 100%">
  848. 您的浏览器不支持 video 标签。
  849. </video>
  850. </a-modal>
  851. <a-modal
  852. :maskClosable="false"
  853. title="选择素材"
  854. v-model="visibleMatemal"
  855. @ok="handleOkShow"
  856. @cancel="cancelAll"
  857. :width="1000"
  858. >
  859. <a-row :gutter="24">
  860. <a-col :span="8">
  861. <a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
  862. <a-radio-group v-model="mediaDimension" style="width: 300px">
  863. <a-radio-button value="a">按时间查询</a-radio-button>
  864. <a-radio-button value="b">按消耗查询</a-radio-button>
  865. </a-radio-group>
  866. </a-form-item>
  867. </a-col>
  868. <a-col :span="8" v-if="mediaDimension == 'a'">
  869. <a-form-item label="日期选择" :labelCol="labelCol" :wrapperCol="wrapperCol">
  870. <a-range-picker name="buildTime" v-model="time" />
  871. </a-form-item>
  872. </a-col>
  873. <a-col :span="8" v-else>
  874. <a-form-item label="消耗时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
  875. <a-select v-model="costType" placeholder="请选择消耗时间" style="width: 100%">
  876. <a-select-option :value="1">昨天</a-select-option>
  877. <a-select-option :value="2">近七天</a-select-option>
  878. <a-select-option :value="3">近14天</a-select-option>
  879. <a-select-option :value="4">近一个月</a-select-option>
  880. <a-select-option :value="5">近三个月</a-select-option>
  881. <a-select-option :value="6">近半年</a-select-option>
  882. <a-select-option :value="7">近一年</a-select-option>
  883. <a-select-option :value="8">全部</a-select-option>
  884. </a-select>
  885. </a-form-item>
  886. </a-col>
  887. <a-col :span="8">
  888. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
  889. 当前选择数量
  890. {{ sumContent + '/' + (getData('unitType')=='4'?(getData('createType')=='0'?getData('createCount'):getData('createCount')*15):getData('createCount')*getData('imageCount') )}}
  891. <a-button type="primary" @click="tongbu()" :loading="tongbuLoading" style="margin-left:10px" v-if="mediaDimension == 'a'">
  892. 刷新素材</a-button>
  893. </a-form-item>
  894. </a-col>
  895. </a-row>
  896. <a-row :gutter="24">
  897. <a-col :span="8">
  898. <a-form-item label="视频ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
  899. <a-input placeholder="请输入视频ID" v-model="photoId"/>
  900. </a-form-item>
  901. </a-col>
  902. <a-col :span="8">
  903. <a-form-item label="视频名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
  904. <a-input placeholder="请输入视频名称" v-model="photoName"/>
  905. </a-form-item>
  906. </a-col>
  907. <!-- <a-col :span="8" v-if="mediaDimension == 'a'">
  908. <a-form-item label="唯一标识" :labelCol="labelCol" :wrapperCol="wrapperCol">
  909. <a-input placeholder="请输入唯一标识,多个以,隔开" v-model="md5Str"/>
  910. </a-form-item>
  911. </a-col> -->
  912. <a-col :span="4">
  913. <a-button style="position: relative;top: 4px;" @click="selectAllVideo">
  914. 全选
  915. </a-button>
  916. <a-button type="primary" style="position: relative;top: 4px;margin-left:5px" @click="searchVideo">
  917. 搜索
  918. </a-button>
  919. </a-col>
  920. <!-- <a-col :span="12">
  921. <a-form-item label="筛选条件" :labelCol="labelCol" :wrapperCol="wrapperCol">
  922. <a-select v-model="orderBy" style="width: 100%">
  923. <a-select-option value="time"> 按时间排序 </a-select-option>
  924. <a-select-option value="cost"> 按消耗排序</a-select-option>
  925. </a-select>
  926. </a-form-item>
  927. </a-col> -->
  928. </a-row>
  929. <ul v-if="dataSource.length > 0" style="overflow: auto; padding-left: 0">
  930. <a-checkbox-group v-model="checkVideo" style="width: 100%" @change="setData">
  931. <li v-for="(item, index) of dataSource" :key="index" class="chouzhen" style="height: 400px">
  932. <!-- <video class="video" :src="item.url" controls="controls" style="width:100%">
  933. 您的浏览器不支持 video 标签。
  934. </video> -->
  935. <a-checkbox
  936. :value="item.photoId"
  937. style="width: 100%; position: absolute; z-index: 100; right: 0; top: 0; max-height: 80%;overflow: hidden;"
  938. >
  939. <img :src="item.coverUrl" alt="" style="width: 90%; margin-bottom: 30px" />
  940. </a-checkbox>
  941. <div style="position: absolute; z-index: 100; bottom: 35px;width:100%;left:0">
  942. <div style="width: 100%; text-align: center">
  943. {{ item.statDate&&item.channelType == 0 ?
  944. '内部 ' + item.statDate.split(' ')[0]:item.statDate&&item.channelType == 1 ?
  945. '素造 ' + item.statDate.split(' ')[0]: item.charge&&item.channelType == 0?
  946. '内部 ' + item.charge :'素造 ' + item.charge}}
  947. </div>
  948. </div>
  949. <a @click="matemalVideo(item, index)" style="position: absolute; z-index: 100; right: 0; bottom: 5px;width:100%;text-align:center"
  950. >查看视频</a
  951. >
  952. </li>
  953. </a-checkbox-group>
  954. </ul>
  955. <div v-else style="width: 100%; height: 400px; display: flex; justify-content: center; align-items: center">
  956. <img
  957. src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
  958. alt=""
  959. v-if="!loadingVideoList"
  960. />
  961. <img v-else src="@/views/modules/material/loading.gif" />
  962. </div>
  963. <!-- <a-button slot="tabBarExtraContent" type="primary" @click="tongbu()" :loading="tongbuLoading">
  964. 刷新素材</a-button
  965. > -->
  966. </a-tabs>
  967. <div style="text-align: right">
  968. <a-pagination
  969. size="small"
  970. :showTotal="ipagination.showTotal"
  971. style="float: right"
  972. v-if="dataSource.length > 0"
  973. showQuickJumper
  974. :pageSize.sync="ipagination.pageSize"
  975. :total="ipagination.total"
  976. v-model="ipagination.current"
  977. @change="getDataSource"
  978. />
  979. </div>
  980. </a-modal>
  981. <a-modal title="监测链接名称" v-model="clickTrackUrlShow">
  982. <template slot="footer">
  983. <a-button
  984. key="submit"
  985. :disabled="trackUrlName == '' && !showTrackUrlNameElse"
  986. type="primary"
  987. @click="clickTrackUrlOk"
  988. >
  989. 确定
  990. </a-button>
  991. </template>
  992. <a-input placeholder="请输入监测链接名称" v-model="trackUrlName" @blur="changeTrackUrlName" style="width: 100%" />
  993. <span style="color: red" v-if="!showTrackUrlNameElse">名称重复</span>
  994. </a-modal>
  995. <a-modal title="监测链接列表" v-model="clickTrackUrlList" :width="1000" :footer="null">
  996. <a-spin :spinning="spinning">
  997. <a-row :gutter="10" class="onlny-click-track">
  998. <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
  999. <a-card class="search-box" style="over-flow: auto">
  1000. <!-- <a-input v-model="trackName"></a-input> -->
  1001. <a-input-search
  1002. placeholder="请输入监测链接名称"
  1003. enter-button="Search"
  1004. size="large"
  1005. @search="onSearch"
  1006. style="width: 40%; margin-bottom: 20px"
  1007. v-model="trackName"
  1008. />
  1009. <a-list size="large" bordered :dataSource="trackUrlList">
  1010. <a-list-item slot="renderItem" slot-scope="item" :title="item.trackUrl" style="line-height: 50px">
  1011. <div slot="actions">
  1012. <a @click="okClickTrackUrl(item)">选择</a>
  1013. <a-divider type="vertical" />
  1014. <a @click="removeClickTrackUrl(item)">删除</a>
  1015. </div>
  1016. {{ item.trackName }}
  1017. <a-input v-model="item.trackUrl" readOnly style="margin: 10px; width: 70%"></a-input>
  1018. </a-list-item>
  1019. </a-list>
  1020. </a-card>
  1021. </a-col>
  1022. </a-row>
  1023. </a-spin>
  1024. </a-modal>
  1025. <a-modal title="收藏标题" v-model="creativeTagVisible" :width="1000" @ok="okTag">
  1026. <el-tree :data="optionsTag" show-checkbox node-key="id" :props="defaultProps" :check-strictly="true" ref="tree">
  1027. </el-tree>
  1028. </a-modal>
  1029. <a-modal title="推荐标题" v-model="titleVisible" :width="1000" :footer="null">
  1030. <a-row :gutter="10">
  1031. <a-col :sm="10" style="margin-bottom: 20px; z-index: 10">
  1032. <a-card class="search-box" style="min-height: 500px">
  1033. <div style="margin-bottom: 30px">
  1034. <span style="display: inline-block; width: 80px">行业</span>
  1035. <a-cascader
  1036. style="margin-top: 1rem; width: 300px"
  1037. v-model="dataOne"
  1038. :options="options"
  1039. :showSearch="{ filter }"
  1040. expandTrigger="hover"
  1041. @change="onChangeTitle"
  1042. placeholder="请选择行业"
  1043. >
  1044. <a-icon type="smile" slot="suffixIcon" class="test" />
  1045. </a-cascader>
  1046. </div>
  1047. <div style="margin-bottom: 30px">
  1048. <span style="display: inline-block; width: 80px">关键词</span>
  1049. <a-input placeholder="请输入关键词" v-model="value" style="width: 300px" />
  1050. </div>
  1051. <span style="display: inline-block; width: 80px; float: left"></span>
  1052. <a-button type="primary" @click="searchQuery" :disabled="value == ''">生成</a-button>
  1053. </a-card>
  1054. </a-col>
  1055. <a-col :sm="14" style="margin-bottom: 20px; z-index: 10">
  1056. <a-card class="search-box" style="over-flow: auto">
  1057. <a-list size="large" bordered :dataSource="title">
  1058. <a-list-item slot="renderItem" slot-scope="item">
  1059. <a slot="actions" @click="okTitle(item)">选择</a>
  1060. {{ item }}
  1061. </a-list-item>
  1062. </a-list>
  1063. </a-card>
  1064. </a-col>
  1065. </a-row>
  1066. </a-modal>
  1067. <a-modal title="收藏标题" v-model="cunTitleVisible" :width="1000" :footer="null">
  1068. <a-row :gutter="10">
  1069. <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
  1070. <a-card class="search-box" style="over-flow: auto">
  1071. <a-list size="large" bordered :dataSource="cunTitleList">
  1072. <a-list-item slot="renderItem" slot-scope="item">
  1073. <div slot="actions">
  1074. <a @click="okTitleCun(item)">选择</a>
  1075. <a-divider type="vertical" />
  1076. <a @click="removeTitleCun(item)">删除</a>
  1077. </div>
  1078. {{ item.title }}
  1079. </a-list-item>
  1080. </a-list>
  1081. </a-card>
  1082. </a-col>
  1083. </a-row>
  1084. </a-modal>
  1085. </a-card>
  1086. </template>
  1087. <script>
  1088. import { getAction, postAction, deleteAction } from '@/api/manage'
  1089. import moment from 'moment'
  1090. import { mapGetters } from 'vuex'
  1091. import jq from 'jquery'
  1092. import selectCheckAll from '@/views/modules/kuaishouapp/account/stepForm/stepModule/test'
  1093. import templateModal from '@/views/modules/kuaishouapp/crossAccount/templateModal'
  1094. import checkBoxGroup from '@/components/formComponents/checkBoxGroup'
  1095. let dateQuantumRangeConst = ''
  1096. const columns = [
  1097. {
  1098. title: '人群',
  1099. dataIndex: 'orientationName',
  1100. scopedSlots: {
  1101. customRender: 'orientationName',
  1102. },
  1103. width: 150,
  1104. },
  1105. {
  1106. title: '属性',
  1107. dataIndex: 'populationType',
  1108. filters: [
  1109. {
  1110. text: '上传人群',
  1111. value: '1',
  1112. },
  1113. {
  1114. text: '广告人群',
  1115. value: '2',
  1116. },
  1117. {
  1118. text: '主题专区',
  1119. value: '3',
  1120. },
  1121. {
  1122. text: '逻辑规则',
  1123. value: '4',
  1124. },
  1125. {
  1126. text: '人群扩展',
  1127. value: '5',
  1128. },
  1129. {
  1130. text: '平台定制',
  1131. value: '6',
  1132. },
  1133. {
  1134. text: '定制付费',
  1135. value: '7',
  1136. },
  1137. {
  1138. text: '网红粉丝类别',
  1139. value: '8',
  1140. },
  1141. {
  1142. text: '内容付费行为',
  1143. value: '9',
  1144. },
  1145. {
  1146. text: '移动应用安装',
  1147. value: '10',
  1148. },
  1149. {
  1150. text: '快手使用活跃度',
  1151. value: '11',
  1152. },
  1153. {
  1154. text: '行业分类',
  1155. value: '12',
  1156. },
  1157. {
  1158. text: '商业兴趣',
  1159. value: '13',
  1160. },
  1161. {
  1162. text: '固化标签',
  1163. value: '14',
  1164. },
  1165. {
  1166. text: '行业偏好',
  1167. value: '15',
  1168. },
  1169. {
  1170. text: '第三方标签',
  1171. value: '16',
  1172. },
  1173. {
  1174. text: '产品关键词',
  1175. value: '17',
  1176. },
  1177. ],
  1178. onFilter: (value, record) => record.populationType.toString().toLowerCase().includes(value.toLowerCase()),
  1179. scopedSlots: {
  1180. customRender: 'populationType',
  1181. },
  1182. width: 150,
  1183. },
  1184. {
  1185. title: '创建时间',
  1186. dataIndex: 'createTime',
  1187. scopedSlots: {
  1188. customRender: 'createTime',
  1189. },
  1190. sorter: (a, b) => a.createTime - b.createTime,
  1191. },
  1192. ]
  1193. function tqFun(qcArr1) {
  1194. var tempArr = []
  1195. function bbFun(qcArr) {
  1196. for (var i = 0; i < qcArr.length; i++) {
  1197. if (qcArr[i] instanceof Array) {
  1198. bbFun(qcArr[i])
  1199. } else {
  1200. tempArr.push(qcArr[i])
  1201. }
  1202. }
  1203. return tempArr
  1204. }
  1205. return bbFun(qcArr1)
  1206. }
  1207. export default {
  1208. name: 'creat-unit',
  1209. components: {
  1210. selectCheckAll,
  1211. templateModal,
  1212. checkBoxGroup,
  1213. },
  1214. props: {
  1215. campaignId: {
  1216. type: String,
  1217. default() {
  1218. return null
  1219. },
  1220. },
  1221. },
  1222. data() {
  1223. return {
  1224. descriptionList: [{value:''}],
  1225. showNumber:false,
  1226. md5Str:'',
  1227. photoId:'',
  1228. photoName:'',
  1229. costType: 1,
  1230. uriCheck: false,
  1231. templateLoading: false,
  1232. dataOne: [],
  1233. actionBarTextList: [],
  1234. trackName: '',
  1235. trackUrlList: [],
  1236. showSite: false,
  1237. appList: [],
  1238. siteList: [],
  1239. createOptions: [],
  1240. fieldNames: {
  1241. label: 'category_name',
  1242. value: 'category_id',
  1243. children: 'child',
  1244. },
  1245. defaultProps: {
  1246. children: 'children',
  1247. label: 'label',
  1248. id: 'id',
  1249. },
  1250. showTrackUrlNameElse: true,
  1251. clickTrackUrlList: false,
  1252. spinning: false,
  1253. trackUrlName: '',
  1254. tagName: '',
  1255. labelCol: {
  1256. lg: {
  1257. span: 6,
  1258. },
  1259. sm: {
  1260. span: 6,
  1261. },
  1262. xs: {
  1263. span: 6,
  1264. },
  1265. md: {
  1266. span: 6,
  1267. },
  1268. },
  1269. wrapperCol: {
  1270. lg: {
  1271. span: 18,
  1272. },
  1273. sm: {
  1274. span: 18,
  1275. },
  1276. xs: {
  1277. span: 14,
  1278. },
  1279. md: {
  1280. span: 14,
  1281. },
  1282. },
  1283. ipagination: {
  1284. current: 1,
  1285. pageSize: 10,
  1286. // pageSizeOptions: ['10', '20', '30'],
  1287. showTotal: (total, range) => {
  1288. return range[0] + '-' + range[1] + ' 共' + total + '条'
  1289. },
  1290. showQuickJumper: true,
  1291. // showSizeChanger: true,
  1292. total: 0,
  1293. onChange: (current) => {
  1294. // 切换分页时的回调,
  1295. // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
  1296. this.ipagination.current = current
  1297. },
  1298. },
  1299. showVideo: true,
  1300. videoList: [],
  1301. orderBy: 'time',
  1302. mediaDimension: 'a',
  1303. visibleMatemal: false,
  1304. loadingVideoList: false,
  1305. checkVideo: [],
  1306. checkVideoAll: [],
  1307. checkVideoWai: [],
  1308. checkVideoWhole: [],
  1309. dataSource: [],
  1310. active: 0,
  1311. time: [],
  1312. channelType: 0,
  1313. creativeMaterialType: '',
  1314. tab: [
  1315. // {
  1316. // value: 2,
  1317. // label: '全部',
  1318. // },
  1319. {
  1320. value: 0,
  1321. label: '内部',
  1322. },
  1323. {
  1324. value: 1,
  1325. label: '外部',
  1326. },
  1327. ],
  1328. templateList: [],
  1329. allianceAccount: false,
  1330. creativeCategorySwitch: false,
  1331. actionbarClickUrlSwitch: false,
  1332. tongbuLoading: false,
  1333. convert: false,
  1334. convertId: '',
  1335. convertList: [],
  1336. checkedTrue: false,
  1337. nameValue: '',
  1338. visible: false,
  1339. timeRange: [],
  1340. form: this.$form.createForm(this),
  1341. step: 0,
  1342. people: '2',
  1343. targeted: '2',
  1344. topMiddle: false,
  1345. topMiddleNo: false,
  1346. keyValue: '',
  1347. keyValueNo: '',
  1348. columns,
  1349. selectedRowKeys: [],
  1350. selectedRowKeysValue: [],
  1351. selectedRowKeysNo: [],
  1352. selectedRowKeysValueNo: [],
  1353. data: [],
  1354. populationData: {},
  1355. url: {
  1356. insertTemplateUrl: '/kuaishou/create/createGroups',
  1357. userAllocationList: '/ctop/userAllocation/list',
  1358. campaignList: '/kuaishou/kuaiShouCampaignTemplate/list',
  1359. getDeepConversionUrl: '/kuaishou/kuaiShouConversionTypes/getIsActivate',
  1360. getCampaignTemplate: '/kuaishou/kuaiShouCampaignTemplate/getKuaiShouCampaignTemplate',
  1361. appListUrl: '/kuaishou/kuaiShouCreateAppTemplate/list',
  1362. },
  1363. appList: [],
  1364. appId: '',
  1365. loading: false,
  1366. campaignTemplateId: '',
  1367. campaignType: null,
  1368. maxBid: 0,
  1369. allForm: {
  1370. dayBudget: '0',
  1371. time: '1',
  1372. scheduleTime: '1',
  1373. scheduleTimeData:
  1374. '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  1375. group: [],
  1376. groupTypeData: null,
  1377. fail: [],
  1378. success: [],
  1379. sceneId: [1],
  1380. appStore: ['huawei', 'oppo', 'vivo', 'xiaomi', 'meizu', 'smartisan'],
  1381. allianceAccount: '1',
  1382. description: '',
  1383. },
  1384. convertType: '1',
  1385. convertAllList: [],
  1386. dataList: [],
  1387. clickTrackUrlShow: false,
  1388. clickTrackUrlShowType: '1',
  1389. optionsTag: [],
  1390. creativeTagVisible: false,
  1391. visibleVideo: false,
  1392. videoUrlShow: '',
  1393. sumContent: 0,
  1394. titleVisible: false,
  1395. options: [],
  1396. value: '',
  1397. title: [],
  1398. cunTitleVisible: false,
  1399. cunTitleList: [],
  1400. createCount: 0,
  1401. tongbuLoading: false,
  1402. }
  1403. },
  1404. computed: {
  1405. count() {
  1406. return moment().startOf('day')
  1407. },
  1408. },
  1409. filters: {
  1410. getDate(value) {
  1411. let date = new Date(value)
  1412. let y = date.getFullYear()
  1413. let MM = date.getMonth() + 1
  1414. MM = MM < 10 ? '0' + MM : MM
  1415. let d = date.getDate()
  1416. d = d < 10 ? '0' + d : d
  1417. return y + '-' + MM + '-' + d
  1418. },
  1419. platform(str) {
  1420. var data = {
  1421. 1: 'Android应用下载',
  1422. 2: 'Android网页游戏',
  1423. 3: 'iOS应用下载',
  1424. 4: 'iOS网页游戏',
  1425. }
  1426. return data[str]
  1427. },
  1428. },
  1429. methods: {
  1430. descriptionchange(val, index) {
  1431. this.$nextTick(() => {
  1432. this.descriptionList[index].value = val.replace(/\s*/g, '').trim()
  1433. })
  1434. },
  1435. addDescription() {
  1436. this.descriptionList.push({ value: '' })
  1437. },
  1438. removeDescription(index) {
  1439. this.descriptionList.splice(index, 1)
  1440. },
  1441. searchVideo() {
  1442. let url = '/kuaishou/kuaiShouVideoGet/getBatchV2VideoList'
  1443. let params = {}
  1444. // localStorage.getItem('campaignAccountId')
  1445. params.accountId = localStorage.getItem('campaignAccountId')
  1446. params.pageSize = this.ipagination.pageSize
  1447. params.pageNo = this.ipagination.current
  1448. params.status = 0
  1449. params.photoId = this.photoId
  1450. params.photoName = this.photoName
  1451. params.materialType =this.creativeMaterialType
  1452. if(this.mediaDimension == 'a'){
  1453. url = '/kuaishou/kuaiShouVideoGet/getBatchV2VideoList'
  1454. // params.signatures = this.md5Str
  1455. if (this.time.length > 0) {
  1456. // params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
  1457. // params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
  1458. params.startDate = moment(this.time[0]).format('YYYY-MM-DD') + ' 00:00:00'
  1459. params.endDate = moment(this.time[1]).format('YYYY-MM-DD') + ' 23:59:59'
  1460. }
  1461. }else if(this.mediaDimension == 'b'){
  1462. url = '/kuaishou/kuaiShouVideoGet/getVideoListByCostType'
  1463. params.costType = this.costType
  1464. }
  1465. // params.materialType = this.creativeMaterialType
  1466. // params.channelType = this.channelType
  1467. // params.orderBy = this.orderBy
  1468. this.showVideoList(url, params)
  1469. },
  1470. tongbu() {
  1471. this.tongbuLoading = true
  1472. getAction('/kuaishou/batch/syncVideo', {
  1473. accountId: localStorage.getItem('campaignAccountId'),
  1474. }).then((res) => {
  1475. if (res.success) {
  1476. this.$message.success(res.message)
  1477. this.tongbuLoading = false
  1478. this.searchVideo()
  1479. } else {
  1480. this.$message.error(res.message)
  1481. this.tongbuLoading = false
  1482. }
  1483. })
  1484. },
  1485. removeTitleCun(item) {
  1486. deleteAction('/kuaishou/kuaiShouTitleCollection/delete', {
  1487. id: item.id,
  1488. }).then((res) => {
  1489. if (res.success) {
  1490. this.getCunTitle()
  1491. }
  1492. })
  1493. },
  1494. okTitleCun(item) {
  1495. this.allForm.description = item.title
  1496. // this.form.setFieldsValue({
  1497. // description: item.title,
  1498. // })
  1499. if (this.descriptionList[0].value == '') {
  1500. this.descriptionList = [{value:item.title}]
  1501. } else {
  1502. for (let index = 0; index < this.descriptionList.length; index++) {
  1503. if (this.descriptionList[index].value == '') {
  1504. this.descriptionList.splice(index, 1)
  1505. }
  1506. }
  1507. if(this.descriptionList.length<=9){
  1508. this.descriptionList.push({value:item.title})
  1509. }
  1510. }
  1511. this.cunTitleVisible = false
  1512. this.cunTitleList = []
  1513. },
  1514. cunTitle() {
  1515. let isNotComplete = this.descriptionList.findIndex(item => {
  1516. return item.value === ''
  1517. })
  1518. if (isNotComplete > -1) {
  1519. this.$message.error('广告语未填,不可收藏')
  1520. return
  1521. }
  1522. var params = {}
  1523. params.accountId = localStorage.getItem('campaignAccountId')
  1524. params.userId = this.userInfo().id
  1525. params.titles = this.descriptionList.map(item=>{
  1526. return item.value
  1527. })
  1528. postAction('/kuaishou/kuaiShouTitleCollection/addMore', params).then((res) => {
  1529. if (res.success) {
  1530. this.$message.success('收藏成功')
  1531. } else {
  1532. this.$message.error(res.message)
  1533. }
  1534. })
  1535. },
  1536. showCunTitle() {
  1537. this.cunTitleVisible = true
  1538. this.getCunTitle()
  1539. },
  1540. getCunTitle() {
  1541. var params = {}
  1542. params.accountId = localStorage.getItem('campaignAccountId')
  1543. params.userId = this.userInfo().id
  1544. params.pageNo = 1
  1545. params.pageSize = 500
  1546. getAction('/kuaishou/kuaiShouTitleCollection/list', params).then((res) => {
  1547. if (res.success) {
  1548. this.cunTitleList = res.result.records
  1549. }
  1550. })
  1551. },
  1552. okTitle(item) {
  1553. this.allForm.description = item
  1554. this.$nextTick(() => {
  1555. if (this.descriptionList[0].value == '') {
  1556. this.descriptionList = [{value:item}]
  1557. } else {
  1558. for (let index = 0; index < this.descriptionList.length; index++) {
  1559. if (this.descriptionList[index].value == '') {
  1560. this.descriptionList.splice(index, 1)
  1561. }
  1562. }
  1563. if(this.descriptionList.length<=9){
  1564. this.descriptionList.push({value:item})
  1565. }
  1566. }
  1567. })
  1568. this.titleVisible = false
  1569. this.dataOne = []
  1570. this.value = ''
  1571. this.title = []
  1572. },
  1573. searchQuery() {
  1574. // /ctop/creativeTitle/titleSuggestion
  1575. getAction('/ctop/creativeTitle/titleSearch', {
  1576. firstCategory: this.dataOne[0],
  1577. secondCategory: this.dataOne[1],
  1578. keywords: this.value,
  1579. }).then((res) => {
  1580. console.log(res)
  1581. this.title = res.result ? res.result : []
  1582. })
  1583. // firstCategory,secondCategory,keywords
  1584. },
  1585. onChangeTitle(value, selectedOptions) {
  1586. this.dataOne = value
  1587. this.value = ''
  1588. this.title = []
  1589. },
  1590. filter(inputValue, path) {
  1591. return path.some((option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
  1592. },
  1593. showTitle() {
  1594. this.titleVisible = true
  1595. this.getHangye()
  1596. },
  1597. getHangye() {
  1598. getAction('/ctop/creativeTitle/getTitleLabel', '').then((res) => {
  1599. if (res.success) {
  1600. this.options = res.result.map((item) => {
  1601. return {
  1602. label: item.label,
  1603. value: item.value,
  1604. children:
  1605. item.children.length > 0
  1606. ? [
  1607. {
  1608. label: '不限',
  1609. value: 0,
  1610. },
  1611. ].concat(item.children)
  1612. : [
  1613. {
  1614. label: '不限',
  1615. value: 0,
  1616. },
  1617. ],
  1618. }
  1619. })
  1620. this.options = [
  1621. {
  1622. label: '不限',
  1623. value: 0,
  1624. },
  1625. ].concat(this.options)
  1626. if (this.dataOne.length > 0) {
  1627. return
  1628. } else {
  1629. this.dataOne = [0]
  1630. }
  1631. }
  1632. })
  1633. },
  1634. matemalVideo(item) {
  1635. this.visibleVideo = true
  1636. this.videoUrlShow = item.url
  1637. },
  1638. showCunTag(type) {
  1639. this.creativeTagVisible = true
  1640. var params = {}
  1641. params.accountId = localStorage.getItem('campaignAccountId')
  1642. params.userId = this.userInfo().id
  1643. params.pageSize = 1000
  1644. params.pageNo = 1
  1645. getAction('/tag/kuaiShouCreativeTagCollection/list', params).then((res) => {
  1646. if (res.success) {
  1647. // console.log(res.result)
  1648. this.optionsTag = res.result.records.map((item) => {
  1649. return {
  1650. id: item.id,
  1651. label: item.tagName,
  1652. children: JSON.parse(item.tagArray).map((item) => {
  1653. return {
  1654. id: item,
  1655. label: item,
  1656. disabled: true,
  1657. }
  1658. }),
  1659. }
  1660. })
  1661. }
  1662. })
  1663. },
  1664. okTag() {
  1665. var data = this.$refs.tree.getCheckedKeys()
  1666. if (data.length > 1) {
  1667. this.$message.error('只能选择一个选项')
  1668. // this.$refs.tree.setCheckedKeys([]);
  1669. } else {
  1670. var params = {}
  1671. params.accountId = localStorage.getItem('campaignAccountId')
  1672. params.userId = this.userInfo().id
  1673. params.pageSize = 1000
  1674. params.pageNo = 1
  1675. params.id = data[0]
  1676. getAction('/tag/kuaiShouCreativeTagCollection/list', params).then((res) => {
  1677. if (res.success) {
  1678. // console.log(res.result)
  1679. this.$nextTick(() => {
  1680. this.form.setFieldsValue({
  1681. creativeTag: JSON.parse(res.result.records[0].tagArray).map((item) => {
  1682. return item
  1683. }),
  1684. })
  1685. this.form.validateFields(['creativeTag'])
  1686. })
  1687. this.creativeTagVisible = false
  1688. } else {
  1689. this.$message.error('选择出错,请稍后选择或自行手填')
  1690. }
  1691. })
  1692. }
  1693. },
  1694. getInfo() {
  1695. if (this.tagName == '') {
  1696. this.$message.error('请输入分类名称')
  1697. return
  1698. } else {
  1699. let params = {}
  1700. params.tagName = this.tagName
  1701. // params.campaignBudget = this.campaignBudget
  1702. params.tagArray = JSON.stringify(this.getData('creativeTag'))
  1703. params.userId = this.userInfo().id
  1704. params.accountId = localStorage.getItem('campaignAccountId')
  1705. postAction('/tag/kuaiShouCreativeTagCollection/add', params).then((res) => {
  1706. if (res.success) {
  1707. this.$message.success('添加成功')
  1708. this.tagName = ''
  1709. } else {
  1710. this.$message.error(res.message)
  1711. }
  1712. })
  1713. }
  1714. },
  1715. onSearch(value) {
  1716. var params = {}
  1717. params.accountId = localStorage.getItem('campaignAccountId')
  1718. params.userId = this.userInfo().id
  1719. params.trackType = this.clickTrackUrlShowType
  1720. params.pageNo = 1
  1721. params.pageSize = 500
  1722. params.trackName = value
  1723. getAction('/kuaishou/kuaiShouTrackUrlCollection/list', params).then((res) => {
  1724. if (res.success) {
  1725. this.trackUrlList = res.result.records
  1726. } else {
  1727. this.$message.error(res.message)
  1728. }
  1729. })
  1730. },
  1731. okClickTrackUrl(item) {
  1732. this.clickTrackUrlList = false
  1733. if (this.clickTrackUrlShowType == '1') {
  1734. this.form.setFieldsValue({
  1735. clickTrackUrl: item.trackUrl,
  1736. })
  1737. } else {
  1738. this.form.setFieldsValue({
  1739. actionbarClickUrl: item.trackUrl,
  1740. })
  1741. }
  1742. },
  1743. removeClickTrackUrl(item) {
  1744. deleteAction('/kuaishou/kuaiShouTrackUrlCollection/delete', {
  1745. id: item.id,
  1746. }).then((res) => {
  1747. if (res.success) {
  1748. this.getClickTrackUrlList(this.clickTrackUrlShowType)
  1749. }
  1750. })
  1751. },
  1752. getClickTrackUrlList(type) {
  1753. this.spinning = true
  1754. this.clickTrackUrlList = true
  1755. this.trackUrlList = []
  1756. var params = {}
  1757. params.accountId = localStorage.getItem('campaignAccountId')
  1758. params.trackType = type
  1759. params.userId = this.userInfo().id
  1760. params.pageNo = 1
  1761. params.pageSize = 500
  1762. getAction('/kuaishou/kuaiShouTrackUrlCollection/list', params).then((res) => {
  1763. if (res.success) {
  1764. this.spinning = false
  1765. this.trackUrlList = res.result.records
  1766. } else {
  1767. this.spinning = false
  1768. this.$message.error(res.message)
  1769. }
  1770. })
  1771. },
  1772. ...mapGetters(['nickname', 'avatar', 'userInfo']),
  1773. changeTrackUrlName() {
  1774. var params = {}
  1775. params.accountId = localStorage.getItem('campaignAccountId')
  1776. params.userId = this.userInfo().id
  1777. params.trackName = this.trackUrlName
  1778. getAction('/kuaishou/kuaiShouTrackUrlCollection/checkTrackName', params).then((res) => {
  1779. this.showTrackUrlNameElse = res.result
  1780. })
  1781. },
  1782. clickTrackUrlOk() {
  1783. var params = {}
  1784. params.accountId = localStorage.getItem('campaignAccountId')
  1785. params.userId = this.userInfo().id
  1786. params.trackName = this.trackUrlName
  1787. params.trackType = this.clickTrackUrlShowType
  1788. params.trackUrl =
  1789. this.clickTrackUrlShowType == '1' ? this.getData('clickTrackUrl') : this.getData('actionbarClickUrl')
  1790. postAction('/kuaishou/kuaiShouTrackUrlCollection/add', params).then((res) => {
  1791. if (res.success) {
  1792. this.clickTrackUrlShow = false
  1793. this.trackUrlName = ''
  1794. this.$message.success('添加成功')
  1795. } else {
  1796. this.$message.error(res.message)
  1797. }
  1798. })
  1799. },
  1800. deleteData(index, item) {
  1801. this.videoList.splice(index, 1)
  1802. var deleteIndex = this.checkVideo.findIndex((c) => c == item.photoId)
  1803. this.checkVideo.splice(deleteIndex, 1)
  1804. for (let i = 0; i < this.checkVideoAll.length; i++) {
  1805. for (let j = 0; j < this.checkVideoAll[i].length; j++) {
  1806. if (this.checkVideoAll[i][j] == item.photoId) {
  1807. this.checkVideoAll[i] = this.checkVideo
  1808. }
  1809. }
  1810. }
  1811. // for (let i = 0; i < this.checkVideoWai.length; i++) {
  1812. // for (let j = 0; j < this.checkVideoWai[i].length; j++) {
  1813. // if (this.checkVideoWai[i][j] == item.photoId) {
  1814. // this.checkVideoWai[i] = this.checkVideo
  1815. // }
  1816. // }
  1817. // }
  1818. this.sumContent = this.checkVideo.length
  1819. // var deleteIndexAll = this.checkVideoAll.findIndex((c) => c == item.photoId)
  1820. // this.checkVideoAll.splice(deleteIndexAll, 1)
  1821. },
  1822. setVideUrl(photoId) {
  1823. this.videoList = []
  1824. getAction('/batch/kuaiShouGroupTemplate/getUrlByPhotoId', { photoId: photoId }).then((res) => {
  1825. if (res.success) {
  1826. this.videoList.push({ url: res.result.url, photoId: photoId, coverUrl: res.result.coverUrl })
  1827. } else {
  1828. }
  1829. })
  1830. },
  1831. changeData(data) {
  1832. if (data.length > 1 && data.findIndex((item) => item == 1) == 0) {
  1833. data.splice(
  1834. data.findIndex((item) => item == 1),
  1835. 1
  1836. )
  1837. } else if (data.length > 1 && data.findIndex((item) => item == 1) == data.length - 1) {
  1838. data.splice(0, data.length - 1)
  1839. } else if (data.length == 0) {
  1840. data.push(1)
  1841. }
  1842. },
  1843. selectAllVideo() {
  1844. this.checkVideo = this.dataSource.map((item) => {
  1845. return item.photoId
  1846. })
  1847. // if (this.active == 0) {
  1848. for (let i = 0; i < this.ipagination.current; i++) {
  1849. this.checkVideoAll.push([])
  1850. }
  1851. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1852. // } else if (this.active == 1) {
  1853. // for (let i = 0; i < this.ipagination.current; i++) {
  1854. // this.checkVideoWai.push([])
  1855. // }
  1856. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1857. // }
  1858. var sum = 0
  1859. for (let i = 0; i < this.checkVideoAll.length; i++) {
  1860. sum += this.checkVideoAll[i].length
  1861. }
  1862. for (let i = 0; i < this.checkVideoWai.length; i++) {
  1863. sum += this.checkVideoWai[i].length
  1864. }
  1865. this.sumContent = sum
  1866. if(this.getData('unitType') == '4'){
  1867. if (this.getData('createType') == '0') {
  1868. if (sum > this.getData('createCount')) {
  1869. this.$message.error('最多选择' + this.getData('createCount') + '个素材')
  1870. this.checkVideo = []
  1871. this.sumContent = this.sumContent - 10
  1872. // if (this.active == 0) {
  1873. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1874. }
  1875. } else {
  1876. if (sum > this.getData('createCount') * 15) {
  1877. this.$message.error('最多选择' + this.getData('createCount') * 15 + '个素材')
  1878. this.checkVideo = []
  1879. this.sumContent = this.sumContent - 15
  1880. // if (this.active == 0) {
  1881. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1882. // } else if (this.active == 1) {
  1883. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1884. // }
  1885. }
  1886. }
  1887. }else{
  1888. if (sum > this.getData('createCount')*this.getData('imageCount')) {
  1889. this.$message.error('最多选择'+this.getData('createCount')*this.getData('imageCount')+'个素材')
  1890. this.checkVideo = []
  1891. this.sumContent-=10
  1892. // if (this.active == 0) {
  1893. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1894. // } else if (this.active == 1) {
  1895. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1896. // }
  1897. }
  1898. }
  1899. },
  1900. setData(data) {
  1901. // if (this.active == 0) {
  1902. for (let i = 0; i < this.ipagination.current; i++) {
  1903. this.checkVideoAll.push([])
  1904. }
  1905. this.checkVideoAll[this.ipagination.current - 1] = data
  1906. // } else if (this.active == 1) {
  1907. // for (let i = 0; i < this.ipagination.current; i++) {
  1908. // this.checkVideoWai.push([])
  1909. // }
  1910. // this.checkVideoWai[this.ipagination.current - 1] = data
  1911. // }
  1912. var sum = 0
  1913. for (let i = 0; i < this.checkVideoAll.length; i++) {
  1914. sum += this.checkVideoAll[i].length
  1915. }
  1916. for (let i = 0; i < this.checkVideoWai.length; i++) {
  1917. sum += this.checkVideoWai[i].length
  1918. }
  1919. this.sumContent = sum
  1920. if(this.getData('unitType') == '4'){
  1921. if (this.getData('createType') == '0') {
  1922. if (sum > this.getData('createCount')) {
  1923. this.$message.error('最多选择' + this.getData('createCount') + '个素材')
  1924. this.checkVideo.pop()
  1925. this.sumContent--
  1926. // if (this.active == 0) {
  1927. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1928. // } else if (this.active == 1) {
  1929. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1930. // }
  1931. }
  1932. } else {
  1933. if (sum > this.getData('createCount') * 15) {
  1934. this.$message.error('最多选择' + this.getData('createCount') * 15 + '个素材')
  1935. this.checkVideo.pop()
  1936. this.sumContent--
  1937. // if (this.active == 0) {
  1938. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1939. // } else if (this.active == 1) {
  1940. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1941. // }
  1942. }
  1943. }
  1944. }else{
  1945. if (sum > this.getData('createCount')*this.getData('imageCount')) {
  1946. this.$message.error('最多选择'+this.getData('createCount')*this.getData('imageCount')+'个素材')
  1947. this.checkVideo.pop()
  1948. this.sumContent--
  1949. // if (this.active == 0) {
  1950. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1951. // } else if (this.active == 1) {
  1952. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1953. // }
  1954. }
  1955. }
  1956. },
  1957. getVideoList() {
  1958. this.orderBy = 'time'
  1959. this.visibleMatemal = true
  1960. if (this.checkVideo.length > 0) {
  1961. } else {
  1962. this.showVideo = false
  1963. this.checkVideo = []
  1964. }
  1965. // this.active = 0
  1966. // this.time = []
  1967. // this.channelType = 0
  1968. this.creativeMaterialType = this.getData('creativeMaterialType')
  1969. this.searchVideo()
  1970. // this.getAction('/kuaishou/kuaiShouVideoGet/getBatchV2VideoList', {accountId:10168379}).then(res=>{
  1971. // console.log(res)
  1972. // })
  1973. // this.getAction('/kuaishou/kuaiShouVideoGet/getVideoListByCostType', {accountId:10168379,costType:1}).then(res=>{
  1974. // console.log(res)
  1975. // })
  1976. },
  1977. getDataSource(page, pageSize) {
  1978. console.log(this.checkVideo, this.checkVideoAll)
  1979. this.checkVideo = this.checkVideoAll[page-1]
  1980. this.ipagination.current = page
  1981. this.searchVideo()
  1982. },
  1983. cancelAll() {
  1984. // this.checkVideoAll = []
  1985. // this.checkVideoWei = []
  1986. this.ipagination.current = 1
  1987. this.mediaDimension = 'a'
  1988. this.time = []
  1989. this.costType = 1
  1990. this.photoId = ''
  1991. this.photoName = ''
  1992. this.visibleMatemal = false
  1993. this.md5Str = ""
  1994. },
  1995. handleOkShow() {
  1996. // this.checkVideoAll = [...new Set(this.checkVideoAll)]
  1997. var data = tqFun(this.checkVideoAll).concat(tqFun(this.checkVideoWai))
  1998. this.checkVideo = data
  1999. // console.log(this.checkVideoAll, this.checkVideo)
  2000. for (let i = 0; i < this.checkVideo.length; i++) {
  2001. this.setVideUrl(this.checkVideo[i])
  2002. if (i == this.checkVideo.length - 1) {
  2003. this.showVideo = true
  2004. this.visibleMatemal = false
  2005. this.cancelAll()
  2006. }
  2007. }
  2008. },
  2009. callback(key) {
  2010. this.channelType = key
  2011. this.checkVideo = []
  2012. this.ipagination.current = 1
  2013. this.time = []
  2014. if (key == 0) {
  2015. this.checkVideo = this.checkVideoAll[this.ipagination.current - 1]
  2016. } else if (key == 1) {
  2017. this.checkVideo = this.checkVideoWai[this.ipagination.current - 1]
  2018. }
  2019. },
  2020. changeType() {
  2021. this.$nextTick(() => {
  2022. if (this.getData('creativeMaterialType') == '1') {
  2023. if(this.getData('unitType') == '4') {
  2024. this.form.setFieldsValue({creativeName:'自定义创意_竖版视频'})
  2025. }else{
  2026. this.form.setFieldsValue({creativeName:'程序化创意_竖版视频'})
  2027. }
  2028. } else {
  2029. if(this.getData('unitType') == '4') {
  2030. this.form.setFieldsValue({creativeName:'自定义创意_横版视频'})
  2031. }else{
  2032. this.form.setFieldsValue({creativeName:'程序化创意_横版视频'})
  2033. }
  2034. }
  2035. })
  2036. },
  2037. lookTemplate(accountId, templateId) {
  2038. this.$refs.templateModal.handleOk(localStorage.getItem('campaignAccountId'), templateId, 'look')
  2039. },
  2040. addTemplate(accountId) {
  2041. this.$refs.templateModal.create(localStorage.getItem('campaignAccountId'), 'add')
  2042. },
  2043. getTemplate(accountId) {
  2044. var data = null
  2045. if (accountId) {
  2046. data = accountId
  2047. } else {
  2048. this.templateLoading = true
  2049. data = localStorage.getItem('campaignAccountId')
  2050. }
  2051. getAction('/batch/kuaishouTemplate/getTemplateByAccountId', {
  2052. accountId: data,
  2053. }).then((res) => {
  2054. if (res.success) {
  2055. this.getTemplateList(data)
  2056. }
  2057. })
  2058. },
  2059. getTemplateList(accountId) {
  2060. this.templateList = []
  2061. getAction('/batch/kuaishouTemplate/list', {
  2062. accountId: accountId,
  2063. }).then((res) => {
  2064. if (res.success) {
  2065. this.templateList = res.result.map((item, index) => {
  2066. return {
  2067. ...item,
  2068. key: index,
  2069. }
  2070. })
  2071. this.templateLoading = false
  2072. } else {
  2073. this.templateLoading = false
  2074. }
  2075. })
  2076. },
  2077. convertOk() {
  2078. var dataLink = []
  2079. dataLink = this.convertAllList.filter((item) => {
  2080. return item.convert_id == this.convertId.key
  2081. })
  2082. if (dataLink.length > 0) {
  2083. this.form.setFieldsValue({ clickTrackUrl: dataLink[0].click_url })
  2084. this.convert = false
  2085. }
  2086. },
  2087. showConvert() {
  2088. this.convertChange()
  2089. if (this.campaignType == 2) {
  2090. if (this.getData('appId')) {
  2091. this.convert = true
  2092. if (this.getPlatForm(this.getData('appId')) == 1 || this.getPlatForm(this.getData('appId')) == 2) {
  2093. this.convertType = '3'
  2094. } else {
  2095. this.convertType = '7'
  2096. }
  2097. } else {
  2098. this.$message.error('请选择应用')
  2099. }
  2100. } else {
  2101. this.convert = true
  2102. this.convertType = '1'
  2103. }
  2104. this.getConvertList()
  2105. },
  2106. convertChange() {
  2107. this.convertId = ''
  2108. },
  2109. getConvertList() {
  2110. var params = {}
  2111. params.accountId = localStorage.getItem('campaignAccountId')
  2112. params.type = this.convertType
  2113. getAction('/kuaishou/batch/getConvertList', params).then((res) => {
  2114. if (res.success) {
  2115. this.convertList = res.result.map((item) => {
  2116. return {
  2117. ...item,
  2118. convert_id: item.convert_id + '',
  2119. }
  2120. })
  2121. this.convertAllList.push(...this.convertList)
  2122. }
  2123. })
  2124. },
  2125. getCheck(e) {
  2126. this.checkedTrue = e.target.checked
  2127. },
  2128. addGroup() {
  2129. this.allForm.group.push({
  2130. bidType: 10,
  2131. // bid: '',
  2132. // cpaBid: '',
  2133. showTipCheck: false,
  2134. deepConversionBidCheck: false,
  2135. // unitName: '',
  2136. unitNameCheck: false,
  2137. deepConversionType: '',
  2138. deepConversionBid: '',
  2139. ocpxActionType: this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
  2140. })
  2141. },
  2142. resData(index) {
  2143. // this.allForm.group[index].bid = ''
  2144. // this.allForm.group[index].cpaBid = ''
  2145. this.allForm.group[index].showTipCheck = false
  2146. this.allForm.group[index].deepConversionBidCheck = false
  2147. this.allForm.group[index].deepConversionType = ''
  2148. this.allForm.group[index].deepConversionBid = ''
  2149. this.form.setFieldsValue({
  2150. bid: undefined,
  2151. })
  2152. this.form.setFieldsValue({
  2153. cpaBid: undefined,
  2154. })
  2155. },
  2156. removeGroup(index) {
  2157. this.allForm.group.splice(index, 1)
  2158. },
  2159. deep_conversion_bidTip(index) {
  2160. if (
  2161. this.allForm.group[index].deepConversionBid < this.getData('cpaBid')
  2162. ) {
  2163. this.allForm.group[index].deepConversionBidCheck = true
  2164. } else {
  2165. this.allForm.group[index].deepConversionBidCheck = false
  2166. }
  2167. },
  2168. checkGroup(e, index) {
  2169. if (e.target.value != '') {
  2170. getAction('/kuaishou/batch/checkUnitName', {
  2171. campaignId: localStorage.getItem('campaignList'),
  2172. unitName: e.target.value,
  2173. }).then((res) => {
  2174. if (res.success) {
  2175. this.allForm.group[index].unitNameCheck = !res.result
  2176. } else {
  2177. this.allForm.group[index].unitNameCheck = false
  2178. }
  2179. })
  2180. }
  2181. },
  2182. showTip(index) {
  2183. if (this.allForm.group[index].bidType == 1) {
  2184. if (this.getData('bid') < 0.2 || this.getData('bid') > this.maxBid) {
  2185. this.allForm.group[index].showTipCheck = true
  2186. } else {
  2187. this.allForm.group[index].showTipCheck = false
  2188. }
  2189. } else {
  2190. if (this.getData('cpaBid') < 1 || this.getData('cpaBid') > this.maxBid) {
  2191. this.allForm.group[index].showTipCheck = true
  2192. } else {
  2193. this.allForm.group[index].showTipCheck = false
  2194. }
  2195. }
  2196. },
  2197. getScheduleTime(item) {
  2198. this.allForm.scheduleTimeData = item
  2199. },
  2200. setTime(e) {
  2201. if (e.target.value == '2') {
  2202. this.timeRange[0] = moment().startOf('day')
  2203. this.timeRange[1] = moment().add(1, 'months')
  2204. }
  2205. },
  2206. setTimeAll(e) {
  2207. if (e.target.value == '2') {
  2208. this.$nextTick(() => {
  2209. this.$refs.selectCheck.init()
  2210. })
  2211. } else {
  2212. }
  2213. },
  2214. getData(className) {
  2215. return this.form.getFieldValue(className)
  2216. },
  2217. bidCheck(rule, value, callback) {
  2218. if (value < 0.2) {
  2219. callback('不得低于0.2元')
  2220. } else {
  2221. callback()
  2222. }
  2223. },
  2224. cpaBidCheck(rule, value, callback) {
  2225. if (value < 1) {
  2226. callback('不得低于1元')
  2227. } else {
  2228. callback()
  2229. }
  2230. },
  2231. handleConfirmValue(rule, value, callback) {
  2232. if (value != '' && value != undefined) {
  2233. getAction('/kuaishou/batch/checkUnitName', {
  2234. campaignId: localStorage.getItem('campaignList'),
  2235. unitName: value + '_0',
  2236. }).then((res) => {
  2237. if (res.success) {
  2238. if (!res.result) {
  2239. callback('广告组名称重复')
  2240. } else {
  2241. callback()
  2242. }
  2243. } else {
  2244. callback()
  2245. }
  2246. })
  2247. } else {
  2248. callback()
  2249. }
  2250. },
  2251. budgetValue(rule, value, callback) {
  2252. if (value < 100 || value > 100000000) {
  2253. callback('不小于100,不超过100000000,仅支持输入自然数')
  2254. }
  2255. callback()
  2256. },
  2257. handleConfirmBid(rule, value, callback) {
  2258. if (this.bid == 0 || this.bid <= 0.2 || this.bid >= 100) {
  2259. callback('不得低于0.2元,不得高于100元')
  2260. }
  2261. callback()
  2262. },
  2263. handleConfirmCpaBid(rule, value, callback) {
  2264. if (this.ocpxActionType == '2' && (this.cpaBid == 0 || this.cpaBid <= 1 || this.cpaBid >= 3000)) {
  2265. callback('金额不得低于1元,不得高于3000元')
  2266. }
  2267. if (this.ocpxActionType == '180' && (this.cpaBid == 0 || this.cpaBid <= 5 || this.cpaBid >= 3000)) {
  2268. callback('金额不得低于5元,不得高于3000元')
  2269. }
  2270. callback()
  2271. },
  2272. onSelectChange(selectedRowKeys, selectionRows) {
  2273. this.selectedRowKeys = selectedRowKeys
  2274. this.selectedRowKeysValue = selectionRows.map((item) => {
  2275. return {
  2276. orientationId: item.orientationId,
  2277. orientationName: item.orientationName,
  2278. }
  2279. })
  2280. },
  2281. getCheckboxProps(record) {
  2282. return {
  2283. props: {
  2284. disabled: this.selectedRowKeysValueNo.some((item) => item.orientationId === record.orientationId),
  2285. },
  2286. }
  2287. },
  2288. onSelectChangeNo(selectedRowKeys, selectionRows) {
  2289. this.selectedRowKeysNo = selectedRowKeys
  2290. this.selectedRowKeysValueNo = selectionRows.map((item) => {
  2291. return {
  2292. orientationId: item.orientationId,
  2293. orientationName: item.orientationName,
  2294. }
  2295. })
  2296. },
  2297. getCheckboxPropsNo(record) {
  2298. return {
  2299. props: {
  2300. disabled: this.selectedRowKeysValue.some((item) => item.orientationId === record.orientationId),
  2301. },
  2302. }
  2303. },
  2304. okSelect() {
  2305. this.keyValue = ''
  2306. this.topMiddle = false
  2307. for (let i = 0; i < this.selectedRowKeysValue.length; i++) {
  2308. this.keyValue += this.selectedRowKeysValue[i].orientationName + ' '
  2309. }
  2310. },
  2311. okSelectNo() {
  2312. this.keyValueNo = ''
  2313. this.topMiddleNo = false
  2314. for (let i = 0; i < this.selectedRowKeysValueNo.length; i++) {
  2315. this.keyValueNo += this.selectedRowKeysValueNo[i].orientationName + ' '
  2316. }
  2317. },
  2318. radioChange() {
  2319. this.selectedRowKeys = []
  2320. this.selectedRowKeysValue = []
  2321. this.selectedRowKeysNo = []
  2322. this.selectedRowKeysValueNo = []
  2323. this.keyValue = ''
  2324. this.keyValueNo = ''
  2325. },
  2326. addApplication() {
  2327. this.tongbuLoading = true
  2328. // this.$refs.application.showApplication()
  2329. getAction('/kuaishou/batch/syncAppList', {
  2330. accountId: localStorage.getItem('campaignAccountId'),
  2331. }).then((res) => {
  2332. if (res.success) {
  2333. this.tongbuLoading = false
  2334. this.$message.success(res.message)
  2335. this.getAppList()
  2336. } else {
  2337. this.tongbuLoading = false
  2338. this.$message.error(res.message)
  2339. }
  2340. })
  2341. },
  2342. handleOk() {
  2343. var that = this
  2344. this.$bus.$emit('remove', '/creat/creatUnit')
  2345. this.$router.replace({
  2346. path: '/batchCreation/campaignList',
  2347. })
  2348. },
  2349. handleCancel(e) {
  2350. this.visible = false
  2351. },
  2352. handleSubmit(e) {
  2353. e.preventDefault()
  2354. if (
  2355. this.checkVideo.length <
  2356. (this.getData('unitType')=='4'?this.getData('createType') == '0' ? this.getData('createCount') : this.getData('createCount') * 15:
  2357. this.getData('createCount')*this.getData('imageCount'))
  2358. ) {
  2359. // this.$message.error('选择的素材不能小于创建条数')
  2360. this.getData('unitType')=='4'?
  2361. this.getData('createType') == '0'
  2362. ? this.$message.error('选择的素材不能小于创建条数')
  2363. : this.$message.error('选择的素材不能小于创建条数*15'):
  2364. this.$message.error('选择的素材不能小于创建条数*'+this.getData('imageCount'))
  2365. } else {
  2366. let isNotComplete = this.descriptionList.findIndex(item => {
  2367. return item.value === ''
  2368. })
  2369. if (isNotComplete > -1) {
  2370. this.$message.error('广告语未填')
  2371. return
  2372. }
  2373. if(this.getData('unitType')=='7'&&this.descriptionList.length<3){
  2374. this.$message.error('程序化创意广告语最少三条')
  2375. return
  2376. }
  2377. this.form.validateFieldsAndScroll((err, values) => {
  2378. if (!err) {
  2379. this.loading = true
  2380. var groupArr = this.allForm.group.map((item) => {
  2381. return {
  2382. ...item,
  2383. deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
  2384. ocpxActionType: item.ocpxActionType,
  2385. bidType: item.bidType == 1 ? 2 : 10,
  2386. }
  2387. })
  2388. var json = {
  2389. ...values,
  2390. cpaBid: values.cpaBid && values.cpaBid != '' ? values.cpaBid * 1000 : null,
  2391. bid: values.bid && values.bid != '' ? values.bid * 1000 : null,
  2392. convertId: this.convertId ? this.convertId.key : null,
  2393. dayBudget: values.dayBudget * 1000,
  2394. photoArr: this.checkVideo,
  2395. creativeCategory: values.creativeCategory
  2396. ? values.creativeCategory[values.creativeCategory.length - 1]
  2397. : null,
  2398. unitType: values.unitType,
  2399. }
  2400. var params = {
  2401. userId: this.userInfo().id,
  2402. ...json,
  2403. ...groupArr[0],
  2404. description:JSON.stringify(this.descriptionList.map(item=>{return item.value})),
  2405. accountId: localStorage.getItem('campaignAccountId'),
  2406. campaignId: localStorage.getItem('campaignList'),
  2407. beginTime: moment(this.timeRange[0]).format('YYYY-MM-DD'),
  2408. endTime: this.allForm.time == '2' ? moment(this.timeRange[1]).format('YYYY-MM-DD') : '',
  2409. appStore: values.useAppMarket == true ? this.allForm.appStore : null,
  2410. useAppMarket: values.useAppMarket ? 1 : 0,
  2411. sceneId: this.allForm.allianceAccount == '1' ? this.allForm.sceneId : [5],
  2412. scheduleTime:
  2413. this.allForm.scheduleTime == '2'
  2414. ? this.allForm.scheduleTimeData
  2415. : '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  2416. }
  2417. postAction('/batch/kuaiShouGroupTemplate/submitUnitTask', params).then((res) => {
  2418. this.loading = false
  2419. if (res.success) {
  2420. this.visible = true
  2421. this.allForm.fail = res.result.code
  2422. this.allForm.success = res.result.size
  2423. } else {
  2424. this.$message.error(res.message)
  2425. }
  2426. })
  2427. }
  2428. })
  2429. }
  2430. },
  2431. onChange(value) {
  2432. // console.log(value)
  2433. },
  2434. changeUnitType(e){
  2435. this.sumContent = 0
  2436. this.videoList = []
  2437. this.checkVideo = []
  2438. this.checkVideoAll = []
  2439. this.ipagination.pageSize = 10
  2440. this.$nextTick(()=>{
  2441. if (this.getData('creativeMaterialType') == '1') {
  2442. if(this.getData('unitType') == '4') {
  2443. this.form.setFieldsValue({creativeName:'自定义创意_竖版视频'})
  2444. }else{
  2445. this.form.setFieldsValue({creativeName:'程序化创意_竖版视频'})
  2446. }
  2447. } else {
  2448. if(this.getData('unitType') == '4') {
  2449. this.form.setFieldsValue({creativeName:'自定义创意_横版视频'})
  2450. }else{
  2451. this.form.setFieldsValue({creativeName:'程序化创意_横版视频'})
  2452. }
  2453. }
  2454. // if(e.target.value == '4') {
  2455. // this.form.setFieldsValue({creativeName:'自定义创意_竖版视频'})
  2456. // }else{
  2457. // this.form.setFieldsValue({creativeName:'程序化创意_竖版视频'})
  2458. // }
  2459. })
  2460. },
  2461. handleChange(value) {
  2462. // this.$refs.population.getAppList(value)
  2463. this.getSiteList(value)
  2464. this.getIsActivate(value)
  2465. },
  2466. handleChangeMould(value) {
  2467. if (value) {
  2468. this.populationData = JSON.parse(
  2469. this.dataList.filter((item) => {
  2470. return item.id == value
  2471. })[0].templateContent
  2472. )
  2473. } else {
  2474. this.populationData = {}
  2475. }
  2476. },
  2477. getPlatForm(appId) {
  2478. if (appId) {
  2479. var data = this.appList.filter((item) => {
  2480. return item.appId == appId
  2481. })
  2482. return data[0].platform
  2483. }
  2484. },
  2485. handleBlur() {
  2486. // console.log('blur')
  2487. },
  2488. handleFocus() {
  2489. // console.log('focus')
  2490. },
  2491. getPageSize(data) {
  2492. if (data.target.value == '0') {
  2493. this.ipagination.pageSize = 5
  2494. } else if (data.target.value == '1') {
  2495. this.ipagination.pageSize = 15
  2496. }
  2497. this.videoList = []
  2498. this.checkVideo = []
  2499. this.checkVideoAll = []
  2500. this.checkVideoWai = []
  2501. this.sumContent = 0
  2502. },
  2503. filterOption(input, option) {
  2504. return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  2505. },
  2506. prevStep() {
  2507. this.$emit('prevStep', this.campaignId ? this.campaignId : localStorage.getItem('campaignList'))
  2508. },
  2509. getMould() {
  2510. let params = {}
  2511. params.accountId = localStorage.getItem('campaignAccountId')
  2512. getAction('/kuaishou/batch/getDirectionalTemplate', params).then((res) => {
  2513. // console.log(res)
  2514. if (res.success) {
  2515. this.dataList = res.result.map((item, index) => {
  2516. return {
  2517. ...item,
  2518. key: index,
  2519. }
  2520. })
  2521. }
  2522. })
  2523. },
  2524. getAppList() {
  2525. let params = {}
  2526. params.accountId = localStorage.getItem('campaignAccountId')
  2527. getAction('/kuaishou/batch/getAppList', params).then((res) => {
  2528. if (res.success) {
  2529. this.appList = res.result.map((item, index) => {
  2530. return {
  2531. ...item,
  2532. key: index,
  2533. }
  2534. })
  2535. }
  2536. })
  2537. },
  2538. getCampaignList() {
  2539. var params = {}
  2540. params.accountId = localStorage.getItem('campaignAccountId')
  2541. params.campaignId = this.campaignId ? this.campaignId : localStorage.getItem('campaignList')
  2542. getAction('/kuaishou/batch/getCampaignList', params).then((res) => {
  2543. if (res.success) {
  2544. this.campaignType = res.result.records[0].campaignType
  2545. // console.log(this.campaignType)
  2546. }
  2547. })
  2548. },
  2549. getData(className) {
  2550. return this.form.getFieldValue(className)
  2551. },
  2552. showVideoList(url, params) {
  2553. this.dataSource = []
  2554. this.loadingVideoList = true
  2555. getAction(url, params).then((res) => {
  2556. // console.log(res)
  2557. if (res.success) {
  2558. this.dataSource = res.result.list
  2559. this.ipagination.total = res.result.total
  2560. this.loadingVideoList = false
  2561. } else {
  2562. this.loadingVideoList = false
  2563. }
  2564. })
  2565. },
  2566. getSiteList(appId) {
  2567. getAction('/kuaishou/batch/getPageList', {
  2568. accountId: localStorage.getItem('campaignAccountId'),
  2569. appId: appId,
  2570. viewComp: 7,
  2571. }).then((res) => {
  2572. if (res.success) {
  2573. this.siteList = res.result
  2574. if (this.siteList.length > 0) {
  2575. this.showSite = true
  2576. }
  2577. } else {
  2578. this.showSite = false
  2579. }
  2580. })
  2581. },
  2582. getChangeAll(type, form, field) {
  2583. this.showNumber = false
  2584. this.showNumber = true
  2585. var node = document.getElementById(field)
  2586. var v = '{{' + type + '}}'
  2587. if (document.selection) {
  2588. //IE
  2589. node.focus()
  2590. var sel = document.selection.createRange()
  2591. sel.text = v
  2592. sel.select()
  2593. if (field == 'campaignName') {
  2594. this[form].setFieldsValue({ campaignName: sel.text })
  2595. } else if (field == 'unitName') {
  2596. this[form].setFieldsValue({ unitName: sel.text })
  2597. }
  2598. } else if (node.selectionStart || node.selectionStart == '0') {
  2599. //MOZILLA/GOOGLE
  2600. var startPos = node.selectionStart
  2601. var endPos = node.selectionEnd
  2602. var restoreTop = node.scrollTop
  2603. node.value = node.value.substring(0, startPos) + v + node.value.substring(endPos, node.value.length)
  2604. if (restoreTop > 0) {
  2605. node.scrollTop = restoreTop
  2606. }
  2607. if (field == 'campaignName') {
  2608. this[form].setFieldsValue({ campaignName: node.value })
  2609. } else if (field == 'unitName') {
  2610. this[form].setFieldsValue({ unitName: node.value })
  2611. }
  2612. node.focus()
  2613. node.selectionStart = startPos + v.length
  2614. node.selectionEnd = startPos + v.length
  2615. // this.campaignName = node.value
  2616. } else {
  2617. //OTHER
  2618. node.value += v
  2619. // console.log(node.value)
  2620. if (field == 'campaignName') {
  2621. this[form].setFieldsValue({ campaignName: node.value })
  2622. } else if (field == 'unitName') {
  2623. this[form].setFieldsValue({ unitName: node.value })
  2624. }
  2625. node.focus()
  2626. // this.campaignName = node.value
  2627. }
  2628. },
  2629. getIsActivate(val){
  2630. let params={};
  2631. params.accountId=localStorage.getItem('campaignAccountId');
  2632. params.campaignType=localStorage.getItem('campaignType');
  2633. params.appId=val
  2634. getAction('/kuaishou/batch/getIsActivate',params).then(res => {
  2635. if (res.success) {
  2636. this.allForm.groupTypeData = res.result
  2637. }
  2638. })
  2639. },
  2640. },
  2641. watch: {
  2642. timeSeries(val) {
  2643. // console.log(val)
  2644. },
  2645. checkVideo(n, o) {},
  2646. checkVideoAll(n, o) {
  2647. // this.checkVideoAll = [...new Set(n)]
  2648. // console.log(n,o)
  2649. // this.checkVideo = [...new Set(n)]
  2650. },
  2651. time(n, o) {
  2652. if(this.visibleMatemal){
  2653. this.searchVideo()
  2654. }
  2655. // if (n.length > 0) {
  2656. // var params = {}
  2657. // params.accountId = localStorage.getItem('campaignAccountId')
  2658. // params.materialType = this.creativeMaterialType
  2659. // params.pageSize = this.ipagination.pageSize
  2660. // params.pageNo = 1
  2661. // params.status = 0
  2662. // params.channelType = this.channelType
  2663. // params.startDate = moment(n[0]).format('YYYY-MM-DD') + ' 00:00:00'
  2664. // params.endDate = moment(n[1]).format('YYYY-MM-DD') + ' 23:59:59'
  2665. // params.orderBy = this.orderBy
  2666. // params.signatures = this.md5Str
  2667. // this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
  2668. // } else {
  2669. // var params = {}
  2670. // params.accountId = localStorage.getItem('campaignAccountId')
  2671. // params.materialType = this.creativeMaterialType
  2672. // params.pageSize = this.ipagination.pageSize
  2673. // params.pageNo = 1
  2674. // params.status = 0
  2675. // params.channelType = this.channelType
  2676. // params.orderBy = this.orderBy
  2677. // params.signatures = this.md5Str
  2678. // this.ipagination.current = 1
  2679. // this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
  2680. // }
  2681. },
  2682. },
  2683. mounted: function () {
  2684. this.step = localStorage.getItem('step')
  2685. this.getTemplate(localStorage.getItem('campaignAccountId'))
  2686. this.getAppList()
  2687. // this.getCampaignList()
  2688. this.campaignType = localStorage.getItem('campaignType')
  2689. this.getMould()
  2690. getAction('/kuaishou/batch/getIsActivate', {
  2691. accountId: localStorage.getItem('campaignAccountId'),
  2692. }).then((res) => {
  2693. if (res.success) {
  2694. this.allForm.groupTypeData = res.result
  2695. this.addGroup()
  2696. }
  2697. })
  2698. getAction('/kuaishou/batch/getWhiteList', {
  2699. accountId: localStorage.getItem('campaignAccountId'),
  2700. }).then((res) => {
  2701. if (res.success) {
  2702. // console.log(res)
  2703. if (res.result) {
  2704. this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
  2705. this.allianceAccount = res.result.alliance_account == 1 ? true : false
  2706. this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
  2707. // if (res.result.alliance_account == 1) {
  2708. // this.allianceAccount = true
  2709. // } else {
  2710. // this.allianceAccount = false
  2711. // }
  2712. } else {
  2713. this.allianceAccount = false
  2714. this.creativeCategorySwitch = false
  2715. this.actionbarClickUrlSwitch = false
  2716. }
  2717. }
  2718. })
  2719. getAction('/kuaishou/batch/getProjectMaxBid', {
  2720. accountId: localStorage.getItem('campaignAccountId'),
  2721. }).then((res) => {
  2722. if (res.success) {
  2723. this.maxBid = res.result / 1000
  2724. }
  2725. })
  2726. getAction('/kuaishou/batch/getActionBarTextByType', {
  2727. type: localStorage.getItem('campaignType'),
  2728. }).then((res) => {
  2729. if (res.success) {
  2730. this.actionBarTextList = res.result
  2731. }
  2732. })
  2733. getAction('/kuaishou/batch/getCreativeCategory', {
  2734. accountId: localStorage.getItem('campaignAccountId'),
  2735. }).then((res) => {
  2736. if (res.success) {
  2737. // console.log(res)
  2738. this.createOptions = res.result
  2739. }
  2740. })
  2741. getAction('/batch/kuaiShouGroupTemplate/getApiCreateCount', {
  2742. accountId: localStorage.getItem('campaignAccountId'),
  2743. }).then((res) => {
  2744. this.createCount = res.result
  2745. })
  2746. },
  2747. }
  2748. </script>
  2749. <style type="text/css" scoped lang="scss">
  2750. .width-video {
  2751. width: calc(20% - 10px);
  2752. margin-right: 10px;
  2753. margin-bottom: 10px;
  2754. }
  2755. .chouzhen {
  2756. border-style: solid;
  2757. border-width: 1px;
  2758. border-color: #e4e4e4;
  2759. width: calc(20% - 10px);
  2760. padding: 10px;
  2761. margin-right: 10px;
  2762. margin-bottom: 10px;
  2763. display: flex;
  2764. align-items: center;
  2765. background: #fff;
  2766. position: relative;
  2767. z-index: 99;
  2768. float: left;
  2769. }
  2770. li.chouzhen.first:before {
  2771. font-size: 12px;
  2772. content: '首帧';
  2773. position: absolute;
  2774. top: 7px;
  2775. left: 5px;
  2776. width: 36px;
  2777. height: 20px;
  2778. color: rgb(255, 255, 255);
  2779. line-height: 20px;
  2780. text-align: center;
  2781. background: rgba(0, 0, 0, 0.5);
  2782. border-radius: 2px;
  2783. z-index: 1000;
  2784. }
  2785. .actor-photo-list {
  2786. display: flex;
  2787. padding-left: 0;
  2788. li {
  2789. width: 25%;
  2790. margin: 10px;
  2791. position: relative;
  2792. height: 250px;
  2793. border: 1px solid #f2f2f2;
  2794. list-style: none;
  2795. img,
  2796. video {
  2797. width: 100%;
  2798. margin-top: auto;
  2799. margin-bottom: auto;
  2800. top: 0;
  2801. bottom: 0;
  2802. position: absolute;
  2803. max-height: 250px;
  2804. }
  2805. }
  2806. }
  2807. .plug-timer-grid {
  2808. width: 100%;
  2809. }
  2810. .plug-timer-grid td,
  2811. .plug-timer-grid th {
  2812. border: 1px solid #97b4d1;
  2813. text-align: center;
  2814. /*cursor:pointer;*/
  2815. font-size: 10px;
  2816. line-height: 10px;
  2817. }
  2818. .Selected {
  2819. background-color: rgb(102, 162, 243);
  2820. opacity: 0.5;
  2821. }
  2822. .plug-timer-grid {
  2823. border-collapse: collapse;
  2824. z-index: 4;
  2825. }
  2826. .plug-timer-grid thead tr {
  2827. display: table-row;
  2828. vertical-align: inherit;
  2829. border-color: inherit;
  2830. }
  2831. .group-creat table td {
  2832. height: 20px;
  2833. max-width: 5px;
  2834. font-size: 12px;
  2835. text-align: center;
  2836. vertical-align: middle;
  2837. overflow: hidden;
  2838. transition: background 0.5s;
  2839. -webkit-transition: background 0.5s;
  2840. }
  2841. .plug-timer-grid tbody th {
  2842. width: 4%;
  2843. }
  2844. .plug-timer-grid tbody tr td {
  2845. width: 2%;
  2846. }
  2847. /*.clear{*/
  2848. /* margin:20px 0px 20px 0px;*/
  2849. /*}*/
  2850. </style>