1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-06-17 20:39:00 +08:00

Compare commits

..

No commits in common. "0fe0b9d41b8900ac46b5a9878c99e8369bfb96de" and "1934776063725558f7de859b9c2099126cbd7a8e" have entirely different histories.

20 changed files with 1509 additions and 1056 deletions

View File

@ -13,42 +13,42 @@
}, },
"dependencies": { "dependencies": {
"@arco-design/color": "^0.4.0", "@arco-design/color": "^0.4.0",
"@vueuse/core": "^13.2.0", "@vueuse/core": "^13.1.0",
"axios": "^1.9.0", "axios": "^1.8.4",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"echarts": "^5.6.0", "echarts": "^5.6.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"naive-ui": "^2.41.0", "naive-ui": "^2.41.0",
"pinia": "^3.0.2", "pinia": "^3.0.2",
"pinia-plugin-persistedstate": "^4.3.0", "pinia-plugin-persistedstate": "^4.2.0",
"vue": "^3.5.14", "vue": "^3.5.13",
"vue-echarts": "^7.0.3", "vue-echarts": "^7.0.3",
"vue-router": "^4.5.1", "vue-router": "^4.5.0",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^4.13.1", "@antfu/eslint-config": "^4.12.0",
"@iconify/json": "^2.2.339", "@iconify/json": "^2.2.331",
"@unocss/eslint-config": "^66.1.2", "@unocss/eslint-config": "^66.0.0",
"@unocss/eslint-plugin": "^66.1.2", "@unocss/eslint-plugin": "^66.0.0",
"@unocss/preset-rem-to-px": "^66.1.2", "@unocss/preset-rem-to-px": "^66.0.0",
"@vitejs/plugin-vue": "^5.2.4", "@vitejs/plugin-vue": "^5.2.3",
"@vitejs/plugin-vue-jsx": "^4.1.2", "@vitejs/plugin-vue-jsx": "^4.1.2",
"eslint": "^9.27.0", "eslint": "^9.25.1",
"eslint-plugin-format": "^1.0.1", "eslint-plugin-format": "^1.0.1",
"esno": "^4.8.0", "esno": "^4.8.0",
"fs-extra": "^11.3.0", "fs-extra": "^11.3.0",
"glob": "^11.0.2", "glob": "^11.0.2",
"lint-staged": "^16.0.0", "lint-staged": "^15.5.1",
"rollup-plugin-visualizer": "^5.14.0", "rollup-plugin-visualizer": "^5.14.0",
"simple-git-hooks": "^2.13.0", "simple-git-hooks": "^2.13.0",
"taze": "^19.1.0", "taze": "^19.0.4",
"unocss": "^66.1.2", "unocss": "^66.0.0",
"unplugin-auto-import": "^19.2.0", "unplugin-auto-import": "^19.1.2",
"unplugin-vue-components": "^28.5.0", "unplugin-vue-components": "^28.5.0",
"vite": "^6.3.5", "vite": "^6.3.3",
"vite-plugin-router-warn": "^1.0.0", "vite-plugin-router-warn": "^1.0.0",
"vite-plugin-vue-devtools": "^7.7.6", "vite-plugin-vue-devtools": "^7.7.5",
"vue3-intro-step": "^1.0.5" "vue3-intro-step": "^1.0.5"
}, },
"simple-git-hooks": { "simple-git-hooks": {

2404
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -29,9 +29,9 @@
</template> </template>
<script setup> <script setup>
import { darkTheme, dateZhCN, zhCN } from 'naive-ui'
import { LayoutSetting } from '@/components' import { LayoutSetting } from '@/components'
import { useAppStore, useTabStore } from '@/store' import { useAppStore, useTabStore } from '@/store'
import { darkTheme, dateZhCN, zhCN } from 'naive-ui'
import { layoutSettingVisible } from './settings' import { layoutSettingVisible } from './settings'
const layouts = new Map() const layouts = new Map()

View File

@ -17,8 +17,8 @@
</template> </template>
<script setup> <script setup>
import { getPresetColors } from '@arco-design/color'
import { useAppStore } from '@/store' import { useAppStore } from '@/store'
import { getPresetColors } from '@arco-design/color'
const appStore = useAppStore() const appStore = useAppStore()

View File

@ -8,8 +8,8 @@
</template> </template>
<script setup> <script setup>
import { useDark, useToggle } from '@vueuse/core'
import { useAppStore } from '@/store' import { useAppStore } from '@/store'
import { useDark, useToggle } from '@vueuse/core'
const appStore = useAppStore() const appStore = useAppStore()
const isDark = useDark() const isDark = useDark()

View File

@ -7,52 +7,48 @@
---------------------------------> --------------------------------->
<template> <template>
<div class="h-full flex flex-col overflow-hidden"> <AppCard v-if="$slots.default" bordered bg="#fafafc dark:black" class="mb-30 min-h-60 rounded-4">
<AppCard v-if="$slots.default" bordered bg="#fafafc dark:black" class="mb-30 min-h-60 rounded-4"> <form class="flex justify-between p-16" @submit.prevent="handleSearch()">
<form class="flex justify-between p-16" @submit.prevent="handleSearch()"> <n-scrollbar x-scrollable>
<n-scrollbar x-scrollable> <n-space :wrap="!expand || isExpanded" :size="[32, 16]" class="p-10">
<n-space :wrap="!expand || isExpanded" :size="[32, 16]" class="p-10"> <slot />
<slot /> </n-space>
</n-space> </n-scrollbar>
</n-scrollbar> <div class="flex-shrink-0 p-10">
<div class="flex-shrink-0 p-10"> <n-button ghost type="primary" @click="handleReset">
<n-button ghost type="primary" @click="handleReset"> <i class="i-fe:rotate-ccw mr-4" />
<i class="i-fe:rotate-ccw mr-4" /> 重置
重置 </n-button>
</n-button> <n-button attr-type="submit" class="ml-20" type="primary">
<n-button attr-type="submit" class="ml-20" type="primary"> <i class="i-fe:search mr-4" />
<i class="i-fe:search mr-4" /> 搜索
搜索 </n-button>
</n-button>
<template v-if="expand"> <template v-if="expand">
<n-button v-if="!isExpanded" type="primary" text @click="toggleExpand"> <n-button v-if="!isExpanded" type="primary" text @click="toggleExpand">
<i class="i-fe:chevrons-down ml-4" /> <i class="i-fe:chevrons-down ml-4" />
展开 展开
</n-button> </n-button>
<n-button v-else text type="primary" @click="toggleExpand"> <n-button v-else text type="primary" @click="toggleExpand">
<i class="i-fe:chevrons-up ml-4" /> <i class="i-fe:chevrons-up ml-4" />
收起 收起
</n-button> </n-button>
</template> </template>
</div> </div>
</form> </form>
</AppCard> </AppCard>
<NDataTable <NDataTable
:remote="remote" :remote="remote"
:loading="loading" :loading="loading"
:scroll-x="scrollX" :scroll-x="scrollX"
:columns="columns" :columns="columns"
:data="tableData" :data="tableData"
:row-key="(row) => row[rowKey]" :row-key="(row) => row[rowKey]"
:pagination="isPagination ? pagination : false" :pagination="isPagination ? pagination : false"
flex-height @update:checked-row-keys="onChecked"
class="flex-1" @update:page="onPageChange"
@update:checked-row-keys="onChecked" />
@update:page="onPageChange"
/>
</div>
</template> </template>
<script setup> <script setup>

View File

@ -6,8 +6,8 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/ **********************************/
import { withDirectives } from 'vue'
import { router } from '@/router' import { router } from '@/router'
import { withDirectives } from 'vue'
const permission = { const permission = {
mounted(el, binding) { mounted(el, binding) {

View File

@ -54,8 +54,7 @@ function handleMenuSelect(key, item) {
}) })
} }
else { else {
if (!item.path) if(!item.path) return
return
router.push(item.path) router.push(item.path)
} }
} }

