feat(richedit): 重构资讯精选和审核页面的筛选条件布局

- 根据用户类型区分展示不同的筛选条件
- 优化筛选条件的布局和样式
- 调整信号规则获取逻辑,支持不同类型
- 更新标签显示逻辑,使用实际数据字段
- 修改环境配置中的API地址
This commit is contained in:
34701892@qq.com 2025-11-11 18:24:35 +08:00
parent 35ca949882
commit 4e6d0b06e2
3 changed files with 201 additions and 70 deletions

View File

@ -2,10 +2,10 @@
ENV = development ENV = development
# 本地环境接口地址 # 本地环境接口地址
# VITE_API_URL = https://4155gf93ll13.vicp.fun/admin VITE_API_URL = http://4155gf93ll13.vicp.fun/admin
# VITE_API_URL = http://localhost:13579/admin # VITE_API_URL = http://localhost:13579/admin
# VITE_API_URL = https://cankao.cs.com.cn/admin # VITE_API_URL = https://cankao.cs.com.cn/admin
VITE_API_URL = http://123.60.153.169:8040/admin # VITE_API_URL = http://123.60.153.169:8040/admin
# VITE_API_URL = /api # VITE_API_URL = /api

View File

@ -3,13 +3,12 @@
<div class="colHeader"> <div class="colHeader">
<div class="page_title">资讯精选</div> <div class="page_title">资讯精选</div>
<div style="width: 100%; display: flex; align-items: flex-end"> <div style="width: 100%; display: flex;margin-top: 20px;">
<el-button type="primary" style="margin-bottom: 10px" @click="restData">清空条件</el-button>
<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>
<el-input v-model="form.keyword" placeholder="输入标题/内容关键字进行搜索(以空格隔开)" class="input-with-select" <el-input v-model="form.keyword" placeholder="输入标题/内容关键字进行搜索(以空格隔开)" class="input-with-select"
@keyup.enter="handleSearch" style="width: 455px"> @keyup.enter="handleSearch" style="width: 500px">
<template #append> <template #append>
<el-button icon="Search" @click="handleSearch" /> <el-button icon="Search" @click="handleSearch" />
</template> </template>
@ -32,21 +31,30 @@
</el-input> </el-input>
</el-space> </el-space>
<div class="colHeader-right-2">
<el-date-picker v-model="daterange" 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="媒体来源" <div class="colHeader-right-2" style="gap: 10px">
size="large" style="width: 240px" filterable @change="handleSearch" /> <span>信号规则</span>
<el-select v-model="signalId1" clearable placeholder="含任一信号规则" multiple size="large"
style="width: 180px" filterable @change="signalChange($event, 1)">
<el-select clearable v-model="form.deleted" size="large" style="width: 150px; margin-left: 10px" <el-option v-for="item in signalRulesList1" :key="item.value" :value="item.value"
placeholder="筛选删除状态" @change="handleSearch"> :label="item.label"></el-option>
<el-option :value="1" 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"> <el-select v-model="signalId2" clearable placeholder="不含任一信号规则" multiple size="large"
style="width: 180px" filterable @change="signalChange($event, 2)">
<el-option v-for="item in signalRulesList2" :key="item.value" :value="item.value"
:label="item.label"></el-option>
</el-select>
<span>报道时间</span>
<div>
<el-date-picker v-model="daterange" type="daterange" range-separator="-"
value-format="YYYY-MM-DD" start-placeholder="选择报道时间" end-placeholder="选择报道时间"
@change="handleSearch" />
</div>
<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 type="number" v-model="form.minScore" style="width: 80px" placeholder="最低"
:min="0" :max="100" @keyup.enter="handleSearch" /> :min="0" :max="100" @keyup.enter="handleSearch" />
@ -58,21 +66,36 @@
</template> </template>
</el-input> </el-input>
</div> </div>
</div> </div>
<div class="colHeader-right-2" style="gap: 10px"> <div class="colHeader-right-2" style="gap: 10px;">
<el-select v-model="signalId1" clearable placeholder="含任一信号规则" multiple size="large" <span>媒体来源</span>
style="width: 240px" filterable @change="signalChange($event, 1)"> <el-select-v2 v-model="form.mediaId" :options="tagSourceList" clearable placeholder="媒体来源"
size="large" style="width: 180px" filterable @change="handleSearch" />
<el-option v-for="item in signalRulesList1" :key="item.value" :value="item.value" <span>企业检索</span>
:label="item.label"></el-option> <el-select v-model="form.companyName" clearable placeholder="请选择" multiple size="large"
style="width: 180px" filterable @change="handleSearch">
<el-option></el-option>
<el-option></el-option>
</el-select> </el-select>
<el-select v-model="signalId2" clearable placeholder="不含任一信号规则" multiple size="large" <span>独家资源</span>
style="width: 240px" filterable @change="signalChange($event, 2)"> <el-select v-model="form.exclusive" clearable placeholder="是否独家搜索" multiple size="large"
<el-option v-for="item in signalRulesList2" :key="item.value" :value="item.value" style="width: 180px" filterable @change="handleSearch">
:label="item.label"></el-option> <el-option></el-option>
<el-option></el-option>
</el-select> </el-select>
<span>删除状态</span>
<el-select 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="0" label="未删除资讯"></el-option>
</el-select>
<el-button type="primary" @click="restData">清空条件</el-button>
</div> </div>
</div> </div>
</div> </div>
@ -91,15 +114,20 @@
</div> </div>
<div class="labels"> <div class="labels">
<div v-for="company in scope.row.companys" :key="company" class="label_item"> <div class="label_item" v-if="scope.row.companyName && scope.row.companyName.length > 0">
{{ company }} {{ scope.row.companyName }}
</div> </div>
</div> </div>
<div class="labels"> <div class="labels">
<div v-for="(label, index) in scope.row.labels" :key="label" class="label_item" <div style="background-color: #EEE6CD;" class="label_item"
:style="{ backgroundColor: index == 0 ? '#EEE6CD' : '#CFDCF3' }"> v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0">
{{ label }} {{ 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> </div>
</div> </div>
@ -326,7 +354,7 @@ import {
getColumn, getColumn,
getNewsScore, getNewsScore,
getIndustryHierarchy, getIndustryHierarchy,
getTagSource, getTagSource, getSignalRules,
doRecover, doRecover,
} from '/@/api/api'; } from '/@/api/api';
import { highlightTitle } from '/@/utils/highlight'; import { highlightTitle } from '/@/utils/highlight';
@ -447,20 +475,20 @@ async function getData() {
}); });
item.title = highlightTitle(item.title, form.value.keyword); item.title = highlightTitle(item.title, form.value.keyword);
item.companys = [ // item.companys = [
"英伟达", // "",
"微软", // "",
] // ]
item.labels = [ // item.labels = [
"新科技-人工智能", // "-",
"新科技-人工智能", // "-",
] // ]
item.signalNames = [ // item.signalNames = [
"信号规则1", // "1",
"信号规则2", // "2",
] // ]
}); });
} }
} catch (error) { } catch (error) {
@ -783,16 +811,26 @@ const signalRulesList2 = ref([
}, },
]) ])
async function getSignalRulesFn() { async function getSignalRulesFn(type) {
let { code, data } = await getSignalRules({ let { code, data } = await getSignalRules({
}); });
if (code == 200) { if (code == 200) {
signalRulesList.value = data.map((item: any) => { if (type == 1) {
return { signalRulesList1.value = data.map((item: any) => {
label: item.name, return {
value: item.id, label: item.name,
}; value: item.id,
}); };
});
} else {
signalRulesList2.value = data.map((item: any) => {
return {
label: item.name,
value: item.id,
};
});
}
} }
} }
@ -839,7 +877,8 @@ onMounted(async () => {
}); });
} }
getSignalRulesFn() getSignalRulesFn(0);
getSignalRulesFn(1);
}); });
</script> </script>
@ -935,13 +974,13 @@ onMounted(async () => {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-end; // align-items: flex-end;
min-width: 700px; // min-width: 700px;
.colHeader-right-1, .colHeader-right-1,
.colHeader-right-2 { .colHeader-right-2 {
display: flex; display: flex;
justify-self: flex-end; // justify-self: flex-end;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
} }

View File

@ -4,10 +4,13 @@
<div class="page_title" v-if="Session.get('userInfoLocal').userType == '00'">资讯精选</div> <div class="page_title" v-if="Session.get('userInfoLocal').userType == '00'">资讯精选</div>
<div class="page_title" v-if="Session.get('userInfoLocal').userType == '01'">资讯审核</div> <div class="page_title" v-if="Session.get('userInfoLocal').userType == '01'">资讯审核</div>
<div style="width: 100%; display: flex; align-items: flex-end"> <!-- 普通管理员和审核人员的筛选条件不一样普通管理员是资讯精选其他是资讯审核 -->
<!-- 普通管理员的筛选 start -->
<div style="width: 100%; display: flex; align-items: flex-end"
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"> <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 v-model="form.keyword" placeholder="输入标题/内容关键字进行搜索(以空格隔开)" class="input-with-select"
@keyup.enter="handleSearch" style="width: 455px"> @keyup.enter="handleSearch" style="width: 455px">
@ -62,22 +65,104 @@
</div> </div>
</div> </div>
<div class="colHeader-right-2" style="gap: 10px"
v-if="Session.get('userInfoLocal').userType == '00'"> </div>
</div>
<!-- 普通管理员的筛选 end -->
<div style="width: 100%; display: flex;margin-top: 20px;" v-else>
<div class="colHeader-right">
<el-space :size="12" class="colHeader-right-1">
<span>标题检索</span>
<el-input v-model="form.keyword" placeholder="输入标题/内容关键字进行搜索(以空格隔开)" class="input-with-select"
@keyup.enter="handleSearch" style="width: 500px">
<template #append>
<el-button icon="Search" @click="handleSearch" />
</template>
</el-input>
<div>
<span>行业分类</span>
<el-tree-select v-model="form.industry" :data="industryList" 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>
</div>
<el-input v-model="form.tag" placeholder="匹配多个概念标签(以空格隔开)" class="input-with-select"
@keyup.enter="handleSearch" style="width: 280px">
<template #append>
<el-button icon="Search" @click="handleSearch" />
</template>
</el-input>
</el-space>
<div class="colHeader-right-2" style="gap: 10px">
<span>信号规则</span>
<el-select v-model="signalId1" clearable placeholder="含任一信号规则" multiple size="large" <el-select v-model="signalId1" clearable placeholder="含任一信号规则" multiple size="large"
style="width: 240px" filterable @change="signalChange($event, 1)"> style="width: 180px" filterable @change="signalChange($event, 1)">
<el-option v-for="item in signalRulesList1" :key="item.value" :value="item.value" <el-option v-for="item in signalRulesList1" :key="item.value" :value="item.value"
:label="item.label"></el-option> :label="item.label"></el-option>
</el-select> </el-select>
<el-select v-model="signalId2" clearable placeholder="不含任一信号规则" multiple size="large" <el-select v-model="signalId2" clearable placeholder="不含任一信号规则" multiple size="large"
style="width: 240px" filterable @change="signalChange($event, 2)"> style="width: 180px" filterable @change="signalChange($event, 2)">
<el-option v-for="item in signalRulesList2" :key="item.value" :value="item.value" <el-option v-for="item in signalRulesList2" :key="item.value" :value="item.value"
:label="item.label"></el-option> :label="item.label"></el-option>
</el-select> </el-select>
<span>报道时间</span>
<div>
<el-date-picker v-model="daterange" type="daterange" range-separator="-"
value-format="YYYY-MM-DD" start-placeholder="选择报道时间" end-placeholder="选择报道时间"
@change="handleSearch" />
</div>
<div style="display: flex; flex-wrap: nowrap; align-items: center">
<span>评分范围</span>
<el-input type="number" v-model="form.minScore" style="width: 80px" placeholder="最低"
:min="0" :max="100" @keyup.enter="handleSearch" />
<i style="color: #ccc"> - </i>
<el-input type="number" v-model="form.maxScore" style="width: 140px" placeholder="最高"
:min="0" :max="100" @keyup.enter="handleSearch">
<template #append>
<el-button icon="Search" @click="handleSearch" />
</template>
</el-input>
</div>
</div> </div>
<div class="colHeader-right-2" style="gap: 10px;">
<span>媒体来源</span>
<el-select-v2 v-model="form.mediaId" :options="tagSourceList" clearable placeholder="媒体来源"
size="large" style="width: 180px" filterable @change="handleSearch" />
<span>企业检索</span>
<el-select v-model="form.companyName" clearable placeholder="请选择" multiple size="large"
style="width: 180px" filterable @change="handleSearch">
<el-option></el-option>
<el-option></el-option>
</el-select>
<span>独家资源</span>
<el-select v-model="form.exclusive" clearable placeholder="是否独家搜索" multiple size="large"
style="width: 180px" filterable @change="handleSearch">
<el-option></el-option>
<el-option></el-option>
</el-select>
<span>删除状态</span>
<el-select 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="0" label="未删除资讯"></el-option>
</el-select>
<el-button type="primary" @click="restData">清空条件</el-button>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -95,15 +180,22 @@
</div> </div>
<div class="labels" v-if="Session.get('userInfoLocal').userType == '00'"> <div class="labels" v-if="Session.get('userInfoLocal').userType == '00'">
<div v-for="company in scope.row.companys" :key="company" class="label_item"> <div class="label_item" v-if="scope.row.companyName && scope.row.companyName.length > 0">
{{ company }} {{ scope.row.companyName }}
</div> </div>
<!-- <div v-for="company in scope.row.companys" :key="company" class="label_item">
{{ company }}
</div> -->
</div> </div>
<div class="labels" v-if="Session.get('userInfoLocal').userType == '00'"> <div class="labels" v-if="Session.get('userInfoLocal').userType == '00'">
<div v-for="(label, index) in scope.row.labels" :key="label" class="label_item" <div style="background-color: #EEE6CD;" class="label_item"
:style="{ backgroundColor: index == 0 ? '#EEE6CD' : '#CFDCF3' }"> v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0">
{{ label }} {{ 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> </div>
</div> </div>
@ -1043,13 +1135,13 @@ onMounted(async () => {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-end; // align-items: flex-end;
min-width: 700px; // min-width: 700px;
.colHeader-right-1, .colHeader-right-1,
.colHeader-right-2 { .colHeader-right-2 {
display: flex; display: flex;
justify-self: flex-end; // justify-self: flex-end;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 10px;
} }