jishuquan.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  1. <template>
  2. <div>
  3. <el-radio-group v-model="tab" size="small" @change="getList">
  4. <el-radio-button label="topic">文章管理</el-radio-button>
  5. <el-radio-button label="video">视频管理</el-radio-button>
  6. <el-radio-button label="ad">活动直播管理</el-radio-button>
  7. <el-radio-button label="kol">KOL管理</el-radio-button>
  8. </el-radio-group>
  9. <br/>
  10. <template v-if="tab==='ad'">
  11. <div>
  12. <el-button type="success" style="margin-top: 20px;" @click="showAdEdit(null)">添加活动</el-button>
  13. </div>
  14. <div class="content" v-if="ads">
  15. <el-table :data="ads" height="100%" border style="width: 100%">
  16. <el-table-column prop="title" label="活动标题"></el-table-column>
  17. <el-table-column prop="position_name" label="位置"></el-table-column>
  18. <el-table-column label="基本数据">
  19. <template slot-scope="ad" v-if="tab==='ad'">
  20. <el-tag type="success">浏览{{ad.row.view_count}}</el-tag>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="status_name" label="状态"></el-table-column>
  24. <el-table-column prop="created_at" label="创建时间"></el-table-column>
  25. <el-table-column label="操作" width="300px;">
  26. <template slot-scope="ad" v-if="tab==='ad'">
  27. <el-button type="primary" @click="showAdEdit(ad.row)">
  28. 编辑
  29. <i class="el-icon-edit el-icon--right"></i>
  30. </el-button>
  31. <el-button type="danger" @click="deleteAd(ad.row.id)">
  32. 删除
  33. <i class="el-icon-delete el-icon--right"></i>
  34. </el-button>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. </div>
  39. <el-pagination
  40. class="order-footer"
  41. background
  42. layout="prev, pager, next"
  43. :page-size="20"
  44. :total="total"
  45. @current-change="handleCurrentChange"
  46. />
  47. </template>
  48. <template v-if="tab==='topic'">
  49. <div style="margin-top: 15px;">
  50. <div style="float: left;width: 200px;margin-right: 15px;">
  51. <el-input v-model="title" placeholder="请输入文章标题" @keyup.enter.native="getList"></el-input>
  52. </div>
  53. <div style="float: left;width: 200px;margin-right: 15px;">
  54. <el-select v-model="labelTab" clearable placeholder="筛选运营标签">
  55. <el-option
  56. v-for="item in labelOptions"
  57. :key="item.value"
  58. :label="item.label"
  59. :value="item.value">
  60. </el-option>
  61. </el-select>
  62. </div>
  63. <div style="float: left;width: 200px;margin-right: 15px;">
  64. <el-select v-model="is_show" clearable placeholder="筛选状态">
  65. <el-option
  66. v-for="item in showOptions"
  67. :key="item.value"
  68. :label="item.label"
  69. :value="item.value">
  70. </el-option>
  71. </el-select>
  72. </div>
  73. <div style="float: left;width: 200px;margin-right: 15px;">
  74. <el-button type="primary" @click="getList">搜索</el-button>
  75. </div>
  76. <div style="clear: both;"></div>
  77. </div>
  78. <div class="content" v-if="topics">
  79. <el-table :data="topics" height="100%" border style="width: 100%">
  80. <el-table-column :className="`clickable`" prop="title" label="文章标题">
  81. <template slot-scope="scope">
  82. <span @click="goTopic(scope.row)">{{scope.row.title}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column :className="`clickable`" prop="nickname" label="作者">
  86. <template slot-scope="scope">
  87. <span @click="goRooterUser(scope.row)">{{scope.row.nickname}}</span>
  88. </template>
  89. </el-table-column>
  90. <el-table-column prop="created_at" label="发布时间"></el-table-column>
  91. <el-table-column label="基本数据" width="280px">
  92. <template slot-scope="topic" v-if="tab==='topic'">
  93. <el-tag type="success">浏览{{topic.row.view_count}}</el-tag>
  94. <el-tag type="info">点赞{{topic.row.like_count}}</el-tag>
  95. <el-tag type="warning">收藏{{topic.row.favorite_count}}</el-tag>
  96. <el-tag type="danger">评论{{topic.row.reply_count}}</el-tag>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="内容标签" width="180px">
  100. <template slot-scope="topic">
  101. <span v-for="item in topic.row.tags">
  102. <el-tag type="info">{{item.name}}</el-tag>
  103. </span>
  104. <el-link icon="el-icon-edit" style="float: right;" @click="editContentTag(topic.row)"></el-link>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="运营标签" width="240px">
  108. <template slot-scope="label" v-if="tab==='topic'">
  109. <el-tag type="info" v-if="label.row.is_top==1" class="custom-label">置顶</el-tag>
  110. <el-tag type="info" v-if="label.row.is_must_see==1" class="custom-label">进站必看</el-tag>
  111. <el-tag type="info" v-if="label.row.is_hot==1" class="custom-label">热门</el-tag>
  112. <el-tag type="info" v-if="label.row.is_good==1" class="custom-label">优质</el-tag>
  113. <el-tag type="info" v-if="label.row.is_new==1" class="custom-label">最新</el-tag>
  114. <el-tag type="info" v-if="label.row.is_ad==1" class="custom-label">广告</el-tag>
  115. <el-link icon="el-icon-edit" style="float: right;" @click="editOperateTag(label.row)"></el-link>
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="状态" width="100px">
  119. <template slot-scope="label" v-if="tab==='topic'">
  120. <span v-if="label.row.is_show==1" >显示中</span>
  121. <span v-else-if="label.row.is_show==0 && label.row.risk_type=='ad'">[命中风控]<br/>&nbsp;&nbsp;&nbsp;&nbsp;广告</span>
  122. <span v-else >已下架</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="操作" width="130px" v-if="tab==='topic'">
  126. <template slot-scope="topic" v-if="tab==='topic'">
  127. <el-link type="warning" icon="el-icon-download" v-if="topic.row.is_show == 1" @click="stopShow(topic.row.id, topic.row.is_show)">下架</el-link>
  128. <el-link type="success" icon="el-icon-upload2" v-else @click="stopShow(topic.row.id, topic.row.is_show)">上架</el-link>
  129. <el-link type="danger" icon="el-icon-delete" @click="delTopic(topic.row.id)">删除</el-link>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <el-dialog title="内容标签管理" :visible.sync="contentTagManege">
  134. <el-form ref="form" :model="form" label-width="100px">
  135. <SelectFilterable :selectData="contentTagData"/>
  136. <div style="float: right;margin-top: 15px;">
  137. <el-button type="primary" @click="addContentTag">提交</el-button>
  138. </div>
  139. <div style="clear: both;"></div>
  140. </el-form>
  141. </el-dialog>
  142. <el-dialog title="运营标签管理" :visible.sync="operateTagManege">
  143. <el-form ref="form" :model="form" label-width="100px">
  144. <SelectFilterable :selectData="operateTagOptions"/>
  145. <div style="float: right;margin-top: 15px;">
  146. <el-button type="primary" @click="addOperateTag">提交</el-button>
  147. </div>
  148. <div style="clear: both;"></div>
  149. </el-form>
  150. </el-dialog>
  151. </div>
  152. <el-pagination
  153. class="order-footer"
  154. background
  155. layout="prev, pager, next"
  156. :page-size="20"
  157. :total="total"
  158. @current-change="handleCurrentChange"
  159. />
  160. </template>
  161. <template v-if="tab==='video'">
  162. <div class="content" v-if="videos">
  163. <el-table :data="videos" height="100%" border style="width: 100%">
  164. <el-table-column prop="title" :className="`clickable`" label="视频简介">
  165. <template slot-scope="scope">
  166. <span @click="goVideo(scope.row)">{{scope.row.title}}</span>
  167. </template>
  168. </el-table-column>
  169. <el-table-column prop="nickname" :className="`clickable`" label="作者">
  170. <template slot-scope="scope">
  171. <span @click="goRooterUser(scope.row)">{{scope.row.nickname}}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column prop="created_at" label="发布时间"></el-table-column>
  175. <el-table-column label="基本数据" width="340px">
  176. <template slot-scope="video" v-if="tab==='video'">
  177. <el-tag type="success">浏览:{{video.row.view_count}}</el-tag>
  178. <el-tag type="info">点赞:{{video.row.like_count}}</el-tag>
  179. <el-tag type="warning">收藏:{{video.row.favorite_count}}</el-tag>
  180. <el-tag type="danger">评论:{{video.row.reply_count}}</el-tag>
  181. </template>
  182. </el-table-column>
  183. <el-table-column prop="status_name" label="状态"></el-table-column>
  184. <el-table-column label="操作" width="340px">
  185. <template slot-scope="video" v-if="tab==='video'">
  186. <el-button
  187. type="primary"
  188. v-if="video.row.status==1"
  189. @click="approveVideo(video.row.id)"
  190. >
  191. 下架
  192. <i class="el-icon-bottom el-icon--right"></i>
  193. </el-button>
  194. <el-button
  195. type="primary"
  196. v-if="video.row.status==0"
  197. @click="approveVideo(video.row.id)"
  198. >
  199. 上架
  200. <i class="el-icon-top el-icon--right"></i>
  201. </el-button>
  202. <el-button type="danger" @click="deleteVideo(video.row.id)">
  203. 删除
  204. <i class="el-icon-delete el-icon--right"></i>
  205. </el-button>
  206. </template>
  207. </el-table-column>
  208. </el-table>
  209. </div>
  210. <el-pagination
  211. class="order-footer"
  212. background
  213. layout="prev, pager, next"
  214. :page-size="20"
  215. :total="total"
  216. @current-change="handleCurrentChange"
  217. />
  218. </template>
  219. <template v-if="tab==='kol'">
  220. <div style="margin:15px 0;">
  221. <div style="width:200px;margin:0 15px;float:left;">
  222. <el-input v-model="authorName" placeholder="输入作者名" @keyup.enter.native="search"></el-input>
  223. </div>
  224. <div style="width:200px;margin:0 15px;float:left;">
  225. <template>
  226. <el-select v-model="createScene" clearable placeholder="选择创建场景">
  227. <el-option
  228. v-for="item in createSceneList"
  229. :label="item.label"
  230. :value="item.value">
  231. </el-option>
  232. </el-select>
  233. </template>
  234. </div>
  235. <div style="width:200px;margin:0 15px;float:left;">
  236. <template>
  237. <el-select v-model="signing" clearable placeholder="选择签约状态">
  238. <el-option
  239. v-for="item in signingList"
  240. :label="item.label"
  241. :value="item.value">
  242. </el-option>
  243. </el-select>
  244. </template>
  245. </div>
  246. <div style="width:100px;margin:0 15px;float:left;">
  247. <el-button type="primary" @click="search">搜索</el-button>
  248. </div>
  249. <div style="margin:0 15px;float:right;">
  250. <el-button type="success" @click="onAddAu(null)">添加KOL</el-button>
  251. </div>
  252. <div style="clear: both;"></div>
  253. </div>
  254. <div class="content" height="30%" v-if="kols">
  255. <el-table :data="kols" height="100%" border style="width: 100%">
  256. <el-table-column prop="portrait" label="头像">
  257. <template slot-scope="scope">
  258. <img :src="scope.row.portrait" min-width="70" height="70">
  259. </template>
  260. </el-table-column>
  261. <el-table-column prop="name" :className="`clickable`" label="作者名">
  262. <template slot-scope="scope">
  263. <span style="color:black;">{{scope.row.name}}</span>
  264. </template>
  265. </el-table-column>
  266. <el-table-column prop="introduction" show-overflow-tooltip :className="`clickable`" label="简介">
  267. <template slot-scope="scope">
  268. <span style="color:black;">{{scope.row.introduction}}</span>
  269. </template>
  270. </el-table-column>
  271. <el-table-column prop="is_signing" label="是否签约">
  272. <template slot-scope="scope">
  273. <div v-if="scope.row.is_signing ==1">
  274. 签约
  275. </div>
  276. <div v-else>未签约</div>
  277. </template>
  278. </el-table-column>
  279. <el-table-column prop="show_repost" label="开启转载说明">
  280. <template slot-scope="scope">
  281. <div v-if="scope.row.show_repost ==1">
  282. 开启
  283. </div>
  284. <div v-else>不开启</div>
  285. </template>
  286. </el-table-column>
  287. <el-table-column prop="create_scene" label="创建场景">
  288. <template slot-scope="scope">
  289. <span v-if="scope.row.create_scene == 'self'">用户绑定</span>
  290. <span v-else>后台新增</span>
  291. </template>
  292. </el-table-column>
  293. <el-table-column prop="uid" label="客栈UID"></el-table-column>
  294. <el-table-column label="关联渠道">
  295. <template slot-scope="scope">
  296. <div v-for="item in scope.row.channle">
  297. {{item.code}}
  298. </div>
  299. </template>
  300. </el-table-column>
  301. <el-table-column prop="re_article_num" label="文章数"></el-table-column>
  302. <el-table-column prop="to_read_num" label="阅读数"></el-table-column>
  303. <el-table-column prop="to_praise_num" label="获赞数"></el-table-column>
  304. <el-table-column prop="to_follow_num" label="粉丝数"></el-table-column>
  305. <!-- <el-table-column label="关联领域">-->
  306. <!-- <template slot-scope="scope">-->
  307. <!-- <el-tag type="success">浏览:{{scope.row.name}}</el-tag>-->
  308. <!-- <el-tag type="danger">评论:</el-tag>-->
  309. <!-- </template>-->
  310. <!-- </el-table-column>-->
  311. <el-table-column label="操作">
  312. <template slot-scope="scope">
  313. <el-link icon="el-icon-edit" @click="onEditAu(scope.row.id)">编辑</el-link>
  314. </template>
  315. </el-table-column>
  316. </el-table>
  317. </div>
  318. <el-pagination
  319. class="order-footer"
  320. background
  321. layout="prev, pager, next"
  322. :page-size="20"
  323. :total="total"
  324. @current-change="handleCurrentChange"
  325. />
  326. </template>
  327. <el-dialog title="活动管理" :visible.sync="dialogFormVisible">
  328. <el-form :model="form">
  329. <el-form-item label="活动标题" :label-width="formLabelWidth">
  330. <el-input v-model="form.title" autocomplete="off"></el-input>
  331. </el-form-item>
  332. <el-form-item label="链接" :label-width="formLabelWidth">
  333. <el-input v-model="form.url" autocomplete="off"></el-input>
  334. </el-form-item>
  335. <el-form-item label="用户UID" :label-width="formLabelWidth">
  336. <el-input v-model="form.uid" autocomplete="off"></el-input>
  337. </el-form-item>
  338. <el-form-item label="话题标签" :label-width="formLabelWidth">
  339. <el-input v-model="form.tags" autocomplete="off"></el-input>
  340. </el-form-item>
  341. <el-form-item label="状态" :label-width="formLabelWidth">
  342. <el-select v-model="form.status" placeholder="请选择上架/下架">
  343. <el-option label="上架" value="1"></el-option>
  344. <el-option label="下架" value="0"></el-option>
  345. </el-select>
  346. </el-form-item>
  347. <el-form-item label="类型" :label-width="formLabelWidth">
  348. <el-select v-model="form.type" placeholder="请选择类型">
  349. <el-option label="文章" value="1"></el-option>
  350. <el-option label="视频" value="2"></el-option>
  351. </el-select>
  352. </el-form-item>
  353. <el-form-item label="广告位置" :label-width="formLabelWidth">
  354. <el-select v-model="form.position" placeholder="请选择位置">
  355. <el-option label="广告位1" value="1"></el-option>
  356. <el-option label="广告位2" value="2"></el-option>
  357. </el-select>
  358. </el-form-item>
  359. </el-form>
  360. <div slot="footer" class="dialog-footer">
  361. <el-button @click="dialogFormVisible = false">取 消</el-button>
  362. <el-button type="primary" @click="editAd">确 定</el-button>
  363. </div>
  364. </el-dialog>
  365. <el-dialog title="KOL管理" :visible.sync="kolFormVisible" :closeOnClickModal="false" :closeOnPressEscape="false">
  366. <el-form :model="kolform">
  367. <el-form-item label="头像" v-if="kolform.portrait != './'" :label-width="formLabelWidth">
  368. <img :src="kolform.portrait" style="width:100px;height:100px;" alt="头像">
  369. </el-form-item>
  370. <el-form-item label="作者名" :label-width="formLabelWidth">
  371. <el-input v-model="kolform.name" autocomplete="off"></el-input>
  372. </el-form-item>
  373. <el-form-item label="简介" :label-width="formLabelWidth">
  374. <el-input v-model="kolform.introduction" autocomplete="off"></el-input>
  375. </el-form-item>
  376. <el-form-item label="账号创建" :label-width="formLabelWidth" v-if="!isEdit">
  377. <el-radio v-model="radio" label="1" checked>自动创建新账号</el-radio>
  378. <el-radio v-model="radio" label="2">指定UID</el-radio>
  379. </el-form-item>
  380. <el-form-item label="客栈UID" :label-width="formLabelWidth" v-show="radio == 2 || isEdit">
  381. <el-input v-model="kolform.uid" autocomplete="off" :disabled="isEdit"></el-input>
  382. </el-form-item>
  383. <el-form-item label="是否签约" :label-width="formLabelWidth">
  384. <el-switch v-model="kolform.is_signing"></el-switch>
  385. </el-form-item>
  386. <el-form-item label="是否开启转载" :label-width="formLabelWidth">
  387. <el-switch v-model="kolform.show_repost"></el-switch>
  388. </el-form-item>
  389. <el-form-item label="创建场景" v-if="kolform.create_scene == 'self'" :label-width="formLabelWidth">
  390. <span>用户绑定</span>
  391. </el-form-item>
  392. <el-form-item label="创建场景" v-else :label-width="formLabelWidth">
  393. <span>后台新增</span>
  394. </el-form-item>
  395. <el-form-item :label-width="formLabelWidth">
  396. <template>
  397. <el-row :gutter="20">
  398. <el-col :span="6">
  399. <div class="grid-content bg-purple">渠道</div>
  400. </el-col>
  401. <el-col :span="6">
  402. <div class="grid-content bg-purple">通道ID</div>
  403. </el-col>
  404. <el-col :span="6">
  405. <div class="grid-content bg-purple">渠道URL</div>
  406. </el-col>
  407. <!-- <el-col :span="6"><div class="grid-content bg-purple"></div></el-col>-->
  408. </el-row>
  409. <template v-for="(item,index) in channelData">
  410. <el-row :gutter="20" style="margin-top: 5px">
  411. <el-col :span="6">
  412. <div class="grid-content bg-purple">
  413. <el-select v-model="channelData[index].code" placeholder="请选择">
  414. <el-option
  415. v-for="item in options"
  416. :key="item.value"
  417. :label="item.label"
  418. :value="item.value">
  419. </el-option>
  420. </el-select>
  421. </div>
  422. </el-col>
  423. <el-col :span="6">
  424. <div class="grid-content bg-purple">
  425. <el-input v-model="item.channel_id" placeholder="请输入内容"></el-input>
  426. </div>
  427. </el-col>
  428. <el-col :span="6">
  429. <div class="grid-content bg-purple">
  430. <el-input v-model="item.url" placeholder="请输入内容"></el-input>
  431. </div>
  432. </el-col>
  433. <el-col :span="6">
  434. <div class="grid-content bg-purple">
  435. <el-button
  436. @click="deleteChannleRow(index)"
  437. type="text"
  438. size="small" v-if="index != 0">
  439. 移除
  440. </el-button>
  441. <el-button
  442. @click="addChannleRow()"
  443. type="text"
  444. size="small">
  445. 添加
  446. </el-button>
  447. </div>
  448. </el-col>
  449. </el-row>
  450. </template>
  451. </template>
  452. </el-form-item>
  453. </el-form>
  454. <div slot="footer" class="dialog-footer">
  455. <el-button @click="kolFormVisible = false">取 消</el-button>
  456. <el-button type="primary" @click="editAu">确 定</el-button>
  457. </div>
  458. </el-dialog>
  459. <el-dialog title="标签管理" :visible.sync="labelEditFormVisible">
  460. <el-form :model="form">
  461. <el-form-item label="当前标签" :label-width="formLabelWidth">
  462. <el-tag
  463. type="info"
  464. v-if="this.currentLabel.is_top===1"
  465. class="custom-label"
  466. closable
  467. :disable-transitions="false"
  468. @close="handleClose('is_top')"
  469. >置顶
  470. </el-tag>
  471. <el-tag
  472. type="info"
  473. v-if="this.currentLabel.is_must_see===1"
  474. class="custom-label"
  475. closable
  476. :disable-transitions="false"
  477. @close="handleClose('is_must_see')"
  478. >进站必看
  479. </el-tag>
  480. <el-tag
  481. type="info"
  482. v-if="this.currentLabel.is_hot===1"
  483. class="custom-label"
  484. closable
  485. :disable-transitions="false"
  486. @close="handleClose('is_hot')"
  487. >热门
  488. </el-tag>
  489. <el-tag
  490. type="info"
  491. v-if="this.currentLabel.is_good===1"
  492. class="custom-label"
  493. closable
  494. :disable-transitions="false"
  495. @close="handleClose('is_good')"
  496. >优质
  497. </el-tag>
  498. <el-tag
  499. type="info"
  500. v-if="this.currentLabel.is_new===1"
  501. class="custom-label"
  502. closable
  503. :disable-transitions="false"
  504. @close="handleClose('is_new')"
  505. >最新
  506. </el-tag>
  507. <el-tag
  508. type="info"
  509. v-if="this.currentLabel.is_ad===1"
  510. class="custom-label"
  511. closable
  512. :disable-transitions="false"
  513. @close="handleClose('is_ad')"
  514. >广告
  515. </el-tag>
  516. </el-form-item>
  517. <el-form-item label="添加标签" :label-width="formLabelWidth">
  518. <el-select v-model="addCurrentLabel" placeholder="请选择位置">
  519. <el-option label="暂不添加" value></el-option>
  520. <el-option label="置顶" value="is_top"></el-option>
  521. <el-option label="进站必看" value="is_must_see"></el-option>
  522. <el-option label="热门" value="is_hot"></el-option>
  523. <el-option label="优质" value="is_good"></el-option>
  524. <el-option label="最新" value="is_new"></el-option>
  525. <el-option label="广告" value="is_ad"></el-option>
  526. </el-select>
  527. </el-form-item>
  528. </el-form>
  529. <div slot="footer" class="dialog-footer">
  530. <el-button type="primary" @click="addLabel">添 加</el-button>
  531. <el-button @click="labelEditFormVisible = false;getList()">关闭</el-button>
  532. </div>
  533. </el-dialog>
  534. </div>
  535. </template>
  536. <script>
  537. import {
  538. AppMain,
  539. Navbar,
  540. Settings,
  541. Sidebar,
  542. TagsView,
  543. SelectFilterable,
  544. SelectLongRangeSearch,
  545. } from "../../../layouts/components/index";
  546. export default {
  547. components: {
  548. AppMain,
  549. Navbar,
  550. Settings,
  551. Sidebar,
  552. TagsView,
  553. SelectFilterable,
  554. SelectLongRangeSearch,
  555. },
  556. data() {
  557. return {
  558. edit_id: '',
  559. contentTagManege: false,
  560. operateTagManege: false,
  561. contentTagData: {
  562. value: '',
  563. options: []
  564. },
  565. operateTagOptions: {
  566. value: '',
  567. options: [{
  568. 'label':'置顶',
  569. 'value':'is_top'
  570. },{
  571. 'label':'进站必看',
  572. 'value':'is_must_see'
  573. },{
  574. 'label':'热门',
  575. 'value':'is_hot'
  576. },{
  577. 'label':'优质',
  578. 'value':'is_good'
  579. },{
  580. 'label':'最新',
  581. 'value':'is_new'
  582. },{
  583. 'label':'广告',
  584. 'value':'is_ad'
  585. },]
  586. },
  587. operateTags: [],
  588. labelTab: "",
  589. title: "",
  590. labelOptions: [
  591. {
  592. label: '全部',
  593. value: ''
  594. },
  595. {
  596. 'label':'置顶',
  597. 'value':'is_top'
  598. },{
  599. 'label':'进站必看',
  600. 'value':'is_must_see'
  601. },{
  602. 'label':'热门',
  603. 'value':'is_hot'
  604. },{
  605. 'label':'优质',
  606. 'value':'is_good'
  607. },{
  608. 'label':'最新',
  609. 'value':'is_new'
  610. },{
  611. 'label':'广告',
  612. 'value':'is_ad'
  613. },
  614. ],
  615. is_show:"",
  616. showOptions: [
  617. {
  618. label: '全部',
  619. value: ''
  620. },
  621. {
  622. label: '显示中',
  623. value: 1
  624. },
  625. {
  626. label:'已下架',
  627. value: 0
  628. }
  629. ],
  630. page: 1,
  631. size: 20,
  632. tab: "topic",
  633. total: 1,
  634. ads: [],
  635. topics: [],
  636. videos: [],
  637. kols: [], //作者
  638. addCurrentLabel: "",
  639. form: {
  640. title: "",
  641. url: "",
  642. type: "1",
  643. tags: "",
  644. status: "1",
  645. position: "1"
  646. },
  647. kolform: {
  648. portrait: '',
  649. name: "",
  650. introduction: "",
  651. uid: "",
  652. is_signing: true,
  653. show_repost: true
  654. },
  655. options: [{
  656. value: 'wechat',
  657. label: 'wechat'
  658. }, {
  659. value: 'juejin',
  660. label: 'juejin'
  661. }, {
  662. value: 'zhihu',
  663. label: 'zhihu'
  664. }, {
  665. value: 'csdn',
  666. label: 'csdn'
  667. }],
  668. currentLabel: {
  669. is_ad: 0,
  670. is_new: 0,
  671. is_good: 0,
  672. is_hot: 0,
  673. is_must_see: 0,
  674. is_top: 0
  675. },
  676. radio: '1',
  677. currentId: 0,
  678. dialogFormVisible: false,
  679. formLabelWidth: "120px",
  680. labelEditFormVisible: false,
  681. kolFormVisible: false, //kol
  682. isEdit: false,
  683. channelData: [
  684. {
  685. channel_id: '',
  686. url: '',
  687. code: 'wechat'
  688. }
  689. ],
  690. authorName: '',
  691. createScene: '',
  692. createSceneList: [
  693. {
  694. 'label':'全部',
  695. 'value':''
  696. },{
  697. 'label':'后台新增',
  698. 'value':'admin'
  699. },{
  700. 'label':'自行绑定',
  701. 'value':'self'
  702. }
  703. ],
  704. signing:'',
  705. signingList:[{
  706. 'label':'全部',
  707. 'value':''
  708. },{
  709. 'label':'已签约',
  710. 'value':'1'
  711. },{
  712. 'label':'未签约',
  713. 'value':'0'
  714. }
  715. ],
  716. }
  717. },
  718. mounted() {
  719. this.getList();
  720. },
  721. methods: {
  722. goTopic(topic) {
  723. window.open(
  724. this.$store.state.domainConfig.jishuinUrl + "/p/" + topic.hash_id
  725. );
  726. },
  727. goVideo(topic) {
  728. window.open(
  729. this.$store.state.domainConfig.jishuinUrl + "/video/" + topic.video_id
  730. );
  731. },
  732. goRooterUser(topic) {
  733. window.open(
  734. this.$store.state.domainConfig.siteUrl + "/rooter/user/" + topic.user_id
  735. );
  736. },
  737. addLabel() {
  738. if (this.addCurrentLabel) {
  739. let res = this.$post("/api/admin/jishuquan/add_label", {
  740. id: this.currentId,
  741. type: this.addCurrentLabel
  742. }).then(res => {
  743. if (res.status === 1) {
  744. this.currentLabel[this.addCurrentLabel] = 1;
  745. this.$message({
  746. type: "success",
  747. message: "添加成功!"
  748. });
  749. }
  750. });
  751. }
  752. },
  753. handleClose(type) {
  754. this.$confirm("此操作将永久删除该标签, 是否继续?", "提示", {
  755. confirmButtonText: "确定",
  756. cancelButtonText: "取消",
  757. type: "warning"
  758. })
  759. .then(() => {
  760. let res = this.$post("/api/admin/jishuquan/remove_label", {
  761. id: this.currentId,
  762. type: type
  763. }).then(res => {
  764. if (res.status === 1) {
  765. this.currentLabel[type] = 0;
  766. this.$message({
  767. type: "success",
  768. message: "删除成功!"
  769. });
  770. }
  771. });
  772. })
  773. .catch(() => {
  774. this.$message({
  775. type: "info",
  776. message: "已取消删除"
  777. });
  778. });
  779. },
  780. editLabel(topic) {
  781. this.currentLabel = {
  782. is_ad: 0,
  783. is_new: 0,
  784. is_good: 0,
  785. is_hot: 0,
  786. is_must_see: 0,
  787. is_top: 0
  788. }; //复位
  789. this.currentId = topic.id;
  790. if (Number(topic.is_ad) === 1) this.currentLabel.is_ad = 1;
  791. if (Number(topic.is_new) === 1) this.currentLabel.is_new = 1;
  792. if (Number(topic.is_hot) === 1) this.currentLabel.is_hot = 1;
  793. if (Number(topic.is_top) === 1) this.currentLabel.is_top = 1;
  794. if (Number(topic.is_good) === 1) this.currentLabel.is_good = 1;
  795. if (Number(topic.is_must_see) === 1) this.currentLabel.is_must_see = 1;
  796. this.labelEditFormVisible = true;
  797. },
  798. delTopic(id) {
  799. this.$confirm("此操作将永久删除该文章, 是否继续?", "提示", {
  800. confirmButtonText: "确定",
  801. cancelButtonText: "取消",
  802. type: "warning"
  803. })
  804. .then(() => {
  805. let res = this.$post("/api/admin/jishuquan/delete_topic", {
  806. id: id
  807. }).then(res => {
  808. if (res.status == 1) {
  809. this.$message({
  810. type: "success",
  811. message: "删除成功!"
  812. });
  813. this.getList();
  814. }
  815. });
  816. })
  817. .catch(() => {
  818. this.$message({
  819. type: "info",
  820. message: "已取消删除"
  821. });
  822. });
  823. },
  824. stopShow(id, is_show) {
  825. let tip = '下架';
  826. if(is_show == 0){
  827. tip = '上架';
  828. }
  829. this.$confirm("此操作将"+ tip +"该文章, 是否继续?", "提示", {
  830. confirmButtonText: "确定",
  831. cancelButtonText: "取消",
  832. type: "warning"
  833. })
  834. .then(() => {
  835. let res = this.$post("/api/admin/jishuquan/stop_show", {
  836. id: id,
  837. is_show: is_show
  838. }).then(res => {
  839. if (res.status == 1) {
  840. this.$message({
  841. type: "success",
  842. message: tip +"成功!"
  843. });
  844. this.getList();
  845. }
  846. });
  847. })
  848. .catch(() => {
  849. this.$message({
  850. type: "info",
  851. message: "已取消" + tip
  852. });
  853. });
  854. },
  855. approveVideo(id) {
  856. this.$confirm("更改视频状态", "提示", {
  857. confirmButtonText: "确定",
  858. cancelButtonText: "取消",
  859. type: "warning"
  860. })
  861. .then(() => {
  862. let res = this.$post("/api/admin/jishuquan/audit_video", {
  863. id: id
  864. }).then(res => {
  865. if (res.status == 1) {
  866. this.$message({
  867. type: "success",
  868. message: "操作成功!"
  869. });
  870. this.getList();
  871. }
  872. });
  873. })
  874. .catch(() => {
  875. this.$message({
  876. type: "info",
  877. message: "已取消"
  878. });
  879. });
  880. },
  881. deleteVideo(id) {
  882. this.$confirm("此操作将永久删除该视频, 是否继续?", "提示", {
  883. confirmButtonText: "确定",
  884. cancelButtonText: "取消",
  885. type: "warning"
  886. })
  887. .then(() => {
  888. let res = this.$post("/api/admin/jishuquan/delete_video", {
  889. id: id
  890. }).then(res => {
  891. if (res.status == 1) {
  892. this.$message({
  893. type: "success",
  894. message: "删除成功!"
  895. });
  896. this.getList();
  897. }
  898. });
  899. })
  900. .catch(() => {
  901. this.$message({
  902. type: "info",
  903. message: "已取消删除"
  904. });
  905. });
  906. },
  907. showAdEdit(item) {
  908. if (item != null) {
  909. this.form.id = item.id;
  910. this.form.title = item.title;
  911. this.form.url = item.url;
  912. this.form.type = item.type;
  913. this.form.tags = item.tags;
  914. this.form.status = item.status;
  915. this.form.position = item.position;
  916. this.form.uid = item.uid;
  917. }
  918. this.dialogFormVisible = true;
  919. },
  920. deleteAd(id) {
  921. this.$confirm("此操作将永久删除该活动, 是否继续?", "提示", {
  922. confirmButtonText: "确定",
  923. cancelButtonText: "取消",
  924. type: "warning"
  925. })
  926. .then(() => {
  927. let res = this.$post("/api/admin/jishuquan/delete_ad", {
  928. id: id
  929. }).then(res => {
  930. if (res.status == 1) {
  931. this.$message({
  932. type: "success",
  933. message: "删除成功!"
  934. });
  935. this.getList();
  936. }
  937. });
  938. })
  939. .catch(() => {
  940. this.$message({
  941. type: "info",
  942. message: "已取消删除"
  943. });
  944. });
  945. },
  946. async editAd() {
  947. let form = this.form;
  948. if (form.id) {
  949. let res = await this.$post("/api/admin/jishuquan/update_ad", form);
  950. if (res.status == 1) {
  951. this.$message({
  952. type: "success",
  953. message: "修改成功"
  954. });
  955. }
  956. } else {
  957. let res = this.$post("/api/admin/jishuquan/create_ad", form);
  958. if (res.status == 1) {
  959. this.$message.success("创建成功");
  960. this.form = {
  961. title: "",
  962. url: "",
  963. type: "1",
  964. tags: "",
  965. status: "1",
  966. position: "1"
  967. };
  968. }
  969. }
  970. this.getList();
  971. this.dialogFormVisible = false;
  972. },
  973. handleCurrentChange(val) {
  974. this.page = val;
  975. this.getList();
  976. },
  977. async getList() {
  978. const page = this.page;
  979. const size = this.size;
  980. const data = {
  981. page,
  982. size
  983. };
  984. let res;
  985. switch (this.tab) {
  986. case "ad":
  987. res = await this.$post("/api/admin/jishuquan/get_ads", data);
  988. this.ads = res.data.ads;
  989. this.total = res.data.total;
  990. break;
  991. case "video":
  992. res = await this.$post("/api/admin/jishuquan/get_videos", data);
  993. this.videos = res.data.videos;
  994. this.total = res.data.total;
  995. break;
  996. case "topic":
  997. if (this.labelTab) data.type = this.labelTab;
  998. data.is_show = this.is_show;
  999. if (this.title) data.title = this.title;
  1000. res = await this.$post("/api/admin/jishuquan/get_topics", data);
  1001. this.topics = res.data.topics;
  1002. this.total = res.data.total;
  1003. if(this.contentTagData.options.length == 0){
  1004. res = await this.$post("/api/admin/jishuquan/listTags", {});
  1005. this.contentTagData.options = [];
  1006. if(res.status == 1){
  1007. let op_arr = new Array();
  1008. for(var i in res.data) {
  1009. op_arr.push({value:res.data[i].id, label:res.data[i].name});
  1010. }
  1011. this.contentTagData.options = op_arr;
  1012. }
  1013. }
  1014. break;
  1015. case "kol":
  1016. res = await this.$post("/api/admin/author/get_aus", data);
  1017. this.kols = res.data.aus;
  1018. this.total = res.data.total;
  1019. break;
  1020. }
  1021. },
  1022. async contact(id) {
  1023. const data = {
  1024. id
  1025. };
  1026. let res = await this.$post("/api/admin/jishuquan/get_ads", data);
  1027. this.$message({
  1028. message: res.info,
  1029. type: "success"
  1030. });
  1031. },
  1032. deleteChannleRow(index) {
  1033. this.channelData.splice(index, 1);
  1034. },
  1035. addChannleRow() {
  1036. this.channelData.push({channel_id: '', url: '', code: 'wechat'})
  1037. },
  1038. onEditAu(id) {
  1039. this.isEdit = true;
  1040. let res = this.$post("/api/admin/author/get_row", {id: id})
  1041. .then(res => {
  1042. if (res.status == 1) {
  1043. this.kolform = res.data;
  1044. this.kolform.is_signing = res.data.is_signing == 1 ? true : false;
  1045. this.kolform.show_repost = res.data.show_repost == 1 ? true : false;
  1046. this.channelData = res.data.channel.length >= 1 ? res.data.channel : [
  1047. {
  1048. channel_id: '',
  1049. url: '',
  1050. code: 'wechat'
  1051. }
  1052. ];
  1053. this.kolFormVisible = true;
  1054. }
  1055. }).catch((re) => {
  1056. this.$message({
  1057. type: "error",
  1058. message: "网络连接错误"
  1059. });
  1060. });
  1061. },
  1062. onAddAu(item) {
  1063. this.clearA();
  1064. this.kolFormVisible = true;
  1065. },
  1066. async editAu() {
  1067. let form = this.kolform;
  1068. form.is_signing = form.is_signing ? 1 : 0;
  1069. form.channelData = JSON.stringify(this.channelData);
  1070. form.show_repost = form.show_repost ? 1 : 0;
  1071. if (form.id) {
  1072. let res = this.$post("/api/admin/author/update_au", form)
  1073. .then(res => {
  1074. if (res.status == 1) {
  1075. this.$message({
  1076. type: "success",
  1077. message: "修改成功!"
  1078. });
  1079. this.clearA();
  1080. this.kolFormVisible = false;
  1081. }
  1082. }).catch((re) => {
  1083. this.$message({
  1084. type: "error",
  1085. message: "修改失败"
  1086. });
  1087. });
  1088. } else {
  1089. if (this.radio == '1') {
  1090. form.uid = '';
  1091. }
  1092. form.create_scene = 'admin';
  1093. let res = await this.$post("/api/admin/author/create_au", form)
  1094. .then(res => {
  1095. if (res.status == 1) {
  1096. this.$message({
  1097. type: "success",
  1098. message: "添加成功!"
  1099. });
  1100. this.clearA();
  1101. this.kolFormVisible = false;
  1102. }
  1103. }).catch((re) => {
  1104. this.$message({
  1105. type: "error",
  1106. message: "添加失败"
  1107. });
  1108. });
  1109. }
  1110. },
  1111. clearA() {
  1112. this.isEdit = false;
  1113. this.kolform = {
  1114. portrait: './',
  1115. name: "",
  1116. introduction: "",
  1117. uid: '',
  1118. is_signing: true,
  1119. };
  1120. this.channelData = [{channel_id: '', url: '', code: 'wechat'}];
  1121. this.getList();
  1122. },
  1123. async search(){
  1124. let form = {
  1125. 'authorName': this.authorName,
  1126. 'createScene': this.createScene,
  1127. 'signing': this.signing,
  1128. 'page': this.page,
  1129. 'size': this.size,
  1130. }
  1131. let res = await this.$post("/api/admin/author/search_aus", form)
  1132. .then(res => {
  1133. if (res.status == 1) {
  1134. this.kols = res.data.aus;
  1135. this.total = res.data.total;
  1136. this.$message({
  1137. type: "success",
  1138. message: "查询成功!"
  1139. });
  1140. }
  1141. }).catch((re) => {
  1142. this.$message({
  1143. type: "error",
  1144. message: "查询失败"
  1145. });
  1146. });
  1147. },
  1148. editContentTag(row){
  1149. this.edit_id = row.id;
  1150. this.contentTagManege = true;
  1151. this.contentTagData.value = row.tags && row.tags.map(item => item.tag_id) || [];
  1152. },
  1153. editOperateTag(row){
  1154. this.edit_id = row.id;
  1155. let tags = new Array();
  1156. if(row.is_top == 1){
  1157. tags.push('is_top');
  1158. }
  1159. if(row.is_must_see == 1){
  1160. tags.push('is_must_see');
  1161. }
  1162. if(row.is_hot == 1){
  1163. tags.push('is_hot');
  1164. }
  1165. if(row.is_good == 1){
  1166. tags.push('is_good');
  1167. }
  1168. if(row.is_new == 1){
  1169. tags.push('is_new');
  1170. }
  1171. if(row.is_ad == 1){
  1172. tags.push('is_ad');
  1173. }
  1174. this.operateTagOptions.value = tags;
  1175. this.operateTagManege = true;
  1176. },
  1177. async addContentTag(){
  1178. let id = this.edit_id;
  1179. let tags = this.contentTagData.value;
  1180. let data = {
  1181. id: id,
  1182. tags: tags
  1183. };
  1184. let res = await this.$post("/api/admin/jishuquan/updateTopicTags", data)
  1185. .then(res => {
  1186. if (res.status == 1) {
  1187. this.$message({
  1188. type: "success",
  1189. message: "编辑成功!"
  1190. });
  1191. this.contentTagData.value = [];
  1192. this.getList();
  1193. this.contentTagManege = false;
  1194. }
  1195. }).catch((re) => {
  1196. this.$message({
  1197. type: "error",
  1198. message: "编辑失败"
  1199. });
  1200. });
  1201. },
  1202. async addOperateTag(){
  1203. let id = this.edit_id;
  1204. let tags = this.operateTagOptions.value;
  1205. let data = {
  1206. id: id,
  1207. is_top: 0,
  1208. is_must_see: 0,
  1209. is_hot: 0,
  1210. is_good: 0,
  1211. is_new: 0,
  1212. is_ad: 0,
  1213. };
  1214. for(var j = 0; j < tags.length; j++) {
  1215. if(tags[j] === 'is_top'){
  1216. data.is_top = 1;
  1217. }else if(tags[j] === 'is_must_see'){
  1218. data.is_must_see = 1;
  1219. }else if(tags[j] === 'is_hot'){
  1220. data.is_hot = 1;
  1221. }else if(tags[j] === 'is_good'){
  1222. data.is_good = 1;
  1223. }else if(tags[j] ==='is_new'){
  1224. data.is_new = 1;
  1225. }else if(tags[j] === 'is_ad'){
  1226. data.is_ad = 1;
  1227. }
  1228. }
  1229. let res = await this.$post("/api/admin/jishuquan/update_operate_tag", data)
  1230. .then(res => {
  1231. if (res.status == 1) {
  1232. this.kols = res.data.aus;
  1233. this.total = res.data.total;
  1234. this.$message({
  1235. type: "success",
  1236. message: "编辑成功!"
  1237. });
  1238. this.getList();
  1239. this.operateTagManege = false;
  1240. }
  1241. }).catch((re) => {
  1242. this.$message({
  1243. type: "error",
  1244. message: "编辑失败"
  1245. });
  1246. });
  1247. }
  1248. }
  1249. };
  1250. </script>
  1251. <style lang="scss" scoped>
  1252. .count-list {
  1253. padding-bottom: 10px;
  1254. display: flex;
  1255. align-items: center;
  1256. }
  1257. .count-item {
  1258. margin-right: 20px;
  1259. font-size: 16px;
  1260. }
  1261. .content {
  1262. margin-top: 30px;
  1263. white-space: nowrap;
  1264. overflow-x: scroll;
  1265. height: calc(100vh - 150px);
  1266. }
  1267. .btn {
  1268. width: 80px;
  1269. }
  1270. .order-footer {
  1271. margin-top: 10px;
  1272. }
  1273. .custom-label {
  1274. margin-bottom: 5px;
  1275. }
  1276. </style>