文章审批加保存
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
"@antv/g6": "^4.2.7",
|
"@antv/g6": "^4.2.7",
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
"axios": "0.18.1",
|
"axios": "0.18.1",
|
||||||
|
"ckeditor4-vue": "^1.4.0",
|
||||||
"clipboard": "2.0.4",
|
"clipboard": "2.0.4",
|
||||||
"codemirror": "^5.59.2",
|
"codemirror": "^5.59.2",
|
||||||
"core-js": "3.6.5",
|
"core-js": "3.6.5",
|
||||||
|
|||||||
@@ -50,6 +50,33 @@ export function addArticle(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 审批系统文章
|
||||||
|
export function approve(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sist/article/approve',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存草稿
|
||||||
|
export function drafts(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sist/article/drafts',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 驳回系统文章
|
||||||
|
export function rejected(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sist/article/rejected',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 修改系统文章
|
// 修改系统文章
|
||||||
export function updateArticle(data) {
|
export function updateArticle(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ export default {
|
|||||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||||
[{ align: [] }], // 对齐方式
|
[{ align: [] }], // 对齐方式
|
||||||
["clean"], // 清除文本格式
|
["clean"], // 清除文本格式
|
||||||
["link", "image", "video"] // 链接、图片、视频
|
["link", "image", "video"], // 链接、图片、视频
|
||||||
|
[{ 'script': 'sub'}, { 'script': 'super' }],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
placeholder: "请输入内容",
|
placeholder: "请输入内容",
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ import './assets/icons' // icon
|
|||||||
import './permission' // permission control
|
import './permission' // permission control
|
||||||
import { getDicts,getEncodeDicts } from "@/api/system/dict/data";
|
import { getDicts,getEncodeDicts } from "@/api/system/dict/data";
|
||||||
import { getConfigKey } from "@/api/system/config";
|
import { getConfigKey } from "@/api/system/config";
|
||||||
import { parseTime, resetForm, addDateRange, addCreateDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/hcy";
|
import { parseTime, resetForm, addDateRange, addCreateDateRange,selectDictCode , selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/hcy";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
//自定义表格工具扩展
|
//自定义表格工具扩展
|
||||||
import RightToolbar from "@/components/RightToolbar"
|
import RightToolbar from "@/components/RightToolbar"
|
||||||
|
import CKEditor from 'ckeditor4-vue';
|
||||||
// 全局方法挂载
|
// 全局方法挂载
|
||||||
Vue.prototype.getDicts = getDicts
|
Vue.prototype.getDicts = getDicts
|
||||||
Vue.prototype.getEncodeDicts = getEncodeDicts
|
Vue.prototype.getEncodeDicts = getEncodeDicts
|
||||||
@@ -31,6 +31,7 @@ Vue.prototype.parseTime = parseTime
|
|||||||
Vue.prototype.resetForm = resetForm
|
Vue.prototype.resetForm = resetForm
|
||||||
Vue.prototype.addDateRange = addDateRange
|
Vue.prototype.addDateRange = addDateRange
|
||||||
Vue.prototype.selectDictLabel = selectDictLabel
|
Vue.prototype.selectDictLabel = selectDictLabel
|
||||||
|
Vue.prototype.selectDictCode = selectDictCode
|
||||||
Vue.prototype.addCreateDateRange = addCreateDateRange
|
Vue.prototype.addCreateDateRange = addCreateDateRange
|
||||||
Vue.prototype.selectDictLabels = selectDictLabels
|
Vue.prototype.selectDictLabels = selectDictLabels
|
||||||
Vue.prototype.download = download
|
Vue.prototype.download = download
|
||||||
@@ -53,6 +54,7 @@ Vue.component('Pagination', Pagination)
|
|||||||
Vue.component('RightToolbar', RightToolbar)
|
Vue.component('RightToolbar', RightToolbar)
|
||||||
|
|
||||||
Vue.use(permission)
|
Vue.use(permission)
|
||||||
|
Vue.use( CKEditor );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you don't want to use mock-server
|
* If you don't want to use mock-server
|
||||||
|
|||||||
@@ -113,15 +113,21 @@ export const constantRoutes = [
|
|||||||
{
|
{
|
||||||
path: 'add',
|
path: 'add',
|
||||||
component: (resolve) => require(['@/views/sist/article/components/article'], resolve),
|
component: (resolve) => require(['@/views/sist/article/components/article'], resolve),
|
||||||
name: 'addarticle',
|
name: 'addArticle',
|
||||||
meta: { title: '添加文章' }
|
meta: { title: '添加文章' }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit/:articleId',
|
path: 'edit/:articleId',
|
||||||
component: (resolve) => require(['@/views/sist/article/components/article'], resolve),
|
component: (resolve) => require(['@/views/sist/article/components/article'], resolve),
|
||||||
name: 'editarticle',
|
name: 'editArticle',
|
||||||
meta: { title: '修改文章' }
|
meta: { title: '修改文章' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'approve/:articleId',
|
||||||
|
component: (resolve) => require(['@/views/sist/article/components/approve'], resolve),
|
||||||
|
name: 'approveArticle',
|
||||||
|
meta: { title: '审批文章' }
|
||||||
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const getters = {
|
|||||||
introduction: state => state.user.introduction,
|
introduction: state => state.user.introduction,
|
||||||
roles: state => state.user.roles,
|
roles: state => state.user.roles,
|
||||||
permissions: state => state.user.permissions,
|
permissions: state => state.user.permissions,
|
||||||
permission_routes: state => state.permission.routes
|
permission_routes: state => state.permission.routes,
|
||||||
|
userId: state => state.user.userId,
|
||||||
}
|
}
|
||||||
export default getters
|
export default getters
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ const user = {
|
|||||||
state: {
|
state: {
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
name: '',
|
name: '',
|
||||||
|
userId: '',
|
||||||
avatar: '',
|
avatar: '',
|
||||||
roles: [],
|
roles: [],
|
||||||
permissions: []
|
permissions: []
|
||||||
@@ -17,6 +18,9 @@ const user = {
|
|||||||
SET_NAME: (state, name) => {
|
SET_NAME: (state, name) => {
|
||||||
state.name = name
|
state.name = name
|
||||||
},
|
},
|
||||||
|
SET_ID: (state, userId) => {
|
||||||
|
state.userId = userId
|
||||||
|
},
|
||||||
SET_AVATAR: (state, avatar) => {
|
SET_AVATAR: (state, avatar) => {
|
||||||
state.avatar = avatar
|
state.avatar = avatar
|
||||||
},
|
},
|
||||||
@@ -60,6 +64,7 @@ const user = {
|
|||||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||||
}
|
}
|
||||||
commit('SET_NAME', user.userName)
|
commit('SET_NAME', user.userName)
|
||||||
|
commit('SET_ID', user.userId)
|
||||||
commit('SET_AVATAR', avatar)
|
commit('SET_AVATAR', avatar)
|
||||||
resolve(res)
|
resolve(res)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
|||||||
@@ -90,6 +90,17 @@ export function selectDictLabel(datas, value) {
|
|||||||
})
|
})
|
||||||
return actions.join('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
|
// 回显数据字典
|
||||||
|
export function selectDictCode(datas, value) {
|
||||||
|
var actions = [];
|
||||||
|
Object.keys(datas).some((key) => {
|
||||||
|
if (datas[key].dictCode == ('' + value)) {
|
||||||
|
actions.push(datas[key].dictLabel);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
|
||||||
// 回显数据字典(字符串数组)
|
// 回显数据字典(字符串数组)
|
||||||
export function selectDictLabels(datas, value, separator) {
|
export function selectDictLabels(datas, value, separator) {
|
||||||
|
|||||||
205
ebts-ui/src/views/sist/article/components/approve.vue
Normal file
205
ebts-ui/src/views/sist/article/components/approve.vue
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<template>
|
||||||
|
<div class="approve">
|
||||||
|
<el-row>
|
||||||
|
<el-col :offset="1" :span="22">
|
||||||
|
<div class="context">
|
||||||
|
<div class="title">{{ article.title }}</div>
|
||||||
|
<!-- <Editor></Editor>-->
|
||||||
|
<div class="text" v-html="article.content"></div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form ref="elForm" size="medium" label-width="100px">
|
||||||
|
<!-- <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">-->
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="是否顶置">
|
||||||
|
<el-radio-group v-model="article.isTop" disabled>
|
||||||
|
<el-radio-button v-for="(item, index) in isTopOptions" :key="index"
|
||||||
|
:label="item.dictValue">{{ item.dictLabel }}
|
||||||
|
</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="是否显示">
|
||||||
|
<el-radio-group v-model="article.isView" disabled>
|
||||||
|
<el-radio-button v-for="(item, index) in isViewOptions" :key="index"
|
||||||
|
:label="item.dictValue">{{ item.dictLabel }}
|
||||||
|
</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="是否英语">
|
||||||
|
<el-radio-group v-model="article.isEnglish" disabled>
|
||||||
|
<el-radio-button v-for="(item, index) in isEnglishOptions" :key="index"
|
||||||
|
:label="item.dictValue">{{ item.dictLabel }}
|
||||||
|
</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="发布时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="publishTime"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="选择日期时间"
|
||||||
|
align="right"
|
||||||
|
:picker-options="pickerOptions">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24" class="submitForm">
|
||||||
|
<el-form-item size="large">
|
||||||
|
<el-button type="success" plain @click="submitForm('approve')">批准</el-button>
|
||||||
|
<el-button type="danger" plain @click="submitForm('rejected')">驳回</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {approve, getArticle, rejected} from "@/api/sist/article";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {},
|
||||||
|
name: "approve",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
article: {
|
||||||
|
id: null,
|
||||||
|
title: null,
|
||||||
|
},
|
||||||
|
fromData: null,
|
||||||
|
publishTime: null,
|
||||||
|
isTopOptions: [],
|
||||||
|
isViewOptions: [],
|
||||||
|
isEnglishOptions: [],
|
||||||
|
pickerOptions: {
|
||||||
|
shortcuts: [{
|
||||||
|
text: '今天',
|
||||||
|
onClick(picker) {
|
||||||
|
picker.$emit('pick', new Date());
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '昨明天',
|
||||||
|
onClick(picker) {
|
||||||
|
const date = new Date();
|
||||||
|
date.setTime(date.getTime() + 3600 * 1000 * 24);
|
||||||
|
picker.$emit('pick', date);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '一周后',
|
||||||
|
onClick(picker) {
|
||||||
|
const date = new Date();
|
||||||
|
date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit('pick', date);
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.article.id = this.$route.params && this.$route.params.articleId;
|
||||||
|
getArticle(this.article.id).then(response => {
|
||||||
|
this.article = response.data
|
||||||
|
})
|
||||||
|
this.getDicts("is_top").then(response => {
|
||||||
|
this.isTopOptions = response.data;
|
||||||
|
});
|
||||||
|
this.getDicts("is_view").then(response => {
|
||||||
|
this.isViewOptions = response.data;
|
||||||
|
});
|
||||||
|
this.getDicts("is_english").then(response => {
|
||||||
|
this.isEnglishOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submitForm(type) {
|
||||||
|
let that = this
|
||||||
|
if (type === "approve") {
|
||||||
|
if (this.publishTime === null) {
|
||||||
|
this.$confirm('您未选择发布时间,是否将现在作为发布时间,并批准发布?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function () {
|
||||||
|
that.toApprove()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$confirm('您确认批准发布?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function () {
|
||||||
|
that.toApprove()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (type === "rejected") {
|
||||||
|
this.$confirm('您确认驳回此文章?', "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}).then(function () {
|
||||||
|
that.toRejected()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// TODO 提交表单
|
||||||
|
},
|
||||||
|
|
||||||
|
toApprove() {
|
||||||
|
this.fromData = {
|
||||||
|
id: this.article.id,
|
||||||
|
publishTime: this.publishTime,
|
||||||
|
}
|
||||||
|
approve(this.fromData).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toRejected() {
|
||||||
|
rejected(this.article.id).then(res => {
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
resetForm() {
|
||||||
|
this.$refs['elForm'].resetFields()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.article {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submitForm {
|
||||||
|
margin-top: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.context {
|
||||||
|
margin: 3rem 4rem;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 2.4rem;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #1956BC;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
margin-top: 2rem;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #3C3C3C;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -118,7 +118,8 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24" class="submitForm">
|
<el-col :span="24" class="submitForm">
|
||||||
<el-form-item size="large">
|
<el-form-item size="large">
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
<el-button type="success" @click="saveDrafts">保存草稿</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">提交审核</el-button>
|
||||||
<el-button @click="resetForm">重置</el-button>
|
<el-button @click="resetForm">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Editor from '@/components/Editor';
|
import Editor from '@/components/Editor';
|
||||||
import {updateArticle, getArticle, addArticle, getArticleType, getArticleApprove} from "@/api/sist/article";
|
import {updateArticle, getArticle, drafts, getArticleType, getArticleApprove} from "@/api/sist/article";
|
||||||
import {Message} from "element-ui";
|
import {Message} from "element-ui";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -160,28 +161,6 @@ export default {
|
|||||||
isViewOptions: [],
|
isViewOptions: [],
|
||||||
isEnglishOptions: [],
|
isEnglishOptions: [],
|
||||||
sitetypeOptions: [],
|
sitetypeOptions: [],
|
||||||
pickerOptions: {
|
|
||||||
shortcuts: [{
|
|
||||||
text: '今天',
|
|
||||||
onClick(picker) {
|
|
||||||
picker.$emit('pick', new Date());
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
text: '昨天',
|
|
||||||
onClick(picker) {
|
|
||||||
const date = new Date();
|
|
||||||
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
||||||
picker.$emit('pick', date);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
text: '一周前',
|
|
||||||
onClick(picker) {
|
|
||||||
const date = new Date();
|
|
||||||
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
||||||
picker.$emit('pick', date);
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
rules: {
|
rules: {
|
||||||
title: [{
|
title: [{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -276,9 +255,7 @@ export default {
|
|||||||
this.labApproveOption = res.data
|
this.labApproveOption = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
console.log(this.formData);
|
|
||||||
this.$refs['elForm'].validate(valid => {
|
this.$refs['elForm'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType === null || this.params.labArticleType === "")) {
|
if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType === null || this.params.labArticleType === "")) {
|
||||||
@@ -288,13 +265,13 @@ export default {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
} else if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType !== null || this.params.labArticleType !== "") && (this.formData.sistApprove === null || this.params.sistApprove === "")) {
|
} else if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType !== null || this.params.labArticleType !== "") && (this.formData.sistApprove === null || this.params.sistApprove === "")) {
|
||||||
Message({
|
this.msgSuccess({
|
||||||
message: "请选择信息网站的审批人",
|
message: "请选择信息网站的审批人",
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
} else if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType != null || this.params.labArticleType !== "") && (this.params.labApprove === null || this.params.labApprove === "")) {
|
} else if ((this.params.sistArticleType === null || this.params.sistArticleType === "") && (this.params.labArticleType != null || this.params.labArticleType !== "") && (this.params.labApprove === null || this.params.labApprove === "")) {
|
||||||
Message({
|
this.msgSuccess({
|
||||||
message: "请选择实验室网站的审批人",
|
message: "请选择实验室网站的审批人",
|
||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
@@ -304,18 +281,28 @@ export default {
|
|||||||
this.formData.params = this.params
|
this.formData.params = this.params
|
||||||
if (this.formData.id != null) {
|
if (this.formData.id != null) {
|
||||||
updateArticle(this.formData).then(response => {
|
updateArticle(this.formData).then(response => {
|
||||||
this.msgSuccess("修改成功");
|
this.msgSuccess("提交审批成功");
|
||||||
this.$router.push("/sist/article");
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addArticle(this.formData).then(response => {
|
|
||||||
this.msgSuccess("新增成功");
|
|
||||||
this.$router.push("/sist/article");
|
this.$router.push("/sist/article");
|
||||||
});
|
});
|
||||||
|
// } else {
|
||||||
|
// addArticle(this.formData).then(response => {
|
||||||
|
// this.msgSuccess("新增成功");
|
||||||
|
// this.$router.push("/sist/article");
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
// TODO 提交表单
|
// TODO 提交表单
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
saveDrafts() {
|
||||||
|
this.$refs['elForm'].validate(valid => {
|
||||||
|
drafts(this.formData).then(res=>{
|
||||||
|
if (this.formData.id === null || this.formData.id === ""){
|
||||||
|
this.formData.id = res.data
|
||||||
|
}
|
||||||
|
this.msgSuccess('保存成功');
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.$refs['elForm'].resetFields()
|
this.$refs['elForm'].resetFields()
|
||||||
},
|
},
|
||||||
@@ -330,5 +317,6 @@ export default {
|
|||||||
|
|
||||||
.submitForm {
|
.submitForm {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
<el-form-item label="文章类型" prop="type">
|
<el-form-item label="文章类型" prop="type">
|
||||||
<el-select v-model="queryParams.type" placeholder="请选择文章类型" clearable size="small">
|
<el-select v-model="queryParams.type" placeholder="请选择文章类型" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in typeOptions"
|
v-for="dict in articleTypeOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictCode"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="dict.dictCode"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="文章标题" align="center" prop="title"/>
|
<el-table-column label="文章标题" align="center" prop="title"/>
|
||||||
<el-table-column label="站点类型" align="center" prop="siteType" :formatter="siteTypeFormat"/>
|
<el-table-column label="站点类型" align="center" prop="siteType" :formatter="siteTypeFormat"/>
|
||||||
<el-table-column label="文章类型" align="center" prop="type" :formatter="typeFormat"/>
|
<el-table-column label="文章类型" align="center" prop="type" :formatter="articleTypeFormat"/>
|
||||||
<el-table-column label="发布人姓名" align="center" prop="publishUserName"/>
|
<el-table-column label="发布人姓名" align="center" prop="publishUserName"/>
|
||||||
<el-table-column label="是否置顶" align="center" prop="isTop" :formatter="isTopFormat"/>
|
<el-table-column label="是否置顶" align="center" prop="isTop" :formatter="isTopFormat"/>
|
||||||
<el-table-column label="是否显示" align="center" prop="isView" :formatter="isViewFormat"/>
|
<el-table-column label="是否显示" align="center" prop="isView" :formatter="isViewFormat"/>
|
||||||
@@ -124,30 +124,31 @@
|
|||||||
<el-table-column label="缩略图" align="center" prop="imgurl"/>
|
<el-table-column label="缩略图" align="center" prop="imgurl"/>
|
||||||
<el-table-column label="是否英文" align="center" prop="isEnglish" :formatter="isEnglishFormat"/>
|
<el-table-column label="是否英文" align="center" prop="isEnglish" :formatter="isEnglishFormat"/>
|
||||||
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat"/>
|
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat"/>
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
<!-- <el-tag-->
|
<!-- <el-tag-->
|
||||||
<!-- v-if="scope.row.status==1">待取件-->
|
<!-- v-if="scope.row.status==1">待取件-->
|
||||||
<!-- </el-tag>-->
|
<!-- </el-tag>-->
|
||||||
<!-- <el-tag-->
|
<!-- <el-tag-->
|
||||||
<!-- type="warning" v-if="scope.row.status==2"-->
|
<!-- type="warning" v-if="scope.row.status==2"-->
|
||||||
<!-- >运输中-->
|
<!-- >运输中-->
|
||||||
<!-- </el-tag>-->
|
<!-- </el-tag>-->
|
||||||
<!-- <el-tag-->
|
<!-- <el-tag-->
|
||||||
<!-- type="danger" v-if="scope.row.status==3"-->
|
<!-- type="danger" v-if="scope.row.status==3"-->
|
||||||
<!-- disable-transitions>待收取-->
|
<!-- disable-transitions>待收取-->
|
||||||
<!-- </el-tag>-->
|
<!-- </el-tag>-->
|
||||||
<!-- <el-tag-->
|
<!-- <el-tag-->
|
||||||
<!-- type="success" v-if="scope.row.status==4"-->
|
<!-- type="success" v-if="scope.row.status==4"-->
|
||||||
<!-- disable-transitions>完成-->
|
<!-- disable-transitions>完成-->
|
||||||
<!-- </el-tag>-->
|
<!-- </el-tag>-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<el-table-column label="发布时间 " align="center" prop="publishTime" width="180">
|
<el-table-column label="发布时间 " align="center" prop="publishTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
<span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<span v-show="scope.row.status === 'NEd5n92EMIpyyBslaNqsRgE'|| scope.row.status === 'N6CfFGz2UWpQ9Uhk3uwiJAQ'">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -164,6 +165,14 @@
|
|||||||
v-hasPermi="['sist:article:remove']"
|
v-hasPermi="['sist:article:remove']"
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
</span>
|
||||||
|
<el-button v-show="scope.row.approvalUserId===userId"
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleApprova(scope.row)"
|
||||||
|
>审批
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -179,8 +188,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listArticle, delArticle, exportArticle} from "@/api/sist/article";
|
import {listArticle, delArticle, exportArticle,drafts} from "@/api/sist/article";
|
||||||
import Editor from '@/components/Editor';
|
import Editor from '@/components/Editor';
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Article",
|
name: "Article",
|
||||||
@@ -189,6 +199,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
userId: store.getters.userId,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@@ -210,7 +221,7 @@ export default {
|
|||||||
// 站点类型 1: sist 2: lab 3: 双边都发字典
|
// 站点类型 1: sist 2: lab 3: 双边都发字典
|
||||||
siteTypeOptions: [],
|
siteTypeOptions: [],
|
||||||
// 1: 2: 3: 根据导航字典
|
// 1: 2: 3: 根据导航字典
|
||||||
typeOptions: [],
|
articleTypeOptions: [],
|
||||||
// 是否置顶字典
|
// 是否置顶字典
|
||||||
isTopOptions: [],
|
isTopOptions: [],
|
||||||
// 是否显示字典
|
// 是否显示字典
|
||||||
@@ -272,8 +283,8 @@ export default {
|
|||||||
this.getDicts("article_site_type").then(response => {
|
this.getDicts("article_site_type").then(response => {
|
||||||
this.siteTypeOptions = response.data;
|
this.siteTypeOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("article_type").then(response => {
|
this.getEncodeDicts("article_type").then(response => {
|
||||||
this.typeOptions = response.data;
|
this.articleTypeOptions = response.data;
|
||||||
});
|
});
|
||||||
this.getDicts("is_top").then(response => {
|
this.getDicts("is_top").then(response => {
|
||||||
this.isTopOptions = response.data;
|
this.isTopOptions = response.data;
|
||||||
@@ -303,8 +314,8 @@ export default {
|
|||||||
return this.selectDictLabel(this.siteTypeOptions, row.siteType);
|
return this.selectDictLabel(this.siteTypeOptions, row.siteType);
|
||||||
},
|
},
|
||||||
// 1: 2: 3: 根据导航字典翻译
|
// 1: 2: 3: 根据导航字典翻译
|
||||||
typeFormat(row, column) {
|
articleTypeFormat(row, column) {
|
||||||
return this.selectDictLabel(this.typeOptions, row.type);
|
return this.selectDictCode(this.articleTypeOptions, row.type);
|
||||||
},
|
},
|
||||||
// 是否置顶字典翻译
|
// 是否置顶字典翻译
|
||||||
isTopFormat(row, column) {
|
isTopFormat(row, column) {
|
||||||
@@ -351,6 +362,10 @@ export default {
|
|||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.$router.push("/article/edit/" + row.id);
|
this.$router.push("/article/edit/" + row.id);
|
||||||
},
|
},
|
||||||
|
/** 审批按钮操作 */
|
||||||
|
handleApprova(row) {
|
||||||
|
this.$router.push("/article/approve/" + row.id);
|
||||||
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
const ids = row.id || this.ids;
|
||||||
|
|||||||
21
ebts-ui/src/views/utils/Editor.vue
Normal file
21
ebts-ui/src/views/utils/Editor.vue
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<div class="Editor">
|
||||||
|
<ckeditor v-model="context"></ckeditor>
|
||||||
|
<div>{{context}}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "Editor",
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
context:""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user