feat(richedit): 新增聚类资讯展示功能并优化表格组件

- 在tableComponents组件中添加树形表格功能,支持展示聚类资讯
- 新增zTable组件用于展示聚类资讯子表
- 优化表格样式和布局,添加聚类资讯标题展示
- 添加showHeader属性控制表格头部显示
This commit is contained in:
34701892@qq.com 2025-11-29 14:42:20 +08:00
parent 9e740a4780
commit 9d07061ea6
3 changed files with 676 additions and 174 deletions

View File

@ -1,6 +1,14 @@
<template> <template>
<div class="cu_table"> <div class="cu_table">
<el-table ref="tableRef" :data="tableData.data" v-loading="tableLoading" style="font-size: 12px" <!-- :cell-class-name="cellClassName" -->
<!-- :tree-props="{ children: 'clusterNews', hasChildren: true }" -->
<el-table
:show-header="showHeader"
ref="tableRef"
:data="tableData.data"
v-loading="tableLoading"
style="font-size: 12px"
:cell-style="{ fontWeight: '400', fontSize: '14px', color: 'rgba(0,0,0,0.65)', height: '46px' }" :cell-style="{ fontWeight: '400', fontSize: '14px', color: 'rgba(0,0,0,0.65)', height: '46px' }"
:header-cell-style="{ :header-cell-style="{
height: '46px', height: '46px',
@ -9,12 +17,27 @@
fontWeight: '400', fontWeight: '400',
fontSize: '14px', fontSize: '14px',
color: ' rgba(0,0,0,0.85)', color: ' rgba(0,0,0,0.85)',
}" @selection-change="selectionChange" @sort-change="sortChange" size="small"> }"
@selection-change="selectionChange"
@sort-change="sortChange"
size="small"
row-key="id"
:cell-class-name="cellClassName"
:tree-props="{ children: 'clusterNews', hasChildren: true }"
>
<slot></slot> <slot></slot>
</el-table> </el-table>
<el-pagination background style="margin-top: 24px" layout="slot, ->,sizes,prev, pager, next, jumper" <el-pagination
:page-sizes="[10, 20, 50, 100]" v-model:page-size="tableData.size" :total="tableData.total" background
v-model:current-page="tableData.page" @current-change="currentChange" @size-change="sizeChange"> style="margin-top: 24px"
layout="slot, ->,sizes,prev, pager, next, jumper"
:page-sizes="[10, 20, 50, 100]"
v-model:page-size="tableData.size"
:total="tableData.total"
v-model:current-page="tableData.page"
@current-change="currentChange"
@size-change="sizeChange"
>
<div style="font-size: 14px; color: rgba(0, 0, 0, 0.6)"> {{ tableData.total }} 项数据</div> <div style="font-size: 14px; color: rgba(0, 0, 0, 0.6)"> {{ tableData.total }} 项数据</div>
</el-pagination> </el-pagination>
</div> </div>
@ -27,7 +50,7 @@ const props = defineProps({
// //
tableData: { tableData: {
type: Object, type: Object,
default: () => { }, default: () => {},
}, },
tableLoading: { tableLoading: {
type: Boolean, type: Boolean,
@ -37,6 +60,10 @@ const props = defineProps({
type: Number, type: Number,
default: 1, default: 1,
}, },
showHeader: {
type: Boolean,
default: true,
},
}); });
const emit = defineEmits(['currentChange', 'selectionChange', 'sizeChange', 'sortChange']); const emit = defineEmits(['currentChange', 'selectionChange', 'sizeChange', 'sortChange']);
@ -68,20 +95,27 @@ function toggleRowSelection(row, isCheck) {
} }
function clearSort() { function clearSort() {
console.log("🚀 ~ clearSort ~ clearSort:", clearSort) console.log('🚀 ~ clearSort ~ clearSort:', clearSort);
tableRef.value.clearSort(); tableRef.value.clearSort();
} }
function cellClassName({ row, column, rowIndex, columnIndex }) {
console.log('🚀 ~ cellClassName ~ rowIndex:', rowIndex);
console.log('🚀 ~ cellClassName ~ row:', row.title);
if (row.isChild) {
return 'first-cell';
}
}
defineExpose({ defineExpose({
clearSelection, clearSelection,
toggleRowSelection, toggleRowSelection,
clearSort clearSort,
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.cu_table { .cu_table {
// border-radius: 10px; // border-radius: 10px;
// margin: 10px; // margin: 10px;
&::after { &::after {
@ -124,4 +158,12 @@ defineExpose({
border: 1px solid #dcdcdc; border: 1px solid #dcdcdc;
border-radius: 4px; border-radius: 4px;
} }
// .el-table :deep(.first-cell) {
// background-color: red;
// }
:deep(.el-table__row--level-1) {
background-color: #f0f0f0;
}
</style> </style>

View File

@ -6,14 +6,18 @@
<!-- 普通管理员和审核人员的筛选条件不一样普通管理员是资讯精选其他是资讯审核 --> <!-- 普通管理员和审核人员的筛选条件不一样普通管理员是资讯精选其他是资讯审核 -->
<!-- 普通管理员的筛选 start --> <!-- 普通管理员的筛选 start -->
<div style="width: 100%; display: flex; align-items: flex-end" <div style="width: 100%; display: flex; align-items: flex-end" v-if="Session.get('userInfoLocal').userType != '00'">
v-if="Session.get('userInfoLocal').userType != '00'">
<el-button type="primary" style="margin-bottom: 10px" @click="restData">清空条件</el-button> <el-button type="primary" style="margin-bottom: 10px" @click="restData">清空条件</el-button>
<div class="colHeader-right" :style="{ alignItems: 'flex-end', minWidth: '700px' }"> <div class="colHeader-right" :style="{ alignItems: 'flex-end', minWidth: '700px' }">
<el-space :size="12" class="colHeader-right-1"> <el-space :size="12" class="colHeader-right-1">
<el-input v-model="form.keyword" placeholder="输入标题/内容关键字进行搜索(以空格隔开)" class="input-with-select" <el-input
@keyup.enter="handleSearch" style="width: 455px"> v-model="form.keyword"
placeholder="输入标题/内容关键字进行搜索(以空格隔开)"
class="input-with-select"
@keyup.enter="handleSearch"
style="width: 455px"
>
<template #append> <template #append>
<el-button icon="Search" @click="handleSearch" /> <el-button icon="Search" @click="handleSearch" />
</template> </template>
@ -21,15 +25,32 @@
<div> <div>
<span>行业分类</span> <span>行业分类</span>
<el-tree-select v-model="form.industry" :data="industryList" multiple <el-tree-select
:render-after-expand="false" filterable show-checkbox style="width: 240px" v-model="form.industry"
@check="handleCheckChange" @clear="handleSearch" node-key="id" collapse-tags :data="industryList"
collapse-tags-tooltip clearable :props="defaultProps"> multiple
:render-after-expand="false"
filterable
show-checkbox
style="width: 240px"
@check="handleCheckChange"
@clear="handleSearch"
node-key="id"
collapse-tags
collapse-tags-tooltip
clearable
:props="defaultProps"
>
</el-tree-select> </el-tree-select>
</div> </div>
<el-input v-model="form.tag" placeholder="匹配多个概念标签(以空格隔开)" class="input-with-select" <el-input
@keyup.enter="handleSearch" style="width: 280px"> v-model="form.tag"
placeholder="匹配多个概念标签(以空格隔开)"
class="input-with-select"
@keyup.enter="handleSearch"
style="width: 280px"
>
<template #append> <template #append>
<el-button icon="Search" @click="handleSearch" /> <el-button icon="Search" @click="handleSearch" />
</template> </template>
@ -37,27 +58,54 @@
</el-space> </el-space>
<div class="colHeader-right-2"> <div class="colHeader-right-2">
<el-date-picker v-model="daterange" type="daterange" range-separator="" <el-date-picker
value-format="YYYY-MM-DD" start-placeholder="选择报道时间" end-placeholder="选择报道时间" v-model="daterange"
style="margin-right: 12px" @change="handleSearch" /> type="daterange"
range-separator="至"
value-format="YYYY-MM-DD"
start-placeholder="选择报道时间"
end-placeholder="选择报道时间"
style="margin-right: 12px"
@change="handleSearch"
/>
<el-select-v2 v-model="form.mediaId" :options="tagSourceList" clearable placeholder="媒体来源" <el-select-v2
size="large" style="width: 240px" filterable @change="handleSearch" /> v-model="form.mediaId"
:options="tagSourceList"
clearable
placeholder="媒体来源"
size="large"
style="width: 240px"
filterable
@change="handleSearch"
/>
<el-select clearable v-model="form.deleted" size="large" style="width: 150px; margin-left: 10px" <el-select
v-if="Session.get('userInfoLocal').userType == '00'" placeholder="筛选删除状态" clearable
@change="handleSearch"> v-model="form.deleted"
size="large"
style="width: 150px; margin-left: 10px"
v-if="Session.get('userInfoLocal').userType == '00'"
placeholder="筛选删除状态"
@change="handleSearch"
>
<el-option :value="1" label="已删除资讯"></el-option> <el-option :value="1" label="已删除资讯"></el-option>
<el-option :value="0" label="未删除资讯"></el-option> <el-option :value="0" label="未删除资讯"></el-option>
</el-select> </el-select>
<div style="margin-left: 12px; display: flex; flex-wrap: nowrap; align-items: center"> <div style="margin-left: 12px; display: flex; flex-wrap: nowrap; align-items: center">
<span>评分范围</span> <span>评分范围</span>
<el-input type="number" v-model="form.minScore" style="width: 80px" placeholder="最低" <el-input
:min="0" :max="100" @keyup.enter="handleSearch" /> type="number"
v-model="form.minScore"
style="width: 80px"
placeholder="最低"
:min="0"
:max="100"
@keyup.enter="handleSearch"
/>
<i style="color: #ccc"> - </i> <i style="color: #ccc"> - </i>
<el-input type="number" v-model="form.maxScore" style="width: 140px" placeholder="最高" <el-input type="number" v-model="form.maxScore" style="width: 140px" placeholder="最高" :min="0" :max="100" @keyup.enter="handleSearch">
:min="0" :max="100" @keyup.enter="handleSearch">
<template #append> <template #append>
<el-button icon="Search" @click="handleSearch" /> <el-button icon="Search" @click="handleSearch" />
</template> </template>
@ -71,8 +119,13 @@
<div class="colHeader-right"> <div class="colHeader-right">
<el-space :size="12" class="colHeader-right-1"> <el-space :size="12" class="colHeader-right-1">
<span>标题检索</span> <span>标题检索</span>
<el-input v-model="form.keyword" placeholder="输入标题/内容关键字进行搜索(以空格隔开)" class="input-with-select" <el-input
@keyup.enter="handleSearch" style="width: 500px"> v-model="form.keyword"
placeholder="输入标题/内容关键字进行搜索(以空格隔开)"
class="input-with-select"
@keyup.enter="handleSearch"
style="width: 500px"
>
<template #append> <template #append>
<el-button icon="Search" @click="handleSearch" /> <el-button icon="Search" @click="handleSearch" />
</template> </template>
@ -80,15 +133,32 @@
<div> <div>
<span>行业分类</span> <span>行业分类</span>
<el-tree-select v-model="form.industry" :data="industryList" multiple <el-tree-select
:render-after-expand="false" filterable show-checkbox style="width: 240px" v-model="form.industry"
@check="handleCheckChange" @clear="handleSearch" node-key="id" collapse-tags :data="industryList"
collapse-tags-tooltip clearable :props="defaultProps"> multiple
:render-after-expand="false"
filterable
show-checkbox
style="width: 240px"
@check="handleCheckChange"
@clear="handleSearch"
node-key="id"
collapse-tags
collapse-tags-tooltip
clearable
:props="defaultProps"
>
</el-tree-select> </el-tree-select>
</div> </div>
<el-input v-model="form.tag" placeholder="匹配多个概念标签(以空格隔开)" class="input-with-select" <el-input
@keyup.enter="handleSearch" style="width: 280px"> v-model="form.tag"
placeholder="匹配多个概念标签(以空格隔开)"
class="input-with-select"
@keyup.enter="handleSearch"
style="width: 280px"
>
<template #append> <template #append>
<el-button icon="Search" @click="handleSearch" /> <el-button icon="Search" @click="handleSearch" />
</template> </template>
@ -97,30 +167,68 @@
<div class="colHeader-right-2" style="gap: 10px"> <div class="colHeader-right-2" style="gap: 10px">
<span>信号规则</span> <span>信号规则</span>
<el-select v-model="form.includeRuleIds" clearable placeholder="含任一信号规则" multiple size="large" <el-select
style="width: 180px" filterable @change="signalChange($event, 1)"> v-model="form.includeRuleIds"
<el-option v-for="item in signalRulesList" :key="item.id" :value="item.id" clearable
:disabled="form.excludeRuleIds?.includes(item.id)" :label="item.ruleName"></el-option> placeholder="含任一信号规则"
multiple
size="large"
style="width: 180px"
filterable
@change="signalChange($event, 1)"
>
<el-option
v-for="item in signalRulesList"
:key="item.id"
:value="item.id"
:disabled="form.excludeRuleIds?.includes(item.id)"
:label="item.ruleName"
></el-option>
</el-select> </el-select>
<el-select v-model="form.excludeRuleIds" clearable placeholder="不含任一信号规则" multiple size="large" <el-select
style="width: 180px" filterable @change="signalChange($event, 2)"> v-model="form.excludeRuleIds"
<el-option v-for="item in signalRulesList" :key="item.id" :value="item.id" clearable
:disabled="form.includeRuleIds?.includes(item.id)" :label="item.ruleName"></el-option> placeholder="不含任一信号规则"
multiple
size="large"
style="width: 180px"
filterable
@change="signalChange($event, 2)"
>
<el-option
v-for="item in signalRulesList"
:key="item.id"
:value="item.id"
:disabled="form.includeRuleIds?.includes(item.id)"
:label="item.ruleName"
></el-option>
</el-select> </el-select>
<span>报道时间</span> <span>报道时间</span>
<div> <div>
<el-date-picker v-model="daterange" type="daterange" range-separator="-" <el-date-picker
value-format="YYYY-MM-DD" start-placeholder="选择报道时间" end-placeholder="选择报道时间" v-model="daterange"
@change="handleSearch" /> type="daterange"
range-separator="-"
value-format="YYYY-MM-DD"
start-placeholder="选择报道时间"
end-placeholder="选择报道时间"
@change="handleSearch"
/>
</div> </div>
<div style="display: flex; flex-wrap: nowrap; align-items: center"> <div style="display: flex; flex-wrap: nowrap; align-items: center">
<span>评分范围</span> <span>评分范围</span>
<el-input type="number" v-model="form.minScore" style="width: 80px" placeholder="最低" <el-input
:min="0" :max="100" @keyup.enter="handleSearch" /> type="number"
v-model="form.minScore"
style="width: 80px"
placeholder="最低"
:min="0"
:max="100"
@keyup.enter="handleSearch"
/>
<i style="color: #ccc"> - </i> <i style="color: #ccc"> - </i>
<el-input type="number" v-model="form.maxScore" style="width: 140px" placeholder="最高" <el-input type="number" v-model="form.maxScore" style="width: 140px" placeholder="最高" :min="0" :max="100" @keyup.enter="handleSearch">
:min="0" :max="100" @keyup.enter="handleSearch">
<template #append> <template #append>
<el-button icon="Search" @click="handleSearch" /> <el-button icon="Search" @click="handleSearch" />
</template> </template>
@ -130,8 +238,16 @@
<div class="colHeader-right-2" style="gap: 10px"> <div class="colHeader-right-2" style="gap: 10px">
<span>媒体来源</span> <span>媒体来源</span>
<el-select-v2 v-model="form.mediaId" :options="tagSourceList" clearable placeholder="媒体来源" <el-select-v2
size="large" style="width: 180px" filterable @change="handleSearch" /> v-model="form.mediaId"
:options="tagSourceList"
clearable
placeholder="媒体来源"
size="large"
style="width: 180px"
filterable
@change="handleSearch"
/>
<span>企业检索</span> <span>企业检索</span>
<!-- <el-select <!-- <el-select
v-model="form.companyName" v-model="form.companyName"
@ -147,24 +263,49 @@
<el-option></el-option> <el-option></el-option>
</el-select> --> </el-select> -->
<el-select class="search-input" popper-class="option-box" v-model="form.companyName" clearable <el-select
filterable remote reserve-keyword remote-show-suffix default-first-option class="search-input"
:suffix-icon="Search" placeholder="输入企业名称/企业简称/证券编码进行搜索" :loading="loading" popper-class="option-box"
:remote-method="getCompany" @change="getData" style="width: 180px"> v-model="form.companyName"
<el-option v-for="item in companyList" :key="item.companyName" :label="item.companyName" clearable
:value="item.companyName"> </el-option> filterable
remote
reserve-keyword
remote-show-suffix
default-first-option
:suffix-icon="Search"
placeholder="输入企业名称/企业简称/证券编码进行搜索"
:loading="loading"
:remote-method="getCompany"
@change="getData"
style="width: 180px"
>
<el-option v-for="item in companyList" :key="item.companyName" :label="item.companyName" :value="item.companyName"> </el-option>
</el-select> </el-select>
<span>独家资讯</span> <span>独家资讯</span>
<el-select v-model="form.exclusive" clearable placeholder="是否独家搜索" size="large" <el-select
style="width: 180px" filterable @change="handleSearch"> v-model="form.exclusive"
clearable
placeholder="是否独家搜索"
size="large"
style="width: 180px"
filterable
@change="handleSearch"
>
<el-option :value="1" label="是"></el-option> <el-option :value="1" label="是"></el-option>
<el-option :value="0" label="否"></el-option> <el-option :value="0" label="否"></el-option>
</el-select> </el-select>
<span>删除状态</span> <span>删除状态</span>
<el-select clearable v-model="form.deleted" size="large" style="width: 150px; margin-left: 10px" <el-select
placeholder="筛选删除状态" @change="handleSearch"> clearable
v-model="form.deleted"
size="large"
style="width: 150px; margin-left: 10px"
placeholder="筛选删除状态"
@change="handleSearch"
>
<el-option :value="1" label="已删除资讯"></el-option> <el-option :value="1" label="已删除资讯"></el-option>
<el-option :value="0" label="未删除资讯"></el-option> <el-option :value="0" label="未删除资讯"></el-option>
</el-select> </el-select>
@ -175,16 +316,32 @@
</div> </div>
</div> </div>
<tableComponents ref="tableRef" :tableData="tableData" style="margin-top: 20px" @sortChange="sortChange" <tableComponents
:tableLoading="tableLoading" @currentChange="currentChange" @sizeChange="sizeChange"> ref="tableRef"
:tableData="tableData"
style="margin-top: 20px"
@sortChange="sortChange"
:tableLoading="tableLoading"
@currentChange="currentChange"
@sizeChange="sizeChange"
>
<!-- <el-table-column type="expand">
<template v-slot="scope">
<z-table :tableData="{ data: scope.row.clusterNews }" style="margin-left: 50px; width: 100%"></z-table>
</template>
</el-table-column> -->
<el-table-column prop="title" label="标题" align="left" width="380"> <el-table-column prop="title" label="标题" align="left" width="380">
<template v-slot="scope"> <template v-slot="scope">
<div style="display: flex; flex-direction: column; gap: 5px; padding: 10px 0"> <div style="display: flex; flex-direction: column; justify-content: flex-start; align-items: start; gap: 5px; padding: 10px 0">
<div
v-if="scope.row.isChild && scope.row.clusterIndex == 0"
style="font-size: 14px; font-weight: bold; margin-left: -20px; margin-bottom: 30px"
>
聚类资讯{{ scope.row.childLength }}
</div>
<div> <div>
<span style="color: red; font-weight: bold; margin-right: 3px" <span style="color: red; font-weight: bold; margin-right: 3px; flex-wrap: nowrap" v-if="scope.row.exclusive == 1">[独家]</span>
v-if="scope.row.exclusive == 1">[独家]</span> <span class="cursor-pointer" @click="goDetail(1, scope.row, true)" v-html="scope.row.title"></span>
<span class="cursor-pointer" @click="goDetail(1, scope.row, true)"
v-html="scope.row.title"></span>
</div> </div>
<div class="labels" v-if="Session.get('userInfoLocal').userType == '00'"> <div class="labels" v-if="Session.get('userInfoLocal').userType == '00'">
@ -209,12 +366,10 @@
</div> </div>
</div> --> </div> -->
<div style="background-color: #eee6cd" class="label_item" <div style="background-color: #eee6cd" class="label_item" v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0">
v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0">
{{ scope.row.conceptLabels[0] }} {{ scope.row.conceptLabels[0] }}
</div> </div>
<div style="background-color: #cfdcf3" class="label_item" <div style="background-color: #cfdcf3" class="label_item" v-if="scope.row.industryLabels && scope.row.industryLabels.length > 0">
v-if="scope.row.industryLabels && scope.row.industryLabels.length > 0">
{{ scope.row.industryLabels[0] }} {{ scope.row.industryLabels[0] }}
</div> </div>
</div> </div>
@ -222,8 +377,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="信号规则" align="center" width="120" <el-table-column label="信号规则" align="center" width="120" v-if="Session.get('userInfoLocal').userType == '00'">
v-if="Session.get('userInfoLocal').userType == '00'">
<template v-slot="scope"> <template v-slot="scope">
<div v-if="scope.row.ruleName && scope.row.ruleName.length > 0"> <div v-if="scope.row.ruleName && scope.row.ruleName.length > 0">
<div v-for="item in scope.row.ruleName" :key="item" class="label_item"> <div v-for="item in scope.row.ruleName" :key="item" class="label_item">
@ -234,8 +388,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="媒体来源" align="center" width="120" <el-table-column label="媒体来源" align="center" width="120" v-if="Session.get('userInfoLocal').userType == '00'">
v-if="Session.get('userInfoLocal').userType == '00'">
<template v-slot="scope"> <template v-slot="scope">
<div v-if="scope.row.sourceName"> <div v-if="scope.row.sourceName">
{{ scope.row.sourceName }} {{ scope.row.sourceName }}
@ -265,16 +418,18 @@
<div v-else> <div v-else>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item :command="null">全部</el-dropdown-item> <el-dropdown-item :command="null">全部</el-dropdown-item>
<el-dropdown-item :command="1" <el-dropdown-item :command="1" v-if="Session.get('userInfoLocal').userType == '00'">未发布</el-dropdown-item>
v-if="Session.get('userInfoLocal').userType == '00'">未发布</el-dropdown-item>
<el-dropdown-item :command="3" <el-dropdown-item :command="3" v-if="Session.get('userInfoLocal').userType != '01'">审核中</el-dropdown-item>
v-if="Session.get('userInfoLocal').userType != '01'">审核中</el-dropdown-item> <el-dropdown-item :command="4" v-if="Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'"
<el-dropdown-item :command="4" >已二审</el-dropdown-item
v-if="Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'">已二审</el-dropdown-item> >
<el-dropdown-item :command="2">已发布</el-dropdown-item> <el-dropdown-item :command="2">已发布</el-dropdown-item>
<el-dropdown-item :command="-1" <el-dropdown-item
v-if="Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'">退改中</el-dropdown-item> :command="-1"
v-if="Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'"
>退改中</el-dropdown-item
>
</el-dropdown-menu> </el-dropdown-menu>
</div> </div>
</template> </template>
@ -283,8 +438,7 @@
<template v-slot="scope"> <template v-slot="scope">
<!-- 新闻状态 0-草稿 1-未发布 2-已发布 --> <!-- 新闻状态 0-草稿 1-未发布 2-已发布 -->
<div class="r_point" :style="{ color: '#000' }"> <div class="r_point" :style="{ color: '#000' }">
<div class="point" :style="{ backgroundColor: scope.row.status == 2 ? '#52C41A' : '#D9D9D9' }"> <div class="point" :style="{ backgroundColor: scope.row.status == 2 ? '#52C41A' : '#D9D9D9' }"></div>
</div>
<text v-if="scope.row.status == 0" style="color: rgba(0, 0, 0, 0.65)">草稿</text> <text v-if="scope.row.status == 0" style="color: rgba(0, 0, 0, 0.65)">草稿</text>
<text v-if="scope.row.status == 1" style="color: rgba(0, 0, 0, 0.65)"> <text v-if="scope.row.status == 1" style="color: rgba(0, 0, 0, 0.65)">
{{ scope.row.deleted ? '已删除' : '未发布' }} {{ scope.row.deleted ? '已删除' : '未发布' }}
@ -304,8 +458,7 @@
{{ scope.row.submitter ? scope.row.submitter : '-' }} {{ scope.row.submitter ? scope.row.submitter : '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" width="120" prop="submitter" label="二校" <el-table-column align="center" width="120" prop="submitter" label="二校" v-if="Session.get('userInfoLocal').userType == '01'">
v-if="Session.get('userInfoLocal').userType == '01'">
<template v-slot="scope"> <template v-slot="scope">
{{ scope.row.submitterSecond ? scope.row.submitterSecond : '-' }} {{ scope.row.submitterSecond ? scope.row.submitterSecond : '-' }}
</template> </template>
@ -339,8 +492,7 @@
<el-table-column prop="score" label="资讯评分" sortable="custom" align="center" width="100"> <el-table-column prop="score" label="资讯评分" sortable="custom" align="center" width="100">
<template v-slot="scope"> <template v-slot="scope">
<div @click="getScoreDetail(scope.row.id)" <div @click="getScoreDetail(scope.row.id)" :class="[{ 'score-active': isAdmin && curScore === scope.row.id }, { 'score-hover': isAdmin }]">
:class="[{ 'score-active': isAdmin && curScore === scope.row.id }, { 'score-hover': isAdmin }]">
{{ scope.row.score }} {{ scope.row.score }}
</div> </div>
</template> </template>
@ -349,72 +501,71 @@
<el-table-column prop="updateTime" label="状态变动时间" sortable="custom" align="center"> <el-table-column prop="updateTime" label="状态变动时间" sortable="custom" align="center">
<template v-slot="scope"> <template v-slot="scope">
<div> <div>
<div>{{ formatTime(scope.row.updateTime) == formatTime(scope.row.createTime) ? <div>{{ formatTime(scope.row.updateTime) == formatTime(scope.row.createTime) ? scope.row.publishTime : scope.row.updateTime }}</div>
scope.row.publishTime : scope.row.updateTime }}</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="250" fixed="right"> <el-table-column label="操作" align="center" width="250" fixed="right">
<template v-slot="scope"> <template v-slot="scope">
<div class="option"> <div class="option">
<el-button v-if="scope.row.deleted" type="text" style="margin-left: -10px" <el-button v-if="scope.row.deleted" type="text" style="margin-left: -10px" @click="doRecoverFn(scope.row)">
@click="doRecoverFn(scope.row)">
<text>恢复</text> <text>恢复</text>
</el-button> </el-button>
<div v-else style="display: flex; gap: 10px; align-items: center"> <div v-else style="display: flex; gap: 10px; align-items: center">
<el-button type="text" :disabled="scope.row.status != 2" class="copyBtn" <el-button type="text" :disabled="scope.row.status != 2" class="copyBtn" @click="copyUrl(scope.row)">复制</el-button>
@click="copyUrl(scope.row)">复制</el-button>
<!-- 新闻状态 0-草稿 | 1-未发布 | 2-已发布 | 3-送审 | 4-已二审 | -1-退改中 --> <!-- 新闻状态 0-草稿 | 1-未发布 | 2-已发布 | 3-送审 | 4-已二审 | -1-退改中 -->
<div v-if="Session.get('userInfoLocal').userType == '00'"> <div v-if="Session.get('userInfoLocal').userType == '00'">
<!-- 普通账号 --> <!-- 普通账号 -->
<el-button <el-button
v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1" v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1"
type="text" @click="goDetail(1, scope.row, false)">编辑</el-button> type="text"
@click="goDetail(1, scope.row, false)"
>编辑</el-button
>
<el-button <el-button
v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1" v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1"
type="text" @click="doApprovalFn(scope.row, scope.row.status)">送审</el-button> type="text"
<el-button v-else-if="scope.row.status == 3" type="text" @click="doApprovalFn(scope.row, scope.row.status)"
@click="doApprovalFn(scope.row, scope.row.status)">撤审</el-button> >送审</el-button
>
<el-button v-else-if="scope.row.status == 3" type="text" @click="doApprovalFn(scope.row, scope.row.status)">撤审</el-button>
<el-button <el-button
v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1" v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1"
type="text" style="color: #ff1818" @click="doDeleteNewsFn(scope.row)">删除</el-button> type="text"
style="color: #ff1818"
@click="doDeleteNewsFn(scope.row)"
>删除</el-button
>
</div> </div>
<div v-if="Session.get('userInfoLocal').userType == '02'"> <div v-if="Session.get('userInfoLocal').userType == '02'">
<el-button v-if="scope.row.status == 4" type="text" <el-button v-if="scope.row.status == 4" type="text" @click="doApprovalFn(scope.row, scope.row.status)">撤审</el-button>
@click="doApprovalFn(scope.row, scope.row.status)">撤审</el-button>
<!-- 二审账号 --> <!-- 二审账号 -->
<el-button v-if="scope.row.status == 3" type="text" style="color: #ff1818" <el-button v-if="scope.row.status == 3" type="text" style="color: #ff1818" @click="doNewReturnFn(scope.row)">退改</el-button>
@click="doNewReturnFn(scope.row)">退改</el-button>
<el-button v-if="scope.row.status == 3" type="text" <el-button v-if="scope.row.status == 3" type="text" @click="goDetail(1, scope.row, false)">编辑</el-button>
@click="goDetail(1, scope.row, false)">编辑</el-button>
<el-button v-if="scope.row.status == 3" type="text" <el-button v-if="scope.row.status == 3" type="text" @click="doNewCheckFn(scope.row)">复审</el-button>
@click="doNewCheckFn(scope.row)">复审</el-button>
<el-button type="text" v-if="scope.row.status == 4" <el-button type="text" v-if="scope.row.status == 4" @click="doNewsPublishFn(scope.row, 2)">发布</el-button>
@click="doNewsPublishFn(scope.row, 2)">发布</el-button>
</div> </div>
<div v-if="Session.get('userInfoLocal').userType == '01'"> <div v-if="Session.get('userInfoLocal').userType == '01'">
<!-- 终审账号 --> <!-- 终审账号 -->
<el-button v-if="scope.row.status == 3 || scope.row.status == 4" type="text" <el-button v-if="scope.row.status == 3 || scope.row.status == 4" type="text" @click="goDetail(1, scope.row, false)">编辑</el-button>
@click="goDetail(1, scope.row, false)">编辑</el-button>
<el-button v-if="scope.row.status == 4" type="text" style="color: #ff1818" <el-button v-if="scope.row.status == 4" type="text" style="color: #ff1818" @click="doNewReturnFn(scope.row)">退改</el-button>
@click="doNewReturnFn(scope.row)">退改</el-button>
<el-button type="text" v-if="scope.row.status == 2" <el-button type="text" v-if="scope.row.status == 2" @click="doNewsPublishFn(scope.row, 1)">撤稿</el-button>
@click="doNewsPublishFn(scope.row, 1)">撤稿</el-button> <el-button type="text" v-else-if="scope.row.status != -1 && scope.row.status == 4" @click="doNewsPublishFn(scope.row, 2)"
<el-button type="text" v-else-if="scope.row.status != -1 && scope.row.status == 4" >发布</el-button
@click="doNewsPublishFn(scope.row, 2)">发布</el-button> >
<el-button v-if="scope.row.status == 3" type="text" <el-button v-if="scope.row.status == 3" type="text" style="color: #ff1818; margin-left: 5px" @click="doNewReturnFn(scope.row)"
style="color: #ff1818; margin-left: 5px" >退改</el-button
@click="doNewReturnFn(scope.row)">退改</el-button> >
</div> </div>
<!-- <el-icon size="16" @click="goRecord(scope.row)"> <!-- <el-icon size="16" @click="goRecord(scope.row)">
@ -424,7 +575,10 @@
<!-- v-if="isAdmin" --> <!-- v-if="isAdmin" -->
<el-icon <el-icon
v-if="isAdmin || Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'" v-if="isAdmin || Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'"
size="16" @click="goRecord(scope.row)" style="margin-left: 10px"> size="16"
@click="goRecord(scope.row)"
style="margin-left: 10px"
>
<Tickets /> <Tickets />
</el-icon> </el-icon>
</div> </div>
@ -433,9 +587,16 @@
</tableComponents> </tableComponents>
<keep-alive> <keep-alive>
<DetailDrawer v-model="drawer" :data="newsData" :readOnly="readOnly" :type="newstype" <DetailDrawer
@handleEditStatus="handleEditStatus" @doNewsPublishFn="doNewsPublishFn" @doDeleteNewsFn="doDeleteNewsFn" v-model="drawer"
@getData="getData" /> :data="newsData"
:readOnly="readOnly"
:type="newstype"
@handleEditStatus="handleEditStatus"
@doNewsPublishFn="doNewsPublishFn"
@doDeleteNewsFn="doDeleteNewsFn"
@getData="getData"
/>
</keep-alive> </keep-alive>
<el-dialog v-model="isScoreShow" title="资讯评分详情" width="680" center> <el-dialog v-model="isScoreShow" title="资讯评分详情" width="680" center>
@ -446,8 +607,9 @@
<el-row>[{{ scoreDetail.industryLabel.join(',') }}]</el-row> <el-row>[{{ scoreDetail.industryLabel.join(',') }}]</el-row>
<el-row justify="space-between"> <el-row justify="space-between">
<el-col :span="12">置信度[{{ scoreDetail.industryConfidence.join(',') }}]</el-col> <el-col :span="12">置信度[{{ scoreDetail.industryConfidence.join(',') }}]</el-col>
<el-col :span="12" style="text-align: right">分类评分<span style="color: #36a4f8">[{{ <el-col :span="12" style="text-align: right"
scoreDetail.industryScore.join(',') }}]</span></el-col> >分类评分<span style="color: #36a4f8">[{{ scoreDetail.industryScore.join(',') }}]</span></el-col
>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
@ -457,8 +619,9 @@
<el-row>[{{ scoreDetail.conceptLabel.join(',') }}]</el-row> <el-row>[{{ scoreDetail.conceptLabel.join(',') }}]</el-row>
<el-row justify="space-between"> <el-row justify="space-between">
<el-col :span="12">置信度[{{ scoreDetail.conceptConfidence.join(',') }}]</el-col> <el-col :span="12">置信度[{{ scoreDetail.conceptConfidence.join(',') }}]</el-col>
<el-col :span="12" style="text-align: right">概念评分<span style="color: #36a4f8">[{{ <el-col :span="12" style="text-align: right"
scoreDetail.conceptScore.join(',') }}]</span></el-col> >概念评分<span style="color: #36a4f8">[{{ scoreDetail.conceptScore.join(',') }}]</span></el-col
>
</el-row> </el-row>
</el-col> </el-col>
</el-row> </el-row>
@ -468,20 +631,21 @@
</el-row> </el-row>
<el-row class="score-detail-row"> <el-row class="score-detail-row">
<el-col :span="12">媒体影响力</el-col> <el-col :span="12">媒体影响力</el-col>
<el-col :span="12" style="text-align: right">评分<span style="color: #36a4f8">{{ <el-col :span="12" style="text-align: right"
scoreDetail.sourceImpact >评分<span style="color: #36a4f8">{{ scoreDetail.sourceImpact }}</span></el-col
}}</span></el-col> >
</el-row> </el-row>
<el-row class="score-detail-row"> <el-row class="score-detail-row">
<el-col :span="12">中国股市相关性</el-col> <el-col :span="12">中国股市相关性</el-col>
<el-col :span="12" style="text-align: right">置信度<span style="color: #36a4f8">{{ <el-col :span="12" style="text-align: right"
scoreDetail.chinaFactor >置信度<span style="color: #36a4f8">{{ scoreDetail.chinaFactor }}</span></el-col
}}</span></el-col> >
</el-row> </el-row>
<el-row class="score-detail-row"> <el-row class="score-detail-row">
<el-col :span="12">资讯质量</el-col> <el-col :span="12">资讯质量</el-col>
<el-col :span="12" style="text-align: right">评分<span style="color: #36a4f8">{{ <el-col :span="12" style="text-align: right"
scoreDetail.publicOpinionScore }}</span></el-col> >评分<span style="color: #36a4f8">{{ scoreDetail.publicOpinionScore }}</span></el-col
>
</el-row> </el-row>
<el-row class="score-detail-row rule"> <el-row class="score-detail-row rule">
<el-col :span="24">*计算规则</el-col> <el-col :span="24">*计算规则</el-col>
@ -489,9 +653,7 @@
</el-row> </el-row>
<el-row class="score-detail-row" justify="space-between"> <el-row class="score-detail-row" justify="space-between">
<el-col :span="12">资讯评分</el-col> <el-col :span="12">资讯评分</el-col>
<el-col :span="12" style="color: #36a4f8; text-align: right; font-weight: 700">{{ <el-col :span="12" style="color: #36a4f8; text-align: right; font-weight: 700">{{ scoreDetail.newsScore }}</el-col>
scoreDetail.newsScore
}}</el-col>
</el-row> </el-row>
</div> </div>
<template #footer> <template #footer>
@ -534,6 +696,7 @@ import clipboard from 'clipboard';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
import recordDialog from './dialog/recordDialog.vue'; import recordDialog from './dialog/recordDialog.vue';
import { isMobileByWidth } from '/@/utils/Utils'; import { isMobileByWidth } from '/@/utils/Utils';
import zTable from './zTable.vue';
const recordDialogRef = ref(); const recordDialogRef = ref();
/** 管理后台需求文件0519V1.1 start */ /** 管理后台需求文件0519V1.1 start */
@ -594,7 +757,7 @@ async function doDeleteNewsFn(item) {
getData(); getData();
} }
}) })
.catch(() => { }); .catch(() => {});
} }
function handleSearch() { function handleSearch() {
@ -650,20 +813,12 @@ async function getData() {
}); });
item.title = highlightTitle(item.title, form.value.keyword); item.title = highlightTitle(item.title, form.value.keyword);
// item.companys = [ if (item.clusterNews && item.clusterNews?.length > 0) {
// "", item.clusterNews.forEach((clusterItem, clusterIndex) => {
// "", clusterItem.childLength = item.clusterNews?.length || 0;
// ] clusterItem.clusterIndex = clusterIndex;
});
// item.labels = [ }
// "-",
// "-",
// ]
// item.signalNames = [
// "1",
// "2",
// ]
}); });
} }
} catch (error) { } catch (error) {
@ -687,18 +842,18 @@ async function doApprovalFn(item, status) {
let { code } = let { code } =
status == 3 || status == 4 status == 3 || status == 4
? await doNewRevoke({ ? await doNewRevoke({
id: item.id, id: item.id,
}) })
: await doNewSubmit({ : await doNewSubmit({
id: item.id, id: item.id,
}); });
if (code == 200) { if (code == 200) {
ElMessage.success('操作成功'); ElMessage.success('操作成功');
drawer.value = false; drawer.value = false;
getData(); getData();
} }
}) })
.catch(() => { }); .catch(() => {});
} }
/** /**
@ -722,20 +877,20 @@ async function doNewsPublishFn(item, status) {
let { code } = let { code } =
status == 1 status == 1
? await doNewRevoke({ ? await doNewRevoke({
id: item.id, id: item.id,
status: status, status: status,
}) })
: await doNewsPublish({ : await doNewsPublish({
id: item.id, id: item.id,
status: status, status: status,
}); });
if (code == 200) { if (code == 200) {
ElMessage.success('操作成功'); ElMessage.success('操作成功');
drawer.value = false; drawer.value = false;
getData(); getData();
} }
}) })
.catch(() => { }); .catch(() => {});
} }
/** /**
@ -966,7 +1121,7 @@ async function doRecoverFn(item) {
getData(); getData();
} }
}) })
.catch(() => { }); .catch(() => {});
} }
// //
@ -1219,4 +1374,9 @@ onMounted(async () => {
display: flex; display: flex;
gap: 5px; gap: 5px;
} }
:deep(.el-table td.el-table__cell div) {
display: flex;
align-items: center;
}
</style> </style>

View File

@ -0,0 +1,300 @@
<template>
<tableComponents
ref="tableRef"
:tableData="tableData"
style="margin-top: 20px"
@sortChange="sortChange"
:tableLoading="tableLoading"
@currentChange="currentChange"
@sizeChange="sizeChange"
:showHeader="false"
>
<el-table-column prop="title" label="标题" align="left" width="480">
<template v-slot="scope">
<div style="display: flex; flex-direction: column; gap: 5px; padding: 10px 0">
<div>
<span style="color: red; font-weight: bold; margin-right: 3px" v-if="scope.row.exclusive == 1">[独家]</span>
<span class="cursor-pointer" @click="goDetail(1, scope.row, true)" v-html="scope.row.title"></span>
</div>
<div class="labels" v-if="Session.get('userInfoLocal').userType == '00'">
<div class="label_item" v-if="scope.row.companyName && scope.row.companyName.length > 0">
{{ scope.row.companyName }}
</div>
<!-- <div v-for="company in scope.row.companys" :key="company" class="label_item">
{{ company }}
</div> -->
</div>
<div class="labels" v-if="Session.get('userInfoLocal').userType == '00'">
<!-- <div v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0" class="label_item_box">
<div v-for="item in scope.row.conceptLabels" :key="item" class="label_item" style="background-color: #eee6cd">
{{ item }}
</div>
</div>
<div v-if="scope.row.industryLabels && scope.row.industryLabels.length > 0" class="label_item_box">
<div v-for="item in scope.row.industryLabels" :key="item" class="label_item" style="background-color: #cfdcf3">
{{ item }}
</div>
</div> -->
<div style="background-color: #eee6cd" class="label_item" v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0">
{{ scope.row.conceptLabels[0] }}
</div>
<div style="background-color: #cfdcf3" class="label_item" v-if="scope.row.industryLabels && scope.row.industryLabels.length > 0">
{{ scope.row.industryLabels[0] }}
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="信号规则" align="center" width="120" v-if="Session.get('userInfoLocal').userType == '00'">
<template v-slot="scope">
<div v-if="scope.row.ruleName && scope.row.ruleName.length > 0">
<div v-for="item in scope.row.ruleName" :key="item" class="label_item">
{{ item }}
</div>
</div>
<div v-else>-</div>
</template>
</el-table-column>
<el-table-column label="媒体来源" align="center" width="120" v-if="Session.get('userInfoLocal').userType == '00'">
<template v-slot="scope">
<div v-if="scope.row.sourceName">
{{ scope.row.sourceName }}
</div>
<div v-else>-</div>
</template>
</el-table-column>
<el-table-column prop="status" align="center" width="120">
<template #header>
<el-dropdown trigger="click" @command="handleCommand">
<div class="el-dropdown-link">
<text style="color: rgba(0, 0, 0, 0.85); font-size: 14px">发布状态</text>
<el-image :src="icon_table_filter" style="width: 20px; height: 20px"></el-image>
</div>
<template #dropdown>
<div v-if="Session.get('userInfoLocal').userType == '00'">
<el-dropdown-menu>
<el-dropdown-item :command="null">全部</el-dropdown-item>
<el-dropdown-item :command="1">未发布</el-dropdown-item>
<el-dropdown-item :command="3">审核中</el-dropdown-item>
<el-dropdown-item :command="4">已二审</el-dropdown-item>
<el-dropdown-item :command="2">已发布</el-dropdown-item>
<el-dropdown-item :command="-1">退改中</el-dropdown-item>
</el-dropdown-menu>
</div>
<div v-else>
<el-dropdown-menu>
<el-dropdown-item :command="null">全部</el-dropdown-item>
<el-dropdown-item :command="1" v-if="Session.get('userInfoLocal').userType == '00'">未发布</el-dropdown-item>
<el-dropdown-item :command="3" v-if="Session.get('userInfoLocal').userType != '01'">审核中</el-dropdown-item>
<el-dropdown-item :command="4" v-if="Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'"
>已二审</el-dropdown-item
>
<el-dropdown-item :command="2">已发布</el-dropdown-item>
<el-dropdown-item :command="-1" v-if="Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'"
>退改中</el-dropdown-item
>
</el-dropdown-menu>
</div>
</template>
</el-dropdown>
</template>
<template v-slot="scope">
<!-- 新闻状态 0-草稿 1-未发布 2-已发布 -->
<div class="r_point" :style="{ color: '#000' }">
<div class="point" :style="{ backgroundColor: scope.row.status == 2 ? '#52C41A' : '#D9D9D9' }"></div>
<text v-if="scope.row.status == 0" style="color: rgba(0, 0, 0, 0.65)">草稿</text>
<text v-if="scope.row.status == 1" style="color: rgba(0, 0, 0, 0.65)">
{{ scope.row.deleted ? '已删除' : '未发布' }}
</text>
<text v-if="scope.row.status == 2" style="color: rgba(0, 0, 0, 0.65)">已发布</text>
<text v-if="scope.row.status == 3" style="color: rgba(0, 0, 0, 0.65)">审核中</text>
<text v-if="scope.row.status == 4" style="color: rgba(0, 0, 0, 0.65)">已二审</text>
<text v-if="scope.row.status == -1 && !scope.row.deleted" style="color: red"> 退改中 </text>
<text v-if="scope.row.status == -1 && scope.row.deleted"> 已删除 </text>
</div>
</template>
</el-table-column>
<el-table-column align="center" width="120" prop="submitter" label="编辑">
<template v-slot="scope">
{{ scope.row.submitter ? scope.row.submitter : '-' }}
</template>
</el-table-column>
<el-table-column align="center" width="120" prop="submitter" label="二校" v-if="Session.get('userInfoLocal').userType == '01'">
<template v-slot="scope">
{{ scope.row.submitterSecond ? scope.row.submitterSecond : '-' }}
</template>
</el-table-column>
<el-table-column align="center" width="120">
<template #header>
<el-dropdown trigger="click" @command="handleCommandRating">
<div class="el-dropdown-link">
<text style="color: rgba(0, 0, 0, 0.85); font-size: 14px">编辑评分</text>
<el-image :src="icon_table_filter" style="width: 20px; height: 20px"></el-image>
</div>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item :command="null">全部</el-dropdown-item>
<el-dropdown-item :command="0">无评分</el-dropdown-item>
<el-dropdown-item :command="5">5</el-dropdown-item>
<el-dropdown-item :command="4">4</el-dropdown-item>
<el-dropdown-item :command="3">3</el-dropdown-item>
<el-dropdown-item :command="2">2</el-dropdown-item>
<el-dropdown-item :command="1">1</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
<template v-slot="scope">
{{ scope.row.rating != 0 && scope.row.rating != null ? scope.row.rating : '-' }}
</template>
</el-table-column>
<el-table-column prop="score" label="资讯评分" sortable="custom" align="center" width="100">
<template v-slot="scope">
<div @click="getScoreDetail(scope.row.id)" :class="[{ 'score-active': isAdmin && curScore === scope.row.id }, { 'score-hover': isAdmin }]">
{{ scope.row.score }}
</div>
</template>
</el-table-column>
<el-table-column prop="publishTime" label="报道时间" sortable="custom" align="center" />
<el-table-column prop="updateTime" label="状态变动时间" sortable="custom" align="center">
<template v-slot="scope">
<div>
<div>{{ formatTime(scope.row.updateTime) == formatTime(scope.row.createTime) ? scope.row.publishTime : scope.row.updateTime }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="250" fixed="right">
<template v-slot="scope">
<div class="option">
<el-button v-if="scope.row.deleted" type="text" style="margin-left: -10px" @click="doRecoverFn(scope.row)">
<text>恢复</text>
</el-button>
<div v-else style="display: flex; gap: 10px; align-items: center">
<el-button type="text" :disabled="scope.row.status != 2" class="copyBtn" @click="copyUrl(scope.row)">复制</el-button>
<!-- 新闻状态 0-草稿 | 1-未发布 | 2-已发布 | 3-送审 | 4-已二审 | -1-退改中 -->
<div v-if="Session.get('userInfoLocal').userType == '00'">
<!-- 普通账号 -->
<el-button
v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1"
type="text"
@click="goDetail(1, scope.row, false)"
>编辑</el-button
>
<el-button
v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1"
type="text"
@click="doApprovalFn(scope.row, scope.row.status)"
>送审</el-button
>
<el-button v-else-if="scope.row.status == 3" type="text" @click="doApprovalFn(scope.row, scope.row.status)">撤审</el-button>
<el-button
v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == -1"
type="text"
style="color: #ff1818"
@click="doDeleteNewsFn(scope.row)"
>删除</el-button
>
</div>
<div v-if="Session.get('userInfoLocal').userType == '02'">
<el-button v-if="scope.row.status == 4" type="text" @click="doApprovalFn(scope.row, scope.row.status)">撤审</el-button>
<!-- 二审账号 -->
<el-button v-if="scope.row.status == 3" type="text" style="color: #ff1818" @click="doNewReturnFn(scope.row)">退改</el-button>
<el-button v-if="scope.row.status == 3" type="text" @click="goDetail(1, scope.row, false)">编辑</el-button>
<el-button v-if="scope.row.status == 3" type="text" @click="doNewCheckFn(scope.row)">复审</el-button>
<el-button type="text" v-if="scope.row.status == 4" @click="doNewsPublishFn(scope.row, 2)">发布</el-button>
</div>
<div v-if="Session.get('userInfoLocal').userType == '01'">
<!-- 终审账号 -->
<el-button v-if="scope.row.status == 3 || scope.row.status == 4" type="text" @click="goDetail(1, scope.row, false)">编辑</el-button>
<el-button v-if="scope.row.status == 4" type="text" style="color: #ff1818" @click="doNewReturnFn(scope.row)">退改</el-button>
<el-button type="text" v-if="scope.row.status == 2" @click="doNewsPublishFn(scope.row, 1)">撤稿</el-button>
<el-button type="text" v-else-if="scope.row.status != -1 && scope.row.status == 4" @click="doNewsPublishFn(scope.row, 2)"
>发布</el-button
>
<el-button v-if="scope.row.status == 3" type="text" style="color: #ff1818; margin-left: 5px" @click="doNewReturnFn(scope.row)"
>退改</el-button
>
</div>
<!-- <el-icon size="16" @click="goRecord(scope.row)">
<Tickets />
</el-icon> -->
</div>
<!-- v-if="isAdmin" -->
<el-icon
v-if="isAdmin || Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'"
size="16"
@click="goRecord(scope.row)"
style="margin-left: 10px"
>
<Tickets />
</el-icon>
</div>
</template>
</el-table-column>
</tableComponents>
</template>
<script setup>
import tableComponents from '/@/components/tableComponents/index.vue';
import { Session } from '/@/utils/storage';
const props = defineProps({
//
tableData: {
type: Object,
default: () => {},
},
tableLoading: {
type: Boolean,
default: false,
},
defaultCurrentPage: {
type: Number,
default: 1,
},
});
</script>
<style scoped lang="scss">
/*表格全选框去除空框*/
.el-table >>> .DisabledSelection .cell .el-checkbox__inner {
display: none;
position: relative;
}
/*表格全选框改为:选择*/
.el-table >>> .DisabledSelection .cell:before {
content: '选择';
position: absolute;
left: 7px;
}
</style>