update:tree表格优化
This commit is contained in:
@@ -310,6 +310,7 @@ defineExpose({
|
||||
}
|
||||
.table {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
</div>
|
||||
<div class="darg-line" @mousedown="startDragFun">||</div>
|
||||
<div class="right-box">
|
||||
<slot name="right" />
|
||||
<div class="right-content">
|
||||
<div class="slot">
|
||||
<slot name="right" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,7 +72,14 @@ const stopDragFun = () => {
|
||||
.right-box {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
.right-content {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
.slot {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.darg-line {
|
||||
display: flex;
|
||||
|
||||
@@ -278,6 +278,7 @@ defineExpose({
|
||||
}
|
||||
.table {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,80 +37,95 @@
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template #table>
|
||||
<TableSearch
|
||||
v-if="searchItems.length > 0"
|
||||
ref="tableSearchRef"
|
||||
:searchItems="searchItems"
|
||||
@search="searchFun"
|
||||
@reset="resetFun"
|
||||
/>
|
||||
<BaseTable
|
||||
ref="baseTableRef"
|
||||
tableName="SIMULATION_KNOWLEDGE"
|
||||
:api="apiName"
|
||||
:params="searchParams"
|
||||
showIndex
|
||||
:actionsWidth="200"
|
||||
:actionList="actionList"
|
||||
@cell-dblclick="onCellDblclickFun"
|
||||
:exportApi="dataExportKnowledgeListApi"
|
||||
:exportFileName="$t('知识库.知识库列表')"
|
||||
:exportDict="{
|
||||
approvalStatus: 'KNOWLEDGE_APPROVE_STATUS',
|
||||
}"
|
||||
:exportParams="{
|
||||
...searchParams,
|
||||
parentDirId: currentFolder?.id || '',
|
||||
}"
|
||||
>
|
||||
<template #leftOptions>
|
||||
<div>
|
||||
<el-button :icon="DArrowLeft" @click="backFun" :disabled="navList.length <= 1">{{
|
||||
$t('通用.返回上一级')
|
||||
}}</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="Plus"
|
||||
@click="openModalFun"
|
||||
:disabled="!currentFolder"
|
||||
>
|
||||
{{ $t('知识库.上传') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #originalName="{ row }">
|
||||
<el-icon v-if="row.dataType === 1">
|
||||
<Folder />
|
||||
</el-icon>
|
||||
<el-icon v-else>
|
||||
<Document />
|
||||
</el-icon>
|
||||
{{ row.originalName }}
|
||||
</template>
|
||||
<template #fileSize="{ row }">
|
||||
{{ formatFileSize(row.fileSize) }}
|
||||
</template>
|
||||
<template #approvalStatus="{ row, column }">
|
||||
<template v-if="row.dataType === 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="openProcessFun(row)"
|
||||
v-if="row[column.field] === 'pending'"
|
||||
>
|
||||
{{ KNOWLEDGE_APPROVE_STATUS.O[row[column.field]] }}
|
||||
</el-button>
|
||||
<el-button type="primary" link @click="openProcessFun(row)" v-else>
|
||||
{{ $t('知识库.审批完成') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #approveType="{ row, column }">
|
||||
<el-button v-if="row.dataType === 2" type="primary" link @click="openProcessFun(row)">
|
||||
{{ KNOWLEDGE_APPROVE_TYPE.O[row[column.field]] }}</el-button
|
||||
<div class="right-table">
|
||||
<div class="search">
|
||||
<TableSearch
|
||||
v-if="searchItems.length > 0"
|
||||
ref="tableSearchRef"
|
||||
:searchItems="searchItems"
|
||||
@search="searchFun"
|
||||
@reset="resetFun"
|
||||
/>
|
||||
</div>
|
||||
<div class="table">
|
||||
<BaseTable
|
||||
ref="baseTableRef"
|
||||
tableName="SIMULATION_KNOWLEDGE"
|
||||
:api="apiName"
|
||||
:params="searchParams"
|
||||
showIndex
|
||||
:actionsWidth="200"
|
||||
:actionList="actionList"
|
||||
:exportApi="dataExportKnowledgeListApi"
|
||||
fullHeight
|
||||
:exportFileName="$t('知识库.知识库列表')"
|
||||
:exportDict="{
|
||||
approvalStatus: 'KNOWLEDGE_APPROVE_STATUS',
|
||||
}"
|
||||
:exportParams="{
|
||||
...searchParams,
|
||||
parentDirId: currentFolder?.id || '',
|
||||
}"
|
||||
@cell-dblclick="onCellDblclickFun"
|
||||
>
|
||||
</template>
|
||||
</BaseTable>
|
||||
<template #leftOptions>
|
||||
<div>
|
||||
<el-button
|
||||
:icon="DArrowLeft"
|
||||
@click="backFun"
|
||||
:disabled="navList.length <= 1"
|
||||
>{{ $t('通用.返回上一级') }}</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
:icon="Plus"
|
||||
@click="openModalFun"
|
||||
:disabled="!currentFolder"
|
||||
>
|
||||
{{ $t('知识库.上传') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<template #originalName="{ row }">
|
||||
<el-icon v-if="row.dataType === 1">
|
||||
<Folder />
|
||||
</el-icon>
|
||||
<el-icon v-else>
|
||||
<Document />
|
||||
</el-icon>
|
||||
{{ row.originalName }}
|
||||
</template>
|
||||
<template #fileSize="{ row }">
|
||||
{{ formatFileSize(row.fileSize) }}
|
||||
</template>
|
||||
<template #approvalStatus="{ row, column }">
|
||||
<template v-if="row.dataType === 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="openProcessFun(row)"
|
||||
v-if="row[column.field] === 'pending'"
|
||||
>
|
||||
{{ KNOWLEDGE_APPROVE_STATUS.O[row[column.field]] }}
|
||||
</el-button>
|
||||
<el-button type="primary" link @click="openProcessFun(row)" v-else>
|
||||
{{ $t('知识库.审批完成') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #approveType="{ row, column }">
|
||||
<el-button
|
||||
v-if="row.dataType === 2"
|
||||
type="primary"
|
||||
link
|
||||
@click="openProcessFun(row)"
|
||||
>
|
||||
{{ KNOWLEDGE_APPROVE_TYPE.O[row[column.field]] }}</el-button
|
||||
>
|
||||
</template>
|
||||
</BaseTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</FileTree>
|
||||
</div>
|
||||
@@ -474,6 +489,15 @@ const openProcessFun = (row: any) => {
|
||||
.options {
|
||||
margin-bottom: var(--margin-small);
|
||||
}
|
||||
.right-table {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
.table {
|
||||
flex: 1;
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user