feat(web-admin): viewport-fill list height for system manage menus
Wire 系统信息 lists (tenant/dict/menu/dept/role/user/post/operlog) and 临时存放 CRM lists under 系统管理 to useListTableViewportHeight, with onActivated recalc for keep-alive pages. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f457d5e106
commit
506cc7991a
19 files changed
+7871
-5820
No files matched your search
@@ -206,7 +206,10 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="crm-clue"
|
||||
<div ref="crmClueTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="crmClueTableRef"
|
||||
:height="tableHeight" table-key="crm-clue"
|
||||
class="list-table"
|
||||
:data="clueList"
|
||||
v-loading="loading"
|
||||
@@ -401,7 +404,10 @@
|
||||
/>
|
||||
</ListTable>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
|
||||
</div>
|
||||
<div ref="crmClueBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -417,6 +423,7 @@
|
||||
@current-change="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ClueForm ref="clueFormRef" @success="getList" />
|
||||
@@ -516,6 +523,7 @@
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
|
||||
@@ -588,6 +596,15 @@
|
||||
]
|
||||
})
|
||||
|
||||
const crmClueTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const crmClueBelowRef = ref<HTMLElement | null>(null)
|
||||
const crmClueTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: crmClueTableWrapRef,
|
||||
pagerEl: crmClueBelowRef,
|
||||
tableRef: crmClueTableRef
|
||||
})
|
||||
|
||||
const clueExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('company')) cols.unshift('company')
|
||||
@@ -891,5 +908,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
</script>
|
||||
@@ -114,7 +114,10 @@
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="crm-customer-pool-rule-index"
|
||||
<div ref="crmPoolRuleTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="crmPoolRuleTableRef"
|
||||
:height="tableHeight" table-key="crm-customer-pool-rule-index"
|
||||
class="list-table"
|
||||
:data="ruleList"
|
||||
v-loading="loading"
|
||||
@@ -210,7 +213,10 @@
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
</ListTable>
|
||||
<div class="pagination list-pager-bar">
|
||||
|
||||
</div>
|
||||
<div ref="crmPoolRuleBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -225,6 +231,7 @@
|
||||
@current-change="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑规则对话框 -->
|
||||
@@ -239,6 +246,7 @@ import ListExportDropdown from '@/components/business/list-export-dropdown/index
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import {
|
||||
Plus,
|
||||
Close,
|
||||
@@ -286,6 +294,15 @@ const {
|
||||
resetToDefault
|
||||
} = usePersistedListColumns('crm_pool_rule_visible_columns', listColumnDefs)
|
||||
|
||||
const crmPoolRuleTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const crmPoolRuleBelowRef = ref<HTMLElement | null>(null)
|
||||
const crmPoolRuleTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: crmPoolRuleTableWrapRef,
|
||||
pagerEl: crmPoolRuleBelowRef,
|
||||
tableRef: crmPoolRuleTableRef
|
||||
})
|
||||
|
||||
const poolRuleExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('poolName')) cols.unshift('poolName')
|
||||
@@ -463,6 +480,8 @@ const handleBatchExecute = async () => {
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
|
||||
watchDebounced(
|
||||
|
||||
@@ -93,7 +93,10 @@
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="crm-customer-pool"
|
||||
<div ref="crmPoolTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="crmPoolTableRef"
|
||||
:height="tableHeight" table-key="crm-customer-pool"
|
||||
class="list-table"
|
||||
:data="customerList"
|
||||
v-loading="loading"
|
||||
@@ -506,7 +509,10 @@
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
</ListTable>
|
||||
<div class="pagination list-pager-bar">
|
||||
|
||||
</div>
|
||||
<div ref="crmPoolBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -521,6 +527,7 @@
|
||||
@current-change="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 客户详情抽屉 -->
|
||||
@@ -549,6 +556,7 @@ import ListExportDropdown from '@/components/business/list-export-dropdown/index
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import ClaimDialog from './components/ClaimDialog.vue'
|
||||
import AssignDialog from './components/AssignDialog.vue'
|
||||
import CustomerDetail from '../CustomerDetailDialog.vue'
|
||||
@@ -632,6 +640,15 @@ const {
|
||||
]
|
||||
})
|
||||
|
||||
const crmPoolTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const crmPoolBelowRef = ref<HTMLElement | null>(null)
|
||||
const crmPoolTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: crmPoolTableWrapRef,
|
||||
pagerEl: crmPoolBelowRef,
|
||||
tableRef: crmPoolTableRef
|
||||
})
|
||||
|
||||
const poolExportColumns = computed(() => {
|
||||
const cols = [...visibleColumns.value]
|
||||
if (!cols.includes('customerName')) cols.unshift('customerName')
|
||||
@@ -747,5 +764,7 @@ watchDebounced(
|
||||
|
||||
onMounted(() => {
|
||||
getList()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
</script>
|
||||
@@ -156,7 +156,10 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="crm-opportunity"
|
||||
<div ref="crmOpportunityTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="crmOpportunityTableRef"
|
||||
:height="tableHeight" table-key="crm-opportunity"
|
||||
v-loading="loading"
|
||||
class="list-table"
|
||||
stripe
|
||||
@@ -452,22 +455,24 @@
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
</ListTable>
|
||||
</div>
|
||||
<div ref="crmOpportunityBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
<el-pagination
|
||||
v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 100, 500]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
background
|
||||
@size-change="getList"
|
||||
@current-change="getList"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-pagination
|
||||
v-model:current-page="queryParams.pageNum"
|
||||
v-model:page-size="queryParams.pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 100, 500]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
background
|
||||
@size-change="getList"
|
||||
@current-change="getList"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -598,6 +603,7 @@
|
||||
import ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const router = useRouter()
|
||||
@@ -651,6 +657,15 @@
|
||||
]
|
||||
})
|
||||
|
||||
const crmOpportunityTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const crmOpportunityBelowRef = ref<HTMLElement | null>(null)
|
||||
const crmOpportunityTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: crmOpportunityTableWrapRef,
|
||||
pagerEl: crmOpportunityBelowRef,
|
||||
tableRef: crmOpportunityTableRef
|
||||
})
|
||||
|
||||
// 当前视图
|
||||
const activeView = ref('mine')
|
||||
|
||||
@@ -1059,7 +1074,9 @@
|
||||
// 初始化加载数据
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -29,7 +29,10 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="crm-supplier-hazard" v-loading="loading" :data="tableData" class="list-table" stripe>
|
||||
<div ref="crmSupplierHazardTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="crmSupplierHazardTableRef"
|
||||
:height="tableHeight" table-key="crm-supplier-hazard" v-loading="loading" :data="tableData" class="list-table" stripe>
|
||||
<el-table-column prop="supplierName" label="主体名称" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="supplierCode" label="编码" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="允许易制毒" min-width="120" align="center">
|
||||
@@ -61,8 +64,9 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="updateTime" label="更新时间" min-width="160" show-overflow-tooltip />
|
||||
</ListTable>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
</div>
|
||||
<div ref="crmSupplierHazardBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
@@ -74,6 +78,7 @@
|
||||
@current-change="loadData"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -82,6 +87,7 @@
|
||||
<script setup lang="ts">
|
||||
import { RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import {
|
||||
listSupplierInfo,
|
||||
updateSupplierInfo,
|
||||
@@ -154,7 +160,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
const crmSupplierHazardTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const crmSupplierHazardBelowRef = ref<HTMLElement | null>(null)
|
||||
const crmSupplierHazardTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: crmSupplierHazardTableWrapRef,
|
||||
pagerEl: crmSupplierHazardBelowRef,
|
||||
tableRef: crmSupplierHazardTableRef
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
</script>
|
||||
Reference in new issue
Block a user