mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-23 07:46:30 +08:00
feat: calc top for table affix
This commit is contained in:
parent
595c282bd2
commit
3cd18f18f7
|
@ -161,6 +161,23 @@ const navToHelper = () => {
|
||||||
height: 64px;
|
height: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-menu-fixed {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1001;
|
||||||
|
|
||||||
|
&-side {
|
||||||
|
left: 232px;
|
||||||
|
right: 0;
|
||||||
|
z-index: 10;
|
||||||
|
width: auto;
|
||||||
|
transition: all 0.3s;
|
||||||
|
&-compact {
|
||||||
|
left: 64px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&-logo-container {
|
&-logo-container {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
:selected-row-keys="selectedRowKeys"
|
:selected-row-keys="selectedRowKeys"
|
||||||
:loading="dataLoading"
|
:loading="dataLoading"
|
||||||
:header-affixed-top="true"
|
:header-affixed-top="true"
|
||||||
:header-affix-props="{ offsetTop: 0, container: getContainer }"
|
:header-affix-props="{ offsetTop, container: getContainer }"
|
||||||
@page-change="rehandlePageChange"
|
@page-change="rehandlePageChange"
|
||||||
@change="rehandleChange"
|
@change="rehandleChange"
|
||||||
@select-change="rehandleSelectChange"
|
@select-change="rehandleSelectChange"
|
||||||
|
@ -85,9 +85,12 @@ import { CONTRACT_STATUS, CONTRACT_TYPES, CONTRACT_PAYMENT_TYPES } from '@/const
|
||||||
import Trend from '@/components/trend/index.vue';
|
import Trend from '@/components/trend/index.vue';
|
||||||
import { ResDataType } from '@/interface';
|
import { ResDataType } from '@/interface';
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
import { useSettingStore } from '@/store';
|
||||||
|
|
||||||
import { COLUMNS } from './constants';
|
import { COLUMNS } from './constants';
|
||||||
|
|
||||||
|
const store = useSettingStore();
|
||||||
|
|
||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
defaultPageSize: 20,
|
defaultPageSize: 20,
|
||||||
|
@ -179,6 +182,10 @@ const handleClickDelete = (row: { rowIndex: any }) => {
|
||||||
confirmVisible.value = true;
|
confirmVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const offsetTop = computed(() => {
|
||||||
|
return store.isUseTabsRouter ? 48 : 0;
|
||||||
|
});
|
||||||
|
|
||||||
const getContainer = () => {
|
const getContainer = () => {
|
||||||
return document.querySelector('.tdesign-starter-layout');
|
return document.querySelector('.tdesign-starter-layout');
|
||||||
};
|
};
|
||||||
|
|
|
@ -64,6 +64,8 @@
|
||||||
:hover="hover"
|
:hover="hover"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:loading="dataLoading"
|
:loading="dataLoading"
|
||||||
|
:header-affixed-top="true"
|
||||||
|
:header-affix-props="{ offsetTop, container: getContainer }"
|
||||||
@page-change="rehandlePageChange"
|
@page-change="rehandlePageChange"
|
||||||
@change="rehandleChange"
|
@change="rehandleChange"
|
||||||
>
|
>
|
||||||
|
@ -108,6 +110,7 @@ import { MessagePlugin } from 'tdesign-vue-next';
|
||||||
import Trend from '@/components/trend/index.vue';
|
import Trend from '@/components/trend/index.vue';
|
||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { ResDataType } from '@/interface';
|
import { ResDataType } from '@/interface';
|
||||||
|
import { useSettingStore } from '@/store';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CONTRACT_STATUS,
|
CONTRACT_STATUS,
|
||||||
|
@ -117,6 +120,8 @@ import {
|
||||||
CONTRACT_PAYMENT_TYPES,
|
CONTRACT_PAYMENT_TYPES,
|
||||||
} from '@/constants';
|
} from '@/constants';
|
||||||
|
|
||||||
|
const store = useSettingStore();
|
||||||
|
|
||||||
const COLUMNS = [
|
const COLUMNS = [
|
||||||
{
|
{
|
||||||
title: '合同名称',
|
title: '合同名称',
|
||||||
|
@ -250,6 +255,14 @@ const rehandleChange = (changeParams, triggerAndData) => {
|
||||||
const rehandleClickOp = ({ text, row }) => {
|
const rehandleClickOp = ({ text, row }) => {
|
||||||
console.log(text, row);
|
console.log(text, row);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const offsetTop = computed(() => {
|
||||||
|
return store.isUseTabsRouter ? 48 : 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
const getContainer = () => {
|
||||||
|
return document.querySelector('.tdesign-starter-layout');
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user