|
|
@ -1,31 +1,37 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-card shadow="hover" class="mgb20"> |
|
|
|
<el-card shadow="hover" |
|
|
|
|
|
|
|
class="mgb20"> |
|
|
|
<div class="flex-between"> |
|
|
|
<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> |
|
|
|
<i class="el-icon-arrow-left"></i> |
|
|
|
<span class="per_back">返回</span> |
|
|
|
<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> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" label-width="140px"> |
|
|
|
<el-form :model="form" |
|
|
|
<el-form-item prop="title" label="标题"> |
|
|
|
:rules="rules" |
|
|
|
<el-input |
|
|
|
class="input-form model" |
|
|
|
id="articleTitle" |
|
|
|
label-width="140px"> |
|
|
|
|
|
|
|
<el-form-item prop="title" |
|
|
|
|
|
|
|
label="标题"> |
|
|
|
|
|
|
|
<el-input id="focus-el" |
|
|
|
style="width: 940px" |
|
|
|
style="width: 940px" |
|
|
|
placeholder="请输入标题" |
|
|
|
placeholder="请输入标题" |
|
|
|
v-model="form.title" |
|
|
|
v-model="form.title" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="100" |
|
|
|
maxlength="100" |
|
|
|
@change="nameChange" |
|
|
|
@change="nameChange"></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<div class="item-line"> |
|
|
|
<div class="item-line"> |
|
|
|
<el-form-item prop="releaseTime" label="发布日期"> |
|
|
|
<el-form-item prop="releaseTime" |
|
|
|
<el-date-picker |
|
|
|
label="发布日期"> |
|
|
|
v-model="form.releaseTime" |
|
|
|
<el-date-picker v-model="form.releaseTime" |
|
|
|
type="date" |
|
|
|
type="date" |
|
|
|
placeholder="选择日期" |
|
|
|
placeholder="选择日期" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
format="yyyy-MM-dd" |
|
|
@ -35,124 +41,136 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item-line"> |
|
|
|
<div class="item-line"> |
|
|
|
<el-form-item prop="source" label="来源"> |
|
|
|
<el-form-item prop="source" |
|
|
|
<el-input |
|
|
|
label="来源"> |
|
|
|
placeholder="请输入来源" |
|
|
|
<el-input placeholder="请输入来源" |
|
|
|
v-model.trim="form.source" |
|
|
|
v-model.trim="form.source" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="50" |
|
|
|
maxlength="50" |
|
|
|
class="inline-input" |
|
|
|
class="inline-input"></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="author" label="作者"> |
|
|
|
<el-form-item prop="author" |
|
|
|
<el-input |
|
|
|
label="作者"> |
|
|
|
v-model="form.author" |
|
|
|
<el-input v-model="form.author" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="50" |
|
|
|
maxlength="50" |
|
|
|
class="inline-input" |
|
|
|
class="inline-input"></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="item-line"> |
|
|
|
<div class="item-line"> |
|
|
|
<el-form-item prop="edit" label="编辑"> |
|
|
|
<el-form-item prop="edit" |
|
|
|
<el-input |
|
|
|
label="编辑"> |
|
|
|
placeholder="请输入编辑" |
|
|
|
<el-input placeholder="请输入编辑" |
|
|
|
v-model.trim="form.edit" |
|
|
|
v-model.trim="form.edit" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="50" |
|
|
|
maxlength="50" |
|
|
|
class="inline-input" |
|
|
|
class="inline-input"></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="audit" label="审核"> |
|
|
|
<el-form-item prop="audit" |
|
|
|
<el-input |
|
|
|
label="审核"> |
|
|
|
placeholder="请输入审核" |
|
|
|
<el-input placeholder="请输入审核" |
|
|
|
v-model.trim="form.audit" |
|
|
|
v-model.trim="form.audit" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="50" |
|
|
|
maxlength="50" |
|
|
|
class="inline-input" |
|
|
|
class="inline-input"></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="item-line"> |
|
|
|
<div class="item-line"> |
|
|
|
<el-form-item prop="classificationId" label="所属分类"> |
|
|
|
<el-form-item prop="classificationId" |
|
|
|
<el-select style="width: 234px;" v-model="form.classificationId"> |
|
|
|
label="所属分类"> |
|
|
|
|
|
|
|
<el-select style="width: 234px;" |
|
|
|
|
|
|
|
v-model="form.classificationId"> |
|
|
|
<template v-for="item in classifications"> |
|
|
|
<template v-for="item in classifications"> |
|
|
|
<el-option |
|
|
|
<el-option v-if="item.id" |
|
|
|
v-if="item.id" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
|
:label="item.classificationName" |
|
|
|
:label="item.classificationName" |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-select> |
|
|
|
</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> |
|
|
|
<el-form-item prop="author" label="主题标签"> |
|
|
|
<el-form-item prop="author" |
|
|
|
<el-select style="width: 234px;" v-model="form.lableId" multiple> |
|
|
|
label="主题标签"> |
|
|
|
|
|
|
|
<el-select style="width: 234px;" |
|
|
|
|
|
|
|
v-model="form.lableId" |
|
|
|
|
|
|
|
multiple> |
|
|
|
<template v-for="item in labels"> |
|
|
|
<template v-for="item in labels"> |
|
|
|
<el-option |
|
|
|
<el-option v-if="item.id" |
|
|
|
v-if="item.id" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
|
:label="item.labelName" |
|
|
|
:label="item.labelName" |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-select> |
|
|
|
</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> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-form-item prop="summary" label="摘要"> |
|
|
|
<el-form-item prop="summary" |
|
|
|
<el-input |
|
|
|
label="摘要"> |
|
|
|
style="width: 940px" |
|
|
|
<el-input style="width: 940px" |
|
|
|
type="textarea" |
|
|
|
type="textarea" |
|
|
|
v-model.trim="form.summary" |
|
|
|
v-model.trim="form.summary" |
|
|
|
:rows="3" |
|
|
|
:rows="3" |
|
|
|
clearable |
|
|
|
clearable></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="bannerImg" label="封面图"> |
|
|
|
<el-form-item prop="bannerImg" |
|
|
|
<el-upload |
|
|
|
label="封面图"> |
|
|
|
class="avatar-uploader" |
|
|
|
<el-upload class="avatar-uploader" |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
:on-change="changeFile" |
|
|
|
:on-change="changeFile" |
|
|
|
:show-file-list="false" |
|
|
|
:show-file-list="false" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:auto-upload="false" |
|
|
|
:auto-upload="false"> |
|
|
|
> |
|
|
|
<img v-if="form.bannerImg" |
|
|
|
<img v-if="form.bannerImg" :src="form.bannerImg" class="avatar"> |
|
|
|
:src="form.bannerImg" |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
class="avatar"> |
|
|
|
<img class="plus" src="@/assets/img/plus.png" alt=""> |
|
|
|
<div class="uploader-default" |
|
|
|
|
|
|
|
v-else> |
|
|
|
|
|
|
|
<img class="plus" |
|
|
|
|
|
|
|
src="@/assets/img/plus.png" |
|
|
|
|
|
|
|
alt=""> |
|
|
|
<p>点击上传</p> |
|
|
|
<p>点击上传</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="mainBody" label="正文" > |
|
|
|
<el-form-item prop="mainBody" |
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" /> |
|
|
|
label="正文"> |
|
|
|
|
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' |
|
|
|
|
|
|
|
v-model="form.mainBody" |
|
|
|
|
|
|
|
:init="editorConfig" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="file" label="文件上传"> |
|
|
|
<el-form-item prop="file" |
|
|
|
<el-upload |
|
|
|
label="文件上传"> |
|
|
|
:before-upload="fileBeforeUpload" |
|
|
|
<el-upload :before-upload="fileBeforeUpload" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-success="uploadSuccessFile" |
|
|
|
:on-success="uploadSuccessFile" |
|
|
|
:action="this.api.fileUploadNakadai" |
|
|
|
:action="this.api.fileUploadNakadai" |
|
|
|
:file-list="form.fileList" |
|
|
|
:file-list="form.fileList" |
|
|
|
:headers="headers" |
|
|
|
:headers="headers"> |
|
|
|
> |
|
|
|
|
|
|
|
<el-button>上传</el-button> |
|
|
|
<el-button>上传</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<div class="btns"> |
|
|
|
<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="submit(0)">保存草稿</el-button> |
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
<el-button @click="back">取消</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 剪裁组件弹窗 --> |
|
|
|
<!-- 剪裁组件弹窗 --> |
|
|
|
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="图片裁剪" |
|
|
|
<Cropper |
|
|
|
append-to-body |
|
|
|
ref="cropper" |
|
|
|
:visible.sync="cropperModel" |
|
|
|
|
|
|
|
width="1100px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
|
|
<Cropper ref="cropper" |
|
|
|
:img-file.sync="file" |
|
|
|
:img-file.sync="file" |
|
|
|
:is-upload="isUpload" |
|
|
|
:is-upload="isUpload" |
|
|
|
:fixed="true" |
|
|
|
:fixed="true" |
|
|
@ -160,30 +178,53 @@ |
|
|
|
@upload="customUpload" /> |
|
|
|
@upload="customUpload" /> |
|
|
|
</el-dialog> |
|
|
|
</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"> |
|
|
|
<div class="plus"> |
|
|
|
<i class="el-icon-circle-plus-outline" @click="addClass"></i> |
|
|
|
<i class="el-icon-circle-plus-outline" |
|
|
|
|
|
|
|
@click="addClass"></i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="classifications" ref="table" header-align="center" row-key="id"> |
|
|
|
<el-table :data="classifications" |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
ref="table" |
|
|
|
<el-table-column prop="classificationName" label="分类名称" align="center" min-width="130"> |
|
|
|
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"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
<el-input v-if="scope.row.edit" |
|
|
|
v-if="scope.row.edit" |
|
|
|
|
|
|
|
placeholder="请输入分类名称" |
|
|
|
placeholder="请输入分类名称" |
|
|
|
v-model="scope.row.classificationName" |
|
|
|
v-model="scope.row.classificationName" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="30" |
|
|
|
maxlength="30"></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
<span v-else>{{ scope.row.classificationName }}</span> |
|
|
|
<span v-else>{{ scope.row.classificationName }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60">否</el-table-column> |
|
|
|
<el-table-column prop="updateTime1" |
|
|
|
<el-table-column label="操作" align="center" min-width="60"> |
|
|
|
label="是否引用" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="60">否</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="60"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitClass(scope.row)"></i> |
|
|
|
<i v-if="scope.row.edit" |
|
|
|
<i v-else class="el-icon-edit edit" @click="editClass(scope.row)"></i> |
|
|
|
class="el-icon-check edit" |
|
|
|
<i class="el-icon-delete del" @click="delClass(scope.row, scope.$index)"></i> |
|
|
|
@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> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -192,30 +233,53 @@ |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</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"> |
|
|
|
<div class="plus"> |
|
|
|
<i class="el-icon-circle-plus-outline" @click="addLabel"></i> |
|
|
|
<i class="el-icon-circle-plus-outline" |
|
|
|
|
|
|
|
@click="addLabel"></i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="labels" ref="table" header-align="center" row-key="id"> |
|
|
|
<el-table :data="labels" |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
|
|
|
ref="table" |
|
|
|
<el-table-column prop="labelName" label="主题名称" align="center" min-width="130"> |
|
|
|
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"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input |
|
|
|
<el-input v-if="scope.row.edit" |
|
|
|
v-if="scope.row.edit" |
|
|
|
|
|
|
|
placeholder="请输入主题名称" |
|
|
|
placeholder="请输入主题名称" |
|
|
|
v-model="scope.row.labelName" |
|
|
|
v-model="scope.row.labelName" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="30" |
|
|
|
maxlength="30"></el-input> |
|
|
|
></el-input> |
|
|
|
|
|
|
|
<span v-else>{{ scope.row.labelName }}</span> |
|
|
|
<span v-else>{{ scope.row.labelName }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60">否</el-table-column> |
|
|
|
<el-table-column prop="updateTime1" |
|
|
|
<el-table-column label="操作" align="center" min-width="60"> |
|
|
|
label="是否引用" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="60">否</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="60"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitLabel(scope.row)"></i> |
|
|
|
<i v-if="scope.row.edit" |
|
|
|
<i v-else class="el-icon-edit edit" @click="editLabel(scope.row)"></i> |
|
|
|
class="el-icon-check edit" |
|
|
|
<i class="el-icon-delete del" @click="delLabel(scope.row, scope.$index)"></i> |
|
|
|
@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> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -234,7 +298,7 @@ import editorConfig from '@/utils/editor' |
|
|
|
import Cropper from '@/components/img-upload/Cropper' |
|
|
|
import Cropper from '@/components/img-upload/Cropper' |
|
|
|
import Axios from 'axios' |
|
|
|
import Axios from 'axios' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
typeId: +this.$route.query.type, |
|
|
|
typeId: +this.$route.query.type, |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -253,7 +317,7 @@ export default { |
|
|
|
isRelease: 0, |
|
|
|
isRelease: 0, |
|
|
|
mainBody: '', |
|
|
|
mainBody: '', |
|
|
|
releaseTime: new Date(), |
|
|
|
releaseTime: new Date(), |
|
|
|
summary : '', |
|
|
|
summary: '', |
|
|
|
title: '', |
|
|
|
title: '', |
|
|
|
fileList: [], |
|
|
|
fileList: [], |
|
|
|
typeId: +this.$route.query.type |
|
|
|
typeId: +this.$route.query.type |
|
|
@ -297,14 +361,14 @@ export default { |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
handler(val){ |
|
|
|
handler (val) { |
|
|
|
this.updateTime++ |
|
|
|
this.updateTime++ |
|
|
|
}, |
|
|
|
}, |
|
|
|
deep:true |
|
|
|
deep: true |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 页面离开的时候如果没有保存则提示 |
|
|
|
// 页面离开的时候如果没有保存则提示 |
|
|
|
beforeRouteLeave(to, from, next) { |
|
|
|
beforeRouteLeave (to, from, next) { |
|
|
|
if (this.submiting) { |
|
|
|
if (this.submiting) { |
|
|
|
next() |
|
|
|
next() |
|
|
|
} else if (!this.pass) { |
|
|
|
} else if (!this.pass) { |
|
|
@ -325,23 +389,23 @@ export default { |
|
|
|
next() |
|
|
|
next() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.getArticle() |
|
|
|
this.getArticle() |
|
|
|
this.getLabel() |
|
|
|
this.getLabel() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 文章详情 |
|
|
|
// 文章详情 |
|
|
|
getArticle() { |
|
|
|
getArticle () { |
|
|
|
const { id } = this.form |
|
|
|
const { id } = this.form |
|
|
|
id ? this.$post(`${this.api.findByIdParnerArticle}?id=${id}`).then(({ data }) => { |
|
|
|
id ? this.$post(`${this.api.findByIdParnerArticle}?id=${id}`).then(({ data }) => { |
|
|
|
data.lableId = data.lableId ? data.lableId.split(',').map(e => +e) : [] |
|
|
|
data.lableId = data.lableId ? data.lableId.split(',').map(e => +e) : [] |
|
|
|
data.fileList.forEach(e => e.name = e.fileName) |
|
|
|
data.fileList.forEach(e => e.name = e.fileName) |
|
|
|
this.form = data |
|
|
|
this.form = data |
|
|
|
this.getClassification(1) |
|
|
|
this.getClassification(1) |
|
|
|
}).catch(err => {}) : this.getClassification(1) |
|
|
|
}).catch(err => { }) : this.getClassification(1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取所属分类 |
|
|
|
// 获取所属分类 |
|
|
|
getClassification(detail) { |
|
|
|
getClassification (detail) { |
|
|
|
this.$post(`${this.api.queryClassificationByType}?typeId=${this.typeId}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.queryClassificationByType}?typeId=${this.typeId}`).then(({ data }) => { |
|
|
|
this.classifications = data |
|
|
|
this.classifications = data |
|
|
|
// 如果所选分类被删除,则清空分类id |
|
|
|
// 如果所选分类被删除,则清空分类id |
|
|
@ -352,14 +416,14 @@ export default { |
|
|
|
this.updateTime = 0 |
|
|
|
this.updateTime = 0 |
|
|
|
}, 500) |
|
|
|
}, 500) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 显示所属分类弹框 |
|
|
|
// 显示所属分类弹框 |
|
|
|
setClass() { |
|
|
|
setClass () { |
|
|
|
this.classVisible = true |
|
|
|
this.classVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增所属分类 |
|
|
|
// 新增所属分类 |
|
|
|
addClass() { |
|
|
|
addClass () { |
|
|
|
this.classifications.push({ |
|
|
|
this.classifications.push({ |
|
|
|
edit: true, |
|
|
|
edit: true, |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
@ -367,11 +431,11 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑所属分类 |
|
|
|
// 编辑所属分类 |
|
|
|
editClass(row) { |
|
|
|
editClass (row) { |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除所属分类 |
|
|
|
// 删除所属分类 |
|
|
|
delClass(row, i) { |
|
|
|
delClass (row, i) { |
|
|
|
if (row.id) { |
|
|
|
if (row.id) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
@ -379,14 +443,14 @@ export default { |
|
|
|
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => { |
|
|
|
Util.successMsg('删除成功') |
|
|
|
Util.successMsg('删除成功') |
|
|
|
this.getClassification() |
|
|
|
this.getClassification() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.classifications.splice(i, 1) |
|
|
|
this.classifications.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交所属分类 |
|
|
|
// 提交所属分类 |
|
|
|
submitClass(row, showMsg = 1) { |
|
|
|
submitClass (row, showMsg = 1) { |
|
|
|
if (!row.classificationName) return Util.errorMsg('请输入分类名称') |
|
|
|
if (!row.classificationName) return Util.errorMsg('请输入分类名称') |
|
|
|
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=${this.typeId}&classificationId=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=${this.typeId}&classificationId=${row.id}`).then(res => { |
|
|
|
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], { |
|
|
|
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], { |
|
|
@ -396,11 +460,11 @@ export default { |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') |
|
|
|
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') |
|
|
|
this.getClassification() |
|
|
|
this.getClassification() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 关闭所属分类 |
|
|
|
// 关闭所属分类 |
|
|
|
closeClass() { |
|
|
|
closeClass () { |
|
|
|
const list = this.classifications |
|
|
|
const list = this.classifications |
|
|
|
if (list.find(e => e.edit && e.classificationName)) { |
|
|
|
if (list.find(e => e.edit && e.classificationName)) { |
|
|
|
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { |
|
|
|
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { |
|
|
@ -421,17 +485,17 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 获取标签 |
|
|
|
// 获取标签 |
|
|
|
getLabel() { |
|
|
|
getLabel () { |
|
|
|
this.$post(this.api.queryAllArticleSubjectTags).then(({ data }) => { |
|
|
|
this.$post(this.api.queryAllArticleSubjectTags).then(({ data }) => { |
|
|
|
this.labels = data |
|
|
|
this.labels = data |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 显示标签弹框 |
|
|
|
// 显示标签弹框 |
|
|
|
setLabel() { |
|
|
|
setLabel () { |
|
|
|
this.labelVisible = true |
|
|
|
this.labelVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增标签 |
|
|
|
// 新增标签 |
|
|
|
addLabel() { |
|
|
|
addLabel () { |
|
|
|
this.labels.push({ |
|
|
|
this.labels.push({ |
|
|
|
edit: true, |
|
|
|
edit: true, |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
@ -439,11 +503,11 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑标签 |
|
|
|
// 编辑标签 |
|
|
|
editLabel(row) { |
|
|
|
editLabel (row) { |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
this.$set(row, 'edit', 1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除标签 |
|
|
|
// 删除标签 |
|
|
|
delLabel(row, i) { |
|
|
|
delLabel (row, i) { |
|
|
|
if (row.id) { |
|
|
|
if (row.id) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
@ -451,14 +515,14 @@ export default { |
|
|
|
this.$post(`${this.api.batchDeletionParnerLabel}?ids=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.batchDeletionParnerLabel}?ids=${row.id}`).then(res => { |
|
|
|
Util.successMsg('删除成功') |
|
|
|
Util.successMsg('删除成功') |
|
|
|
this.getLabel() |
|
|
|
this.getLabel() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.labels.splice(i, 1) |
|
|
|
this.labels.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交标签 |
|
|
|
// 提交标签 |
|
|
|
submitLabel(row, showMsg = 1) { |
|
|
|
submitLabel (row, showMsg = 1) { |
|
|
|
if (!row.labelName) return Util.errorMsg('请输入主题名称') |
|
|
|
if (!row.labelName) return Util.errorMsg('请输入主题名称') |
|
|
|
this.$post(`${this.api.checkForHeavyParnerLabel}?labelName=${row.labelName}&labelId=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.checkForHeavyParnerLabel}?labelName=${row.labelName}&labelId=${row.id}`).then(res => { |
|
|
|
this.$post(this.api[row.id ? 'updateParnerLabel' : 'saveParnerLabel'], { |
|
|
|
this.$post(this.api[row.id ? 'updateParnerLabel' : 'saveParnerLabel'], { |
|
|
@ -467,11 +531,11 @@ export default { |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') |
|
|
|
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') |
|
|
|
this.getLabel() |
|
|
|
this.getLabel() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 关闭标签 |
|
|
|
// 关闭标签 |
|
|
|
closeLabel() { |
|
|
|
closeLabel () { |
|
|
|
const list = this.labels |
|
|
|
const list = this.labels |
|
|
|
if (list.find(e => e.edit && e.labelName)) { |
|
|
|
if (list.find(e => e.edit && e.labelName)) { |
|
|
|
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { |
|
|
|
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { |
|
|
@ -490,9 +554,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 文章名称判重 |
|
|
|
// 文章名称判重 |
|
|
|
nameChange(){ |
|
|
|
nameChange () { |
|
|
|
const { title, id } = this.form |
|
|
|
const { title, id } = this.form |
|
|
|
if(title && title !== this.originalName){ |
|
|
|
if (title && title !== this.originalName) { |
|
|
|
this.$post(this.api.checkIfTheTitleIsRepeat, { |
|
|
|
this.$post(this.api.checkIfTheTitleIsRepeat, { |
|
|
|
typeId: this.typeId, |
|
|
|
typeId: this.typeId, |
|
|
|
title, |
|
|
|
title, |
|
|
@ -502,18 +566,18 @@ export default { |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
this.nameRepeat = true |
|
|
|
this.nameRepeat = true |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.nameRepeat = false |
|
|
|
this.nameRepeat = false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 图片裁剪上传事件 |
|
|
|
// 图片裁剪上传事件 |
|
|
|
customUpload(data) { |
|
|
|
customUpload (data) { |
|
|
|
const formData = new FormData() |
|
|
|
const formData = new FormData() |
|
|
|
formData.append('file', data, this.file.name) |
|
|
|
formData.append('file', data, this.file.name) |
|
|
|
this.imgUpload(formData) |
|
|
|
this.imgUpload(formData) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 压缩图片 |
|
|
|
// 压缩图片 |
|
|
|
compress(img) { |
|
|
|
compress (img) { |
|
|
|
const canvas = document.createElement('canvas') |
|
|
|
const canvas = document.createElement('canvas') |
|
|
|
const ctx = canvas.getContext('2d') |
|
|
|
const ctx = canvas.getContext('2d') |
|
|
|
// let initSize = img.src.length; |
|
|
|
// let initSize = img.src.length; |
|
|
@ -530,7 +594,7 @@ export default { |
|
|
|
return ndata |
|
|
|
return ndata |
|
|
|
}, |
|
|
|
}, |
|
|
|
// base64转成bolb对象 |
|
|
|
// base64转成bolb对象 |
|
|
|
dataURItoBlob(base64Data) { |
|
|
|
dataURItoBlob (base64Data) { |
|
|
|
let byteString |
|
|
|
let byteString |
|
|
|
if (base64Data.split(',')[0].indexOf('base64') >= 0) { |
|
|
|
if (base64Data.split(',')[0].indexOf('base64') >= 0) { |
|
|
|
byteString = atob(base64Data.split(',')[1]) |
|
|
|
byteString = atob(base64Data.split(',')[1]) |
|
|
@ -550,7 +614,7 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 图片上传到服务器 |
|
|
|
// 图片上传到服务器 |
|
|
|
imgUpload(formData) { |
|
|
|
imgUpload (formData) { |
|
|
|
this.isUpload = true |
|
|
|
this.isUpload = true |
|
|
|
Axios({ |
|
|
|
Axios({ |
|
|
|
method: 'post', |
|
|
|
method: 'post', |
|
|
@ -562,13 +626,13 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.form.bannerImg = data.filesResult.fileUrl |
|
|
|
this.form.bannerImg = data.filesResult.fileUrl |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
this.$refs.cropper.isDisabled = false |
|
|
|
this.$refs.cropper.isDisabled = false |
|
|
|
this.isUpload = false |
|
|
|
this.isUpload = false |
|
|
|
this.cropperModel = false |
|
|
|
this.cropperModel = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 图片改变钩子 |
|
|
|
// 图片改变钩子 |
|
|
|
changeFile(file) { |
|
|
|
changeFile (file) { |
|
|
|
const { size, name } = file |
|
|
|
const { size, name } = file |
|
|
|
const ext = name.substring(name.lastIndexOf('.') + 1) |
|
|
|
const ext = name.substring(name.lastIndexOf('.') + 1) |
|
|
|
if (!Util.isImg(ext)) { |
|
|
|
if (!Util.isImg(ext)) { |
|
|
@ -589,23 +653,23 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 附件删除 |
|
|
|
// 附件删除 |
|
|
|
handleRemove(e, fileList) { |
|
|
|
handleRemove (e, fileList) { |
|
|
|
e.id ? this.$post(`${this.api.batchDeletionParnerFile}?ids=${e.id}`).then(res => { |
|
|
|
e.id ? this.$post(`${this.api.batchDeletionParnerFile}?ids=${e.id}`).then(res => { |
|
|
|
this.form.fileList = fileList |
|
|
|
this.form.fileList = fileList |
|
|
|
}).catch(res => {}) : (this.form.fileList = fileList) |
|
|
|
}).catch(res => { }) : (this.form.fileList = fileList) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// banner上传成功 |
|
|
|
// banner上传成功 |
|
|
|
uploadSuccessBanner(res) { |
|
|
|
uploadSuccessBanner (res) { |
|
|
|
let url = this.form.bannerImg |
|
|
|
let url = this.form.bannerImg |
|
|
|
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => {}).catch(e => {}) |
|
|
|
url && this.$del(this.api.delFile, [url.split('/').pop()]).then(res => { }).catch(e => { }) |
|
|
|
this.form.bannerImg = res.url |
|
|
|
this.form.bannerImg = res.url |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 附件上传之前的钩子 |
|
|
|
// 附件上传之前的钩子 |
|
|
|
fileBeforeUpload(file) { |
|
|
|
fileBeforeUpload (file) { |
|
|
|
this.uploading++ |
|
|
|
this.uploading++ |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 附件上传成功 |
|
|
|
// 附件上传成功 |
|
|
|
uploadSuccessFile(res) { |
|
|
|
uploadSuccessFile (res) { |
|
|
|
const { originalFileName, fileUrl } = res.filesResult |
|
|
|
const { originalFileName, fileUrl } = res.filesResult |
|
|
|
this.uploading-- |
|
|
|
this.uploading-- |
|
|
|
this.form.id ? |
|
|
|
this.form.id ? |
|
|
@ -622,7 +686,7 @@ export default { |
|
|
|
url: fileUrl, |
|
|
|
url: fileUrl, |
|
|
|
id: data |
|
|
|
id: data |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(res => {}) : |
|
|
|
}).catch(res => { }) : |
|
|
|
this.form.fileList.push({ |
|
|
|
this.form.fileList.push({ |
|
|
|
fileName: originalFileName, |
|
|
|
fileName: originalFileName, |
|
|
|
filePath: fileUrl, |
|
|
|
filePath: fileUrl, |
|
|
@ -631,11 +695,11 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 预览 |
|
|
|
// 预览 |
|
|
|
preview() { |
|
|
|
preview () { |
|
|
|
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`) |
|
|
|
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${this.form.id}&siteId=${this.form.siteId}&id=${this.form.columnId}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 返回 |
|
|
|
// 返回 |
|
|
|
back() { |
|
|
|
back () { |
|
|
|
this.pass = true |
|
|
|
this.pass = true |
|
|
|
// 更改了信息才需要提示 |
|
|
|
// 更改了信息才需要提示 |
|
|
|
if (this.updateTime) { |
|
|
|
if (this.updateTime) { |
|
|
@ -651,17 +715,17 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
submit(isRelease, next) { |
|
|
|
submit (isRelease, next) { |
|
|
|
if (this.submiting) return false |
|
|
|
if (this.submiting) return false |
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
console.log('form=>',form) |
|
|
|
console.log('form=>', form) |
|
|
|
if (!form.title) return Util.errorMsg('请填写标题') |
|
|
|
if (!form.title) return Util.errorMsg('请填写标题') |
|
|
|
if (this.nameRepeat) return Util.errorMsg('该标题已重复!') |
|
|
|
if (this.nameRepeat) return Util.errorMsg('该标题已重复!') |
|
|
|
// 如果是发布 |
|
|
|
// 如果是发布 |
|
|
|
if (isRelease) { |
|
|
|
if (isRelease) { |
|
|
|
if (!form.releaseTime) return Util.errorMsg('请选择发布日期') |
|
|
|
if (!form.releaseTime) return Util.errorMsg('请选择发布日期') |
|
|
|
if (!form.classificationId) return Util.errorMsg('请选择所属分类') |
|
|
|
if (!form.classificationId) return Util.errorMsg('请选择所属分类') |
|
|
|
if (!form.bannerImg ) return Util.errorMsg('请上传封面') |
|
|
|
if (!form.bannerImg) return Util.errorMsg('请上传封面') |
|
|
|
if (!form.mainBody) return Util.errorMsg('请输入正文') |
|
|
|
if (!form.mainBody) return Util.errorMsg('请输入正文') |
|
|
|
} |
|
|
|
} |
|
|
|
// if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布') |
|
|
|
// if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布') |
|
|
@ -701,7 +765,7 @@ $upload-lg-height: 102px; |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
width: $upload-width; |
|
|
|
width: $upload-width; |
|
|
|
height: $upload-height; |
|
|
|
height: $upload-height; |
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
border: 1px solid #dcdee0; |
|
|
|
border-radius: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
overflow: hidden; |
|
|
|
overflow: hidden; |
|
|
@ -712,7 +776,7 @@ $upload-lg-height: 102px; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
background: #FAFAFA; |
|
|
|
background: #fafafa; |
|
|
|
p { |
|
|
|
p { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
@ -769,7 +833,7 @@ $upload-lg-height: 102px; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
&:hover .review { |
|
|
|
&:hover .review { |
|
|
|
border-color: #9278FF; |
|
|
|
border-color: #9278ff; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.review { |
|
|
|
.review { |
|
|
@ -779,7 +843,7 @@ $upload-lg-height: 102px; |
|
|
|
width: 170px; |
|
|
|
width: 170px; |
|
|
|
height: 112px; |
|
|
|
height: 112px; |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
border: 1px solid #dcdee0; |
|
|
|
border-radius: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
img { |
|
|
|
img { |
|
|
|
width: 80px; |
|
|
|
width: 80px; |
|
|
@ -798,7 +862,7 @@ $upload-lg-height: 102px; |
|
|
|
.plus { |
|
|
|
.plus { |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
|
color: #9278FF; |
|
|
|
color: #9278ff; |
|
|
|
text-align: right; |
|
|
|
text-align: right; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
@ -806,7 +870,8 @@ $upload-lg-height: 102px; |
|
|
|
margin-left: 10px !important; |
|
|
|
margin-left: 10px !important; |
|
|
|
} |
|
|
|
} |
|
|
|
.manage-dia { |
|
|
|
.manage-dia { |
|
|
|
.edit, .del { |
|
|
|
.edit, |
|
|
|
|
|
|
|
.del { |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
@ -834,12 +899,13 @@ $upload-lg-height: 102px; |
|
|
|
} |
|
|
|
} |
|
|
|
.line { |
|
|
|
.line { |
|
|
|
margin-bottom: 24px; |
|
|
|
margin-bottom: 24px; |
|
|
|
border-bottom: 1px dashed #C2C2C2; |
|
|
|
border-bottom: 1px dashed #c2c2c2; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-form-item--small.el-form-item { |
|
|
|
.el-form-item--small.el-form-item { |
|
|
|
margin-bottom: 24px; |
|
|
|
margin-bottom: 24px; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-input, .el-select { |
|
|
|
.el-input, |
|
|
|
|
|
|
|
.el-select { |
|
|
|
width: 300px; |
|
|
|
width: 300px; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-select .el-input { |
|
|
|
.el-select .el-input { |
|
|
@ -848,13 +914,14 @@ $upload-lg-height: 102px; |
|
|
|
.el-textarea { |
|
|
|
.el-textarea { |
|
|
|
width: 550px; |
|
|
|
width: 550px; |
|
|
|
} |
|
|
|
} |
|
|
|
.auto, .auto .el-input { |
|
|
|
.auto, |
|
|
|
|
|
|
|
.auto .el-input { |
|
|
|
width: auto; |
|
|
|
width: auto; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before { |
|
|
|
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before { |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
|
vertical-align: -4px; |
|
|
|
vertical-align: -4px; |
|
|
|
color: #F5222D; |
|
|
|
color: #f5222d; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.btns { |
|
|
|
.btns { |
|
|
|