form.ftl 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>文章</title>
  5. <#include "../../include/head-file.ftl">
  6. <script src="${base}/static/mdiy/index.js"></script>
  7. </head>
  8. <body>
  9. <div id="form" v-cloak>
  10. <el-header class="ms-header ms-tr" height="50px" >
  11. <el-row type="flex" justify="space-between" align="middle">
  12. <el-col :xs="12" :sm="14" :md="16" :lg="18" :xl="18" style="display:flex;align-items:center;">
  13. <el-tooltip class="item" effect="dark" :content="form.id" placement="top-start">
  14. <span v-if="form.id && categoryType=='2'" style="float: left; max-width:calc(30% - 40px);" class="header-info">编号:{{form.id}}</span>
  15. </el-tooltip>
  16. <el-button v-if="form.id && categoryType=='2'" type="text" style="float: left" icon="el-icon-document-copy" circle :data-clipboard-text="form.id" @click="copyString()" class="copyBtn"></el-button>
  17. </el-col>
  18. <el-col :xs="12" :sm="10" :md="8" :lg="6" :xl="6" class="ms-tr">
  19. <@shiro.hasPermission name="cms:content:save">
  20. <el-button type="primary" icon="iconfont icon-baocun" size="mini" @click="save()" :loading="saveDisabled">保存
  21. </el-button>
  22. </@shiro.hasPermission>
  23. <el-button size="mini" icon="iconfont icon-fanhui" plain onclick="javascript:history.go(-1)">返回
  24. </el-button>
  25. </el-col>
  26. </el-row>
  27. </el-header>
  28. <el-main class="ms-container" style="position:relative;">
  29. <el-scrollbar class="ms-scrollbar" style="height: 100%;">
  30. <el-tabs v-model="activeName" style="height: calc(100% - 10px);">
  31. <el-tab-pane style="position:relative;" v-for="(item, index) in editableTabs" :key="index"
  32. :label="item.title" :name="item.name">
  33. <el-form v-if="item.title=='文章编辑'" ref="form" :model="form" :rules="rules" label-width="120px"
  34. size="mini">
  35. <el-row gutter="0" justify="start" align="top">
  36. <el-col :span="returnIsShow?'12':'24'">
  37. <el-form-item label="文章标题" prop="contentTitle">
  38. <el-input v-model="form.contentTitle"
  39. :disabled="false"
  40. :style="{width: '100%'}"
  41. :clearable="true"
  42. placeholder="请输入文章标题">
  43. </el-input>
  44. <div class="ms-form-tip">
  45. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.title}</a>
  46. </div>
  47. </el-form-item>
  48. </el-col>
  49. <el-col span="12" v-if="returnIsShow">
  50. <el-form-item label="所属栏目" prop="categoryId">
  51. <treeselect v-model="form.categoryId"
  52. :disable-branch-nodes="true"
  53. :normalizer="node=>{
  54. return {
  55. id: node.id,
  56. label: node.categoryTitle,
  57. children: node.children
  58. }}"
  59. @change="categoryChange"
  60. :options="contentCategoryIdOptions" placeholder="请选择"></treeselect>
  61. <div class="ms-form-tip">
  62. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.typetitle}</a>
  63. 不能选择封面、链接栏目类型,不能选择父栏目
  64. </div>
  65. </el-form-item>
  66. </el-col>
  67. </el-row>
  68. <el-row
  69. gutter="0"
  70. justify="start" align="top">
  71. <el-col span="12">
  72. <el-form-item label="文章类型" prop="contentType">
  73. <el-select v-model="form.contentType"
  74. :style="{width: '100%'}"
  75. :filterable="false"
  76. :disabled="false"
  77. :multiple="true" :clearable="true"
  78. placeholder="请选择文章类型">
  79. <el-option v-for='item in contentTypeOptions' :key="item.dictValue"
  80. :value="item.dictValue"
  81. :label="item.dictLabel"></el-option>
  82. </el-select>
  83. <div class="ms-form-tip">
  84. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{flag}</a>
  85. 通过自定义字典可扩展,通常用在 arclist标签的flag属性上进行过滤文章
  86. </div>
  87. </el-form-item>
  88. </el-col>
  89. <el-col span="12">
  90. <el-form-item label="发布时间" prop="contentDatetime">
  91. <el-date-picker
  92. v-model="form.contentDatetime"
  93. placeholder="请选择发布时间"
  94. start-placeholder=""
  95. end-placeholder=""
  96. :readonly="false"
  97. :disabled="false"
  98. :editable="true"
  99. :clearable="true"
  100. format="yyyy-MM-dd HH:mm:ss"
  101. value-format="yyyy-MM-dd HH:mm:ss"
  102. :style="{width:'100%'}"
  103. type="datetime">
  104. </el-date-picker>
  105. <div class="ms-form-tip">
  106. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.date?string("yyyy-MM-dd")}</a>
  107. </div>
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. <el-row
  112. gutter="0"
  113. justify="start" align="top">
  114. <el-col span="12">
  115. <el-form-item label="文章作者" prop="contentAuthor">
  116. <el-input v-model="form.contentAuthor"
  117. :disabled="false"
  118. :style="{width: '100%'}"
  119. :clearable="true"
  120. placeholder="请输入文章作者">
  121. </el-input>
  122. <div class="ms-form-tip">
  123. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.author}</a>
  124. </div>
  125. </el-form-item>
  126. </el-col>
  127. <el-col span="12">
  128. <el-form-item label="文章来源" prop="contentSource">
  129. <el-input v-model="form.contentSource"
  130. :disabled="false"
  131. :style="{width: '100%'}"
  132. :clearable="true"
  133. placeholder="请输入文章来源">
  134. </el-input>
  135. <div class="ms-form-tip">
  136. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.source}</a>
  137. </div>
  138. </el-form-item>
  139. </el-col>
  140. </el-row>
  141. <el-row
  142. gutter="0"
  143. justify="start" align="top">
  144. <el-col span="12">
  145. <el-form-item label="文章外链接" prop="contentOutLink">
  146. <el-input v-model="form.contentOutLink"
  147. :disabled="false"
  148. :style="{width: '100%'}"
  149. :clearable="true"
  150. placeholder="请输入文章外链接">
  151. </el-input>
  152. <div class="ms-form-tip">
  153. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html"
  154. target="_blank">${'$'}{field.outlink}</a> 文章外链接必须以http或者https等开头
  155. </div>
  156. </el-form-item>
  157. </el-col>
  158. </el-row>
  159. <el-row
  160. gutter="0"
  161. justify="start" align="top">
  162. <el-col span="12">
  163. <el-form-item label="是否显示" prop="contentDisplay">
  164. <el-radio-group v-model="form.contentDisplay"
  165. :style="{width: ''}"
  166. :disabled="false">
  167. <el-radio :style="{display: true ? 'inline-block' : 'block'}"
  168. :label="item.value"
  169. v-for='(item, index) in contentDisplayOptions'
  170. :key="item.value + index">
  171. {{true? item.label : item.value}}
  172. </el-radio>
  173. </el-radio-group>
  174. <div class="ms-form-tip">
  175. 选择否后前端将不显示,需要重新生成才有效果
  176. </div>
  177. </el-form-item>
  178. </el-col>
  179. <el-col span="12">
  180. <el-form-item label="自定义顺序" prop="contentSort">
  181. <el-input-number
  182. v-model="form.contentSort"
  183. :disabled="false"
  184. controls-position="">
  185. </el-input-number>
  186. <div class="ms-form-tip">
  187. 提示:前台模板标签需要设置orderby属性为sort才能生效
  188. </div>
  189. </el-form-item>
  190. </el-col>
  191. </el-row>
  192. <el-form-item label="文章缩略图" prop="contentImg">
  193. <el-upload
  194. :file-list="form.contentImg"
  195. :action="ms.manager+'/file/upload.do'"
  196. :on-remove="contentImghandleRemove"
  197. :style="{width:''}"
  198. :limit="1"
  199. :on-exceed="contentImghandleExceed"
  200. :disabled="false"
  201. :data="{uploadPath:'/cms/content','isRename':true ,'appId':true}"
  202. :on-success="contentImgSuccess"
  203. accept="image/*"
  204. list-type="picture-card">
  205. <i class="el-icon-plus"></i>
  206. <div slot="tip" class="ms-form-tip">
  207. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'{@ms:file field.litpic/}'}</a><br/>
  208. 最多上传1张图片,文章缩略图,支持jpg格式
  209. </div>
  210. </el-upload>
  211. </el-form-item>
  212. <el-form-item label="关键字" prop="contentKeyword">
  213. <el-input
  214. type="textarea" :rows="5"
  215. :disabled="false"
  216. v-model="form.contentKeyword"
  217. :style="{width: '100%'}"
  218. placeholder="请输入文章关键字">
  219. </el-input>
  220. <div class="ms-form-tip">
  221. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.keyword}</a>,用于SEO优化
  222. </div>
  223. </el-form-item>
  224. <el-form-item label="描述" prop="contentDescription">
  225. <el-input
  226. type="textarea" :rows="5"
  227. :disabled="false"
  228. v-model="form.contentDescription"
  229. :style="{width: '100%'}"
  230. placeholder="请输入对该文章的简短描述,以便用户查看文章简略">
  231. </el-input>
  232. <div class="ms-form-tip">
  233. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.descrip}</a>,用于SEO优化
  234. </div>
  235. </el-form-item>
  236. <el-form-item label="文章内容" prop="contentDetails">
  237. <vue-ueditor-wrap style="line-height: 0px" v-model="form.contentDetails"
  238. :config="editorConfig"></vue-ueditor-wrap>
  239. <div class="ms-form-tip">
  240. 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.content}</a>
  241. </div>
  242. </el-form-item>
  243. </el-form>
  244. <div :id="'model'+index" v-else></div>
  245. </el-tab-pane>
  246. </el-tabs>
  247. </el-scrollbar>
  248. </el-main>
  249. </div>
  250. </body>
  251. </html>
  252. <script>
  253. var formVue = new Vue({
  254. el: '#form',
  255. data: function () {
  256. return {
  257. saveDisabled: false,
  258. activeName: 'form',
  259. //自定义模型实例
  260. model: undefined,
  261. editableTabs: [{
  262. title: '文章编辑',
  263. name: 'form'
  264. }],
  265. editorConfig: ms.editorConfig,
  266. contentCategoryIdOptions: [],
  267. returnIsShow: true,
  268. type: '',
  269. //表单数据
  270. form: {
  271. // 文章标题
  272. contentTitle: '',
  273. // 所属栏目
  274. categoryId: undefined,
  275. // 文章类型
  276. contentType: [],
  277. // 是否显示
  278. contentDisplay: '0',
  279. // 文章作者
  280. contentAuthor: '',
  281. // 文章来源
  282. contentSource: '',
  283. // 自定义顺序
  284. contentSort: 0,
  285. // 文章缩略图
  286. contentImg: [],
  287. // 描述
  288. contentDescription: '',
  289. // 关键字
  290. contentKeyword: '',
  291. // 文章内容
  292. contentDetails: '',
  293. //文章外链接
  294. contentOutLink: '',
  295. contentDatetime: ms.util.date.fmt(Date.now(),"yyyy-MM-dd hh:mm:ss"),
  296. },
  297. categoryType: '1',
  298. contentTypeOptions: [],
  299. categoryIdOptions: [],
  300. contentDisplayOptions: [{
  301. "value": "0",
  302. "label": "是"
  303. }, {
  304. "value": "1",
  305. "label": "否"
  306. }],
  307. rules: {
  308. // 文章标题
  309. contentTitle: [{
  310. "required": true,
  311. "message": "请选择文章标题"
  312. }],
  313. // 发布时间
  314. contentDatetime: [{
  315. "required": true,
  316. "message": "发布时间不能为空"
  317. }],
  318. categoryId: [{
  319. "required": true,
  320. "message": "所属栏目不能为空"
  321. }]
  322. }
  323. };
  324. },
  325. watch: {},
  326. computed: {
  327. currCategory: function () {
  328. var that = this;
  329. return this.categoryIdOptions.find(function (value) {
  330. return value.id === that.form.categoryId;
  331. });
  332. }
  333. },
  334. methods: {
  335. save: function () {
  336. var _this = this;
  337. var that = this; //自定义模型需要验证
  338. if (this.model && !this.model.validate()) {
  339. this.activeName = 'custom-name';
  340. return;
  341. }
  342. var url = ms.manager + "/cms/content/save.do";
  343. if (that.form.id > 0) {
  344. url = ms.manager + "/cms/content/update.do";
  345. }
  346. //若缩略图为空则赋值为空串
  347. if (that.form.contentImg.length == 0){
  348. that.form.contentImg = "";
  349. }
  350. this.$refs.form[0].validate(function (valid) {
  351. if (valid) {
  352. that.saveDisabled = true; //判断
  353. var data = JSON.parse(JSON.stringify(that.form));
  354. if (data.contentType) {
  355. data.contentType = data.contentType.join(',');
  356. }
  357. if (data.contentImg == []) {
  358. data.contentImg = ""
  359. }else {
  360. data.contentImg = JSON.stringify(data.contentImg);
  361. }
  362. ms.http.post(url, data).then(function (data) {
  363. if (data.result) {
  364. //保存时需要赋值关联ID
  365. if (that.model) {
  366. that.model.form.linkId = data.data.id;
  367. that.model.save();
  368. }
  369. that.$notify({
  370. title: '成功',
  371. message: '保存成功',
  372. type: 'success',
  373. duration: 1000,
  374. onClose: function () {
  375. if (that.returnIsShow) {
  376. javascript: history.go(-1);
  377. } else {
  378. //如果是顶级封面或封面,则重新加载,避免文章和自定义模型重复保存
  379. location.reload();
  380. }
  381. that.saveDisabled = false;
  382. }
  383. });
  384. } else {
  385. that.$notify({
  386. title: '失败',
  387. message: data.msg,
  388. type: 'warning'
  389. });
  390. that.saveDisabled = false;
  391. }
  392. });
  393. } else {
  394. _this.activeName = 'form';
  395. return false;
  396. }
  397. });
  398. },
  399. removeModel: function () {
  400. var that = this;
  401. var model = document.getElementById('model1');
  402. var custom = document.getElementById('c_model');
  403. if (custom) {
  404. model.removeChild(custom);
  405. }
  406. that.model = undefined;
  407. },
  408. categoryChange: function () {
  409. this.changeModel();
  410. },
  411. changeModel: function () {
  412. var that = this;
  413. that.editableTabs = [that.editableTabs[0]];
  414. if (this.currCategory) {
  415. if (this.currCategory.mdiyModelId) {
  416. that.rederModel(this.currCategory.mdiyModelId)
  417. }
  418. }
  419. },
  420. rederModel: function (modelId) {
  421. var that = this;
  422. that.editableTabs.push({
  423. title: '',
  424. name: 'custom-name'
  425. });
  426. ms.mdiy.model.extend("model1", {id:modelId},{ linkId: that.form.id },true).then(function(obj) {
  427. that.model = obj;
  428. that.editableTabs[1].title = obj.modelName
  429. });
  430. },
  431. getValue: function (data) {
  432. this.form.categoryId = data.id;
  433. },
  434. //获取当前文章
  435. get: function (id) {
  436. var that = this;
  437. ms.http.get(ms.manager + "/cms/content/get.do", {
  438. "id": id
  439. }).then(function (res) {
  440. if (res.result && res.data) {
  441. if (res.data.contentType && res.data.contentType != '') {
  442. res.data.contentType = res.data.contentType.split(',');
  443. } else {
  444. res.data.contentType = [];
  445. }
  446. if (res.data.contentImg && res.data.contentImg != '') {
  447. res.data.contentImg = JSON.parse(res.data.contentImg);
  448. res.data.contentImg.forEach(function (value) {
  449. value.url = ms.base + value.path;
  450. });
  451. } else {
  452. res.data.contentImg = [];
  453. }
  454. that.form = res.data;
  455. var category = that.categoryIdOptions.filter(function (f) {
  456. return f['id'] == that.form.categoryId;
  457. });
  458. if (category.length > 0) {
  459. that.categoryType = category[0].categoryType
  460. if (category[0].categoryType == '2') {
  461. that.returnIsShow = false;
  462. }
  463. }
  464. that.changeModel();
  465. }
  466. });
  467. },
  468. //根据封面获取当前文章
  469. getFromFengMian: function (categoryId) {
  470. var that = this;
  471. ms.http.get(ms.manager + "/cms/content/getFromFengMian.do", {
  472. "categoryId": categoryId
  473. }).then(function (res) {
  474. if (res.result) {
  475. if (res.data != null) {
  476. if (res.data.contentType && res.data.contentType != '') {
  477. res.data.contentType = res.data.contentType.split(',');
  478. } else {
  479. res.data.contentType = [];
  480. }
  481. if (res.data.contentImg && res.data.contentImg != '') {
  482. res.data.contentImg = JSON.parse(res.data.contentImg);
  483. res.data.contentImg.forEach(function (value) {
  484. value.url = ms.base + value.path;
  485. });
  486. } else {
  487. res.data.contentImg = [];
  488. }
  489. that.form = res.data;
  490. var category = that.categoryIdOptions.filter(function (f) {
  491. return f['id'] == that.form.categoryId;
  492. });
  493. if (category.length > 0) {
  494. that.categoryType = category[0].categoryType
  495. if (category[0].categoryType == '2') {
  496. that.returnIsShow = false;
  497. }
  498. }
  499. }
  500. that.changeModel();
  501. } else {
  502. that.$notify({
  503. title: '失败',
  504. message: "获取错误",
  505. type: 'warning'
  506. });
  507. }
  508. });
  509. },
  510. //获取contentCategoryId数据源
  511. contentCategoryIdOptionsGet: function () {
  512. var that = this;
  513. ms.http.get(ms.manager + "/cms/category/list.do", {
  514. pageSize: 9999
  515. }).then(function (res) {
  516. if (res.result) {
  517. res.data.rows.forEach(function (item) {
  518. if (item.categoryType == '2' || item.categoryType == '3') {
  519. item.isDisabled = true;
  520. }
  521. });
  522. that.contentCategoryIdOptions = ms.util.treeData(res.data.rows, 'id', 'categoryId', 'children');
  523. that.categoryIdOptions = res.data.rows;
  524. //获取到栏目数据之后再进行初始化
  525. that.init();
  526. }
  527. });
  528. },
  529. //获取contentType数据源
  530. contentTypeOptionsGet: function () {
  531. var that = this;
  532. ms.http.get(ms.base + '/mdiy/dict/list.do', {
  533. dictType: '文章属性',
  534. pageSize: 99999
  535. }).then(function (data) {
  536. if(data.result){
  537. data = data.data;
  538. that.contentTypeOptions = data.rows;
  539. }
  540. });
  541. },
  542. //contentImg文件上传完成回调
  543. contentImgSuccess: function (response, file, fileList) {
  544. if(response.result){
  545. this.form.contentImg.push({
  546. url: file.url,
  547. name: file.name,
  548. path: response.data,
  549. uid: file.uid
  550. });
  551. }else {
  552. this.$notify({
  553. title: '失败',
  554. message: response.msg,
  555. type: 'warning'
  556. });
  557. }
  558. },
  559. contentImghandleRemove: function (file, files) {
  560. var index = -1;
  561. index = this.form.contentImg.findIndex(function (text) {
  562. return text == file;
  563. });
  564. if (index != -1) {
  565. this.form.contentImg.splice(index, 1);
  566. }
  567. },
  568. //上传超过限制
  569. contentImghandleExceed: function (files, fileList) {
  570. this.$notify({
  571. title: '失败',
  572. message: '当前最多上传1个文件',
  573. type: 'warning'
  574. });
  575. },
  576. //查询列表
  577. list: function (categoryId) {
  578. var that = this;
  579. ms.http.post(ms.manager + "/cms/content/list.do", {
  580. categoryId: categoryId
  581. }).then(function (res) {
  582. if (res.result && res.data.total > 0) {
  583. if (res.data.rows[0].contentType) {
  584. res.data.rows[0].contentType = res.data.rows[0].contentType.split(',');
  585. }
  586. if (res.data.rows[0].contentImg && res.data.rows[0].contentImg != '') {
  587. res.data.rows[0].contentImg = JSON.parse(res.data.rows[0].contentImg);
  588. res.data.rows[0].contentImg.forEach(function (value) {
  589. value.url = ms.base + value.path;
  590. });
  591. } else {
  592. res.data.rows[0].contentImg = [];
  593. }
  594. that.form = res.data.rows[0];
  595. }
  596. });
  597. },
  598. //只有在渲染完栏目数据之后才会初始化
  599. init: function () {
  600. this.form.id = ms.util.getParameter("id");
  601. this.type = ms.util.getParameter("type");
  602. //在指定栏目下新增或编辑文章时
  603. var categoryId = ms.util.getParameter("categoryId");
  604. if (categoryId) {
  605. this.form.categoryId = categoryId;
  606. //如果是封面栏目直接跳转
  607. if (this.type) {
  608. this.getFromFengMian(this.form.categoryId);
  609. this.returnIsShow = false;
  610. //指定非封面栏目编辑文章
  611. }else if (this.form.id) {
  612. this.get(this.form.id);
  613. //指定栏目新增文章渲染自定义模型
  614. }else {
  615. this.changeModel();
  616. }
  617. //不指定栏目编辑文章
  618. }else if (this.form.id) {
  619. this.get(this.form.id);
  620. }//else 如果即不指定栏目新增文章,又不是编辑文章就不渲染自定义模型
  621. },
  622. //复制文章id
  623. copyString: function () {
  624. var clipboard = new ClipboardJS('.copyBtn');
  625. var self = this;
  626. clipboard.on('success', function (e) {
  627. self.$notify({
  628. title: '提示',
  629. message: '已成功复制到剪切板',
  630. type: 'success'
  631. });
  632. clipboard.destroy();
  633. });
  634. },
  635. },
  636. created: function () {
  637. this.contentCategoryIdOptionsGet();
  638. this.contentTypeOptionsGet();
  639. }
  640. });
  641. </script>
  642. <style>
  643. .el-select {
  644. width: 100%;
  645. }
  646. body {
  647. overflow: hidden;
  648. }
  649. #form {
  650. overflow: hidden;
  651. }
  652. .el-scrollbar__bar.is-vertical{
  653. width: 6px!important;
  654. }
  655. .header-info {
  656. white-space: nowrap;
  657. display:inline-block;
  658. overflow: hidden;
  659. text-overflow: ellipsis;
  660. }
  661. </style>