|
|
|
@ -1,31 +1,37 @@ |
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
|
<el-card shadow="hover" |
|
|
|
|
class="mgb20"> |
|
|
|
|
<div class="flex-between"> |
|
|
|
|
<div class="per_title" v-preventReClick @click="back"> |
|
|
|
|
<div class="per_title" |
|
|
|
|
v-preventReClick |
|
|
|
|
@click="back"> |
|
|
|
|
<i class="el-icon-arrow-left"></i> |
|
|
|
|
<span class="per_back">返回</span> |
|
|
|
|
<span class="per_school" v-text="form.id ? '编辑文章' : '新建文章'"></span> |
|
|
|
|
<span class="per_school" |
|
|
|
|
v-text="form.id ? '编辑文章' : '新建文章'"></span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
|
<div class="page"> |
|
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" label-width="140px"> |
|
|
|
|
<el-form-item prop="title" label="标题"> |
|
|
|
|
<el-input |
|
|
|
|
id="articleTitle" |
|
|
|
|
<el-form :model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
class="input-form model" |
|
|
|
|
label-width="140px"> |
|
|
|
|
<el-form-item prop="title" |
|
|
|
|
label="标题"> |
|
|
|
|
<el-input id="focus-el" |
|
|
|
|
style="width: 940px" |
|
|
|
|
placeholder="请输入标题" |
|
|
|
|
v-model="form.title" |
|
|
|
|
clearable |
|
|
|
|
maxlength="100" |
|
|
|
|
@change="nameChange" |
|
|
|
|
></el-input> |
|
|
|
|
@change="nameChange"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="releaseTime" label="发布日期"> |
|
|
|
|
<el-date-picker |
|
|
|
|
v-model="form.releaseTime" |
|
|
|
|
<el-form-item prop="releaseTime" |
|
|
|
|
label="发布日期"> |
|
|
|
|
<el-date-picker v-model="form.releaseTime" |
|
|
|
|
type="date" |
|
|
|
|
placeholder="选择日期" |
|
|
|
|
format="yyyy-MM-dd" |
|
|
|
@ -35,124 +41,136 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="source" label="来源"> |
|
|
|
|
<el-input |
|
|
|
|
placeholder="请输入来源" |
|
|
|
|
<el-form-item prop="source" |
|
|
|
|
label="来源"> |
|
|
|
|
<el-input placeholder="请输入来源" |
|
|
|
|
v-model.trim="form.source" |
|
|
|
|
clearable |
|
|
|
|
maxlength="50" |
|
|
|
|
class="inline-input" |
|
|
|
|
></el-input> |
|
|
|
|
class="inline-input"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="author" label="作者"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="form.author" |
|
|
|
|
<el-form-item prop="author" |
|
|
|
|
label="作者"> |
|
|
|
|
<el-input v-model="form.author" |
|
|
|
|
clearable |
|
|
|
|
maxlength="50" |
|
|
|
|
class="inline-input" |
|
|
|
|
></el-input> |
|
|
|
|
class="inline-input"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="edit" label="编辑"> |
|
|
|
|
<el-input |
|
|
|
|
placeholder="请输入编辑" |
|
|
|
|
<el-form-item prop="edit" |
|
|
|
|
label="编辑"> |
|
|
|
|
<el-input placeholder="请输入编辑" |
|
|
|
|
v-model.trim="form.edit" |
|
|
|
|
clearable |
|
|
|
|
maxlength="50" |
|
|
|
|
class="inline-input" |
|
|
|
|
></el-input> |
|
|
|
|
class="inline-input"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="audit" label="审核"> |
|
|
|
|
<el-input |
|
|
|
|
placeholder="请输入审核" |
|
|
|
|
<el-form-item prop="audit" |
|
|
|
|
label="审核"> |
|
|
|
|
<el-input placeholder="请输入审核" |
|
|
|
|
v-model.trim="form.audit" |
|
|
|
|
clearable |
|
|
|
|
maxlength="50" |
|
|
|
|
class="inline-input" |
|
|
|
|
></el-input> |
|
|
|
|
class="inline-input"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="classificationId" label="所属分类"> |
|
|
|
|
<el-select style="width: 234px;" v-model="form.classificationId"> |
|
|
|
|
<el-form-item prop="classificationId" |
|
|
|
|
label="所属分类"> |
|
|
|
|
<el-select style="width: 234px;" |
|
|
|
|
v-model="form.classificationId"> |
|
|
|
|
<template v-for="item in classifications"> |
|
|
|
|
<el-option |
|
|
|
|
v-if="item.id" |
|
|
|
|
<el-option v-if="item.id" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.classificationName" |
|
|
|
|
:value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</template> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button> |
|
|
|
|
<el-button class="set-btn" |
|
|
|
|
type="primary" |
|
|
|
|
@click="setClass">设置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="author" label="主题标签"> |
|
|
|
|
<el-select style="width: 234px;" v-model="form.lableId" multiple> |
|
|
|
|
<el-form-item prop="author" |
|
|
|
|
label="主题标签"> |
|
|
|
|
<el-select style="width: 234px;" |
|
|
|
|
v-model="form.lableId" |
|
|
|
|
multiple> |
|
|
|
|
<template v-for="item in labels"> |
|
|
|
|
<el-option |
|
|
|
|
v-if="item.id" |
|
|
|
|
<el-option v-if="item.id" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.labelName" |
|
|
|
|
:value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</template> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button class="set-btn" type="primary" @click="setLabel">设置</el-button> |
|
|
|
|
<el-button class="set-btn" |
|
|
|
|
type="primary" |
|
|
|
|
@click="setLabel">设置</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<el-form-item prop="summary" label="摘要"> |
|
|
|
|
<el-input |
|
|
|
|
style="width: 940px" |
|
|
|
|
<el-form-item prop="summary" |
|
|
|
|
label="摘要"> |
|
|
|
|
<el-input style="width: 940px" |
|
|
|
|
type="textarea" |
|
|
|
|
v-model.trim="form.summary" |
|
|
|
|
:rows="3" |
|
|
|
|
clearable |
|
|
|
|
></el-input> |
|
|
|
|
clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="bannerImg" label="封面图"> |
|
|
|
|
<el-upload |
|
|
|
|
class="avatar-uploader" |
|
|
|
|
<el-form-item prop="bannerImg" |
|
|
|
|
label="封面图"> |
|
|
|
|
<el-upload class="avatar-uploader" |
|
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
|
:on-change="changeFile" |
|
|
|
|
:show-file-list="false" |
|
|
|
|
:action="this.api.fileupload" |
|
|
|
|
:auto-upload="false" |
|
|
|
|
> |
|
|
|
|
<img v-if="form.bannerImg" :src="form.bannerImg" class="avatar"> |
|
|
|
|
<div class="uploader-default" v-else> |
|
|
|
|
<img class="plus" src="@/assets/img/plus.png" alt=""> |
|
|
|
|
:auto-upload="false"> |
|
|
|
|
<img v-if="form.bannerImg" |
|
|
|
|
:src="form.bannerImg" |
|
|
|
|
class="avatar"> |
|
|
|
|
<div class="uploader-default" |
|
|
|
|
v-else> |
|
|
|
|
<img class="plus" |
|
|
|
|
src="@/assets/img/plus.png" |
|
|
|
|
alt=""> |
|
|
|
|
<p>点击上传</p> |
|
|
|
|
</div> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="mainBody" label="正文" > |
|
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" /> |
|
|
|
|
<el-form-item prop="mainBody" |
|
|
|
|
label="正文"> |
|
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' |
|
|
|
|
v-model="form.mainBody" |
|
|
|
|
:init="editorConfig" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="file" label="文件上传"> |
|
|
|
|
<el-upload |
|
|
|
|
:before-upload="fileBeforeUpload" |
|
|
|
|
<el-form-item prop="file" |
|
|
|
|
label="文件上传"> |
|
|
|
|
<el-upload :before-upload="fileBeforeUpload" |
|
|
|
|
:on-remove="handleRemove" |
|
|
|
|
:on-success="uploadSuccessFile" |
|
|
|
|
:action="this.api.fileUploadNakadai" |
|
|
|
|
:file-list="form.fileList" |
|
|
|
|
:headers="headers" |
|
|
|
|
> |
|
|
|
|
:headers="headers"> |
|
|
|
|
<el-button>上传</el-button> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="btns"> |
|
|
|
|
<el-button type="primary" @click="submit(1)">发布</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="submit(1)">发布</el-button> |
|
|
|
|
<el-button @click="submit(0)">保存草稿</el-button> |
|
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- 剪裁组件弹窗 --> |
|
|
|
|
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false"> |
|
|
|
|
<Cropper |
|
|
|
|
ref="cropper" |
|
|
|
|
<el-dialog title="图片裁剪" |
|
|
|
|
append-to-body |
|
|
|
|
:visible.sync="cropperModel" |
|
|
|
|
width="1100px" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<Cropper ref="cropper" |
|
|
|
|
:img-file.sync="file" |
|
|
|
|
:is-upload="isUpload" |
|
|
|
|
:fixed="true" |
|
|
|
@ -160,30 +178,53 @@ |
|
|
|
|
@upload="customUpload" /> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="所属分类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeClass"> |
|
|
|
|
<el-dialog title="所属分类设置" |
|
|
|
|
:visible.sync="classVisible" |
|
|
|
|
width="500px" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
class="manage-dia" |
|
|
|
|
:before-close="closeClass"> |
|
|
|
|
<div class="plus"> |
|
|
|
|
<i class="el-icon-circle-plus-outline" @click="addClass"></i> |
|
|
|
|
<i class="el-icon-circle-plus-outline" |
|
|
|
|
@click="addClass"></i> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="classifications" ref="table" header-align="center" row-key="id"> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="classificationName" label="分类名称" align="center" min-width="130"> |
|
|
|
|
<el-table :data="classifications" |
|
|
|
|
ref="table" |
|
|
|
|
header-align="center" |
|
|
|
|
row-key="id"> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="60" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="classificationName" |
|
|
|
|
label="分类名称" |
|
|
|
|
align="center" |
|
|
|
|
min-width="130"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input |
|
|
|
|
v-if="scope.row.edit" |
|
|
|
|
<el-input v-if="scope.row.edit" |
|
|
|
|
placeholder="请输入分类名称" |
|
|
|
|
v-model="scope.row.classificationName" |
|
|
|
|
clearable |
|
|
|
|
maxlength="30" |
|
|
|
|
></el-input> |
|
|
|
|
maxlength="30"></el-input> |
|
|
|
|
<span v-else>{{ scope.row.classificationName }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60">否</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" min-width="60"> |
|
|
|
|
<el-table-column prop="updateTime1" |
|
|
|
|
label="是否引用" |
|
|
|
|
align="center" |
|
|
|
|
min-width="60">否</el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
min-width="60"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitClass(scope.row)"></i> |
|
|
|
|
<i v-else class="el-icon-edit edit" @click="editClass(scope.row)"></i> |
|
|
|
|
<i class="el-icon-delete del" @click="delClass(scope.row, scope.$index)"></i> |
|
|
|
|
<i v-if="scope.row.edit" |
|
|
|
|
class="el-icon-check edit" |
|
|
|
|
@click="submitClass(scope.row)"></i> |
|
|
|
|
<i v-else |
|
|
|
|
class="el-icon-edit edit" |
|
|
|
|
@click="editClass(scope.row)"></i> |
|
|
|
|
<i class="el-icon-delete del" |
|
|
|
|
@click="delClass(scope.row, scope.$index)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -192,30 +233,53 @@ |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<el-dialog title="主题标签设置" :visible.sync="labelVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeLabel"> |
|
|
|
|
<el-dialog title="主题标签设置" |
|
|
|
|
:visible.sync="labelVisible" |
|
|
|
|
width="500px" |
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
class="manage-dia" |
|
|
|
|
:before-close="closeLabel"> |
|
|
|
|
<div class="plus"> |
|
|
|
|
<i class="el-icon-circle-plus-outline" @click="addLabel"></i> |
|
|
|
|
<i class="el-icon-circle-plus-outline" |
|
|
|
|
@click="addLabel"></i> |
|
|
|
|
</div> |
|
|
|
|
<el-table :data="labels" ref="table" header-align="center" row-key="id"> |
|
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="labelName" label="主题名称" align="center" min-width="130"> |
|
|
|
|
<el-table :data="labels" |
|
|
|
|
ref="table" |
|
|
|
|
header-align="center" |
|
|
|
|
row-key="id"> |
|
|
|
|
<el-table-column type="index" |
|
|
|
|
width="60" |
|
|
|
|
label="序号" |
|
|
|
|
align="center"></el-table-column> |
|
|
|
|
<el-table-column prop="labelName" |
|
|
|
|
label="主题名称" |
|
|
|
|
align="center" |
|
|
|
|
min-width="130"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input |
|
|
|
|
v-if="scope.row.edit" |
|
|
|
|
<el-input v-if="scope.row.edit" |
|
|
|
|
placeholder="请输入主题名称" |
|
|
|
|
v-model="scope.row.labelName" |
|
|
|
|
clearable |
|
|
|
|
maxlength="30" |
|
|
|
|
></el-input> |
|
|
|
|
maxlength="30"></el-input> |
|
|
|
|
<span v-else>{{ scope.row.labelName }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60">否</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center" min-width="60"> |
|
|
|
|
<el-table-column prop="updateTime1" |
|
|
|
|
label="是否引用" |
|
|
|
|
align="center" |
|
|
|
|
min-width="60">否</el-table-column> |
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
align="center" |
|
|
|
|
min-width="60"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitLabel(scope.row)"></i> |
|
|
|
|
<i v-else class="el-icon-edit edit" @click="editLabel(scope.row)"></i> |
|
|
|
|
<i class="el-icon-delete del" @click="delLabel(scope.row, scope.$index)"></i> |
|
|
|
|
<i v-if="scope.row.edit" |
|
|
|
|
class="el-icon-check edit" |
|
|
|
|
@click="submitLabel(scope.row)"></i> |
|
|
|
|
<i v-else |
|
|
|
|
class="el-icon-edit edit" |
|
|
|
|
@click="editLabel(scope.row)"></i> |
|
|
|
|
<i class="el-icon-delete del" |
|
|
|
|
@click="delLabel(scope.row, scope.$index)"></i> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
@ -701,7 +765,7 @@ $upload-lg-height: 102px; |
|
|
|
|
position: relative; |
|
|
|
|
width: $upload-width; |
|
|
|
|
height: $upload-height; |
|
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
|
border: 1px solid #dcdee0; |
|
|
|
|
border-radius: 2px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
overflow: hidden; |
|
|
|
@ -712,7 +776,7 @@ $upload-lg-height: 102px; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
text-align: center; |
|
|
|
|
background: #FAFAFA; |
|
|
|
|
background: #fafafa; |
|
|
|
|
p { |
|
|
|
|
margin-top: 10px; |
|
|
|
|
font-size: 14px; |
|
|
|
@ -769,7 +833,7 @@ $upload-lg-height: 102px; |
|
|
|
|
text-align: center; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&:hover .review { |
|
|
|
|
border-color: #9278FF; |
|
|
|
|
border-color: #9278ff; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.review { |
|
|
|
@ -779,7 +843,7 @@ $upload-lg-height: 102px; |
|
|
|
|
width: 170px; |
|
|
|
|
height: 112px; |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
|
border: 1px solid #dcdee0; |
|
|
|
|
border-radius: 2px; |
|
|
|
|
img { |
|
|
|
|
width: 80px; |
|
|
|
@ -798,7 +862,7 @@ $upload-lg-height: 102px; |
|
|
|
|
.plus { |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
font-size: 18px; |
|
|
|
|
color: #9278FF; |
|
|
|
|
color: #9278ff; |
|
|
|
|
text-align: right; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
@ -806,7 +870,8 @@ $upload-lg-height: 102px; |
|
|
|
|
margin-left: 10px !important; |
|
|
|
|
} |
|
|
|
|
.manage-dia { |
|
|
|
|
.edit, .del { |
|
|
|
|
.edit, |
|
|
|
|
.del { |
|
|
|
|
font-size: 14px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
@ -834,12 +899,13 @@ $upload-lg-height: 102px; |
|
|
|
|
} |
|
|
|
|
.line { |
|
|
|
|
margin-bottom: 24px; |
|
|
|
|
border-bottom: 1px dashed #C2C2C2; |
|
|
|
|
border-bottom: 1px dashed #c2c2c2; |
|
|
|
|
} |
|
|
|
|
.el-form-item--small.el-form-item { |
|
|
|
|
margin-bottom: 24px; |
|
|
|
|
} |
|
|
|
|
.el-input, .el-select { |
|
|
|
|
.el-input, |
|
|
|
|
.el-select { |
|
|
|
|
width: 300px; |
|
|
|
|
} |
|
|
|
|
.el-select .el-input { |
|
|
|
@ -848,13 +914,14 @@ $upload-lg-height: 102px; |
|
|
|
|
.el-textarea { |
|
|
|
|
width: 550px; |
|
|
|
|
} |
|
|
|
|
.auto, .auto .el-input { |
|
|
|
|
.auto, |
|
|
|
|
.auto .el-input { |
|
|
|
|
width: auto; |
|
|
|
|
} |
|
|
|
|
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before { |
|
|
|
|
font-size: 18px; |
|
|
|
|
vertical-align: -4px; |
|
|
|
|
color: #F5222D; |
|
|
|
|
color: #f5222d; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.btns { |
|
|
|
|