feat(richedit): 根据用户类型控制表格折叠功能

添加 hadExpand 状态控制表格折叠功能,仅对 userType 为 '01' 的用户禁用折叠
更新环境配置,切换 API 地址到测试环境
This commit is contained in:
34701892@qq.com 2025-12-01 14:18:33 +08:00
parent df941cefbe
commit dbc19385ea
4 changed files with 31 additions and 25 deletions

View File

@ -2,9 +2,9 @@
ENV = production
# 线上环境接口地址
VITE_API_URL = https://cankao.cs.com.cn/admin
# VITE_API_URL = http://123.60.153.169:8040/admin
# VITE_API_URL = https://cankao.cs.com.cn/admin
VITE_API_URL = http://123.60.153.169:8040/admin
#H5的域名目前是给列表里的复制用
VITE_API_URL_H5 = https://cankao.cs.com.cn
# VITE_API_URL_H5 = http://123.60.153.169:8040
# VITE_API_URL_H5 = https://cankao.cs.com.cn
VITE_API_URL_H5 = http://123.60.153.169:8040

View File

@ -1,8 +1,5 @@
<template>
<div class="cu_table">
<!-- :cell-class-name="cellClassName" -->
<!-- :tree-props="{ children: 'clusterNews', hasChildren: true }" -->
<el-table
:show-header="showHeader"
ref="tableRef"
@ -23,7 +20,7 @@
size="small"
row-key="id"
:cell-class-name="cellClassName"
:tree-props="{ children: 'clusterNews', hasChildren: true }"
:tree-props="{ children: hadExpand ? 'clusterNews' : '', hasChildren: true }"
>
<slot></slot>
</el-table>
@ -45,6 +42,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import { Session } from '/@/utils/storage';
const props = defineProps({
//
@ -64,6 +62,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
hadExpand: {
type: Boolean,
default: true,
},
});
const emit = defineEmits(['currentChange', 'selectionChange', 'sizeChange', 'sortChange']);

View File

@ -565,6 +565,7 @@ function handleSearch() {
getData();
}
const hadExpand = ref(true);
//
async function getData() {
// return
@ -619,6 +620,13 @@ async function getData() {
});
}
});
// console.log('🚀 ~ getData ~ route.path:', route.path);
// if (Session.get('userInfoLocal').userType != '01') {
// hadExpand.value = false;
// } else {
// hadExpand.value = true;
// }
}
} catch (error) {
tableLoading.value = false;

View File

@ -323,6 +323,7 @@
@sortChange="sortChange"
:tableLoading="tableLoading"
@currentChange="currentChange"
:hadExpand="hadExpand"
@sizeChange="sizeChange"
>
<!-- <el-table-column type="expand">
@ -332,7 +333,9 @@
</el-table-column> -->
<el-table-column prop="title" label="标题" align="left" width="380">
<template v-slot="scope">
<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 && Session.get('userInfoLocal').userType != '01'">
{{ scope.row.clusterNews ? scope.row.clusterNews.length : 0 }}
</div>
<div
style="display: flex; flex-direction: column; justify-content: flex-start; align-items: start; gap: 5px; padding: 10px 0; margin-top: 8px"
@ -352,24 +355,9 @@
<div class="label_item" v-if="scope.row.companyName && scope.row.companyName.length > 0">
{{ scope.row.companyName }}
</div>
<!-- <div v-for="company in scope.row.companys" :key="company" class="label_item">
{{ company }}
</div> -->
</div>
<div class="labels" v-if="Session.get('userInfoLocal').userType == '00'">
<!-- <div v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0" class="label_item_box">
<div v-for="item in scope.row.conceptLabels" :key="item" class="label_item" style="background-color: #eee6cd">
{{ item }}
</div>
</div>
<div v-if="scope.row.industryLabels && scope.row.industryLabels.length > 0" class="label_item_box">
<div v-for="item in scope.row.industryLabels" :key="item" class="label_item" style="background-color: #cfdcf3">
{{ item }}
</div>
</div> -->
<div style="background-color: #eee6cd" class="label_item" v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0">
{{ scope.row.conceptLabels[0] }}
</div>
@ -775,7 +763,7 @@ function handleSearch() {
tableData.page = 1;
getData();
}
const hadExpand = ref(false);
//
async function getData() {
// return
@ -830,6 +818,14 @@ async function getData() {
});
}
});
//
console.log("🚀 ~ getData ~ Session.get('userInfoLocal').userType:", Session.get('userInfoLocal').userType);
if (Session.get('userInfoLocal').userType == '01') {
hadExpand.value = false;
} else {
hadExpand.value = true;
}
}
} catch (error) {
tableLoading.value = false;