targetedPopulation.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349
  1. <style>
  2. #table_time_selected1 tr {
  3. border: 1px solid rgb(102, 162, 243);
  4. }
  5. .plug-timer-grid th {
  6. line-height: 25px;
  7. }
  8. .module-form .ant-form-item-required::before {
  9. display: inline-block;
  10. margin-right: 4px;
  11. color: #f5222d;
  12. font-size: 14px;
  13. font-family: SimSun, sans-serif;
  14. line-height: 1;
  15. content: '';
  16. }
  17. .else-label .ant-form-item-label label::after {
  18. content: '';
  19. position: relative;
  20. top: -0.5px;
  21. margin: 0 8px 0 2px;
  22. }
  23. </style>
  24. <style scoped>
  25. ul {
  26. padding-left: 0;
  27. }
  28. li {
  29. list-style: none;
  30. }
  31. li:hover {
  32. background: #f2f2f2;
  33. }
  34. </style>
  35. <template>
  36. <a-form :form="formAll" class="module-form" @submit="handleSubmit">
  37. <a-form-item
  38. label="自定义人群"
  39. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  40. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  41. >
  42. <a-radio-group buttonStyle="solid" v-model="people" @change="getPeople">
  43. <a-radio-button value="2">不限</a-radio-button>
  44. <a-radio-button value="3">定向人群</a-radio-button>
  45. <!-- <a-radio-button value="4">付费人群</a-radio-button> -->
  46. </a-radio-group>
  47. <span style="color: red;margin-left:10px">第三方人群包不能复制</span>
  48. </a-form-item>
  49. <a-form-item
  50. v-if="people == '3'"
  51. label="定向逻辑"
  52. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  53. :wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }"
  54. >
  55. <a-radio-group buttonStyle="solid" v-model="targeted" @change="radioChange">
  56. <a-radio-button value="2">定向</a-radio-button>
  57. <a-radio-button value="3">排除</a-radio-button>
  58. <a-radio-button value="4">同时定向排除</a-radio-button>
  59. </a-radio-group>
  60. <div
  61. :style="{
  62. border: targeted == '4' ? '1px solid #f2f2f2' : '0',
  63. padding: targeted == '4' ? '20px' : '0',
  64. }"
  65. v-clickoutside="targetedShow"
  66. >
  67. <div style="display: flex; margin-top: 15px" v-if="targeted == '4' || targeted == '2'">
  68. <span style="white-space: nowrap; width: 10%" v-if="targeted == '4'">定向池:</span>
  69. <a-input
  70. placeholder="请至少选择一个自定义人群"
  71. @focus="
  72. topMiddle = true
  73. topMiddleNo = false
  74. dataList = dataElse
  75. "
  76. v-model="keyValue"
  77. @change="showOne"
  78. />
  79. </div>
  80. <div
  81. style="background: white; padding: 10px; box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15)"
  82. :style="{ width: targeted == '4' ? '90%' : '100%', marginLeft: targeted == '4' ? '10%' : '0' }"
  83. v-show="topMiddle"
  84. >
  85. <a-table
  86. :columns="columns"
  87. :dataSource="dataList"
  88. bordered
  89. :pagination="false"
  90. :scroll="{ y: 300, x: true }"
  91. :rowSelection="{
  92. selectedRowKeys: selectedRowKeys,
  93. onChange: onSelectChange,
  94. getCheckboxProps: getCheckboxProps,
  95. }"
  96. >
  97. <span slot="orientationName" slot-scope="text, record">{{ text }}({{ record.orientationId }})</span>
  98. <span slot="populationType" slot-scope="text">{{ text | population_type }}</span>
  99. <span slot="putTime" slot-scope="text">{{ text | getDate }}</span>
  100. </a-table>
  101. <div style="text-align: right">
  102. <a-button style="margin-right: 5px" @click="topMiddle = false">取消</a-button>
  103. <a-button type="primary" @click="okSelect">确定</a-button>
  104. </div>
  105. </div>
  106. <div style="display: flex; margin-top: 15px" v-if="targeted == '4' || targeted == '3'">
  107. <span style="white-space: nowrap; width: 10%" v-if="targeted == '4'">排除池:</span>
  108. <a-input
  109. placeholder="请至少选择一个自定义人群"
  110. @focus="
  111. topMiddleNo = true
  112. topMiddle = false
  113. dataList = dataElse
  114. "
  115. v-model="keyValueNo"
  116. @change="showTwo"
  117. />
  118. </div>
  119. <div
  120. style="background: white; padding: 10px; box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15)"
  121. :style="{ width: targeted == '4' ? '90%' : '100%', marginLeft: targeted == '4' ? '10%' : '0' }"
  122. v-show="topMiddleNo"
  123. >
  124. <a-table
  125. :columns="columns"
  126. :dataSource="dataList"
  127. bordered
  128. :pagination="false"
  129. :scroll="{ y: 300, x: true }"
  130. :rowSelection="{
  131. selectedRowKeys: selectedRowKeysNo,
  132. onChange: onSelectChangeNo,
  133. getCheckboxProps: getCheckboxPropsNo,
  134. }"
  135. >
  136. <span slot="orientationName" slot-scope="text, record">{{ text }}({{ record.orientationId }})</span>
  137. <span slot="populationType" slot-scope="text">{{ text | population_type }}</span>
  138. <span slot="putTime" slot-scope="text">{{ text | getDate }}</span>
  139. </a-table>
  140. <div style="text-align: right">
  141. <a-button style="margin-right: 5px" @click="topMiddleNo = false">取消</a-button>
  142. <a-button type="primary" @click="okSelectNo">确定</a-button>
  143. </div>
  144. </div>
  145. </div>
  146. </a-form-item>
  147. <a-form-item
  148. label="地区"
  149. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  150. :wrapperCol="{ lg: { span: 17 }, sm: { span: 17 } }"
  151. >
  152. <a-radio-group @change="regionChange" v-model="allForm.regionType" buttonStyle="solid">
  153. <a-radio-button value="noLimit">不限</a-radio-button>
  154. <a-radio-button value="limit">指定地区</a-radio-button>
  155. </a-radio-group>
  156. <div v-if="allForm.regionType == 'limit'" style="margin-top: 10px">
  157. <select-region :checkData.sync="allForm.region" :dataValue="allForm.region" />
  158. </div>
  159. </a-form-item>
  160. <a-form-item
  161. label="年龄"
  162. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  163. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  164. >
  165. <a-radio-group v-model="allForm.ageType" buttonStyle="solid">
  166. <a-radio-button value="noLimit">不限</a-radio-button>
  167. <a-radio-button value="ageLimit">限定年龄段</a-radio-button>
  168. <a-radio-button value="ageCustom">自定义年龄段</a-radio-button>
  169. </a-radio-group>
  170. <div v-if="allForm.ageType == 'ageLimit'">
  171. <a-checkbox-group v-decorator="['agesRange', { rules: [{ required: true, message: '请选择年龄段' }] }]">
  172. <!-- <a-checkbox :value="0">0-11岁</a-checkbox>
  173. <a-checkbox :value="12">12-17岁</a-checkbox> -->
  174. <a-checkbox :value="18">18-23岁</a-checkbox>
  175. <a-checkbox :value="24">24-30岁</a-checkbox>
  176. <a-checkbox :value="31">31-40岁</a-checkbox>
  177. <a-checkbox :value="41">41-49岁</a-checkbox>
  178. <a-checkbox :value="50">50+</a-checkbox>
  179. </a-checkbox-group>
  180. </div>
  181. <div v-if="allForm.ageType == 'ageCustom'">
  182. <a-slider
  183. range
  184. :marks="marks"
  185. :min="5"
  186. :max="55"
  187. v-decorator="[
  188. 'age',
  189. {
  190. rules: [{ required: true, message: '请选择年龄段' }, { validator: handleConfirmValue }],
  191. initialValue: [10, 50],
  192. },
  193. ]"
  194. />
  195. </div>
  196. </a-form-item>
  197. <a-form-item
  198. label="性别"
  199. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  200. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  201. >
  202. <a-radio-group
  203. buttonStyle="solid"
  204. v-decorator="[
  205. 'gender',
  206. {
  207. initialValue: 0,
  208. },
  209. ]"
  210. >
  211. <a-radio-button :value="0">不限</a-radio-button>
  212. <a-radio-button :value="1">女性</a-radio-button>
  213. <a-radio-button :value="2">男性</a-radio-button>
  214. </a-radio-group>
  215. </a-form-item>
  216. <a-form-item
  217. label="最低版本"
  218. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  219. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  220. >
  221. <a-radio-group buttonStyle="solid" v-model="allForm.platform_os">
  222. <a-radio-button :value="0" v-if="getApp == '0'">不限</a-radio-button>
  223. <a-radio-button :value="1" v-if="getApp == '0' || getApp == '1'">Android系统</a-radio-button>
  224. <a-radio-button :value="2" v-if="getApp == '0' || getApp == '2'">IOS系统</a-radio-button>
  225. </a-radio-group>
  226. </a-form-item>
  227. <a-form-item
  228. label=" "
  229. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  230. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  231. v-if="allForm.platform_os == 1"
  232. class="else-label"
  233. >
  234. <a-radio-group
  235. v-decorator="[
  236. 'androidOsv',
  237. {
  238. initialValue: 3,
  239. },
  240. ]"
  241. >
  242. <a-radio :value="3">不限</a-radio>
  243. <a-radio :value="4">4X+</a-radio>
  244. <a-radio :value="5">5x+</a-radio>
  245. <a-radio :value="6">6x+</a-radio>
  246. <a-radio :value="7">7x+</a-radio>
  247. </a-radio-group>
  248. </a-form-item>
  249. <a-form-item
  250. label=" "
  251. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  252. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  253. v-if="allForm.platform_os == 2"
  254. class="else-label"
  255. >
  256. <a-radio-group
  257. v-decorator="[
  258. 'iosOsv',
  259. {
  260. initialValue: 6,
  261. },
  262. ]"
  263. >
  264. <a-radio :value="6">不限</a-radio>
  265. <a-radio :value="7">7X+</a-radio>
  266. <a-radio :value="8">8x+</a-radio>
  267. <a-radio :value="9">9x+</a-radio>
  268. <a-radio :value="10">10x+</a-radio>
  269. </a-radio-group>
  270. </a-form-item>
  271. <a-form-item
  272. v-if="allForm.platform_os != 2"
  273. label="设备品牌"
  274. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  275. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  276. >
  277. <a-radio-group buttonStyle="solid" v-model="allForm.device">
  278. <a-radio-button value="0">不限</a-radio-button>
  279. <a-radio-button value="1">选择品牌</a-radio-button>
  280. </a-radio-group>
  281. <div v-if="allForm.device == '1'" style="width: 120%">
  282. <a-checkbox-group
  283. v-decorator="['deviceBrand', { rules: [{ required: true, message: '请选择设备品牌' }] }]"
  284. style="width: 120%"
  285. >
  286. <a-checkbox :value="1">OPPO</a-checkbox>
  287. <a-checkbox :value="2">VIVO</a-checkbox>
  288. <a-checkbox :value="3">华为</a-checkbox>
  289. <a-checkbox :value="4">小米</a-checkbox>
  290. <a-checkbox :value="5">荣耀</a-checkbox>
  291. <a-checkbox :value="6">三星</a-checkbox>
  292. <a-checkbox :value="7">金立</a-checkbox>
  293. <a-checkbox :value="8">魅族</a-checkbox>
  294. <a-checkbox :value="9">乐视</a-checkbox>
  295. <a-checkbox :value="10">其他</a-checkbox>
  296. <a-checkbox :value="11" v-if="allForm.platform_os == 0">苹果</a-checkbox>
  297. </a-checkbox-group>
  298. </div>
  299. </a-form-item>
  300. <a-form-item
  301. label="设备价格"
  302. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  303. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  304. >
  305. <a-radio-group buttonStyle="solid" v-model="allForm.price">
  306. <a-radio-button value="0">不限</a-radio-button>
  307. <a-radio-button value="1">选择价格</a-radio-button>
  308. </a-radio-group>
  309. <div v-if="allForm.price == '1'" style="width: 120%">
  310. <a-checkbox-group
  311. v-decorator="['devicePrice', { rules: [{ required: true, message: '请选择设备价格' }] }]"
  312. style="width: 120%"
  313. >
  314. <a-checkbox :value="1">1500以下</a-checkbox>
  315. <a-checkbox :value="2">1501~2000</a-checkbox>
  316. <a-checkbox :value="3">2001~2500</a-checkbox>
  317. <a-checkbox :value="4">2501~3000</a-checkbox>
  318. <a-checkbox :value="5">3001~3500</a-checkbox>
  319. <a-checkbox :value="6">3501~4000</a-checkbox>
  320. <a-checkbox :value="7">4001~4500</a-checkbox>
  321. <a-checkbox :value="8">4501~5000</a-checkbox>
  322. <a-checkbox :value="9">5001~5500</a-checkbox>
  323. <a-checkbox :value="10">5500以上</a-checkbox>
  324. </a-checkbox-group>
  325. </div>
  326. </a-form-item>
  327. <a-form-item
  328. label="APP行为"
  329. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  330. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  331. v-if="allForm.platform_os == 1 && allForm.platform_os && lol == '1'"
  332. >
  333. <a-radio-group buttonStyle="solid" v-model="allForm.appType" @change="getAppType">
  334. <a-radio-button value="0">不限</a-radio-button>
  335. <a-radio-button value="1">按分类</a-radio-button>
  336. <a-radio-button value="2">按APP名称</a-radio-button>
  337. </a-radio-group>
  338. </a-form-item>
  339. <a-form-item
  340. label=" "
  341. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  342. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  343. v-if="allForm.platform_os == 1 && allForm.appType == '1' && lol == '1'"
  344. class="else-label"
  345. >
  346. <a-select
  347. mode="multiple"
  348. style="width: 100%"
  349. optionFilterProp="children"
  350. showSearch
  351. :filterOption="filterOption"
  352. v-decorator="['appInterest', { rules: [{ required: true, message: '请选择APP行为' }] }]"
  353. >
  354. <a-select-option v-for="item in optionsAppActive" :key="item.tagId" :value="item.tagId">{{
  355. item.tagName
  356. }}</a-select-option>
  357. </a-select>
  358. </a-form-item>
  359. <a-form-item
  360. label=" "
  361. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  362. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  363. v-if="allForm.platform_os == 1 && allForm.appType == '2' && lol == '1'"
  364. class="else-label"
  365. >
  366. <div style="position: relative" v-clickoutside="handleClose">
  367. <a-input
  368. placeholder="请输入搜索内容"
  369. @change="getAppAll"
  370. @focus="getAppAllElse"
  371. style="width: 100%; position: relative"
  372. v-model="appListValue"
  373. />
  374. <div
  375. style="
  376. width: 100%;
  377. position: absolute;
  378. z-index: 10;
  379. height: 200px;
  380. background: white;
  381. overflow: auto;
  382. box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.15);
  383. "
  384. v-if="closeDialog"
  385. >
  386. <ul>
  387. <li style="padding: 0 10px">
  388. <a-checkbox
  389. style="float: left; margin: 0 5px"
  390. @change="onCheckAllChange"
  391. :indeterminate="indeterminate"
  392. :checked="checkAll"
  393. ></a-checkbox
  394. >全选
  395. </li>
  396. <a-checkbox-group @change="onChange" v-model="checkArr" class="home-card" style="width: 100%">
  397. <li style="padding: 0 10px; width: 100%" v-for="item of optionsApp" :key="item.appId">
  398. <a-checkbox :value="item.appId" style="float: left; margin: 0 5px"></a-checkbox>{{ item.appName }}
  399. </li>
  400. </a-checkbox-group>
  401. </ul>
  402. </div>
  403. <div style="width: 100%" v-if="optionsAll.length > 0">
  404. <a-button @click="clearAll">清空</a-button>
  405. <br />
  406. <a-tag v-for="item of optionsAll" :key="item" closable :afterClose="() => log(item)">
  407. {{ showAppName(item) ? showAppName(item) : item }}
  408. </a-tag>
  409. </div>
  410. </div>
  411. </a-form-item>
  412. <a-form-item
  413. label="商业兴趣"
  414. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  415. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  416. v-if="lol == '1'"
  417. >
  418. <a-radio-group buttonStyle="solid" @change="businessInterest" v-model="allForm.businessInterestType">
  419. <a-radio-button :value="0">不限</a-radio-button>
  420. <a-radio-button :value="1">智能推荐</a-radio-button>
  421. <a-radio-button :value="2">兴趣标签</a-radio-button>
  422. </a-radio-group>
  423. <br />
  424. <span v-if="allForm.businessInterestType == 1"
  425. >商业兴趣定向会根据您的投放计划,智能精选出最匹配人群,帮助您获取更满足投放意图的人群,以达到最好的投放效果。</span
  426. >
  427. </a-form-item>
  428. <a-form-item
  429. label=" "
  430. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  431. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  432. class="else-label"
  433. v-if="allForm.businessInterestType == 2 && lol == '1'"
  434. >
  435. <a-select
  436. mode="multiple"
  437. style="width: 100%"
  438. optionFilterProp="children"
  439. showSearch
  440. :filterOption="filterOption"
  441. v-decorator="['businessInterest', { rules: [{ required: true, message: '请选择商业兴趣' }] }]"
  442. >
  443. <a-select-option v-for="item in businessOptions" :key="item.tagId" :value="item.tagId">{{
  444. item.tagName
  445. }}</a-select-option>
  446. </a-select>
  447. </a-form-item>
  448. <a-form-item
  449. label="网络环境"
  450. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  451. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  452. >
  453. <a-radio-group
  454. buttonStyle="solid"
  455. v-decorator="[
  456. 'network',
  457. {
  458. initialValue: 0,
  459. },
  460. ]"
  461. >
  462. <a-radio-button :value="0">不限</a-radio-button>
  463. <a-radio-button :value="1">Wi-Fi</a-radio-button>
  464. <a-radio-button :value="2">移动网络</a-radio-button>
  465. </a-radio-group>
  466. </a-form-item>
  467. <a-form-item
  468. label="网红粉丝"
  469. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  470. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  471. v-if="lol == '1'"
  472. >
  473. <a-radio-group buttonStyle="solid" v-model="allForm.fansStar" @change="fansStar">
  474. <a-radio-button value="0">不限</a-radio-button>
  475. <a-radio-button value="1">网红类别</a-radio-button>
  476. </a-radio-group>
  477. </a-form-item>
  478. <a-form-item
  479. label=" "
  480. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  481. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  482. class="else-label"
  483. v-if="allForm.fansStar == '1' && lol == '1'"
  484. >
  485. <a-select
  486. mode="multiple"
  487. style="width: 100%"
  488. optionFilterProp="children"
  489. showSearch
  490. :filterOption="filterOption"
  491. v-decorator="['fansStar', { rules: [{ required: true, message: '请选择网红类别' }] }]"
  492. >
  493. <a-select-option v-for="item in fansStarOptions" :key="item.tagId" :value="item.tagId">{{
  494. item.tagName
  495. }}</a-select-option>
  496. </a-select>
  497. </a-form-item>
  498. <a-form-item
  499. label="兴趣视频用户"
  500. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  501. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  502. v-if="lol == '1'"
  503. >
  504. <a-radio-group buttonStyle="solid" v-model="allForm.interestVideo" @change="interestVideo">
  505. <a-radio-button value="0">不限</a-radio-button>
  506. <a-radio-button value="1">视频标签</a-radio-button>
  507. </a-radio-group>
  508. </a-form-item>
  509. <a-form-item
  510. label=" "
  511. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  512. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  513. class="else-label"
  514. v-if="allForm.interestVideo == '1' && lol == '1'"
  515. >
  516. <a-select
  517. mode="multiple"
  518. style="width: 100%"
  519. optionFilterProp="children"
  520. showSearch
  521. showArrow
  522. :filterOption="filterOption"
  523. v-decorator="['interestVideo', { rules: [{ required: true, message: '请选择视频标签' }] }]"
  524. >
  525. <a-select-option v-for="item in interestVideoOptions" :key="item.tagId" :value="item.tagId">{{
  526. item.tagName
  527. }}</a-select-option>
  528. </a-select>
  529. </a-form-item>
  530. <a-form-item
  531. label="过滤已转化用户"
  532. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  533. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  534. >
  535. <!-- v-decorator="[
  536. 'isOpen',
  537. {
  538. initialValue: '0'
  539. }
  540. ]" -->
  541. <a-radio-group buttonStyle="solid" v-decorator="['filterConvertedLevel', { initialValue: 0 }]">
  542. <a-radio-button :value="0">不限</a-radio-button>
  543. <a-radio-button :value="1">广告组</a-radio-button>
  544. <a-radio-button :value="2">广告计划</a-radio-button>
  545. <a-radio-button :value="3">本账户</a-radio-button>
  546. <a-radio-button :value="4">公司主体</a-radio-button>
  547. <a-radio-button :value="5">APP</a-radio-button>
  548. </a-radio-group>
  549. </a-form-item>
  550. <a-form-item
  551. label="智能扩量"
  552. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  553. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  554. v-if="lol == '1'"
  555. >
  556. <!-- v-decorator="[
  557. 'isOpen',
  558. {
  559. initialValue: '0'
  560. }
  561. ]" -->
  562. <a-radio-group buttonStyle="solid" v-model="allForm.isOpen">
  563. <a-radio-button :value="0">关闭</a-radio-button>
  564. <a-radio-button :value="1">开启</a-radio-button>
  565. </a-radio-group>
  566. </a-form-item>
  567. <a-form-item
  568. label=" "
  569. :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
  570. :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
  571. class="else-label"
  572. v-if="allForm.isOpen == 1 && lol == '1'"
  573. >
  574. <a-checkbox :disabled="allForm.ageType == 'noLimit'" :checked="allForm.noAgeBreak" @change="getAge"
  575. >不可突破年龄</a-checkbox
  576. >
  577. <a-checkbox :disabled="getData('gender') == '0'" :checked="allForm.noGenderBreak" @change="getGender"
  578. >不可突破性别</a-checkbox
  579. >
  580. <a-checkbox
  581. :disabled="allForm.regionType != 'limit' || allForm.region.length == 0"
  582. :checked="allForm.noAreaBreak"
  583. @change="getArea"
  584. >不可突破地域</a-checkbox
  585. >
  586. </a-form-item>
  587. </a-form>
  588. </template>
  589. <script>
  590. import { getAction, postAction } from '@/api/manage'
  591. import moment from 'moment'
  592. import { mapGetters } from 'vuex'
  593. import jq from 'jquery'
  594. import selectRegion from './selectRegion'
  595. import pick from 'lodash.pick'
  596. let dateQuantumRangeConst = ''
  597. const clickoutside = {
  598. // 初始化指令
  599. bind(el, binding, vnode) {
  600. function documentHandler(e) {
  601. // 这里判断点击的元素是否是本身,是本身,则返回
  602. if (el.contains(e.target)) {
  603. return false
  604. }
  605. // 判断指令中是否绑定了函数
  606. if (binding.expression) {
  607. // 如果绑定了函数 则调用那个函数,此处binding.value就是handleClose方法
  608. binding.value(e)
  609. }
  610. }
  611. // 给当前元素绑定个私有变量,方便在unbind中可以解除事件监听
  612. el.__vueClickOutside__ = documentHandler
  613. document.addEventListener('click', documentHandler)
  614. },
  615. update() {},
  616. unbind(el, binding) {
  617. // 解除事件监听
  618. document.removeEventListener('click', el.__vueClickOutside__)
  619. delete el.__vueClickOutside__
  620. },
  621. }
  622. const columns = [
  623. {
  624. title: '人群',
  625. dataIndex: 'orientationName',
  626. scopedSlots: { customRender: 'orientationName' },
  627. width: 150,
  628. },
  629. {
  630. title: '属性',
  631. dataIndex: 'populationType',
  632. filters: [
  633. { text: '上传人群', value: '1' },
  634. { text: '广告人群', value: '2' },
  635. { text: '主题专区', value: '3' },
  636. { text: '逻辑规则', value: '4' },
  637. { text: '人群扩展', value: '5' },
  638. { text: '平台定制', value: '6' },
  639. { text: '定制付费', value: '7' },
  640. { text: '网红粉丝类别', value: '8' },
  641. { text: '内容付费行为', value: '9' },
  642. { text: '移动应用安装', value: '10' },
  643. { text: '快手使用活跃度', value: '11' },
  644. { text: '行业分类', value: '12' },
  645. { text: '商业兴趣', value: '13' },
  646. { text: '固化标签', value: '14' },
  647. { text: '行业偏好', value: '15' },
  648. { text: '第三方标签', value: '16' },
  649. { text: '产品关键词', value: '17' },
  650. ],
  651. onFilter: (value, record) => record.populationType.toString().toLowerCase().includes(value.toLowerCase()),
  652. scopedSlots: { customRender: 'populationType' },
  653. width: 150,
  654. },
  655. {
  656. title: '创建时间',
  657. dataIndex: 'putTime',
  658. scopedSlots: { customRender: 'putTime' },
  659. sorter: (a, b) => a.putTime - b.putTime,
  660. },
  661. ]
  662. export default {
  663. name: 'BaseForm',
  664. components: { selectRegion },
  665. props: {
  666. campaignId: {
  667. type: String,
  668. default() {
  669. return null
  670. },
  671. },
  672. platform: {
  673. default() {
  674. return null
  675. },
  676. },
  677. populationData: {},
  678. lol: {
  679. type: String,
  680. default() {
  681. return '1'
  682. },
  683. },
  684. },
  685. filters: {
  686. getDate(value) {
  687. let date = new Date(value)
  688. let y = date.getFullYear()
  689. let MM = date.getMonth() + 1
  690. MM = MM < 10 ? '0' + MM : MM
  691. let d = date.getDate()
  692. d = d < 10 ? '0' + d : d
  693. return y + '-' + MM + '-' + d
  694. },
  695. platform(str) {
  696. var data = {
  697. 1: 'Android应用下载',
  698. 2: 'Android网页游戏',
  699. 3: 'iOS应用下载',
  700. 4: 'iOS网页游戏',
  701. }
  702. return data[str]
  703. },
  704. population_type(str) {
  705. var data = {
  706. 1: '上传人群',
  707. 2: '广告人群',
  708. 3: '主题专区',
  709. 4: '逻辑规则',
  710. 5: '人群扩展',
  711. 6: '平台定制',
  712. 7: '定制付费',
  713. 8: '网红粉丝类别',
  714. 9: '内容付费行为',
  715. 10: '移动应用安装',
  716. 11: '快手使用活跃度',
  717. 12: '行业分类',
  718. 13: '商业兴趣',
  719. 14: '固化标签',
  720. 15: '行业偏好',
  721. 16: '第三方标签',
  722. 17: '产品关键词',
  723. }
  724. return data[str]
  725. },
  726. },
  727. watch: {
  728. platform(n, o) {
  729. if (n == 1 || n == 2) {
  730. // platform_os
  731. this.allForm.platform_os = 1
  732. // this.form.setFieldsValue({ platform_os: '1' })
  733. } else if (n == 3 || n == 4) {
  734. this.allForm.platform_os = 2
  735. // this.form.setFieldsValue({ platform_os: '2' })
  736. } else {
  737. this.allForm.platform_os = 0
  738. // this.form.setFieldsValue({ platform_os: '0' })
  739. }
  740. },
  741. populationData: {
  742. immediate: true, // immediate选项可以开启首次赋值监听
  743. handler(n, oldVal) {
  744. console.log(n)
  745. if (n.allForm) {
  746. this.allForm = n.allForm
  747. this.allForm.noAgeBreak = n.noAgeBreak == '0' ? false : true
  748. this.allForm.noGenderBreak = n.noGenderBreak == '0' ? false : true
  749. this.allForm.noAreaBreak = n.noAreaBreak == '0' ? false : true
  750. this.selectedRowKeys = n.population ? n.population : []
  751. this.selectedRowKeysNo = n.excludePopulation ? n.excludePopulation : []
  752. this.optionsAll = n.appIds ? (typeof n.appIds == 'string' ? JSON.parse(n.appIds) : n.appIds) : []
  753. this.targeted = n.excludePopulation ? (n.population ? '4' : '3') : '2'
  754. this.people = n.excludePopulation ? '3' : n.population ? '3' : '2'
  755. this.getPeople().then((res) => {
  756. if (n.excludePopulation) {
  757. this.keyValueNo = ''
  758. this.selectedRowKeysValueNo = []
  759. for (let i = 0; i < res.length; i++) {
  760. for (let j = 0; j < n.excludePopulation.length; j++) {
  761. if (res[i].orientationId == n.excludePopulation[j]) {
  762. this.keyValueNo += res[i].orientationName + ' '
  763. this.selectedRowKeysValueNo.push({
  764. orientationId: res[i].orientationId,
  765. orientationName: res[i].orientationName,
  766. })
  767. this.selectedRowKeysNo.push()
  768. }
  769. }
  770. }
  771. }
  772. if (n.population) {
  773. this.keyValue = ''
  774. this.selectedRowKeysValue = []
  775. for (let i = 0; i < res.length; i++) {
  776. for (let j = 0; j < n.population.length; j++) {
  777. if (res[i].orientationId == n.population[j]) {
  778. this.keyValue += res[i].orientationName + ' '
  779. this.selectedRowKeysValue.push({
  780. orientationId: res[i].orientationId,
  781. orientationName: res[i].orientationName,
  782. })
  783. }
  784. }
  785. }
  786. }
  787. })
  788. this.$nextTick(() => {
  789. this.formAll.setFieldsValue(
  790. pick(n, [
  791. 'fansStar',
  792. 'interestVideo',
  793. 'appInterest',
  794. 'gender',
  795. 'network',
  796. 'agesRange',
  797. 'age',
  798. 'androidOsv',
  799. 'iosOsv',
  800. 'deviceBrand',
  801. 'devicePrice',
  802. 'businessInterest',
  803. 'filterConvertedLevel',
  804. ])
  805. )
  806. })
  807. } else {
  808. this.formAll.resetFields()
  809. this.selectedRowKeys = []
  810. this.selectedRowKeysNo = []
  811. this.selectedRowKeysValueNo = []
  812. this.selectedRowKeysValue = []
  813. this.targeted = '2'
  814. this.people = '2'
  815. this.allForm = {
  816. regionType: 'noLimit',
  817. region: [],
  818. ageType: 'noLimit',
  819. age: [],
  820. device: '0',
  821. price: '0',
  822. appType: '0',
  823. fansStar: '0',
  824. interestVideo: '0',
  825. platform_os: 0,
  826. businessInterestType: 0,
  827. isOpen: 0,
  828. noAgeBreak: false,
  829. noGenderBreak: false,
  830. noAreaBreak: false,
  831. }
  832. }
  833. },
  834. },
  835. checkArr(n, o) {
  836. console.log(n, o)
  837. this.optionsAll.push(...n)
  838. this.optionsAll = [...new Set(this.optionsAll)]
  839. if (n.length != o.length) {
  840. if (n.length < o.length) {
  841. var a = new Set(n)
  842. var b = new Set(o)
  843. var c = new Set([...b].filter((item) => !a.has(item))) // {1}
  844. console.log(...c)
  845. var d = this.optionsAll.indexOf(...c)
  846. if (d > 0) {
  847. this.optionsAll.splice(d, 1)
  848. }
  849. }
  850. }
  851. },
  852. },
  853. directives: { clickoutside },
  854. data() {
  855. return {
  856. optionsAll: [],
  857. formAll: this.$form.createForm(this),
  858. marks: {
  859. 5: '5岁',
  860. 10: '10岁',
  861. 15: '15岁',
  862. 20: '20岁',
  863. 25: '25岁',
  864. 30: '30岁',
  865. 35: '35岁',
  866. 40: '40岁',
  867. 45: '45岁',
  868. 50: '50岁',
  869. 55: '55岁',
  870. },
  871. step: 0,
  872. loading: false,
  873. checkArr: [],
  874. appListValue: '',
  875. checkAll: false,
  876. allForm: {
  877. regionType: 'noLimit',
  878. region: [],
  879. ageType: 'noLimit',
  880. age: [],
  881. device: '0',
  882. price: '0',
  883. appType: '0',
  884. fansStar: '0',
  885. interestVideo: '0',
  886. platform_os: 0,
  887. businessInterestType: 0,
  888. isOpen: 0,
  889. noAgeBreak: false,
  890. noGenderBreak: false,
  891. noAreaBreak: false,
  892. people: '2',
  893. targeted: '2',
  894. topMiddle: false,
  895. topMiddleNo: false,
  896. keyValue: '',
  897. keyValueNo: '',
  898. },
  899. options: [],
  900. optionsAll: [],
  901. optionProps: {
  902. value: 'regionId',
  903. label: 'name',
  904. children: 'children',
  905. multiple: true,
  906. emitPath: false,
  907. // checkStrictly: true
  908. },
  909. optionsApp: [],
  910. optionsAppActive: [],
  911. checkOptions: [],
  912. businessOptions: [],
  913. fansStarOptions: [],
  914. interestVideoOptions: [],
  915. optionPropsApp: {
  916. value: 'tagId',
  917. label: 'tagName',
  918. children: 'children',
  919. multiple: true,
  920. emitPath: false,
  921. },
  922. getApp: '0',
  923. closeDialog: false,
  924. indeterminate: false,
  925. checkAll: false,
  926. people: '2',
  927. targeted: '2',
  928. topMiddle: false,
  929. topMiddleNo: false,
  930. keyValue: '',
  931. keyValueNo: '',
  932. columns,
  933. selectedRowKeys: [],
  934. selectedRowKeysValue: [],
  935. selectedRowKeysNo: [],
  936. selectedRowKeysValueNo: [],
  937. dataList: [],
  938. dataElse: [],
  939. }
  940. },
  941. computed: {},
  942. methods: {
  943. getPeople() {
  944. return new Promise((resolve, reject) => {
  945. getAction('/kuaishou/batch/getPopulationList', { accountId: localStorage.getItem('accountId') }).then((res) => {
  946. if (res.success) {
  947. if (res.result) {
  948. this.dataList = res.result.map((item, index) => {
  949. return {
  950. ...item,
  951. key: index,
  952. }
  953. })
  954. this.dataElse = this.dataList
  955. resolve(res.result)
  956. }
  957. }
  958. })
  959. })
  960. },
  961. radioChange() {
  962. this.selectedRowKeys = []
  963. this.selectedRowKeysValue = []
  964. this.selectedRowKeysNo = []
  965. this.selectedRowKeysValueNo = []
  966. this.keyValue = ''
  967. this.keyValueNo = ''
  968. },
  969. onSelectChange(selectedRowKeys, selectionRows) {
  970. this.selectedRowKeys = selectedRowKeys
  971. this.selectedRowKeysValue = selectionRows.map((item) => {
  972. return { orientationId: item.orientationId, orientationName: item.orientationName }
  973. })
  974. },
  975. getCheckboxProps(record) {
  976. return {
  977. props: {
  978. disabled: this.selectedRowKeysValueNo.some((item) => item.orientationId === record.orientationId),
  979. },
  980. }
  981. },
  982. onSelectChangeNo(selectedRowKeys, selectionRows) {
  983. this.selectedRowKeysNo = selectedRowKeys
  984. this.selectedRowKeysValueNo = selectionRows.map((item) => {
  985. return { orientationId: item.orientationId, orientationName: item.orientationName }
  986. })
  987. },
  988. getCheckboxPropsNo(record) {
  989. return {
  990. props: {
  991. disabled: this.selectedRowKeysValue.some((item) => item.orientationId === record.orientationId),
  992. },
  993. }
  994. },
  995. okSelect() {
  996. this.keyValue = ''
  997. this.topMiddle = false
  998. for (let i = 0; i < this.selectedRowKeysValue.length; i++) {
  999. this.keyValue += this.selectedRowKeysValue[i].orientationName + ' '
  1000. }
  1001. },
  1002. okSelectNo() {
  1003. this.keyValueNo = ''
  1004. this.topMiddleNo = false
  1005. for (let i = 0; i < this.selectedRowKeysValueNo.length; i++) {
  1006. this.keyValueNo += this.selectedRowKeysValueNo[i].orientationName + ' '
  1007. }
  1008. },
  1009. showOne() {
  1010. // this.keyValueNo =orientationName
  1011. var data = this.keyValue.split(' ')
  1012. this.dataList = this.dataElse.filter((item) => {
  1013. return item.orientationName.toLowerCase().indexOf(data[data.length - 1].toLowerCase()) > -1
  1014. })
  1015. },
  1016. showTwo() {
  1017. // this.keyValueNo =orientationName
  1018. var data = this.keyValueNo.split(' ')
  1019. this.dataList = this.dataElse.filter((item) => {
  1020. return item.orientationName.toLowerCase().indexOf(data[data.length - 1].toLowerCase()) > -1
  1021. })
  1022. },
  1023. getAge(e) {
  1024. this.allForm.noAgeBreak = e.target.checked
  1025. },
  1026. getGender(e) {
  1027. this.allForm.noGenderBreak = e.target.checked
  1028. },
  1029. getArea(e) {
  1030. this.allForm.noAreaBreak = e.target.checked
  1031. },
  1032. getRegion(data) {
  1033. this.$refs.cascaderRegion.getCheckedNodes()
  1034. var dataName = this.$refs.cascaderRegion.getCheckedNodes()
  1035. var jsonArr = data
  1036. for (let i = 0; i < dataName.length; i++) {
  1037. for (let j = 0; j < data.length; j++) {
  1038. if (dataName[i].children.length > 0) {
  1039. if (data[j].substring(0, 2) == dataName[i].value) {
  1040. jsonArr.splice(j, 1)
  1041. }
  1042. }
  1043. }
  1044. }
  1045. },
  1046. showAppName(appId) {
  1047. if (this.checkOptions.length > 0) {
  1048. var data = this.checkOptions.filter((item) => {
  1049. return item.appId == appId
  1050. })
  1051. if (data[0]) {
  1052. return data[0].appName
  1053. } else {
  1054. return null
  1055. }
  1056. } else {
  1057. return null
  1058. }
  1059. },
  1060. log(appId) {
  1061. var index = this.optionsAll.findIndex((item) => item === appId)
  1062. this.optionsAll.splice(index, 1)
  1063. if (this.optionsAll.length == 0) {
  1064. this.indeterminate = false
  1065. this.checkAll = false
  1066. }
  1067. },
  1068. handleClose(e) {
  1069. this.closeDialog = false
  1070. },
  1071. targetedShow(e) {
  1072. this.topMiddle = false
  1073. this.topMiddleNo = false
  1074. },
  1075. clearAll() {
  1076. this.checkArr = []
  1077. this.indeterminate = false
  1078. this.checkAll = false
  1079. },
  1080. onChange(checkedList) {
  1081. this.indeterminate =
  1082. !!checkedList.length &&
  1083. checkedList.length <
  1084. this.optionsApp.map((item) => {
  1085. return item.appId
  1086. }).length
  1087. this.checkAll =
  1088. checkedList.length ===
  1089. this.optionsApp.map((item) => {
  1090. return item.appId
  1091. }).length
  1092. },
  1093. onCheckAllChange(e) {
  1094. Object.assign(this, {
  1095. checkArr: e.target.checked
  1096. ? this.optionsApp.map((item) => {
  1097. return item.appId
  1098. })
  1099. : [],
  1100. indeterminate: false,
  1101. checkAll: e.target.checked,
  1102. })
  1103. if (this.optionsAll.length > 20) {
  1104. this.$message.error('最多选择20个APP行为')
  1105. this.checkArr = []
  1106. this.indeterminate = false
  1107. this.checkAll = false
  1108. }
  1109. // if (this.checkAll) {
  1110. // this.checkArr = []
  1111. // } else {
  1112. // this.checkArr = this.optionsApp.map(item => {
  1113. // return item.app_id
  1114. // })
  1115. // }
  1116. // this.checkAll = !this.checkAll
  1117. },
  1118. handleSubmit() {
  1119. // e.preventDefault()
  1120. this.formAll.validateFields((err, values) => {
  1121. if (!err) {
  1122. // this.checkArr
  1123. var json = {}
  1124. if (this.allForm.appType == '2') {
  1125. json.appIds = this.optionsAll
  1126. }
  1127. if (this.allForm.regionType == 'limit') {
  1128. json.region = this.allForm.region.map((item) => {
  1129. return item.value
  1130. })
  1131. }
  1132. var jsonData = {}
  1133. if (this.people == '3') {
  1134. if (this.targeted == '2') {
  1135. jsonData.population = this.selectedRowKeysValue.map((item) => {
  1136. return item.orientationId
  1137. })
  1138. } else if (this.targeted == '3') {
  1139. jsonData.excludePopulation = this.selectedRowKeysValueNo.map((item) => {
  1140. return item.orientationId
  1141. })
  1142. } else if (this.targeted == '4') {
  1143. jsonData.population = this.selectedRowKeysValue.map((item) => {
  1144. return item.orientationId
  1145. })
  1146. jsonData.excludePopulation = this.selectedRowKeysValueNo.map((item) => {
  1147. return item.orientationId
  1148. })
  1149. } else {
  1150. jsonData = {}
  1151. }
  1152. }
  1153. var dataJson = {
  1154. ...values,
  1155. platformOs: this.allForm.platform_os,
  1156. businessInterestType: this.allForm.businessInterestType,
  1157. isOpen: this.allForm.isOpen,
  1158. ...json,
  1159. noAgeBreak: this.allForm.noAgeBreak ? 1 : 0,
  1160. noGenderBreak: this.allForm.noGenderBreak ? 1 : 0,
  1161. noAreaBreak: this.allForm.noAreaBreak ? 1 : 0,
  1162. allForm: this.allForm,
  1163. ...jsonData,
  1164. }
  1165. this.$emit('update:populationData', dataJson)
  1166. }
  1167. })
  1168. },
  1169. handleConfirmValue(rule, value, callback) {
  1170. if (Math.abs(value[0] - value[1]) < 5) {
  1171. callback('自定义年龄段需要间隔大于5岁')
  1172. }
  1173. callback()
  1174. },
  1175. manyValidator(rule, value, callback) {
  1176. if (value.length > 20) {
  1177. callback('最多只能选择20个选项')
  1178. }
  1179. callback()
  1180. },
  1181. regionChange() {
  1182. this.allForm.region = []
  1183. },
  1184. search(e) {},
  1185. put() {
  1186. var data = this.allForm.region.map((item) => {
  1187. return item[1] + ''
  1188. })
  1189. var dataElse = data.map((item) => {
  1190. return [item.substring(0, 2), item]
  1191. })
  1192. },
  1193. getAppAllElse(e) {
  1194. this.checkArr = this.optionsAll
  1195. // this.getAppAll()
  1196. if (this.appListValue != '') {
  1197. getAction('/kuaishou/batch/getAppSearch', {
  1198. accountId: localStorage.getItem('accountId'),
  1199. appName: e.target.value,
  1200. }).then((res) => {
  1201. if (res.result) {
  1202. this.optionsApp = res.result
  1203. this.checkOptions.push(...res.result)
  1204. this.closeDialog = true
  1205. } else {
  1206. this.optionsApp = []
  1207. this.closeDialog = false
  1208. }
  1209. })
  1210. } else {
  1211. this.optionsApp = []
  1212. this.closeDialog = false
  1213. }
  1214. },
  1215. getAppAll(e) {
  1216. if (e.target.value !== '') {
  1217. getAction('/kuaishou/batch/getAppSearch', {
  1218. accountId: localStorage.getItem('accountId'),
  1219. appName: e.target.value,
  1220. }).then((res) => {
  1221. if (res.result) {
  1222. this.optionsApp = res.result
  1223. this.checkOptions.push(...res.result)
  1224. this.closeDialog = true
  1225. } else {
  1226. this.optionsApp = []
  1227. this.closeDialog = false
  1228. }
  1229. })
  1230. } else {
  1231. this.optionsApp = []
  1232. this.closeDialog = false
  1233. }
  1234. },
  1235. getAppType(e) {
  1236. this.optionsApp = []
  1237. this.formAll.setFieldsValue({ appInterest: [] })
  1238. this.checkArr = []
  1239. if (e.target.value == '1') {
  1240. getAction('/kuaishou/batch/getTargetList', { tagType: 'APP_INTEREST' }).then((res) => {
  1241. if (res.success) {
  1242. this.optionsApp = res.result
  1243. }
  1244. })
  1245. }
  1246. },
  1247. businessInterest(e) {
  1248. this.formAll.setFieldsValue({ businessInterest: [] })
  1249. if (e.target.value == '2') {
  1250. this.getDataType('BUSINESS_INTEREST', 'businessOptions')
  1251. }
  1252. },
  1253. fansStar(e) {
  1254. if (e.target.value == '1') {
  1255. this.getDataType('FANS_STAR', 'fansStarOptions')
  1256. }
  1257. },
  1258. interestVideo(e) {
  1259. if (e.target.value == '1') {
  1260. this.getDataType('INTEREST_VIDEO', 'interestVideoOptions')
  1261. }
  1262. },
  1263. filterOption(input, option) {
  1264. return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  1265. },
  1266. getDataType(type, dataList) {
  1267. getAction('/kuaishou/batch/getTargetList', { tagType: type }).then((res) => {
  1268. if (res.success) {
  1269. this[dataList] = res.result
  1270. }
  1271. })
  1272. },
  1273. getData(className) {
  1274. return this.formAll.getFieldValue(className)
  1275. },
  1276. },
  1277. mounted: function () {
  1278. this.getDataType('APP_INTEREST', 'optionsAppActive')
  1279. this.getDataType('BUSINESS_INTEREST', 'businessOptions')
  1280. this.getDataType('FANS_STAR', 'fansStarOptions')
  1281. this.getDataType('INTEREST_VIDEO', 'interestVideoOptions')
  1282. },
  1283. }
  1284. </script>
  1285. <style type="text/css">
  1286. .plug-timer-grid {
  1287. width: 100%;
  1288. }
  1289. .plug-timer-grid td,
  1290. .plug-timer-grid th {
  1291. border: 1px solid #97b4d1;
  1292. text-align: center; /*cursor:pointer;*/
  1293. font-size: 10px;
  1294. line-height: 10px;
  1295. }
  1296. .Selected {
  1297. background-color: rgb(102, 162, 243);
  1298. opacity: 0.5;
  1299. }
  1300. .plug-timer-grid {
  1301. border-collapse: collapse;
  1302. z-index: 4;
  1303. }
  1304. .plug-timer-grid thead tr {
  1305. display: table-row;
  1306. vertical-align: inherit;
  1307. border-color: inherit;
  1308. }
  1309. .group-creat table td {
  1310. height: 20px;
  1311. max-width: 5px;
  1312. font-size: 12px;
  1313. text-align: center;
  1314. vertical-align: middle;
  1315. overflow: hidden;
  1316. transition: background 0.5s;
  1317. -webkit-transition: background 0.5s;
  1318. }
  1319. .plug-timer-grid tbody th {
  1320. width: 4%;
  1321. }
  1322. .plug-timer-grid tbody tr td {
  1323. width: 2%;
  1324. }
  1325. /*.clear{*/
  1326. /* margin:20px 0px 20px 0px;*/
  1327. /*}*/
  1328. </style>