|
|
@@ -27,16 +27,35 @@
|
|
|
</template>
|
|
|
|
|
|
<template v-if="column.dataIndex === 'action'">
|
|
|
- <a-button size="small" @click="handleDetail(record)" style="margin-right: 5px">详情</a-button>
|
|
|
+<!-- <a-button size="small" @click="handleDetail(record)" style="margin-right: 5px">详情</a-button>-->
|
|
|
<a-button size="small" @click="handleEdit(record)" style="margin-right: 5px">编辑</a-button>
|
|
|
- <a-popover v-model:visible="popoverVisibles[record.collegeId]" title="确定删除?" trigger="click">
|
|
|
+ <a-popover v-model:visible="popoverVisibles[record.noticeId]" title="确定发布?" trigger="click">
|
|
|
<template #content>
|
|
|
- <a-button style="margin-right: 10px" type="primary" @click="handleShelf(record,1)">确定
|
|
|
+ <a-button style="margin-right: 10px" type="primary" @click="handlePulish(record)">确定
|
|
|
</a-button>
|
|
|
- <a-button @click="()=>{ popoverVisibles[record.collegeId] = false}">取消</a-button>
|
|
|
+ <a-button @click="()=>{ popoverVisibles[record.noticeId] = false}">取消</a-button>
|
|
|
</template>
|
|
|
<!-- <a-button size="small" style="margin-right: 5px">选择</a-button>-->
|
|
|
- <a-button size="small" @click="handleDelete(record)" style="margin-right: 5px">删除</a-button>
|
|
|
+ <a-button v-if="record.noticeStatus == 0" size="small" style="margin-right: 5px">发布</a-button>
|
|
|
+ </a-popover>
|
|
|
+ <a-popover v-model:visible="popoverNotVisibles[record.noticeId]" title="确定取消?" trigger="click">
|
|
|
+ <template #content>
|
|
|
+ <a-button style="margin-right: 10px" type="primary" @click="handleNotPulish(record)">确定
|
|
|
+ </a-button>
|
|
|
+ <a-button @click="()=>{ popoverNotVisibles[record.noticeId] = false}">取消</a-button>
|
|
|
+ </template>
|
|
|
+ <!-- <a-button size="small" style="margin-right: 5px">选择</a-button>-->
|
|
|
+ <a-button v-if="record.noticeStatus == 1" size="small" style="margin-right: 5px">取消发布</a-button>
|
|
|
+ </a-popover>
|
|
|
+
|
|
|
+ <a-popover v-model:visible="popoverDelVisibles[record.noticeId]" title="确定删除?" trigger="click">
|
|
|
+ <template #content>
|
|
|
+ <a-button style="margin-right: 10px" type="primary" @click="handleDelete(record)">确定
|
|
|
+ </a-button>
|
|
|
+ <a-button @click="()=>{ popoverDelVisibles[record.noticeId] = false}">取消</a-button>
|
|
|
+ </template>
|
|
|
+ <!-- <a-button size="small" style="margin-right: 5px">选择</a-button>-->
|
|
|
+ <a-button size="small" style="margin-right: 5px">删除</a-button>
|
|
|
</a-popover>
|
|
|
</template>
|
|
|
</template>
|
|
|
@@ -56,7 +75,7 @@
|
|
|
import tool from '@/utils/tool'
|
|
|
import {ref, onMounted} from 'vue'
|
|
|
import {EyeOutlined, EditOutlined, SnippetsOutlined, DeleteOutlined} from '@ant-design/icons-vue'
|
|
|
-import {list} from '@/api/notice'
|
|
|
+import {list, courceDownList, publish, cancel} from '@/api/notice'
|
|
|
import {useRouter} from 'vue-router'
|
|
|
import collegeApi from '@/api/college'
|
|
|
import {updateCourseStatus} from '@/api/course/courseDetail'
|
|
|
@@ -70,6 +89,8 @@ const loading = ref(false) // 列表loading
|
|
|
const dataSources = ref([])
|
|
|
const popoverVisible = ref({})
|
|
|
const popoverVisibles = ref({})
|
|
|
+const popoverNotVisibles = ref({})
|
|
|
+const popoverDelVisibles = ref({})
|
|
|
const formState = ref({
|
|
|
name: '',
|
|
|
loacl: ''
|
|
|
@@ -78,25 +99,25 @@ const columns = [
|
|
|
{
|
|
|
title: '公告标题',
|
|
|
dataIndex: 'title',
|
|
|
- sorter: true,
|
|
|
+ // sorter: true,
|
|
|
width: '15%'
|
|
|
},
|
|
|
{
|
|
|
title: '内容',
|
|
|
dataIndex: 'content',
|
|
|
- sorter: true,
|
|
|
+ // sorter: true,
|
|
|
width: '15%'
|
|
|
},
|
|
|
{
|
|
|
title: '发布时间',
|
|
|
dataIndex: 'createTime',
|
|
|
- sorter: true,
|
|
|
+ // sorter: true,
|
|
|
width: '12%'
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
- sorter: true,
|
|
|
+ // sorter: true,
|
|
|
width: '10%'
|
|
|
}
|
|
|
]
|
|
|
@@ -140,11 +161,25 @@ const handleEdit = (record) => {
|
|
|
|
|
|
emit('handleEdit', record)
|
|
|
}
|
|
|
+const handlePulish = (record) => {
|
|
|
+ console.log('编辑记录', record)
|
|
|
+ popoverVisibles.value[record.noticeId] = false
|
|
|
+ publish({noticeId :record.noticeId }).then((res)=>{
|
|
|
+ getList()
|
|
|
+ })
|
|
|
+}
|
|
|
+const handleNotPulish = (record) => {
|
|
|
+ console.log('编辑记录', record)
|
|
|
+ popoverNotVisibles.value[record.noticeId] = false
|
|
|
+ cancel({noticeId :record.noticeId }).then((res)=>{
|
|
|
+ getList()
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
// 上架按钮点击事件
|
|
|
const handleShelf = (record,num) => {
|
|
|
console.log('上架记录', record)
|
|
|
- popoverVisible.value[record.collegeId] = false
|
|
|
+ popoverVisible.value[record.noticeId] = false
|
|
|
// 在这里添加上架记录的逻辑
|
|
|
// {
|
|
|
// "courseId": "1948183431150227458",
|
|
|
@@ -159,6 +194,10 @@ const handleShelf = (record,num) => {
|
|
|
// 删除按钮点击事件
|
|
|
const handleDelete = (record) => {
|
|
|
console.log('删除记录', record)
|
|
|
+ popoverDelVisibles.value[record.noticeId] = false
|
|
|
+ courceDownList({noticeId :record.noticeId }).then((res)=>{
|
|
|
+ getList()
|
|
|
+ })
|
|
|
// 在这里添加删除记录的逻辑
|
|
|
}
|
|
|
const getList = () => {
|