Skip to content

Commit

Permalink
!16 3.9.0
Browse files Browse the repository at this point in the history
Merge pull request !16 from ktianc/master
  • Loading branch information
vvandk authored and gitee-org committed Mar 12, 2024
2 parents 13bfb7d + adc7b21 commit b3b427e
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 99 deletions.
73 changes: 37 additions & 36 deletions kinit-admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-element-plus-admin",
"version": "2.5.6",
"version": "2.7.0",
"description": "一套基于vue3、element-plus、typesScript、vite4的后台集成方案。",
"author": "Archer <[email protected]>",
"private": false,
Expand All @@ -24,18 +24,18 @@
"dependencies": {
"@iconify/iconify": "3.1.1",
"@iconify/vue": "4.1.1",
"@vueuse/core": "10.7.1",
"@vueuse/core": "10.9.0",
"@wangeditor/editor": "5.1.23",
"@wangeditor/editor-for-vue": "5.1.10",
"@zxcvbn-ts/core": "3.0.4",
"animate.css": "4.1.1",
"axios": "1.6.5",
"axios": "1.6.7",
"cropperjs": "1.6.1",
"dayjs": "1.11.10",
"driver.js": "1.3.1",
"echarts": "5.4.3",
"echarts": "5.5.0",
"echarts-wordcloud": "2.1.0",
"element-plus": "2.4.4",
"element-plus": "2.5.6",
"lodash-es": "4.17.21",
"mitt": "3.0.1",
"nprogress": "0.2.0",
Expand All @@ -44,78 +44,79 @@
"qrcode": "1.5.3",
"qs": "6.11.2",
"url": "0.11.3",
"vue": "3.4.7",
"vue-draggable-plus": "0.3.4",
"vue-i18n": "9.9.0",
"vue": "3.4.20",
"vue-draggable-plus": "0.3.5",
"vue-i18n": "9.9.1",
"vue-json-pretty": "2.3.0",
"vue-router": "4.2.5",
"vue-router": "4.3.0",
"vue-types": "5.1.1",
"xgplayer": "3.0.11"
"xgplayer": "3.0.13"
},
"devDependencies": {
"@amap/amap-jsapi-loader": "1.0.1",
"@commitlint/cli": "18.4.4",
"@commitlint/config-conventional": "18.4.4",
"@iconify/json": "2.2.166",
"@commitlint/cli": "19.0.1",
"@commitlint/config-conventional": "19.0.0",
"@iconify/json": "2.2.187",
"@intlify/unplugin-vue-i18n": "2.0.0",
"@kjgl77/datav-vue3": "1.6.1",
"@types/fs-extra": "11.0.4",
"@types/inquirer": "9.0.7",
"@types/lodash-es": "4.17.12",
"@types/node": "20.10.8",
"@types/node": "20.11.21",
"@types/nprogress": "0.2.3",
"@types/qrcode": "1.5.5",
"@types/qs": "6.9.11",
"@types/sortablejs": "1.15.7",
"@typescript-eslint/eslint-plugin": "6.18.1",
"@typescript-eslint/parser": "6.18.1",
"@unocss/transformer-variant-group": "0.58.3",
"@vitejs/plugin-legacy": "5.2.0",
"@vitejs/plugin-vue": "5.0.2",
"@types/qs": "6.9.12",
"@types/sortablejs": "1.15.8",
"@typescript-eslint/eslint-plugin": "7.1.0",
"@typescript-eslint/parser": "7.1.0",
"@unocss/transformer-variant-group": "0.58.5",
"@vitejs/plugin-legacy": "5.3.1",
"@vitejs/plugin-vue": "5.0.4",
"@vitejs/plugin-vue-jsx": "3.1.0",
"autoprefixer": "10.4.16",
"autoprefixer": "10.4.17",
"chalk": "5.3.0",
"consola": "3.2.3",
"cron-validate": "1.4.5",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-define-config": "2.1.0",
"eslint-plugin-prettier": "5.1.2",
"eslint-plugin-vue": "9.19.2",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-vue": "9.22.0",
"esno": "4.0.0",
"fs-extra": "11.2.0",
"inquirer": "9.2.12",
"inquirer": "9.2.15",
"less": "4.2.0",
"lint-staged": "15.2.0",
"lint-staged": "15.2.2",
"lodash": "4.17.21",
"moment": "2.30.1",
"plop": "4.0.1",
"postcss": "8.4.33",
"postcss-html": "1.5.0",
"postcss": "8.4.35",
"postcss-html": "1.6.0",
"postcss-less": "6.0.0",
"prettier": "3.1.1",
"prettier": "3.2.5",
"rimraf": "5.0.5",
"rollup": "4.9.4",
"rollup": "4.12.0",
"rollup-plugin-visualizer": "5.12.0",
"stylelint": "16.1.0",
"stylelint": "16.2.1",
"stylelint-config-html": "1.1.0",
"stylelint-config-recommended": "14.0.0",
"stylelint-config-standard": "36.0.0",
"stylelint-order": "6.0.4",
"terser": "5.26.0",
"terser": "5.28.1",
"typescript": "5.3.3",
"unocss": "0.58.3",
"vite": "5.0.11",
"unocss": "0.58.5",
"vite": "5.1.4",
"vite-plugin-ejs": "1.7.0",
"vite-plugin-eslint": "1.8.1",
"vite-plugin-progress": "0.0.7",
"vite-plugin-purge-icons": "0.10.0",
"vite-plugin-style-import": "2.0.0",
"vite-plugin-svg-icons": "2.0.1",
"vue-draggable-plus": "0.2.6",
"vite-plugin-url-copy": "1.1.3",
"vue-tsc": "1.8.27",
"vue3-json-viewer": "2.2.2",
"zipson": "^0.2.12"
"zipson": "0.2.12"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
12 changes: 10 additions & 2 deletions kinit-admin/src/components/Form/src/Form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,15 @@ export default defineComponent({
margin-left: 0 !important;
}
.@{elNamespace}-form--inline .@{elNamespace}-input {
width: 245px;
.@{elNamespace}-form--inline {
:deep(.el-form-item__content) {
& > :first-child {
min-width: 229.5px;
}
}
.@{elNamespace}-input-number {
// 229.5px是兼容el-input-number的最小宽度,
min-width: 229.5px;
}
}
</style>
2 changes: 1 addition & 1 deletion kinit-admin/src/components/Menu/src/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default defineComponent({
>
{{
default: () => {
const { renderMenuItem } = useRenderMenuItem(unref(menuMode))
const { renderMenuItem } = useRenderMenuItem()
return renderMenuItem(unref(routers))
}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,49 @@ import { ElSubMenu, ElMenuItem } from 'element-plus'
import { hasOneShowingChild } from '../helper'
import { isUrl } from '@/utils/is'
import { useRenderMenuTitle } from './useRenderMenuTitle'
import { useDesign } from '@/hooks/web/useDesign'
import { pathResolve } from '@/utils/routerHelper'

const { renderMenuTitle } = useRenderMenuTitle()

export const useRenderMenuItem = (
export const useRenderMenuItem = () =>
// allRouters: AppRouteRecordRaw[] = [],
menuMode: 'vertical' | 'horizontal'
) => {
const renderMenuItem = (routers: AppRouteRecordRaw[], parentPath = '/') => {
return routers
.filter((v) => !v.meta?.hidden)
.map((v) => {
const meta = v.meta ?? {}
const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v)
const fullPath = isUrl(v.path) ? v.path : pathResolve(parentPath, v.path) // getAllParentPath<AppRouteRecordRaw>(allRouters, v.path).join('/')
{
const renderMenuItem = (routers: AppRouteRecordRaw[], parentPath = '/') => {
return routers
.filter((v) => !v.meta?.hidden)
.map((v) => {
const meta = v.meta ?? {}
const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v)
const fullPath = isUrl(v.path) ? v.path : pathResolve(parentPath, v.path) // getAllParentPath<AppRouteRecordRaw>(allRouters, v.path).join('/')

if (
oneShowingChild &&
(!onlyOneChild?.children || onlyOneChild?.noShowingChildren) &&
!meta?.alwaysShow
) {
return (
<ElMenuItem index={onlyOneChild ? pathResolve(fullPath, onlyOneChild.path) : fullPath}>
{{
default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta)
}}
</ElMenuItem>
)
} else {
const { getPrefixCls } = useDesign()
if (
oneShowingChild &&
(!onlyOneChild?.children || onlyOneChild?.noShowingChildren) &&
!meta?.alwaysShow
) {
return (
<ElMenuItem
index={onlyOneChild ? pathResolve(fullPath, onlyOneChild.path) : fullPath}
>
{{
default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta)
}}
</ElMenuItem>
)
} else {
return (
<ElSubMenu index={fullPath}>
{{
title: () => renderMenuTitle(meta),
default: () => renderMenuItem(v.children!, fullPath)
}}
</ElSubMenu>
)
}
})
}

const preFixCls = getPrefixCls('menu-popper')
return (
<ElSubMenu
index={fullPath}
popperClass={
menuMode === 'vertical' ? `${preFixCls}--vertical` : `${preFixCls}--horizontal`
}
>
{{
title: () => renderMenuTitle(meta),
default: () => renderMenuItem(v.children!, fullPath)
}}
</ElSubMenu>
)
}
})
return {
renderMenuItem
}
}

return {
renderMenuItem
}
}
8 changes: 6 additions & 2 deletions kinit-admin/src/components/TabMenu/src/TabMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export default defineComponent({
} else {
showTitle.value = !collapse
}
},
{
immediate: true
}
)
Expand Down Expand Up @@ -202,11 +205,12 @@ export default defineComponent({
</div>
<Menu
class={[
'!absolute top-0 z-1000',
'!absolute top-0 z-3000',
{
'!left-[var(--tab-menu-min-width)]': unref(collapse),
'!left-[var(--tab-menu-max-width)]': !unref(collapse),
'!w-[var(--left-menu-max-width)]': unref(showMenu) || unref(fixedMenu),
'!w-[var(--left-menu-max-width)] border-r-1 border-r-solid border-[var(--el-border-color)]':
unref(showMenu) || unref(fixedMenu),
'!w-0': !unref(showMenu) && !unref(fixedMenu)
}
]}
Expand Down
3 changes: 2 additions & 1 deletion kinit-admin/src/components/Table/src/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default defineComponent({
border: propTypes.bool.def(true),
size: {
type: String as PropType<ComponentSize>,
validator: (v: ComponentSize) => ['medium', 'small', 'mini'].includes(v)
validator: (v: ComponentSize) => ['default', 'small', 'large'].includes(v)
},
fit: propTypes.bool.def(true),
showHeader: propTypes.bool.def(true),
Expand Down Expand Up @@ -349,6 +349,7 @@ export default defineComponent({
const bindValue: Recordable = { ...attrs, ...unref(getProps) }
delete bindValue.columns
delete bindValue.data
delete bindValue.align
return bindValue
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ import { propTypes } from '@/utils/propTypes'
import { moveElementToIndex } from '@/utils/index'
import { BaseButton } from '@/components/Button'
const appStore = useAppStore()
const sizeMap = computed(() => appStore.sizeMap)
const { setStorage, getStorage, removeStorage } = useStorage()
const { t } = useI18n()
export default defineComponent({
name: 'TableActions',
props: {
Expand All @@ -47,6 +42,10 @@ export default defineComponent({
},
emits: ['refresh', 'changSize'],
setup(props, { emit }) {
const appStore = useAppStore()
const sizeMap = computed(() => appStore.sizeMap)
const { t } = useI18n()
const refresh = () => {
emit('refresh')
}
Expand Down
4 changes: 2 additions & 2 deletions kinit-admin/src/components/TagsView/src/TagsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,14 @@ const isActive = (route: RouteLocationNormalizedLoaded): boolean => {
// 所有右键菜单组件的元素
const itemRefs = useTemplateRefsList<ComponentRef<typeof ContextMenu & ContextMenuExpose>>()
// 右键菜单装填改变的时候
// 右键菜单状态改变的时候
const visibleChange = (visible: boolean, tagItem: RouteLocationNormalizedLoaded) => {
if (visible) {
for (const v of unref(itemRefs)) {
const elDropdownMenuRef = v.elDropdownMenuRef
if (tagItem.fullPath !== v.tagItem.fullPath) {
elDropdownMenuRef?.handleClose()
setSelectTag(tagItem)
}
}
}
Expand Down Expand Up @@ -582,4 +583,3 @@ watch(
}
}
</style>
@/hooks/web/useTagsView
23 changes: 20 additions & 3 deletions kinit-admin/uno.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
import { defineConfig, toEscapedSelector as e, presetUno, presetIcons } from 'unocss'
import transformerVariantGroup from '@unocss/transformer-variant-group'
import { loadEnv } from 'vite'

const root = process.cwd()

const createPresetIcons = () => {
const isBuild = !!process.argv[4]
let env = {} as any
if (!isBuild) {
env = loadEnv(process.argv[3], root)
} else {
env = loadEnv(process.argv[4], root)
}

// @ts-ignore
if (import.meta.env.VITE_USE_ONLINE_ICON === 'true') {
if (env.VITE_USE_ONLINE_ICON === 'true') {
return []
} else {
return [
presetIcons({
prefix: ''
// 由于默认加载的是所有的图标,启动会非常慢,可以在这里去加载需要的图标,确保启动速度
// collections: {
// carbon: () => import('@iconify-json/carbon/icons.json').then(i => i.default),
// mdi: () => import('@iconify-json/mdi/icons.json').then(i => i.default),
// logos: () => import('@iconify-json/logos/icons.json').then(i => i.default),
// }
})
]
} else {
return []
}
}

Expand Down
Loading

0 comments on commit b3b427e

Please sign in to comment.