diff --git a/.gitignore b/.gitignore index 227d10b..295ea6b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ node_modules dist dist-ssr *.local -components.d.ts +/components.d.ts diff --git a/components.d.ts b/components.d.ts index bfd18eb..dc3bff8 100644 --- a/components.d.ts +++ b/components.d.ts @@ -5,11 +5,12 @@ declare module 'vue' { export interface GlobalComponents { 404: typeof import('./src/components/Error/404.vue')['default'] - Aa: typeof import('E:/HBuilderProjects/element-plus-admin/src/components/aa.vue')['default'] Avatars: typeof import('./src/components/Avatars/index.vue')['default'] + ComDetail: typeof import('./src/components/ComDetail/index.vue')['default'] + ComDialog: typeof import('./src/components/ComDialog/index.vue')['default'] + ComSearch: typeof import('./src/components/ComSearch/index.vue')['default'] + ComTable: typeof import('./src/components/ComTable/index.vue')['default'] CountTo: typeof import('./src/components/CountTo/index.vue')['default'] - Detail: typeof import('./src/components/Detail/index.vue')['default'] - Dialog: typeof import('./src/components/Dialog/index.vue')['default'] Echart: typeof import('./src/components/Echart/index.vue')['default'] Editor: typeof import('./src/components/Editor/index.vue')['default'] ElAlert: typeof import('element-plus/es')['ElAlert'] @@ -21,8 +22,6 @@ declare module 'vue' { ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] - ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] - ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] @@ -52,17 +51,14 @@ declare module 'vue' { ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] - Highlight: typeof import('E:/HBuilderProjects/element-plus-admin/src/components/Highlight/index.vue')['default'] Loading: typeof import('element-plus/es')['ElLoadingDirective'] ParentView: typeof import('./src/components/ParentView/index.vue')['default'] Preview: typeof import('./src/components/Preview/index.vue')['default'] Qrcode: typeof import('./src/components/Qrcode/index.vue')['default'] Redirect: typeof import('./src/components/Redirect/index.vue')['default'] - Search: typeof import('./src/components/Search/index.vue')['default'] - Slot: typeof import('./src/components/Table/components/Slot.vue')['default'] + Slot: typeof import('./src/components/ComTable/components/Slot.vue')['default'] SvgIcon: typeof import('./src/components/SvgIcon/index.vue')['default'] - Table: typeof import('./src/components/Table/index.vue')['default'] - TableColumn: typeof import('./src/components/Table/components/TableColumn.vue')['default'] + TableColumn: typeof import('./src/components/ComTable/components/TableColumn.vue')['default'] } } diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index f3d2503..0000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/components/Detail/index.vue b/src/components/ComDetail/index.vue similarity index 97% rename from src/components/Detail/index.vue rename to src/components/ComDetail/index.vue index afe4b08..ddc0ad3 100644 --- a/src/components/Detail/index.vue +++ b/src/components/ComDetail/index.vue @@ -37,7 +37,7 @@ - + + diff --git a/src/components/Preview/index.vue b/src/components/Preview/index.vue index a104673..d9bd6dc 100644 --- a/src/components/Preview/index.vue +++ b/src/components/Preview/index.vue @@ -65,7 +65,7 @@ import { ref, reactive, computed, watch, nextTick, unref } from 'vue' import { previewProps } from './props' import { isFirefox } from '@/utils/validate' import { on, off } from '@/utils/dom-utils' -import throttle from 'lodash-es/throttle' +import { throttle } from 'lodash-es' import SvgIcon from '_c/SvgIcon/index.vue' const mousewheelEventName = isFirefox() ? 'DOMMouseScroll' : 'mousewheel' diff --git a/src/components/Table/index.vue b/src/components/Table/index.vue deleted file mode 100644 index 7d34e4a..0000000 --- a/src/components/Table/index.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - - - diff --git a/src/components/index.ts b/src/components/index.ts index 3aacce7..15b415a 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,9 +1,9 @@ import type { App } from 'vue' import SvgIcon from './SvgIcon/index.vue' // svg组件 -import ComSearch from './Search/index.vue' // search组件 -import ComDialog from './Dialog/index.vue' // dialog组件 -import ComDetail from './Detail/index.vue' // detail组件 -import ComTable from './Table/index.vue' // table组件 +import ComSearch from './ComSearch/index.vue' // search组件 +import ComDialog from './ComDialog/index.vue' // dialog组件 +import ComDetail from './ComDetail/index.vue' // detail组件 +import ComTable from './ComTable/index.vue' // table组件 export function setupGlobCom(app: App): void { app.component('SvgIcon', SvgIcon) diff --git a/src/router/index.ts b/src/router/index.ts index 45814be..7d083f8 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -245,228 +245,199 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [ meta: { title: '基础表格' } + }, + { + path: 'page-table', + component: () => import('_v/table-demo/page-table/index.vue'), + name: 'PageTable', + meta: { + title: '分页表格' + } + }, + { + path: 'stripe-table', + component: () => import('_v/table-demo/stripe-table/index.vue'), + name: 'StripeTable', + meta: { + title: '带斑马纹表格' + } + }, + { + path: 'border-table', + component: () => import('_v/table-demo/border-table/index.vue'), + name: 'BorderTable', + meta: { + title: '带边框表格' + } + }, + { + path: 'state-table', + component: () => import('_v/table-demo/state-table/index.vue'), + name: 'StateTable', + meta: { + title: '带状态表格' + } + }, + { + path: 'fixed-header', + component: () => import('_v/table-demo/fixed-header/index.vue'), + name: 'FixedHeader', + meta: { + title: '固定表头' + } + }, + { + path: 'fixed-column', + component: () => import('_v/table-demo/fixed-column/index.vue'), + name: 'FixedColumn', + meta: { + title: '固定列' + } + }, + { + path: 'fixed-column-header', + component: () => import('_v/table-demo/fixed-column-header/index.vue'), + name: 'FixedColumnHeader', + meta: { + title: '固定列和表头' + } + }, + { + path: 'fluid-height', + component: () => import('_v/table-demo/fluid-height/index.vue'), + name: 'FluidHeight', + meta: { + title: '流体高度' + } + }, + { + path: 'multi-header', + component: () => import('_v/table-demo/multi-header/index.vue'), + name: 'MultiHeader', + meta: { + title: '多级表头' + } + }, + { + path: 'single-choice', + component: () => import('_v/table-demo/single-choice/index.vue'), + name: 'SingleChoice', + meta: { + title: '单选' + } + }, + { + path: 'multiple-choice', + component: () => import('_v/table-demo/multiple-choice/index.vue'), + name: 'MultipleChoice', + meta: { + title: '多选' + } + }, + { + path: 'sort-table', + component: () => import('_v/table-demo/sort-table/index.vue'), + name: 'SortTable', + meta: { + title: '排序' + } + }, + { + path: 'screen-table', + component: () => import('_v/table-demo/screen-table/index.vue'), + name: 'ScreenTable', + meta: { + title: '筛选' + } + }, + { + path: 'expand-row', + component: () => import('_v/table-demo/expand-row/index.vue'), + name: 'ExpandRow', + meta: { + title: '展开行' + } + }, + { + path: 'tree-and-load', + component: () => import('_v/table-demo/tree-and-load/index.vue'), + name: 'TreeAndLoad', + meta: { + title: '树形数据与懒加载' + } + }, + { + path: 'custom-header', + component: () => import('_v/table-demo/custom-header/index.vue'), + name: 'CustomHeader', + meta: { + title: '自定义表头' + } + }, + { + path: 'total-table', + component: () => import('_v/table-demo/total-table/index.vue'), + name: 'TotalTable', + meta: { + title: '表尾合计行' + } + }, + { + path: 'merge-table', + component: () => import('_v/table-demo/merge-table/index.vue'), + name: 'MergeTable', + meta: { + title: '合并行或列' + } + }, + { + path: 'custom-index', + component: () => import('_v/table-demo/custom-index/index.vue'), + name: 'CustomIndex', + meta: { + title: '自定义索引' + } + } + ] + }, + { + path: '/directives-demo', + component: Layout, + redirect: '/directives-demo/clipboard', + name: 'DirectivesDemo', + meta: { + title: '自定义指令', + icon: 'clipboard', + alwaysShow: true + }, + children: [ + { + path: 'clipboard', + component: () => import('_v/directives-demo/clipboard/index.vue'), + name: 'ClipboardDemo', + meta: { + title: 'Clipboard' + } + } + ] + }, + { + path: '/icon', + component: Layout, + name: 'IconsDemo', + meta: {}, + children: [ + { + path: 'index', + component: () => import('_v/icons/index.vue'), + name: 'Icons', + meta: { + title: '图标', + icon: 'icon' + } } - // { - // path: 'page-table', - // component: () => import('_v/table-demo/page-table/index.vue'), - // name: 'PageTable', - // meta: { - // title: '分页表格' - // } - // }, - // { - // path: 'stripe-table', - // component: () => import('_v/table-demo/stripe-table/index.vue'), - // name: 'StripeTable', - // meta: { - // title: '带斑马纹表格' - // } - // }, - // { - // path: 'border-table', - // component: () => import('_v/table-demo/border-table/index.vue'), - // name: 'BorderTable', - // meta: { - // title: '带边框表格' - // } - // }, - // { - // path: 'state-table', - // component: () => import('_v/table-demo/state-table/index.vue'), - // name: 'StateTable', - // meta: { - // title: '带状态表格' - // } - // }, - // { - // path: 'fixed-header', - // component: () => import('_v/table-demo/fixed-header/index.vue'), - // name: 'FixedHeader', - // meta: { - // title: '固定表头' - // } - // }, - // { - // path: 'fixed-column', - // component: () => import('_v/table-demo/fixed-column/index.vue'), - // name: 'FixedColumn', - // meta: { - // title: '固定列' - // } - // }, - // { - // path: 'fixed-column-header', - // component: () => import('_v/table-demo/fixed-column-header/index.vue'), - // name: 'FixedColumnHeader', - // meta: { - // title: '固定列和表头' - // } - // }, - // { - // path: 'fluid-height', - // component: () => import('_v/table-demo/fluid-height/index.vue'), - // name: 'FluidHeight', - // meta: { - // title: '流体高度' - // } - // }, - // { - // path: 'multi-header', - // component: () => import('_v/table-demo/multi-header/index.vue'), - // name: 'MultiHeader', - // meta: { - // title: '多级表头' - // } - // }, - // { - // path: 'single-choice', - // component: () => import('_v/table-demo/single-choice/index.vue'), - // name: 'SingleChoice', - // meta: { - // title: '单选' - // } - // }, - // { - // path: 'multiple-choice', - // component: () => import('_v/table-demo/multiple-choice/index.vue'), - // name: 'MultipleChoice', - // meta: { - // title: '多选' - // } - // }, - // { - // path: 'sort-table', - // component: () => import('_v/table-demo/sort-table/index.vue'), - // name: 'SortTable', - // meta: { - // title: '排序' - // } - // }, - // { - // path: 'screen-table', - // component: () => import('_v/table-demo/screen-table/index.vue'), - // name: 'ScreenTable', - // meta: { - // title: '筛选' - // } - // }, - // { - // path: 'expand-row', - // component: () => import('_v/table-demo/expand-row/index.vue'), - // name: 'ExpandRow', - // meta: { - // title: '展开行' - // } - // }, - // { - // path: 'tree-and-load', - // component: () => import('_v/table-demo/tree-and-load/index.vue'), - // name: 'TreeAndLoad', - // meta: { - // title: '树形数据与懒加载' - // } - // }, - // { - // path: 'custom-header', - // component: () => import('_v/table-demo/custom-header/index.vue'), - // name: 'CustomHeader', - // meta: { - // title: '自定义表头' - // } - // }, - // { - // path: 'total-table', - // component: () => import('_v/table-demo/total-table/index.vue'), - // name: 'TotalTable', - // meta: { - // title: '表尾合计行' - // } - // }, - // { - // path: 'merge-table', - // component: () => import('_v/table-demo/merge-table/index.vue'), - // name: 'MergeTable', - // meta: { - // title: '合并行或列' - // } - // }, - // { - // path: 'custom-index', - // component: () => import('_v/table-demo/custom-index/index.vue'), - // name: 'CustomIndex', - // meta: { - // title: '自定义索引' - // } - // } ] }, - // { - // path: '/directives-demo', - // component: Layout, - // redirect: '/directives-demo/clipboard', - // name: 'DirectivesDemo', - // meta: { - // title: '自定义指令', - // icon: 'clipboard', - // alwaysShow: true - // }, - // children: [ - // { - // path: 'clipboard', - // component: () => import('_v/directives-demo/clipboard/index.vue'), - // name: 'ClipboardDemo', - // meta: { - // title: 'Clipboard' - // } - // } - // ] - // }, - // { - // path: '/hooks-demo', - // component: Layout, - // redirect: '/hooks-demo/watermark', - // name: 'HooksDemo', - // meta: { - // title: 'Hooks', - // icon: 'international', - // alwaysShow: true - // }, - // children: [ - // { - // path: 'watermark', - // component: () => import('_v/hooks-demo/useWatermark/index.vue'), - // name: 'UseWatermarkDemo', - // meta: { - // title: 'UseWaterMark' - // } - // }, - // { - // path: 'useScrollTo', - // component: () => import('_v/hooks-demo/useScrollTo/index.vue'), - // name: 'UseScrollToDemo', - // meta: { - // title: 'UseScrollTo' - // } - // } - // ] - // }, - // { - // path: '/icon', - // component: Layout, - // name: 'IconsDemo', - // meta: {}, - // children: [ - // { - // path: 'index', - // component: () => import('_v/icons/index.vue'), - // name: 'Icons', - // meta: { - // title: '图标', - // icon: 'icon' - // } - // } - // ] - // }, { path: '/level', component: Layout, diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index f6e2aa5..6b9d8ea 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -12,7 +12,7 @@ import { store } from '../index' import { useAppStoreWithOut } from '@/store/modules/app' const appStore = useAppStoreWithOut() -const modules = import.meta.glob('../views/*/*.vue') +const modules = import.meta.glob('./src/views/*/*.vue') /* Layout */ const Layout = () => import('@/layout/index.vue') diff --git a/src/views/components-demo/detail/index.vue b/src/views/components-demo/detail/index.vue index bca4e65..c092c0a 100644 --- a/src/views/components-demo/detail/index.vue +++ b/src/views/components-demo/detail/index.vue @@ -113,6 +113,7 @@ + + diff --git a/src/views/icons/index.vue b/src/views/icons/index.vue new file mode 100644 index 0000000..853e88c --- /dev/null +++ b/src/views/icons/index.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/src/views/icons/svg-icons.ts b/src/views/icons/svg-icons.ts new file mode 100644 index 0000000..32f994a --- /dev/null +++ b/src/views/icons/svg-icons.ts @@ -0,0 +1,9 @@ +const modules = import.meta.glob('../../assets/icons/*.svg') + +const svgIcons: string[] = [] + +for (const key in modules) { + svgIcons.push(key.split('../../assets/icons/')[1].split('.')[0]) +} + +export default svgIcons diff --git a/src/views/table-demo/custom-header/index.vue b/src/views/table-demo/custom-header/index.vue index 88c42b0..33231f3 100644 --- a/src/views/table-demo/custom-header/index.vue +++ b/src/views/table-demo/custom-header/index.vue @@ -21,9 +21,9 @@ diff --git a/src/views/table-demo/multiple-choice/index.vue b/src/views/table-demo/multiple-choice/index.vue index 2b2ae21..8c8ef30 100644 --- a/src/views/table-demo/multiple-choice/index.vue +++ b/src/views/table-demo/multiple-choice/index.vue @@ -17,9 +17,9 @@ />
- 切换第二、第三行的选中状态 + + 切换第二、第三行的选中状态 + 取消选择