refactor(richedit): 优化组件代码格式和布局结构
简化模板代码格式,移除冗余换行和缩进 保持原有功能不变,提升代码可读性
This commit is contained in:
parent
e2651d7c9e
commit
887a634d14
|
|
@ -8,13 +8,8 @@
|
|||
|
||||
<div class="colHeader-right">
|
||||
<el-space :size="12" class="colHeader-right-1">
|
||||
<el-input
|
||||
v-model="form.keyword"
|
||||
placeholder="输入标题/内容关键字进行搜索(以空格隔开)"
|
||||
class="input-with-select"
|
||||
@keyup.enter="handleSearch"
|
||||
style="width: 455px"
|
||||
>
|
||||
<el-input v-model="form.keyword" placeholder="输入标题/内容关键字进行搜索(以空格隔开)" class="input-with-select"
|
||||
@keyup.enter="handleSearch" style="width: 455px">
|
||||
<template #append>
|
||||
<el-button icon="Search" @click="handleSearch" />
|
||||
</template>
|
||||
|
|
@ -22,32 +17,15 @@
|
|||
|
||||
<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 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"
|
||||
>
|
||||
<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>
|
||||
|
|
@ -55,53 +33,26 @@
|
|||
</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-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="媒体来源"
|
||||
size="large"
|
||||
style="width: 240px"
|
||||
filterable
|
||||
@change="handleSearch"
|
||||
/>
|
||||
<el-select-v2 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"
|
||||
placeholder="筛选删除状态"
|
||||
@change="handleSearch"
|
||||
>
|
||||
<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>
|
||||
|
||||
<div style="margin-left: 12px; 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"
|
||||
/>
|
||||
<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">
|
||||
<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>
|
||||
|
|
@ -114,15 +65,8 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<tableComponents
|
||||
ref="tableRef"
|
||||
:tableData="tableData"
|
||||
style="margin-top: 20px"
|
||||
@sortChange="sortChange"
|
||||
:tableLoading="tableLoading"
|
||||
@currentChange="currentChange"
|
||||
@sizeChange="sizeChange"
|
||||
>
|
||||
<tableComponents ref="tableRef" :tableData="tableData" style="margin-top: 20px" @sortChange="sortChange"
|
||||
:tableLoading="tableLoading" @currentChange="currentChange" @sizeChange="sizeChange">
|
||||
<el-table-column prop="title" label="标题" align="left" width="380">
|
||||
<template v-slot="scope">
|
||||
<span class="cursor-pointer" @click="goDetail(1, scope.row, true)" v-html="scope.row.title"></span>
|
||||
|
|
@ -140,16 +84,16 @@
|
|||
<template #dropdown>
|
||||
<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="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="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-item :command="-1"
|
||||
v-if="Session.get('userInfoLocal').userType == '02' || Session.get('userInfoLocal').userType == '01'">退改中</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
|
|
@ -157,7 +101,8 @@
|
|||
<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>
|
||||
<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)">未发布</text>
|
||||
<text v-if="scope.row.status == 2" style="color: rgba(0, 0, 0, 0.65)">已发布</text>
|
||||
|
|
@ -201,7 +146,8 @@
|
|||
|
||||
<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 }]">
|
||||
<div @click="getScoreDetail(scope.row.id)"
|
||||
:class="[{ 'score-active': isAdmin && curScore === scope.row.id }, { 'score-hover': isAdmin }]">
|
||||
{{ scope.row.score }}
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -210,49 +156,41 @@
|
|||
<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>{{ 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)">
|
||||
<el-button type="text" :disabled="scope.row.status != 2" class="copyBtn"
|
||||
@click="copyUrl(scope.row)">复制</el-button>
|
||||
<!--
|
||||
<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 v-if="scope.row.status == 0 || 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" type="text"
|
||||
@click="goDetail(1, scope.row, false)">编辑</el-button>
|
||||
|
||||
<el-button v-if="scope.row.status == 3 && Session.get('userInfoLocal').userType == '01'"
|
||||
type="text" @click="goDetail(1, scope.row, false)">编辑</el-button>
|
||||
|
||||
<el-button
|
||||
v-if="scope.row.status == 3 && Session.get('userInfoLocal').userType == '01'"
|
||||
type="text"
|
||||
@click="goDetail(1, scope.row, false)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<!-- <div v-if="Session.get('userInfoLocal').userType == '01'">
|
||||
<el-button type="text" v-if="scope.row.status == 2"
|
||||
@click="doNewsPublishFn(scope.row, 1)">撤稿</el-button>
|
||||
<el-button type="text" v-else @click="doNewsPublishFn(scope.row, 2)">发布</el-button>
|
||||
</div> -->
|
||||
<div style="display: flex">
|
||||
<el-button v-if="scope.row.status == 0 || 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" 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>
|
||||
</div>
|
||||
<el-button type="text" :disabled="scope.row.status != 2" class="copyBtn" @click="copyUrl(scope.row)">复制</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status == 0 || scope.row.status == 1"
|
||||
type="text"
|
||||
style="color: #ff1818; margin-left: 3px"
|
||||
@click="doDeleteNewsFn(scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
|
||||
<!-- <el-icon size="16" @click="goRecord(scope.row)">
|
||||
<Tickets />
|
||||
</el-icon> -->
|
||||
</div>
|
||||
<el-button v-if="scope.row.status == 0 || scope.row.status == 1" type="text"
|
||||
style="color: #ff1818; margin-left: 3px"
|
||||
@click="doDeleteNewsFn(scope.row)">删除</el-button>
|
||||
|
||||
|
||||
</div> -->
|
||||
<!-- v-if="isAdmin" -->
|
||||
<el-icon v-if="isAdmin" size="16" @click="goRecord(scope.row)" style="margin-left: 10px">
|
||||
<Tickets />
|
||||
|
|
@ -263,16 +201,9 @@
|
|||
</tableComponents>
|
||||
|
||||
<keep-alive>
|
||||
<DetailDrawer
|
||||
v-model="drawer"
|
||||
:data="newsData"
|
||||
:readOnly="readOnly"
|
||||
:type="newstype"
|
||||
@handleEditStatus="handleEditStatus"
|
||||
@doNewsPublishFn="doNewsPublishFn"
|
||||
@doDeleteNewsFn="doDeleteNewsFn"
|
||||
@getData="getData"
|
||||
/>
|
||||
<DetailDrawer v-model="drawer" :data="newsData" :readOnly="readOnly" :type="newstype"
|
||||
@handleEditStatus="handleEditStatus" @doNewsPublishFn="doNewsPublishFn" @doDeleteNewsFn="doDeleteNewsFn"
|
||||
@getData="getData" />
|
||||
</keep-alive>
|
||||
|
||||
<el-dialog v-model="isScoreShow" title="资讯评分详情" width="680" center>
|
||||
|
|
@ -283,9 +214,8 @@
|
|||
<el-row>[{{ scoreDetail.industryLabel.join(',') }}]</el-row>
|
||||
<el-row justify="space-between">
|
||||
<el-col :span="12">置信度:[{{ scoreDetail.industryConfidence.join(',') }}]</el-col>
|
||||
<el-col :span="12" style="text-align: right"
|
||||
>分类评分:<span style="color: #36a4f8">[{{ scoreDetail.industryScore.join(',') }}]</span></el-col
|
||||
>
|
||||
<el-col :span="12" style="text-align: right">分类评分:<span style="color: #36a4f8">[{{
|
||||
scoreDetail.industryScore.join(',') }}]</span></el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -295,9 +225,8 @@
|
|||
<el-row>[{{ scoreDetail.conceptLabel.join(',') }}]</el-row>
|
||||
<el-row justify="space-between">
|
||||
<el-col :span="12">置信度:[{{ scoreDetail.conceptConfidence.join(',') }}]</el-col>
|
||||
<el-col :span="12" style="text-align: right"
|
||||
>概念评分:<span style="color: #36a4f8">[{{ scoreDetail.conceptScore.join(',') }}]</span></el-col
|
||||
>
|
||||
<el-col :span="12" style="text-align: right">概念评分:<span style="color: #36a4f8">[{{
|
||||
scoreDetail.conceptScore.join(',') }}]</span></el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -307,21 +236,20 @@
|
|||
</el-row>
|
||||
<el-row class="score-detail-row">
|
||||
<el-col :span="12">媒体影响力</el-col>
|
||||
<el-col :span="12" style="text-align: right"
|
||||
>评分:<span style="color: #36a4f8">{{ scoreDetail.sourceImpact }}</span></el-col
|
||||
>
|
||||
<el-col :span="12" style="text-align: right">评分:<span style="color: #36a4f8">{{
|
||||
scoreDetail.sourceImpact
|
||||
}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="score-detail-row">
|
||||
<el-col :span="12">中国股市相关性</el-col>
|
||||
<el-col :span="12" style="text-align: right"
|
||||
>置信度:<span style="color: #36a4f8">{{ scoreDetail.chinaFactor }}</span></el-col
|
||||
>
|
||||
<el-col :span="12" style="text-align: right">置信度:<span style="color: #36a4f8">{{
|
||||
scoreDetail.chinaFactor
|
||||
}}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="score-detail-row">
|
||||
<el-col :span="12">资讯质量</el-col>
|
||||
<el-col :span="12" style="text-align: right"
|
||||
>评分:<span style="color: #36a4f8">{{ scoreDetail.publicOpinionScore }}</span></el-col
|
||||
>
|
||||
<el-col :span="12" style="text-align: right">评分:<span style="color: #36a4f8">{{
|
||||
scoreDetail.publicOpinionScore }}</span></el-col>
|
||||
</el-row>
|
||||
<el-row class="score-detail-row rule">
|
||||
<el-col :span="24">*计算规则</el-col>
|
||||
|
|
@ -329,7 +257,9 @@
|
|||
</el-row>
|
||||
<el-row class="score-detail-row" justify="space-between">
|
||||
<el-col :span="12">资讯评分</el-col>
|
||||
<el-col :span="12" style="color: #36a4f8; text-align: right; font-weight: 700">{{ scoreDetail.newsScore }}</el-col>
|
||||
<el-col :span="12" style="color: #36a4f8; text-align: right; font-weight: 700">{{
|
||||
scoreDetail.newsScore
|
||||
}}</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<template #footer>
|
||||
|
|
@ -428,7 +358,7 @@ async function doDeleteNewsFn(item) {
|
|||
getData();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
|
|
@ -503,18 +433,18 @@ async function doApprovalFn(item, status) {
|
|||
let { code } =
|
||||
status == 3
|
||||
? await doNewRevoke({
|
||||
id: item.id,
|
||||
})
|
||||
id: item.id,
|
||||
})
|
||||
: await doNewSubmit({
|
||||
id: item.id,
|
||||
});
|
||||
id: item.id,
|
||||
});
|
||||
if (code == 200) {
|
||||
ElMessage.success('操作成功');
|
||||
drawer.value = false;
|
||||
getData();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -538,20 +468,20 @@ async function doNewsPublishFn(item, status) {
|
|||
let { code } =
|
||||
status == 1
|
||||
? await doNewRevoke({
|
||||
id: item.id,
|
||||
status: status,
|
||||
})
|
||||
id: item.id,
|
||||
status: status,
|
||||
})
|
||||
: await doNewsPublish({
|
||||
id: item.id,
|
||||
status: status,
|
||||
});
|
||||
id: item.id,
|
||||
status: status,
|
||||
});
|
||||
if (code == 200) {
|
||||
ElMessage.success('操作成功');
|
||||
drawer.value = false;
|
||||
getData();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -771,10 +701,10 @@ async function doRecoverFn(item) {
|
|||
getData();
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
}
|
||||
|
||||
function recordDialogClose() {}
|
||||
function recordDialogClose() { }
|
||||
|
||||
// 页面加载时
|
||||
onMounted(async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue