diff --git a/src/api/article.js b/src/api/article.js
index 77e68a5..49c4a3c 100644
--- a/src/api/article.js
+++ b/src/api/article.js
@@ -91,9 +91,9 @@ export const submitArticle = (data) => {
// @Produce application/json
// @Param menu Object
// @Router /cms/article/review [put]
-export const reviewArticle = (data) => {
+export const reviewBackArticle = (data) => {
return service({
- url: '/cms/article/review',
+ url: '/cms/article/reviewBack',
method: 'put',
data
})
diff --git a/src/api/fetcher.js b/src/api/fetcher.js
index baf9ab4..58d679c 100644
--- a/src/api/fetcher.js
+++ b/src/api/fetcher.js
@@ -11,12 +11,12 @@ export const getFetcherArticleList = (data) => {
})
}
-// @Summary 根据id获取文章
+// @Summary 根据id导入文章
// @accept application/json
-// @Router /cms/fetcher/getArticle [get]
-export const getFetcherArticleById = (params) => {
+// @Router /cms/fetcher/importArticle [get]
+export const importFetcherArticleById = (params) => {
return service({
- url: '/cms/fetcher/getArticle',
+ url: '/cms/fetcher/importArticle',
method: 'get',
params
})
diff --git a/src/view/content/article/index.vue b/src/view/content/article/index.vue
index 98cbb7c..311c576 100644
--- a/src/view/content/article/index.vue
+++ b/src/view/content/article/index.vue
@@ -41,17 +41,19 @@
新增文章
- 删除
+ 删除
-
+
- {{ scope.row.title }}
+
+ {{ scope.row.title }}
+
{{ scope.row.subtitle }}
@@ -102,21 +104,30 @@
-
预览
-
提审
-
+
+
审核
-
+
+
发布
-
+
+ 撤销
-
-
+ 编辑
- 删除
+
+
+ 删除
@@ -148,12 +159,13 @@ import {
setArticleChannels,
setArticleCategories,
submitArticle,
- reviewArticle,
+ reviewBackArticle,
releaseArticle,
cancelArticle
} from '@/api/article'
import ArticleEdit from '@/view/content/components/articleEdit.vue'
-
+import { useBtnAuth } from '@/utils/btnAuth'
+const btnAuth = useBtnAuth()
const articleEditTitle = ref('')
const articleEditRef = ref(false)
const page = ref(1)
@@ -359,23 +371,23 @@ const handleRowReview = row => {
cancelButtonText: '否',
type: 'warning'
}).then(async valid => {
- // 确认通过,状态为待发布
- const res = await reviewArticle({ ID: row.ID, status: 3 })
+ // 确认通过,发布文章
+ const res = await releaseArticle({ ID: row.ID })
if (res.code === 0) {
ElMessage({
type: 'success',
- message: '审核确认通过!'
+ message: '审核通过!'
})
- row.status = 3
+ row.status = 4
}
}).catch(async (action) => {
- // 确认不通过,状态为待提审
+ // 确认不通过,状态为草稿
if (action === 'cancel') {
- const res = await reviewArticle({ ID: row.ID, status: 1 })
+ const res = await reviewBackArticle({ ID: row.ID })
if (res.code === 0) {
ElMessage({
type: 'warning',
- message: '审核确认不通过!'
+ message: '审核不通过!'
})
row.status = 1
}
@@ -383,14 +395,6 @@ const handleRowReview = row => {
})
}
-// 预览
-const handleRowPreview = (row) => {
- ElMessage({
- type: 'warning',
- message: '开发中。。。'
- })
-}
-
// ----- 列表更新栏目相关 -----
const handleChangeChannels = async row => {
await nextTick()
diff --git a/src/view/content/channel/index.vue b/src/view/content/channel/index.vue
index b4ddbef..322b61c 100644
--- a/src/view/content/channel/index.vue
+++ b/src/view/content/channel/index.vue
@@ -10,6 +10,12 @@
+
+
+ 预览
+
+
@@ -96,12 +102,12 @@
-
+
-
+
diff --git a/src/view/content/components/articleEdit.vue b/src/view/content/components/articleEdit.vue
index d8ce887..8950115 100644
--- a/src/view/content/components/articleEdit.vue
+++ b/src/view/content/components/articleEdit.vue
@@ -55,7 +55,9 @@
-
+
+
+
@@ -151,7 +153,7 @@ import {
updateArticle,
getArticleById,
} from '@/api/article'
-import { getFetcherArticleById } from '@/api/fetcher'
+import { importFetcherArticleById } from '@/api/fetcher'
// 组件定义
defineOptions({
@@ -348,7 +350,7 @@ const initFormByArticle = async (id) => {
// 从爬虫数据中获取内容并填充至文章内容中
const initFormByFetcher = async (id) => {
- const res = await getFetcherArticleById({ ID: id })
+ const res = await importFetcherArticleById({ ID: id })
if (res.code === 0 && res.data && res.data.article) {
fetcherArticleId.value = id
const { title, author, source, content, publicTime } = res.data.article
diff --git a/src/view/content/fetcher/article.vue b/src/view/content/fetcher/article.vue
index 65be19d..d837c99 100644
--- a/src/view/content/fetcher/article.vue
+++ b/src/view/content/fetcher/article.vue
@@ -121,6 +121,7 @@ const initSearchInfo = () => {
formatTimeToStr(startDate, 'yyyy-MM-dd'),
formatTimeToStr(endDate, 'yyyy-MM-dd'),
],
+ state: 0,
}
}
@@ -162,8 +163,7 @@ const handleRowEdit = (ID) => {
// ----- 查询 -----
const getTableData = async () => {
- const state = 0
- const res = await getFetcherArticleList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value, state })
+ const res = await getFetcherArticleList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
if (res.code === 0) {
tableData.value = res.data.list
total.value = res.data.total
diff --git a/src/view/layout/aside/index.vue b/src/view/layout/aside/index.vue
index 3fcd676..0d29eec 100644
--- a/src/view/layout/aside/index.vue
+++ b/src/view/layout/aside/index.vue
@@ -105,7 +105,6 @@ const selectMenuItem = (index, _, ele, aaa) => {
if (index.indexOf('http://') > -1 || index.indexOf('https://') > -1) {
window.open(index)
} else {
- console.log(index, query, params)
router.push({ name: index, query, params })
}
}
diff --git a/src/view/superAdmin/api/api.vue b/src/view/superAdmin/api/api.vue
index 73184e2..4c6339f 100644
--- a/src/view/superAdmin/api/api.vue
+++ b/src/view/superAdmin/api/api.vue
@@ -1,121 +1,45 @@
-
+
-
+
-
+
-
+
-
-
+
+
- 查询
- 重置
+ 查询
+ 重置
- 新增
-
- 删除
- 刷新缓存
+ 新增
+
+
+
+ 删除
+ 刷新缓存
-
-
-
-
-
-
-
+
+
+
+
+
+
+
{{ scope.row.method }} / {{ methodFilter(scope.row.method) }}
@@ -123,108 +47,44 @@
-
+
- 编辑
- 删除
+ 编辑
+ 删除
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
+
+
@@ -342,7 +202,7 @@ const sortChange = ({ prop, order }) => {
}
// 查询
-const getTableData = async() => {
+const getTableData = async () => {
const table = await getApiList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
if (table.code === 0) {
tableData.value = table.data.list
@@ -359,12 +219,12 @@ const handleSelectionChange = (val) => {
apis.value = val
}
-const onDelete = async() => {
+const onDelete = async () => {
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
- }).then(async() => {
+ }).then(async () => {
const ids = apis.value.map(item => item.ID)
const res = await deleteApisByIds({ ids })
if (res.code === 0) {
@@ -379,12 +239,12 @@ const onDelete = async() => {
}
})
}
-const onFresh = async() => {
+const onFresh = async () => {
ElMessageBox.confirm('确定要刷新缓存吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
- }).then(async() => {
+ }).then(async () => {
const res = await freshCasbin()
if (res.code === 0) {
ElMessage({
@@ -428,13 +288,13 @@ const closeDialog = () => {
dialogFormVisible.value = false
}
-const editApiFunc = async(row) => {
+const editApiFunc = async (row) => {
const res = await getApiById({ id: row.ID })
form.value = res.data.api
openDialog('edit')
}
-const enterDialog = async() => {
+const enterDialog = async () => {
apiForm.value.validate(async valid => {
if (valid) {
switch (type.value) {
@@ -482,13 +342,13 @@ const enterDialog = async() => {
})
}
-const deleteApiFunc = async(row) => {
+const deleteApiFunc = async (row) => {
ElMessageBox.confirm('此操作将永久删除所有角色下该api, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
- .then(async() => {
+ .then(async () => {
const res = await deleteApi(row)
if (res.code === 0) {
ElMessage({
diff --git a/src/view/superAdmin/authority/components/apis.vue b/src/view/superAdmin/authority/components/apis.vue
index d0edf30..c53f57e 100644
--- a/src/view/superAdmin/authority/components/apis.vue
+++ b/src/view/superAdmin/authority/components/apis.vue
@@ -1,31 +1,14 @@
@@ -43,7 +26,7 @@ defineOptions({
const props = defineProps({
row: {
- default: function() {
+ default: function () {
return {}
},
type: Object
@@ -60,7 +43,7 @@ const filterText = ref('')
const apiTreeData = ref([])
const apiTreeIds = ref([])
const activeUserId = ref('')
-const init = async() => {
+const init = async () => {
const res2 = await getAllApis()
const apis = res2.data.apis
@@ -90,14 +73,14 @@ const enterAndNext = () => {
const buildApiTree = (apis) => {
const apiObj = {}
apis &&
- apis.forEach(item => {
- item.onlyId = 'p:' + item.path + 'm:' + item.method
- if (Object.prototype.hasOwnProperty.call(apiObj, item.apiGroup)) {
- apiObj[item.apiGroup].push(item)
- } else {
- Object.assign(apiObj, { [item.apiGroup]: [item] })
- }
- })
+ apis.forEach(item => {
+ item.onlyId = 'p:' + item.path + 'm:' + item.method
+ if (Object.prototype.hasOwnProperty.call(apiObj, item.apiGroup)) {
+ apiObj[item.apiGroup].push(item)
+ } else {
+ Object.assign(apiObj, { [item.apiGroup]: [item] })
+ }
+ })
const apiTree = []
for (const key in apiObj) {
const treeNode = {
@@ -112,7 +95,7 @@ const buildApiTree = (apis) => {
// 关联关系确定
const apiTree = ref(null)
-const authApiEnter = async() => {
+const authApiEnter = async () => {
const checkArr = apiTree.value.getCheckedNodes(true)
var casbinInfos = []
checkArr && checkArr.forEach(item => {
@@ -145,4 +128,3 @@ watch(filterText, (val) => {
})
-
diff --git a/src/view/superAdmin/authority/components/datas.vue b/src/view/superAdmin/authority/components/datas.vue
index 61d6b8b..1090f6c 100644
--- a/src/view/superAdmin/authority/components/datas.vue
+++ b/src/view/superAdmin/authority/components/datas.vue
@@ -1,40 +1,16 @@
+ title="此功能仅用于创建角色和角色的many2many关系表,具体使用还须自己结合表实现业务,详情参考示例代码(客户示例)。此功能不建议使用,建议使用插件市场【组织管理功能(点击前往)】来管理资源权限。" />
- 全选
- 本角色
- 本角色及子角色
- 确 定
+ 全选
+ 本角色
+ 本角色及子角色
+ 确 定
-
- {{ item.authorityName }}
+
+ {{ item.authorityName }}
@@ -52,13 +28,13 @@ defineOptions({
const props = defineProps({
row: {
- default: function() {
+ default: function () {
return {}
},
type: Object
},
authority: {
- default: function() {
+ default: function () {
return []
},
type: Array
@@ -121,7 +97,7 @@ const getChildrenId = (row, arrBox) => {
})
}
// 提交
-const authDataEnter = async() => {
+const authDataEnter = async () => {
const res = await setDataAuthority(props.row)
if (res.code === 0) {
ElMessage({ type: 'success', message: '资源设置成功' })
diff --git a/src/view/superAdmin/authority/components/menus.vue b/src/view/superAdmin/authority/components/menus.vue
index e22adc5..b13b832 100644
--- a/src/view/superAdmin/authority/components/menus.vue
+++ b/src/view/superAdmin/authority/components/menus.vue
@@ -1,53 +1,26 @@
-
- 确 定
+
+ 确 定
-
-
+
+
{{ node.label }}
- setDefault(data)"
- >
- {{ row.defaultRouter === data.name?"首页":"设为首页" }}
+ setDefault(data)">
+ {{ row.defaultRouter === data.name ? "首页" : "设为首页" }}
- OpenBtn(data)"
- >
+ OpenBtn(data)">
分配按钮
@@ -56,37 +29,16 @@
-
-
-
-
-
+
+
+
+
+
@@ -95,9 +47,7 @@