出版物字段添加

master
yujialong 2 years ago
parent 16f44661fe
commit d94596c3f9
  1. BIN
      src/assets/images/style/44.png
  2. BIN
      src/assets/images/style/45.png
  3. BIN
      src/assets/images/style/46.png
  4. BIN
      src/assets/images/style/47.png
  5. BIN
      src/assets/images/style/48.png
  6. 11
      src/const/column.js
  7. 655
      src/pages/article/add/index.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 477 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

@ -87,4 +87,15 @@ export default {
name: '产品资料和其它'
}
],
// 专利类别
patentClasses: [
{
id: 1,
name: '发明专利'
},
{
id: 2,
name: '实用外观'
}
]
}

@ -58,9 +58,100 @@
</el-date-picker>
</el-form-item>
</div>
<template v-if="form.articleTemplate === 26">
<!-- 专利 -->
<template v-if="isPatent">
<div class="item-line">
<el-form-item prop="doi" label="DOI">
<el-form-item prop="patentClassId" label="专利类别">
<el-select v-model="form.patentClassId" clearable>
<template v-for="item in patentClasses">
<el-option
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</template>
</el-select>
</el-form-item>
<el-form-item prop="applicationNumber" label="申请号">
<el-input
placeholder="请输入申请号"
v-model.trim="form.applicationNumber"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
</div>
<div class="item-line">
<el-form-item prop="applicationDate" label="申请日期">
<el-date-picker
v-model="form.applicationDate"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
:clearable="false"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
<el-form-item prop="dateOfAuthorization" label="授权日期">
<el-date-picker
v-model="form.dateOfAuthorization"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
:clearable="false"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</div>
<el-form-item prop="inventor" label="发明人">
<el-input
style="width: 940px"
type="textarea"
v-model="form.inventor"
:rows="3"
></el-input>
</el-form-item>
</template>
<!-- 专著 -->
<template v-if="isMonograph">
<div class="item-line">
<el-form-item prop="publishingHouse" label="出版社">
<el-input
placeholder="请输入出版社"
v-model.trim="form.publishingHouse"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="writersAndEditors" label="编写人员">
<el-input
placeholder="请输入编写人员"
v-model.trim="form.writersAndEditors"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
</div>
<div class="item-line">
<el-form-item prop="publicationYear" label="出版时间">
<el-date-picker
style="width: 300px"
v-model="form.publicationYear"
type="year"
placeholder="请选择出版时间"
format="yyyy"
value-format="yyyy">
</el-date-picker>
</el-form-item>
</div>
</template>
<!-- 期刊详情 or 论文 -->
<template v-if="form.articleTemplate === 26 || isThesis">
<div class="item-line">
<el-form-item v-if="!isThesis" prop="doi" label="DOI">
<el-input
placeholder="请输入DOI"
v-model.trim="form.doi"
@ -69,21 +160,21 @@
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="publicationYear" label="出版年份">
<el-form-item prop="publicationYear" :label="isThesis ? '发表年度' : '出版年份'">
<el-date-picker
style="width: 300px"
v-model="form.publicationYear"
type="year"
placeholder="请选择出版年份"
:placeholder="'请选择' + (isThesis ? '发表年度' : '出版年份')"
format="yyyy"
value-format="yyyy">
</el-date-picker>
</el-form-item>
</div>
<div class="item-line">
<el-form-item prop="periodicalName" label="刊物名称">
<el-form-item prop="periodicalName" :label="isThesis ? '期刊名称' : '刊物名称'">
<el-input
placeholder="请输入刊物名称"
:placeholder="'请输入' + (isThesis ? '期刊名称' : '刊物名称')"
v-model="form.periodicalName"
clearable
maxlength="50"
@ -120,7 +211,8 @@
></el-input>
</el-form-item>
</template>
<div v-else class="item-line">
<!-- 非出版物的才显示下面字段 -->
<div v-else-if="!isPublication" class="item-line">
<el-form-item prop="source" label="来源">
<el-input
placeholder="请输入来源"
@ -151,53 +243,97 @@
></el-input>
</el-form-item>
</div>
<div v-if="form.articleTemplate === 25" class="item-line">
<el-form-item prop="lectureSeries" label="演讲系列">
<el-input
placeholder="请输入演讲系列"
v-model.trim="form.lectureSeries"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="onlineLocation" label="线上地点">
<el-input
placeholder="请输入线上地点"
v-model.trim="form.onlineLocation"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
</div>
<div v-if="form.articleTemplate === 22 || form.articleTemplate === 23" class="item-line">
<el-form-item prop="edit" label="编辑">
<el-input
placeholder="请输入编辑"
v-model.trim="form.edit"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="audit" label="审核">
<el-input
placeholder="请输入审核"
v-model.trim="form.audit"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
</div>
<template v-if="form.articleTemplate === 25">
<div class="item-line">
<el-form-item prop="classificationId" label="所属分类">
<template v-if="!isPublication">
<div v-if="form.articleTemplate === 25" class="item-line">
<el-form-item prop="lectureSeries" label="演讲系列">
<el-input
placeholder="请输入演讲系列"
v-model.trim="form.lectureSeries"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="onlineLocation" label="线上地点">
<el-input
placeholder="请输入线上地点"
v-model.trim="form.onlineLocation"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
</div>
<div v-if="form.articleTemplate === 22 || form.articleTemplate === 23" class="item-line">
<el-form-item prop="edit" label="编辑">
<el-input
placeholder="请输入编辑"
v-model.trim="form.edit"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="audit" label="审核">
<el-input
placeholder="请输入审核"
v-model.trim="form.audit"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
</div>
<template v-if="form.articleTemplate === 25">
<div class="item-line">
<el-form-item prop="classificationId" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId" clearable>
<template v-for="item in classifications">
<el-option
v-if="item.classificationName"
: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-form-item>
<el-form-item prop="offlineLocation" label="线下地点">
<el-input
placeholder="请输入线下地点"
v-model="form.offlineLocation"
clearable
maxlength="100"
></el-input>
</el-form-item>
</div>
<el-form-item prop="keynoteSpeaker" label="主讲人">
<el-input
style="width: 940px"
placeholder="请输入主讲人"
v-model="form.keynoteSpeaker"
clearable
maxlength="100"
></el-input>
</el-form-item>
<el-form-item prop="eventProfile" label="活动简介">
<el-input
style="width: 940px"
placeholder="请输入活动简介"
v-model="form.eventProfile"
type="textarea"
clearable
></el-input>
</el-form-item>
</template>
<div v-if="form.articleTemplate === 22 || form.articleTemplate === 23" class="item-line">
<el-form-item prop="source" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId" clearable>
<template v-for="item in classifications">
<el-option
v-if="item.classificationName"
v-if="item.id"
:key="item.id"
:label="item.classificationName"
:value="item.id">
@ -206,226 +342,184 @@
</el-select>
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button>
</el-form-item>
<el-form-item prop="offlineLocation" label="线下地点">
<el-input
placeholder="请输入线下地点"
v-model="form.offlineLocation"
clearable
maxlength="100"
></el-input>
<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"
: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-form-item>
</div>
<el-form-item prop="keynoteSpeaker" label="主讲人">
<el-input
style="width: 940px"
placeholder="请输入主讲人"
v-model="form.keynoteSpeaker"
clearable
maxlength="100"
></el-input>
</el-form-item>
<el-form-item prop="eventProfile" label="活动简介">
<el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 23" prop="summary" label="摘要">
<el-input
style="width: 940px"
placeholder="请输入活动简介"
v-model="form.eventProfile"
type="textarea"
v-model.trim="form.summary"
:rows="3"
clearable
></el-input>
</el-form-item>
</template>
<div v-if="form.articleTemplate === 22 || form.articleTemplate === 23" class="item-line">
<el-form-item prop="source" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId" clearable>
<template v-for="item in classifications">
<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-form-item prop="titleImg" :label="form.articleTemplate === 25 ? '标题图' : '封面图'">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-change="file => changeFile(file, 0)"
:show-file-list="false"
:action="this.api.upload"
:auto-upload="false"
>
<img v-if="form.titleImg" :src="form.titleImg" class="avatar">
<div class="uploader-default" v-else>
<img class="plus" src="@/assets/images/plus.png" alt="">
<p>点击上传</p>
</div>
</el-upload>
</el-form-item>
<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"
: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-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 25" prop="bannerImg" label="Banner图(选填)" style="flex: 1;">
<el-upload
class="avatar-uploader avatar-uploader-lg"
accept=".jpg,.png,.jpeg,.gif"
:on-change="file => changeFile(file, 1)"
:show-file-list="false"
:action="this.api.upload"
:auto-upload="false"
>
<img v-if="form.bannerImg" :src="form.bannerImg" class="avatar-lg">
<div class="uploader-default" v-else>
<img class="plus" src="@/assets/images/plus.png" alt="">
<p>点击上传</p>
</div>
</el-upload>
</el-form-item>
</div>
<el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 23" prop="summary" label="摘要">
<el-input
style="width: 940px"
type="textarea"
v-model.trim="form.summary"
:rows="3"
clearable
></el-input>
</el-form-item>
<el-form-item prop="titleImg" :label="form.articleTemplate === 25 ? '标题图' : '封面图'">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-change="file => changeFile(file, 0)"
:show-file-list="false"
:action="this.api.upload"
:auto-upload="false"
>
<img v-if="form.titleImg" :src="form.titleImg" class="avatar">
<div class="uploader-default" v-else>
<img class="plus" src="@/assets/images/plus.png" alt="">
<p>点击上传</p>
</div>
</el-upload>
</el-form-item>
<el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 25" prop="bannerImg" label="Banner图(选填)" style="flex: 1;">
<el-upload
class="avatar-uploader avatar-uploader-lg"
accept=".jpg,.png,.jpeg,.gif"
:on-change="file => changeFile(file, 1)"
:show-file-list="false"
:action="this.api.upload"
:auto-upload="false"
>
<img v-if="form.bannerImg" :src="form.bannerImg" class="avatar-lg">
<div class="uploader-default" v-else>
<img class="plus" src="@/assets/images/plus.png" alt="">
<p>点击上传</p>
</div>
</el-upload>
</el-form-item>
<el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 23 || form.articleTemplate === 25" prop="mainBody" label="正文">
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" />
</el-form-item>
<template v-if="form.articleTemplate === 26">
<el-form-item prop="publicationTypeId" label="出版物类型">
<el-select style="width: 234px;" v-model="form.publicationTypeId">
<template v-for="item in publicationTypes">
<el-option
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</template>
</el-select>
</el-form-item>
<el-form-item prop="quote" label="引用">
<el-input
style="width: 940px"
type="textarea"
v-model="form.quote"
:rows="3"
></el-input>
</el-form-item>
<el-form-item prop="articleKeyWord" label="关键字">
<el-input
style="width: 940px"
v-model="form.articleKeyWord"
></el-input>
</el-form-item>
<el-form-item prop="mainBody" label="摘要">
<el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 23 || form.articleTemplate === 25" prop="mainBody" label="正文">
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" />
</el-form-item>
</template>
<el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 23 || form.articleTemplate === 25" prop="file" label="文件上传">
<el-upload
:before-upload="fileBeforeUpload"
:on-remove="handleRemove"
:on-success="uploadSuccessFile"
:action="this.api.upload"
:file-list="form.fileList"
:headers="headers"
:data="{
quote: form.title,
site: site.siteName,
uploader: userName
}"
>
<el-button>上传</el-button>
</el-upload>
</el-form-item>
<template v-if="form.articleTemplate === 24">
<el-form-item prop="connectionType" label="连接类型">
<el-radio-group v-model="form.connectionType">
<el-radio :label="1">站内链接</el-radio>
<el-radio :label="2">站外链接</el-radio>
<el-radio :label="3">其他站点链接</el-radio>
</el-radio-group>
</el-form-item>
<template v-if="form.connectionType === 1">
<el-form-item label="站内链接">
<el-cascader
v-model="links"
:options="columns"
:props="columnProps"
clearable
@change="getArticle"></el-cascader>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="article" clearable>
<el-option
v-for="item in articles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
<template v-if="form.articleTemplate === 26">
<el-form-item prop="publicationTypeId" label="出版物类型">
<el-select style="width: 234px;" v-model="form.publicationTypeId">
<template v-for="item in publicationTypes">
<el-option
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</template>
</el-select>
</el-form-item>
<el-form-item prop="quote" label="引用">
<el-input
style="width: 940px"
type="textarea"
v-model="form.quote"
:rows="3"
></el-input>
</el-form-item>
<el-form-item prop="articleKeyWord" label="关键字">
<el-input
style="width: 940px"
v-model="form.articleKeyWord"
></el-input>
</el-form-item>
<el-form-item prop="mainBody" label="摘要">
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" />
</el-form-item>
</template>
<el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接">
<el-input
placeholder="请输入站外链接"
v-model.trim="form.linkAddress"
clearable
></el-input>
<el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 23 || form.articleTemplate === 25" prop="file" label="文件上传">
<el-upload
:before-upload="fileBeforeUpload"
:on-remove="handleRemove"
:on-success="uploadSuccessFile"
:action="this.api.upload"
:file-list="form.fileList"
:headers="headers"
:data="{
quote: form.title,
site: site.siteName,
uploader: userName
}"
>
<el-button>上传</el-button>
</el-upload>
</el-form-item>
<template v-if="form.connectionType === 3">
<el-form-item prop="siteSelection" label="站点选择">
<el-select v-model="form.siteSelection" @change="getOtherColumn">
<el-option
v-for="item in sites"
:key="item.id"
:label="item.siteName"
:value="item.id">
</el-option>
</el-select>
<template v-if="form.articleTemplate === 24">
<el-form-item prop="connectionType" label="连接类型">
<el-radio-group v-model="form.connectionType">
<el-radio :label="1">站内链接</el-radio>
<el-radio :label="2">站外链接</el-radio>
<el-radio :label="3">其他站点链接</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="栏目">
<el-cascader
v-model="otherLink"
:options="otherColumns"
:props="columnProps"
<template v-if="form.connectionType === 1">
<el-form-item label="站内链接">
<el-cascader
v-model="links"
:options="columns"
:props="columnProps"
clearable
@change="getArticle"></el-cascader>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="article" clearable>
<el-option
v-for="item in articles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接">
<el-input
placeholder="请输入站外链接"
v-model.trim="form.linkAddress"
clearable
@change="getArticle"></el-cascader>
></el-input>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="otherArticle" clearable>
<el-option
v-for="item in otherArticles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
<template v-if="form.connectionType === 3">
<el-form-item prop="siteSelection" label="站点选择">
<el-select v-model="form.siteSelection" @change="getOtherColumn">
<el-option
v-for="item in sites"
:key="item.id"
:label="item.siteName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="栏目">
<el-cascader
v-model="otherLink"
:options="otherColumns"
:props="columnProps"
clearable
@change="getArticle"></el-cascader>
</el-form-item>
<el-form-item label="文章">
<el-select v-model="otherArticle" clearable>
<el-option
v-for="item in otherArticles"
:key="item.id"
:label="item.title"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</template>
<el-form-item prop="isOpen" label="新窗口打开">
<el-switch
v-model="form.isOpen"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</template>
<el-form-item prop="isOpen" label="新窗口打开">
<el-switch
v-model="form.isOpen"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</template>
</el-form>
<div class="btns">
@ -525,6 +619,7 @@ export default {
site: this.$store.state.content.site,
userId: this.$store.state.user.userId,
publicationTypes: ColumnConst.publicationTypes,
patentClasses: ColumnConst.patentClasses,
headers: {
token: Util.local.get(Setting.tokenKey)
},
@ -586,7 +681,16 @@ export default {
linkAddress: '',
siteSelection: '',
fileList: [],
isOpen: 1
isOpen: 1,
patentClassId: '',
patentName: '',
writersAndEditors: '',
inventor: '',
famousWorks: '',
applicationNumber: '',
applicationDate: '',
dateOfAuthorization: '',
publishingHouse: ''
},
rules: {
title: [
@ -648,7 +752,23 @@ export default {
]),
...mapState('content', [
'column'
])
]),
//
isPublication() {
return this.columnInfo.templateId === 11
},
//
isThesis() {
return this.columnInfo.listStyleId === 46
},
//
isPatent() {
return this.columnInfo.listStyleId === 44
},
//
isMonograph() {
return this.columnInfo.listStyleId === 45
},
},
components: {
Editor,
@ -1246,23 +1366,26 @@ export default {
if (tId !== 25) {
if (!form.releaseTime) return Util.errorMsg('请选择发布日期')
}
if (tId === 22 || tId === 23 || tId === 24) {
if (!form.titleImg ) return Util.errorMsg('请上传封面')
}
if (tId === 25) {
if ((!form.time || !form.time.length) && isRelease) return Util.errorMsg('请选择起止时间')
form.activityStartTime = form.time[0]
form.activityEndTime = form.time[1]
}
if (tId === 24 && form.connectionType !== 2) {
if (form.connectionType === 1) {
if (!this.links.length) return Util.errorMsg('请选择站内链接')
//
if (!this.isPublication) {
if (tId === 22 || tId === 23 || tId === 24) {
if (!form.titleImg ) return Util.errorMsg('请上传封面')
}
if (!this.otherLink.length && form.connectionType === 3) {
if (!this.otherLink.length) return Util.errorMsg('请选择栏目')
if (tId === 25) {
if ((!form.time || !form.time.length) && isRelease) return Util.errorMsg('请选择起止时间')
form.activityStartTime = form.time[0]
form.activityEndTime = form.time[1]
}
if (tId === 24 && form.connectionType !== 2) {
if (form.connectionType === 1) {
if (!this.links.length) return Util.errorMsg('请选择站内链接')
}
if (!this.otherLink.length && form.connectionType === 3) {
if (!this.otherLink.length) return Util.errorMsg('请选择栏目')
}
}
if ((tId === 22 || tId === 23 || tId === 25) && !form.mainBody) return Util.errorMsg('请输入正文')
}
if ((tId === 22 || tId === 23 || tId === 25) && !form.mainBody) return Util.errorMsg('请输入正文')
}
if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布')
if (form.connectionType === 1) {

Loading…
Cancel
Save