|
|
@@ -1,294 +1,296 @@
|
|
|
|
|
|
<template type="text/x-template" id="content-form">
|
|
|
-<div id="form" v-cloak>
|
|
|
- <el-header class="ms-header ms-tr" height="50px" >
|
|
|
- <el-col :span="12" style="display:flex;align-items:center;">
|
|
|
- <el-tooltip v-if="form.id && categoryType=='2'" class="item" effect="dark" :content="form.id" placement="top-start">
|
|
|
- <span style="float: left; " class="header-info">编号:{{form.id}}</span>
|
|
|
- </el-tooltip>
|
|
|
- <el-button v-if="form.id && categoryType=='2'" type="primary" link style="float: left" class="el-icon-document-copy" circle :data-clipboard-text="form.id" @click="copyString()" class="copyBtn"></el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12" class="ms-tr">
|
|
|
- <@shiro.hasPermission name="cms:content:save">
|
|
|
- <el-button type="primary" class="iconfont icon-baocun" size="default" @click="save()" :loading="saveDisabled">保存
|
|
|
+ <div id="form" v-cloak>
|
|
|
+ <el-header class="ms-header ms-tr" height="50px" >
|
|
|
+ <el-row type="flex" justify="space-between" align="middle" style="width: 100%;">
|
|
|
+ <el-col :span=12 style="display:flex;align-items:center;">
|
|
|
+ <el-tooltip v-if="form.id && categoryType=='2'" class="item" effect="dark" :content="form.id" placement="top-start">
|
|
|
+ <span style="float: left; " class="header-info">编号:{{form.id}}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-button v-if="form.id && categoryType=='2'" type="primary" link style="float: left" class="el-icon-document-copy copyBtn" circle :data-clipboard-text="form.id" @click="copyString()"></el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="ms-tr">
|
|
|
+ <@shiro.hasPermission name="cms:content:save">
|
|
|
+ <el-button type="primary" class="iconfont icon-baocun" size="default" @click="save()" :loading="saveDisabled">保存
|
|
|
+ </el-button>
|
|
|
+ </@shiro.hasPermission>
|
|
|
+ <el-button v-if="categoryType!='2' || id!=null" size="default" class="iconfont icon-fanhui" plain @click="back()">返回
|
|
|
</el-button>
|
|
|
- </@shiro.hasPermission>
|
|
|
- <el-button v-if="categoryType==1" size="default" class="iconfont icon-fanhui" plain @click="back()">返回
|
|
|
- </el-button>
|
|
|
- <el-button v-if="categoryType==2" size="default" type="danger" class="el-icon-delete" @click="del()" :disabled="!form.id" >删除
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- </el-header>
|
|
|
- <el-main class="ms-container" style="position:relative;">
|
|
|
- <el-scrollbar class="ms-scrollbar" style="height: 95vh">
|
|
|
- <el-tabs v-model="activeName" style="height: calc(100vh - 10px);">
|
|
|
- <el-tab-pane style="position:relative;" v-for="(item, index) in editableTabs" :key="index"
|
|
|
- :label="item.title" :name="item.name">
|
|
|
- <el-form v-if="item.title=='文章编辑'" ref="form" :model="form" :rules="rules" label-width="120px"
|
|
|
- size="default">
|
|
|
- <el-row :gutter=0 justify="start" align="top">
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章标题" prop="contentTitle">
|
|
|
- <el-input v-model="form.contentTitle"
|
|
|
- :disabled="false"
|
|
|
- :style="{width: '100%'}"
|
|
|
- :clearable="true"
|
|
|
- placeholder="请输入文章标题">
|
|
|
- </el-input>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.title}</a>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span=12 >
|
|
|
- <el-form-item label="所属栏目" prop="categoryId">
|
|
|
- <el-tree-select
|
|
|
- v-model="form.categoryId"
|
|
|
- :disabled="!categoryChangeEnabled"
|
|
|
- :data="contentCategoryIdOptions"
|
|
|
- :props="{value: 'id',label: 'categoryTitle',children: 'children'}"
|
|
|
- :render-after-expand="false"
|
|
|
- :check-strictly="false"
|
|
|
- :default-expand-all="false"
|
|
|
- @change="categoryChange"
|
|
|
- filterable
|
|
|
- ></el-tree-select>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.typetitle}</a>
|
|
|
- 不能选择封面、链接栏目类型,不能选择父栏目
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row
|
|
|
- :gutter=0
|
|
|
- justify="start" align="top">
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章副标题" prop="contentShortTitle">
|
|
|
- <el-input v-model="form.contentShortTitle"
|
|
|
- :disabled="false"
|
|
|
- :style="{width: '100%'}"
|
|
|
- :clearable="true"
|
|
|
- placeholder="请输入文章副标题">
|
|
|
- </el-input>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.shorttitle}</a>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章外链接" prop="contentOutLink">
|
|
|
- <el-input v-model="form.contentOutLink"
|
|
|
- :disabled="false"
|
|
|
- :style="{width: '100%'}"
|
|
|
- :clearable="true"
|
|
|
- placeholder="请输入文章外链接">
|
|
|
- </el-input>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html"
|
|
|
- target="_blank">${'$'}{field.outlink}</a> 文章外链接必须以http或者https等开头
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row
|
|
|
- :gutter=0
|
|
|
- justify="start" align="top">
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章类型" prop="contentType">
|
|
|
- <el-select v-model="form.contentType"
|
|
|
- :style="{width: '100%'}"
|
|
|
- :filterable="false"
|
|
|
- :disabled="false"
|
|
|
- :multiple="true" :clearable="true"
|
|
|
- placeholder="请选择文章类型">
|
|
|
- <el-option v-for='item in contentTypeOptions' :key="item.dictValue"
|
|
|
- :value="item.dictValue"
|
|
|
- :label="item.dictLabel"></el-option>
|
|
|
- </el-select>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{flag}</a>
|
|
|
- 通过自定义字典可扩展,通常用在 arclist标签的flag属性上进行过滤文章
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="发布时间" prop="contentDatetime">
|
|
|
- <el-date-picker
|
|
|
- v-model="form.contentDatetime"
|
|
|
- placeholder="请选择发布时间"
|
|
|
- start-placeholder=""
|
|
|
- end-placeholder=""
|
|
|
- :readonly="false"
|
|
|
- :disabled="false"
|
|
|
- :editable="true"
|
|
|
- :clearable="true"
|
|
|
- format="YYYY-MM-DD HH:mm:ss"
|
|
|
- value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
- :style="{width:'100%'}"
|
|
|
- type="datetime">
|
|
|
- </el-date-picker>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<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>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row
|
|
|
- :gutter=0
|
|
|
- justify="start" align="top">
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章作者" prop="contentAuthor">
|
|
|
- <el-input v-model="form.contentAuthor"
|
|
|
- :disabled="false"
|
|
|
- :style="{width: '100%'}"
|
|
|
- :clearable="true"
|
|
|
- placeholder="请输入文章作者">
|
|
|
- </el-input>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.author}</a>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章来源" prop="contentSource">
|
|
|
- <el-input v-model="form.contentSource"
|
|
|
- :disabled="false"
|
|
|
- :style="{width: '100%'}"
|
|
|
- :clearable="true"
|
|
|
- placeholder="请输入文章来源">
|
|
|
- </el-input>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.source}</a>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row
|
|
|
- :gutter=0
|
|
|
- justify="start" align="top">
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="是否显示" prop="contentDisplay">
|
|
|
- <el-radio-group v-model="form.contentDisplay"
|
|
|
- :style="{width: ''}"
|
|
|
- :disabled="false">
|
|
|
- <el-radio :style="{display: true ? 'inline-block' : 'block'}"
|
|
|
- :label="item.value"
|
|
|
- v-for='(item, index) in contentDisplayOptions'
|
|
|
- :key="item.value + index">
|
|
|
- {{true? item.label : item.value}}
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 选择否后前端将不显示,需要重新生成才有效果
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="自定义顺序" prop="contentSort">
|
|
|
- <el-input-number
|
|
|
- v-model="form.contentSort"
|
|
|
- :disabled="false"
|
|
|
- controls-position="">
|
|
|
- </el-input-number>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 提示:前台模板标签需要设置orderby属性为sort才能生效
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row
|
|
|
- :gutter=0
|
|
|
- justify="start" align="top">
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章缩略图" prop="contentImg">
|
|
|
- <el-upload
|
|
|
- :file-list="form.contentImg"
|
|
|
- :action="ms.manager+'/file/upload.do'"
|
|
|
- :on-remove="contentImghandleRemove"
|
|
|
- :style="{width:''}"
|
|
|
- :limit="1"
|
|
|
- :on-exceed="contentImghandleExceed"
|
|
|
- :disabled="false"
|
|
|
- :data="{uploadPath:'/cms/content','isRename':true ,'appId':true}"
|
|
|
- :on-success="contentImgSuccess"
|
|
|
- :on-error="contentImgError"
|
|
|
- :on-preview="contentImgHandLePreview"
|
|
|
- accept="image/*"
|
|
|
- list-type="picture-card">
|
|
|
- <i class="el-icon-plus"></i>
|
|
|
- <template #tip>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'{@ms:file field.litpic/}'}</a><br/>
|
|
|
- 最多可上传10张图片,文章缩略图,支持jpg格式;多图情况下,{@ms:file field.litpic/}会只取第一张缩略图,其他用法参考文档arclist标签
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span=12>
|
|
|
- <el-form-item label="文章标签" prop="contentTags">
|
|
|
- <el-select v-model="form.contentTags"
|
|
|
- :style="{width: '100%'}"
|
|
|
- :filterable="false"
|
|
|
- :disabled="false"
|
|
|
- :multiple="true" :clearable="true"
|
|
|
- placeholder="请选择文章标签">
|
|
|
- <el-option v-for='item in contentTagsOptions' :key="item.dictValue"
|
|
|
- :value="item.dictValue"
|
|
|
- :label="item.dictLabel"></el-option>
|
|
|
- </el-select>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.tags}</a>
|
|
|
- 通过自定义字典可扩展数据;字典类型:文章标签
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-form-item label="关键字" prop="contentKeyword">
|
|
|
- <el-input
|
|
|
- type="textarea" :rows="5"
|
|
|
- :disabled="false"
|
|
|
- v-model="form.contentKeyword"
|
|
|
- :style="{width: '100%'}"
|
|
|
- placeholder="请输入文章关键字">
|
|
|
- </el-input>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.keyword}</a>,用于SEO优化
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="描述" prop="contentDescription">
|
|
|
- <el-input
|
|
|
- type="textarea" :rows="5"
|
|
|
- :disabled="false"
|
|
|
- v-model="form.contentDescription"
|
|
|
- :style="{width: '100%'}"
|
|
|
- placeholder="请输入对该文章的简短描述,以便用户查看文章简略">
|
|
|
- </el-input>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.descrip}</a>,用于SEO优化
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="文章内容" prop="contentDetails" v-loading="editorHiden">
|
|
|
- <vue-ueditor-wrap style="line-height: 0px"
|
|
|
- v-if="!editorHiden"
|
|
|
- v-model="form.contentDetails"
|
|
|
- :config="editorConfig"></vue-ueditor-wrap>
|
|
|
- <div class="ms-form-tip">
|
|
|
- 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.content}</a> <br/>
|
|
|
- 温馨提示:推荐使用高级版本编辑器,<a href='http://store.mingsoft.net/#/detail?id=299&type=plugin' target="_blank">新版富文本编辑器</a>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <div :id="'model'+index" v-else>
|
|
|
- <ms-mdiy-form v-if="modelName!=null" ref="modelForm" type="model" :model-name="modelName" :model-id="modelId" :id="form.id"></ms-mdiy-form>
|
|
|
- </div>
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- </el-scrollbar>
|
|
|
- </el-main>
|
|
|
-</div>
|
|
|
+ <el-button v-if="form.id && categoryType=='2'" size="default" type="danger" class="el-icon-delete" @click="del()" :disabled="!form.id" >删除
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-header>
|
|
|
+ <el-main class="ms-container" style="position:relative;">
|
|
|
+ <el-scrollbar class="ms-scrollbar" style="height: 100%;">
|
|
|
+ <el-tabs v-model="activeName" style="height: calc(100% - 10px);">
|
|
|
+ <el-tab-pane style="position:relative;" v-for="(item, index) in editableTabs" :key="index"
|
|
|
+ :label="item.title" :name="item.name">
|
|
|
+ <el-form v-if="item.title=='文章编辑'" ref="form" :model="form" :rules="rules" label-width="120px"
|
|
|
+ size="default">
|
|
|
+ <el-row :gutter=0 justify="start" align="top">
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章标题" prop="contentTitle">
|
|
|
+ <el-input v-model="form.contentTitle"
|
|
|
+ :disabled="false"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ :clearable="true"
|
|
|
+ placeholder="请输入文章标题">
|
|
|
+ </el-input>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.title}</a>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span=12 >
|
|
|
+ <el-form-item label="所属栏目" prop="categoryId">
|
|
|
+ <el-tree-select
|
|
|
+ v-model="form.categoryId"
|
|
|
+ :disabled="!categoryChangeEnabled"
|
|
|
+ :data="contentCategoryIdOptions"
|
|
|
+ :props="{value: 'id',label: 'categoryTitle',children: 'children'}"
|
|
|
+ :render-after-expand="false"
|
|
|
+ :check-strictly="false"
|
|
|
+ :default-expand-all="false"
|
|
|
+ @change="categoryChange"
|
|
|
+ filterable
|
|
|
+ ></el-tree-select>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.typetitle}</a>
|
|
|
+ 不能选择封面、链接栏目类型,不能选择父栏目
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ :gutter=0
|
|
|
+ justify="start" align="top">
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章副标题" prop="contentShortTitle">
|
|
|
+ <el-input v-model="form.contentShortTitle"
|
|
|
+ :disabled="false"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ :clearable="true"
|
|
|
+ placeholder="请输入文章副标题">
|
|
|
+ </el-input>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.shorttitle}</a>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章外链接" prop="contentOutLink">
|
|
|
+ <el-input v-model="form.contentOutLink"
|
|
|
+ :disabled="false"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ :clearable="true"
|
|
|
+ placeholder="请输入文章外链接">
|
|
|
+ </el-input>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html"
|
|
|
+ target="_blank">${'$'}{field.outlink}</a> 文章外链接必须以http或者https等开头
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ :gutter=0
|
|
|
+ justify="start" align="top">
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章类型" prop="contentType">
|
|
|
+ <el-select v-model="form.contentType"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ :filterable="false"
|
|
|
+ :disabled="false"
|
|
|
+ :multiple="true" :clearable="true"
|
|
|
+ placeholder="请选择文章类型">
|
|
|
+ <el-option v-for='item in contentTypeOptions' :key="item.dictValue"
|
|
|
+ :value="item.dictValue"
|
|
|
+ :label="item.dictLabel"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{flag}</a>
|
|
|
+ 通过自定义字典可扩展,通常用在 arclist标签的flag属性上进行过滤文章
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="发布时间" prop="contentDatetime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="form.contentDatetime"
|
|
|
+ placeholder="请选择发布时间"
|
|
|
+ start-placeholder=""
|
|
|
+ end-placeholder=""
|
|
|
+ :readonly="false"
|
|
|
+ :disabled="false"
|
|
|
+ :editable="true"
|
|
|
+ :clearable="true"
|
|
|
+ format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ :style="{width:'100%'}"
|
|
|
+ type="datetime">
|
|
|
+ </el-date-picker>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<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>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ :gutter=0
|
|
|
+ justify="start" align="top">
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章作者" prop="contentAuthor">
|
|
|
+ <el-input v-model="form.contentAuthor"
|
|
|
+ :disabled="false"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ :clearable="true"
|
|
|
+ placeholder="请输入文章作者">
|
|
|
+ </el-input>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.author}</a>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章来源" prop="contentSource">
|
|
|
+ <el-input v-model="form.contentSource"
|
|
|
+ :disabled="false"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ :clearable="true"
|
|
|
+ placeholder="请输入文章来源">
|
|
|
+ </el-input>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.source}</a>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ :gutter=0
|
|
|
+ justify="start" align="top">
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="是否显示" prop="contentDisplay">
|
|
|
+ <el-radio-group v-model="form.contentDisplay"
|
|
|
+ :style="{width: ''}"
|
|
|
+ :disabled="false">
|
|
|
+ <el-radio :style="{display: true ? 'inline-block' : 'block'}"
|
|
|
+ :value="item.value"
|
|
|
+ v-for='(item, index) in contentDisplayOptions'
|
|
|
+ :key="item.value + index">
|
|
|
+ {{true? item.label : item.value}}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 选择否后前端将不显示,需要重新生成才有效果。单篇文章显示是由栏目控制。
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="自定义顺序" prop="contentSort">
|
|
|
+ <el-input-number
|
|
|
+ v-model="form.contentSort"
|
|
|
+ :disabled="false"
|
|
|
+ controls-position="">
|
|
|
+ </el-input-number>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 提示:前台模板标签需要设置orderby属性为sort才能生效
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row
|
|
|
+ :gutter=0
|
|
|
+ justify="start" align="top">
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章缩略图" prop="contentImg">
|
|
|
+ <el-upload
|
|
|
+ :file-list="form.contentImg"
|
|
|
+ :action="ms.manager+'/file/upload.do'"
|
|
|
+ :on-remove="contentImghandleRemove"
|
|
|
+ :style="{width:''}"
|
|
|
+ :limit="10"
|
|
|
+ :on-exceed="contentImghandleExceed"
|
|
|
+ :disabled="false"
|
|
|
+ :data="{uploadPath:'/cms/content','isRename':true ,'appId':true}"
|
|
|
+ :on-success="contentImgSuccess"
|
|
|
+ :on-error="contentImgError"
|
|
|
+ :on-preview="contentImgHandLePreview"
|
|
|
+ accept="image/*"
|
|
|
+ list-type="picture-card">
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
+ <template #tip>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'{@ms:file field.litpic/}'}</a><br/>
|
|
|
+ 最多可上传10张图片,文章缩略图,支持jpg格式;多图情况下,{@ms:file field.litpic/}会只取第一张缩略图,其他用法参考文档arclist标签
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span=12>
|
|
|
+ <el-form-item label="文章标签" prop="contentTags">
|
|
|
+ <el-select v-model="form.contentTags"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ :filterable="false"
|
|
|
+ :disabled="false"
|
|
|
+ :multiple="true" :clearable="true"
|
|
|
+ placeholder="请选择文章标签">
|
|
|
+ <el-option v-for='item in contentTagsOptions' :key="item.dictValue"
|
|
|
+ :value="item.dictValue"
|
|
|
+ :label="item.dictLabel"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.tags}</a>
|
|
|
+ 通过自定义字典可扩展数据;字典类型:文章标签
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-form-item label="关键字" prop="contentKeyword">
|
|
|
+ <el-input
|
|
|
+ type="textarea" :rows="5"
|
|
|
+ :disabled="false"
|
|
|
+ v-model="form.contentKeyword"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ placeholder="请输入文章关键字">
|
|
|
+ </el-input>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.keyword}</a>,用于SEO优化
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="描述" prop="contentDescription">
|
|
|
+ <el-input
|
|
|
+ type="textarea" :rows="5"
|
|
|
+ :disabled="false"
|
|
|
+ v-model="form.contentDescription"
|
|
|
+ :style="{width: '100%'}"
|
|
|
+ placeholder="请输入对该文章的简短描述,以便用户查看文章简略">
|
|
|
+ </el-input>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.descrip}</a>,用于SEO优化
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="文章内容" prop="contentDetails" v-loading="editorHiden">
|
|
|
+ <vue-ueditor-wrap style="line-height: 0px"
|
|
|
+ v-if="!editorHiden"
|
|
|
+ v-model="form.contentDetails"
|
|
|
+ :config="editorConfig"></vue-ueditor-wrap>
|
|
|
+ <div class="ms-form-tip">
|
|
|
+ 标签:<a href="http://doc.mingsoft.net/mcms/biao-qian/wen-zhang-lie-biao-ms-arclist.html" target="_blank">${'$'}{field.content}</a> <br/>
|
|
|
+ 温馨提示:推荐使用高级版本编辑器,<a href='http://store.mingsoft.net/#/detail?id=299&type=plugin' target="_blank">新版富文本编辑器</a>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div :id="'model'+index" v-else>
|
|
|
+ <ms-mdiy-form v-if="modelName!=null" ref="modelForm" type="model" :model-name="modelName" :model-id="modelId" :id="form.id"></ms-mdiy-form>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-main>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -376,7 +378,7 @@
|
|
|
// 文章标题
|
|
|
contentTitle: [{
|
|
|
"required": true,
|
|
|
- "message": "请选择文章标题"
|
|
|
+ "message": "请输入文章标题"
|
|
|
}],
|
|
|
// 发布时间
|
|
|
contentDatetime: [{
|
|
|
@@ -387,6 +389,11 @@
|
|
|
"required": true,
|
|
|
"message": "所属栏目不能为空"
|
|
|
}],
|
|
|
+ // 文章外链接
|
|
|
+ contentOutLink: [{
|
|
|
+ "pattern":/(((http|ftp|https):\/\/)?)([a-zA-Z0-9.-])\/[a-zA-Z0-9&%.\/-~-]*/,
|
|
|
+ "message":"文章外链接格式不匹配"},{"min":0,"max":200,"message":"文章外链接长度必须为0-200"}],
|
|
|
+ // 文章标签
|
|
|
contentTags: [{
|
|
|
validator: checkTags, trigger: 'blur'
|
|
|
}]
|
|
|
@@ -396,18 +403,21 @@
|
|
|
},
|
|
|
watch: {
|
|
|
"categoryId":function(n,o) {
|
|
|
- this.activeName = "form";
|
|
|
- this.$refs.form[0].resetFields();
|
|
|
+ var that = this;
|
|
|
+ that.activeName = "form";
|
|
|
+ that.$refs.form[0].resetFields();
|
|
|
|
|
|
- this.contentCategoryIdOptionsGet();
|
|
|
+ that.contentCategoryIdOptionsGet();
|
|
|
},
|
|
|
|
|
|
},
|
|
|
computed: {
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
back:function() {
|
|
|
+ //如果没有back方法,说明不是从文章管理里面打开的文章表单
|
|
|
+ //是文章管理的就放回对应的栏目列表
|
|
|
+ //不是就路由会退一下
|
|
|
if(this.$attrs.onBack) {
|
|
|
this.$emit('back');
|
|
|
} else {
|
|
|
@@ -491,20 +501,18 @@
|
|
|
if (that.categoryChangeEnabled) { //如果列表新增就需要返回的列表
|
|
|
that.$emit("back");
|
|
|
}
|
|
|
- that.saveDisabled = false;
|
|
|
//为了让上传控件不显示类型警告
|
|
|
if(res.data.contentImg=="") {
|
|
|
res.data.contentImg =[];
|
|
|
}
|
|
|
- that.form = res.data;
|
|
|
-
|
|
|
+ that.saveDisabled = false;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
that.$notify({
|
|
|
title: '失败',
|
|
|
- message: data.msg,
|
|
|
+ message: res.msg,
|
|
|
type: 'warning'
|
|
|
});
|
|
|
that.saveDisabled = false;
|
|
|
@@ -525,10 +533,10 @@
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(function () {
|
|
|
- var formData = JSON.parse(JSON.stringify(that.form));
|
|
|
- formData.contentType = ""
|
|
|
- formData.contentImg = ""
|
|
|
- formData.contentTags = ""
|
|
|
+ var formData = that.form;
|
|
|
+ formData.contentImg = "";
|
|
|
+ formData.contentType = "";
|
|
|
+ formData.contentTags = "";
|
|
|
ms.http.post(ms.manager + "/cms/content/delete.do", [formData], {
|
|
|
headers: {
|
|
|
'Content-Type': 'application/json'
|
|
|
@@ -623,6 +631,8 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err);
|
|
|
});
|
|
|
},
|
|
|
//根据封面获取当前文章
|
|
|
@@ -657,16 +667,15 @@
|
|
|
|
|
|
that.form = res.data;
|
|
|
|
|
|
+ // 左侧树选择单篇
|
|
|
+ var category = that.categoryIdOptions.filter(function (f) {
|
|
|
+ return f['id'] == that.form.categoryId;
|
|
|
+ });
|
|
|
+ if (category.length > 0) {
|
|
|
+ that.categoryChangeEnabled = false;
|
|
|
+ that.changeModel(category[0].id);
|
|
|
+ }
|
|
|
}
|
|
|
- // 左侧树选择单篇
|
|
|
- var category = that.categoryIdOptions.filter(function (f) {
|
|
|
- return f['id'] == that.form.categoryId;
|
|
|
- });
|
|
|
- if (category.length > 0) {
|
|
|
- that.categoryChangeEnabled = false;
|
|
|
- that.changeModel(category[0].id);
|
|
|
- }
|
|
|
-
|
|
|
} else {
|
|
|
that.$notify({
|
|
|
title: '失败',
|
|
|
@@ -674,8 +683,8 @@
|
|
|
type: 'warning'
|
|
|
});
|
|
|
}
|
|
|
- }).catch(function (err) {
|
|
|
- console.log(err);
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err);
|
|
|
});
|
|
|
},
|
|
|
//获取contentCategoryId数据源
|
|
|
@@ -684,7 +693,6 @@
|
|
|
ms.http.get(ms.manager + "/cms/category/list.do").then(function (res) {
|
|
|
if (res.result) {
|
|
|
res.data.rows.forEach(function (item) {
|
|
|
- // 单篇和链接类型的叶子栏目不可被选择
|
|
|
if (item.categoryType == '2' || item.categoryType == '3') {
|
|
|
item.disabled = true;
|
|
|
}
|
|
|
@@ -695,8 +703,8 @@
|
|
|
//获取到栏目数据之后再进行初始化
|
|
|
that.init();
|
|
|
}
|
|
|
- }).catch(function (err) {
|
|
|
- console.log(err);
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err);
|
|
|
});
|
|
|
},
|
|
|
//获取contentType数据源
|
|
|
@@ -710,8 +718,8 @@
|
|
|
data = data.data;
|
|
|
that.contentTypeOptions = data.rows;
|
|
|
}
|
|
|
- }).catch(function (err) {
|
|
|
- console.log(err);
|
|
|
+ }).catch(function (err) {
|
|
|
+ console.log(err);
|
|
|
});
|
|
|
},
|
|
|
//获取contentTag数据源
|
|
|
@@ -756,6 +764,9 @@
|
|
|
type: 'warning'
|
|
|
});
|
|
|
},
|
|
|
+ contentImgHandLePreview:function (file) {
|
|
|
+ window.open(file.url)
|
|
|
+ },
|
|
|
contentImghandleRemove: function (file, files) {
|
|
|
var index = -1;
|
|
|
index = this.form.contentImg.findIndex(function (text) {
|
|
|
@@ -779,9 +790,9 @@
|
|
|
},
|
|
|
//只有在渲染完栏目数据之后才会初始化
|
|
|
init: function () {
|
|
|
- var that = this;
|
|
|
+ var that = this;
|
|
|
this.form.id = this.id;
|
|
|
- that.editorHiden = true;
|
|
|
+ this.editorHiden = true;
|
|
|
|
|
|
//在指定栏目下新增或编辑文章时
|
|
|
if (this.categoryId) {
|
|
|
@@ -828,7 +839,7 @@
|
|
|
}
|
|
|
});
|
|
|
</script>
|
|
|
-<style>
|
|
|
+<style scoped>
|
|
|
.el-select {
|
|
|
width: 100%;
|
|
|
}
|
|
|
@@ -839,15 +850,16 @@
|
|
|
|
|
|
#form {
|
|
|
overflow: hidden;
|
|
|
- flex: 1;
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
.el-scrollbar__bar.is-vertical{
|
|
|
width: 6px!important;
|
|
|
}
|
|
|
- .header-info {
|
|
|
- white-space: nowrap;
|
|
|
- display:inline-block;
|
|
|
- overflow: hidden;
|
|
|
- text-overflow: ellipsis;
|
|
|
+ #form >>> .el-tabs__item {
|
|
|
+ background-color: unset;
|
|
|
+ }
|
|
|
+ /** 解决上传组件点击冒泡,因为图片是镂空的 **/
|
|
|
+ :deep(.el-icon--zoom-in),:deep(.el-icon--delete) {
|
|
|
+ background-color: rgba(0, 0, 0, 0.167);
|
|
|
}
|
|
|
</style>
|