feat(richedit): 添加聚类模式开关并优化相关逻辑
- 在富文本编辑页面添加聚类模式开关组件 - 调整聚类新闻数量显示逻辑与开关状态绑定 - 修改初始化逻辑,默认开启聚类模式 - 添加开关样式调整
This commit is contained in:
parent
49fd3c996d
commit
5f21670322
|
|
@ -191,6 +191,10 @@
|
|||
</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
|
||||
ref="tableRef"
|
||||
:tableData="tableData"
|
||||
|
|
@ -199,11 +203,14 @@
|
|||
:tableLoading="tableLoading"
|
||||
@currentChange="currentChange"
|
||||
@sizeChange="sizeChange"
|
||||
:hadExpand="hadExpand"
|
||||
>
|
||||
<el-table-column prop="title" label="标题" align="left" width="380">
|
||||
<template v-slot="scope">
|
||||
<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
|
||||
style="
|
||||
|
|
@ -596,8 +603,13 @@ function initPageData() {
|
|||
range: 'all',
|
||||
includeRuleIds: includeRuleIds.value,
|
||||
excludeRuleIds: excludeRuleIds.value,
|
||||
clusterSwitch: hadExpand.value,
|
||||
};
|
||||
}
|
||||
function handleExpandChange() {
|
||||
// hadExpand.value = !hadExpand.value;
|
||||
getData();
|
||||
}
|
||||
|
||||
const hadExpand = ref(true);
|
||||
// 获取列表
|
||||
|
|
@ -1182,4 +1194,8 @@ onMounted(async () => {
|
|||
font-style: normal;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep(.el-switch__label.is-active) {
|
||||
color: #4e4e4e;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -316,6 +316,10 @@
|
|||
</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
|
||||
ref="tableRef"
|
||||
:tableData="tableData"
|
||||
|
|
@ -334,7 +338,7 @@
|
|||
<el-table-column prop="title" label="标题" align="left" width="380">
|
||||
<template v-slot="scope">
|
||||
<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 }}
|
||||
</div>
|
||||
|
||||
|
|
@ -795,9 +799,16 @@ function initPageData() {
|
|||
range: Session.get('userInfoLocal').userType == '01' ? 'review' : Session.get('userInfoLocal').userType == '02' ? 'secondReview' : 'all',
|
||||
includeRuleIds: includeRuleIds.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() {
|
||||
// return
|
||||
|
|
@ -832,15 +843,6 @@ async function getData() {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 判断有没有折叠菜单
|
||||
if (Session.get('userInfoLocal').userType != '00') {
|
||||
hadExpand.value = false;
|
||||
} else {
|
||||
// 会进来这里说明这个页面是资讯精选
|
||||
getRealTotalFn();
|
||||
hadExpand.value = true;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
tableLoading.value = false;
|
||||
|
|
@ -1256,6 +1258,15 @@ onMounted(async () => {
|
|||
}
|
||||
|
||||
getCompany();
|
||||
|
||||
// 判断有没有折叠菜单
|
||||
if (Session.get('userInfoLocal').userType != '00') {
|
||||
hadExpand.value = false;
|
||||
} else {
|
||||
// 会进来这里说明这个页面是资讯精选
|
||||
getRealTotalFn();
|
||||
hadExpand.value = true;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -1421,4 +1432,8 @@ onMounted(async () => {
|
|||
font-style: normal;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep(.el-switch__label.is-active) {
|
||||
color: #4e4e4e;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue