diff --git a/package.json b/package.json index e555f2a..bf2980e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "vue-element-admin-webpack", + "name": "vue-element-plus-admin-webpack", "version": "0.1.0", "private": true, "scripts": { @@ -19,7 +19,7 @@ "clipboard": "^2.0.6", "core-js": "^3.6.5", "echarts": "^4.9.0", - "element-plus": "^1.0.1-beta.8", + "element-plus": "1.0.1-beta.10", "highlight.js": "^10.4.0", "lodash-es": "^4.17.15", "mockjs": "^1.1.0", diff --git a/src/components/Editor/props.ts b/src/components/Editor/props.ts index 0a697b9..5bc78c9 100644 --- a/src/components/Editor/props.ts +++ b/src/components/Editor/props.ts @@ -1,5 +1,5 @@ import { PropType } from 'vue' -import { message } from 'ant-design-vue' +import { ElMessage } from 'element-plus' import { oneOf } from '@/utils' import { Config } from './types' @@ -18,19 +18,19 @@ export const editorProps = { customAlert: (s: string, t: string) => { switch (t) { case 'success': - message.success(s) + ElMessage.success(s) break case 'info': - message.info(s) + ElMessage.info(s) break case 'warning': - message.warning(s) + ElMessage.warning(s) break case 'error': - message.error(s) + ElMessage.error(s) break default: - message.info(s) + ElMessage.info(s) break } }, diff --git a/src/components/Image/index.vue b/src/components/Image/index.vue deleted file mode 100644 index a28a9e9..0000000 --- a/src/components/Image/index.vue +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - 加载失败 - - - - - - - - diff --git a/src/components/Logo/index.vue b/src/components/Logo/index.vue index 55708ff..3582772 100644 --- a/src/components/Logo/index.vue +++ b/src/components/Logo/index.vue @@ -19,7 +19,7 @@ export default defineComponent({ }, setup(props) { const show = ref(true) - const title = computed(() => appStore.title) + const title = computed(() => appStore.logoTitle) const layout = computed(() => appStore.layout) watch( () => props.collapsed, diff --git a/src/components/Preview/index.vue b/src/components/Preview/index.vue index 50ecd6b..ee8f5bc 100644 --- a/src/components/Preview/index.vue +++ b/src/components/Preview/index.vue @@ -10,7 +10,7 @@ - + @@ -19,14 +19,14 @@ :class="{ 'is-disabled': !infinite && isFirst }" @click="prev" > - + - + @@ -63,15 +63,11 @@ import { isFirefox } from '@/utils/is' import { on, off } from '@/utils/dom-utils' import throttle from 'lodash-es/throttle' import SvgIcon from '_c/SvgIcon/index.vue' -import { CloseCircleOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons-vue' const mousewheelEventName = isFirefox() ? 'DOMMouseScroll' : 'mousewheel' export default defineComponent({ name: 'Preview', components: { - SvgIcon, - CloseCircleOutlined, - LeftOutlined, - RightOutlined + SvgIcon }, props: previewProps, setup(props) { diff --git a/src/components/Scrollbar/Bar.vue b/src/components/Scrollbar/Bar.vue deleted file mode 100644 index ad2c993..0000000 --- a/src/components/Scrollbar/Bar.vue +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - diff --git a/src/components/Scrollbar/index.vue b/src/components/Scrollbar/index.vue deleted file mode 100644 index 612df97..0000000 --- a/src/components/Scrollbar/index.vue +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/Scrollbar/types.ts b/src/components/Scrollbar/types.ts deleted file mode 100644 index c998234..0000000 --- a/src/components/Scrollbar/types.ts +++ /dev/null @@ -1,14 +0,0 @@ -export interface BarMapItem { - offset: string - scroll: string - scrollSize: string - size: string - key: string - axis: string - client: string - direction: string -} -export interface BarMap { - vertical: BarMapItem - horizontal: BarMapItem -} diff --git a/src/components/Scrollbar/util.ts b/src/components/Scrollbar/util.ts deleted file mode 100644 index 43472a5..0000000 --- a/src/components/Scrollbar/util.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { BarMap } from './types' -export const BAR_MAP: BarMap = { - vertical: { - offset: 'offsetHeight', - scroll: 'scrollTop', - scrollSize: 'scrollHeight', - size: 'height', - key: 'vertical', - axis: 'Y', - client: 'clientY', - direction: 'top' - }, - horizontal: { - offset: 'offsetWidth', - scroll: 'scrollLeft', - scrollSize: 'scrollWidth', - size: 'width', - key: 'horizontal', - axis: 'X', - client: 'clientX', - direction: 'left' - } -} - -export function renderThumbStyle({ move, size, bar }: any) { - const style = {} as any - const translate = `translate${bar.axis}(${move}%)` - - style[bar.size] = size - style.transform = translate - style.msTransform = translate - style.webkitTransform = translate - - return style -} - -function extend(to: T, _from: K): T & K { - return Object.assign(to, _from) -} - -export function toObject(arr: Array): Record { - const res = {} - for (let i = 0; i < arr.length; i++) { - if (arr[i]) { - extend(res, arr[i]) - } - } - return res -} diff --git a/src/components/Search/index.vue b/src/components/Search/index.vue index 8b5af9d..cfc2f87 100644 --- a/src/components/Search/index.vue +++ b/src/components/Search/index.vue @@ -1,96 +1,86 @@ - - - + + - - - + {changeVal(val, item)})" /> - - + {changeVal(val, item)})" /> - - + {changeVal(val, item)})" > - - {{ item.optionLabel ? v[item.optionLabel] : v.title }} - - + :label="item.optionLabel ? v[item.optionLabel] : v.title" + /> + - - + {changeVal(val, item)})" > - {{ item.optionLabel ? v[item.optionLabel] : v.label }} - + - {{ item.optionLabel ? v[item.optionLabel] : v.label }} - + - + - - + - - + {changeVal(val, item)})" /> - - + {changeVal(val, item)})" /> - - + {changeVal(val, item)})" /> - - - {changeVal(val, item)})" - /> - - - - + + - - - 查询 - - + - - - 重置 - - - - - + + + + + - - - - 查询 - + - - - - 重置 - + - - + + diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx deleted file mode 100644 index f2b5d30..0000000 --- a/src/components/Table/Table.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { defineComponent, PropType, computed } from 'vue' -import { Table } from 'ant-design-vue' - -export default defineComponent({ - name: 'ComTable', - props: { - columns: { - type: Array as PropType, - default: () => [] - } - }, - setup(props, { attrs, slots }) { - const getBindValue = computed((): any => { - const bindValue = { ...attrs, ...props } - delete bindValue.columns - return bindValue - }) - - function renderTabelItem(columns: any[]) { - return columns.map((v: any) => { - const vSlots: any = v.slots || {} - if (v.children) { - const slotData = { - title: () => vSlots.title && slots[vSlots.title] && slots[vSlots.title]!(), - default: () => {renderTabelItem(v.children)} - } - if (!vSlots.title) { - delete slotData.title - } - return ( - - - ) - } else { - const slotData = { - title: () => vSlots.title && slots[vSlots.title] && slots[vSlots.title]!(), - default: ({ text, record, index, column }: any) => { - if (vSlots.customRender) { - return slots[vSlots.customRender] && slots[vSlots.customRender]!({ text, record, index, column }) - } else { - return text - } - }, - filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, column }: any) => vSlots.filterDropdown && slots[vSlots.filterDropdown] && slots[vSlots.filterDropdown]!({ setSelectedKeys, selectedKeys, confirm, clearFilters, column }), - filterIcon: (filtered: any) => vSlots.filterIcon && slots[vSlots.filterIcon] && slots[vSlots.filterIcon]!(filtered) - } - if (!vSlots.title) { - delete slotData.title - } - if (!vSlots.filterDropdown) { - delete slotData.filterDropdown - } - if (!vSlots.filterIcon) { - delete slotData.filterIcon - } - return ( - - - ) - } - }) - } - - return () => { - const tableSlot = { - title: (currentPageData: any) => slots.title && slots.title(currentPageData), - footer: (currentPageData: any) => slots.footer && slots.footer(currentPageData), - expandedRowRender: ({ record, index, indent, expanded }: any) => slots.expandedRowRender && slots.expandedRowRender({ record, index, indent, expanded }), - } - if (!slots.title) { - delete tableSlot.title - } - if (!slots.footer) { - delete tableSlot.footer - } - if (!slots.expandedRowRender) { - delete tableSlot.expandedRowRender - } - return ( - - {renderTabelItem(props.columns)} - - ) - } - } -}) diff --git a/src/components/Table/TableItem.vue b/src/components/Table/TableItem.vue deleted file mode 100644 index 33b76ba..0000000 --- a/src/components/Table/TableItem.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/Table/components/Slot.vue b/src/components/Table/components/Slot.vue new file mode 100644 index 0000000..b49804a --- /dev/null +++ b/src/components/Table/components/Slot.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/components/Table/components/TableColumn.vue b/src/components/Table/components/TableColumn.vue new file mode 100644 index 0000000..5086472 --- /dev/null +++ b/src/components/Table/components/TableColumn.vue @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + {{ scope.row[item.key] }} + + + + + + + + + + + diff --git a/src/components/Table/index.ts b/src/components/Table/index.ts deleted file mode 100644 index f0f7164..0000000 --- a/src/components/Table/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Table from './Table' - -export default Table diff --git a/src/components/Table/index.vue b/src/components/Table/index.vue index b23bebe..521a01f 100644 --- a/src/components/Table/index.vue +++ b/src/components/Table/index.vue @@ -1,47 +1,109 @@ - - + + - - - - + + + + + - - - + + + + + + + + + + + + + {{ scope.row[item.key] }} + + + + - + - - diff --git a/src/pages/index/layout/components/Navbar.vue b/src/pages/index/layout/components/Navbar.vue deleted file mode 100644 index 9a7d315..0000000 --- a/src/pages/index/layout/components/Navbar.vue +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/pages/index/layout/components/Silder/Item.vue b/src/pages/index/layout/components/Silder/Item.vue deleted file mode 100644 index 0931df7..0000000 --- a/src/pages/index/layout/components/Silder/Item.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - {{ title }} - - - - - - - diff --git a/src/pages/index/layout/components/Silder/hooks/setSidebarItem.ts b/src/pages/index/layout/components/Silder/hooks/setSidebarItem.ts deleted file mode 100644 index e8be448..0000000 --- a/src/pages/index/layout/components/Silder/hooks/setSidebarItem.ts +++ /dev/null @@ -1,92 +0,0 @@ -import { ref } from 'vue' -import type { RouteRecordRaw } from 'vue-router' -import path from 'path' -import { isExternal } from '@/utils/validate' -// import { setSidebarItem } from './types' - -export function setSidebarItem() { - const onlyOneChild = ref(null) - - function hasOneShowingChild(children: RouteRecordRaw[] = [], parent: RouteRecordRaw): boolean { - const showingChildren: RouteRecordRaw[] = children.filter((item: RouteRecordRaw) => { - if (item.meta && item.meta.hidden) { - return false - } else { - // Temp set(will be used if only has one showing child) - onlyOneChild.value = item - return true - } - }) - - // When there is only one child router, the child router is displayed by default - if (showingChildren.length === 1) { - return true - } - - // Show parent if there are no child router to display - if (showingChildren.length === 0) { - onlyOneChild.value = { ...parent, path: '', noShowingChildren: true } - return true - } - return false - } - - function resolvePath(basePath: string, routePath: string): string { - if (isExternal(routePath)) { - return routePath - } - return path.resolve(basePath, routePath) - } - - function treeFindRouter(tree: any[], func: Function, result: RouteRecordRaw[] = []): RouteRecordRaw[] { - if (!tree) return [] - for (const data of tree) { - result.push(data) - if (func(data)) return result - if (data.children) { - const findChildren = treeFindRouter(data.children, func, result) - if (findChildren.length) return findChildren - } - result.pop() - } - return [] - } - - function getFullPath(arr: string[]): string[] { - const result: string[] = [] - let basePath = '/' - for (let i = 0; i < arr.length; i++) { - if (i === arr.length) { - continue - } - result.push(resolvePath(basePath, arr[i])) - basePath = resolvePath(basePath, arr[i]) - } - return result - } - - function findCurrentRoute(routers: RouteRecordRaw[], path: string, basePath = '/', result: Array = []): any { - for (const item of routers) { - if (!item.meta?.hidden) { - const _basePath = resolvePath(basePath, item.path) - if (_basePath === path && !item.children) { - result.push(item) - } else { - if (item.children) { - findCurrentRoute(item.children, path, _basePath, result) - } - } - } - } - return result ? result[0] : null - } - - return { - onlyOneChild, - hasOneShowingChild, - resolvePath, - treeFindRouter, - getFullPath, - findCurrentRoute - } -} diff --git a/src/pages/index/layout/components/Silder/hooks/types.d.ts b/src/pages/index/layout/components/Silder/hooks/types.d.ts deleted file mode 100644 index d5eb3d9..0000000 --- a/src/pages/index/layout/components/Silder/hooks/types.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Ref } from 'vue' -import ref from 'vue' - -export interface setSidebarItem = { - onlyOneChild: Ref - hasOneShowingChild: Function - resolvePath: Function - treeFindPath: Function - getFullPath: Function -} \ No newline at end of file diff --git a/src/pages/index/layout/components/Silder/index.less b/src/pages/index/layout/components/Silder/index.less deleted file mode 100644 index 9f0036a..0000000 --- a/src/pages/index/layout/components/Silder/index.less +++ /dev/null @@ -1,10 +0,0 @@ -.sidebar-container { - height: 100%; -} -.has-logo { - height: calc(~"100% - @{topSilderHeight}"); -} -.menu-wrap { - height: 100%; - overflow: hidden; -} diff --git a/src/pages/index/layout/components/Silder/index.ts b/src/pages/index/layout/components/Silder/index.ts deleted file mode 100644 index ffcbcf7..0000000 --- a/src/pages/index/layout/components/Silder/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Silder from './index' - -export default Silder diff --git a/src/pages/index/layout/components/Silder/index.tsx b/src/pages/index/layout/components/Silder/index.tsx deleted file mode 100644 index d3b3b68..0000000 --- a/src/pages/index/layout/components/Silder/index.tsx +++ /dev/null @@ -1,176 +0,0 @@ -import { ref, defineComponent, PropType, computed, watch } from 'vue' -// import { Menu } from 'element-plus' -import { useRouter } from 'vue-router' -import type { RouteRecordRaw, RouteLocationNormalizedLoaded } from 'vue-router' -import Scrollbar from '_c/Scrollbar/index.vue' -import Item from './Item.vue' -import { permissionStore } from '_p/index/store/modules/permission' -import { setSidebarItem } from './hooks/setSidebarItem' -import { isExternal } from '@/utils/validate' -import { findIndex } from '@/utils' -import config from '_p/index/config' -const { show_logo } = config - -import './index.less' - -export default defineComponent({ - name: 'Silder', - components: { - Scrollbar, - Item - }, - props: { - collapsed: { - type: Boolean as PropType, - default: true - }, - inlineIndent: { - type: Number as PropType, - default: 24 - }, - forceSubMenuRender: { - type: Boolean as PropType, - default: false - }, - mode: { - type: String as PropType<'vertical' | 'horizontal' | 'vertical-right' | 'inline'>, - default: 'inline' - }, - theme: { - type: String as PropType<'light' | 'dark'>, - default: 'dark' - } - }, - setup(props) { - const { currentRoute, push } = useRouter() - const { resolvePath, treeFindRouter, getFullPath, findCurrentRoute } = setSidebarItem() - const routers = computed((): RouteRecordRaw[] => { - return permissionStore.routers - }) - const selectedKeys = ref([]) - const openKeys = ref([]) - const activeMenuName = ref('') - - watch( - () => currentRoute.value, - (route: RouteLocationNormalizedLoaded) => { - setSelectedKeys(route) - }, - { - immediate: true - } - ) - - watch( - () => props.collapsed, - (collapsed: boolean) => { - setOpenKeys(currentRoute.value, collapsed) - }, - { - immediate: true - } - ) - - function handleOpenChange(keyArr: string[]) { - // 需要自己管理openKeys - openKeys.value = keyArr - } - - function setOpenKeys(route: RouteLocationNormalizedLoaded, collapsed: boolean) { - let currentRoute: any = null - if (route.meta.activeMenu) { - currentRoute = findCurrentRoute(routers.value, route.meta.activeMenu) - } else { - currentRoute = route - } - const parentRoute: RouteRecordRaw[] = treeFindRouter(permissionStore.routers, (data: any) => data.name === currentRoute.name) - openKeys.value = collapsed ? [] : getFullPath(parentRoute.map((v: RouteRecordRaw) => v.path)) - } - - function setSelectedKeys(route: RouteLocationNormalizedLoaded) { - const { meta, path, name } = route - activeMenuName.value = name as string - if (meta.activeMenu) { - selectedKeys.value = [meta.activeMenu] - return - } - selectedKeys.value = [path] - } - - function highlightMenu(className: string, basePath: string) { - const parentRoute: RouteRecordRaw[] = treeFindRouter(permissionStore.routers, (data: any) => data.name === currentRoute.value.name) - const parentFullPath: string[] = getFullPath(parentRoute.map((v: RouteRecordRaw) => v.path)) - return findIndex(parentFullPath, (item: string) => item === basePath) !== -1 ? className : '' - } - - function handleMenuClick({ key }: any) { - console.log(key) - if (isExternal(key)) { - window.open(key) - } else { - push({ path: key }) - } - } - - // function renderMenu(routers: RouteRecordRaw[], basePath = '/') { - // if (routers && routers.length) { - // return routers.map((item: RouteRecordRaw) => { - // if (!item.meta?.hidden) { - // const _basePath = resolvePath(basePath, item.path) - // const { onlyOneChild, hasOneShowingChild } = setSidebarItem() - // if (hasOneShowingChild(item.children, item) && (!onlyOneChild.value.children || onlyOneChild.value.noShowingChildren) && !item.meta?.alwaysShow) { - // return ( - // [ - // - // ] - // }}> - // - // ) - // } else { - // return ( - // [ - // - // ] - // }} - // > - // {renderMenu(item.children as any, _basePath)} - // - // ) - // } - // } - // }) - // } - // } - - // return () => { - // return ( - // // - // // - // // - // // {renderMenu(routers.value)} - // // - // // - // // - // ) - // } - } -}) diff --git a/src/pages/index/layout/components/TagsView.vue b/src/pages/index/layout/components/TagsView.vue deleted file mode 100644 index 36656d0..0000000 --- a/src/pages/index/layout/components/TagsView.vue +++ /dev/null @@ -1,377 +0,0 @@ - - - - - - - - - - - {{ tag.title }} - - - - - - - - - - - - 刷新 - - - 关闭 - - - 关闭其他 - - - 关闭全部 - - - - - - - - diff --git a/src/pages/index/layout/components/UserInfo.vue b/src/pages/index/layout/components/UserInfo.vue deleted file mode 100644 index 613c75d..0000000 --- a/src/pages/index/layout/components/UserInfo.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - 管理员 - - - - - - - 首页 - - - - 退出登录 - - - - - - - - - diff --git a/src/pages/index/layout/index.vue b/src/pages/index/layout/index.vue index cfdf8a2..9b18d60 100644 --- a/src/pages/index/layout/index.vue +++ b/src/pages/index/layout/index.vue @@ -1,29 +1,26 @@ - + diff --git a/src/pages/index/layout/modules/LeftTop.vue b/src/pages/index/layout/modules/LeftTop.vue index bf5c769..7942281 100644 --- a/src/pages/index/layout/modules/LeftTop.vue +++ b/src/pages/index/layout/modules/LeftTop.vue @@ -1,97 +1,157 @@ - - + + + - - - + + + - - - - - - + + + - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/index/layout/modules/Top.vue b/src/pages/index/layout/modules/Top.vue index 7eb48ca..bb16ef5 100644 --- a/src/pages/index/layout/modules/Top.vue +++ b/src/pages/index/layout/modules/Top.vue @@ -1,128 +1,291 @@ - - - - - - - - + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/index/main.ts b/src/pages/index/main.ts index 4661fdf..775b524 100644 --- a/src/pages/index/main.ts +++ b/src/pages/index/main.ts @@ -47,7 +47,7 @@ setupSvgIcon(app) // 全局注册svgIcon组件 setupGlobCom(app) // 注册全局公用组件 -// setupDirectives(app) // 注册全局自定义指令 +setupDirectives(app) // 注册全局自定义指令 // mockXHR() // mock注册 diff --git a/src/pages/index/permission.ts b/src/pages/index/permission.ts index c89e8f5..eb8bc3a 100644 --- a/src/pages/index/permission.ts +++ b/src/pages/index/permission.ts @@ -4,9 +4,7 @@ import NProgress from 'nprogress' // 引入进度条 import 'nprogress/nprogress.css' // 进度条样式 -import config from './config' - -const { user_info, title } = config +import { appStore } from '_p/index/store/modules/app' import wsCache from '@/cache' @@ -20,7 +18,7 @@ import type { RouteRecordRaw } from 'vue-router' const whiteList: string[] = ['/login'] // 不重定向白名单 router.beforeEach((to, from, next) => { - if (wsCache.get(user_info)) { + if (wsCache.get(appStore.userInfo)) { if (to.path === '/login') { next({ path: '/' }) } else { @@ -55,6 +53,6 @@ router.beforeEach((to, from, next) => { }) router.afterEach((to) => { - document.title = getPageTitle(to.meta.title, title) + document.title = getPageTitle(to.meta.title, appStore.title) NProgress.done() // 结束进度条 }) diff --git a/src/pages/index/router/index.ts b/src/pages/index/router/index.ts index 2f165f0..46d2fca 100644 --- a/src/pages/index/router/index.ts +++ b/src/pages/index/router/index.ts @@ -6,8 +6,6 @@ import { getParentLayout } from './utils' /* Layout */ const Layout = () => import('../layout/index.vue') -/* ParentView */ -import ParentView from '_c/ParentView/index.vue' /** * redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击 @@ -50,7 +48,8 @@ export const constantRouterMap: AppRouteRecordRaw[] = [ name: 'NoFind', meta: { hidden: true, - title: '404' + title: '404', + noTagsView: true } }, { @@ -83,281 +82,305 @@ export const constantRouterMap: AppRouteRecordRaw[] = [ } ] }, - // { - // path: '/external-link', - // component: Layout, - // meta: {}, - // children: [ - // { - // path: 'http://192.168.169.57/ue/2019/doc/vue-standard/dist/', - // meta: { title: '文档', icon: 'documentation' } - // } - // ] - // } + { + path: '/external-link', + component: Layout, + meta: {}, + children: [ + { + path: 'http://192.168.169.57/ue/2019/doc/vue-standard/dist/', + meta: { title: '文档', icon: 'documentation' } + } + ] + } ] export const asyncRouterMap: AppRouteRecordRaw[] = [ - // { - // path: '/components-demo', - // component: Layout, - // redirect: '/components-demo/echarts', - // name: 'ComponentsDemo', - // meta: { - // title: '功能组件', - // icon: 'component', - // alwaysShow: true - // }, - // children: [ - // { - // path: 'echarts', - // component: () => import('_p/index/views/components-demo/echarts/index.vue'), - // name: 'EchartsDemo', - // meta: { - // title: '图表' - // } - // }, - // { - // path: 'image', - // component: () => import('_p/index/views/components-demo/image/index.vue'), - // name: 'ImageDemo', - // meta: { - // title: '图片' - // } - // }, - // { - // path: 'preview', - // component: () => import('_p/index/views/components-demo/preview/index.vue'), - // name: 'PreviewDemo', - // meta: { - // title: '图片预览' - // } - // }, - // { - // path: 'scroll', - // component: () => import('_p/index/views/components-demo/scroll/index.vue'), - // name: 'ScrollDemo', - // meta: { - // title: '滚动' - // } - // }, - // { - // path: 'count-to', - // component: () => import('_p/index/views/components-demo/count-to/index.vue'), - // name: 'CountToDemo', - // meta: { - // title: '数字动画' - // } - // }, - // { - // path: 'search', - // component: () => import('_p/index/views/components-demo/search/index.vue'), - // name: 'SearchDemo', - // meta: { - // title: '查询' - // } - // }, - // { - // path: 'button', - // component: () => import('_p/index/views/components-demo/button/index.vue'), - // name: 'ButtonDemo', - // meta: { - // title: '按钮' - // } - // }, - // { - // path: 'editor', - // component: () => import('_p/index/views/components-demo/editor/index.vue'), - // name: 'EditorDemo', - // meta: { - // title: '富文本编辑器' - // } - // }, - // { - // path: 'markdown', - // component: () => import('_p/index/views/components-demo/markdown/index.vue'), - // name: 'MarkdownDemo', - // meta: { - // title: 'markdown编辑器' - // } - // } - // ] - // }, - // // { - // // path: '/table-demo', - // // component: Layout, - // // redirect: '/table-demo/basic-usage', - // // name: 'TableDemo', - // // meta: { - // // title: '表格', - // // icon: 'table', - // // alwaysShow: true - // // }, - // // children: [ - // // // { - // // // path: 'test', - // // // component: () => import('_p/index/views/table-demo/test'), - // // // name: 'test', - // // // meta: { - // // // title: 'test' - // // // } - // // // }, - // // { - // // path: 'basic-usage', - // // component: () => import('_p/index/views/table-demo/basic-usage/index.vue'), - // // name: 'BasicUsage', - // // meta: { - // // title: '基础用法' - // // } - // // }, - // // { - // // path: 'table-ellipsis', - // // component: () => import('_p/index/views/table-demo/table-ellipsis/index.vue'), - // // name: 'TableEllipsis', - // // meta: { - // // title: '单元格自动省略' - // // } - // // }, - // // { - // // path: 'table-load', - // // component: () => import('_p/index/views/table-demo/table-load/index.vue'), - // // name: 'TableLoad', - // // meta: { - // // title: '远程加载数据' - // // } - // // }, - // // { - // // path: 'table-border', - // // component: () => import('_p/index/views/table-demo/table-border/index.vue'), - // // name: 'TableBorder', - // // meta: { - // // title: '带边框' - // // } - // // }, - // // { - // // path: 'table-merge', - // // component: () => import('_p/index/views/table-demo/table-merge/index.vue'), - // // name: 'TableMerge', - // // meta: { - // // title: '表格行/列合并' - // // } - // // }, - // // { - // // path: 'custom-menu', - // // component: () => import('_p/index/views/table-demo/custom-menu/index.vue'), - // // name: 'CustomMenu', - // // meta: { - // // title: '自定义筛选菜单' - // // } - // // }, - // // { - // // path: 'edit-cell', - // // component: () => import('_p/index/views/table-demo/edit-cell/index.vue'), - // // name: 'EditCell', - // // meta: { - // // title: '可编辑单元格' - // // } - // // }, - // // { - // // path: 'edit-row', - // // component: () => import('_p/index/views/table-demo/edit-row/index.vue'), - // // name: 'EditRow', - // // meta: { - // // title: '可编辑行' - // // } - // // }, - // // { - // // path: 'table-tree', - // // component: () => import('_p/index/views/table-demo/table-tree/index.vue'), - // // name: 'TableTree', - // // meta: { - // // title: '树形数据展示' - // // } - // // }, - // // { - // // path: 'table-expanded', - // // component: () => import('_p/index/views/table-demo/table-expanded/index.vue'), - // // name: 'TableExpanded', - // // meta: { - // // title: '可展开' - // // } - // // }, - // // { - // // path: 'fixed-header', - // // component: () => import('_p/index/views/table-demo/fixed-header/index.vue'), - // // name: 'FixedHeader', - // // meta: { - // // title: '固定头和列' - // // } - // // } - // // ] - // // }, - // { - // path: '/directives-demo', - // component: Layout, - // redirect: '/directives-demo/clipboard', - // name: 'DirectivesDemo', - // meta: { - // title: '自定义指令', - // icon: 'clipboard', - // alwaysShow: true - // }, - // children: [ - // { - // path: 'clipboard', - // component: () => import('_p/index/views/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('_p/index/views/hooks-demo/useWatermark/index.vue'), - // name: 'UseWatermarkDemo', - // meta: { - // title: 'UseWaterMark' - // } - // }, - // { - // path: 'useScrollTo', - // component: () => import('_p/index/views/hooks-demo/useScrollTo/index.vue'), - // name: 'UseScrollToDemo', - // meta: { - // title: 'UseScrollTo' - // } - // } - // ] - // }, - // { - // path: '/icon', - // component: Layout, - // name: 'IconsDemo', - // meta: {}, - // children: [ - // { - // path: 'index', - // component: () => import('_p/index/views/icons/index.vue'), - // name: 'Icons', - // meta: { - // title: '图标', - // icon: 'icon' - // } - // } - // ] - // }, + { + path: '/components-demo', + component: Layout, + redirect: '/components-demo/echarts', + name: 'ComponentsDemo', + meta: { + title: '功能组件', + icon: 'component', + alwaysShow: true + }, + children: [ + { + path: 'echarts', + component: () => import('_p/index/views/components-demo/echarts/index.vue'), + name: 'EchartsDemo', + meta: { + title: '图表' + } + }, + { + path: 'preview', + component: () => import('_p/index/views/components-demo/preview/index.vue'), + name: 'PreviewDemo', + meta: { + title: '图片预览' + } + }, + { + path: 'count-to', + component: () => import('_p/index/views/components-demo/count-to/index.vue'), + name: 'CountToDemo', + meta: { + title: '数字动画' + } + }, + { + path: 'search', + component: () => import('_p/index/views/components-demo/search/index.vue'), + name: 'SearchDemo', + meta: { + title: '查询' + } + }, + { + path: 'editor', + component: () => import('_p/index/views/components-demo/editor/index.vue'), + name: 'EditorDemo', + meta: { + title: '富文本编辑器' + } + }, + { + path: 'markdown', + component: () => import('_p/index/views/components-demo/markdown/index.vue'), + name: 'MarkdownDemo', + meta: { + title: 'markdown编辑器' + } + } + ] + }, + { + path: '/table-demo', + component: Layout, + redirect: '/table-demo/basic-usage', + name: 'TableDemo', + meta: { + title: '表格', + icon: 'table', + alwaysShow: true + }, + children: [ + // { + // path: 'test', + // component: () => import('_p/index/views/table-demo/test'), + // name: 'test', + // meta: { + // title: 'test' + // } + // }, + { + path: 'basic-table', + component: () => import('_p/index/views/table-demo/basic-table/index.vue'), + name: 'BasicTable', + meta: { + title: '基础表格' + } + }, + { + path: 'stripe-table', + component: () => import('_p/index/views/table-demo/stripe-table/index.vue'), + name: 'StripeTable', + meta: { + title: '带斑马纹表格' + } + }, + { + path: 'border-table', + component: () => import('_p/index/views/table-demo/border-table/index.vue'), + name: 'BorderTable', + meta: { + title: '带边框表格' + } + }, + { + path: 'state-table', + component: () => import('_p/index/views/table-demo/state-table/index.vue'), + name: 'StateTable', + meta: { + title: '带状态表格' + } + }, + { + path: 'fixed-header', + component: () => import('_p/index/views/table-demo/fixed-header/index.vue'), + name: 'FixedHeader', + meta: { + title: '固定表头' + } + }, + { + path: 'fixed-column', + component: () => import('_p/index/views/table-demo/fixed-column/index.vue'), + name: 'FixedColumn', + meta: { + title: '固定列' + } + }, + { + path: 'fixed-column-header', + component: () => import('_p/index/views/table-demo/fixed-column-header/index.vue'), + name: 'FixedColumnHeader', + meta: { + title: '固定列和表头' + } + }, + { + path: 'fluid-height', + component: () => import('_p/index/views/table-demo/fluid-height/index.vue'), + name: 'FluidHeight', + meta: { + title: '流体高度' + } + }, + { + path: 'multi-header', + component: () => import('_p/index/views/table-demo/multi-header/index.vue'), + name: 'MultiHeader', + meta: { + title: '多级表头' + } + }, + { + path: 'single-choice', + component: () => import('_p/index/views/table-demo/single-choice/index.vue'), + name: 'SingleChoice', + meta: { + title: '单选' + } + }, + { + path: 'multiple-choice', + component: () => import('_p/index/views/table-demo/multiple-choice/index.vue'), + name: 'MultipleChoice', + meta: { + title: '多选' + } + }, + { + path: 'sort-table', + component: () => import('_p/index/views/table-demo/sort-table/index.vue'), + name: 'SortTable', + meta: { + title: '排序' + } + }, + { + path: 'screen-table', + component: () => import('_p/index/views/table-demo/screen-table/index.vue'), + name: 'ScreenTable', + meta: { + title: '筛选' + } + }, + { + path: 'expand-row', + component: () => import('_p/index/views/table-demo/expand-row/index.vue'), + name: 'ExpandRow', + meta: { + title: '展开行' + } + }, + { + path: 'tree-and-load', + component: () => import('_p/index/views/table-demo/tree-and-load/index.vue'), + name: 'TreeAndLoad', + meta: { + title: '树形数据与懒加载' + } + }, + { + path: 'custom-header', + component: () => import('_p/index/views/table-demo/custom-header/index.vue'), + name: 'CustomHeader', + meta: { + title: '自定义表头' + } + }, + { + path: 'total-table', + component: () => import('_p/index/views/table-demo/total-table/index.vue'), + name: 'TotalTable', + meta: { + title: '表尾合计行' + } + }, + ] + }, + { + path: '/directives-demo', + component: Layout, + redirect: '/directives-demo/clipboard', + name: 'DirectivesDemo', + meta: { + title: '自定义指令', + icon: 'clipboard', + alwaysShow: true + }, + children: [ + { + path: 'clipboard', + component: () => import('_p/index/views/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('_p/index/views/hooks-demo/useWatermark/index.vue'), + name: 'UseWatermarkDemo', + meta: { + title: 'UseWaterMark' + } + }, + { + path: 'useScrollTo', + component: () => import('_p/index/views/hooks-demo/useScrollTo/index.vue'), + name: 'UseScrollToDemo', + meta: { + title: 'UseScrollTo' + } + } + ] + }, + { + path: '/icon', + component: Layout, + name: 'IconsDemo', + meta: {}, + children: [ + { + path: 'index', + component: () => import('_p/index/views/icons/index.vue'), + name: 'Icons', + meta: { + title: '图标', + icon: 'icon' + } + } + ] + }, { path: '/level', component: Layout, diff --git a/src/pages/index/store/modules/app.ts b/src/pages/index/store/modules/app.ts index 39a6dab..ee3b584 100644 --- a/src/pages/index/store/modules/app.ts +++ b/src/pages/index/store/modules/app.ts @@ -15,6 +15,8 @@ export interface AppState { showScreenfull: Boolean showUserInfo: Boolean title: String + logoTitle: String + userInfo: String } @Module({ dynamic: true, namespaced: true, store, name: 'app' }) @@ -31,7 +33,9 @@ class App extends VuexModule implements AppState { public showHamburger = true // 是否显示侧边栏缩收按钮 public showScreenfull = true // 是否全屏按钮 public showUserInfo = true // 是否显示用户头像 - public title = 'vue-antdv-admin' // 标题 + public title = 'vue-element-plus-admin' // 标题 + public logoTitle = 'vue-ElPlus-admin' // logo标题 + public userInfo = 'userInfo' // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突 @Mutation private SET_COLLAPSED(collapsed: boolean): void { @@ -85,6 +89,10 @@ class App extends VuexModule implements AppState { private SET_TITLE(title: string): void { this.title = title } + @Mutation + private SET_LOGOTITLE(logoTitle: string): void { + this.logoTitle = logoTitle + } @Action public SetCollapsed(collapsed: boolean): void { @@ -138,6 +146,10 @@ class App extends VuexModule implements AppState { public SetTitle(title: string): void { this.SET_TITLE(title) } + @Action + public SetLogoTitle(logoTitle: string): void { + this.SET_LOGOTITLE(logoTitle) + } } export const appStore = getModule(App) diff --git a/src/pages/index/views/components-demo/button/index.vue b/src/pages/index/views/components-demo/button/index.vue index 5715cac..99d7b1f 100644 --- a/src/pages/index/views/components-demo/button/index.vue +++ b/src/pages/index/views/components-demo/button/index.vue @@ -1,47 +1,47 @@ - + default - 默认按钮 - 默认按钮 - 默认按钮 - 默认按钮 + 默认按钮 + 默认按钮 + 默认按钮 + 默认按钮 primary - 主要按钮 - 主要按钮 - 主要按钮 - 主要按钮 + 主要按钮 + 主要按钮 + 主要按钮 + 主要按钮 success - 成功按钮 - 成功按钮 - 成功按钮 - 成功按钮 + 成功按钮 + 成功按钮 + 成功按钮 + 成功按钮 warning - 警告按钮 - 警告按钮 - 警告按钮 - 警告按钮 + 警告按钮 + 警告按钮 + 警告按钮 + 警告按钮 danger - 危险按钮 - 危险按钮 - 危险按钮 - 危险按钮 + 危险按钮 + 危险按钮 + 危险按钮 + 危险按钮 info - 信息按钮 - 信息按钮 - 信息按钮 - 信息按钮 + 信息按钮 + 信息按钮 + 信息按钮 + 信息按钮 diff --git a/src/pages/index/views/components-demo/count-to/index.vue b/src/pages/index/views/components-demo/count-to/index.vue index 2513948..d26ddcc 100644 --- a/src/pages/index/views/components-demo/count-to/index.vue +++ b/src/pages/index/views/components-demo/count-to/index.vue @@ -1,6 +1,12 @@ - + - - + + - startVal: + startVal: - - + + - endVal: + endVal: - - + + - duration: + duration: - - + + - separator: + separator: - - + + - prefix: + prefix: - - + + - suffix: + suffix: - - + + - start - pause/resume + start + pause/resume - - + + @@ -121,10 +127,11 @@ export default defineComponent({ align-items: center; margin-bottom: 10px; &>span { - width: 100px; + display: inline-block; + width: 120px; text-align: center; } - @{deep}(.ant-input-number) { + @{deep}(.el-input-number) { width: 100%; } } diff --git a/src/pages/index/views/components-demo/echarts/index.vue b/src/pages/index/views/components-demo/echarts/index.vue index 0ea3885..37a9681 100644 --- a/src/pages/index/views/components-demo/echarts/index.vue +++ b/src/pages/index/views/components-demo/echarts/index.vue @@ -1,29 +1,35 @@ - + - - + + - - + + - - + + - - + + - - + + diff --git a/src/pages/index/views/components-demo/editor/index.vue b/src/pages/index/views/components-demo/editor/index.vue index 8bf3f7b..18afa7d 100644 --- a/src/pages/index/views/components-demo/editor/index.vue +++ b/src/pages/index/views/components-demo/editor/index.vue @@ -1,6 +1,12 @@ - + diff --git a/src/pages/index/views/components-demo/image/index.vue b/src/pages/index/views/components-demo/image/index.vue deleted file mode 100644 index 920f39d..0000000 --- a/src/pages/index/views/components-demo/image/index.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - {{ fit }} - - - - - - - - 默认 - - - - 自定义 - - - - 加载中... - - - - - - - - - - 默认 - - - - 自定义 - - - - - - - - - - - - - - - - - - - - diff --git a/src/pages/index/views/components-demo/markdown/index.vue b/src/pages/index/views/components-demo/markdown/index.vue index 63c5231..2dc1837 100644 --- a/src/pages/index/views/components-demo/markdown/index.vue +++ b/src/pages/index/views/components-demo/markdown/index.vue @@ -1,6 +1,12 @@ - + diff --git a/src/pages/index/views/components-demo/preview/index.vue b/src/pages/index/views/components-demo/preview/index.vue index 43eb28b..cb50413 100644 --- a/src/pages/index/views/components-demo/preview/index.vue +++ b/src/pages/index/views/components-demo/preview/index.vue @@ -1,8 +1,20 @@ - + - + - - 点击预览 + + 点击预览 - - 点击预览 + + 点击预览 + + diff --git a/src/pages/index/views/table-demo/basic-usage/index.vue b/src/pages/index/views/table-demo/basic-usage/index.vue deleted file mode 100644 index 8e054db..0000000 --- a/src/pages/index/views/table-demo/basic-usage/index.vue +++ /dev/null @@ -1,118 +0,0 @@ - - - - - {{ text }} - - - Name - - - - - {{ tag.toUpperCase() }} - - - - - - Invite -- {{ record.name }} - - Delete - - More actions - - - - - - - - - diff --git a/src/pages/index/views/table-demo/border-table/index.vue b/src/pages/index/views/table-demo/border-table/index.vue new file mode 100644 index 0000000..d0a92e6 --- /dev/null +++ b/src/pages/index/views/table-demo/border-table/index.vue @@ -0,0 +1,78 @@ + + + + + + + + + + diff --git a/src/pages/index/views/table-demo/custom-header/index.vue b/src/pages/index/views/table-demo/custom-header/index.vue new file mode 100644 index 0000000..917c32e --- /dev/null +++ b/src/pages/index/views/table-demo/custom-header/index.vue @@ -0,0 +1,111 @@ + + + + + + + + + Edit + Delete + + + + + + + + diff --git a/src/pages/index/views/table-demo/custom-menu/index.vue b/src/pages/index/views/table-demo/custom-menu/index.vue deleted file mode 100644 index fb1e042..0000000 --- a/src/pages/index/views/table-demo/custom-menu/index.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - setSelectedKeys(e.target.value ? [e.target.value] : [])" - @pressEnter="handleSearch(selectedKeys, confirm, column.dataIndex)" - /> - - - Search - - - Reset - - - - - - - - - - - {{ fragment }} - - {{ fragment }} - - - - {{ text }} - - - - - - - - - diff --git a/src/pages/index/views/table-demo/edit-cell/EditableCell.vue b/src/pages/index/views/table-demo/edit-cell/EditableCell.vue deleted file mode 100644 index 1202771..0000000 --- a/src/pages/index/views/table-demo/edit-cell/EditableCell.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - {{ value || ' ' }} - - - - - - - - diff --git a/src/pages/index/views/table-demo/edit-cell/index.vue b/src/pages/index/views/table-demo/edit-cell/index.vue deleted file mode 100644 index 6cc0da2..0000000 --- a/src/pages/index/views/table-demo/edit-cell/index.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - - Add - - - - onCellChange(record.key, 'name', val)" /> - - - - Delete - - - - - - - - - diff --git a/src/pages/index/views/table-demo/edit-row/index.vue b/src/pages/index/views/table-demo/edit-row/index.vue deleted file mode 100644 index b748a8e..0000000 --- a/src/pages/index/views/table-demo/edit-row/index.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - handleChange(e.target.value, record.key, col)" - /> - - {{ text }} - - - - - - - Save - - Cancel - - - - - Edit - - - - - - - - - - - diff --git a/src/pages/index/views/table-demo/expand-row/index.vue b/src/pages/index/views/table-demo/expand-row/index.vue new file mode 100644 index 0000000..ad0193f --- /dev/null +++ b/src/pages/index/views/table-demo/expand-row/index.vue @@ -0,0 +1,140 @@ + + + + + + + + {{ scope.row.name }} + + + {{ scope.row.shop }} + + + {{ scope.row.id }} + + + {{ scope.row.shopId }} + + + {{ scope.row.category }} + + + {{ scope.row.address }} + + + {{ scope.row.desc }} + + + + + + + + + + diff --git a/src/pages/index/views/table-demo/fixed-column-header/index.vue b/src/pages/index/views/table-demo/fixed-column-header/index.vue new file mode 100644 index 0000000..d0c3eb4 --- /dev/null +++ b/src/pages/index/views/table-demo/fixed-column-header/index.vue @@ -0,0 +1,166 @@ + + + + + + 查看 + 编辑 + + + + + + + + diff --git a/src/pages/index/views/table-demo/fixed-column/index.vue b/src/pages/index/views/table-demo/fixed-column/index.vue new file mode 100644 index 0000000..5570ef6 --- /dev/null +++ b/src/pages/index/views/table-demo/fixed-column/index.vue @@ -0,0 +1,133 @@ + + + + + + 查看 + 编辑 + + + + + + + + diff --git a/src/pages/index/views/table-demo/fixed-header/index.vue b/src/pages/index/views/table-demo/fixed-header/index.vue index bbb7051..70956d0 100644 --- a/src/pages/index/views/table-demo/fixed-header/index.vue +++ b/src/pages/index/views/table-demo/fixed-header/index.vue @@ -1,46 +1,78 @@ - - - action - - + + + + diff --git a/src/pages/index/views/table-demo/multi-header/index.vue b/src/pages/index/views/table-demo/multi-header/index.vue new file mode 100644 index 0000000..5322b19 --- /dev/null +++ b/src/pages/index/views/table-demo/multi-header/index.vue @@ -0,0 +1,162 @@ + + + + + + 地址是: {{ scope.row.address }} + + + 移除 + + + + + + + + diff --git a/src/pages/index/views/table-demo/multiple-choice/index.vue b/src/pages/index/views/table-demo/multiple-choice/index.vue new file mode 100644 index 0000000..b658f01 --- /dev/null +++ b/src/pages/index/views/table-demo/multiple-choice/index.vue @@ -0,0 +1,102 @@ + + + + + + + 切换第二、第三行的选中状态 + 取消选择 + + + + + + + diff --git a/src/pages/index/views/table-demo/screen-table/index.vue b/src/pages/index/views/table-demo/screen-table/index.vue new file mode 100644 index 0000000..5535367 --- /dev/null +++ b/src/pages/index/views/table-demo/screen-table/index.vue @@ -0,0 +1,130 @@ + + + + 清除日期过滤器 + 清除所有过滤器 + + + {{ scope.row.tag }} + + + + + + + + diff --git a/src/pages/index/views/table-demo/single-choice/index.vue b/src/pages/index/views/table-demo/single-choice/index.vue new file mode 100644 index 0000000..05e777c --- /dev/null +++ b/src/pages/index/views/table-demo/single-choice/index.vue @@ -0,0 +1,96 @@ + + + + + + + 选中第二行 + 取消选择 + + + + + + + diff --git a/src/pages/index/views/table-demo/sort-table/index.vue b/src/pages/index/views/table-demo/sort-table/index.vue new file mode 100644 index 0000000..7b749cf --- /dev/null +++ b/src/pages/index/views/table-demo/sort-table/index.vue @@ -0,0 +1,82 @@ + + + + + + + + + + diff --git a/src/pages/index/views/table-demo/state-table/index.vue b/src/pages/index/views/table-demo/state-table/index.vue new file mode 100644 index 0000000..6cc75a2 --- /dev/null +++ b/src/pages/index/views/table-demo/state-table/index.vue @@ -0,0 +1,100 @@ + + + + + + + + + + diff --git a/src/pages/index/views/table-demo/stripe-table/index.vue b/src/pages/index/views/table-demo/stripe-table/index.vue new file mode 100644 index 0000000..bd953e1 --- /dev/null +++ b/src/pages/index/views/table-demo/stripe-table/index.vue @@ -0,0 +1,78 @@ + + + + + + + + + + diff --git a/src/pages/index/views/table-demo/table-border/index.vue b/src/pages/index/views/table-demo/table-border/index.vue deleted file mode 100644 index abcc350..0000000 --- a/src/pages/index/views/table-demo/table-border/index.vue +++ /dev/null @@ -1,87 +0,0 @@ - - - - - {{ text }} - - - Header - - - Footer - - - - - - - - diff --git a/src/pages/index/views/table-demo/table-ellipsis/index.vue b/src/pages/index/views/table-demo/table-ellipsis/index.vue deleted file mode 100644 index be0eb55..0000000 --- a/src/pages/index/views/table-demo/table-ellipsis/index.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - {{ text }} - - - - - - - - diff --git a/src/pages/index/views/table-demo/table-expanded/index.vue b/src/pages/index/views/table-demo/table-expanded/index.vue deleted file mode 100644 index 6f58384..0000000 --- a/src/pages/index/views/table-demo/table-expanded/index.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - Delete - - - - {{ record.description }} - - - - - - - - - diff --git a/src/pages/index/views/table-demo/table-load/index.vue b/src/pages/index/views/table-demo/table-load/index.vue deleted file mode 100644 index 6854377..0000000 --- a/src/pages/index/views/table-demo/table-load/index.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - - {{ text }} - - - - - - - diff --git a/src/pages/index/views/table-demo/table-merge/index.vue b/src/pages/index/views/table-demo/table-merge/index.vue deleted file mode 100644 index e6670a7..0000000 --- a/src/pages/index/views/table-demo/table-merge/index.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - - - {{ text }} - - - - - - - - diff --git a/src/pages/index/views/table-demo/table-tree/index.vue b/src/pages/index/views/table-demo/table-tree/index.vue deleted file mode 100644 index 434f8fa..0000000 --- a/src/pages/index/views/table-demo/table-tree/index.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - diff --git a/src/pages/index/views/table-demo/test/table.vue b/src/pages/index/views/table-demo/test/table.vue index 706a491..430d376 100644 --- a/src/pages/index/views/table-demo/test/table.vue +++ b/src/pages/index/views/table-demo/test/table.vue @@ -10,7 +10,7 @@ @change="e => setSelectedKeys(e.target.value ? [e.target.value] : [])" @pressEnter="handleSearch(selectedKeys, confirm, column.dataIndex)" /> - Search - - + + Reset - + diff --git a/src/pages/index/views/table-demo/total-table/index.vue b/src/pages/index/views/table-demo/total-table/index.vue new file mode 100644 index 0000000..0f74644 --- /dev/null +++ b/src/pages/index/views/table-demo/total-table/index.vue @@ -0,0 +1,167 @@ + + + + + + + + + + + + diff --git a/src/pages/index/views/table-demo/tree-and-load/index.vue b/src/pages/index/views/table-demo/tree-and-load/index.vue new file mode 100644 index 0000000..e47cb0b --- /dev/null +++ b/src/pages/index/views/table-demo/tree-and-load/index.vue @@ -0,0 +1,181 @@ + + + + + + + + + + + + diff --git a/src/styles/sidebar.less b/src/styles/sidebar.less deleted file mode 100644 index 5693160..0000000 --- a/src/styles/sidebar.less +++ /dev/null @@ -1,234 +0,0 @@ -#app { - - // 主体区域 Main container - .main-container { - min-height: 100%; - transition: margin-left .28s; - margin-left: @menuWidth; - position: relative; - } - - // 侧边栏 Sidebar container - .sidebar-container { - transition: width 0.28s; - width: @menuWidth !important; - height: 100%; - position: fixed; - font-size: 0px; - top: 0; - bottom: 0; - left: 0; - z-index: 1001; - overflow: hidden; - - //reset element-ui css - .horizontal-collapse-transition { - transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; - } - - .scrollbar-wrapper { - overflow-x: hidden !important; - - .el-scrollbar__view { - height: 100%; - } - } - - .el-scrollbar__bar.is-vertical { - right: 0px; - } - - .el-scrollbar { - height: 100%; - } - - &.has-logo { - .el-scrollbar { - height: calc(100% - 70px); - } - } - - .is-horizontal { - display: none; - } - - a { - display: inline-block; - width: 100%; - overflow: hidden; - } - - .svg-icon { - margin-right: 16px; - } - - .el-menu { - border: none; - height: 100%; - width: 100% !important; - } - - // menu hover - .submenu-title-noDropdown, - .el-submenu__title { - color: hsla(0,0%,100%,.7) !important; - &:hover { - // background-color: @menuHover !important; - color: @subMenuActiveText !important; - } - } - - .is-active>.el-submenu__title { - color: @subMenuActiveText !important; - } - - .is-active { - color: @subMenuActiveText !important; - background-color: @menuActiveBg !important; - &:hover { - color: @subMenuActiveText !important; - background-color: @menuActiveBg !important; - } - & .el-menu-item { - background-color: @menuActiveBg !important; - &:hover { - color: @subMenuActiveText !important; - } - } - } - - & .nest-menu .el-submenu>.el-submenu__title, - & .el-submenu .el-menu-item { - min-width: @menuWidth !important; - background-color: @subMenuBg !important; - - &:hover { - color: @subMenuActiveText !important; - background-color: @subMenuHover !important; - } - } - - & .nest-menu { - & .is-active { - background-color: @menuActiveBg !important; - &:hover { - color: @subMenuActiveText !important; - background-color: @menuActiveBg !important; - } - } - } - } - - .hideSidebar { - .sidebar-container { - width: 36px !important; - } - - .main-container { - margin-left: 36px; - } - - .submenu-title-noDropdown { - padding-left: 10px !important; - position: relative; - - .el-tooltip { - padding: 0 10px !important; - } - } - - .el-submenu { - overflow: hidden; - - &>.el-submenu__title { - padding-left: 10px !important; - - .el-submenu__icon-arrow { - display: none; - } - } - } - - .el-menu--collapse { - .el-submenu { - &>.el-submenu__title { - &>span { - height: 0; - width: 0; - overflow: hidden; - visibility: hidden; - display: inline-block; - } - } - } - } - } - - .el-menu--collapse .el-menu .el-submenu { - min-width: @menuWidth !important; - } - - // 适配移动端, Mobile responsive - .mobile { - .main-container { - margin-left: 0px; - } - - .sidebar-container { - transition: transform .28s; - width: @menuWidth !important; - } - - &.hideSidebar { - .sidebar-container { - pointer-events: none; - transition-duration: 0.3s; - transform: translate3d(-@menuWidth, 0, 0); - } - } - } - - .withoutAnimation { - - .main-container, - .sidebar-container { - transition: none; - } - } -} - -// when menu collapsed -.el-menu--vertical { - &>.el-menu { - .svg-icon { - margin-right: 16px; - } - } - - .nest-menu .el-submenu>.el-submenu__title, - .el-menu-item { - &:hover { - // you can use @subMenuHover - // background-color: @menuHover !important; - } - } - - // the scroll bar appears when the subMenu is too long - >.el-menu--popup { - max-height: 100vh; - overflow-y: auto; - - &::-webkit-scrollbar-track-piece { - background: #d3dce6; - } - - &::-webkit-scrollbar { - width: 6px; - } - - &::-webkit-scrollbar-thumb { - background: #99a9bf; - border-radius: 20px; - } - } -} diff --git a/src/styles/sider.less b/src/styles/sider.less index 460c985..de35522 100644 --- a/src/styles/sider.less +++ b/src/styles/sider.less @@ -35,24 +35,6 @@ } } } - - .is-active { - color: @menuActiveText !important; - background-color: @subMenuHover !important; - &>.el-submenu__title { - color: @menuActiveText !important; - } - } - - .nest-menu { - background-color: @subMenuBg !important; - .el-submenu>.el-submenu__title { - background-color: @subMenuBg !important; - } - .is-active { - background-color: @subMenuHover !important; - } - } // menu hover .submenu-title-noDropdown, .el-submenu__title { @@ -65,6 +47,28 @@ color: @subMenuActiveText !important; // background-color: @subMenuHover !important; } + .is-active { + color: @menuActiveText !important; + background-color: @subMenuHover !important; + &:hover { + color: @subMenuActiveText !important; + background-color: @subMenuHover !important; + } + &>.el-submenu__title { + color: @menuActiveText !important; + } + } + + // .nest-menu { + // background-color: @subMenuBg !important; + // .el-submenu>.el-submenu__title { + // background-color: @subMenuBg !important; + // } + // .is-active { + // background-color: @subMenuHover !important; + // } + // } + } .el-menu--collapse { &>div>.el-submenu { @@ -103,11 +107,11 @@ } } - .nest-menu { - .is-active { - background-color: @subMenuHover !important; - } - } + // .nest-menu { + // .is-active { + // background-color: @subMenuHover !important; + // } + // } // menu hover .submenu-title-noDropdown, .el-submenu__title { @@ -149,15 +153,15 @@ } } - .nest-menu { - background-color: @subMenuBg !important; - .el-submenu>.el-submenu__title { - background-color: @subMenuBg !important; - } - .is-active { - background-color: @subMenuHover !important; - } - } + // .nest-menu { + // background-color: @subMenuBg !important; + // .el-submenu>.el-submenu__title { + // background-color: @subMenuBg !important; + // } + // .is-active { + // background-color: @subMenuHover !important; + // } + // } // menu hover .submenu-title-noDropdown, .el-submenu__title { @@ -191,11 +195,11 @@ } } - .nest-menu { - .is-active { - // background-color: @subMenuHover !important; - } - } + // .nest-menu { + // .is-active { + // // background-color: @subMenuHover !important; + // } + // } // menu hover .submenu-title-noDropdown, .el-submenu__title { diff --git a/yarn.lock b/yarn.lock index e1631d0..975ed7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3990,10 +3990,10 @@ electron-to-chromium@^1.3.621: resolved "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.622.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.622.tgz#9726bd2e67a5462154750ce9701ca6af07d07877" integrity sha1-lya9LmelRiFUdQzpcBymrwfQeHc= -element-plus@^1.0.1-beta.8: - version "1.0.1-beta.8" - resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-1.0.1-beta.8.tgz#d64ead88cff37274262bfd9196fe4657f55149ed" - integrity sha512-D1u65HYMnT44U3cmll66W4mEhxLPZTqcziJtaWwdtl6VIEjrUwnrkCScnH5mVw3w/3NwRHW6XiqZCFxqafUvhw== +element-plus@1.0.1-beta.10: + version "1.0.1-beta.10" + resolved "https://registry.yarnpkg.com/element-plus/-/element-plus-1.0.1-beta.10.tgz#3fdc914c4a888b899d701642e13d1904ccae01f0" + integrity sha512-yjiU9Nnt8VyKJR6L2JoSa59W9pMX4A/Q6csXbd3OJ2ZcakalCP1iDGhAWmp6WQOkgmJFhhhyLENDd5HH1d5Zdw== dependencies: "@popperjs/core" "^2.4.4" async-validator "^3.4.0"
- {{ record.description }} -