feat:情报论坛-市情报指有置顶功能
This commit is contained in:
@ -75,3 +75,9 @@ export function spliceString(targetArr){
|
||||
}
|
||||
return currentStr
|
||||
}
|
||||
/** 是否是市情指(市情报指挥) */
|
||||
export function isShiQingZhi() {
|
||||
const { deptBizType, deptLevel } = getItem('deptId')?.[0] || {}
|
||||
const Jb = deptLevel?.[0] == '2' ? '01' : deptLevel?.[0] == '3' ? '02' : '03'
|
||||
return deptBizType == '23' && Jb == '01'
|
||||
}
|
||||
|
||||
@ -21,7 +21,8 @@
|
||||
</div>
|
||||
<div class="post-images">
|
||||
<div class="image-list">
|
||||
<div v-for="(img, imgIndex) in item.tp" :key="imgIndex" class="image-item" v-if="item.tp && item.tp.length > 0">
|
||||
<div v-for="(img, imgIndex) in item.tp" :key="imgIndex" class="image-item"
|
||||
v-if="item.tp && item.tp.length > 0">
|
||||
<el-image :src="setAddress(img)" show-progress>
|
||||
<template #error>
|
||||
<div class="image-slot error">
|
||||
@ -34,7 +35,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: flex-end;margin-bottom: 10px;" v-if="sfzh == item.fbrsfzh">
|
||||
<div style="display: flex;justify-content: flex-end;margin-bottom: 10px;" v-if="sfzh == item.fbrsfzh||isShiQingZhi()">
|
||||
<el-button type="text" size="small" class="action-btn edit-btn" @click.stop="handleEdit(item)">
|
||||
<el-icon>
|
||||
<Edit />
|
||||
@ -45,6 +46,12 @@
|
||||
<Delete />
|
||||
</el-icon> 删除
|
||||
</el-button>
|
||||
<el-button v-if="isShiQingZhi()" type="text" size="small" class="action-btn delete-btn"
|
||||
@click.stop="handleSetTop(item)">
|
||||
<el-icon>
|
||||
<Top />
|
||||
</el-icon> {{ item.sfzd == 1 ? '取消置顶' : '置顶' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -70,12 +77,14 @@
|
||||
import Release from './release.vue'
|
||||
import { setAddress } from '@/utils/tools'
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { tbGsxtXxltSelectPage, tbGsxtXxltDelete ,tbGsxtXxltHfid} from '@/api/tbGsxtXxltHf'
|
||||
import { tbGsxtXxltSelectPage, tbGsxtXxltDelete, tbGsxtXxltHfid, tbGsxtXxltUpdate } from '@/api/tbGsxtXxltHf'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Edit, Delete, Document } from '@element-plus/icons-vue'
|
||||
import { getItem } from '@/utils/storage.js'
|
||||
import Particulars from "./particulars.vue";
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { isShiQingZhi } from "@/utils/auth.js"
|
||||
|
||||
const route = useRoute()
|
||||
const particulars = ref()
|
||||
const showModel = ref(false)
|
||||
@ -156,6 +165,31 @@ const handleDelete = (item) => {
|
||||
ElMessage({ message: '已取消删除', type: 'info' })
|
||||
})
|
||||
}
|
||||
/** 置顶帖子 */
|
||||
const handleSetTop = (item) => {
|
||||
ElMessageBox.confirm(
|
||||
`确定要置顶帖子「${item.title}」吗?`,
|
||||
'置顶确认',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
).then(async () => {
|
||||
const detail = await tbGsxtXxltHfid(item.id)
|
||||
detail.sfzd = item.sfzd === 1 ? 0 : 1
|
||||
tbGsxtXxltUpdate(detail).then(res => {
|
||||
if (res) {
|
||||
ElMessage({ message: `帖子「${item.title}」已置顶`, type: 'success' })
|
||||
SaveReport() // 置顶后刷新列表
|
||||
} else {
|
||||
ElMessage({ message: `置顶帖子「${item.title}」失败:${res.msg || '未知错误'}`, type: 'error' })
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
ElMessage({ message: '已取消置顶', type: 'info' })
|
||||
})
|
||||
}
|
||||
const load = () => {
|
||||
|
||||
if (listQuery.pageCurrent * listQuery.pageSize < total.value) {
|
||||
|
||||
Reference in New Issue
Block a user