index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. <!--
  2. MIT License
  3. Copyright (c) 2020 www.joolun.com
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in all
  11. copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. SOFTWARE.
  19. -->
  20. <template>
  21. <div class="app-container">
  22. <!-- 搜索工作栏 -->
  23. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  24. <el-form-item label="公众号" prop="accountId">
  25. <el-select v-model="queryParams.accountId" placeholder="请选择公众号">
  26. <el-option v-for="item in accounts" :key="parseInt(item.id)" :label="item.name" :value="parseInt(item.id)" />
  27. </el-select>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  31. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  32. </el-form-item>
  33. </el-form>
  34. <!-- 操作工具栏 -->
  35. <el-row :gutter="10" class="mb8">
  36. <el-col :span="1.5">
  37. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
  38. v-hasPermi="['mp:draft:create']">新增
  39. </el-button>
  40. </el-col>
  41. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  42. </el-row>
  43. <!-- 列表 -->
  44. <div class="waterfall" v-loading="loading">
  45. <div v-if="item.content && item.content.newsItem" class="waterfall-item" v-for="item in list"
  46. :key='item.articleId'>
  47. <wx-news :articles="item.content.newsItem" />
  48. <!-- TODO 芋艿:权限、样式(搜索框之类的) -->
  49. <el-row class="ope-row">
  50. <el-button type="success" circle @click="handlePublishNews(item)">发布</el-button>
  51. <el-button type="primary" icon="el-icon-edit" circle @click="handleEditNews(item)"></el-button>
  52. <el-button type="danger" icon="el-icon-delete" circle @click="delMaterial(item)"></el-button>
  53. </el-row>
  54. </div>
  55. </div>
  56. <!-- 分页记录 -->
  57. <div v-if="list.length <= 0 && !loading" class="el-table__empty-block">
  58. <span class="el-table__empty-text">暂无数据</span>
  59. </div>
  60. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
  61. @pagination="getList"/>
  62. <!-- TODO 芋艿:位置调整 -->
  63. <el-dialog :title="operateMaterial === 'add' ? '新建图文' : '修改图文'"
  64. append-to-body
  65. :before-close="dialogNewsClose"
  66. :close-on-click-modal="false"
  67. :visible.sync="dialogNewsVisible"
  68. width="80%"
  69. top="20px">
  70. <div class="left">
  71. <div class="select-item">
  72. <div v-for="(news, index) in articlesAdd" :key='news.id'>
  73. <div class="news-main father" v-if="index === 0" :class="{'activeAddNews': isActiveAddNews === index}"
  74. @click="activeNews(index)">
  75. <div class="news-content">
  76. <img class="material-img" v-if="news.thumbUrl" :src="news.thumbUrl"/>
  77. <div class="news-content-title">{{news.title}}</div>
  78. </div>
  79. <div class="child" v-if="articlesAdd.length>1">
  80. <el-button type="mini" icon="el-icon-sort-down" @click="downNews(index)">下移</el-button>
  81. <el-button v-if="operateMaterial === 'add'" type="mini" icon="el-icon-delete"
  82. @click="minusNews(index)">删除
  83. </el-button>
  84. </div>
  85. </div>
  86. <div class="news-main-item father" v-if="index>0" :class="{'activeAddNews': isActiveAddNews === index}"
  87. @click="activeNews(index)">
  88. <div class="news-content-item">
  89. <div class="news-content-item-title ">{{news.title}}</div>
  90. <div class="news-content-item-img">
  91. <img class="material-img" v-if="news.thumbUrl" :src="news.thumbUrl" height="100%"/>
  92. </div>
  93. </div>
  94. <div class="child">
  95. <el-button v-if="articlesAdd.length > index+1" type="mini" icon="el-icon-sort-down"
  96. @click="downNews(index)">下移
  97. </el-button>
  98. <el-button type="mini" icon="el-icon-sort-up" @click="upNews(index)">上移</el-button>
  99. <el-button v-if="operateMaterial=== 'add'" type="mini" icon="el-icon-delete"
  100. @click="minusNews(index)">删除
  101. </el-button>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="news-main-plus" @click="plusNews" v-if="articlesAdd.length<8 && operateMaterial==='add'">
  106. <i class="el-icon-circle-plus icon-plus"></i>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="right" v-loading="addMaterialLoading" v-if="articlesAdd.length > 0">
  111. <!--富文本编辑器组件-->
  112. <el-row>
  113. <WxEditor v-model="articlesAdd[isActiveAddNews].content" :uploadData="uploadData"
  114. v-if="hackResetEditor"/>
  115. </el-row>
  116. <br><br><br><br>
  117. <!-- 封面和摘要 -->
  118. <div class="input-tt">封面和摘要:</div>
  119. <div>
  120. <div class="thumb-div">
  121. <img class="material-img" v-if="articlesAdd[isActiveAddNews].thumbUrl"
  122. :src="articlesAdd[isActiveAddNews].thumbUrl" :class="isActiveAddNews === 0 ? 'avatar':'avatar1'">
  123. <i v-else class="el-icon-plus avatar-uploader-icon"
  124. :class="isActiveAddNews === 0 ? 'avatar':'avatar1'"></i>
  125. <div class="thumb-but">
  126. <el-upload :action="actionUrl" :headers="headers" multiple :limit="1" :file-list="fileList" :data="uploadData"
  127. :before-upload="beforeThumbImageUpload" :on-success="handleUploadSuccess">
  128. <el-button slot="trigger" size="mini" type="primary">本地上传</el-button>
  129. <el-button size="mini" type="primary" @click="openMaterial" style="margin-left: 5px">素材库选择</el-button>
  130. <div slot="tip" class="el-upload__tip">支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M</div>
  131. </el-upload>
  132. </div>
  133. </div>
  134. <el-dialog title="选择图片" :visible.sync="dialogImageVisible" width="80%" append-to-body>
  135. <WxMaterialSelect :objData="{repType:'image'}" @selectMaterial="selectMaterial" />
  136. </el-dialog>
  137. <el-input :rows="8" type="textarea" v-model="articlesAdd[isActiveAddNews].digest" placeholder="请输入摘要"
  138. class="digest" maxlength="120"></el-input>
  139. </div>
  140. <!-- 标题、作者、原文地址 -->
  141. <div class="input-tt">标题:</div>
  142. <el-input v-model="articlesAdd[isActiveAddNews].title" placeholder="请输入标题"></el-input>
  143. <div class="input-tt">作者:</div>
  144. <el-input v-model="articlesAdd[isActiveAddNews].author" placeholder="请输入作者"></el-input>
  145. <div class="input-tt">原文地址:</div>
  146. <el-input v-model="articlesAdd[isActiveAddNews].contentSourceUrl" placeholder="请输入原文地址"></el-input>
  147. </div>
  148. <div slot="footer" class="dialog-footer">
  149. <el-button @click="dialogNewsVisible = false">取 消</el-button>
  150. <el-button type="primary" @click="submitForm">提 交</el-button>
  151. </div>
  152. </el-dialog>
  153. </div>
  154. </template>
  155. <script>
  156. // import { getPage as getPage1 } from '@/api/wxmp/wxmaterial'
  157. // import WxEditor from '@/components/Editor/WxEditor.vue'
  158. import WxNews from '@/views/mp/components/wx-news/main.vue';
  159. import WxMaterialSelect from '@/views/mp/components/wx-material-select/main.vue'
  160. import { getAccessToken } from '@/utils/auth'
  161. import {createDraft, getDraftPage} from "@/api/mp/draft";
  162. import {getSimpleAccounts} from "@/api/mp/account";
  163. export default {
  164. name: 'mpDraft',
  165. components: {
  166. // WxEditor,
  167. WxNews,
  168. WxMaterialSelect
  169. },
  170. data() {
  171. return {
  172. // 遮罩层
  173. loading: false,
  174. // 显示搜索条件
  175. showSearch: true,
  176. // 总条数
  177. total: 0,
  178. // 数据列表
  179. list: [],
  180. queryParams: {
  181. pageNo: 1,
  182. pageSize: 10,
  183. accountId: undefined,
  184. },
  185. page1: {
  186. total: 0, // 总页数
  187. currentPage: 1, // 当前页数
  188. pageSize: 10 // 每页显示多少条
  189. },
  190. // ========== 文件上传 ==========
  191. actionUrl: process.env.VUE_APP_BASE_API + "/admin-api/mp/material/upload-permanent", // 上传永久素材的地址
  192. headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
  193. fileList: [],
  194. uploadData: {
  195. "type": 'image', // TODO 芋艿:试试要不要换成 thumb
  196. "title": '',
  197. "introduction": '',
  198. "accountId": 1,
  199. },
  200. // ========== 草稿新建 or 修改 ==========
  201. dialogNewsVisible: false,
  202. addMaterialLoading: false, // 添加草稿的 loading 标识
  203. articlesAdd: [],
  204. isActiveAddNews: 0,
  205. dialogImageVisible: false,
  206. imageListData: [],
  207. tableLoading1: false,
  208. operateMaterial: 'add',
  209. articlesMediaId: '',
  210. hackResetEditor: false,
  211. // 公众号账号列表
  212. accounts: [],
  213. }
  214. },
  215. created() {
  216. getSimpleAccounts().then(response => {
  217. this.accounts = response.data;
  218. // 默认选中第一个
  219. if (this.accounts.length > 0) {
  220. this.queryParams.accountId = this.accounts[0].id;
  221. this.setAccountId(this.accounts[0].id);
  222. }
  223. // 加载数据
  224. // this.getList();
  225. })
  226. },
  227. methods: {
  228. /** 设置账号编号 */
  229. setAccountId(accountId) {
  230. this.queryParams.accountId = accountId;
  231. this.uploadData.accountId = accountId;
  232. },
  233. /** 查询列表 */
  234. getList() {
  235. // 如果没有选中公众号账号,则进行提示。
  236. if (!this.queryParams.accountId) {
  237. this.$message.error('未选中公众号,无法查询草稿箱')
  238. return false
  239. }
  240. this.loading = true
  241. getDraftPage((this.queryParams)).then(response => {
  242. // 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
  243. response.data.list.forEach(item => {
  244. const newsItem = item.content.newsItem;
  245. newsItem.forEach(article => {
  246. article.picUrl = article.thumbUrl;
  247. })
  248. })
  249. this.list = response.data.list
  250. this.total = response.data.total
  251. }).finally(() => {
  252. this.loading = false
  253. })
  254. },
  255. /** 搜索按钮操作 */
  256. handleQuery() {
  257. this.queryParams.pageNo = 1
  258. this.getList()
  259. },
  260. /** 重置按钮操作 */
  261. resetQuery() {
  262. this.resetForm('queryForm')
  263. // 默认选中第一个
  264. if (this.accounts.length > 0) {
  265. this.setAccountId(this.accounts[0].id)
  266. }
  267. this.handleQuery()
  268. },
  269. delMaterial(item){
  270. this.$confirm('此操作将永久删除该草稿, 是否继续?', '提示', {
  271. confirmButtonText: '确定',
  272. cancelButtonText: '取消',
  273. type: 'warning'
  274. }).then(() => {
  275. this.loading = true
  276. delObj({
  277. id:item.mediaId
  278. }).then(response => {
  279. this.loading = false
  280. if(response.code == 200){
  281. this.getList(this.queryParams)
  282. }else{
  283. this.loading = false
  284. this.$message.error('删除出错:' + response.msg)
  285. }
  286. }).catch(() => {
  287. this.loading = false
  288. })
  289. })
  290. },
  291. getPage1(){
  292. this.tableLoading1 = true
  293. getPage1({
  294. current: this.page1.currentPage,
  295. size: this.page1.pageSize,
  296. type:'image'
  297. }).then(response => {
  298. this.tableLoading1 = false
  299. this.imageListData = response.data.items
  300. this.page1.total = response.data.totalCount
  301. }).catch(() => {
  302. this.tableLoading1 = false
  303. })
  304. },
  305. openMaterial(){
  306. this.imageListData = null
  307. this.page1.currentPage = 1
  308. this.getPage1()
  309. this.dialogImageVisible = true
  310. },
  311. dialogNewsClose(done){
  312. this.$confirm('修改内容可能还未保存,确定关闭吗?', '提示', {
  313. confirmButtonText: '确定',
  314. cancelButtonText: '取消',
  315. type: 'warning'
  316. }).then(() => {
  317. this.hackResetEditor = false//销毁组件
  318. this.$nextTick(() => {
  319. this.hackResetEditor = true//重建组件
  320. })
  321. this.isActiveAddNews = 0
  322. done()
  323. }).catch(() => {
  324. })
  325. },
  326. /** 提交按钮 */
  327. submitForm() {
  328. this.addMaterialLoading = true
  329. if (this.operateMaterial === 'add') {
  330. createDraft(this.queryParams.accountId, this.articlesAdd).then(response => {
  331. this.$modal.msgSuccess("新增成功");
  332. this.dialogNewsVisible = false;
  333. this.getList()
  334. }).finally(() => {
  335. this.addMaterialLoading = false
  336. })
  337. }
  338. if(this.operateMaterial == 'edit'){
  339. putObj({
  340. articles:this.articlesAdd,
  341. mediaId:this.articlesMediaId
  342. }).then(response => {
  343. this.addMaterialLoading = false
  344. this.dialogNewsVisible = false
  345. if(response.code == 200){
  346. this.isActiveAddNews = 0
  347. this.articlesAdd = [
  348. {
  349. "title": '',
  350. "thumbMediaId": '',
  351. "author": '',
  352. "digest": '',
  353. "showCoverPic": '',
  354. "content": '',
  355. "contentSourceUrl": '',
  356. "needOpenComment":'',
  357. "onlyFansCanComment":'',
  358. "thumbUrl":''
  359. }
  360. ]
  361. this.getList(this.queryParams)
  362. }else{
  363. this.$message.error('修改图文出错:' + response.msg)
  364. }
  365. }).catch(() => {
  366. this.addMaterialLoading = false
  367. })
  368. }
  369. },
  370. handleEditNews(item){
  371. this.hackResetEditor = false // 销毁组件
  372. this.$nextTick(() => {
  373. this.hackResetEditor = true // 重建组件
  374. })
  375. if (this.operateMaterial == 'add') {
  376. this.isActiveAddNews = 0
  377. }
  378. this.operateMaterial = 'edit'
  379. this.articlesAdd = JSON.parse(JSON.stringify(item.content.newsItem))
  380. this.articlesMediaId = item.mediaId
  381. this.dialogNewsVisible = true
  382. },
  383. /** 新增按钮操作 */
  384. handleAdd() {
  385. this.resetEditor();
  386. this.reset();
  387. // 打开表单,并设置初始化
  388. this.operateMaterial = 'add'
  389. this.dialogNewsVisible = true
  390. },
  391. // 表单重置
  392. reset() {
  393. this.isActiveAddNews = 0
  394. this.articlesAdd = [this.buildEmptyArticle()]
  395. },
  396. // 表单 Editor 重置
  397. resetEditor() {
  398. this.hackResetEditor = false // 销毁组件
  399. this.$nextTick(() => {
  400. this.hackResetEditor = true // 重建组件
  401. })
  402. },
  403. // 将图文向下移动
  404. downNews(index) {
  405. let temp = this.articlesAdd[index]
  406. this.articlesAdd[index] = this.articlesAdd[index+1]
  407. this.articlesAdd[index + 1] = temp
  408. this.isActiveAddNews = index + 1
  409. },
  410. // 将图文向上移动
  411. upNews(index) {
  412. let temp = this.articlesAdd[index]
  413. this.articlesAdd[index] = this.articlesAdd[index - 1]
  414. this.articlesAdd[index - 1] = temp
  415. this.isActiveAddNews = index - 1
  416. },
  417. // 选中指定 index 的图文
  418. activeNews(index) {
  419. this.resetEditor();
  420. this.isActiveAddNews = index
  421. },
  422. // 删除指定 index 的图文
  423. minusNews(index) {
  424. this.$modal.confirm('确定删除该图文吗?').then(() => {
  425. this.articlesAdd.splice(index,1);
  426. if (this.isActiveAddNews === index) {
  427. this.isActiveAddNews = 0
  428. }
  429. }).catch(() => {})
  430. },
  431. // 添加一个图文
  432. plusNews() {
  433. this.articlesAdd.push(this.buildEmptyArticle())
  434. this.isActiveAddNews = this.articlesAdd.length - 1
  435. },
  436. // 创建空的 article
  437. buildEmptyArticle() {
  438. return {
  439. "title": '',
  440. "thumbMediaId": '',
  441. "author": '',
  442. "digest": '',
  443. "showCoverPic": '',
  444. "content": '',
  445. "contentSourceUrl": '',
  446. "needOpenComment":'',
  447. "onlyFansCanComment":'',
  448. "thumbUrl":''
  449. }
  450. },
  451. // ======================== 文件上传 ========================
  452. beforeThumbImageUpload(file) {
  453. this.addMaterialLoading = true
  454. const isType = file.type === 'image/jpeg'
  455. || file.type === 'image/png'
  456. || file.type === 'image/gif'
  457. || file.type === 'image/bmp'
  458. || file.type === 'image/jpg';
  459. if (!isType) {
  460. this.$message.error('上传图片格式不对!')
  461. this.addMaterialLoading = false
  462. return false;
  463. }
  464. const isLt = file.size / 1024 / 1024 < 2
  465. if (!isLt) {
  466. this.$message.error('上传图片大小不能超过 2M!')
  467. this.addMaterialLoading = false
  468. return false;
  469. }
  470. // 校验通过
  471. return true;
  472. },
  473. handleUploadSuccess(response, file, fileList) {
  474. this.addMaterialLoading = false // 关闭 loading
  475. if (response.code !== 0) {
  476. this.$message.error('上传出错:' + response.msg)
  477. return false;
  478. }
  479. // 重置上传文件的表单
  480. this.fileList = []
  481. this.uploadData.title = ''
  482. this.uploadData.introduction = ''
  483. // 设置草稿的封面字段
  484. this.articlesAdd[this.isActiveAddNews].thumbMediaId = response.data.mediaId
  485. this.articlesAdd[this.isActiveAddNews].thumbUrl = response.data.url
  486. },
  487. selectMaterial(item){
  488. this.dialogImageVisible = false
  489. this.articlesAdd[this.isActiveAddNews].thumbMediaId = item.mediaId
  490. this.articlesAdd[this.isActiveAddNews].thumbUrl = item.url
  491. },
  492. // ======================== 草稿箱发布 ========================
  493. handlePublishNews(item){
  494. this.$confirm('你正在通过发布的方式发表内容。 发布不占用群发次数,一天可多次发布。已发布内容不会推送给用户,也不会展示在公众号主页中。 发布后,你可以前往发表记录获取链接,也可以将发布内容添加到自定义菜单、自动回复、话题和页面模板中。', '提示', {
  495. confirmButtonText: '确定',
  496. cancelButtonText: '取消',
  497. type: 'warning'
  498. }).then(() => {
  499. this.loading = true
  500. publish(item.mediaId).then(response => {
  501. this.loading = false
  502. this.$message.success('发布任务提交成功')
  503. this.getList(this.queryParams)
  504. }).catch(() => {
  505. this.loading = false
  506. })
  507. }).catch(() => {
  508. })
  509. }
  510. }
  511. }
  512. </script>
  513. <style lang="scss" scoped>
  514. .pagination {
  515. float: right;
  516. margin-right: 25px;
  517. }
  518. .add_but {
  519. padding: 10px;
  520. }
  521. .ope-row {
  522. margin-top: 5px;
  523. text-align: center;
  524. border-top: 1px solid #eaeaea;
  525. padding-top: 5px;
  526. }
  527. .item-name {
  528. font-size: 12px;
  529. overflow: hidden;
  530. text-overflow: ellipsis;
  531. white-space: nowrap;
  532. text-align: center;
  533. }
  534. .el-upload__tip {
  535. margin-left: 5px;
  536. }
  537. /*新增图文*/
  538. .left {
  539. display: inline-block;
  540. width: 35%;
  541. vertical-align: top;
  542. margin-top: 200px;
  543. }
  544. .right {
  545. display: inline-block;
  546. width: 60%;
  547. margin-top: -40px;
  548. }
  549. .avatar-uploader {
  550. width: 20%;
  551. display: inline-block;
  552. }
  553. .avatar-uploader .el-upload {
  554. border-radius: 6px;
  555. cursor: pointer;
  556. position: relative;
  557. overflow: hidden;
  558. text-align: unset !important;
  559. }
  560. .avatar-uploader .el-upload:hover {
  561. border-color: #165dff;
  562. }
  563. .avatar-uploader-icon {
  564. border: 1px solid #d9d9d9;
  565. font-size: 28px;
  566. color: #8c939d;
  567. width: 120px;
  568. height: 120px;
  569. line-height: 120px;
  570. text-align: center;
  571. }
  572. .avatar {
  573. width: 230px;
  574. height: 120px;
  575. }
  576. .avatar1 {
  577. width: 120px;
  578. height: 120px;
  579. }
  580. .digest {
  581. width: 60%;
  582. display: inline-block;
  583. vertical-align: top;
  584. }
  585. /*新增图文*/
  586. /*瀑布流样式*/
  587. .waterfall {
  588. width: 100%;
  589. column-gap: 10px;
  590. column-count: 5;
  591. margin: 0 auto;
  592. }
  593. .waterfall-item {
  594. padding: 10px;
  595. margin-bottom: 10px;
  596. break-inside: avoid;
  597. border: 1px solid #eaeaea;
  598. }
  599. p {
  600. line-height: 30px;
  601. }
  602. @media (min-width: 992px) and (max-width: 1300px) {
  603. .waterfall {
  604. column-count: 3;
  605. }
  606. p {
  607. color: red;
  608. }
  609. }
  610. @media (min-width: 768px) and (max-width: 991px) {
  611. .waterfall {
  612. column-count: 2;
  613. }
  614. p {
  615. color: orange;
  616. }
  617. }
  618. @media (max-width: 767px) {
  619. .waterfall {
  620. column-count: 1;
  621. }
  622. }
  623. /*瀑布流样式*/
  624. .news-main {
  625. background-color: #FFFFFF;
  626. width: 100%;
  627. margin: auto;
  628. height: 120px;
  629. }
  630. .news-content {
  631. background-color: #acadae;
  632. width: 100%;
  633. height: 120px;
  634. position: relative;
  635. }
  636. .news-content-title {
  637. display: inline-block;
  638. font-size: 15px;
  639. color: #FFFFFF;
  640. position: absolute;
  641. left: 0px;
  642. bottom: 0px;
  643. background-color: black;
  644. width: 98%;
  645. padding: 1%;
  646. opacity: 0.65;
  647. overflow: hidden;
  648. text-overflow: ellipsis;
  649. white-space: nowrap;
  650. height: 25px;
  651. }
  652. .news-main-item {
  653. background-color: #FFFFFF;
  654. padding: 5px 0px;
  655. border-top: 1px solid #eaeaea;
  656. width: 100%;
  657. margin: auto;
  658. }
  659. .news-content-item {
  660. position: relative;
  661. margin-left: -3px
  662. }
  663. .news-content-item-title {
  664. display: inline-block;
  665. font-size: 12px;
  666. width: 70%;
  667. }
  668. .news-content-item-img {
  669. display: inline-block;
  670. width: 25%;
  671. background-color: #acadae
  672. }
  673. .input-tt {
  674. padding: 5px;
  675. }
  676. .activeAddNews {
  677. border: 5px solid #2bb673;
  678. }
  679. .news-main-plus {
  680. width: 280px;
  681. text-align: center;
  682. margin: auto;
  683. height: 50px;
  684. }
  685. .icon-plus {
  686. margin: 10px;
  687. font-size: 25px;
  688. }
  689. .select-item {
  690. width: 60%;
  691. padding: 10px;
  692. margin: 0 auto 10px auto;
  693. border: 1px solid #eaeaea;
  694. }
  695. .father .child {
  696. display: none;
  697. text-align: center;
  698. position: relative;
  699. bottom: 25px;
  700. }
  701. .father:hover .child {
  702. display: block;
  703. }
  704. .thumb-div {
  705. display: inline-block;
  706. width: 30%;
  707. text-align: center;
  708. }
  709. .thumb-but {
  710. margin: 5px;
  711. }
  712. .material-img {
  713. width: 100%;
  714. height: 100%;
  715. }
  716. </style>