creatUnit.vue 97 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867
  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. {{createCount}}
  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 class="step4-else" style="display: inline-block; position: relative; border-radius: 4px; width: 100%; border: 1px solid #d9d9d9;">
  642. <a-textarea
  643. class="rending"
  644. placeholder="请输入广告语"
  645. v-decorator="['description',{ rules: [{ required: true, message: '广告语必填' }] }]"
  646. @keyup="getData('description')?form.setFieldsValue({
  647. description: getData('description').replace(/\s/g,'')
  648. }):null"
  649. @change="getData('description')?form.setFieldsValue({
  650. description: getData('description').replace(/\s/g,'')
  651. }):null"
  652. :autosize="{ minRows: 2, maxRows: 6 }"
  653. :max-length="30"
  654. ></a-textarea>
  655. <p
  656. style="
  657. font-size: 12px;
  658. color: #b6bbc7;
  659. letter-spacing: 0.3px;
  660. text-align: right;
  661. line-height: 20px;
  662. position: absolute;
  663. bottom: 0;
  664. right: 6px;
  665. width: 100%;
  666. margin-bottom: 0;
  667. "
  668. >
  669. {{ (getData('description')?getData('description').length:0) + '/30' }}
  670. </p>
  671. </div>
  672. <br />
  673. <a @click="cunTitle()">收藏</a>
  674. <a @click="showCunTitle()" style="margin-left: 10px">收藏列表</a>
  675. <!--
  676. <br />
  677. <a-tag v-for="(itemTag, indexTag) of tags" :key="indexTag" @click="getChange(item, itemTag, index)">{{
  678. itemTag.name
  679. }}</a-tag> -->
  680. </a-form-item>
  681. <a-form-item label="下载详情" v-if="showSite" :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  682. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }">
  683. <a-select
  684. v-decorator="['siteId']"
  685. showSearch
  686. allowClear
  687. placeholder="选择应用下载详情页"
  688. optionFilterProp="children"
  689. :filterOption="filterOption"
  690. >
  691. <a-select-option v-for="appModel in siteList" :key="appModel.siteId" :value="appModel.siteId">
  692. {{ appModel.name }}
  693. </a-select-option>
  694. </a-select>
  695. </a-form-item>
  696. <a-form-item
  697. label="创意分类"
  698. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  699. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  700. v-if="creativeCategorySwitch"
  701. >
  702. <a-cascader
  703. :options="createOptions"
  704. v-decorator="['creativeCategory',{ rules: [{ required: true, message: '创意分类必选' }] }]"
  705. :fieldNames="fieldNames"
  706. placeholder="请选择创意分类"
  707. />
  708. </a-form-item>
  709. <a-form-item
  710. label="创意标签"
  711. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  712. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  713. v-if="creativeCategorySwitch"
  714. >
  715. <a-select
  716. mode="tags"
  717. style="width: 100%"
  718. placeholder="按回车生成标签"
  719. v-decorator="['creativeTag',{ rules: [{ required: true, message: '创意标签必填' }] }]"
  720. dropdownClassName="display-none-selset"
  721. :token-separators="[',', ' ', ',']"
  722. >
  723. </a-select>
  724. <span v-if="getData('creativeTag') && getData('creativeTag').length > 10" style="color: red"
  725. >创意标签最多填写10个,请删减</span>
  726. <br />
  727. <a-popconfirm @confirm="getInfo()">
  728. <div slot="title">
  729. <div>
  730. 分类名称:
  731. <a-input placeholder="请输入" v-model="tagName" style="display: inline-block; width: 300px" />
  732. </div>
  733. </div>
  734. <a style="margin-right: 10px" :disabled="!getData('creativeTag')">收藏</a>
  735. </a-popconfirm>
  736. <a @click="showCunTag('creativeTag')">收藏列表</a>
  737. </a-form-item>
  738. <a-form-item
  739. label="行动号召"
  740. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  741. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  742. >
  743. <a-select
  744. v-decorator="['actionBarText', { rules: [{ required: true, message: '行动号召按钮文案' }] }]"
  745. showSearch
  746. allowClear
  747. placeholder="选择行动号召按钮文案"
  748. optionFilterProp="children"
  749. :filterOption="filterOption"
  750. >
  751. <a-select-option v-for="appModel in actionBarTextList" :key="appModel.id" :value="appModel.actionBarText">
  752. {{ appModel.actionBarText }}
  753. </a-select-option>
  754. </a-select>
  755. </a-form-item>
  756. <a-form-item
  757. label="下载详情"
  758. v-if="showSite"
  759. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  760. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  761. >
  762. <a-select
  763. v-decorator="['siteId']"
  764. showSearch
  765. allowClear
  766. placeholder="选择应用下载详情页"
  767. optionFilterProp="children"
  768. :filterOption="filterOption"
  769. >
  770. <a-select-option v-for="appModel in siteList" :key="appModel.siteId" :value="appModel.siteId">
  771. {{ appModel.name }}
  772. </a-select-option>
  773. </a-select>
  774. </a-form-item>
  775. <a-form-item
  776. label="第三方点击监测链接"
  777. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  778. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  779. >
  780. <a-input v-decorator="['clickTrackUrl']" placeholder="请输入第三方检测链接"> </a-input>
  781. <a
  782. v-if="getData('clickTrackUrl')"
  783. @click="
  784. clickTrackUrlShow = true
  785. clickTrackUrlShowType == '1'
  786. "
  787. style="margin-right: 10px"
  788. >收藏监测链接</a
  789. >
  790. <a
  791. @click="
  792. getClickTrackUrlList('1')
  793. clickTrackUrlShowType = '1'
  794. "
  795. >监测链接列表</a
  796. >
  797. </a-form-item>
  798. <a-form-item
  799. label="第三方ActionBar点击监控链接"
  800. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  801. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  802. v-if="actionbarClickUrlSwitch"
  803. >
  804. <a-input v-decorator="['actionbarClickUrl']" placeholder="请输入第三方点击监控链接"> </a-input>
  805. <span style="color: red; position: relative; top: -10px">仅加白使用</span>
  806. <br />
  807. <a
  808. v-if="getData('actionbarClickUrl')"
  809. @click="
  810. clickTrackUrlShow = true
  811. clickTrackUrlShowType = '2'
  812. "
  813. style="margin-right: 10px; position: relative; top: -20px"
  814. >收藏监测链接</a
  815. >
  816. <a
  817. @click="
  818. getClickTrackUrlList('2')
  819. clickTrackUrlShowType = '2'
  820. "
  821. style="margin-right: 10px; position: relative; top: -20px"
  822. >监测链接列表</a
  823. >
  824. </a-form-item>
  825. <a-form-item :wrapperCol="{ span: 20 }" style="text-align: center">
  826. <a-button htmlType="submit" type="primary" :loading="loading">确定</a-button>
  827. <!-- <a-button style="margin-left: 8px" @click="prevStep" v-show="step == 1">上一步</a-button> -->
  828. </a-form-item>
  829. </a-form>
  830. <a-modal v-model="visible" title="广告组创建信息">
  831. <div>创建成功:{{ allForm.success }}条</div>
  832. <template slot="footer">
  833. <a-button key="submit" type="primary" @click="handleOk"> 返回列表 </a-button>
  834. </template>
  835. </a-modal>
  836. <templateModal ref="templateModal" @getData="getTemplateList" />
  837. <a-modal title="查看视频" v-model="visibleVideo" :width="400" :footer="null">
  838. <video class="video" :src="videoUrlShow" controls="controls" style="width: 100%">
  839. 您的浏览器不支持 video 标签。
  840. </video>
  841. </a-modal>
  842. <a-modal
  843. :maskClosable="false"
  844. title="选择素材"
  845. v-model="visibleMatemal"
  846. @ok="handleOkShow"
  847. @cancel="cancelAll"
  848. :width="1000"
  849. >
  850. <a-row :gutter="24">
  851. <a-col :span="8">
  852. <a-form-item label="类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
  853. <a-radio-group v-model="mediaDimension" style="width: 300px">
  854. <a-radio-button value="a">按时间查询</a-radio-button>
  855. <a-radio-button value="b">按消耗查询</a-radio-button>
  856. </a-radio-group>
  857. </a-form-item>
  858. </a-col>
  859. <a-col :span="8" v-if="mediaDimension == 'a'">
  860. <a-form-item label="日期选择" :labelCol="labelCol" :wrapperCol="wrapperCol">
  861. <a-range-picker name="buildTime" v-model="time" />
  862. </a-form-item>
  863. </a-col>
  864. <a-col :span="8" v-else>
  865. <a-form-item label="消耗时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
  866. <a-select v-model="costType" placeholder="请选择消耗时间" style="width: 100%">
  867. <a-select-option :value="1">昨天</a-select-option>
  868. <a-select-option :value="2">近七天</a-select-option>
  869. <a-select-option :value="3">近14天</a-select-option>
  870. <a-select-option :value="4">近一个月</a-select-option>
  871. <a-select-option :value="5">近三个月</a-select-option>
  872. <a-select-option :value="6">近半年</a-select-option>
  873. <a-select-option :value="7">近一年</a-select-option>
  874. <a-select-option :value="8">全部</a-select-option>
  875. </a-select>
  876. </a-form-item>
  877. </a-col>
  878. <a-col :span="8">
  879. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol">
  880. 当前选择数量
  881. {{ sumContent + '/' + (getData('unitType')=='4'?(getData('createType')=='0'?getData('createCount'):getData('createCount')*15):getData('createCount')*getData('imageCount') )}}
  882. <a-button type="primary" @click="tongbu()" :loading="tongbuLoading" style="margin-left:10px" v-if="mediaDimension == 'a'">
  883. 刷新素材</a-button>
  884. </a-form-item>
  885. </a-col>
  886. </a-row>
  887. <a-row :gutter="24">
  888. <a-col :span="8">
  889. <a-form-item label="视频ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
  890. <a-input placeholder="请输入视频ID" v-model="photoId"/>
  891. </a-form-item>
  892. </a-col>
  893. <a-col :span="8">
  894. <a-form-item label="视频名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
  895. <a-input placeholder="请输入视频名称" v-model="photoName"/>
  896. </a-form-item>
  897. </a-col>
  898. <!-- <a-col :span="8" v-if="mediaDimension == 'a'">
  899. <a-form-item label="唯一标识" :labelCol="labelCol" :wrapperCol="wrapperCol">
  900. <a-input placeholder="请输入唯一标识,多个以,隔开" v-model="md5Str"/>
  901. </a-form-item>
  902. </a-col> -->
  903. <a-col :span="4">
  904. <a-button style="position: relative;top: 4px;" @click="selectAllVideo">
  905. 全选
  906. </a-button>
  907. <a-button type="primary" style="position: relative;top: 4px;margin-left:5px" @click="searchVideo">
  908. 搜索
  909. </a-button>
  910. </a-col>
  911. <!-- <a-col :span="12">
  912. <a-form-item label="筛选条件" :labelCol="labelCol" :wrapperCol="wrapperCol">
  913. <a-select v-model="orderBy" style="width: 100%">
  914. <a-select-option value="time"> 按时间排序 </a-select-option>
  915. <a-select-option value="cost"> 按消耗排序</a-select-option>
  916. </a-select>
  917. </a-form-item>
  918. </a-col> -->
  919. </a-row>
  920. <ul v-if="dataSource.length > 0" style="overflow: auto; padding-left: 0">
  921. <a-checkbox-group v-model="checkVideo" style="width: 100%" @change="setData">
  922. <li v-for="(item, index) of dataSource" :key="index" class="chouzhen" style="height: 400px">
  923. <!-- <video class="video" :src="item.url" controls="controls" style="width:100%">
  924. 您的浏览器不支持 video 标签。
  925. </video> -->
  926. <a-checkbox
  927. :value="item.photoId"
  928. style="width: 100%; position: absolute; z-index: 100; right: 0; top: 0"
  929. >
  930. <img :src="item.coverUrl" alt="" style="width: 90%; margin-bottom: 30px" />
  931. <div>
  932. <div style="width: 100%; text-align: center">
  933. {{ item.statDate&&item.channelType == 0 ?
  934. '内部 ' + item.statDate.split(' ')[0]:item.statDate&&item.channelType == 1 ?
  935. '素造 ' + item.statDate.split(' ')[0]: item.charge&&item.channelType == 0?
  936. '内部 ' + item.charge :'素造 ' + item.charge}}
  937. </div>
  938. </div>
  939. </a-checkbox>
  940. <a @click="matemalVideo(item, index)" style="position: absolute; z-index: 100; right: 56px; bottom: 5px"
  941. >查看视频</a
  942. >
  943. </li>
  944. </a-checkbox-group>
  945. </ul>
  946. <div v-else style="width: 100%; height: 400px; display: flex; justify-content: center; align-items: center">
  947. <img
  948. 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"
  949. alt=""
  950. v-if="!loadingVideoList"
  951. />
  952. <img v-else src="@/views/modules/material/loading.gif" />
  953. </div>
  954. <!-- <a-button slot="tabBarExtraContent" type="primary" @click="tongbu()" :loading="tongbuLoading">
  955. 刷新素材</a-button
  956. > -->
  957. </a-tabs>
  958. <div style="text-align: right">
  959. <a-pagination
  960. size="small"
  961. :showTotal="ipagination.showTotal"
  962. style="float: right"
  963. v-if="dataSource.length > 0"
  964. showQuickJumper
  965. :pageSize.sync="ipagination.pageSize"
  966. :total="ipagination.total"
  967. v-model="ipagination.current"
  968. @change="getDataSource"
  969. />
  970. </div>
  971. </a-modal>
  972. <a-modal title="监测链接名称" v-model="clickTrackUrlShow">
  973. <template slot="footer">
  974. <a-button
  975. key="submit"
  976. :disabled="trackUrlName == '' && !showTrackUrlNameElse"
  977. type="primary"
  978. @click="clickTrackUrlOk"
  979. >
  980. 确定
  981. </a-button>
  982. </template>
  983. <a-input placeholder="请输入监测链接名称" v-model="trackUrlName" @blur="changeTrackUrlName" style="width: 100%" />
  984. <span style="color: red" v-if="!showTrackUrlNameElse">名称重复</span>
  985. </a-modal>
  986. <a-modal title="监测链接列表" v-model="clickTrackUrlList" :width="1000" :footer="null">
  987. <a-spin :spinning="spinning">
  988. <a-row :gutter="10" class="onlny-click-track">
  989. <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
  990. <a-card class="search-box" style="over-flow: auto">
  991. <!-- <a-input v-model="trackName"></a-input> -->
  992. <a-input-search
  993. placeholder="请输入监测链接名称"
  994. enter-button="Search"
  995. size="large"
  996. @search="onSearch"
  997. style="width: 40%; margin-bottom: 20px"
  998. v-model="trackName"
  999. />
  1000. <a-list size="large" bordered :dataSource="trackUrlList">
  1001. <a-list-item slot="renderItem" slot-scope="item" :title="item.trackUrl" style="line-height: 50px">
  1002. <div slot="actions">
  1003. <a @click="okClickTrackUrl(item)">选择</a>
  1004. <a-divider type="vertical" />
  1005. <a @click="removeClickTrackUrl(item)">删除</a>
  1006. </div>
  1007. {{ item.trackName }}
  1008. <a-input v-model="item.trackUrl" readOnly style="margin: 10px; width: 70%"></a-input>
  1009. </a-list-item>
  1010. </a-list>
  1011. </a-card>
  1012. </a-col>
  1013. </a-row>
  1014. </a-spin>
  1015. </a-modal>
  1016. <a-modal title="收藏标题" v-model="creativeTagVisible" :width="1000" @ok="okTag">
  1017. <el-tree :data="optionsTag" show-checkbox node-key="id" :props="defaultProps" :check-strictly="true" ref="tree">
  1018. </el-tree>
  1019. </a-modal>
  1020. <a-modal title="推荐标题" v-model="titleVisible" :width="1000" :footer="null">
  1021. <a-row :gutter="10">
  1022. <a-col :sm="10" style="margin-bottom: 20px; z-index: 10">
  1023. <a-card class="search-box" style="min-height: 500px">
  1024. <div style="margin-bottom: 30px">
  1025. <span style="display: inline-block; width: 80px">行业</span>
  1026. <a-cascader
  1027. style="margin-top: 1rem; width: 300px"
  1028. v-model="dataOne"
  1029. :options="options"
  1030. :showSearch="{ filter }"
  1031. expandTrigger="hover"
  1032. @change="onChangeTitle"
  1033. placeholder="请选择行业"
  1034. >
  1035. <a-icon type="smile" slot="suffixIcon" class="test" />
  1036. </a-cascader>
  1037. </div>
  1038. <div style="margin-bottom: 30px">
  1039. <span style="display: inline-block; width: 80px">关键词</span>
  1040. <a-input placeholder="请输入关键词" v-model="value" style="width: 300px" />
  1041. </div>
  1042. <span style="display: inline-block; width: 80px; float: left"></span>
  1043. <a-button type="primary" @click="searchQuery" :disabled="value == ''">生成</a-button>
  1044. </a-card>
  1045. </a-col>
  1046. <a-col :sm="14" style="margin-bottom: 20px; z-index: 10">
  1047. <a-card class="search-box" style="over-flow: auto">
  1048. <a-list size="large" bordered :dataSource="title">
  1049. <a-list-item slot="renderItem" slot-scope="item">
  1050. <a slot="actions" @click="okTitle(item)">选择</a>
  1051. {{ item }}
  1052. </a-list-item>
  1053. </a-list>
  1054. </a-card>
  1055. </a-col>
  1056. </a-row>
  1057. </a-modal>
  1058. <a-modal title="收藏标题" v-model="cunTitleVisible" :width="1000" :footer="null">
  1059. <a-row :gutter="10">
  1060. <a-col :sm="24" style="margin-bottom: 20px; z-index: 10">
  1061. <a-card class="search-box" style="over-flow: auto">
  1062. <a-list size="large" bordered :dataSource="cunTitleList">
  1063. <a-list-item slot="renderItem" slot-scope="item">
  1064. <div slot="actions">
  1065. <a @click="okTitleCun(item)">选择</a>
  1066. <a-divider type="vertical" />
  1067. <a @click="removeTitleCun(item)">删除</a>
  1068. </div>
  1069. {{ item.title }}
  1070. </a-list-item>
  1071. </a-list>
  1072. </a-card>
  1073. </a-col>
  1074. </a-row>
  1075. </a-modal>
  1076. </a-card>
  1077. </template>
  1078. <script>
  1079. import { getAction, postAction, deleteAction } from '@/api/manage'
  1080. import moment from 'moment'
  1081. import { mapGetters } from 'vuex'
  1082. import jq from 'jquery'
  1083. import selectCheckAll from '@/views/modules/kuaishouapp/account/stepForm/stepModule/test'
  1084. import templateModal from '@/views/modules/kuaishouapp/crossAccount/templateModal'
  1085. import checkBoxGroup from '@/components/formComponents/checkBoxGroup'
  1086. let dateQuantumRangeConst = ''
  1087. const columns = [
  1088. {
  1089. title: '人群',
  1090. dataIndex: 'orientationName',
  1091. scopedSlots: {
  1092. customRender: 'orientationName',
  1093. },
  1094. width: 150,
  1095. },
  1096. {
  1097. title: '属性',
  1098. dataIndex: 'populationType',
  1099. filters: [
  1100. {
  1101. text: '上传人群',
  1102. value: '1',
  1103. },
  1104. {
  1105. text: '广告人群',
  1106. value: '2',
  1107. },
  1108. {
  1109. text: '主题专区',
  1110. value: '3',
  1111. },
  1112. {
  1113. text: '逻辑规则',
  1114. value: '4',
  1115. },
  1116. {
  1117. text: '人群扩展',
  1118. value: '5',
  1119. },
  1120. {
  1121. text: '平台定制',
  1122. value: '6',
  1123. },
  1124. {
  1125. text: '定制付费',
  1126. value: '7',
  1127. },
  1128. {
  1129. text: '网红粉丝类别',
  1130. value: '8',
  1131. },
  1132. {
  1133. text: '内容付费行为',
  1134. value: '9',
  1135. },
  1136. {
  1137. text: '移动应用安装',
  1138. value: '10',
  1139. },
  1140. {
  1141. text: '快手使用活跃度',
  1142. value: '11',
  1143. },
  1144. {
  1145. text: '行业分类',
  1146. value: '12',
  1147. },
  1148. {
  1149. text: '商业兴趣',
  1150. value: '13',
  1151. },
  1152. {
  1153. text: '固化标签',
  1154. value: '14',
  1155. },
  1156. {
  1157. text: '行业偏好',
  1158. value: '15',
  1159. },
  1160. {
  1161. text: '第三方标签',
  1162. value: '16',
  1163. },
  1164. {
  1165. text: '产品关键词',
  1166. value: '17',
  1167. },
  1168. ],
  1169. onFilter: (value, record) => record.populationType.toString().toLowerCase().includes(value.toLowerCase()),
  1170. scopedSlots: {
  1171. customRender: 'populationType',
  1172. },
  1173. width: 150,
  1174. },
  1175. {
  1176. title: '创建时间',
  1177. dataIndex: 'createTime',
  1178. scopedSlots: {
  1179. customRender: 'createTime',
  1180. },
  1181. sorter: (a, b) => a.createTime - b.createTime,
  1182. },
  1183. ]
  1184. function tqFun(qcArr1) {
  1185. var tempArr = []
  1186. function bbFun(qcArr) {
  1187. for (var i = 0; i < qcArr.length; i++) {
  1188. if (qcArr[i] instanceof Array) {
  1189. bbFun(qcArr[i])
  1190. } else {
  1191. tempArr.push(qcArr[i])
  1192. }
  1193. }
  1194. return tempArr
  1195. }
  1196. return bbFun(qcArr1)
  1197. }
  1198. export default {
  1199. name: 'creat-unit',
  1200. components: {
  1201. selectCheckAll,
  1202. templateModal,
  1203. checkBoxGroup,
  1204. },
  1205. props: {
  1206. campaignId: {
  1207. type: String,
  1208. default() {
  1209. return null
  1210. },
  1211. },
  1212. },
  1213. data() {
  1214. return {
  1215. showNumber:false,
  1216. md5Str:'',
  1217. photoId:'',
  1218. photoName:'',
  1219. costType: 1,
  1220. uriCheck: false,
  1221. templateLoading: false,
  1222. dataOne: [],
  1223. actionBarTextList: [],
  1224. trackName: '',
  1225. trackUrlList: [],
  1226. showSite: false,
  1227. appList: [],
  1228. siteList: [],
  1229. createOptions: [],
  1230. fieldNames: {
  1231. label: 'category_name',
  1232. value: 'category_id',
  1233. children: 'child',
  1234. },
  1235. defaultProps: {
  1236. children: 'children',
  1237. label: 'label',
  1238. id: 'id',
  1239. },
  1240. showTrackUrlNameElse: true,
  1241. clickTrackUrlList: false,
  1242. spinning: false,
  1243. trackUrlName: '',
  1244. tagName: '',
  1245. labelCol: {
  1246. lg: {
  1247. span: 6,
  1248. },
  1249. sm: {
  1250. span: 6,
  1251. },
  1252. xs: {
  1253. span: 6,
  1254. },
  1255. md: {
  1256. span: 6,
  1257. },
  1258. },
  1259. wrapperCol: {
  1260. lg: {
  1261. span: 18,
  1262. },
  1263. sm: {
  1264. span: 18,
  1265. },
  1266. xs: {
  1267. span: 14,
  1268. },
  1269. md: {
  1270. span: 14,
  1271. },
  1272. },
  1273. ipagination: {
  1274. current: 1,
  1275. pageSize: 10,
  1276. // pageSizeOptions: ['10', '20', '30'],
  1277. showTotal: (total, range) => {
  1278. return range[0] + '-' + range[1] + ' 共' + total + '条'
  1279. },
  1280. showQuickJumper: true,
  1281. // showSizeChanger: true,
  1282. total: 0,
  1283. onChange: (current) => {
  1284. // 切换分页时的回调,
  1285. // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
  1286. this.ipagination.current = current
  1287. },
  1288. },
  1289. showVideo: true,
  1290. videoList: [],
  1291. orderBy: 'time',
  1292. mediaDimension: 'a',
  1293. visibleMatemal: false,
  1294. loadingVideoList: false,
  1295. checkVideo: [],
  1296. checkVideoAll: [],
  1297. checkVideoWai: [],
  1298. checkVideoWhole: [],
  1299. dataSource: [],
  1300. active: 0,
  1301. time: [],
  1302. channelType: 0,
  1303. creativeMaterialType: '',
  1304. tab: [
  1305. // {
  1306. // value: 2,
  1307. // label: '全部',
  1308. // },
  1309. {
  1310. value: 0,
  1311. label: '内部',
  1312. },
  1313. {
  1314. value: 1,
  1315. label: '外部',
  1316. },
  1317. ],
  1318. templateList: [],
  1319. allianceAccount: false,
  1320. creativeCategorySwitch: false,
  1321. actionbarClickUrlSwitch: false,
  1322. tongbuLoading: false,
  1323. convert: false,
  1324. convertId: '',
  1325. convertList: [],
  1326. checkedTrue: false,
  1327. nameValue: '',
  1328. visible: false,
  1329. timeRange: [],
  1330. form: this.$form.createForm(this),
  1331. step: 0,
  1332. people: '2',
  1333. targeted: '2',
  1334. topMiddle: false,
  1335. topMiddleNo: false,
  1336. keyValue: '',
  1337. keyValueNo: '',
  1338. columns,
  1339. selectedRowKeys: [],
  1340. selectedRowKeysValue: [],
  1341. selectedRowKeysNo: [],
  1342. selectedRowKeysValueNo: [],
  1343. data: [],
  1344. populationData: {},
  1345. url: {
  1346. insertTemplateUrl: '/kuaishou/create/createGroups',
  1347. userAllocationList: '/ctop/userAllocation/list',
  1348. campaignList: '/kuaishou/kuaiShouCampaignTemplate/list',
  1349. getDeepConversionUrl: '/kuaishou/kuaiShouConversionTypes/getIsActivate',
  1350. getCampaignTemplate: '/kuaishou/kuaiShouCampaignTemplate/getKuaiShouCampaignTemplate',
  1351. appListUrl: '/kuaishou/kuaiShouCreateAppTemplate/list',
  1352. },
  1353. appList: [],
  1354. appId: '',
  1355. loading: false,
  1356. campaignTemplateId: '',
  1357. campaignType: null,
  1358. maxBid: 0,
  1359. allForm: {
  1360. dayBudget: '0',
  1361. time: '1',
  1362. scheduleTime: '1',
  1363. scheduleTimeData:
  1364. '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  1365. group: [],
  1366. groupTypeData: null,
  1367. fail: [],
  1368. success: [],
  1369. sceneId: [1],
  1370. appStore: ['huawei', 'oppo', 'vivo', 'xiaomi', 'meizu', 'smartisan'],
  1371. allianceAccount: '1',
  1372. description: '',
  1373. },
  1374. convertType: '1',
  1375. convertAllList: [],
  1376. dataList: [],
  1377. clickTrackUrlShow: false,
  1378. clickTrackUrlShowType: '1',
  1379. optionsTag: [],
  1380. creativeTagVisible: false,
  1381. visibleVideo: false,
  1382. videoUrlShow: '',
  1383. sumContent: 0,
  1384. titleVisible: false,
  1385. options: [],
  1386. value: '',
  1387. title: [],
  1388. cunTitleVisible: false,
  1389. cunTitleList: [],
  1390. createCount: 0,
  1391. tongbuLoading: false,
  1392. }
  1393. },
  1394. computed: {
  1395. count() {
  1396. return moment().startOf('day')
  1397. },
  1398. },
  1399. filters: {
  1400. getDate(value) {
  1401. let date = new Date(value)
  1402. let y = date.getFullYear()
  1403. let MM = date.getMonth() + 1
  1404. MM = MM < 10 ? '0' + MM : MM
  1405. let d = date.getDate()
  1406. d = d < 10 ? '0' + d : d
  1407. return y + '-' + MM + '-' + d
  1408. },
  1409. platform(str) {
  1410. var data = {
  1411. 1: 'Android应用下载',
  1412. 2: 'Android网页游戏',
  1413. 3: 'iOS应用下载',
  1414. 4: 'iOS网页游戏',
  1415. }
  1416. return data[str]
  1417. },
  1418. },
  1419. methods: {
  1420. searchVideo() {
  1421. let url = '/kuaishou/kuaiShouVideoGet/getBatchV2VideoList'
  1422. let params = {}
  1423. // localStorage.getItem('campaignAccountId')
  1424. params.accountId = localStorage.getItem('campaignAccountId')
  1425. params.pageSize = this.ipagination.pageSize
  1426. params.pageNo = this.ipagination.current
  1427. params.status = 0
  1428. params.photoId = this.photoId
  1429. params.photoName = this.photoName
  1430. if(this.mediaDimension == 'a'){
  1431. url = '/kuaishou/kuaiShouVideoGet/getBatchV2VideoList'
  1432. // params.signatures = this.md5Str
  1433. if (this.time.length > 0) {
  1434. // params.startDate = moment(this.time[0]).format('YYYY-MM-DD')
  1435. // params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
  1436. params.startDate = moment(this.time[0]).format('YYYY-MM-DD') + ' 00:00:00'
  1437. params.endDate = moment(this.time[1]).format('YYYY-MM-DD') + ' 23:59:59'
  1438. }
  1439. }else if(this.mediaDimension == 'b'){
  1440. url = '/kuaishou/kuaiShouVideoGet/getVideoListByCostType'
  1441. params.costType = this.costType
  1442. }
  1443. // params.materialType = this.creativeMaterialType
  1444. // params.channelType = this.channelType
  1445. // params.orderBy = this.orderBy
  1446. this.showVideoList(url, params)
  1447. },
  1448. tongbu() {
  1449. this.tongbuLoading = true
  1450. getAction('/kuaishou/batch/syncVideo', {
  1451. accountId: localStorage.getItem('campaignAccountId'),
  1452. }).then((res) => {
  1453. if (res.success) {
  1454. this.$message.success(res.message)
  1455. this.tongbuLoading = false
  1456. this.searchVideo()
  1457. } else {
  1458. this.$message.error(res.message)
  1459. this.tongbuLoading = false
  1460. }
  1461. })
  1462. },
  1463. removeTitleCun(item) {
  1464. deleteAction('/kuaishou/kuaiShouTitleCollection/delete', {
  1465. id: item.id,
  1466. }).then((res) => {
  1467. if (res.success) {
  1468. this.getCunTitle()
  1469. }
  1470. })
  1471. },
  1472. okTitleCun(item) {
  1473. this.allForm.description = item.title
  1474. this.form.setFieldsValue({
  1475. description: item.title,
  1476. })
  1477. this.cunTitleVisible = false
  1478. this.cunTitleList = []
  1479. },
  1480. cunTitle() {
  1481. if (this.getData('description') && this.getData('description') == '') {
  1482. this.$message.error('请填写广告语后再进行收藏')
  1483. } else {
  1484. var params = {}
  1485. params.accountId = localStorage.getItem('campaignAccountId')
  1486. params.userId = this.userInfo().id
  1487. params.title = this.getData('description')
  1488. postAction('/kuaishou/kuaiShouTitleCollection/add', params).then((res) => {
  1489. if (res.success) {
  1490. this.$message.success('收藏成功')
  1491. } else {
  1492. this.$message.error(res.message)
  1493. }
  1494. })
  1495. }
  1496. },
  1497. showCunTitle() {
  1498. this.cunTitleVisible = true
  1499. this.getCunTitle()
  1500. },
  1501. getCunTitle() {
  1502. var params = {}
  1503. params.accountId = localStorage.getItem('campaignAccountId')
  1504. params.userId = this.userInfo().id
  1505. params.pageNo = 1
  1506. params.pageSize = 500
  1507. getAction('/kuaishou/kuaiShouTitleCollection/list', params).then((res) => {
  1508. if (res.success) {
  1509. this.cunTitleList = res.result.records
  1510. }
  1511. })
  1512. },
  1513. okTitle(item) {
  1514. this.allForm.description = item
  1515. this.$nextTick(() => {
  1516. this.form.setFieldsValue({
  1517. description: item,
  1518. })
  1519. })
  1520. this.titleVisible = false
  1521. this.dataOne = []
  1522. this.value = ''
  1523. this.title = []
  1524. },
  1525. searchQuery() {
  1526. // /ctop/creativeTitle/titleSuggestion
  1527. getAction('/ctop/creativeTitle/titleSearch', {
  1528. firstCategory: this.dataOne[0],
  1529. secondCategory: this.dataOne[1],
  1530. keywords: this.value,
  1531. }).then((res) => {
  1532. console.log(res)
  1533. this.title = res.result ? res.result : []
  1534. })
  1535. // firstCategory,secondCategory,keywords
  1536. },
  1537. onChangeTitle(value, selectedOptions) {
  1538. this.dataOne = value
  1539. this.value = ''
  1540. this.title = []
  1541. },
  1542. filter(inputValue, path) {
  1543. return path.some((option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
  1544. },
  1545. showTitle() {
  1546. this.titleVisible = true
  1547. this.getHangye()
  1548. },
  1549. getHangye() {
  1550. getAction('/ctop/creativeTitle/getTitleLabel', '').then((res) => {
  1551. if (res.success) {
  1552. this.options = res.result.map((item) => {
  1553. return {
  1554. label: item.label,
  1555. value: item.value,
  1556. children:
  1557. item.children.length > 0
  1558. ? [
  1559. {
  1560. label: '不限',
  1561. value: 0,
  1562. },
  1563. ].concat(item.children)
  1564. : [
  1565. {
  1566. label: '不限',
  1567. value: 0,
  1568. },
  1569. ],
  1570. }
  1571. })
  1572. this.options = [
  1573. {
  1574. label: '不限',
  1575. value: 0,
  1576. },
  1577. ].concat(this.options)
  1578. if (this.dataOne.length > 0) {
  1579. return
  1580. } else {
  1581. this.dataOne = [0]
  1582. }
  1583. }
  1584. })
  1585. },
  1586. matemalVideo(item) {
  1587. this.visibleVideo = true
  1588. this.videoUrlShow = item.url
  1589. },
  1590. showCunTag(type) {
  1591. this.creativeTagVisible = true
  1592. var params = {}
  1593. params.accountId = localStorage.getItem('campaignAccountId')
  1594. params.userId = this.userInfo().id
  1595. params.pageSize = 1000
  1596. params.pageNo = 1
  1597. getAction('/tag/kuaiShouCreativeTagCollection/list', params).then((res) => {
  1598. if (res.success) {
  1599. // console.log(res.result)
  1600. this.optionsTag = res.result.records.map((item) => {
  1601. return {
  1602. id: item.id,
  1603. label: item.tagName,
  1604. children: JSON.parse(item.tagArray).map((item) => {
  1605. return {
  1606. id: item,
  1607. label: item,
  1608. disabled: true,
  1609. }
  1610. }),
  1611. }
  1612. })
  1613. }
  1614. })
  1615. },
  1616. okTag() {
  1617. var data = this.$refs.tree.getCheckedKeys()
  1618. if (data.length > 1) {
  1619. this.$message.error('只能选择一个选项')
  1620. // this.$refs.tree.setCheckedKeys([]);
  1621. } else {
  1622. var params = {}
  1623. params.accountId = localStorage.getItem('campaignAccountId')
  1624. params.userId = this.userInfo().id
  1625. params.pageSize = 1000
  1626. params.pageNo = 1
  1627. params.id = data[0]
  1628. getAction('/tag/kuaiShouCreativeTagCollection/list', params).then((res) => {
  1629. if (res.success) {
  1630. // console.log(res.result)
  1631. this.$nextTick(() => {
  1632. this.form.setFieldsValue({
  1633. creativeTag: JSON.parse(res.result.records[0].tagArray).map((item) => {
  1634. return item
  1635. }),
  1636. })
  1637. this.form.validateFields(['creativeTag'])
  1638. })
  1639. this.creativeTagVisible = false
  1640. } else {
  1641. this.$message.error('选择出错,请稍后选择或自行手填')
  1642. }
  1643. })
  1644. }
  1645. },
  1646. getInfo() {
  1647. if (this.tagName == '') {
  1648. this.$message.error('请输入分类名称')
  1649. return
  1650. } else {
  1651. let params = {}
  1652. params.tagName = this.tagName
  1653. // params.campaignBudget = this.campaignBudget
  1654. params.tagArray = JSON.stringify(this.getData('creativeTag'))
  1655. params.userId = this.userInfo().id
  1656. params.accountId = localStorage.getItem('campaignAccountId')
  1657. postAction('/tag/kuaiShouCreativeTagCollection/add', params).then((res) => {
  1658. if (res.success) {
  1659. this.$message.success('添加成功')
  1660. this.tagName = ''
  1661. } else {
  1662. this.$message.error(res.message)
  1663. }
  1664. })
  1665. }
  1666. },
  1667. onSearch(value) {
  1668. var params = {}
  1669. params.accountId = localStorage.getItem('campaignAccountId')
  1670. params.userId = this.userInfo().id
  1671. params.trackType = this.clickTrackUrlShowType
  1672. params.pageNo = 1
  1673. params.pageSize = 500
  1674. params.trackName = value
  1675. getAction('/kuaishou/kuaiShouTrackUrlCollection/list', params).then((res) => {
  1676. if (res.success) {
  1677. this.trackUrlList = res.result.records
  1678. } else {
  1679. this.$message.error(res.message)
  1680. }
  1681. })
  1682. },
  1683. okClickTrackUrl(item) {
  1684. this.clickTrackUrlList = false
  1685. if (this.clickTrackUrlShowType == '1') {
  1686. this.form.setFieldsValue({
  1687. clickTrackUrl: item.trackUrl,
  1688. })
  1689. } else {
  1690. this.form.setFieldsValue({
  1691. actionbarClickUrl: item.trackUrl,
  1692. })
  1693. }
  1694. },
  1695. removeClickTrackUrl(item) {
  1696. deleteAction('/kuaishou/kuaiShouTrackUrlCollection/delete', {
  1697. id: item.id,
  1698. }).then((res) => {
  1699. if (res.success) {
  1700. this.getClickTrackUrlList(this.clickTrackUrlShowType)
  1701. }
  1702. })
  1703. },
  1704. getClickTrackUrlList(type) {
  1705. this.spinning = true
  1706. this.clickTrackUrlList = true
  1707. this.trackUrlList = []
  1708. var params = {}
  1709. params.accountId = localStorage.getItem('campaignAccountId')
  1710. params.trackType = type
  1711. params.userId = this.userInfo().id
  1712. params.pageNo = 1
  1713. params.pageSize = 500
  1714. getAction('/kuaishou/kuaiShouTrackUrlCollection/list', params).then((res) => {
  1715. if (res.success) {
  1716. this.spinning = false
  1717. this.trackUrlList = res.result.records
  1718. } else {
  1719. this.spinning = false
  1720. this.$message.error(res.message)
  1721. }
  1722. })
  1723. },
  1724. ...mapGetters(['nickname', 'avatar', 'userInfo']),
  1725. changeTrackUrlName() {
  1726. var params = {}
  1727. params.accountId = localStorage.getItem('campaignAccountId')
  1728. params.userId = this.userInfo().id
  1729. params.trackName = this.trackUrlName
  1730. getAction('/kuaishou/kuaiShouTrackUrlCollection/checkTrackName', params).then((res) => {
  1731. this.showTrackUrlNameElse = res.result
  1732. })
  1733. },
  1734. clickTrackUrlOk() {
  1735. var params = {}
  1736. params.accountId = localStorage.getItem('campaignAccountId')
  1737. params.userId = this.userInfo().id
  1738. params.trackName = this.trackUrlName
  1739. params.trackType = this.clickTrackUrlShowType
  1740. params.trackUrl =
  1741. this.clickTrackUrlShowType == '1' ? this.getData('clickTrackUrl') : this.getData('actionbarClickUrl')
  1742. postAction('/kuaishou/kuaiShouTrackUrlCollection/add', params).then((res) => {
  1743. if (res.success) {
  1744. this.clickTrackUrlShow = false
  1745. this.trackUrlName = ''
  1746. this.$message.success('添加成功')
  1747. } else {
  1748. this.$message.error(res.message)
  1749. }
  1750. })
  1751. },
  1752. deleteData(index, item) {
  1753. this.videoList.splice(index, 1)
  1754. var deleteIndex = this.checkVideo.findIndex((c) => c == item.photoId)
  1755. this.checkVideo.splice(deleteIndex, 1)
  1756. for (let i = 0; i < this.checkVideoAll.length; i++) {
  1757. for (let j = 0; j < this.checkVideoAll[i].length; j++) {
  1758. if (this.checkVideoAll[i][j] == item.photoId) {
  1759. this.checkVideoAll[i] = this.checkVideo
  1760. }
  1761. }
  1762. }
  1763. // for (let i = 0; i < this.checkVideoWai.length; i++) {
  1764. // for (let j = 0; j < this.checkVideoWai[i].length; j++) {
  1765. // if (this.checkVideoWai[i][j] == item.photoId) {
  1766. // this.checkVideoWai[i] = this.checkVideo
  1767. // }
  1768. // }
  1769. // }
  1770. this.sumContent = this.checkVideo.length
  1771. // var deleteIndexAll = this.checkVideoAll.findIndex((c) => c == item.photoId)
  1772. // this.checkVideoAll.splice(deleteIndexAll, 1)
  1773. },
  1774. setVideUrl(photoId) {
  1775. this.videoList = []
  1776. getAction('/batch/kuaiShouGroupTemplate/getUrlByPhotoId', { photoId: photoId }).then((res) => {
  1777. if (res.success) {
  1778. this.videoList.push({ url: res.result.url, photoId: photoId, coverUrl: res.result.coverUrl })
  1779. } else {
  1780. }
  1781. })
  1782. },
  1783. changeData(data) {
  1784. if (data.length > 1 && data.findIndex((item) => item == 1) == 0) {
  1785. data.splice(
  1786. data.findIndex((item) => item == 1),
  1787. 1
  1788. )
  1789. } else if (data.length > 1 && data.findIndex((item) => item == 1) == data.length - 1) {
  1790. data.splice(0, data.length - 1)
  1791. } else if (data.length == 0) {
  1792. data.push(1)
  1793. }
  1794. },
  1795. selectAllVideo() {
  1796. this.checkVideo = this.dataSource.map((item) => {
  1797. return item.photoId
  1798. })
  1799. // if (this.active == 0) {
  1800. for (let i = 0; i < this.ipagination.current; i++) {
  1801. this.checkVideoAll.push([])
  1802. }
  1803. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1804. // } else if (this.active == 1) {
  1805. // for (let i = 0; i < this.ipagination.current; i++) {
  1806. // this.checkVideoWai.push([])
  1807. // }
  1808. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1809. // }
  1810. var sum = 0
  1811. for (let i = 0; i < this.checkVideoAll.length; i++) {
  1812. sum += this.checkVideoAll[i].length
  1813. }
  1814. for (let i = 0; i < this.checkVideoWai.length; i++) {
  1815. sum += this.checkVideoWai[i].length
  1816. }
  1817. this.sumContent = sum
  1818. if(this.getData('unitType') == '4'){
  1819. if (this.getData('createType') == '0') {
  1820. if (sum > this.getData('createCount')) {
  1821. this.$message.error('最多选择' + this.getData('createCount') + '个素材')
  1822. this.checkVideo = []
  1823. this.sumContent = this.sumContent - 10
  1824. // if (this.active == 0) {
  1825. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1826. }
  1827. } else {
  1828. if (sum > this.getData('createCount') * 15) {
  1829. this.$message.error('最多选择' + this.getData('createCount') * 15 + '个素材')
  1830. this.checkVideo = []
  1831. this.sumContent = this.sumContent - 15
  1832. // if (this.active == 0) {
  1833. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1834. // } else if (this.active == 1) {
  1835. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1836. // }
  1837. }
  1838. }
  1839. }else{
  1840. if (sum > this.getData('createCount')*this.getData('imageCount')) {
  1841. this.$message.error('最多选择'+this.getData('createCount')*this.getData('imageCount')+'个素材')
  1842. this.checkVideo = []
  1843. this.sumContent-=10
  1844. // if (this.active == 0) {
  1845. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1846. // } else if (this.active == 1) {
  1847. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1848. // }
  1849. }
  1850. }
  1851. },
  1852. setData(data) {
  1853. // if (this.active == 0) {
  1854. for (let i = 0; i < this.ipagination.current; i++) {
  1855. this.checkVideoAll.push([])
  1856. }
  1857. this.checkVideoAll[this.ipagination.current - 1] = data
  1858. // } else if (this.active == 1) {
  1859. // for (let i = 0; i < this.ipagination.current; i++) {
  1860. // this.checkVideoWai.push([])
  1861. // }
  1862. // this.checkVideoWai[this.ipagination.current - 1] = data
  1863. // }
  1864. var sum = 0
  1865. for (let i = 0; i < this.checkVideoAll.length; i++) {
  1866. sum += this.checkVideoAll[i].length
  1867. }
  1868. for (let i = 0; i < this.checkVideoWai.length; i++) {
  1869. sum += this.checkVideoWai[i].length
  1870. }
  1871. this.sumContent = sum
  1872. if(this.getData('unitType') == '4'){
  1873. if (this.getData('createType') == '0') {
  1874. if (sum > this.getData('createCount')) {
  1875. this.$message.error('最多选择' + this.getData('createCount') + '个素材')
  1876. this.checkVideo.pop()
  1877. this.sumContent--
  1878. // if (this.active == 0) {
  1879. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1880. // } else if (this.active == 1) {
  1881. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1882. // }
  1883. }
  1884. } else {
  1885. if (sum > this.getData('createCount') * 15) {
  1886. this.$message.error('最多选择' + this.getData('createCount') * 15 + '个素材')
  1887. this.checkVideo.pop()
  1888. this.sumContent--
  1889. // if (this.active == 0) {
  1890. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1891. // } else if (this.active == 1) {
  1892. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1893. // }
  1894. }
  1895. }
  1896. }else{
  1897. if (sum > this.getData('createCount')*this.getData('imageCount')) {
  1898. this.$message.error('最多选择'+this.getData('createCount')*this.getData('imageCount')+'个素材')
  1899. this.checkVideo.pop()
  1900. this.sumContent--
  1901. // if (this.active == 0) {
  1902. this.checkVideoAll[this.ipagination.current - 1] = this.checkVideo
  1903. // } else if (this.active == 1) {
  1904. // this.checkVideoWai[this.ipagination.current - 1] = this.checkVideo
  1905. // }
  1906. }
  1907. }
  1908. },
  1909. getVideoList() {
  1910. this.orderBy = 'time'
  1911. this.visibleMatemal = true
  1912. if (this.checkVideo.length > 0) {
  1913. } else {
  1914. this.showVideo = false
  1915. this.checkVideo = []
  1916. }
  1917. // this.active = 0
  1918. // this.time = []
  1919. // this.channelType = 0
  1920. this.creativeMaterialType = this.getData('creativeMaterialType')
  1921. this.searchVideo()
  1922. // this.getAction('/kuaishou/kuaiShouVideoGet/getBatchV2VideoList', {accountId:10168379}).then(res=>{
  1923. // console.log(res)
  1924. // })
  1925. // this.getAction('/kuaishou/kuaiShouVideoGet/getVideoListByCostType', {accountId:10168379,costType:1}).then(res=>{
  1926. // console.log(res)
  1927. // })
  1928. },
  1929. getDataSource(page, pageSize) {
  1930. console.log(this.checkVideo, this.checkVideoAll)
  1931. this.checkVideo = this.checkVideoAll[page-1]
  1932. this.ipagination.current = page
  1933. this.searchVideo()
  1934. },
  1935. cancelAll() {
  1936. // this.checkVideoAll = []
  1937. // this.checkVideoWei = []
  1938. this.ipagination.current = 1
  1939. this.mediaDimension = 'a'
  1940. this.time = []
  1941. this.costType = 1
  1942. this.photoId = ''
  1943. this.photoName = ''
  1944. this.visibleMatemal = false
  1945. this.md5Str = ""
  1946. },
  1947. handleOkShow() {
  1948. // this.checkVideoAll = [...new Set(this.checkVideoAll)]
  1949. var data = tqFun(this.checkVideoAll).concat(tqFun(this.checkVideoWai))
  1950. this.checkVideo = data
  1951. // console.log(this.checkVideoAll, this.checkVideo)
  1952. for (let i = 0; i < this.checkVideo.length; i++) {
  1953. this.setVideUrl(this.checkVideo[i])
  1954. if (i == this.checkVideo.length - 1) {
  1955. this.showVideo = true
  1956. this.visibleMatemal = false
  1957. this.cancelAll()
  1958. }
  1959. }
  1960. },
  1961. callback(key) {
  1962. this.channelType = key
  1963. this.checkVideo = []
  1964. this.ipagination.current = 1
  1965. this.time = []
  1966. if (key == 0) {
  1967. this.checkVideo = this.checkVideoAll[this.ipagination.current - 1]
  1968. } else if (key == 1) {
  1969. this.checkVideo = this.checkVideoWai[this.ipagination.current - 1]
  1970. }
  1971. },
  1972. changeType() {
  1973. this.$nextTick(() => {
  1974. if (this.getData('creativeMaterialType') == '1') {
  1975. if(this.getData('unitType') == '4') {
  1976. this.form.setFieldsValue({creativeName:'自定义创意_竖版视频'})
  1977. }else{
  1978. this.form.setFieldsValue({creativeName:'程序化创意_竖版视频'})
  1979. }
  1980. } else {
  1981. if(this.getData('unitType') == '4') {
  1982. this.form.setFieldsValue({creativeName:'自定义创意_横版视频'})
  1983. }else{
  1984. this.form.setFieldsValue({creativeName:'程序化创意_横版视频'})
  1985. }
  1986. }
  1987. })
  1988. },
  1989. lookTemplate(accountId, templateId) {
  1990. this.$refs.templateModal.handleOk(localStorage.getItem('campaignAccountId'), templateId, 'look')
  1991. },
  1992. addTemplate(accountId) {
  1993. this.$refs.templateModal.create(localStorage.getItem('campaignAccountId'), 'add')
  1994. },
  1995. getTemplate(accountId) {
  1996. var data = null
  1997. if (accountId) {
  1998. data = accountId
  1999. } else {
  2000. this.templateLoading = true
  2001. data = localStorage.getItem('campaignAccountId')
  2002. }
  2003. getAction('/batch/kuaishouTemplate/getTemplateByAccountId', {
  2004. accountId: data,
  2005. }).then((res) => {
  2006. if (res.success) {
  2007. this.getTemplateList(data)
  2008. }
  2009. })
  2010. },
  2011. getTemplateList(accountId) {
  2012. this.templateList = []
  2013. getAction('/batch/kuaishouTemplate/list', {
  2014. accountId: accountId,
  2015. }).then((res) => {
  2016. if (res.success) {
  2017. this.templateList = res.result.map((item, index) => {
  2018. return {
  2019. ...item,
  2020. key: index,
  2021. }
  2022. })
  2023. this.templateLoading = false
  2024. } else {
  2025. this.templateLoading = false
  2026. }
  2027. })
  2028. },
  2029. convertOk() {
  2030. var dataLink = []
  2031. dataLink = this.convertAllList.filter((item) => {
  2032. return item.convert_id == this.convertId.key
  2033. })
  2034. if (dataLink.length > 0) {
  2035. this.form.setFieldsValue({ clickTrackUrl: dataLink[0].click_url })
  2036. this.convert = false
  2037. }
  2038. },
  2039. showConvert() {
  2040. this.convertChange()
  2041. if (this.campaignType == 2) {
  2042. if (this.getData('appId')) {
  2043. this.convert = true
  2044. if (this.getPlatForm(this.getData('appId')) == 1 || this.getPlatForm(this.getData('appId')) == 2) {
  2045. this.convertType = '3'
  2046. } else {
  2047. this.convertType = '7'
  2048. }
  2049. } else {
  2050. this.$message.error('请选择应用')
  2051. }
  2052. } else {
  2053. this.convert = true
  2054. this.convertType = '1'
  2055. }
  2056. this.getConvertList()
  2057. },
  2058. convertChange() {
  2059. this.convertId = ''
  2060. },
  2061. getConvertList() {
  2062. var params = {}
  2063. params.accountId = localStorage.getItem('campaignAccountId')
  2064. params.type = this.convertType
  2065. getAction('/kuaishou/batch/getConvertList', params).then((res) => {
  2066. if (res.success) {
  2067. this.convertList = res.result.map((item) => {
  2068. return {
  2069. ...item,
  2070. convert_id: item.convert_id + '',
  2071. }
  2072. })
  2073. this.convertAllList.push(...this.convertList)
  2074. }
  2075. })
  2076. },
  2077. getCheck(e) {
  2078. this.checkedTrue = e.target.checked
  2079. },
  2080. addGroup() {
  2081. this.allForm.group.push({
  2082. bidType: 10,
  2083. // bid: '',
  2084. // cpaBid: '',
  2085. showTipCheck: false,
  2086. deepConversionBidCheck: false,
  2087. // unitName: '',
  2088. unitNameCheck: false,
  2089. deepConversionType: '',
  2090. deepConversionBid: '',
  2091. ocpxActionType: this.allForm.groupTypeData.isActivate == '1' ? 180 : 2,
  2092. })
  2093. },
  2094. resData(index) {
  2095. // this.allForm.group[index].bid = ''
  2096. // this.allForm.group[index].cpaBid = ''
  2097. this.allForm.group[index].showTipCheck = false
  2098. this.allForm.group[index].deepConversionBidCheck = false
  2099. this.allForm.group[index].deepConversionType = ''
  2100. this.allForm.group[index].deepConversionBid = ''
  2101. this.form.setFieldsValue({
  2102. bid: undefined,
  2103. })
  2104. this.form.setFieldsValue({
  2105. cpaBid: undefined,
  2106. })
  2107. },
  2108. removeGroup(index) {
  2109. this.allForm.group.splice(index, 1)
  2110. },
  2111. deep_conversion_bidTip(index) {
  2112. if (
  2113. this.allForm.group[index].deepConversionBid < this.getData('cpaBid')
  2114. ) {
  2115. this.allForm.group[index].deepConversionBidCheck = true
  2116. } else {
  2117. this.allForm.group[index].deepConversionBidCheck = false
  2118. }
  2119. },
  2120. checkGroup(e, index) {
  2121. if (e.target.value != '') {
  2122. getAction('/kuaishou/batch/checkUnitName', {
  2123. campaignId: localStorage.getItem('campaignList'),
  2124. unitName: e.target.value,
  2125. }).then((res) => {
  2126. if (res.success) {
  2127. this.allForm.group[index].unitNameCheck = !res.result
  2128. } else {
  2129. this.allForm.group[index].unitNameCheck = false
  2130. }
  2131. })
  2132. }
  2133. },
  2134. showTip(index) {
  2135. if (this.allForm.group[index].bidType == 1) {
  2136. if (this.getData('bid') < 0.2 || this.getData('bid') > this.maxBid) {
  2137. this.allForm.group[index].showTipCheck = true
  2138. } else {
  2139. this.allForm.group[index].showTipCheck = false
  2140. }
  2141. } else {
  2142. if (this.getData('cpaBid') < 1 || this.getData('cpaBid') > this.maxBid) {
  2143. this.allForm.group[index].showTipCheck = true
  2144. } else {
  2145. this.allForm.group[index].showTipCheck = false
  2146. }
  2147. }
  2148. },
  2149. getScheduleTime(item) {
  2150. this.allForm.scheduleTimeData = item
  2151. },
  2152. setTime(e) {
  2153. if (e.target.value == '2') {
  2154. this.timeRange[0] = moment().startOf('day')
  2155. this.timeRange[1] = moment().add(1, 'months')
  2156. }
  2157. },
  2158. setTimeAll(e) {
  2159. if (e.target.value == '2') {
  2160. this.$nextTick(() => {
  2161. this.$refs.selectCheck.init()
  2162. })
  2163. } else {
  2164. }
  2165. },
  2166. getData(className) {
  2167. return this.form.getFieldValue(className)
  2168. },
  2169. bidCheck(rule, value, callback) {
  2170. if (value < 0.2) {
  2171. callback('不得低于0.2元')
  2172. } else {
  2173. callback()
  2174. }
  2175. },
  2176. cpaBidCheck(rule, value, callback) {
  2177. if (value < 1) {
  2178. callback('不得低于1元')
  2179. } else {
  2180. callback()
  2181. }
  2182. },
  2183. handleConfirmValue(rule, value, callback) {
  2184. if (value != '' && value != undefined) {
  2185. getAction('/kuaishou/batch/checkUnitName', {
  2186. campaignId: localStorage.getItem('campaignList'),
  2187. unitName: value + '_0',
  2188. }).then((res) => {
  2189. if (res.success) {
  2190. if (!res.result) {
  2191. callback('广告组名称重复')
  2192. } else {
  2193. callback()
  2194. }
  2195. } else {
  2196. callback()
  2197. }
  2198. })
  2199. } else {
  2200. callback()
  2201. }
  2202. },
  2203. budgetValue(rule, value, callback) {
  2204. if (value < 100 || value > 100000000) {
  2205. callback('不小于100,不超过100000000,仅支持输入自然数')
  2206. }
  2207. callback()
  2208. },
  2209. handleConfirmBid(rule, value, callback) {
  2210. if (this.bid == 0 || this.bid <= 0.2 || this.bid >= 100) {
  2211. callback('不得低于0.2元,不得高于100元')
  2212. }
  2213. callback()
  2214. },
  2215. handleConfirmCpaBid(rule, value, callback) {
  2216. if (this.ocpxActionType == '2' && (this.cpaBid == 0 || this.cpaBid <= 1 || this.cpaBid >= 3000)) {
  2217. callback('金额不得低于1元,不得高于3000元')
  2218. }
  2219. if (this.ocpxActionType == '180' && (this.cpaBid == 0 || this.cpaBid <= 5 || this.cpaBid >= 3000)) {
  2220. callback('金额不得低于5元,不得高于3000元')
  2221. }
  2222. callback()
  2223. },
  2224. onSelectChange(selectedRowKeys, selectionRows) {
  2225. this.selectedRowKeys = selectedRowKeys
  2226. this.selectedRowKeysValue = selectionRows.map((item) => {
  2227. return {
  2228. orientationId: item.orientationId,
  2229. orientationName: item.orientationName,
  2230. }
  2231. })
  2232. },
  2233. getCheckboxProps(record) {
  2234. return {
  2235. props: {
  2236. disabled: this.selectedRowKeysValueNo.some((item) => item.orientationId === record.orientationId),
  2237. },
  2238. }
  2239. },
  2240. onSelectChangeNo(selectedRowKeys, selectionRows) {
  2241. this.selectedRowKeysNo = selectedRowKeys
  2242. this.selectedRowKeysValueNo = selectionRows.map((item) => {
  2243. return {
  2244. orientationId: item.orientationId,
  2245. orientationName: item.orientationName,
  2246. }
  2247. })
  2248. },
  2249. getCheckboxPropsNo(record) {
  2250. return {
  2251. props: {
  2252. disabled: this.selectedRowKeysValue.some((item) => item.orientationId === record.orientationId),
  2253. },
  2254. }
  2255. },
  2256. okSelect() {
  2257. this.keyValue = ''
  2258. this.topMiddle = false
  2259. for (let i = 0; i < this.selectedRowKeysValue.length; i++) {
  2260. this.keyValue += this.selectedRowKeysValue[i].orientationName + ' '
  2261. }
  2262. },
  2263. okSelectNo() {
  2264. this.keyValueNo = ''
  2265. this.topMiddleNo = false
  2266. for (let i = 0; i < this.selectedRowKeysValueNo.length; i++) {
  2267. this.keyValueNo += this.selectedRowKeysValueNo[i].orientationName + ' '
  2268. }
  2269. },
  2270. radioChange() {
  2271. this.selectedRowKeys = []
  2272. this.selectedRowKeysValue = []
  2273. this.selectedRowKeysNo = []
  2274. this.selectedRowKeysValueNo = []
  2275. this.keyValue = ''
  2276. this.keyValueNo = ''
  2277. },
  2278. addApplication() {
  2279. this.tongbuLoading = true
  2280. // this.$refs.application.showApplication()
  2281. getAction('/kuaishou/batch/syncAppList', {
  2282. accountId: localStorage.getItem('campaignAccountId'),
  2283. }).then((res) => {
  2284. if (res.success) {
  2285. this.tongbuLoading = false
  2286. this.$message.success(res.message)
  2287. this.getAppList()
  2288. } else {
  2289. this.tongbuLoading = false
  2290. this.$message.error(res.message)
  2291. }
  2292. })
  2293. },
  2294. handleOk() {
  2295. var that = this
  2296. this.$bus.$emit('remove', '/creat/creatUnit')
  2297. this.$router.replace({
  2298. path: '/batchCreation/campaignList',
  2299. })
  2300. },
  2301. handleCancel(e) {
  2302. this.visible = false
  2303. },
  2304. handleSubmit(e) {
  2305. e.preventDefault()
  2306. if (
  2307. this.checkVideo.length <
  2308. (this.getData('unitType')=='4'?this.getData('createType') == '0' ? this.getData('createCount') : this.getData('createCount') * 15:
  2309. this.getData('createCount')*this.getData('imageCount'))
  2310. ) {
  2311. // this.$message.error('选择的素材不能小于创建条数')
  2312. this.getData('unitType')=='4'?
  2313. this.getData('createType') == '0'
  2314. ? this.$message.error('选择的素材不能小于创建条数')
  2315. : this.$message.error('选择的素材不能小于创建条数*15'):
  2316. this.$message.error('选择的素材不能小于创建条数*'+this.getData('imageCount'))
  2317. } else {
  2318. this.form.validateFieldsAndScroll((err, values) => {
  2319. if (!err) {
  2320. this.loading = true
  2321. var groupArr = this.allForm.group.map((item) => {
  2322. return {
  2323. ...item,
  2324. deepConversionBid: item.deepConversionBid != '' ? item.deepConversionBid * 1000 : '',
  2325. ocpxActionType: item.ocpxActionType,
  2326. bidType: item.bidType == 1 ? 2 : 10,
  2327. }
  2328. })
  2329. var json = {
  2330. ...values,
  2331. cpaBid: values.cpaBid && values.cpaBid != '' ? values.cpaBid * 1000 : null,
  2332. bid: values.bid && values.bid != '' ? values.bid * 1000 : null,
  2333. convertId: this.convertId ? this.convertId.key : null,
  2334. dayBudget: values.dayBudget * 1000,
  2335. photoArr: this.checkVideo,
  2336. creativeCategory: values.creativeCategory
  2337. ? values.creativeCategory[values.creativeCategory.length - 1]
  2338. : null,
  2339. unitType: values.unitType,
  2340. }
  2341. var params = {
  2342. userId: this.userInfo().id,
  2343. ...json,
  2344. ...groupArr[0],
  2345. accountId: localStorage.getItem('campaignAccountId'),
  2346. campaignId: localStorage.getItem('campaignList'),
  2347. beginTime: moment(this.timeRange[0]).format('YYYY-MM-DD'),
  2348. endTime: this.allForm.time == '2' ? moment(this.timeRange[1]).format('YYYY-MM-DD') : '',
  2349. appStore: values.useAppMarket == true ? this.allForm.appStore : null,
  2350. useAppMarket: values.useAppMarket ? 1 : 0,
  2351. sceneId: this.allForm.allianceAccount == '1' ? this.allForm.sceneId : [5],
  2352. scheduleTime:
  2353. this.allForm.scheduleTime == '2'
  2354. ? this.allForm.scheduleTimeData
  2355. : '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  2356. }
  2357. postAction('/batch/kuaiShouGroupTemplate/submitUnitTask', params).then((res) => {
  2358. this.loading = false
  2359. if (res.success) {
  2360. this.visible = true
  2361. this.allForm.fail = res.result.code
  2362. this.allForm.success = res.result.size
  2363. } else {
  2364. this.$message.error(res.message)
  2365. }
  2366. })
  2367. }
  2368. })
  2369. }
  2370. },
  2371. onChange(value) {
  2372. // console.log(value)
  2373. },
  2374. changeUnitType(e){
  2375. this.sumContent = 0
  2376. this.videoList = []
  2377. this.checkVideo = []
  2378. this.checkVideoAll = []
  2379. this.ipagination.pageSize = 10
  2380. this.$nextTick(()=>{
  2381. if (this.getData('creativeMaterialType') == '1') {
  2382. if(this.getData('unitType') == '4') {
  2383. this.form.setFieldsValue({creativeName:'自定义创意_竖版视频'})
  2384. }else{
  2385. this.form.setFieldsValue({creativeName:'程序化创意_竖版视频'})
  2386. }
  2387. } else {
  2388. if(this.getData('unitType') == '4') {
  2389. this.form.setFieldsValue({creativeName:'自定义创意_横版视频'})
  2390. }else{
  2391. this.form.setFieldsValue({creativeName:'程序化创意_横版视频'})
  2392. }
  2393. }
  2394. // if(e.target.value == '4') {
  2395. // this.form.setFieldsValue({creativeName:'自定义创意_竖版视频'})
  2396. // }else{
  2397. // this.form.setFieldsValue({creativeName:'程序化创意_竖版视频'})
  2398. // }
  2399. })
  2400. },
  2401. handleChange(value) {
  2402. // this.$refs.population.getAppList(value)
  2403. this.getSiteList(value)
  2404. this.getIsActivate(value)
  2405. },
  2406. handleChangeMould(value) {
  2407. if (value) {
  2408. this.populationData = JSON.parse(
  2409. this.dataList.filter((item) => {
  2410. return item.id == value
  2411. })[0].templateContent
  2412. )
  2413. } else {
  2414. this.populationData = {}
  2415. }
  2416. },
  2417. getPlatForm(appId) {
  2418. if (appId) {
  2419. var data = this.appList.filter((item) => {
  2420. return item.appId == appId
  2421. })
  2422. return data[0].platform
  2423. }
  2424. },
  2425. handleBlur() {
  2426. // console.log('blur')
  2427. },
  2428. handleFocus() {
  2429. // console.log('focus')
  2430. },
  2431. getPageSize(data) {
  2432. if (data.target.value == '0') {
  2433. this.ipagination.pageSize = 5
  2434. } else if (data.target.value == '1') {
  2435. this.ipagination.pageSize = 15
  2436. }
  2437. this.videoList = []
  2438. this.checkVideo = []
  2439. this.checkVideoAll = []
  2440. this.checkVideoWai = []
  2441. this.sumContent = 0
  2442. },
  2443. filterOption(input, option) {
  2444. return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  2445. },
  2446. prevStep() {
  2447. this.$emit('prevStep', this.campaignId ? this.campaignId : localStorage.getItem('campaignList'))
  2448. },
  2449. getMould() {
  2450. let params = {}
  2451. params.accountId = localStorage.getItem('campaignAccountId')
  2452. getAction('/kuaishou/batch/getDirectionalTemplate', params).then((res) => {
  2453. // console.log(res)
  2454. if (res.success) {
  2455. this.dataList = res.result.map((item, index) => {
  2456. return {
  2457. ...item,
  2458. key: index,
  2459. }
  2460. })
  2461. }
  2462. })
  2463. },
  2464. getAppList() {
  2465. let params = {}
  2466. params.accountId = localStorage.getItem('campaignAccountId')
  2467. getAction('/kuaishou/batch/getAppList', params).then((res) => {
  2468. if (res.success) {
  2469. this.appList = res.result.map((item, index) => {
  2470. return {
  2471. ...item,
  2472. key: index,
  2473. }
  2474. })
  2475. }
  2476. })
  2477. },
  2478. getCampaignList() {
  2479. var params = {}
  2480. params.accountId = localStorage.getItem('campaignAccountId')
  2481. params.campaignId = this.campaignId ? this.campaignId : localStorage.getItem('campaignList')
  2482. getAction('/kuaishou/batch/getCampaignList', params).then((res) => {
  2483. if (res.success) {
  2484. this.campaignType = res.result.records[0].campaignType
  2485. // console.log(this.campaignType)
  2486. }
  2487. })
  2488. },
  2489. getData(className) {
  2490. return this.form.getFieldValue(className)
  2491. },
  2492. showVideoList(url, params) {
  2493. this.dataSource = []
  2494. this.loadingVideoList = true
  2495. getAction(url, params).then((res) => {
  2496. // console.log(res)
  2497. if (res.success) {
  2498. this.dataSource = res.result.list
  2499. this.ipagination.total = res.result.total
  2500. this.loadingVideoList = false
  2501. } else {
  2502. this.loadingVideoList = false
  2503. }
  2504. })
  2505. },
  2506. getSiteList(appId) {
  2507. getAction('/kuaishou/batch/getPageList', {
  2508. accountId: localStorage.getItem('campaignAccountId'),
  2509. appId: appId,
  2510. viewComp: 7,
  2511. }).then((res) => {
  2512. if (res.success) {
  2513. this.siteList = res.result
  2514. if (this.siteList.length > 0) {
  2515. this.showSite = true
  2516. }
  2517. } else {
  2518. this.showSite = false
  2519. }
  2520. })
  2521. },
  2522. getChangeAll(type, form, field) {
  2523. this.showNumber = false
  2524. this.showNumber = true
  2525. var node = document.getElementById(field)
  2526. var v = '{{' + type + '}}'
  2527. if (document.selection) {
  2528. //IE
  2529. node.focus()
  2530. var sel = document.selection.createRange()
  2531. sel.text = v
  2532. sel.select()
  2533. if (field == 'campaignName') {
  2534. this[form].setFieldsValue({ campaignName: sel.text })
  2535. } else if (field == 'unitName') {
  2536. this[form].setFieldsValue({ unitName: sel.text })
  2537. }
  2538. } else if (node.selectionStart || node.selectionStart == '0') {
  2539. //MOZILLA/GOOGLE
  2540. var startPos = node.selectionStart
  2541. var endPos = node.selectionEnd
  2542. var restoreTop = node.scrollTop
  2543. node.value = node.value.substring(0, startPos) + v + node.value.substring(endPos, node.value.length)
  2544. if (restoreTop > 0) {
  2545. node.scrollTop = restoreTop
  2546. }
  2547. if (field == 'campaignName') {
  2548. this[form].setFieldsValue({ campaignName: node.value })
  2549. } else if (field == 'unitName') {
  2550. this[form].setFieldsValue({ unitName: node.value })
  2551. }
  2552. node.focus()
  2553. node.selectionStart = startPos + v.length
  2554. node.selectionEnd = startPos + v.length
  2555. // this.campaignName = node.value
  2556. } else {
  2557. //OTHER
  2558. node.value += v
  2559. // console.log(node.value)
  2560. if (field == 'campaignName') {
  2561. this[form].setFieldsValue({ campaignName: node.value })
  2562. } else if (field == 'unitName') {
  2563. this[form].setFieldsValue({ unitName: node.value })
  2564. }
  2565. node.focus()
  2566. // this.campaignName = node.value
  2567. }
  2568. },
  2569. getIsActivate(val){
  2570. let params={};
  2571. params.accountId=localStorage.getItem('campaignAccountId');
  2572. params.campaignType=localStorage.getItem('campaignType');
  2573. params.appId=val
  2574. getAction('/kuaishou/batch/getIsActivate',params).then(res => {
  2575. if (res.success) {
  2576. this.allForm.groupTypeData = res.result
  2577. }
  2578. })
  2579. },
  2580. },
  2581. watch: {
  2582. timeSeries(val) {
  2583. // console.log(val)
  2584. },
  2585. checkVideo(n, o) {},
  2586. checkVideoAll(n, o) {
  2587. // this.checkVideoAll = [...new Set(n)]
  2588. // console.log(n,o)
  2589. // this.checkVideo = [...new Set(n)]
  2590. },
  2591. time(n, o) {
  2592. this.searchVideo()
  2593. // if (n.length > 0) {
  2594. // var params = {}
  2595. // params.accountId = localStorage.getItem('campaignAccountId')
  2596. // params.materialType = this.creativeMaterialType
  2597. // params.pageSize = this.ipagination.pageSize
  2598. // params.pageNo = 1
  2599. // params.status = 0
  2600. // params.channelType = this.channelType
  2601. // params.startDate = moment(n[0]).format('YYYY-MM-DD') + ' 00:00:00'
  2602. // params.endDate = moment(n[1]).format('YYYY-MM-DD') + ' 23:59:59'
  2603. // params.orderBy = this.orderBy
  2604. // params.signatures = this.md5Str
  2605. // this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
  2606. // } else {
  2607. // var params = {}
  2608. // params.accountId = localStorage.getItem('campaignAccountId')
  2609. // params.materialType = this.creativeMaterialType
  2610. // params.pageSize = this.ipagination.pageSize
  2611. // params.pageNo = 1
  2612. // params.status = 0
  2613. // params.channelType = this.channelType
  2614. // params.orderBy = this.orderBy
  2615. // params.signatures = this.md5Str
  2616. // this.ipagination.current = 1
  2617. // this.showVideoList('/kuaishou/kuaiShouVideoGet/getVideoList', params)
  2618. // }
  2619. },
  2620. },
  2621. mounted: function () {
  2622. this.step = localStorage.getItem('step')
  2623. this.getTemplate(localStorage.getItem('campaignAccountId'))
  2624. this.getAppList()
  2625. // this.getCampaignList()
  2626. this.campaignType = localStorage.getItem('campaignType')
  2627. this.getMould()
  2628. getAction('/kuaishou/batch/getIsActivate', {
  2629. accountId: localStorage.getItem('campaignAccountId'),
  2630. }).then((res) => {
  2631. if (res.success) {
  2632. this.allForm.groupTypeData = res.result
  2633. this.addGroup()
  2634. }
  2635. })
  2636. getAction('/kuaishou/batch/getWhiteList', {
  2637. accountId: localStorage.getItem('campaignAccountId'),
  2638. }).then((res) => {
  2639. if (res.success) {
  2640. // console.log(res)
  2641. if (res.result) {
  2642. this.creativeCategorySwitch = res.result.creative_category_switch == 1 ? true : false
  2643. this.allianceAccount = res.result.alliance_account == 1 ? true : false
  2644. this.actionbarClickUrlSwitch = res.result.actionbar_click_url_switch == 1 ? true : false
  2645. // if (res.result.alliance_account == 1) {
  2646. // this.allianceAccount = true
  2647. // } else {
  2648. // this.allianceAccount = false
  2649. // }
  2650. } else {
  2651. this.allianceAccount = false
  2652. this.creativeCategorySwitch = false
  2653. this.actionbarClickUrlSwitch = false
  2654. }
  2655. }
  2656. })
  2657. getAction('/kuaishou/batch/getProjectMaxBid', {
  2658. accountId: localStorage.getItem('campaignAccountId'),
  2659. }).then((res) => {
  2660. if (res.success) {
  2661. this.maxBid = res.result / 1000
  2662. }
  2663. })
  2664. getAction('/kuaishou/batch/getActionBarTextByType', {
  2665. type: localStorage.getItem('campaignType'),
  2666. }).then((res) => {
  2667. if (res.success) {
  2668. this.actionBarTextList = res.result
  2669. }
  2670. })
  2671. getAction('/kuaishou/batch/getCreativeCategory', {
  2672. accountId: localStorage.getItem('campaignAccountId'),
  2673. }).then((res) => {
  2674. if (res.success) {
  2675. // console.log(res)
  2676. this.createOptions = res.result
  2677. }
  2678. })
  2679. getAction('/batch/kuaiShouGroupTemplate/getApiCreateCount', {
  2680. accountId: localStorage.getItem('campaignAccountId'),
  2681. }).then((res) => {
  2682. this.createCount = res.result
  2683. })
  2684. },
  2685. }
  2686. </script>
  2687. <style type="text/css" scoped lang="scss">
  2688. .width-video {
  2689. width: calc(20% - 10px);
  2690. margin-right: 10px;
  2691. margin-bottom: 10px;
  2692. }
  2693. .chouzhen {
  2694. border-style: solid;
  2695. border-width: 1px;
  2696. border-color: #e4e4e4;
  2697. width: calc(20% - 10px);
  2698. padding: 10px;
  2699. margin-right: 10px;
  2700. margin-bottom: 10px;
  2701. display: flex;
  2702. align-items: center;
  2703. background: #fff;
  2704. position: relative;
  2705. z-index: 99;
  2706. float: left;
  2707. }
  2708. li.chouzhen.first:before {
  2709. font-size: 12px;
  2710. content: '首帧';
  2711. position: absolute;
  2712. top: 7px;
  2713. left: 5px;
  2714. width: 36px;
  2715. height: 20px;
  2716. color: rgb(255, 255, 255);
  2717. line-height: 20px;
  2718. text-align: center;
  2719. background: rgba(0, 0, 0, 0.5);
  2720. border-radius: 2px;
  2721. z-index: 1000;
  2722. }
  2723. .actor-photo-list {
  2724. display: flex;
  2725. padding-left: 0;
  2726. li {
  2727. width: 25%;
  2728. margin: 10px;
  2729. position: relative;
  2730. height: 250px;
  2731. border: 1px solid #f2f2f2;
  2732. list-style: none;
  2733. img,
  2734. video {
  2735. width: 100%;
  2736. margin-top: auto;
  2737. margin-bottom: auto;
  2738. top: 0;
  2739. bottom: 0;
  2740. position: absolute;
  2741. max-height: 250px;
  2742. }
  2743. }
  2744. }
  2745. .plug-timer-grid {
  2746. width: 100%;
  2747. }
  2748. .plug-timer-grid td,
  2749. .plug-timer-grid th {
  2750. border: 1px solid #97b4d1;
  2751. text-align: center;
  2752. /*cursor:pointer;*/
  2753. font-size: 10px;
  2754. line-height: 10px;
  2755. }
  2756. .Selected {
  2757. background-color: rgb(102, 162, 243);
  2758. opacity: 0.5;
  2759. }
  2760. .plug-timer-grid {
  2761. border-collapse: collapse;
  2762. z-index: 4;
  2763. }
  2764. .plug-timer-grid thead tr {
  2765. display: table-row;
  2766. vertical-align: inherit;
  2767. border-color: inherit;
  2768. }
  2769. .group-creat table td {
  2770. height: 20px;
  2771. max-width: 5px;
  2772. font-size: 12px;
  2773. text-align: center;
  2774. vertical-align: middle;
  2775. overflow: hidden;
  2776. transition: background 0.5s;
  2777. -webkit-transition: background 0.5s;
  2778. }
  2779. .plug-timer-grid tbody th {
  2780. width: 4%;
  2781. }
  2782. .plug-timer-grid tbody tr td {
  2783. width: 2%;
  2784. }
  2785. /*.clear{*/
  2786. /* margin:20px 0px 20px 0px;*/
  2787. /*}*/
  2788. </style>