refactor(richedit): 移除用户类型相关条件渲染逻辑

移除资讯精选页面中基于用户类型的条件渲染逻辑,简化代码结构
This commit is contained in:
34701892@qq.com 2025-09-06 18:31:56 +08:00
parent 94cc7c172c
commit 633db07fbe
2 changed files with 11 additions and 20 deletions

View File

@ -1,8 +1,7 @@
<template> <template>
<div class="index inside_pd"> <div class="index inside_pd">
<div class="colHeader"> <div class="colHeader">
<div class="page_title" v-if="Session.get('userInfoLocal').userType == '00'">资讯精选</div> <div class="page_title">资讯精选</div>
<div class="page_title" v-if="Session.get('userInfoLocal').userType == '01'">资讯审核</div>
<div style="width: 100%; display: flex; align-items: flex-end"> <div style="width: 100%; display: flex; align-items: flex-end">
<el-button type="primary" style="margin-bottom: 10px" @click="restData">清空条件</el-button> <el-button type="primary" style="margin-bottom: 10px" @click="restData">清空条件</el-button>
@ -42,8 +41,7 @@
size="large" style="width: 240px" filterable @change="handleSearch" /> 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 clearable v-model="form.deleted" size="large" style="width: 150px; margin-left: 10px"
v-if="Session.get('userInfoLocal').userType == '00'" placeholder="筛选删除状态" placeholder="筛选删除状态" @change="handleSearch">
@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>
@ -86,8 +84,7 @@
<template #dropdown> <template #dropdown>
<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">未发布</el-dropdown-item>
v-if="Session.get('userInfoLocal').userType == '00'">未发布</el-dropdown-item>
<el-dropdown-item :command="2">已发布</el-dropdown-item> <el-dropdown-item :command="2">已发布</el-dropdown-item>
<el-dropdown-item :command="3">审核中</el-dropdown-item> <el-dropdown-item :command="3">审核中</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@ -107,12 +104,11 @@
</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="编辑人">
<template v-slot="scope"> <template v-slot="scope">
{{ 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"> <el-table-column align="center" width="120">
<template #header> <template #header>
<el-dropdown trigger="click" @command="handleCommandRating"> <el-dropdown trigger="click" @command="handleCommandRating">
@ -167,20 +163,15 @@
<el-button v-if="scope.row.status == 0 || scope.row.status == 1" type="text" <el-button v-if="scope.row.status == 0 || scope.row.status == 1" 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 && Session.get('userInfoLocal').userType == '01'" <el-button v-if="scope.row.status == 3" type="text"
type="text" @click="goDetail(1, scope.row, false)">编辑</el-button> @click="goDetail(1, scope.row, false)">编辑</el-button>
<div v-if="Session.get('userInfoLocal').userType == '01'"> <div>
<!-- 审核人员才有发布和撤稿 --> <!-- 审核人员才有发布和撤稿 -->
<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 @click="doNewsPublishFn(scope.row, 2)">发布</el-button> <el-button type="text" v-else @click="doNewsPublishFn(scope.row, 2)">发布</el-button>
</div> </div>
<div v-else-if="Session.get('userInfoLocal').userType == '00'" 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>
</div>
<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>
<el-button v-if="scope.row.status == 0 || scope.row.status == 1" type="text" <el-button v-if="scope.row.status == 0 || scope.row.status == 1" type="text"

View File

@ -107,11 +107,11 @@
</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="编辑人">
<template v-slot="scope"> <template v-slot="scope">
{{ 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"> <el-table-column align="center" width="120">
<template #header> <template #header>
<el-dropdown trigger="click" @command="handleCommandRating"> <el-dropdown trigger="click" @command="handleCommandRating">