diff --git a/.eslintrc.js b/.eslintrc.js
index 2aec88b..4cad823 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -24,6 +24,7 @@ module.exports = defineConfig({
'plugin:prettier/recommended'
],
rules: {
+ 'vue/no-setup-props-destructure': 'off',
'vue/script-setup-uses-vars': 'error',
'vue/no-reserved-component-names': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
diff --git a/README.md b/README.md
index ddc3778..390b166 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
diff --git a/src/components/TabMenu/src/TabMenu.vue b/src/components/TabMenu/src/TabMenu.vue
index 8fcb54d..3305113 100644
--- a/src/components/TabMenu/src/TabMenu.vue
+++ b/src/components/TabMenu/src/TabMenu.vue
@@ -141,7 +141,7 @@ export default defineComponent({
id={`${variables.namespace}-menu`}
class={[
prefixCls,
- 'relative bg-[var(--left-menu-bg-color)] top-1px z-3000 layout-border__right',
+ 'relative bg-[var(--left-menu-bg-color)] top-1px layout-border__right',
{
'w-[var(--tab-menu-max-width)]': !unref(collapse),
'w-[var(--tab-menu-min-width)]': unref(collapse)
diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue
index c3ab442..ed964d2 100644
--- a/src/components/Table/src/Table.vue
+++ b/src/components/Table/src/Table.vue
@@ -362,7 +362,7 @@ export default defineComponent({
return children && children.length
? renderTreeTableColumn(children)
: props?.slots?.default
- ? props.slots.default(args)
+ ? props.slots.default(...args)
: v?.formatter
? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index)
: isImageUrl
@@ -371,7 +371,7 @@ export default defineComponent({
}
}
if (props?.slots?.header) {
- slots['header'] = (...args: any[]) => props.slots.header(args)
+ slots['header'] = (...args: any[]) => props.slots.header(...args)
}
return (
@@ -459,7 +459,7 @@ export default defineComponent({
return children && children.length
? renderTreeTableColumn(children)
: props?.slots?.default
- ? props.slots.default(args)
+ ? props.slots.default(...args)
: v?.formatter
? v?.formatter?.(data.row, data.column, get(data.row, v.field), data.$index)
: isImageUrl
@@ -468,7 +468,7 @@ export default defineComponent({
}
}
if (props?.slots?.header) {
- slots['header'] = (...args: any[]) => props.slots.header(args)
+ slots['header'] = (...args: any[]) => props.slots.header(...args)
}
return (
diff --git a/src/locales/en.ts b/src/locales/en.ts
index ba217d9..5a0042e 100644
--- a/src/locales/en.ts
+++ b/src/locales/en.ts
@@ -164,7 +164,10 @@ export default {
department: 'Department management',
menuManagement: 'Menu management',
// 权限测试页面
- permission: 'Permission test page'
+ permission: 'Permission test page',
+ function: 'Function',
+ multipleTabs: 'Multiple tabs',
+ details: 'Details'
},
permission: {
hasPermission: 'Please set the operation permission value'
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index 0957481..305f2ca 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -163,7 +163,10 @@ export default {
PicturePreview: '表格图片预览',
department: '部门管理',
menuManagement: '菜单管理',
- permission: '权限测试页'
+ permission: '权限测试页',
+ function: '功能',
+ multipleTabs: '多开标签页',
+ details: '详情页'
},
permission: {
hasPermission: '请设置操作权限值'
diff --git a/src/permission.ts b/src/permission.ts
index 48c8c4a..92eebfb 100644
--- a/src/permission.ts
+++ b/src/permission.ts
@@ -5,15 +5,15 @@ import type { RouteRecordRaw } from 'vue-router'
import { useTitle } from '@/hooks/web/useTitle'
import { useNProgress } from '@/hooks/web/useNProgress'
import { usePermissionStoreWithOut } from '@/store/modules/permission'
-import { useDictStoreWithOut } from '@/store/modules/dict'
+// import { useDictStoreWithOut } from '@/store/modules/dict'
import { usePageLoading } from '@/hooks/web/usePageLoading'
-import { getDictApi } from '@/api/common'
+// import { getDictApi } from '@/api/common'
const permissionStore = usePermissionStoreWithOut()
const appStore = useAppStoreWithOut()
-const dictStore = useDictStoreWithOut()
+// const dictStore = useDictStoreWithOut()
const { getStorage } = useStorage()
@@ -30,14 +30,14 @@ router.beforeEach(async (to, from, next) => {
if (to.path === '/login') {
next({ path: '/' })
} else {
- if (!dictStore.getIsSetDict) {
- // 获取所有字典
- const res = await getDictApi()
- if (res) {
- dictStore.setDictObj(res.data)
- dictStore.setIsSetDict(true)
- }
- }
+ // if (!dictStore.getIsSetDict) {
+ // // 获取所有字典
+ // const res = await getDictApi()
+ // if (res) {
+ // dictStore.setDictObj(res.data)
+ // dictStore.setIsSetDict(true)
+ // }
+ // }
if (permissionStore.getIsAddRouters) {
next()
return
diff --git a/src/router/index.ts b/src/router/index.ts
index 36716fb..0e37e54 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -313,6 +313,37 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
}
]
},
+ {
+ path: '/function',
+ component: Layout,
+ redirect: '/function/multipleTabs',
+ name: 'Function',
+ meta: {
+ title: t('router.function'),
+ icon: 'ri:function-fill',
+ alwaysShow: true
+ },
+ children: [
+ {
+ path: 'multiple-tabs',
+ component: () => import('@/views/Function/MultipleTabs.vue'),
+ name: 'MultipleTabs',
+ meta: {
+ title: t('router.multipleTabs')
+ }
+ },
+ {
+ path: 'multiple-tabs-demo/:id',
+ component: () => import('@/views/Function/MultipleTabsDemo.vue'),
+ name: 'MultipleTabsDemo',
+ meta: {
+ hidden: true,
+ title: t('router.details'),
+ canTo: true
+ }
+ }
+ ]
+ },
{
path: '/hooks',
component: Layout,
@@ -333,14 +364,6 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
}
}
// {
- // path: 'useOpenTab',
- // component: () => import('@/views/hooks/useOpenTab.vue'),
- // name: 'UseOpenTab',
- // meta: {
- // title: 'useOpenTab'
- // }
- // }
- // {
// path: 'useCrudSchemas',
// component: () => import('@/views/hooks/useCrudSchemas.vue'),
// name: 'UseCrudSchemas',
diff --git a/src/views/Authorization/Department/Department.vue b/src/views/Authorization/Department/Department.vue
index 864226a..6d52381 100644
--- a/src/views/Authorization/Department/Department.vue
+++ b/src/views/Authorization/Department/Department.vue
@@ -85,7 +85,7 @@ const crudSchemas = reactive
([
table: {
slots: {
default: (data: any) => {
- return <>{data[0].row.departmentName}>
+ return <>{data.row.departmentName}>
}
}
},
@@ -119,7 +119,7 @@ const crudSchemas = reactive([
table: {
slots: {
default: (data: any) => {
- const status = data[0].row.status
+ const status = data.row.status
return (
<>
@@ -215,13 +215,13 @@ const crudSchemas = reactive([
default: (data: any) => {
return (
<>
- action(data[0].row, 'edit')}>
+ action(data.row, 'edit')}>
{t('exampleDemo.edit')}
- action(data[0].row, 'detail')}>
+ action(data.row, 'detail')}>
{t('exampleDemo.detail')}
- delData(data[0].row)}>
+ delData(data.row)}>
{t('exampleDemo.del')}
>
diff --git a/src/views/Authorization/Menu/Menu.vue b/src/views/Authorization/Menu/Menu.vue
index 9927185..cf43ef4 100644
--- a/src/views/Authorization/Menu/Menu.vue
+++ b/src/views/Authorization/Menu/Menu.vue
@@ -41,7 +41,7 @@ const tableColumns = reactive([
label: t('menu.icon'),
slots: {
default: (data: any) => {
- const icon = data[0].row.meta.icon
+ const icon = data.row.meta.icon
if (icon) {
return (
<>
@@ -59,7 +59,7 @@ const tableColumns = reactive([
label: t('menu.permission'),
slots: {
default: (data: any) => {
- const permission = data[0].row.meta.permission
+ const permission = data.row.meta.permission
return permission ? <>{permission.join(', ')}> : null
}
}
@@ -69,7 +69,7 @@ const tableColumns = reactive([
label: t('menu.component'),
slots: {
default: (data: any) => {
- const component = data[0].row.component
+ const component = data.row.component
return <>{component === '#' ? '顶级目录' : component === '##' ? '子目录' : component}>
}
}
@@ -85,8 +85,8 @@ const tableColumns = reactive([
default: (data: any) => {
return (
<>
-
- {data[0].row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')}
+
+ {data.row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')}
>
)
@@ -99,7 +99,7 @@ const tableColumns = reactive([
width: 240,
slots: {
default: (data: any) => {
- const row = data[0].row
+ const row = data.row
return (
<>
action(row, 'edit')}>
diff --git a/src/views/Authorization/Role/Role.vue b/src/views/Authorization/Role/Role.vue
index 68096af..42a7923 100644
--- a/src/views/Authorization/Role/Role.vue
+++ b/src/views/Authorization/Role/Role.vue
@@ -47,8 +47,8 @@ const tableColumns = reactive([
default: (data: any) => {
return (
<>
-
- {data[0].row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')}
+
+ {data.row.status === 1 ? t('userDemo.enable') : t('userDemo.disable')}
>
)
@@ -69,7 +69,7 @@ const tableColumns = reactive([
width: 240,
slots: {
default: (data: any) => {
- const row = data[0].row
+ const row = data.row
return (
<>
action(row, 'edit')}>
diff --git a/src/views/Authorization/User/User.vue b/src/views/Authorization/User/User.vue
index 6f7720d..ccb95ca 100644
--- a/src/views/Authorization/User/User.vue
+++ b/src/views/Authorization/User/User.vue
@@ -150,7 +150,7 @@ const crudSchemas = reactive([
width: 240,
slots: {
default: (data: any) => {
- const row = data[0].row as DepartmentUserItem
+ const row = data.row as DepartmentUserItem
return (
<>
action(row, 'edit')}>
diff --git a/src/views/Components/Table/DefaultTable.vue b/src/views/Components/Table/DefaultTable.vue
index 13a6fb0..b06eef2 100644
--- a/src/views/Components/Table/DefaultTable.vue
+++ b/src/views/Components/Table/DefaultTable.vue
@@ -1,7 +1,7 @@
diff --git a/src/views/Components/Table/TreeTable.vue b/src/views/Components/Table/TreeTable.vue
index c97bc88..5ca4b53 100644
--- a/src/views/Components/Table/TreeTable.vue
+++ b/src/views/Components/Table/TreeTable.vue
@@ -1,7 +1,7 @@
diff --git a/src/views/Components/Table/UseTableDemo.vue b/src/views/Components/Table/UseTableDemo.vue
index 9b78a90..78c9dbf 100644
--- a/src/views/Components/Table/UseTableDemo.vue
+++ b/src/views/Components/Table/UseTableDemo.vue
@@ -30,8 +30,8 @@ const columns = reactive([
field: 'expand',
type: 'expand',
slots: {
- default: (data: TableSlotDefault[]) => {
- const { row } = data[0]
+ default: (data: TableSlotDefault) => {
+ const { row } = data
return (
diff --git a/src/views/Example/Dialog/ExampleDialog.vue b/src/views/Example/Dialog/ExampleDialog.vue
index b544247..cec4b40 100644
--- a/src/views/Example/Dialog/ExampleDialog.vue
+++ b/src/views/Example/Dialog/ExampleDialog.vue
@@ -212,13 +212,13 @@ const crudSchemas = reactive([
default: (data: any) => {
return (
<>
- action(data[0].row, 'edit')}>
+ action(data.row, 'edit')}>
{t('exampleDemo.edit')}
- action(data[0].row, 'detail')}>
+ action(data.row, 'detail')}>
{t('exampleDemo.detail')}
- delData(data[0].row)}>
+ delData(data.row)}>
{t('exampleDemo.del')}
>
diff --git a/src/views/Example/Page/ExamplePage.vue b/src/views/Example/Page/ExamplePage.vue
index b5db6c1..459e1b4 100644
--- a/src/views/Example/Page/ExamplePage.vue
+++ b/src/views/Example/Page/ExamplePage.vue
@@ -229,13 +229,13 @@ const crudSchemas = reactive([
default: (data: any) => {
return (
<>
- action(data[0].row, 'edit')}>
+ action(data.row, 'edit')}>
{t('exampleDemo.edit')}
- action(data[0].row, 'detail')}>
+ action(data.row, 'detail')}>
{t('exampleDemo.detail')}
- delData(data[0].row)}>
+ delData(data.row)}>
{t('exampleDemo.del')}
>
diff --git a/src/views/Function/MultipleTabs.vue b/src/views/Function/MultipleTabs.vue
new file mode 100644
index 0000000..4c3aa93
--- /dev/null
+++ b/src/views/Function/MultipleTabs.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
+ 打开详情页{{ item }}
+
+
+
diff --git a/src/views/Function/MultipleTabsDemo.vue b/src/views/Function/MultipleTabsDemo.vue
new file mode 100644
index 0000000..e8089bd
--- /dev/null
+++ b/src/views/Function/MultipleTabsDemo.vue
@@ -0,0 +1,14 @@
+
+
+
+ 获取参数:
+
diff --git a/stylelint.config.js b/stylelint.config.js
index 2acd479..de520a2 100644
--- a/stylelint.config.js
+++ b/stylelint.config.js
@@ -2,7 +2,7 @@ module.exports = {
root: true,
plugins: ['stylelint-order'],
customSyntax: 'postcss-html',
- extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
+ extends: ['stylelint-config-standard'],
rules: {
'selector-pseudo-class-no-unknown': [
true,
diff --git a/vite.config.ts b/vite.config.ts
index fd06ffa..86dbbcc 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -45,7 +45,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
if (name === 'click-outside') {
return ''
}
- return `element-plus/es/components/${name.substring(3)}/style/css`
+ return `element-plus/es/components/${name.replace(/^el-/, '')}/style/css`
}
}]
}),