Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
b54b7942
提交
b54b7942
authored
4月 01, 2021
作者:
Vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(table): make sure the editing line is working, fix #439
上级
8a14069e
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
172 行增加
和
29 行删除
+172
-29
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+2
-0
BasicTable.vue
src/components/Table/src/BasicTable.vue
+1
-1
useTable.ts
src/components/Table/src/hooks/useTable.ts
+6
-1
useTitle.ts
src/hooks/web/useTitle.ts
+15
-8
dashboard.ts
src/locales/lang/en/routes/dashboard.ts
+1
-1
dashboard.ts
src/locales/lang/zh_CN/routes/dashboard.ts
+1
-1
about.ts
src/router/menus/modules/about.ts
+5
-5
about.ts
src/router/routes/modules/about.ts
+10
-11
FormTable.vue
src/views/demo/table/FormTable.vue
+10
-1
index.vue
src/views/sys/about/index.vue
+102
-0
global.d.ts
types/global.d.ts
+10
-0
vite.config.ts
vite.config.ts
+9
-0
没有找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
b54b7942
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
-
新增
`headerTitle`
slot
-
新增
`headerTitle`
slot
-
新增打印示例
-
新增打印示例
-
新增关于界面
### ✨ Refactor
### ✨ Refactor
...
@@ -15,6 +16,7 @@
...
@@ -15,6 +16,7 @@
-
确保面包屑正确的显示图标
-
确保面包屑正确的显示图标
-
修复 tinymce 上传按钮全屏模式下消失问题
-
修复 tinymce 上传按钮全屏模式下消失问题
-
确保 title 在重新登录后正常改变
## 2.1.1 (2021-03-26)
## 2.1.1 (2021-03-26)
...
...
src/components/Table/src/BasicTable.vue
浏览文件 @
b54b7942
...
@@ -185,7 +185,7 @@
...
@@ -185,7 +185,7 @@
}
=
useTableForm
(
getProps
,
slots
,
fetch
);
}
=
useTableForm
(
getProps
,
slots
,
fetch
);
const
getBindValues
=
computed
(()
=>
{
const
getBindValues
=
computed
(()
=>
{
const
dataSource
=
toRaw
(
unref
(
getDataSourceRef
)
);
const
dataSource
=
unref
(
getDataSourceRef
);
let
propsData
:
Recordable
=
{
let
propsData
:
Recordable
=
{
size
:
'middle'
,
size
:
'middle'
,
// ...(dataSource.length === 0 ? { getPopupContainer: () => document.body } : {}),
// ...(dataSource.length === 0 ? { getPopupContainer: () => document.body } : {}),
...
...
src/components/Table/src/hooks/useTable.ts
浏览文件 @
b54b7942
...
@@ -17,7 +17,12 @@ type UseTableMethod = TableActionType & {
...
@@ -17,7 +17,12 @@ type UseTableMethod = TableActionType & {
export
function
useTable
(
export
function
useTable
(
tableProps
?:
Props
tableProps
?:
Props
):
[(
instance
:
TableActionType
,
formInstance
:
UseTableMethod
)
=>
void
,
TableActionType
]
{
):
[
(
instance
:
TableActionType
,
formInstance
:
UseTableMethod
)
=>
void
,
TableActionType
&
{
getForm
:
()
=>
FormActionType
;
}
]
{
const
tableRef
=
ref
<
Nullable
<
TableActionType
>>
(
null
);
const
tableRef
=
ref
<
Nullable
<
TableActionType
>>
(
null
);
const
loadedRef
=
ref
<
Nullable
<
boolean
>>
(
false
);
const
loadedRef
=
ref
<
Nullable
<
boolean
>>
(
false
);
const
formRef
=
ref
<
Nullable
<
UseTableMethod
>>
(
null
);
const
formRef
=
ref
<
Nullable
<
UseTableMethod
>>
(
null
);
...
...
src/hooks/web/useTitle.ts
浏览文件 @
b54b7942
import
{
watch
,
unref
}
from
'vue'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
useTitle
as
usePageTitle
}
from
'@vueuse/core'
;
import
{
useTitle
as
usePageTitle
}
from
'@vueuse/core'
;
import
{
useGlobSetting
}
from
'/@/hooks/setting'
;
import
{
useGlobSetting
}
from
'/@/hooks/setting'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
REDIRECT_NAME
}
from
'/@/router/constant'
;
import
{
REDIRECT_NAME
}
from
'/@/router/constant'
;
import
{
listenerRouteChange
}
from
'/@/logics/mitt/routeChange'
;
export
function
useTitle
()
{
export
function
useTitle
()
{
const
{
title
}
=
useGlobSetting
();
const
{
title
}
=
useGlobSetting
();
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
{
currentRoute
}
=
useRouter
();
const
pageTitle
=
usePageTitle
();
const
pageTitle
=
usePageTitle
();
listenerRouteChange
((
route
)
=>
{
watch
(
if
(
route
.
name
===
REDIRECT_NAME
)
{
()
=>
currentRoute
.
value
.
path
,
return
;
()
=>
{
}
const
route
=
unref
(
currentRoute
);
if
(
route
.
name
===
REDIRECT_NAME
)
{
return
;
}
const
tTitle
=
t
(
route
?.
meta
?.
title
as
string
);
const
tTitle
=
t
(
route
?.
meta
?.
title
as
string
);
pageTitle
.
value
=
tTitle
?
`
${
tTitle
}
-
${
title
}
`
:
`
${
title
}
`
;
pageTitle
.
value
=
tTitle
?
`
${
tTitle
}
-
${
title
}
`
:
`
${
title
}
`
;
});
},
{
immediate
:
true
}
);
}
}
src/locales/lang/en/routes/dashboard.ts
浏览文件 @
b54b7942
export
default
{
export
default
{
dashboard
:
'Dashboard'
,
dashboard
:
'Dashboard'
,
welcome
:
'Home
'
,
about
:
'About
'
,
workbench
:
'Workbench'
,
workbench
:
'Workbench'
,
analysis
:
'Analysis'
,
analysis
:
'Analysis'
,
};
};
src/locales/lang/zh_CN/routes/dashboard.ts
浏览文件 @
b54b7942
export
default
{
export
default
{
dashboard
:
'Dashboard'
,
dashboard
:
'Dashboard'
,
welcome
:
'首页
'
,
about
:
'关于
'
,
workbench
:
'工作台'
,
workbench
:
'工作台'
,
analysis
:
'分析页'
,
analysis
:
'分析页'
,
};
};
src/router/menus/modules/
home
.ts
→
src/router/menus/modules/
about
.ts
浏览文件 @
b54b7942
import
type
{
MenuModule
}
from
'/@/router/types'
;
import
type
{
MenuModule
}
from
'/@/router/types'
;
import
{
t
}
from
'/@/hooks/web/useI18n'
;
import
{
t
}
from
'/@/hooks/web/useI18n'
;
const
menu
:
MenuModule
=
{
const
about
:
MenuModule
=
{
orderNo
:
0
,
orderNo
:
10000
0
,
menu
:
{
menu
:
{
path
:
'/
home/welcome
'
,
path
:
'/
about/index
'
,
name
:
t
(
'routes.dashboard.
welcome
'
),
name
:
t
(
'routes.dashboard.
about
'
),
},
},
};
};
export
default
menu
;
export
default
about
;
src/router/routes/modules/
home
.ts
→
src/router/routes/modules/
about
.ts
浏览文件 @
b54b7942
...
@@ -4,23 +4,22 @@ import { LAYOUT } from '/@/router/constant';
...
@@ -4,23 +4,22 @@ import { LAYOUT } from '/@/router/constant';
import
{
t
}
from
'/@/hooks/web/useI18n'
;
import
{
t
}
from
'/@/hooks/web/useI18n'
;
const
dashboard
:
AppRouteModule
=
{
const
dashboard
:
AppRouteModule
=
{
path
:
'/
home
'
,
path
:
'/
about
'
,
name
:
'
Home
'
,
name
:
'
About
'
,
component
:
LAYOUT
,
component
:
LAYOUT
,
redirect
:
'/
home/welcome
'
,
redirect
:
'/
about/index
'
,
meta
:
{
meta
:
{
icon
:
'
ion:home-outlin
e'
,
icon
:
'
simple-icons:about-dot-m
e'
,
title
:
t
(
'routes.dashboard.
welcome
'
),
title
:
t
(
'routes.dashboard.
about
'
),
},
},
children
:
[
children
:
[
{
{
path
:
'
welcome
'
,
path
:
'
index
'
,
name
:
'
Welcom
e'
,
name
:
'
AboutPag
e'
,
component
:
()
=>
import
(
'/@/views/
dashboard/welcome
/index.vue'
),
component
:
()
=>
import
(
'/@/views/
sys/about
/index.vue'
),
meta
:
{
meta
:
{
title
:
t
(
'routes.dashboard.welcome'
),
title
:
t
(
'routes.dashboard.about'
),
affix
:
true
,
icon
:
'simple-icons:about-dot-me'
,
icon
:
'bx:bx-home'
,
},
},
},
},
],
],
...
...
src/views/demo/table/FormTable.vue
浏览文件 @
b54b7942
<
template
>
<
template
>
<BasicTable
@
register=
"registerTable"
>
<BasicTable
@
register=
"registerTable"
>
<template
#
form-custom
>
custom-slot
</
template
>
<template
#
form-custom
>
custom-slot
</
template
>
<
template
#
toolbar
>
<a-button
type=
"primary"
@
click=
"getFormValues"
>
获取表单数据
</a-button>
</
template
>
</BasicTable>
</BasicTable>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
...
@@ -13,7 +17,7 @@
...
@@ -13,7 +17,7 @@
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
BasicTable
},
components
:
{
BasicTable
},
setup
()
{
setup
()
{
const
[
registerTable
]
=
useTable
({
const
[
registerTable
,
{
getForm
}
]
=
useTable
({
title
:
'开启搜索区域'
,
title
:
'开启搜索区域'
,
api
:
demoListApi
,
api
:
demoListApi
,
columns
:
getBasicColumns
(),
columns
:
getBasicColumns
(),
...
@@ -23,8 +27,13 @@
...
@@ -23,8 +27,13 @@
rowSelection
:
{
type
:
'checkbox'
},
rowSelection
:
{
type
:
'checkbox'
},
});
});
function
getFormValues
()
{
console
.
log
(
getForm
().
getFieldsValue
());
}
return
{
return
{
registerTable
,
registerTable
,
getFormValues
,
};
};
},
},
});
});
...
...
src/views/sys/about/index.vue
0 → 100644
浏览文件 @
b54b7942
<
template
>
<PageWrapper
title=
"关于"
>
<template
#
headerContent
>
<div
class=
"flex justify-between items-center"
>
<span
class=
"flex-1"
>
<a
:href=
"GITHUB_URL"
target=
"_blank"
>
{{
name
}}
</a>
是一个基于Vue3.0、Vite、 Ant-Design-Vue 、TypeScript
的后台解决方案,目标是为中大型项目开发,提供现成的开箱解决方案及丰富的示例,原则上不会限制任何代码用于商用。
</span>
</div>
</
template
>
<Description
@
register=
"infoRegister"
/>
<Description
@
register=
"register"
class=
"my-4"
/>
<Description
@
register=
"registerDev"
/>
</PageWrapper>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
h
}
from
'vue'
;
import
{
Tag
}
from
'ant-design-vue'
;
import
{
PageWrapper
}
from
'/@/components/Page'
;
import
{
Description
,
DescItem
,
useDescription
}
from
'/@/components/Description/index'
;
import
{
GITHUB_URL
,
SITE_URL
,
DOC_URL
}
from
'/@/settings/siteSetting'
;
export
default
defineComponent
({
name
:
'AboutPage'
,
components
:
{
Description
,
PageWrapper
},
setup
()
{
const
{
pkg
,
lastBuildTime
}
=
window
.
__APP_INFO__
;
const
{
dependencies
,
devDependencies
,
name
,
version
}
=
pkg
;
const
schema
:
DescItem
[]
=
[];
const
devSchema
:
DescItem
[]
=
[];
const
commonTagRender
=
(
color
:
string
)
=>
(
curVal
)
=>
h
(
Tag
,
{
color
},
()
=>
curVal
);
const
commonLinkRender
=
(
text
:
string
)
=>
(
href
)
=>
h
(
'a'
,
{
href
,
target
:
'_blank'
},
text
);
const
infoSchema
:
DescItem
[]
=
[
{
label
:
'版本'
,
field
:
'version'
,
render
:
commonTagRender
(
'blue'
),
},
{
label
:
'最后编译时间'
,
field
:
'lastBuildTime'
,
render
:
commonTagRender
(
'blue'
),
},
{
label
:
'文档地址'
,
field
:
'doc'
,
render
:
commonLinkRender
(
'文档地址'
),
},
{
label
:
'预览地址'
,
field
:
'preview'
,
render
:
commonLinkRender
(
'预览地址'
),
},
{
label
:
'Github'
,
field
:
'github'
,
render
:
commonLinkRender
(
'Github'
),
},
];
const
infoData
=
{
version
,
lastBuildTime
,
doc
:
DOC_URL
,
preview
:
SITE_URL
,
github
:
GITHUB_URL
,
};
Object
.
keys
(
dependencies
).
forEach
((
key
)
=>
{
schema
.
push
({
field
:
key
,
label
:
key
});
});
Object
.
keys
(
devDependencies
).
forEach
((
key
)
=>
{
devSchema
.
push
({
field
:
key
,
label
:
key
});
});
const
[
register
]
=
useDescription
({
title
:
'生产环境依赖'
,
data
:
dependencies
,
schema
:
schema
,
column
:
3
,
});
const
[
registerDev
]
=
useDescription
({
title
:
'开发环境依赖'
,
data
:
devDependencies
,
schema
:
devSchema
,
column
:
3
,
});
const
[
infoRegister
]
=
useDescription
({
title
:
'项目信息'
,
data
:
infoData
,
schema
:
infoSchema
,
column
:
2
,
});
return
{
register
,
registerDev
,
infoRegister
,
name
,
GITHUB_URL
};
},
});
</
script
>
types/global.d.ts
浏览文件 @
b54b7942
...
@@ -10,6 +10,16 @@ declare global {
...
@@ -10,6 +10,16 @@ declare global {
declare
interface
Window
{
declare
interface
Window
{
// Global vue app instance
// Global vue app instance
__APP__
:
App
<
Element
>
;
__APP__
:
App
<
Element
>
;
__APP_INFO__
:
{
pkg
:
{
name
:
string
;
version
:
string
;
dependencies
:
Recordable
<
string
>
;
devDependencies
:
Recordable
<
string
>
;
};
lastBuildTime
:
string
;
};
}
}
// vue
// vue
...
...
vite.config.ts
浏览文件 @
b54b7942
...
@@ -9,6 +9,13 @@ import { createAlias } from './build/vite/alias';
...
@@ -9,6 +9,13 @@ import { createAlias } from './build/vite/alias';
import
{
wrapperEnv
}
from
'./build/utils'
;
import
{
wrapperEnv
}
from
'./build/utils'
;
import
{
createVitePlugins
}
from
'./build/vite/plugin'
;
import
{
createVitePlugins
}
from
'./build/vite/plugin'
;
import
{
OUTPUT_DIR
}
from
'./build/constant'
;
import
{
OUTPUT_DIR
}
from
'./build/constant'
;
import
pkg
from
'./package.json'
;
import
moment
from
'moment'
;
const
APP_INFO
=
{
pkg
,
lastBuildTime
:
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
};
export
default
({
command
,
mode
}:
ConfigEnv
):
UserConfig
=>
{
export
default
({
command
,
mode
}:
ConfigEnv
):
UserConfig
=>
{
const
root
=
process
.
cwd
();
const
root
=
process
.
cwd
();
...
@@ -58,6 +65,8 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
...
@@ -58,6 +65,8 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
__VUE_I18N_LEGACY_API__
:
false
,
__VUE_I18N_LEGACY_API__
:
false
,
__VUE_I18N_FULL_INSTALL__
:
false
,
__VUE_I18N_FULL_INSTALL__
:
false
,
__INTLIFY_PROD_DEVTOOLS__
:
false
,
__INTLIFY_PROD_DEVTOOLS__
:
false
,
__APP_INFO__
:
JSON
.
stringify
(
APP_INFO
),
},
},
css
:
{
css
:
{
preprocessorOptions
:
{
preprocessorOptions
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论