View File

@ -6,10 +6,10 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/ **********************************/
import { defaultLayout, defaultPrimaryColor, naiveThemeOverrides } from '@/settings'
import { generate, getRgbStr } from '@arco-design/color' import { generate, getRgbStr } from '@arco-design/color'
import { useDark } from '@vueuse/core' import { useDark } from '@vueuse/core'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { defaultLayout, defaultPrimaryColor, naiveThemeOverrides } from '@/settings'
export const useAppStore = defineStore('app', { export const useAppStore = defineStore('app', {
state: () => ({ state: () => ({

View File

@ -6,8 +6,8 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/ **********************************/
import { defineStore } from 'pinia'
import { usePermissionStore, useRouterStore, useTabStore, useUserStore } from '@/store' import { usePermissionStore, useRouterStore, useTabStore, useUserStore } from '@/store'
import { defineStore } from 'pinia'
export const useAuthStore = defineStore('auth', { export const useAuthStore = defineStore('auth', {
state: () => ({ state: () => ({

View File

@ -6,9 +6,9 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/ **********************************/
import { isExternal } from '@/utils'
import { hyphenate } from '@vueuse/core' import { hyphenate } from '@vueuse/core'
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { isExternal } from '@/utils'
export const usePermissionStore = defineStore('permission', { export const usePermissionStore = defineStore('permission', {
state: () => ({ state: () => ({

View File

@ -7,9 +7,9 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/ **********************************/
import * as NaiveUI from 'naive-ui'
import { useAppStore } from '@/store' import { useAppStore } from '@/store'
import { isNullOrUndef } from '@/utils' import { isNullOrUndef } from '@/utils'
import * as NaiveUI from 'naive-ui'
export function setupMessage(NMessage) { export function setupMessage(NMessage) {
class Message { class Message {

View File

@ -159,13 +159,13 @@
</template> </template>
<script setup> <script setup>
import { useUserStore } from '@/store'
import { BarChart, LineChart, PieChart } from 'echarts/charts' import { BarChart, LineChart, PieChart } from 'echarts/charts'
import { GridComponent, LegendComponent, TooltipComponent } from 'echarts/components' import { GridComponent, LegendComponent, TooltipComponent } from 'echarts/components'
import * as echarts from 'echarts/core' import * as echarts from 'echarts/core'
import { UniversalTransition } from 'echarts/features' import { UniversalTransition } from 'echarts/features'
import { CanvasRenderer } from 'echarts/renderers' import { CanvasRenderer } from 'echarts/renderers'
import VChart from 'vue-echarts' import VChart from 'vue-echarts'
import { useUserStore } from '@/store'
const userStore = useUserStore() const userStore = useUserStore()

View File

@ -101,9 +101,9 @@
</template> </template>
<script setup> <script setup>
import { useStorage } from '@vueuse/core'
import { useAuthStore } from '@/store' import { useAuthStore } from '@/store'
import { lStorage, throttle } from '@/utils' import { lStorage, throttle } from '@/utils'
import { useStorage } from '@vueuse/core'
import api from './api' import api from './api'
const authStore = useAuthStore() const authStore = useAuthStore()

View File

@ -6,8 +6,8 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/ **********************************/
import axios from 'axios'
import { request } from '@/utils' import { request } from '@/utils'
import axios from 'axios'
export default { export default {
getMenuTree: () => request.get('/permission/menu/tree'), getMenuTree: () => request.get('/permission/menu/tree'),

View File

@ -159,10 +159,10 @@
</template> </template>
<script setup> <script setup>
import icons from 'isme:icons'
import pagePathes from 'isme:page-pathes'
import { MeModal } from '@/components' import { MeModal } from '@/components'
import { useForm, useModal } from '@/composables' import { useForm, useModal } from '@/composables'
import icons from 'isme:icons'
import pagePathes from 'isme:page-pathes'
import api from '../api' import api from '../api'
import QuestionLabel from './QuestionLabel.vue' import QuestionLabel from './QuestionLabel.vue'

View File

@ -92,8 +92,8 @@
</template> </template>
<script setup> <script setup>
import { NButton, NSwitch } from 'naive-ui'
import { MeCrud } from '@/components' import { MeCrud } from '@/components'
import { NButton, NSwitch } from 'naive-ui'
import api from './api' import api from './api'
import MenuTree from './components/MenuTree.vue' import MenuTree from './components/MenuTree.vue'
import ResAddOrEdit from './components/ResAddOrEdit.vue' import ResAddOrEdit from './components/ResAddOrEdit.vue'

View File

@ -75,7 +75,7 @@
:checked-keys="modalForm.permissionIds" :checked-keys="modalForm.permissionIds"
:on-update:checked-keys="(keys) => (modalForm.permissionIds = keys)" :on-update:checked-keys="(keys) => (modalForm.permissionIds = keys)"
checkable check-on-click default-expand-all default-expand-all checkable check-on-click
class="cus-scroll max-h-200 w-full" class="cus-scroll max-h-200 w-full"
/> />
</n-form-item> </n-form-item>
@ -95,9 +95,9 @@
</template> </template>
<script setup> <script setup>
import { NButton, NSwitch } from 'naive-ui'
import { MeCrud, MeModal, MeQueryItem } from '@/components' import { MeCrud, MeModal, MeQueryItem } from '@/components'
import { useCrud } from '@/composables' import { useCrud } from '@/composables'
import { NButton, NSwitch } from 'naive-ui'
import api from './api' import api from './api'
defineOptions({ name: 'RoleMgt' }) defineOptions({ name: 'RoleMgt' })

View File

@ -67,10 +67,10 @@
</template> </template>
<script setup> <script setup>
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
import { h } from 'vue'
import { MeCrud, MeQueryItem } from '@/components' import { MeCrud, MeQueryItem } from '@/components'
import { formatDateTime } from '@/utils' import { formatDateTime } from '@/utils'
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
import { h } from 'vue'
import api from './api' import api from './api'
defineOptions({ name: 'RoleUser' }) defineOptions({ name: 'RoleUser' })

View File

@ -110,11 +110,11 @@
</template> </template>
<script setup> <script setup>
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
import { MeCrud, MeModal, MeQueryItem } from '@/components' import { MeCrud, MeModal, MeQueryItem } from '@/components'
import { useCrud } from '@/composables' import { useCrud } from '@/composables'
import { withPermission } from '@/directives' import { withPermission } from '@/directives'
import { formatDateTime } from '@/utils' import { formatDateTime } from '@/utils'
import { NAvatar, NButton, NSwitch, NTag } from 'naive-ui'
import api from './api' import api from './api'
defineOptions({ name: 'UserMgt' }) defineOptions({ name: 'UserMgt' })