|
@@ -60,6 +60,14 @@
|
|
|
<el-button link type="primary" size="small" @click="() => Add(scope.row, catalogData)">
|
|
|
添加
|
|
|
</el-button>
|
|
|
+ <el-popconfirm
|
|
|
+ @confirm="publishAsTreeFunc(scope.row.catalogId)"
|
|
|
+ title="确定发布该栏目吗?"
|
|
|
+ >
|
|
|
+ <template #reference>
|
|
|
+ <el-button link type="primary" size="small">发布</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
<el-popconfirm @confirm="deleteSiteFun(scope.row.catalogId)" title="确定删除该栏目吗?">
|
|
|
<template #reference>
|
|
|
<el-button link type="primary" size="small">删除</el-button>
|
|
@@ -88,7 +96,14 @@ import type { SiteList } from '@/types/Site'
|
|
|
import type { CatalogTreeOri } from '@/types/Catalog'
|
|
|
import { reactive, ref } from 'vue'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
-import { getSiteList, deleteAsTree, getAsTree, updateAsTree, createAsTree } from '@/api/index'
|
|
|
+import {
|
|
|
+ getSiteList,
|
|
|
+ deleteAsTree,
|
|
|
+ getAsTree,
|
|
|
+ updateAsTree,
|
|
|
+ createAsTree,
|
|
|
+ publishAsTree,
|
|
|
+} from '@/api/index'
|
|
|
|
|
|
import { formatDateSite } from '@/tool/index'
|
|
|
|
|
@@ -174,6 +189,22 @@ const saveEdit = (row: CatalogTreeOri) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const publishAsTreeFunc = (id: number) => {
|
|
|
+ loading.value = true
|
|
|
+ publishAsTree(id)
|
|
|
+ .then(() => {
|
|
|
+ loading.value = false
|
|
|
+ show(mediaId[0], mediaId[1])
|
|
|
+ ElMessage({
|
|
|
+ message: '发布成功',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
const Add = (row: CatalogTreeOri, list: CatalogTreeOri[]) => {
|
|
|
const sonItem: CatalogTreeOri = { isEdit: true, parentId: row.catalogId, mediaId: row.mediaId }
|
|
|
for (let i = 0; i < list.length; i++) {
|