index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  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="handleAddNews"
  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">
  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. <div class="input-tt">封面和摘要:</div>
  118. <div>
  119. <div class="thumb-div">
  120. <img class="material-img" v-if="articlesAdd[isActiveAddNews].thumbUrl"
  121. :src="articlesAdd[isActiveAddNews].thumbUrl" :class="isActiveAddNews == 0 ? 'avatar':'avatar1'">
  122. <i v-else class="el-icon-plus avatar-uploader-icon"
  123. :class="isActiveAddNews === 0 ? 'avatar':'avatar1'"></i>
  124. <div class="thumb-but">
  125. <el-upload
  126. :action="actionUrl"
  127. :headers="headers"
  128. multiple
  129. :limit="1"
  130. :on-success="handleUploadSuccess"
  131. :file-list="fileList"
  132. :before-upload="beforeThumbImageUpload"
  133. :data="uploadData">
  134. <el-button slot="trigger" size="mini" type="primary">
  135. 本地上传
  136. </el-button>
  137. <el-button size="mini" type="primary"
  138. @click="openMaterial" style="margin-left: 5px">素材库选择
  139. </el-button>
  140. <div slot="tip" class="el-upload__tip">支持bmp/png/jpeg/jpg/gif格式,大小不超过2M</div>
  141. </el-upload>
  142. </div>
  143. </div>
  144. <el-dialog title="选择图片" :visible.sync="dialogImageVisible" width="80%" append-to-body>
  145. <WxMaterialSelect :objData="{repType:'image'}"
  146. @selectMaterial="selectMaterial"></WxMaterialSelect>
  147. </el-dialog>
  148. <el-input :rows="8" type="textarea" v-model="articlesAdd[isActiveAddNews].digest" placeholder="请输入摘要"
  149. class="digest" maxlength="120"></el-input>
  150. </div>
  151. <div class="input-tt">标题:</div>
  152. <el-input v-model="articlesAdd[isActiveAddNews].title" placeholder="请输入标题"></el-input>
  153. <div class="input-tt">作者:</div>
  154. <el-input v-model="articlesAdd[isActiveAddNews].author" placeholder="请输入作者"></el-input>
  155. <div class="input-tt">原文地址:</div>
  156. <el-input v-model="articlesAdd[isActiveAddNews].contentSourceUrl" placeholder="请输入原文地址"></el-input>
  157. </div>
  158. <div slot="footer" class="dialog-footer">
  159. <el-button @click="dialogNewsVisible = false">取 消</el-button>
  160. <el-button type="primary" @click="subNews">提 交</el-button>
  161. </div>
  162. </el-dialog>
  163. </div>
  164. </template>
  165. <script>
  166. // import {getPage, addObj, delObj, putObj, publish} from '@/api/wxmp/wxdraft'
  167. // import { getPage as getPage1 } from '@/api/wxmp/wxmaterial'
  168. // import WxEditor from '@/components/Editor/WxEditor.vue'
  169. import WxNews from '@/views/mp/components/wx-news/main.vue';
  170. import WxMaterialSelect from '@/views/mp/components/wx-material-select/main.vue'
  171. import { getAccessToken } from '@/utils/auth'
  172. import { getDraftPage } from "@/api/mp/draft";
  173. import {getSimpleAccounts} from "@/api/mp/account";
  174. export default {
  175. name: 'mpDraft',
  176. components: {
  177. // WxEditor,
  178. WxNews,
  179. WxMaterialSelect
  180. },
  181. data() {
  182. return {
  183. // 遮罩层
  184. loading: false,
  185. // 显示搜索条件
  186. showSearch: true,
  187. // 总条数
  188. total: 0,
  189. // 数据列表
  190. list: [],
  191. queryParams: {
  192. pageNo: 1,
  193. pageSize: 10,
  194. accountId: undefined,
  195. },
  196. page1: {
  197. total: 0, // 总页数
  198. currentPage: 1, // 当前页数
  199. pageSize: 10 // 每页显示多少条
  200. },
  201. actionUrl: process.env.VUE_APP_BASE_API +'/wxmaterial/materialFileUpload',
  202. headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
  203. fileList: [],
  204. dialogVideoVisible: false,
  205. dialogNewsVisible: false,
  206. addMaterialLoading: false,
  207. uploadData: {
  208. "mediaType": 'image',
  209. "title": '',
  210. "introduction": ''
  211. },
  212. articlesAdd: [
  213. {
  214. "title": '',
  215. "thumbMediaId": '',
  216. "author": '',
  217. "digest": '',
  218. "showCoverPic": '',
  219. "content": '',
  220. "contentSourceUrl": '',
  221. "needOpenComment": '',
  222. "onlyFansCanComment": '',
  223. "thumbUrl": ''
  224. }
  225. ],
  226. isActiveAddNews: 0,
  227. dialogImageVisible: false,
  228. imageListData: [],
  229. tableLoading1: false,
  230. operateMaterial: 'add',
  231. articlesMediaId: '',
  232. hackResetEditor: false,
  233. // 公众号账号列表
  234. accounts: [],
  235. }
  236. },
  237. created() {
  238. getSimpleAccounts().then(response => {
  239. this.accounts = response.data;
  240. // 默认选中第一个
  241. if (this.accounts.length > 0) {
  242. this.queryParams.accountId = this.accounts[0].id;
  243. }
  244. // 加载数据
  245. this.getList();
  246. })
  247. },
  248. methods: {
  249. /** 查询列表 */
  250. getList() {
  251. // 如果没有选中公众号账号,则进行提示。
  252. if (!this.queryParams.accountId) {
  253. this.$message.error('未选中公众号,无法查询草稿箱')
  254. return false
  255. }
  256. this.loading = true
  257. getDraftPage((this.queryParams)).then(response => {
  258. // 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
  259. response.data.list.forEach(item => {
  260. const newsItem = item.content.newsItem;
  261. newsItem.forEach(article => {
  262. article.picUrl = article.thumbUrl;
  263. })
  264. })
  265. this.list = response.data.list
  266. this.total = response.data.total
  267. }).finally(() => {
  268. this.loading = false
  269. })
  270. },
  271. delMaterial(item){
  272. this.$confirm('此操作将永久删除该草稿, 是否继续?', '提示', {
  273. confirmButtonText: '确定',
  274. cancelButtonText: '取消',
  275. type: 'warning'
  276. }).then(() => {
  277. this.loading = true
  278. delObj({
  279. id:item.mediaId
  280. }).then(response => {
  281. this.loading = false
  282. if(response.code == 200){
  283. this.getList(this.queryParams)
  284. }else{
  285. this.loading = false
  286. this.$message.error('删除出错:' + response.msg)
  287. }
  288. }).catch(() => {
  289. this.loading = false
  290. })
  291. })
  292. },
  293. getPage1(){
  294. this.tableLoading1 = true
  295. getPage1({
  296. current: this.page1.currentPage,
  297. size: this.page1.pageSize,
  298. type:'image'
  299. }).then(response => {
  300. this.tableLoading1 = false
  301. this.imageListData = response.data.items
  302. this.page1.total = response.data.totalCount
  303. }).catch(() => {
  304. this.tableLoading1 = false
  305. })
  306. },
  307. openMaterial(){
  308. this.imageListData = null
  309. this.page1.currentPage = 1
  310. this.getPage1()
  311. this.dialogImageVisible = true
  312. },
  313. dialogNewsClose(done){
  314. this.$confirm('修改内容可能还未保存,确定关闭吗?', '提示', {
  315. confirmButtonText: '确定',
  316. cancelButtonText: '取消',
  317. type: 'warning'
  318. }).then(() => {
  319. this.hackResetEditor = false//销毁组件
  320. this.$nextTick(() => {
  321. this.hackResetEditor = true//重建组件
  322. })
  323. this.isActiveAddNews = 0
  324. done()
  325. }).catch(() => {
  326. })
  327. },
  328. downNews(index){
  329. let temp = this.articlesAdd[index]
  330. this.articlesAdd[index] = this.articlesAdd[index+1]
  331. this.articlesAdd[index+1] = temp
  332. this.isActiveAddNews = index+1
  333. },
  334. upNews(index){
  335. let temp = this.articlesAdd[index]
  336. this.articlesAdd[index] = this.articlesAdd[index-1]
  337. this.articlesAdd[index-1] = temp
  338. this.isActiveAddNews = index-1
  339. },
  340. activeNews(index){
  341. this.hackResetEditor = false//销毁组件
  342. this.$nextTick(() => {
  343. this.hackResetEditor = true//重建组件
  344. })
  345. this.isActiveAddNews = index
  346. },
  347. minusNews(index){
  348. this.$confirm('确定删除该图文吗?', '提示', {
  349. confirmButtonText: '确定',
  350. cancelButtonText: '取消',
  351. type: 'warning'
  352. }).then(() => {
  353. this.articlesAdd.splice(index,1);
  354. if(this.isActiveAddNews === index){
  355. this.isActiveAddNews = 0
  356. }
  357. }).catch(() => {})
  358. },
  359. plusNews(){
  360. this.articlesAdd.push(
  361. {
  362. "title": '',
  363. "thumbMediaId": '',
  364. "author": '',
  365. "digest": '',
  366. "showCoverPic": '',
  367. "content": '',
  368. "contentSourceUrl": '',
  369. "needOpenComment":'',
  370. "onlyFansCanComment":'',
  371. "thumbUrl":''
  372. }
  373. )
  374. this.isActiveAddNews = this.articlesAdd.length - 1
  375. },
  376. subNews(){
  377. this.addMaterialLoading = true
  378. if(this.operateMaterial == 'add'){
  379. addObj({
  380. articles:this.articlesAdd
  381. }).then(response => {
  382. this.addMaterialLoading = false
  383. this.dialogNewsVisible = false
  384. if(response.code == 200){
  385. this.isActiveAddNews = 0
  386. this.articlesAdd = [
  387. {
  388. "title": '',
  389. "thumbMediaId": '',
  390. "author": '',
  391. "digest": '',
  392. "showCoverPic": '',
  393. "content": '',
  394. "contentSourceUrl": '',
  395. "needOpenComment":'',
  396. "onlyFansCanComment":'',
  397. "thumbUrl":''
  398. }
  399. ]
  400. this.queryParams.currentPage = 1
  401. this.getList(this.queryParams)
  402. }else{
  403. this.$message.error('新增图文出错:' + response.msg)
  404. }
  405. }).catch(() => {
  406. this.addMaterialLoading = false
  407. })
  408. }
  409. if(this.operateMaterial == 'edit'){
  410. putObj({
  411. articles:this.articlesAdd,
  412. mediaId:this.articlesMediaId
  413. }).then(response => {
  414. this.addMaterialLoading = false
  415. this.dialogNewsVisible = false
  416. if(response.code == 200){
  417. this.isActiveAddNews = 0
  418. this.articlesAdd = [
  419. {
  420. "title": '',
  421. "thumbMediaId": '',
  422. "author": '',
  423. "digest": '',
  424. "showCoverPic": '',
  425. "content": '',
  426. "contentSourceUrl": '',
  427. "needOpenComment":'',
  428. "onlyFansCanComment":'',
  429. "thumbUrl":''
  430. }
  431. ]
  432. this.getList(this.queryParams)
  433. }else{
  434. this.$message.error('修改图文出错:' + response.msg)
  435. }
  436. }).catch(() => {
  437. this.addMaterialLoading = false
  438. })
  439. }
  440. },
  441. handleEditNews(item){
  442. this.hackResetEditor = false//销毁组件
  443. this.$nextTick(() => {
  444. this.hackResetEditor = true//重建组件
  445. })
  446. if(this.operateMaterial == 'add'){
  447. this.isActiveAddNews = 0
  448. }
  449. this.operateMaterial = 'edit'
  450. this.articlesAdd = JSON.parse(JSON.stringify(item.content.newsItem))
  451. this.articlesMediaId = item.mediaId
  452. this.dialogNewsVisible = true
  453. },
  454. handleAddNews(){
  455. this.hackResetEditor = false//销毁组件
  456. this.$nextTick(() => {
  457. this.hackResetEditor = true//重建组件
  458. })
  459. if(this.operateMaterial == 'edit'){
  460. this.isActiveAddNews = 0
  461. this.articlesAdd = [
  462. {
  463. "title": '',
  464. "thumbMediaId": '',
  465. "author": '',
  466. "digest": '',
  467. "showCoverPic": '',
  468. "content": '',
  469. "contentSourceUrl": '',
  470. "needOpenComment":'',
  471. "onlyFansCanComment":'',
  472. "thumbUrl":''
  473. }
  474. ]
  475. }
  476. this.operateMaterial = 'add'
  477. this.dialogNewsVisible = true
  478. },
  479. beforeThumbImageUpload(file){
  480. this.addMaterialLoading = true
  481. const isType = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif' || file.type === 'image/bmp' || file.type === 'image/jpg';
  482. const isLt = file.size / 1024 / 1024 < 2
  483. if (!isType) {
  484. this.$message.error('上传图片格式不对!')
  485. }
  486. if (!isLt) {
  487. this.$message.error('上传图片大小不能超过2M!')
  488. }
  489. this.addMaterialLoading = false
  490. return isType && isLt;
  491. },
  492. handleUploadSuccess(response, file, fileList){
  493. this.loading = false
  494. this.addMaterialLoading = false
  495. if(response.code == 200){
  496. this.dialogVideoVisible = false
  497. this.fileList = []
  498. this.uploadData.title = ''
  499. this.uploadData.introduction = ''
  500. this.articlesAdd[this.isActiveAddNews].thumbMediaId = response.data.mediaId
  501. this.articlesAdd[this.isActiveAddNews].thumbUrl = response.data.url
  502. }else{
  503. this.$message.error('上传出错:' + response.msg)
  504. }
  505. },
  506. selectMaterial(item){
  507. this.dialogImageVisible = false
  508. this.articlesAdd[this.isActiveAddNews].thumbMediaId = item.mediaId
  509. this.articlesAdd[this.isActiveAddNews].thumbUrl = item.url
  510. },
  511. handlePublishNews(item){
  512. this.$confirm('你正在通过发布的方式发表内容。 发布不占用群发次数,一天可多次发布。已发布内容不会推送给用户,也不会展示在公众号主页中。 发布后,你可以前往发表记录获取链接,也可以将发布内容添加到自定义菜单、自动回复、话题和页面模板中。', '提示', {
  513. confirmButtonText: '确定',
  514. cancelButtonText: '取消',
  515. type: 'warning'
  516. }).then(() => {
  517. this.loading = true
  518. publish(item.mediaId).then(response => {
  519. this.loading = false
  520. this.$message.success('发布任务提交成功')
  521. this.getList(this.queryParams)
  522. }).catch(() => {
  523. this.loading = false
  524. })
  525. }).catch(() => {
  526. })
  527. }
  528. }
  529. }
  530. </script>
  531. <style lang="scss" scoped>
  532. .pagination {
  533. float: right;
  534. margin-right: 25px;
  535. }
  536. .add_but {
  537. padding: 10px;
  538. }
  539. .ope-row {
  540. margin-top: 5px;
  541. text-align: center;
  542. border-top: 1px solid #eaeaea;
  543. padding-top: 5px;
  544. }
  545. .item-name {
  546. font-size: 12px;
  547. overflow: hidden;
  548. text-overflow: ellipsis;
  549. white-space: nowrap;
  550. text-align: center;
  551. }
  552. .el-upload__tip {
  553. margin-left: 5px;
  554. }
  555. /*新增图文*/
  556. .left {
  557. display: inline-block;
  558. width: 35%;
  559. vertical-align: top;
  560. margin-top: 200px;
  561. }
  562. .right {
  563. display: inline-block;
  564. width: 60%;
  565. margin-top: -40px;
  566. }
  567. .avatar-uploader {
  568. width: 20%;
  569. display: inline-block;
  570. }
  571. .avatar-uploader .el-upload {
  572. border-radius: 6px;
  573. cursor: pointer;
  574. position: relative;
  575. overflow: hidden;
  576. text-align: unset !important;
  577. }
  578. .avatar-uploader .el-upload:hover {
  579. border-color: #165dff;
  580. }
  581. .avatar-uploader-icon {
  582. border: 1px solid #d9d9d9;
  583. font-size: 28px;
  584. color: #8c939d;
  585. width: 120px;
  586. height: 120px;
  587. line-height: 120px;
  588. text-align: center;
  589. }
  590. .avatar {
  591. width: 230px;
  592. height: 120px;
  593. }
  594. .avatar1 {
  595. width: 120px;
  596. height: 120px;
  597. }
  598. .digest {
  599. width: 60%;
  600. display: inline-block;
  601. vertical-align: top;
  602. }
  603. /*新增图文*/
  604. /*瀑布流样式*/
  605. .waterfall {
  606. width: 100%;
  607. column-gap: 10px;
  608. column-count: 5;
  609. margin: 0 auto;
  610. }
  611. .waterfall-item {
  612. padding: 10px;
  613. margin-bottom: 10px;
  614. break-inside: avoid;
  615. border: 1px solid #eaeaea;
  616. }
  617. p {
  618. line-height: 30px;
  619. }
  620. @media (min-width: 992px) and (max-width: 1300px) {
  621. .waterfall {
  622. column-count: 3;
  623. }
  624. p {
  625. color: red;
  626. }
  627. }
  628. @media (min-width: 768px) and (max-width: 991px) {
  629. .waterfall {
  630. column-count: 2;
  631. }
  632. p {
  633. color: orange;
  634. }
  635. }
  636. @media (max-width: 767px) {
  637. .waterfall {
  638. column-count: 1;
  639. }
  640. }
  641. /*瀑布流样式*/
  642. .news-main {
  643. background-color: #FFFFFF;
  644. width: 100%;
  645. margin: auto;
  646. height: 120px;
  647. }
  648. .news-content {
  649. background-color: #acadae;
  650. width: 100%;
  651. height: 120px;
  652. position: relative;
  653. }
  654. .news-content-title {
  655. display: inline-block;
  656. font-size: 15px;
  657. color: #FFFFFF;
  658. position: absolute;
  659. left: 0px;
  660. bottom: 0px;
  661. background-color: black;
  662. width: 98%;
  663. padding: 1%;
  664. opacity: 0.65;
  665. overflow: hidden;
  666. text-overflow: ellipsis;
  667. white-space: nowrap;
  668. height: 25px;
  669. }
  670. .news-main-item {
  671. background-color: #FFFFFF;
  672. padding: 5px 0px;
  673. border-top: 1px solid #eaeaea;
  674. width: 100%;
  675. margin: auto;
  676. }
  677. .news-content-item {
  678. position: relative;
  679. margin-left: -3px
  680. }
  681. .news-content-item-title {
  682. display: inline-block;
  683. font-size: 12px;
  684. width: 70%;
  685. }
  686. .news-content-item-img {
  687. display: inline-block;
  688. width: 25%;
  689. background-color: #acadae
  690. }
  691. .input-tt {
  692. padding: 5px;
  693. }
  694. .activeAddNews {
  695. border: 5px solid #2bb673;
  696. }
  697. .news-main-plus {
  698. width: 280px;
  699. text-align: center;
  700. margin: auto;
  701. height: 50px;
  702. }
  703. .icon-plus {
  704. margin: 10px;
  705. font-size: 25px;
  706. }
  707. .select-item {
  708. width: 60%;
  709. padding: 10px;
  710. margin: 0 auto 10px auto;
  711. border: 1px solid #eaeaea;
  712. }
  713. .father .child {
  714. display: none;
  715. text-align: center;
  716. position: relative;
  717. bottom: 25px;
  718. }
  719. .father:hover .child {
  720. display: block;
  721. }
  722. .thumb-div {
  723. display: inline-block;
  724. width: 30%;
  725. text-align: center;
  726. }
  727. .thumb-but {
  728. margin: 5px;
  729. }
  730. .material-img {
  731. width: 100%;
  732. height: 100%;
  733. }
  734. </style>