jishuquan.vue 45 KB

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