SNewestDataListLayout2.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. const e = `<template>
  2. <div class="list-layout" ref="layout">
  3. <a-spin :spinning="spinning">
  4. <div class="tools">
  5. <div class="title">
  6. {{ $l(title) }}
  7. </div>
  8. <div class="btns">
  9. <a-space :size="spaceSize">
  10. <span class="item-btn" v-for="btn in renderButtons" :key="btn.key">
  11. <a-button
  12. class="btn"
  13. v-action="btn.action || btn.key"
  14. v-show="btn.show !== false"
  15. :disabled="!!btn.disabled"
  16. :type="btn.type || (btn.key === 'add' ? 'primary' : 'default')"
  17. @click="btnCallback(btn)"
  18. >
  19. <template #icon>
  20. <component v-if="renderIcon(btn)" :is="renderIcon(btn)" />
  21. </template>
  22. {{ $l(btn.name) }}
  23. </a-button>
  24. </span>
  25. <slot name="otherBtns" :selections="selectedRowKeys" />
  26. </a-space>
  27. </div>
  28. </div>
  29. <div class="list-layout-main">
  30. <div
  31. class="side s-side-tree"
  32. ref="side"
  33. :style="{ width: sideWidth + 'px' }"
  34. style="overflow-y: auto"
  35. v-if="$slots.tree"
  36. >
  37. <slot name="tree" />
  38. </div>
  39. <div class="side-bar s-theme-bg" v-if="$slots.tree" v-sidedrag></div>
  40. <div class="layout-list-content" v-if="!$slots.empty && listType === 'table'">
  41. <div class="filter-wrap" ref="filters" v-if="$slots.filter || $slots.filterMore">
  42. <div class="filter-content" v-if="$slots.filter">
  43. <div class="filter">
  44. <slot name="filter" />
  45. </div>
  46. <a class="filter-more-btn" v-if="$slots.filterMore" @click="toggleFilter">
  47. {{ !isMoreFilter ? $l('更多筛选') : $l('收起') }}
  48. <double-right-outlined
  49. style="font-size: 12px; transform: rotate(90deg)"
  50. v-if="!isMoreFilter"
  51. />
  52. <double-right-outlined style="font-size: 12px; transform: rotate(-90deg)" v-else />
  53. </a>
  54. <div class="reset-wrap" v-if="$slots.filter">
  55. <a-button
  56. v-if="isEnableAdvancedSearch"
  57. class="advanced-search"
  58. type="link"
  59. @click="advancedSearch"
  60. >{{ $l('高级搜索') }}</a-button
  61. >
  62. <a-tooltip placement="top" :overlayStyle="{ maxWidth: '500px' }">
  63. <template #title>
  64. <span>{{ $l('条件重置') }}</span>
  65. </template>
  66. <a-button style="padding-bottom: 2px" @click="filterReset">
  67. <template #icon>
  68. <sync-outlined />
  69. </template>
  70. </a-button>
  71. </a-tooltip>
  72. </div>
  73. </div>
  74. <div class="filter-more-content" v-if="$slots.filterMore" v-show="isMoreFilter">
  75. <slot name="filterMore" />
  76. </div>
  77. <div class="desc-wrap" v-if="$slots.desc">
  78. <slot name="desc" />
  79. </div>
  80. </div>
  81. <div class="search-bar" v-if="isEnableSearchBar">
  82. <slot name="search-bar" />
  83. </div>
  84. <div class="status-bar" v-if="isEnableStatusBar">
  85. <slot name="status-bar" />
  86. </div>
  87. <div class="table-content">
  88. <div class="tabs-wrap" v-if="$slots.tabs" ref="tabs">
  89. <slot name="tabs" />
  90. </div>
  91. <div class="table-container">
  92. <s-table
  93. ref="table"
  94. size="middle"
  95. :scroll="{ y: tableScrollPx, x: '100%' }"
  96. :pageSize="pageSize"
  97. :rowKey="rowKey"
  98. :columns="renderColumns"
  99. :data="loadData"
  100. v-model:expanded-row-keys="expandedRowKeys"
  101. :rowSelection="
  102. showSelection || isSelection
  103. ? {
  104. selectedRowKeys: selectedRowKeys,
  105. onChange: onSelectChange,
  106. getCheckboxProps: getCheckboxProps
  107. }
  108. : null
  109. "
  110. :showPagination="showPagination"
  111. >
  112. <!-- template / isClick / action 列共用 bodyCell:template 渲染同名插槽,isClick 渲染可点击,action 渲染操作列 -->
  113. <template #bodyCell="scope">
  114. <template v-if="scope.column">
  115. <!-- cell-template -->
  116. <slot
  117. v-if="isTemplateColumn(scope.column.dataIndex)"
  118. :name="scope.column.dataIndex"
  119. :text="scope.text"
  120. :record="scope.record"
  121. :index="scope.index"
  122. :item="getColumn(scope.column.dataIndex)"
  123. />
  124. <!-- cell-click -->
  125. <a
  126. v-else-if="isClickColumn(scope.column.dataIndex)"
  127. @click="tableColCallback(scope.column.dataIndex, scope.record)"
  128. >{{ getCellText(scope.text) }}</a
  129. >
  130. <!-- cell-action -->
  131. <slot
  132. v-else-if="scope.column.dataIndex === 'action'"
  133. name="action"
  134. :record="scope.record"
  135. />
  136. </template>
  137. </template>
  138. </s-table>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="layout-list-content" v-if="!$slots.empty && listType === 'custom'">
  143. <slot name="custom-layout-list-content" />
  144. </div>
  145. <div class="layout-list-content" v-if="$slots.empty">
  146. <slot name="empty" />
  147. </div>
  148. </div>
  149. <div class="other">
  150. <slot name="other" />
  151. </div>
  152. </a-spin>
  153. <s-import-modal
  154. v-if="isShowImportModal"
  155. ref="importModalRef"
  156. :upload-url="importItem.importUploadUrl"
  157. v-model:value="importVisible"
  158. :columns="importItem.importColumns"
  159. :apis="importItem.importApis"
  160. @reload="reload"
  161. />
  162. </div>
  163. </template>
  164. <script setup>
  165. import { computed, h, nextTick, onActivated, onMounted, ref, watch } from 'vue'
  166. import { useRoute } from 'vue-router'
  167. import STable from '../Table/index'
  168. import { createSideDrag } from '../../utils/side-drag'
  169. defineOptions({ name: 'SNewestDataListLayout' })
  170. const props = defineProps({
  171. // 页面标题
  172. title: {
  173. type: String,
  174. required: true
  175. },
  176. // 工具栏按钮配置
  177. buttons: {
  178. type: Array,
  179. default: () => [
  180. {
  181. name: window.$l('添加'),
  182. key: 'add',
  183. show: true,
  184. type: 'primary',
  185. icon: true,
  186. api: null
  187. },
  188. {
  189. name: window.$l('批量删除'),
  190. key: 'remove',
  191. action: 'remove',
  192. show: true,
  193. icon: true,
  194. api: null
  195. },
  196. {
  197. name: window.$l('导入'),
  198. key: 'import',
  199. show: true,
  200. icon: true,
  201. importColumns: [], // 预览的表头信息
  202. importUploadUrl: null, // 上传url
  203. importApis: {
  204. templateDownload: null,
  205. importPreview: null,
  206. importData: null,
  207. exportExceptionData: null
  208. }
  209. },
  210. {
  211. name: window.$l('导出'),
  212. key: 'export',
  213. show: true,
  214. icon: true,
  215. api: null
  216. }
  217. ]
  218. },
  219. // 列表checkbox列
  220. isSelection: {
  221. type: Boolean,
  222. default: false
  223. },
  224. // 是否显示分页
  225. showPagination: {
  226. type: Boolean,
  227. default: true
  228. },
  229. // 表格列配置
  230. columns: {
  231. type: Array,
  232. default: () => []
  233. },
  234. // 行主键字段名
  235. rowKey: {
  236. type: [Function, String],
  237. default: 'id'
  238. },
  239. // 取数函数,返回 { list, total }
  240. loadData: {
  241. type: Function,
  242. required: true
  243. },
  244. // 每页条数
  245. pSize: {
  246. type: [String, Number],
  247. default: 20
  248. },
  249. // 列表主体形态:table 走表格,custom 走 custom-layout-list-content 插槽
  250. listType: {
  251. type: String,
  252. default: 'table'
  253. },
  254. // 高级搜索入口
  255. isEnableAdvancedSearch: {
  256. type: Boolean,
  257. default: false
  258. },
  259. // 状态条插槽开关
  260. isEnableStatusBar: {
  261. type: Boolean,
  262. default: false
  263. },
  264. // 搜索条插槽开关
  265. isEnableSearchBar: {
  266. type: Boolean,
  267. default: false
  268. },
  269. // 行勾选控制(antd rowSelection.getCheckboxProps):返回 { disabled, ... }
  270. getCheckboxProps: {
  271. type: Function,
  272. default: () => ({})
  273. }
  274. })
  275. const emit = defineEmits(['reset', 'btnCallback', 'tableColCallback', 'advancedSearch'])
  276. const route = useRoute()
  277. // ---------- 模板 ref ----------
  278. const layout = ref(null)
  279. const side = ref(null)
  280. const filters = ref(null)
  281. const tabs = ref(null)
  282. const table = ref(null)
  283. const importModalRef = ref(null)
  284. const spaceSize = ref(8)
  285. // ---------- 状态 ----------
  286. const importVisible = ref(false)
  287. // 表体滚动高度:仅作为 scroll.y 同步值(初值兜底),布局高度完全由 CSS flex 决定
  288. const tableScrollPx = ref(300)
  289. const isMoreFilter = ref(false)
  290. const spinning = ref(false)
  291. const pageSize = ref(20)
  292. const sideWidth = ref(256)
  293. const showSelection = ref(false)
  294. const selectedRowKeys = ref([])
  295. const expandedRowKeys = ref([])
  296. const renderColumns = ref([])
  297. const renderButtons = ref([])
  298. const iconMap = {
  299. add: 'PlusCircleOutlined',
  300. edit: 'FormOutlined',
  301. delete: 'DeleteOutlined',
  302. remove: 'DeleteOutlined',
  303. import: 'UploadOutlined',
  304. export: 'DownloadOutlined',
  305. assign: 'ClusterOutlined',
  306. execute: 'PlayCircleOutlined',
  307. pause: 'PauseCircleOutlined',
  308. resume: 'PoweroffOutlined',
  309. approve: 'HighlightOutlined',
  310. setting: 'SettingOutlined',
  311. TopOfType: 'VerticalAlignTopOutlined',
  312. TOP: 'VerticalAlignTopOutlined',
  313. synchronize: 'SyncOutlined'
  314. }
  315. // ---------- computed ----------
  316. const isShowImportModal = computed(() => renderButtons.value.map((i) => i.key).includes('import'))
  317. const importItem = computed(() => renderButtons.value.find((i) => i.key === 'import') || {})
  318. // ---------- watch ----------
  319. watch(
  320. () => props.buttons,
  321. (v) => {
  322. if (v && v.length) initRenderButtons(v)
  323. },
  324. { immediate: true, deep: true }
  325. )
  326. watch(
  327. () => props.columns,
  328. () => initComponent()
  329. )
  330. // ---------- 方法 ----------
  331. function isFunction(fn, name = '') {
  332. if (fn && typeof fn === 'function') {
  333. return true
  334. }
  335. const is = import.meta.env.NODE_ENV === 'development'
  336. if (is) {
  337. console.error(\`\${name}按钮未绑定接口方法Api,请绑定接口或从按钮回调事件"btnCallback"中自行处理\`)
  338. }
  339. return false
  340. }
  341. function renderIcon(v) {
  342. if (typeof v.icon === 'string') {
  343. return v.icon
  344. }
  345. if (typeof v.icon === 'boolean' && v.icon) {
  346. return iconMap[v.key] || ''
  347. }
  348. return ''
  349. }
  350. function initRenderButtons(list) {
  351. // 后续可在这里对当前按钮集合编写逻辑
  352. renderButtons.value = list.map((i) => {
  353. if (i.key === 'remove') showSelection.value = true
  354. return i
  355. })
  356. }
  357. function initTable() {
  358. nextTick(() => {
  359. measureLayout()
  360. pageSize.value = props.pSize
  361. renderColumns.value = props.columns.map((i) => {
  362. if (
  363. (i.template || i.isClick || (i.dataIndex === 'action' && !i.customRender)) &&
  364. !i.scopedSlots
  365. ) {
  366. i.scopedSlots = { customRender: i.dataIndex }
  367. }
  368. return i
  369. })
  370. })
  371. setTimeout(() => {
  372. const th = document.querySelector('.ant-table-cell.ant-table-cell-scrollbar')
  373. const thead = document.querySelector('.ant-table-thead tr')
  374. if (th && thead) thead.removeChild(th)
  375. }, 100)
  376. }
  377. function initComponent() {
  378. nextTick(() => {
  379. initTable()
  380. })
  381. }
  382. function toggleFilter() {
  383. isMoreFilter.value = !isMoreFilter.value
  384. measureLayout()
  385. }
  386. // 查询条件重置
  387. function filterReset() {
  388. emit('reset')
  389. }
  390. function reload() {
  391. table.value && table.value.refresh(true)
  392. }
  393. // 树列表 - 新增/编辑/详情 时 不刷新
  394. function setFilterParams() {}
  395. // 设置列表路由地址
  396. function sethsitoryPath() {
  397. sessionStorage.setItem('backPath', route.path)
  398. }
  399. // 按钮回调
  400. function btnCallback(item) {
  401. emit('btnCallback', item.key, selectedRowKeys.value)
  402. const fn = actionMap[item.key]
  403. if (typeof fn === 'function') {
  404. fn(item)
  405. } else {
  406. handAction(item)
  407. }
  408. }
  409. // 其他未定义按钮方法生成
  410. function handAction(item) {
  411. if (item.selection !== false && !selectedRowKeys.value.length) {
  412. window.$message.warn(\`\${window.$l('请选择要')}\${window.$l(item.name)}\${window.$l('的数据')}\`)
  413. return
  414. }
  415. if (isFunction(item.api, item.name, item.key)) {
  416. if (item.confirm) {
  417. window.$confirm({
  418. title: \`\${item.name}\`,
  419. content: () =>
  420. h(
  421. 'div',
  422. { style: 'color:var(--s-color-error)' },
  423. \`\${window.$l('确认要')}\${window.$l(item.name)}\${window.$l('数据吗?')}\`
  424. ),
  425. onOk: () => {
  426. spinning.value = true
  427. item
  428. .api(selectedRowKeys.value)
  429. .then(() => {
  430. window.$message.success(\`\${window.$l(item.name)}\${window.$l('成功')}\`)
  431. emit('reset')
  432. })
  433. .finally(() => {
  434. spinning.value = false
  435. })
  436. }
  437. })
  438. return
  439. }
  440. spinning.value = true
  441. item
  442. .api(selectedRowKeys.value)
  443. .then(() => {
  444. window.$message.success(\`\${window.$l(item.name)}\${window.$l('成功')}\`)
  445. emit('reset')
  446. })
  447. .finally(() => {
  448. spinning.value = false
  449. })
  450. }
  451. }
  452. // 变更按钮状态
  453. function setStateBtn(action, opt) {
  454. if (typeof action === 'string') {
  455. setStateBtnItem(action, opt)
  456. } else {
  457. action.forEach((i) => {
  458. setStateBtnItem(i, opt)
  459. })
  460. }
  461. }
  462. function setStateBtnItem(action, opt) {
  463. const item = renderButtons.value.find((i) => i.key === action)
  464. if (!item) {
  465. console.error(\`按钮(\${action})未定义, 请确认该变更状态按钮是否设置正确\`)
  466. return
  467. }
  468. Object.keys(opt).forEach((i) => {
  469. item[i] = opt[i]
  470. })
  471. }
  472. // 添加方法(业务自行处理,这里只做占位,不再走 handAction)
  473. function addAction() {}
  474. // 删除方法
  475. function deleteAction(item) {
  476. handAction(item)
  477. }
  478. // 导入方法
  479. function importAction() {
  480. if (!isShowImportModal.value) {
  481. emit('btnCallback', 'import')
  482. return
  483. }
  484. importVisible.value = true
  485. }
  486. // 导出方法
  487. function exportAction(item) {
  488. if (isFunction(item.api, item.name, item.key)) {
  489. spinning.value = true
  490. item
  491. .api(selectedRowKeys.value)
  492. .then(() => {
  493. spinning.value = false
  494. })
  495. .catch(() => {
  496. spinning.value = false
  497. })
  498. }
  499. }
  500. // 表格可点击列事件回调
  501. function tableColCallback(field, item) {
  502. emit('tableColCallback', field, item)
  503. }
  504. // 按 dataIndex 取列配置
  505. function getColumn(dataIndex) {
  506. return renderColumns.value.find((i) => i.dataIndex === dataIndex)
  507. }
  508. // 该列是否使用自定义插槽(列 dataIndex 即插槽名)
  509. function isTemplateColumn(dataIndex) {
  510. const col = getColumn(dataIndex)
  511. return !!(col && col.template)
  512. }
  513. // 该列是否为可点击列
  514. function isClickColumn(dataIndex) {
  515. const col = getColumn(dataIndex)
  516. return !!(col && col.isClick)
  517. }
  518. // 可点击列显示文本:对象取 name,其它原样
  519. function getCellText(text) {
  520. if (text === null || text === undefined) return ''
  521. if (typeof text === 'object') return text.name === undefined ? '' : text.name
  522. return text
  523. }
  524. function onSelectChange(keys) {
  525. selectedRowKeys.value = keys
  526. }
  527. // ---------- 高度 ----------
  528. // 布局高度全部交给 CSS flex(根 100% → 主区 flex:1 → 表格链条逐层贯通),
  529. // 这里只把 flex 撑出来的真实表体高度同步给 scroll.y —— antd 需要 scroll.y 才启用固定表头。
  530. // 旧的算术法(父高 − 工具条 − 过滤区 − 分页)死穴是首帧分页还没渲染,必然差十几像素;
  531. // 同步真实 clientHeight 没有这个问题,值偏小也不影响布局(.ant-table-body 已 max-height:none)。
  532. function measureLayout() {
  533. nextTick(syncTableHeight)
  534. }
  535. function syncTableHeight() {
  536. const el = table.value && table.value.$el
  537. const bodyEl = el && el.querySelector('.ant-table-body')
  538. const h = bodyEl && bodyEl.clientHeight
  539. if (h) tableScrollPx.value = Math.max(h - 8, 0)
  540. }
  541. // 高级搜索入口
  542. function advancedSearch() {
  543. emit('advancedSearch')
  544. }
  545. // 按钮 key → 处理函数(等价于原 Options API 里 this[item.key] 的语义)
  546. const actionMap = {
  547. add: addAction,
  548. delete: deleteAction,
  549. import: importAction,
  550. export: exportAction,
  551. reload,
  552. filterReset,
  553. toggleFilter,
  554. setStateBtn,
  555. handAction
  556. }
  557. // ---------- 拖拽分隔条指令 ----------
  558. const vSidedrag = createSideDrag(
  559. () => sideWidth.value,
  560. (width) => (sideWidth.value = width),
  561. { min: 256 }
  562. )
  563. // ---------- 生命周期 ----------
  564. onMounted(() => {
  565. initComponent()
  566. })
  567. // keep-alive 缓存页切回来时 DOM 重新可见,下一帧补同步一次 scroll.y
  568. onActivated(() => {
  569. nextTick(syncTableHeight)
  570. })
  571. defineExpose({
  572. reload,
  573. spinning,
  574. selectedRowKeys,
  575. expandedRowKeys,
  576. renderColumns,
  577. renderButtons,
  578. setStateBtn,
  579. btnCallback,
  580. filterReset,
  581. toggleFilter,
  582. table,
  583. importVisible,
  584. measureLayout,
  585. advancedSearch
  586. })
  587. <\/script>
  588. <style lang="less" scoped>
  589. // 高度实现:纯 CSS flex,零 JS 测量。
  590. // 根节点撑满父容器 → 工具条定高 → 主区吃掉剩余高度 → 表格链条逐层贯通到表体。
  591. // 前提:父容器有确定高度(基座 BasicLayout 的 router-view 已带 height);
  592. // 父级高度不确定时退化为「按内容撑开」,不会像旧版那样测量成 0 直接塌掉。
  593. .list-layout {
  594. height: 100%;
  595. min-height: 0;
  596. display: flex;
  597. flex-direction: column;
  598. overflow: hidden;
  599. }
  600. // 根节点外再包一层 a-spin 时(如 SNewestDataListLayout),把剩余高度透传下去,
  601. // 否则 .list-layout-main 拿不到高度,整页退化成内容高度
  602. .list-layout > :deep(.ant-spin-nested-loading),
  603. .list-layout > :deep(.ant-spin-container) {
  604. flex: 1 1 auto;
  605. min-height: 0;
  606. display: flex;
  607. flex-direction: column;
  608. }
  609. .other {
  610. flex: 0 0 auto;
  611. }
  612. .tools {
  613. flex: 0 0 60px;
  614. height: 60px;
  615. display: flex;
  616. justify-content: space-between;
  617. align-items: center;
  618. // border-bottom: 1px solid var(--s-bg-color);
  619. // padding: 0 16px;
  620. box-sizing: border-box;
  621. .title {
  622. font-size: 18px;
  623. font-weight: 500;
  624. }
  625. }
  626. .list-layout-main {
  627. flex: 1 1 auto;
  628. min-height: 0;
  629. display: flex;
  630. justify-content: flex-start;
  631. // stretch 让左右两栏撑满主区高度;flex-start 会让子栏退回内容高度,表格就不吃剩余空间了
  632. align-items: stretch;
  633. border-radius: 6px;
  634. background-color: var(--s-bg-color-container);
  635. overflow: hidden;
  636. }
  637. .side {
  638. // 宽度由模板内联的 sideWidth 决定,不参与伸缩,否则拖拽后的宽度会被挤掉
  639. flex: 0 0 auto;
  640. min-width: 256px;
  641. padding: 10px;
  642. box-sizing: border-box;
  643. overflow: hidden;
  644. }
  645. .side-bar {
  646. // 必须禁止伸缩:主区和左树都带 flex-grow,空间不足时这根 10px 的分隔条会被压成 0 宽,
  647. // 表现就是「分隔条不见了、左侧树拖不动」
  648. flex: 0 0 10px;
  649. width: 10px;
  650. align-self: stretch;
  651. cursor: pointer;
  652. user-select: none;
  653. }
  654. .layout-list-content {
  655. flex: 1 1 auto;
  656. min-width: 0;
  657. min-height: 0;
  658. overflow: hidden;
  659. padding: 24px;
  660. box-sizing: border-box;
  661. // 该布局内容区是「查询区 + 表格区」纵向排列,必须是 flex 容器,表格区才能吃掉剩余高度
  662. display: flex;
  663. flex-direction: column;
  664. }
  665. // 表格区吃掉内容区剩余高度;与 SListLayout 同一套撑满链路
  666. .table-container {
  667. flex: 1 1 auto;
  668. min-width: 0;
  669. min-height: 0;
  670. display: flex;
  671. flex-direction: column;
  672. overflow: hidden;
  673. // STable 自带的 .table-wrapper 不能漏,漏了整条链断掉、表体撑不开
  674. :deep(.table-wrapper),
  675. :deep(.ant-table-wrapper),
  676. :deep(.ant-spin-nested-loading),
  677. :deep(.ant-spin-container),
  678. :deep(.ant-table),
  679. :deep(.ant-table-container) {
  680. flex: 1 1 auto;
  681. min-height: 0;
  682. display: flex;
  683. flex-direction: column;
  684. }
  685. :deep(.ant-table-header) {
  686. flex: 0 0 auto;
  687. }
  688. :deep(.ant-table-body) {
  689. flex: 1 1 auto;
  690. min-height: 0;
  691. // antd 把 scroll.y 写成 inline max-height,会卡住 flex 撑出来的高度
  692. max-height: none !important;
  693. }
  694. :deep(.ant-table-pagination.ant-pagination) {
  695. flex: 0 0 auto;
  696. margin: 0;
  697. padding: 16px 0;
  698. border-top: 1px solid var(--s-border-color-split);
  699. box-sizing: border-box;
  700. }
  701. }
  702. .filter-wrap {
  703. flex: 0 0 auto;
  704. padding: 0 0 24px;
  705. box-sizing: border-box;
  706. .filter-content {
  707. height: 32px;
  708. display: flex;
  709. justify-content: flex-start;
  710. align-items: center;
  711. }
  712. }
  713. .filter-more-content {
  714. margin-top: 4px;
  715. }
  716. .search-bar {
  717. width: 100%;
  718. }
  719. .status-bar {
  720. width: 100%;
  721. }
  722. .desc-wrap {
  723. padding: 16px 0 0;
  724. box-sizing: border-box;
  725. }
  726. .reset-wrap {
  727. margin-left: 24px;
  728. flex: 1;
  729. text-align: right;
  730. }
  731. </style>
  732. `;
  733. export {
  734. e as default
  735. };