diff --git a/src/components/Button/src/PopConfirmButton.vue b/src/components/Button/src/PopConfirmButton.vue index 99a1ffe2251a69b829c0b33795d169ac5b627e85..2a9f633fd411fab02bf2c76f239da73684601827 100644 --- a/src/components/Button/src/PopConfirmButton.vue +++ b/src/components/Button/src/PopConfirmButton.vue @@ -13,6 +13,7 @@ inheritAttrs: false, components: { Popconfirm, BasicButton }, props: { + size: propTypes.oneOf(['large', 'default', 'small']).def(), enable: propTypes.bool.def(true), okText: propTypes.string, cancelText: propTypes.string, @@ -31,7 +32,7 @@ return popValues; }); return () => { - const Button = h(BasicButton, omit(unref(attrs), 'icon'), extendSlots(slots)); + const Button = h(BasicButton, unref(getBindValues), extendSlots(slots)); if (!props.enable) { return Button; } diff --git a/src/components/Table/index.ts b/src/components/Table/index.ts index 234c8855f39991ebee09c036f4d7624fcd3aab73..05d65fb2980fc94374f0e472f41ac73f8b41fd8e 100644 --- a/src/components/Table/index.ts +++ b/src/components/Table/index.ts @@ -2,11 +2,9 @@ import { createAsyncComponent } from '/@/utils/factory/createAsyncComponent'; export { default as BasicTable } from './src/BasicTable.vue'; export { default as TableAction } from './src/components/TableAction.vue'; -// export { default as TableImg } from './src/components/TableImg.vue'; export { default as EditTableHeaderIcon } from './src/components/EditTableHeaderIcon.vue'; export const TableImg = createAsyncComponent(() => import('./src/components/TableImg.vue')); -// export const TableAction = createAsyncComponent(() => import('./src/components/TableAction.vue')); export * from './src/types/table'; export * from './src/types/pagination'; diff --git a/src/components/Table/src/components/TableAction.vue b/src/components/Table/src/components/TableAction.vue index d064459f75475e3ab12f3ac855bb5ce9d3de80c0..7194ba49d4f9834527f1d63c5e7fe3c046792596 100644 --- a/src/components/Table/src/components/TableAction.vue +++ b/src/components/Table/src/components/TableAction.vue @@ -5,7 +5,10 @@ {{ action.label }} - + @@ -44,17 +47,31 @@ }, setup(props) { const { prefixCls } = useDesign('basic-table-action'); - let table = {}; + let table: Partial = {}; if (!props.outside) { table = useTableContext(); } + // const getSize = computed(() => { + // const size = table?.getSize?.(); + // if (size === 'middle' || !size) { + // return; + // } + + // if (size === 'default') { + // return 'large'; + // } + // return size; + // }); + const getActions = computed(() => { return (props.actions || []).map((action) => { const { popConfirm } = action; + // const size = unref(getSize); return { type: 'link', size: 'small', + // ...(size ? { size } : {}), ...action, ...(popConfirm || {}), onConfirm: popConfirm?.confirm, diff --git a/src/components/Table/src/components/editable/EditableCell.vue b/src/components/Table/src/components/editable/EditableCell.vue index 4e3974f35574d26b4d585aaf88ffb3863959699a..de8b71cb4988a8795e7089bafc1b5749b0923282 100644 --- a/src/components/Table/src/components/editable/EditableCell.vue +++ b/src/components/Table/src/components/editable/EditableCell.vue @@ -85,6 +85,18 @@ return unref(ruleMessage) && unref(ruleVisible); }); + // const getSize = computed(() => { + // const size = table?.getSize?.(); + // if (size === 'middle' || !size) { + // return; + // } + + // if (size === 'default') { + // return 'large'; + // } + // return size; + // }); + const getIsCheckComp = computed(() => { const component = unref(getComponent); return ['Checkbox', 'Switch'].includes(component); @@ -300,6 +312,7 @@ handleOptionsChange, getWrapperStyle, getRowEditable, + // getSize, }; }, }); diff --git a/src/components/Table/src/components/editable/helper.ts b/src/components/Table/src/components/editable/helper.ts index 4abbadfe6c5dca4123f1a17a188ced9689973a27..d2f60622653ce079131f92f9e36a797b71955768 100644 --- a/src/components/Table/src/components/editable/helper.ts +++ b/src/components/Table/src/components/editable/helper.ts @@ -8,10 +8,10 @@ const { t } = useI18n(); */ export function createPlaceholderMessage(component: ComponentType) { if (component.includes('Input')) { - return t('component.form.input'); + return t('common.inputText'); } if (component.includes('Picker')) { - return t('component.form.choose'); + return t('common.chooseText'); } if ( @@ -20,7 +20,7 @@ export function createPlaceholderMessage(component: ComponentType) { component.includes('Radio') || component.includes('Switch') ) { - return t('component.form.choose'); + return t('common.chooseText'); } return ''; } diff --git a/src/components/Table/src/hooks/useTableScroll.ts b/src/components/Table/src/hooks/useTableScroll.ts index 0c0011640800558c6644e7d21934feee6d7d66a2..83851b499da9defa10d69544c51810d6ef76dde9 100644 --- a/src/components/Table/src/hooks/useTableScroll.ts +++ b/src/components/Table/src/hooks/useTableScroll.ts @@ -143,7 +143,7 @@ export function useTableScroll( const table = unref(tableElRef); const tableWidth = table?.$el?.offsetWidth ?? 0; - return tableWidth > width ? tableWidth - 24 : width; + return tableWidth > width ? '100%' : width; }); const getScrollRef = computed(() => { diff --git a/src/components/Table/src/style/index.less b/src/components/Table/src/style/index.less index 74a77a72838f2327dcb96d460435afb0ef705c23..17e7d622a567004e7855c62a4b52fcaaa6fa818e 100644 --- a/src/components/Table/src/style/index.less +++ b/src/components/Table/src/style/index.less @@ -51,7 +51,7 @@ // .ant-table { width: 100%; - overflow-x: auto; + overflow-x: hidden; border: none; &-title { @@ -107,22 +107,11 @@ border: 1px solid @border-color !important; } - .ant-table td { - white-space: nowrap; - } - .ant-table-tbody > tr > td, .ant-table-tbody > tr > th, .ant-table-thead > tr > td, .ant-table-thead > tr > th { - white-space: pre; - } - - .ant-table-tbody > tr > td > span, - .ant-table-tbody > tr > th > span, - .ant-table-thead > tr > td > span, - .ant-table-thead > tr > th > span { - display: block; + white-space: nowrap; } .ant-table-row-cell-last { diff --git a/src/views/demo/page/form/high/PersonTable.vue b/src/views/demo/page/form/high/PersonTable.vue index 3f341409682a202b7b99287143f1b27138bc144c..5f7fcef42f1e0d0890e9deffa0c146e9f65db05b 100644 --- a/src/views/demo/page/form/high/PersonTable.vue +++ b/src/views/demo/page/form/high/PersonTable.vue @@ -30,7 +30,6 @@ title: '工号', dataIndex: 'no', editRow: true, - // customRender: renderEditableRow({ dataIndex: 'no', placeholder: '请输入工号' }), }, {