form.ftl 34 KB

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