diff --git a/package.json b/package.json index b112715..92ce0ad 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "makeit-captcha": "^1.2.5", "mitt": "^2.1.0", "mockjs": "^1.1.0", - "naive-ui": "^2.16.0", + "naive-ui": "^2.16.1", "pinia": "^2.0.0-beta.3", "qs": "^6.10.1", "vfonts": "^0.1.0", diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index 0cf3692..b1a3f60 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -233,9 +233,6 @@ getCacheColumns, setCacheColumnsField, emit, - getSize: () => { - return unref(getBindValues).size; - }, }; const getCanResize = computed(() => { @@ -288,7 +285,6 @@ densitySelect, updatePage, updatePageSize, - updateCheckedRowKeys, pagination, tableAction, }; diff --git a/src/components/Table/src/hooks/useColumns.ts b/src/components/Table/src/hooks/useColumns.ts index 6bf7511..42cb8ae 100644 --- a/src/components/Table/src/hooks/useColumns.ts +++ b/src/components/Table/src/hooks/useColumns.ts @@ -52,6 +52,8 @@ export function useColumns(propsRef: ComputedRef) { return hasPermission(column.auth) && isIfShow(column); }) .map((column) => { + //默认 ellipsis 为true + column.ellipsis = typeof column.ellipsis === 'undefined' ? { tooltip: true } : false; const { edit } = column; if (edit) { column.render = renderEditCell(column); diff --git a/src/layout/components/Menu/index.vue b/src/layout/components/Menu/index.vue index f397d83..0d99909 100644 --- a/src/layout/components/Menu/index.vue +++ b/src/layout/components/Menu/index.vue @@ -40,7 +40,8 @@ default: 'left', }, }, - setup(props) { + emits: ['update:collapsed'], + setup(props, { emit }) { // 当前路由 const currentRoute = useRoute(); const router = useRouter(); @@ -72,6 +73,9 @@ () => settingStore.menuSetting.mixMenu, () => { updateMenu(); + if (props.collapsed) { + emit('update:collapsed', !props.collapsed); + } } ); diff --git a/src/views/comp/table/CellColumns.ts b/src/views/comp/table/CellColumns.ts index cf75d4d..8207fa2 100644 --- a/src/views/comp/table/CellColumns.ts +++ b/src/views/comp/table/CellColumns.ts @@ -5,10 +5,12 @@ export const columns = [ { title: 'id', key: 'id', + width: 100, }, { title: '编码', key: 'no', + width: 100, }, { title: '名称', @@ -22,6 +24,7 @@ export const columns = [ { title: '头像', key: 'avatar', + width: 100, render(row) { return h(NAvatar, { size: 48, @@ -47,29 +50,33 @@ export const columns = [ }, edit: true, width: 200, + ellipsis: false, }, { title: '开始日期', key: 'beginTime', edit: true, - width: 250, + width: 160, editComponent: 'NDatePicker', editComponentProps: { type: 'datetime', format: 'yyyy-MM-dd HH:mm:ss', }, + ellipsis: false, }, { title: '结束日期', key: 'endTime', - width: 200, + width: 160, }, { title: '创建时间', key: 'date', + width: 160, }, { title: '停留时间', key: 'time', + width: 160, }, ]; diff --git a/src/views/comp/table/basic.vue b/src/views/comp/table/basic.vue index 936a01d..bf1e0c2 100644 --- a/src/views/comp/table/basic.vue +++ b/src/views/comp/table/basic.vue @@ -8,6 +8,7 @@ :row-key="(row) => row.id" ref="actionRef" :actionColumn="actionColumn" + :scroll-x="1360" @update:checked-row-keys="onCheckedRow" >