diff --git a/ebts-ui/package.json b/ebts-ui/package.json
index 32c0861..405f43f 100644
--- a/ebts-ui/package.json
+++ b/ebts-ui/package.json
@@ -39,6 +39,7 @@
"@antv/g6": "^4.2.7",
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.18.1",
+ "ckeditor4-vue": "^1.4.0",
"clipboard": "2.0.4",
"codemirror": "^5.59.2",
"core-js": "3.6.5",
diff --git a/ebts-ui/src/api/sist/article.js b/ebts-ui/src/api/sist/article.js
index 90d88ef..d58bfaa 100644
--- a/ebts-ui/src/api/sist/article.js
+++ b/ebts-ui/src/api/sist/article.js
@@ -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) {
return request({
diff --git a/ebts-ui/src/components/Editor/index.vue b/ebts-ui/src/components/Editor/index.vue
index 77c3062..95efa86 100644
--- a/ebts-ui/src/components/Editor/index.vue
+++ b/ebts-ui/src/components/Editor/index.vue
@@ -47,7 +47,8 @@ export default {
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
[{ align: [] }], // 对齐方式
["clean"], // 清除文本格式
- ["link", "image", "video"] // 链接、图片、视频
+ ["link", "image", "video"], // 链接、图片、视频
+ [{ 'script': 'sub'}, { 'script': 'super' }],
],
},
placeholder: "请输入内容",
diff --git a/ebts-ui/src/main.js b/ebts-ui/src/main.js
index 220df5a..d69d802 100644
--- a/ebts-ui/src/main.js
+++ b/ebts-ui/src/main.js
@@ -18,11 +18,11 @@ import './assets/icons' // icon
import './permission' // permission control
import { getDicts,getEncodeDicts } from "@/api/system/dict/data";
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 RightToolbar from "@/components/RightToolbar"
-
+import CKEditor from 'ckeditor4-vue';
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getEncodeDicts = getEncodeDicts
@@ -31,6 +31,7 @@ Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
+Vue.prototype.selectDictCode = selectDictCode
Vue.prototype.addCreateDateRange = addCreateDateRange
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
@@ -53,6 +54,7 @@ Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.use(permission)
+Vue.use( CKEditor );
/**
* If you don't want to use mock-server
diff --git a/ebts-ui/src/router/index.js b/ebts-ui/src/router/index.js
index 33ec28f..c0eee35 100644
--- a/ebts-ui/src/router/index.js
+++ b/ebts-ui/src/router/index.js
@@ -113,15 +113,21 @@ export const constantRoutes = [
{
path: 'add',
component: (resolve) => require(['@/views/sist/article/components/article'], resolve),
- name: 'addarticle',
+ name: 'addArticle',
meta: { title: '添加文章' }
},
{
path: 'edit/:articleId',
component: (resolve) => require(['@/views/sist/article/components/article'], resolve),
- name: 'editarticle',
+ name: 'editArticle',
meta: { title: '修改文章' }
},
+ {
+ path: 'approve/:articleId',
+ component: (resolve) => require(['@/views/sist/article/components/approve'], resolve),
+ name: 'approveArticle',
+ meta: { title: '审批文章' }
+ },
]
},
{
diff --git a/ebts-ui/src/store/getters.js b/ebts-ui/src/store/getters.js
index df51465..db0cad9 100644
--- a/ebts-ui/src/store/getters.js
+++ b/ebts-ui/src/store/getters.js
@@ -10,6 +10,7 @@ const getters = {
introduction: state => state.user.introduction,
roles: state => state.user.roles,
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
diff --git a/ebts-ui/src/store/modules/user.js b/ebts-ui/src/store/modules/user.js
index ba870b4..4242da8 100644
--- a/ebts-ui/src/store/modules/user.js
+++ b/ebts-ui/src/store/modules/user.js
@@ -5,6 +5,7 @@ const user = {
state: {
token: getToken(),
name: '',
+ userId: '',
avatar: '',
roles: [],
permissions: []
@@ -17,6 +18,9 @@ const user = {
SET_NAME: (state, name) => {
state.name = name
},
+ SET_ID: (state, userId) => {
+ state.userId = userId
+ },
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
@@ -60,6 +64,7 @@ const user = {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
commit('SET_NAME', user.userName)
+ commit('SET_ID', user.userId)
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
diff --git a/ebts-ui/src/utils/hcy.js b/ebts-ui/src/utils/hcy.js
index dada41d..7299166 100644
--- a/ebts-ui/src/utils/hcy.js
+++ b/ebts-ui/src/utils/hcy.js
@@ -90,6 +90,17 @@ export function selectDictLabel(datas, value) {
})
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) {
diff --git a/ebts-ui/src/views/sist/article/components/approve.vue b/ebts-ui/src/views/sist/article/components/approve.vue
new file mode 100644
index 0000000..b51dd19
--- /dev/null
+++ b/ebts-ui/src/views/sist/article/components/approve.vue
@@ -0,0 +1,205 @@
+
+
+
+
+
+
{{ article.title }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.dictLabel }}
+
+
+
+
+
+
+
+ {{ item.dictLabel }}
+
+
+
+
+
+
+
+ {{ item.dictLabel }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 批准
+ 驳回
+
+
+
+
+
+
+
+
+
+
diff --git a/ebts-ui/src/views/sist/article/components/article.vue b/ebts-ui/src/views/sist/article/components/article.vue
index 7b7d399..9470a11 100644
--- a/ebts-ui/src/views/sist/article/components/article.vue
+++ b/ebts-ui/src/views/sist/article/components/article.vue
@@ -118,7 +118,8 @@
- 提交
+ 保存草稿
+ 提交审核
重置
@@ -128,7 +129,7 @@
+
+