feat(richedit): 根据用户类型控制表格折叠功能
添加 hadExpand 状态控制表格折叠功能,仅对 userType 为 '01' 的用户禁用折叠 更新环境配置,切换 API 地址到测试环境
This commit is contained in:
parent
df941cefbe
commit
dbc19385ea
|
|
@ -2,9 +2,9 @@
|
||||||
ENV = production
|
ENV = production
|
||||||
|
|
||||||
# 线上环境接口地址
|
# 线上环境接口地址
|
||||||
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
|
||||||
|
|
||||||
#H5的域名,目前是给列表里的复制用
|
#H5的域名,目前是给列表里的复制用
|
||||||
VITE_API_URL_H5 = https://cankao.cs.com.cn
|
# VITE_API_URL_H5 = https://cankao.cs.com.cn
|
||||||
# VITE_API_URL_H5 = http://123.60.153.169:8040
|
VITE_API_URL_H5 = http://123.60.153.169:8040
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="cu_table">
|
<div class="cu_table">
|
||||||
<!-- :cell-class-name="cellClassName" -->
|
|
||||||
<!-- :tree-props="{ children: 'clusterNews', hasChildren: true }" -->
|
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
:show-header="showHeader"
|
:show-header="showHeader"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
|
|
@ -23,7 +20,7 @@
|
||||||
size="small"
|
size="small"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:cell-class-name="cellClassName"
|
:cell-class-name="cellClassName"
|
||||||
:tree-props="{ children: 'clusterNews', hasChildren: true }"
|
:tree-props="{ children: hadExpand ? 'clusterNews' : '', hasChildren: true }"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -45,6 +42,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { Session } from '/@/utils/storage';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 列表内容
|
// 列表内容
|
||||||
|
|
@ -64,6 +62,10 @@ const props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
hadExpand: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['currentChange', 'selectionChange', 'sizeChange', 'sortChange']);
|
const emit = defineEmits(['currentChange', 'selectionChange', 'sizeChange', 'sortChange']);
|
||||||
|
|
|
||||||
|
|
@ -565,6 +565,7 @@ function handleSearch() {
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hadExpand = ref(true);
|
||||||
// 获取列表
|
// 获取列表
|
||||||
async function getData() {
|
async function getData() {
|
||||||
// return
|
// 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) {
|
} catch (error) {
|
||||||
tableLoading.value = false;
|
tableLoading.value = false;
|
||||||
|
|
|
||||||
|
|
@ -323,6 +323,7 @@
|
||||||
@sortChange="sortChange"
|
@sortChange="sortChange"
|
||||||
:tableLoading="tableLoading"
|
:tableLoading="tableLoading"
|
||||||
@currentChange="currentChange"
|
@currentChange="currentChange"
|
||||||
|
:hadExpand="hadExpand"
|
||||||
@sizeChange="sizeChange"
|
@sizeChange="sizeChange"
|
||||||
>
|
>
|
||||||
<!-- <el-table-column type="expand">
|
<!-- <el-table-column type="expand">
|
||||||
|
|
@ -332,7 +333,9 @@
|
||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
<el-table-column prop="title" label="标题" align="left" width="380">
|
<el-table-column prop="title" label="标题" align="left" width="380">
|
||||||
<template v-slot="scope">
|
<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
|
<div
|
||||||
style="display: flex; flex-direction: column; justify-content: flex-start; align-items: start; gap: 5px; padding: 10px 0; margin-top: 8px"
|
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">
|
<div class="label_item" v-if="scope.row.companyName && scope.row.companyName.length > 0">
|
||||||
{{ scope.row.companyName }}
|
{{ 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-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">
|
<div style="background-color: #eee6cd" class="label_item" v-if="scope.row.conceptLabels && scope.row.conceptLabels.length > 0">
|
||||||
{{ scope.row.conceptLabels[0] }}
|
{{ scope.row.conceptLabels[0] }}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -775,7 +763,7 @@ function handleSearch() {
|
||||||
tableData.page = 1;
|
tableData.page = 1;
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
|
const hadExpand = ref(false);
|
||||||
// 获取列表
|
// 获取列表
|
||||||
async function getData() {
|
async function getData() {
|
||||||
// return
|
// 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) {
|
} catch (error) {
|
||||||
tableLoading.value = false;
|
tableLoading.value = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue