feat(richedit): 添加聚类模式开关并优化相关逻辑

- 在富文本编辑页面添加聚类模式开关组件
- 调整聚类新闻数量显示逻辑与开关状态绑定
- 修改初始化逻辑,默认开启聚类模式
- 添加开关样式调整
This commit is contained in:
34701892@qq.com 2025-12-05 17:49:55 +08:00
parent 49fd3c996d
commit 5f21670322
2 changed files with 43 additions and 12 deletions

View File

@ -191,6 +191,10 @@
</div> </div>
</div> </div>
<div style="width: 100%; display: flex; justify-content: flex-end">
<el-switch v-model="hadExpand" inactive-text="聚类模式" @change="handleExpandChange"></el-switch>
</div>
<tableComponents <tableComponents
ref="tableRef" ref="tableRef"
:tableData="tableData" :tableData="tableData"
@ -199,11 +203,14 @@
:tableLoading="tableLoading" :tableLoading="tableLoading"
@currentChange="currentChange" @currentChange="currentChange"
@sizeChange="sizeChange" @sizeChange="sizeChange"
:hadExpand="hadExpand"
> >
<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; justify-content: flex-start; align-items: center; width: 100%"> <div style="display: flex; justify-content: flex-start; align-items: center; width: 100%">
<div style="margin-right: 15px" v-if="scope.row.clusterNews">{{ scope.row.clusterNews ? scope.row.clusterNews.length : 0 }}</div> <div style="margin-right: 15px" v-if="scope.row.clusterNews && hadExpand">
{{ scope.row.clusterNews ? scope.row.clusterNews.length : 0 }}
</div>
<div <div
style=" style="
@ -596,8 +603,13 @@ function initPageData() {
range: 'all', range: 'all',
includeRuleIds: includeRuleIds.value, includeRuleIds: includeRuleIds.value,
excludeRuleIds: excludeRuleIds.value, excludeRuleIds: excludeRuleIds.value,
clusterSwitch: hadExpand.value,
}; };
} }
function handleExpandChange() {
// hadExpand.value = !hadExpand.value;
getData();
}
const hadExpand = ref(true); const hadExpand = ref(true);
// //
@ -1182,4 +1194,8 @@ onMounted(async () => {
font-style: normal; font-style: normal;
cursor: pointer; cursor: pointer;
} }
:deep(.el-switch__label.is-active) {
color: #4e4e4e;
}
</style> </style>

View File

@ -316,6 +316,10 @@
</div> </div>
</div> </div>
<div v-if="Session.get('userInfoLocal').userType == '00'" style="width: 100%; display: flex; justify-content: flex-end">
<el-switch v-model="hadExpand" inactive-text="聚类模式" @change="handleExpandChange"></el-switch>
</div>
<tableComponents <tableComponents
ref="tableRef" ref="tableRef"
:tableData="tableData" :tableData="tableData"
@ -334,7 +338,7 @@
<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; justify-content: flex-start; align-items: center; width: 100%"> <div style="display: flex; justify-content: flex-start; align-items: center; width: 100%">
<div style="margin-right: 15px" v-if="scope.row.clusterNews && Session.get('userInfoLocal').userType == '00'"> <div style="margin-right: 15px" v-if="scope.row.clusterNews && Session.get('userInfoLocal').userType == '00' && hadExpand">
{{ scope.row.clusterNews ? scope.row.clusterNews.length : 0 }} {{ scope.row.clusterNews ? scope.row.clusterNews.length : 0 }}
</div> </div>
@ -795,9 +799,16 @@ function initPageData() {
range: Session.get('userInfoLocal').userType == '01' ? 'review' : Session.get('userInfoLocal').userType == '02' ? 'secondReview' : 'all', range: Session.get('userInfoLocal').userType == '01' ? 'review' : Session.get('userInfoLocal').userType == '02' ? 'secondReview' : 'all',
includeRuleIds: includeRuleIds.value, includeRuleIds: includeRuleIds.value,
excludeRuleIds: excludeRuleIds.value, excludeRuleIds: excludeRuleIds.value,
clusterSwitch: hadExpand.value,
}; };
} }
const hadExpand = ref(false);
function handleExpandChange() {
// hadExpand.value = !hadExpand.value;
getData();
}
const hadExpand = ref(true);
// //
async function getData() { async function getData() {
// return // return
@ -832,15 +843,6 @@ async function getData() {
}); });
} }
}); });
//
if (Session.get('userInfoLocal').userType != '00') {
hadExpand.value = false;
} else {
//
getRealTotalFn();
hadExpand.value = true;
}
} }
} catch (error) { } catch (error) {
tableLoading.value = false; tableLoading.value = false;
@ -1256,6 +1258,15 @@ onMounted(async () => {
} }
getCompany(); getCompany();
//
if (Session.get('userInfoLocal').userType != '00') {
hadExpand.value = false;
} else {
//
getRealTotalFn();
hadExpand.value = true;
}
}); });
</script> </script>
@ -1421,4 +1432,8 @@ onMounted(async () => {
font-style: normal; font-style: normal;
cursor: pointer; cursor: pointer;
} }
:deep(.el-switch__label.is-active) {
color: #4e4e4e;
}
</style> </style>