diff --git a/apps/web-antd/src/adapter/vxe-table.ts b/apps/web-antd/src/adapter/vxe-table.ts index 1903e1c09..9935d0b0c 100644 --- a/apps/web-antd/src/adapter/vxe-table.ts +++ b/apps/web-antd/src/adapter/vxe-table.ts @@ -300,4 +300,5 @@ export type OnActionClickParams> = { export type OnActionClickFn> = ( params: OnActionClickParams, ) => void; +export * from '#/components/table-action'; export type * from '@vben/plugins/vxe-table'; diff --git a/apps/web-antd/src/api/infra/demo/demo01/index.ts b/apps/web-antd/src/api/infra/demo/demo01/index.ts index 0fbd31410..94fb6330c 100644 --- a/apps/web-antd/src/api/infra/demo/demo01/index.ts +++ b/apps/web-antd/src/api/infra/demo/demo01/index.ts @@ -47,6 +47,7 @@ export function deleteDemo01Contact(id: number) { } // 批量删除示例联系人 +// TODO @puhui999:注释风格哈。 export function deleteDemo01ContactByIds(ids: number[]) { return requestClient.delete( `/infra/demo01-contact/delete-batch?ids=${ids.join(',')}`, diff --git a/apps/web-antd/src/components/dept-select-modal/dept-select-modal.vue b/apps/web-antd/src/components/dept-select-modal/dept-select-modal.vue new file mode 100644 index 000000000..561ab24e4 --- /dev/null +++ b/apps/web-antd/src/components/dept-select-modal/dept-select-modal.vue @@ -0,0 +1,161 @@ +// TODO @芋艿:是否有更好的组织形式?! + + diff --git a/apps/web-antd/src/components/dept-select-modal/index.ts b/apps/web-antd/src/components/dept-select-modal/index.ts new file mode 100644 index 000000000..d373be445 --- /dev/null +++ b/apps/web-antd/src/components/dept-select-modal/index.ts @@ -0,0 +1 @@ +export { default as DeptSelectModal } from './dept-select-modal.vue'; diff --git a/apps/web-antd/src/components/table-action/icons.ts b/apps/web-antd/src/components/table-action/icons.ts new file mode 100644 index 000000000..471b7eb86 --- /dev/null +++ b/apps/web-antd/src/components/table-action/icons.ts @@ -0,0 +1,12 @@ +export const ACTION_ICON = { + DOWNLOAD: 'lucide:download', + UPLOAD: 'lucide:upload', + ADD: 'lucide:plus', + EDIT: 'lucide:edit', + DELETE: 'lucide:trash', + REFRESH: 'lucide:refresh-cw', + SEARCH: 'lucide:search', + FILTER: 'lucide:filter', + MORE: 'lucide:ellipsis-vertical', + VIEW: 'lucide:eye', +}; diff --git a/apps/web-antd/src/components/table-action/index.ts b/apps/web-antd/src/components/table-action/index.ts index 7dad46ea5..672c0a533 100644 --- a/apps/web-antd/src/components/table-action/index.ts +++ b/apps/web-antd/src/components/table-action/index.ts @@ -1,2 +1,4 @@ +export * from './icons'; + export { default as TableAction } from './table-action.vue'; export * from './typing'; diff --git a/apps/web-antd/src/components/table-action/table-action.vue b/apps/web-antd/src/components/table-action/table-action.vue index 329a70451..1ad69eb26 100644 --- a/apps/web-antd/src/components/table-action/table-action.vue +++ b/apps/web-antd/src/components/table-action/table-action.vue @@ -1,7 +1,5 @@ diff --git a/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue b/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue index 67efb697e..03117b363 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue @@ -224,15 +224,20 @@ defineExpose({ :class=" cn('cursor-pointer', getNodeClass?.(item), { 'data-[selected]:bg-accent': !multiple, + 'cursor-not-allowed': disabled, + }) + " + v-bind=" + Object.assign(item.bind, { + onfocus: disabled ? 'this.blur()' : undefined, }) " - v-bind="item.bind" @select=" (event) => { if (event.detail.originalEvent.type === 'click') { event.preventDefault(); } - onSelect(item, event.detail.isSelected); + !disabled && onSelect(item, event.detail.isSelected); } " @toggle=" @@ -240,7 +245,7 @@ defineExpose({ if (event.detail.originalEvent.type === 'click') { event.preventDefault(); } - onToggle(item); + !disabled && onToggle(item); } " class="tree-node focus:ring-grass8 my-0.5 flex items-center rounded px-2 py-1 outline-none focus:ring-2" @@ -262,10 +267,11 @@ defineExpose({ { // $event.stopPropagation(); // $event.preventDefault(); - handleSelect(); + !disabled && handleSelect(); // onSelect(item, !isSelected); } " diff --git a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue index f48bba8c0..7033f263b 100644 --- a/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue +++ b/packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue @@ -40,14 +40,14 @@ const style = computed(() => { const tabsView = computed(() => { return props.tabs.map((tab) => { - const { fullPath, meta, name, path } = tab || {}; + const { fullPath, meta, name, path, key } = tab || {}; const { affixTab, icon, newTabTitle, tabClosable, title } = meta || {}; return { affixTab: !!affixTab, closable: Reflect.has(meta, 'tabClosable') ? !!tabClosable : true, fullPath, icon: icon as string, - key: fullPath || path, + key, meta, name, path, diff --git a/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue b/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue index 43628532e..4333fc4b1 100644 --- a/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue +++ b/packages/@core/ui-kit/tabs-ui/src/components/tabs/tabs.vue @@ -47,14 +47,14 @@ const typeWithClass = computed(() => { const tabsView = computed(() => { return props.tabs.map((tab) => { - const { fullPath, meta, name, path } = tab || {}; + const { fullPath, meta, name, path, key } = tab || {}; const { affixTab, icon, newTabTitle, tabClosable, title } = meta || {}; return { affixTab: !!affixTab, closable: Reflect.has(meta, 'tabClosable') ? !!tabClosable : true, fullPath, icon: icon as string, - key: fullPath || path, + key, meta, name, path, diff --git a/packages/effects/hooks/src/use-design-tokens.ts b/packages/effects/hooks/src/use-design-tokens.ts index e33f721db..6a076f3c4 100644 --- a/packages/effects/hooks/src/use-design-tokens.ts +++ b/packages/effects/hooks/src/use-design-tokens.ts @@ -193,67 +193,107 @@ export function useElementPlusDesignTokens() { '--el-border-radius-base': getCssVariableValue('--radius', false), '--el-color-danger': getCssVariableValue('--destructive-500'), - '--el-color-danger-dark-2': getCssVariableValue('--destructive'), - '--el-color-danger-light-3': getCssVariableValue('--destructive-400'), - '--el-color-danger-light-5': getCssVariableValue('--destructive-300'), - '--el-color-danger-light-7': getCssVariableValue('--destructive-200'), + '--el-color-danger-dark-2': isDark.value + ? getCssVariableValue('--destructive-400') + : getCssVariableValue('--destructive-600'), + '--el-color-danger-light-3': isDark.value + ? getCssVariableValue('--destructive-600') + : getCssVariableValue('--destructive-400'), + '--el-color-danger-light-5': isDark.value + ? getCssVariableValue('--destructive-700') + : getCssVariableValue('--destructive-300'), + '--el-color-danger-light-7': isDark.value + ? getCssVariableValue('--destructive-800') + : getCssVariableValue('--destructive-200'), '--el-color-danger-light-8': isDark.value - ? border + ? getCssVariableValue('--destructive-900') : getCssVariableValue('--destructive-100'), '--el-color-danger-light-9': isDark.value - ? accent + ? getCssVariableValue('--destructive-950') : getCssVariableValue('--destructive-50'), '--el-color-error': getCssVariableValue('--destructive-500'), - '--el-color-error-dark-2': getCssVariableValue('--destructive'), - '--el-color-error-light-3': getCssVariableValue('--destructive-400'), - '--el-color-error-light-5': getCssVariableValue('--destructive-300'), - '--el-color-error-light-7': getCssVariableValue('--destructive-200'), + '--el-color-error-dark-2': isDark.value + ? getCssVariableValue('--destructive-400') + : getCssVariableValue('--destructive-600'), + '--el-color-error-light-3': isDark.value + ? getCssVariableValue('--destructive-600') + : getCssVariableValue('--destructive-400'), + '--el-color-error-light-5': isDark.value + ? getCssVariableValue('--destructive-700') + : getCssVariableValue('--destructive-300'), + '--el-color-error-light-7': isDark.value + ? getCssVariableValue('--destructive-800') + : getCssVariableValue('--destructive-200'), '--el-color-error-light-8': isDark.value - ? border + ? getCssVariableValue('--destructive-900') : getCssVariableValue('--destructive-100'), '--el-color-error-light-9': isDark.value - ? accent + ? getCssVariableValue('--destructive-950') : getCssVariableValue('--destructive-50'), + '--el-color-info-light-5': border, '--el-color-info-light-8': border, '--el-color-info-light-9': getCssVariableValue('--info'), // getCssVariableValue('--secondary'), + '--el-color-primary': getCssVariableValue('--primary-500'), - '--el-color-primary-dark-2': getCssVariableValue('--primary'), - '--el-color-primary-light-3': getCssVariableValue('--primary-400'), - '--el-color-primary-light-5': getCssVariableValue('--primary-300'), + '--el-color-primary-dark-2': isDark.value + ? getCssVariableValue('--primary-400') + : getCssVariableValue('--primary-600'), + '--el-color-primary-light-3': isDark.value + ? getCssVariableValue('--primary-600') + : getCssVariableValue('--primary-400'), + '--el-color-primary-light-5': isDark.value + ? getCssVariableValue('--primary-700') + : getCssVariableValue('--primary-300'), '--el-color-primary-light-7': isDark.value - ? border + ? getCssVariableValue('--primary-800') : getCssVariableValue('--primary-200'), '--el-color-primary-light-8': isDark.value - ? border + ? getCssVariableValue('--primary-900') : getCssVariableValue('--primary-100'), '--el-color-primary-light-9': isDark.value - ? accent + ? getCssVariableValue('--primary-950') : getCssVariableValue('--primary-50'), '--el-color-success': getCssVariableValue('--success-500'), - '--el-color-success-dark-2': getCssVariableValue('--success'), - '--el-color-success-light-3': getCssVariableValue('--success-400'), - '--el-color-success-light-5': getCssVariableValue('--success-300'), - '--el-color-success-light-7': getCssVariableValue('--success-200'), + '--el-color-success-dark-2': isDark.value + ? getCssVariableValue('--success-400') + : getCssVariableValue('--success-600'), + '--el-color-success-light-3': isDark.value + ? getCssVariableValue('--success-600') + : getCssVariableValue('--success-400'), + '--el-color-success-light-5': isDark.value + ? getCssVariableValue('--success-700') + : getCssVariableValue('--success-300'), + '--el-color-success-light-7': isDark.value + ? getCssVariableValue('--success-800') + : getCssVariableValue('--success-200'), '--el-color-success-light-8': isDark.value - ? border + ? getCssVariableValue('--success-900') : getCssVariableValue('--success-100'), '--el-color-success-light-9': isDark.value - ? accent + ? getCssVariableValue('--success-950') : getCssVariableValue('--success-50'), '--el-color-warning': getCssVariableValue('--warning-500'), - '--el-color-warning-dark-2': getCssVariableValue('--warning'), - '--el-color-warning-light-3': getCssVariableValue('--warning-400'), - '--el-color-warning-light-5': getCssVariableValue('--warning-300'), - '--el-color-warning-light-7': getCssVariableValue('--warning-200'), + '--el-color-warning-dark-2': isDark.value + ? getCssVariableValue('--warning-400') + : getCssVariableValue('--warning-600'), + '--el-color-warning-light-3': isDark.value + ? getCssVariableValue('--warning-600') + : getCssVariableValue('--warning-400'), + '--el-color-warning-light-5': isDark.value + ? getCssVariableValue('--warning-700') + : getCssVariableValue('--warning-300'), + '--el-color-warning-light-7': isDark.value + ? getCssVariableValue('--warning-800') + : getCssVariableValue('--warning-200'), '--el-color-warning-light-8': isDark.value - ? border + ? getCssVariableValue('--warning-900') : getCssVariableValue('--warning-100'), '--el-color-warning-light-9': isDark.value - ? accent + ? getCssVariableValue('--warning-950') : getCssVariableValue('--warning-50'), '--el-fill-color': getCssVariableValue('--accent'), diff --git a/packages/effects/hooks/src/use-tabs.ts b/packages/effects/hooks/src/use-tabs.ts index 25bc4883d..526721127 100644 --- a/packages/effects/hooks/src/use-tabs.ts +++ b/packages/effects/hooks/src/use-tabs.ts @@ -1,3 +1,4 @@ +import type { ComputedRef } from 'vue'; import type { RouteLocationNormalized } from 'vue-router'; import { useRoute, useRouter } from 'vue-router'; @@ -53,7 +54,24 @@ export function useTabs() { await tabbarStore.closeTabByKey(key, router); } - async function setTabTitle(title: string) { + /** + * 设置当前标签页的标题 + * + * @description 支持设置静态标题字符串或动态计算标题 + * @description 动态标题会在每次渲染时重新计算,适用于多语言或状态相关的标题 + * + * @param title - 标题内容 + * - 静态标题: 直接传入字符串 + * - 动态标题: 传入 ComputedRef + * + * @example + * // 静态标题 + * setTabTitle('标签页') + * + * // 动态标题(多语言) + * setTabTitle(computed(() => t('page.title'))) + */ + async function setTabTitle(title: ComputedRef | string) { tabbarStore.setUpdateTime(); await tabbarStore.setTabTitle(route, title); } diff --git a/packages/effects/layouts/src/authentication/authentication.vue b/packages/effects/layouts/src/authentication/authentication.vue index 401154584..cb500de51 100644 --- a/packages/effects/layouts/src/authentication/authentication.vue +++ b/packages/effects/layouts/src/authentication/authentication.vue @@ -38,7 +38,7 @@ const { authPanelCenter, authPanelLeft, authPanelRight, isDark } =