index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  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. ① 优化代码,和项目的代码保持一致
  21. ② 清理冗余代码,保证代码整洁
  22. ③ 增加注释,提升可读性
  23. -->
  24. <template>
  25. <div class="app-container">
  26. <doc-alert title="公众号图文" url="https://doc.iocoder.cn/mp/article/" />
  27. <!-- 搜索工作栏 -->
  28. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  29. <el-form-item label="公众号" prop="accountId">
  30. <el-select v-model="queryParams.accountId" placeholder="请选择公众号">
  31. <el-option v-for="item in accounts" :key="parseInt(item.id)" :label="item.name" :value="parseInt(item.id)" />
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  36. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  37. </el-form-item>
  38. </el-form>
  39. <!-- 操作工具栏 -->
  40. <el-row :gutter="10" class="mb8">
  41. <el-col :span="1.5">
  42. <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
  43. v-hasPermi="['mp:draft:create']">新增
  44. </el-button>
  45. </el-col>
  46. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  47. </el-row>
  48. <!-- 列表 -->
  49. <div class="waterfall" v-loading="loading">
  50. <div v-if="item.content && item.content.newsItem" class="waterfall-item" v-for="item in list"
  51. :key='item.articleId'>
  52. <wx-news :articles="item.content.newsItem" />
  53. <!-- 操作按钮 -->
  54. <el-row class="ope-row">
  55. <el-button type="success" circle @click="handlePublish(item)" v-hasPermi="['mp:free-publish:submit']">发布</el-button>
  56. <el-button type="primary" icon="el-icon-edit" circle @click="handleUpdate(item)" v-hasPermi="['mp:draft:update']" />
  57. <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(item)" v-hasPermi="['mp:draft:delete']" />
  58. </el-row>
  59. </div>
  60. </div>
  61. <!-- 分页记录 -->
  62. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
  63. @pagination="getList"/>
  64. <!-- 添加或修改草稿对话框 -->
  65. <el-dialog :title="operateMaterial === 'add' ? '新建图文' : '修改图文'"
  66. append-to-body width="80%" top="20px" :visible.sync="dialogNewsVisible"
  67. :before-close="dialogNewsClose" :close-on-click-modal="false">
  68. <div class="left">
  69. <div class="select-item">
  70. <div v-for="(news, index) in articlesAdd" :key='news.id'>
  71. <div class="news-main father" v-if="index === 0" :class="{'activeAddNews': isActiveAddNews === index}"
  72. @click="activeNews(index)">
  73. <div class="news-content">
  74. <img class="material-img" v-if="news.thumbUrl" :src="news.thumbUrl"/>
  75. <div class="news-content-title">{{news.title}}</div>
  76. </div>
  77. <div class="child" v-if="articlesAdd.length>1">
  78. <el-button type="mini" icon="el-icon-sort-down" @click="downNews(index)">下移</el-button>
  79. <el-button v-if="operateMaterial === 'add'" type="mini" icon="el-icon-delete"
  80. @click="minusNews(index)">删除
  81. </el-button>
  82. </div>
  83. </div>
  84. <div class="news-main-item father" v-if="index>0" :class="{'activeAddNews': isActiveAddNews === index}"
  85. @click="activeNews(index)">
  86. <div class="news-content-item">
  87. <div class="news-content-item-title ">{{news.title}}</div>
  88. <div class="news-content-item-img">
  89. <img class="material-img" v-if="news.thumbUrl" :src="news.thumbUrl" height="100%"/>
  90. </div>
  91. </div>
  92. <div class="child">
  93. <el-button v-if="articlesAdd.length > index+1" type="mini" icon="el-icon-sort-down"
  94. @click="downNews(index)">下移
  95. </el-button>
  96. <el-button type="mini" icon="el-icon-sort-up" @click="upNews(index)">上移</el-button>
  97. <el-button v-if="operateMaterial=== 'add'" type="mini" icon="el-icon-delete"
  98. @click="minusNews(index)">删除
  99. </el-button>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="news-main-plus" @click="plusNews" v-if="articlesAdd.length<8 && operateMaterial==='add'">
  104. <i class="el-icon-circle-plus icon-plus"></i>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="right" v-loading="addMaterialLoading" v-if="articlesAdd.length > 0">
  109. <br /> <br /> <br /> <br />
  110. <!-- 标题、作者、原文地址 -->
  111. <el-input v-model="articlesAdd[isActiveAddNews].title" placeholder="请输入标题(必填)" />
  112. <el-input v-model="articlesAdd[isActiveAddNews].author" placeholder="请输入作者" style="margin-top: 5px;" />
  113. <el-input v-model="articlesAdd[isActiveAddNews].contentSourceUrl" placeholder="请输入原文地址" style="margin-top: 5px;" />
  114. <!-- 封面和摘要 -->
  115. <div class="input-tt">封面和摘要:</div>
  116. <div>
  117. <div class="thumb-div">
  118. <img class="material-img" v-if="articlesAdd[isActiveAddNews].thumbUrl"
  119. :src="articlesAdd[isActiveAddNews].thumbUrl" :class="isActiveAddNews === 0 ? 'avatar':'avatar1'">
  120. <i v-else class="el-icon-plus avatar-uploader-icon"
  121. :class="isActiveAddNews === 0 ? 'avatar':'avatar1'"></i>
  122. <div class="thumb-but">
  123. <el-upload :action="actionUrl" :headers="headers" multiple :limit="1" :file-list="fileList" :data="uploadData"
  124. :before-upload="beforeThumbImageUpload" :on-success="handleUploadSuccess">
  125. <el-button slot="trigger" size="mini" type="primary">本地上传</el-button>
  126. <el-button size="mini" type="primary" @click="openMaterial" style="margin-left: 5px">素材库选择</el-button>
  127. <div slot="tip" class="el-upload__tip">支持 bmp/png/jpeg/jpg/gif 格式,大小不超过 2M</div>
  128. </el-upload>
  129. </div>
  130. <el-dialog title="选择图片" :visible.sync="dialogImageVisible" width="80%" append-to-body>
  131. <wx-material-select ref="materialSelect" :objData="{type: 'image', accountId: this.queryParams.accountId}"
  132. @selectMaterial="selectMaterial" />
  133. </el-dialog>
  134. </div>
  135. <el-input :rows="8" type="textarea" v-model="articlesAdd[isActiveAddNews].digest" placeholder="请输入摘要"
  136. class="digest" maxlength="120" style="float: right" />
  137. </div>
  138. <!--富文本编辑器组件-->
  139. <el-row>
  140. <wx-editor v-model="articlesAdd[isActiveAddNews].content" :account-id="this.uploadData.accountId"
  141. v-if="hackResetEditor"/>
  142. </el-row>
  143. </div>
  144. <div slot="footer" class="dialog-footer">
  145. <el-button @click="dialogNewsVisible = false">取 消</el-button>
  146. <el-button type="primary" @click="submitForm">提 交</el-button>
  147. </div>
  148. </el-dialog>
  149. </div>
  150. </template>
  151. <script>
  152. import WxEditor from '@/views/mp/components/wx-editor/WxEditor.vue';
  153. import WxNews from '@/views/mp/components/wx-news/main.vue';
  154. import WxMaterialSelect from '@/views/mp/components/wx-material-select/main.vue'
  155. import { getAccessToken } from '@/utils/auth'
  156. import {createDraft, deleteDraft, getDraftPage, updateDraft} from "@/api/mp/draft";
  157. import { getSimpleAccounts } from "@/api/mp/account";
  158. import {deleteFreePublish, submitFreePublish} from "@/api/mp/freePublish";
  159. export default {
  160. name: 'MpDraft',
  161. components: {
  162. WxEditor,
  163. WxNews,
  164. WxMaterialSelect
  165. },
  166. data() {
  167. return {
  168. // 遮罩层
  169. loading: false,
  170. // 显示搜索条件
  171. showSearch: true,
  172. // 总条数
  173. total: 0,
  174. // 数据列表
  175. list: [],
  176. queryParams: {
  177. pageNo: 1,
  178. pageSize: 10,
  179. accountId: undefined,
  180. },
  181. // ========== 文件上传 ==========
  182. actionUrl: process.env.VUE_APP_BASE_API + "/admin-api/mp/material/upload-permanent", // 上传永久素材的地址
  183. headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
  184. fileList: [],
  185. uploadData: {
  186. "type": 'image',
  187. // "accountId": 1,
  188. },
  189. // ========== 草稿新建 or 修改 ==========
  190. dialogNewsVisible: false,
  191. addMaterialLoading: false, // 添加草稿的 loading 标识
  192. articlesAdd: [],
  193. isActiveAddNews: 0,
  194. dialogImageVisible: false,
  195. operateMaterial: 'add',
  196. articlesMediaId: '',
  197. hackResetEditor: false,
  198. // 公众号账号列表
  199. accounts: [],
  200. }
  201. },
  202. created() {
  203. getSimpleAccounts().then(response => {
  204. this.accounts = response.data;
  205. // 默认选中第一个
  206. if (this.accounts.length > 0) {
  207. this.setAccountId(this.accounts[0].id);
  208. }
  209. // 加载数据
  210. this.getList();
  211. })
  212. },
  213. methods: {
  214. // ======================== 列表查询 ========================
  215. /** 设置账号编号 */
  216. setAccountId(accountId) {
  217. this.queryParams.accountId = accountId;
  218. this.uploadData.accountId = accountId;
  219. },
  220. /** 查询列表 */
  221. getList() {
  222. // 如果没有选中公众号账号,则进行提示。
  223. if (!this.queryParams.accountId) {
  224. this.$message.error('未选中公众号,无法查询草稿箱')
  225. return false
  226. }
  227. this.loading = true
  228. getDraftPage(this.queryParams).then(response => {
  229. // 将 thumbUrl 转成 picUrl,保证 wx-news 组件可以预览封面
  230. response.data.list.forEach(item => {
  231. const newsItem = item.content.newsItem;
  232. newsItem.forEach(article => {
  233. article.picUrl = article.thumbUrl;
  234. })
  235. })
  236. this.list = response.data.list
  237. this.total = response.data.total
  238. }).finally(() => {
  239. this.loading = false
  240. })
  241. },
  242. /** 搜索按钮操作 */
  243. handleQuery() {
  244. this.queryParams.pageNo = 1
  245. // 默认选中第一个
  246. if (this.queryParams.accountId) {
  247. this.setAccountId(this.queryParams.accountId)
  248. }
  249. this.getList()
  250. },
  251. /** 重置按钮操作 */
  252. resetQuery() {
  253. this.resetForm('queryForm')
  254. // 默认选中第一个
  255. if (this.accounts.length > 0) {
  256. this.setAccountId(this.accounts[0].id)
  257. }
  258. this.handleQuery()
  259. },
  260. // ======================== 新增/修改草稿 ========================
  261. /** 新增按钮操作 */
  262. handleAdd() {
  263. this.resetEditor();
  264. this.reset();
  265. // 打开表单,并设置初始化
  266. this.operateMaterial = 'add'
  267. this.dialogNewsVisible = true
  268. },
  269. /** 更新按钮操作 */
  270. handleUpdate(item){
  271. this.resetEditor();
  272. this.reset();
  273. this.articlesMediaId = item.mediaId
  274. this.articlesAdd = JSON.parse(JSON.stringify(item.content.newsItem))
  275. // 打开表单,并设置初始化
  276. this.operateMaterial = 'edit'
  277. this.dialogNewsVisible = true
  278. },
  279. /** 提交按钮 */
  280. submitForm() {
  281. this.addMaterialLoading = true
  282. if (this.operateMaterial === 'add') {
  283. createDraft(this.queryParams.accountId, this.articlesAdd).then(response => {
  284. this.$modal.msgSuccess("新增成功");
  285. this.dialogNewsVisible = false;
  286. this.getList()
  287. }).finally(() => {
  288. this.addMaterialLoading = false
  289. })
  290. } else {
  291. updateDraft(this.queryParams.accountId, this.articlesMediaId, this.articlesAdd).then(response => {
  292. this.$modal.msgSuccess("更新成功");
  293. this.dialogNewsVisible = false;
  294. this.getList()
  295. }).finally(() => {
  296. this.addMaterialLoading = false
  297. })
  298. }
  299. },
  300. // 关闭弹窗
  301. dialogNewsClose(done) {
  302. this.$modal.confirm('修改内容可能还未保存,确定关闭吗?').then(() => {
  303. this.reset()
  304. this.resetEditor()
  305. done()
  306. }).catch(() => {})
  307. },
  308. // 表单重置
  309. reset() {
  310. this.isActiveAddNews = 0
  311. this.articlesAdd = [this.buildEmptyArticle()]
  312. },
  313. // 表单 Editor 重置
  314. resetEditor() {
  315. this.hackResetEditor = false // 销毁组件
  316. this.$nextTick(() => {
  317. this.hackResetEditor = true // 重建组件
  318. })
  319. },
  320. // 将图文向下移动
  321. downNews(index) {
  322. let temp = this.articlesAdd[index]
  323. this.articlesAdd[index] = this.articlesAdd[index+1]
  324. this.articlesAdd[index + 1] = temp
  325. this.isActiveAddNews = index + 1
  326. },
  327. // 将图文向上移动
  328. upNews(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. // 选中指定 index 的图文
  335. activeNews(index) {
  336. this.resetEditor();
  337. this.isActiveAddNews = index
  338. },
  339. // 删除指定 index 的图文
  340. minusNews(index) {
  341. this.$modal.confirm('确定删除该图文吗?').then(() => {
  342. this.articlesAdd.splice(index,1);
  343. if (this.isActiveAddNews === index) {
  344. this.isActiveAddNews = 0
  345. }
  346. }).catch(() => {})
  347. },
  348. // 添加一个图文
  349. plusNews() {
  350. this.articlesAdd.push(this.buildEmptyArticle())
  351. this.isActiveAddNews = this.articlesAdd.length - 1
  352. },
  353. // 创建空的 article
  354. buildEmptyArticle() {
  355. return {
  356. "title": '',
  357. "thumbMediaId": '',
  358. "author": '',
  359. "digest": '',
  360. "showCoverPic": '',
  361. "content": '',
  362. "contentSourceUrl": '',
  363. "needOpenComment":'',
  364. "onlyFansCanComment":'',
  365. "thumbUrl":''
  366. }
  367. },
  368. // ======================== 文件上传 ========================
  369. beforeThumbImageUpload(file) {
  370. this.addMaterialLoading = true
  371. const isType = file.type === 'image/jpeg'
  372. || file.type === 'image/png'
  373. || file.type === 'image/gif'
  374. || file.type === 'image/bmp'
  375. || file.type === 'image/jpg';
  376. if (!isType) {
  377. this.$message.error('上传图片格式不对!')
  378. this.addMaterialLoading = false
  379. return false;
  380. }
  381. const isLt = file.size / 1024 / 1024 < 2
  382. if (!isLt) {
  383. this.$message.error('上传图片大小不能超过 2M!')
  384. this.addMaterialLoading = false
  385. return false;
  386. }
  387. // 校验通过
  388. return true;
  389. },
  390. handleUploadSuccess(response, file, fileList) {
  391. this.addMaterialLoading = false // 关闭 loading
  392. if (response.code !== 0) {
  393. this.$message.error('上传出错:' + response.msg)
  394. return false;
  395. }
  396. // 重置上传文件的表单
  397. this.fileList = []
  398. // 设置草稿的封面字段
  399. this.articlesAdd[this.isActiveAddNews].thumbMediaId = response.data.mediaId
  400. this.articlesAdd[this.isActiveAddNews].thumbUrl = response.data.url
  401. },
  402. // 选择 or 上传完素材,设置回草稿
  403. selectMaterial(item) {
  404. this.dialogImageVisible = false
  405. this.articlesAdd[this.isActiveAddNews].thumbMediaId = item.mediaId
  406. this.articlesAdd[this.isActiveAddNews].thumbUrl = item.url
  407. },
  408. // 打开素材选择
  409. openMaterial() {
  410. this.dialogImageVisible = true
  411. try {
  412. this.$refs['materialSelect'].queryParams.accountId = this.queryParams.accountId // 强制设置下 accountId,避免二次查询不对
  413. this.$refs['materialSelect'].handleQuery(); // 刷新列表,失败也无所谓
  414. } catch (e) {}
  415. },
  416. // ======================== 草稿箱发布 ========================
  417. handlePublish(item) {
  418. const accountId = this.queryParams.accountId;
  419. const mediaId = item.mediaId;
  420. const content = '你正在通过发布的方式发表内容。 发布不占用群发次数,一天可多次发布。已发布内容不会推送给用户,也不会展示在公众号主页中。 发布后,你可以前往发表记录获取链接,也可以将发布内容添加到自定义菜单、自动回复、话题和页面模板中。';
  421. this.$modal.confirm(content).then(function() {
  422. return submitFreePublish(accountId, mediaId);
  423. }).then(() => {
  424. this.getList();
  425. this.$modal.msgSuccess("发布成功");
  426. }).catch(() => {});
  427. },
  428. handleDelete(item) {
  429. const accountId = this.queryParams.accountId;
  430. const mediaId = item.mediaId;
  431. this.$modal.confirm('此操作将永久删除该草稿, 是否继续?').then(function() {
  432. return deleteDraft(accountId, mediaId);
  433. }).then(() => {
  434. this.getList();
  435. this.$modal.msgSuccess("删除成功");
  436. }).catch(() => {});
  437. },
  438. }
  439. }
  440. </script>
  441. <style lang="scss" scoped>
  442. .pagination {
  443. float: right;
  444. margin-right: 25px;
  445. }
  446. .add_but {
  447. padding: 10px;
  448. }
  449. .ope-row {
  450. margin-top: 5px;
  451. text-align: center;
  452. border-top: 1px solid #eaeaea;
  453. padding-top: 5px;
  454. }
  455. .item-name {
  456. font-size: 12px;
  457. overflow: hidden;
  458. text-overflow: ellipsis;
  459. white-space: nowrap;
  460. text-align: center;
  461. }
  462. .el-upload__tip {
  463. margin-left: 5px;
  464. }
  465. /*新增图文*/
  466. .left {
  467. display: inline-block;
  468. width: 35%;
  469. vertical-align: top;
  470. margin-top: 200px;
  471. }
  472. .right {
  473. display: inline-block;
  474. width: 60%;
  475. margin-top: -40px;
  476. }
  477. .avatar-uploader {
  478. width: 20%;
  479. display: inline-block;
  480. }
  481. .avatar-uploader .el-upload {
  482. border-radius: 6px;
  483. cursor: pointer;
  484. position: relative;
  485. overflow: hidden;
  486. text-align: unset !important;
  487. }
  488. .avatar-uploader .el-upload:hover {
  489. border-color: #165dff;
  490. }
  491. .avatar-uploader-icon {
  492. border: 1px solid #d9d9d9;
  493. font-size: 28px;
  494. color: #8c939d;
  495. width: 120px;
  496. height: 120px;
  497. line-height: 120px;
  498. text-align: center;
  499. }
  500. .avatar {
  501. width: 230px;
  502. height: 120px;
  503. }
  504. .avatar1 {
  505. width: 120px;
  506. height: 120px;
  507. }
  508. .digest {
  509. width: 60%;
  510. display: inline-block;
  511. vertical-align: top;
  512. }
  513. /*新增图文*/
  514. /*瀑布流样式*/
  515. .waterfall {
  516. width: 100%;
  517. column-gap: 10px;
  518. column-count: 5;
  519. margin: 0 auto;
  520. }
  521. .waterfall-item {
  522. padding: 10px;
  523. margin-bottom: 10px;
  524. break-inside: avoid;
  525. border: 1px solid #eaeaea;
  526. }
  527. p {
  528. line-height: 30px;
  529. }
  530. @media (min-width: 992px) and (max-width: 1300px) {
  531. .waterfall {
  532. column-count: 3;
  533. }
  534. p {
  535. color: red;
  536. }
  537. }
  538. @media (min-width: 768px) and (max-width: 991px) {
  539. .waterfall {
  540. column-count: 2;
  541. }
  542. p {
  543. color: orange;
  544. }
  545. }
  546. @media (max-width: 767px) {
  547. .waterfall {
  548. column-count: 1;
  549. }
  550. }
  551. /*瀑布流样式*/
  552. .news-main {
  553. background-color: #FFFFFF;
  554. width: 100%;
  555. margin: auto;
  556. height: 120px;
  557. }
  558. .news-content {
  559. background-color: #acadae;
  560. width: 100%;
  561. height: 120px;
  562. position: relative;
  563. }
  564. .news-content-title {
  565. display: inline-block;
  566. font-size: 15px;
  567. color: #FFFFFF;
  568. position: absolute;
  569. left: 0px;
  570. bottom: 0px;
  571. background-color: black;
  572. width: 98%;
  573. padding: 1%;
  574. opacity: 0.65;
  575. overflow: hidden;
  576. text-overflow: ellipsis;
  577. white-space: nowrap;
  578. height: 25px;
  579. }
  580. .news-main-item {
  581. background-color: #FFFFFF;
  582. padding: 5px 0px;
  583. border-top: 1px solid #eaeaea;
  584. width: 100%;
  585. margin: auto;
  586. }
  587. .news-content-item {
  588. position: relative;
  589. margin-left: -3px
  590. }
  591. .news-content-item-title {
  592. display: inline-block;
  593. font-size: 12px;
  594. width: 70%;
  595. }
  596. .news-content-item-img {
  597. display: inline-block;
  598. width: 25%;
  599. background-color: #acadae
  600. }
  601. .input-tt {
  602. padding: 5px;
  603. }
  604. .activeAddNews {
  605. border: 5px solid #2bb673;
  606. }
  607. .news-main-plus {
  608. width: 280px;
  609. text-align: center;
  610. margin: auto;
  611. height: 50px;
  612. }
  613. .icon-plus {
  614. margin: 10px;
  615. font-size: 25px;
  616. }
  617. .select-item {
  618. width: 60%;
  619. padding: 10px;
  620. margin: 0 auto 10px auto;
  621. border: 1px solid #eaeaea;
  622. }
  623. .father .child {
  624. display: none;
  625. text-align: center;
  626. position: relative;
  627. bottom: 25px;
  628. }
  629. .father:hover .child {
  630. display: block;
  631. }
  632. .thumb-div {
  633. display: inline-block;
  634. width: 30%;
  635. text-align: center;
  636. }
  637. .thumb-but {
  638. margin: 5px;
  639. }
  640. .material-img {
  641. width: 100%;
  642. height: 100%;
  643. }
  644. </style>