update 动态消息
This commit is contained in:
@@ -68,6 +68,13 @@ const addOverseasStandard = (params) => postAction('/laws/standard/overseas/comm
|
|||||||
// 海外标准-编辑标准
|
// 海外标准-编辑标准
|
||||||
const editOverseasStandard = (params) => postAction('/laws/standard/overseas/commonEdit', params)
|
const editOverseasStandard = (params) => postAction('/laws/standard/overseas/commonEdit', params)
|
||||||
|
|
||||||
|
// 动态消息-保存
|
||||||
|
const saveDynamicMessage = (params) => postAction('/laws/standard/lawsNewsFeed/save', params)
|
||||||
|
// 动态消息-发布
|
||||||
|
const releaseDynamicMessage = (params) => postAction('/laws/standard/lawsNewsFeed/release', params)
|
||||||
|
// 动态消息-通过id查询
|
||||||
|
const getDynamicMessageById = (params) => getAction('/laws/standard/lawsNewsFeed/queryById', params)
|
||||||
|
|
||||||
export {
|
export {
|
||||||
// 国内标准
|
// 国内标准
|
||||||
getDomesticStandardSearchForm,
|
getDomesticStandardSearchForm,
|
||||||
@@ -104,5 +111,10 @@ export {
|
|||||||
configOverseasStandard,
|
configOverseasStandard,
|
||||||
removeOverseasStandard,
|
removeOverseasStandard,
|
||||||
addOverseasStandard,
|
addOverseasStandard,
|
||||||
editOverseasStandard
|
editOverseasStandard,
|
||||||
|
|
||||||
|
// 动态消息
|
||||||
|
saveDynamicMessage,
|
||||||
|
releaseDynamicMessage,
|
||||||
|
getDynamicMessageById
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 306 KiB |
@@ -42,6 +42,9 @@ module.exports = {
|
|||||||
dynamicHeading: 'Dynamic heading',
|
dynamicHeading: 'Dynamic heading',
|
||||||
dynamicCataloging: 'Dynamic cataloging',
|
dynamicCataloging: 'Dynamic cataloging',
|
||||||
releaseStatus: 'Release status',
|
releaseStatus: 'Release status',
|
||||||
releaseTime: 'Release time'
|
releaseTime: 'Release time',
|
||||||
|
pushRange: 'Push range',
|
||||||
|
dynamicDetails: 'Dynamic details',
|
||||||
|
dataText: 'Data text'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ module.exports = {
|
|||||||
dynamicHeading: '动态标题',
|
dynamicHeading: '动态标题',
|
||||||
dynamicCataloging: '动态分类',
|
dynamicCataloging: '动态分类',
|
||||||
releaseStatus: '发布状态',
|
releaseStatus: '发布状态',
|
||||||
releaseTime: '发布时间'
|
releaseTime: '发布时间',
|
||||||
|
pushRange: '推送范围',
|
||||||
|
dynamicDetails: '动态详情',
|
||||||
|
dataText: '资料文本'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,9 @@ export default {
|
|||||||
this.initFileList(val)
|
this.initFileList(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
fileType () {
|
||||||
|
this.fileTypes = this.fileType
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -309,6 +312,7 @@ export default {
|
|||||||
file.uploadGoOn = false
|
file.uploadGoOn = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
console.log(this.fileType)
|
||||||
// 不等于全部类型可以上传的时候,对上传的文件进行判断
|
// 不等于全部类型可以上传的时候,对上传的文件进行判断
|
||||||
if (this.fileType !== FILE_TYPE_ALL) {
|
if (this.fileType !== FILE_TYPE_ALL) {
|
||||||
// filter(tt => fileType.indexOf(tt) > -1) 判断用户传的文件类型,和要求传的文件类型是否一致
|
// filter(tt => fileType.indexOf(tt) > -1) 判断用户传的文件类型,和要求传的文件类型是否一致
|
||||||
|
|||||||
@@ -57,3 +57,15 @@ export const StandardSource = {
|
|||||||
OVERSEAS: { text: '国外', value: '2' },
|
OVERSEAS: { text: '国外', value: '2' },
|
||||||
ENTERPRISE: { text: '企标', value: '3' }
|
ENTERPRISE: { text: '企标', value: '3' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 动态分类
|
||||||
|
export const DynamicCataloging = {
|
||||||
|
WEEKLY_NEWSPAPER: { text: '周报', value: '1' },
|
||||||
|
MONTHLY_MAGAZINE: { text: '月报', value: '2' },
|
||||||
|
NOTIFICATION: { text: '通知', value: '3' },
|
||||||
|
IMPLEMENTATION_OF_EARLY_WARNING: { text: '实施预警', value: '4' },
|
||||||
|
SHARE: { text: '分享', value: '5' },
|
||||||
|
DOMESTIC_DYNAMICS: { text: '国内动态', value: '6' },
|
||||||
|
FOREIGN_TRENDS: { text: '国外动态', value: '7' },
|
||||||
|
OTHER: { text: '其他', value: '8' }
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<template>
|
||||||
|
<internal-detail-page :title="$t('standardRegulationLibrary.dynamicMessage.dynamicDetails')" :loading="loading" :content-padding="0">
|
||||||
|
<div class="page-title-img">
|
||||||
|
<img src="../../../assets/image/dynamicMessageDetailBg.png" alt="" />
|
||||||
|
</div>
|
||||||
|
<div class="detail-content">
|
||||||
|
<div class="detail-title">
|
||||||
|
【{{ $t('standardRegulationLibrary.dynamicMessage.dynamicDetails') }}】{{ detailData.dynamicHeading }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</internal-detail-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import InternalDetailPage from '../../../components/InternalDetailPage.vue'
|
||||||
|
import { getDynamicMessageById } from '../../../api/standardRegulationLibraryApi.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DynamicMessageDetail',
|
||||||
|
components: { InternalDetailPage },
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
detailData: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.initData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initData () {
|
||||||
|
getDynamicMessageById({ id: this.$route.query.id }).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.detailData = Object.assign({}, res.result || {})
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.page-title-img {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-content {
|
||||||
|
margin: 0 230px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-title {
|
||||||
|
margin-top: 30px;
|
||||||
|
font-size: 22px;
|
||||||
|
font-family: PingFang SC-Semibold, PingFang SC, sans-serif;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1D2129;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,323 @@
|
|||||||
|
<template>
|
||||||
|
<internal-detail-page :title="$route.query.title" :content-padding="0" :loading="loading">
|
||||||
|
<a-form :form="form">
|
||||||
|
<a-row>
|
||||||
|
<!--动态标题-->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :label="$t('standardRegulationLibrary.dynamicMessage.dynamicHeading')" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.dynamicMessage.dynamicHeading')"
|
||||||
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
|
:maxLength="50"
|
||||||
|
v-decorator="['dynamicHeading', validatorRules.dynamicHeading]" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!--动态分类-->
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardRegulationLibrary.dynamicMessage.dynamicCataloging')">
|
||||||
|
<j-dict-select-tag v-decorator="['dynamicClassification', validatorRules.dynamicClassification]"
|
||||||
|
dict-code="dynamic_news_type"
|
||||||
|
:placeholder="$t('pleaseSelect') + $t('standardRegulationLibrary.dynamicMessage.dynamicCataloging')"
|
||||||
|
@change="handleCatalogingChange" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<!--推送范围-->
|
||||||
|
<a-form-item v-if="needWritePushRange"
|
||||||
|
:labelCol="lineLabelCol"
|
||||||
|
:wrapperCol="lineWrapperCol"
|
||||||
|
:label="$t('standardRegulationLibrary.dynamicMessage.pushRange')">
|
||||||
|
<user-selection v-decorator="['pushRange', validatorRules.pushRange]"
|
||||||
|
type="checkbox"
|
||||||
|
:placeholder="$t('pleaseSelect') + $t('standardRegulationLibrary.dynamicMessage.pushRange')" />
|
||||||
|
</a-form-item>
|
||||||
|
<!--动态详情-->
|
||||||
|
<a-form-item v-if="needWriteDynamicDetails"
|
||||||
|
:labelCol="lineLabelCol"
|
||||||
|
:wrapperCol="lineWrapperCol"
|
||||||
|
:label="$t('standardRegulationLibrary.dynamicMessage.dynamicDetails')">
|
||||||
|
<u-editor :content="ueContent" :config="config" ref="uEditor" @editor-onChange="uEditorChange" />
|
||||||
|
</a-form-item>
|
||||||
|
<!--资料文本-->
|
||||||
|
<a-form-item :labelCol="lineLabelCol"
|
||||||
|
:wrapperCol="lineWrapperCol"
|
||||||
|
:label="$t('standardRegulationLibrary.dynamicMessage.dataText')">
|
||||||
|
<j-upload v-decorator="['dataText', validatorRules.dataText]" :number="fileNum" :file-type="fileType" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
|
||||||
|
<div class="bottom-operate-box">
|
||||||
|
<!--取消-->
|
||||||
|
<a-button type="primary" ghost :loading="loading">{{ $t('cancel') }}</a-button>
|
||||||
|
<!--保存-->
|
||||||
|
<a-button type="primary" :loading="loading" @click="handleSave">{{ $t('preservation') }}</a-button>
|
||||||
|
<!--发布-->
|
||||||
|
<a-button type="primary" :loading="loading" @click="handlePublish">{{ $t('release') }}</a-button>
|
||||||
|
</div>
|
||||||
|
</internal-detail-page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import InternalDetailPage from '../../../components/InternalDetailPage.vue'
|
||||||
|
import UserSelection from '../../../components/selection/UserSelection.vue'
|
||||||
|
import UEditor from '../../../components/uEditor/UEditor.vue'
|
||||||
|
import { saveDynamicMessage, getDynamicMessageById, releaseDynamicMessage } from '../../../api/standardRegulationLibraryApi.js'
|
||||||
|
import { DynamicCataloging } from '../../../enums/commonEnums.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DynamicMessageFormPage',
|
||||||
|
components: { UEditor, InternalDetailPage, UserSelection },
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
form: this.$form.createForm(this),
|
||||||
|
labelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 4 }
|
||||||
|
},
|
||||||
|
wrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 18 }
|
||||||
|
},
|
||||||
|
lineLabelCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 2 }
|
||||||
|
},
|
||||||
|
lineWrapperCol: {
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 21 }
|
||||||
|
},
|
||||||
|
ueContent: '',
|
||||||
|
// UE编辑器配置
|
||||||
|
config: {
|
||||||
|
// 可以在此处定义工具栏的内容
|
||||||
|
toolbars: [
|
||||||
|
[
|
||||||
|
'undo', // 撤销
|
||||||
|
'redo', // 重做
|
||||||
|
'bold', // 加粗
|
||||||
|
'italic', // 斜体
|
||||||
|
'underline', // 下划线
|
||||||
|
'strikethrough', // 删除线
|
||||||
|
'subscript', // 下标
|
||||||
|
'superscript', // 上标
|
||||||
|
'fontborder', // 字符边框
|
||||||
|
'fontfamily', // 字体
|
||||||
|
'fontsize', // 字号
|
||||||
|
'forecolor', // 字体颜色
|
||||||
|
// 'backcolor', // 背景色
|
||||||
|
'paragraph', // 段落格式
|
||||||
|
'customstyle', // 自定义标题
|
||||||
|
'indent', // 首行缩进
|
||||||
|
'justifyleft', // 居左对齐
|
||||||
|
'fullscreen', // 全屏
|
||||||
|
'justifyright', // 居右对齐
|
||||||
|
'justifycenter', // 居中对齐
|
||||||
|
'justifyjustify', // 两端对齐
|
||||||
|
'lineheight', // 行间距,
|
||||||
|
'rowspacingtop', // 段前距
|
||||||
|
'rowspacingbottom', // 段后距
|
||||||
|
'directionalityltr', // 从左向右输入
|
||||||
|
'directionalityrtl', // 从右向左输入
|
||||||
|
'cleardoc', // 清空文档
|
||||||
|
'formatmatch', // 格式刷
|
||||||
|
'removeformat', // 清除格式
|
||||||
|
'source', // 源代码
|
||||||
|
'blockquote', // 引用
|
||||||
|
'pasteplain', // 纯文本粘贴模式
|
||||||
|
'selectall', // 全选
|
||||||
|
'horizontal', // 分隔线
|
||||||
|
'time', // 时间
|
||||||
|
'date', // 日期
|
||||||
|
'link', // 超链接
|
||||||
|
'unlink', // 取消链接
|
||||||
|
// 'background', // 背景
|
||||||
|
// 'simpleupload', // 单图上传
|
||||||
|
'imagenone', // 默认
|
||||||
|
'imageleft', // 左浮动
|
||||||
|
'imageright', // 右浮动
|
||||||
|
'imagecenter', // 居中
|
||||||
|
'touppercase', // 字母大写
|
||||||
|
'tolowercase', // 字母小写
|
||||||
|
'emotion', // 表情
|
||||||
|
'spechars', // 特殊字符
|
||||||
|
'searchreplace', // 查询替换
|
||||||
|
'insertunorderedlist', // 无序列表
|
||||||
|
'insertorderedlist', // 有序列表
|
||||||
|
'pagebreak', // 分页
|
||||||
|
'insertframe', // 插入Iframe
|
||||||
|
'charts', // 图表
|
||||||
|
'edittip ', // 编辑提示
|
||||||
|
'autotypeset', // 自动排版
|
||||||
|
'drafts', // 从草稿箱加载
|
||||||
|
'inserttable', // 插入表格
|
||||||
|
'deletetable', // 删除表格,
|
||||||
|
'insertparagraphbeforetable', // ”表格前插入行”
|
||||||
|
'insertrow', // 前插入行
|
||||||
|
'insertcol', // 前插入列
|
||||||
|
'mergeright', // 右合并单元格
|
||||||
|
'mergedown', // 下合并单元格
|
||||||
|
'deleterow', // 删除行
|
||||||
|
'deletecol', // 删除列
|
||||||
|
'splittorows', // 拆分成行
|
||||||
|
'splittocols', // 拆分成列
|
||||||
|
'splittocells', // 完全拆分单元格
|
||||||
|
'inserttitle', // 插入标题
|
||||||
|
'deletecaption', // 删除表格标题,
|
||||||
|
'mergecells', // 合并多个单元格
|
||||||
|
'edittable', // 表格属性
|
||||||
|
'edittd' // 单元格属性
|
||||||
|
]
|
||||||
|
],
|
||||||
|
autoHeightEnabled: false,
|
||||||
|
autoFloatEnabled: false,
|
||||||
|
initialContent: '', // 初始化编辑器的内容,也可以通过textarea/script给值,看官网例子
|
||||||
|
autoClearinitialContent: true, // 是否自动清除编辑器初始内容,注意:如果focus属性设置为true,这个也为真,那么编辑器一上来就会触发导致初始化的内容看不到了
|
||||||
|
initialFrameWidth: 650,
|
||||||
|
elementPathEnabled: false,
|
||||||
|
initialFrameHeight: 300,
|
||||||
|
maximumWords: 4000,
|
||||||
|
BaseUrl: '',
|
||||||
|
UEDITOR_HOME_URL: '/ueditor/',
|
||||||
|
editTableIndex: 1
|
||||||
|
},
|
||||||
|
fileNum: 0, // 动态分类为周报或月报时,控制只能上传一个
|
||||||
|
fileType: 'all', // 动态分类为周报或月报时,控制只能上传pdf
|
||||||
|
validatorRules: {
|
||||||
|
// 动态标题
|
||||||
|
dynamicHeading: {
|
||||||
|
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.dynamicMessage.dynamicHeading') }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
// 动态分类
|
||||||
|
dynamicClassification: {
|
||||||
|
rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.dynamicMessage.dynamicCataloging') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
// 推送范围
|
||||||
|
pushRange: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseSelect') + this.$t('standardRegulationLibrary.dynamicMessage.pushRange') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
},
|
||||||
|
// 资料文本
|
||||||
|
dataText: {
|
||||||
|
rules: [{ required: false, message: this.$t('uploadFile.pleaseUpload') + this.$t('standardRegulationLibrary.dynamicMessage.dataText') }],
|
||||||
|
validateTrigger: 'change'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loading: false,
|
||||||
|
modal: {},
|
||||||
|
needWritePushRange: true, // 是否需要填写推送范围
|
||||||
|
needWriteDynamicDetails: true // 是否需要填写动态详情
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
if (this.$route.query.id) {
|
||||||
|
this.initFormData()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initFormData () {
|
||||||
|
this.loading = true
|
||||||
|
getDynamicMessageById({ id: this.$route.query.id }).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.modal = res.result || {}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.form.setFieldsValue(this.modal)
|
||||||
|
this.ueContent = this.modal.dynamicDetails
|
||||||
|
this.$refs.uEditor.setContent(this.ueContent)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取表格内容
|
||||||
|
uEditorChange (val) {
|
||||||
|
console.log('--------------uEditorChange------------', val)
|
||||||
|
this.ueContent = val
|
||||||
|
},
|
||||||
|
handleSave () {
|
||||||
|
this.form.validateFields((errors, values) => {
|
||||||
|
if (!errors) {
|
||||||
|
const formData = Object.assign(this.modal, values)
|
||||||
|
formData.dynamicDetails = this.ueContent
|
||||||
|
this.loading = true
|
||||||
|
saveDynamicMessage(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$router.go(-1)
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleCatalogingChange (value) {
|
||||||
|
if (value === DynamicCataloging.WEEKLY_NEWSPAPER.value || value === DynamicCataloging.MONTHLY_MAGAZINE.value) {
|
||||||
|
this.fileNum = 1
|
||||||
|
this.fileType = 'pdf'
|
||||||
|
this.needWritePushRange = false
|
||||||
|
this.needWriteDynamicDetails = false
|
||||||
|
this.form.setFieldsValue({ dataText: undefined })
|
||||||
|
} else {
|
||||||
|
this.fileNum = 0
|
||||||
|
this.fileType = 'all'
|
||||||
|
this.needWritePushRange = true
|
||||||
|
this.needWriteDynamicDetails = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlePublish () {
|
||||||
|
this.form.validateFields((errors, values) => {
|
||||||
|
if (!errors) {
|
||||||
|
const formData = Object.assign(this.modal, values)
|
||||||
|
formData.dynamicDetails = this.ueContent
|
||||||
|
this.loading = true
|
||||||
|
releaseDynamicMessage(formData).then(res => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$message.success(res.message)
|
||||||
|
this.$router.go(-1)
|
||||||
|
} else {
|
||||||
|
this.$message.warn(res.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
@import '~@assets/less/common.less';
|
||||||
|
|
||||||
|
/deep/ .edui-default .edui-editor {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .edui-default .edui-toolbar {
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-operate-box {
|
||||||
|
height: 52px;
|
||||||
|
padding: 10px 32px;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
.ant-btn {
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-form {
|
||||||
|
height: calc(100% - 52px);
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 32px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -38,6 +38,15 @@
|
|||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
@operationClick="operationClick">
|
@operationClick="operationClick">
|
||||||
|
|
||||||
|
<!-- 标准编号-->
|
||||||
|
<template v-slot:click="{text, record}">
|
||||||
|
<a-tooltip overlay-class-name="tooltip-style">
|
||||||
|
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||||
|
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{ text }}</div>
|
||||||
|
<div v-else class="table-text">{{ global.emptyLine }}</div>
|
||||||
|
</a-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
</j-table>
|
</j-table>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
@@ -46,11 +55,27 @@
|
|||||||
<script>
|
<script>
|
||||||
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
|
import { JeroListMixin } from '../../../mixins/JeroListMixin.js'
|
||||||
import JTable from '../../../components/jero/JTable.vue'
|
import JTable from '../../../components/jero/JTable.vue'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DynamicMessageList',
|
name: 'DynamicMessageList',
|
||||||
components: { JTable },
|
components: { JTable },
|
||||||
mixins: [JeroListMixin],
|
mixins: [JeroListMixin],
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo']),
|
||||||
|
// 是否管理员
|
||||||
|
isAdmin () {
|
||||||
|
let flag = false
|
||||||
|
if (this.userInfo.userRoleList && this.userInfo.userRoleList.length > 0) {
|
||||||
|
this.userInfo.userRoleList.forEach(res => {
|
||||||
|
if (res.roleCode === 'admin') {
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return flag
|
||||||
|
}
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
operationList: [
|
operationList: [
|
||||||
@@ -58,7 +83,11 @@ export default {
|
|||||||
{
|
{
|
||||||
text: this.$t('edit'),
|
text: this.$t('edit'),
|
||||||
clickEvent: 'handleEdit',
|
clickEvent: 'handleEdit',
|
||||||
has: ''
|
has: '',
|
||||||
|
// 管理员可以编辑/删除所有,编辑人能修改/删除自己发布的,其他用户只能收藏/查看和分享
|
||||||
|
show: (record) => {
|
||||||
|
return this.isAdmin || record.writer === this.userInfo.id
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 分享
|
// 分享
|
||||||
{
|
{
|
||||||
@@ -78,7 +107,8 @@ export default {
|
|||||||
{
|
{
|
||||||
dataIndex: 'dynamicHeading',
|
dataIndex: 'dynamicHeading',
|
||||||
title: this.$t('standardRegulationLibrary.dynamicMessage.dynamicHeading'),
|
title: this.$t('standardRegulationLibrary.dynamicMessage.dynamicHeading'),
|
||||||
width: 200
|
width: 200,
|
||||||
|
scopedSlots: { customRender: 'click' }
|
||||||
},
|
},
|
||||||
// 动态分类
|
// 动态分类
|
||||||
{
|
{
|
||||||
@@ -117,6 +147,33 @@ export default {
|
|||||||
delete: '/laws/standard/lawsNewsFeed/delete'
|
delete: '/laws/standard/lawsNewsFeed/delete'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleAdd () {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/standardRegulationLibrary/DynamicMessageFormPage',
|
||||||
|
query: {
|
||||||
|
title: this.$t('newlyAdded')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleEdit ({ id }) {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/standardRegulationLibrary/DynamicMessageFormPage',
|
||||||
|
query: {
|
||||||
|
title: this.$t('newlyAdded'),
|
||||||
|
id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toDetailPage ({ id }) {
|
||||||
|
this.$router.push({
|
||||||
|
path: '/standardRegulationLibrary/DynamicMessageDetail',
|
||||||
|
query: {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user