Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
6a182a2c
提交
6a182a2c
authored
3月 28, 2023
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
style: 代码格式问题修复
上级
619016b3
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
20 行增加
和
38 行删除
+20
-38
themeConfig.ts
build/config/themeConfig.ts
+1
-6
index.ts
build/generate/icon/index.ts
+5
-13
utils.ts
build/utils.ts
+3
-3
styleImport.ts
build/vite/plugin/styleImport.ts
+1
-1
svgSprite.ts
build/vite/plugin/svgSprite.ts
+1
-1
theme.ts
build/vite/plugin/theme.ts
+4
-10
proxy.ts
build/vite/proxy.ts
+1
-1
pont-template.ts
pont-template.ts
+3
-2
pont-transform.ts
pont-transform.ts
+1
-1
没有找到文件。
build/config/themeConfig.ts
浏览文件 @
6a182a2c
...
...
@@ -30,12 +30,7 @@ export function getThemeColors(color?: string) {
return
[...
lightColors
,
...
modeColors
]
}
export
function
generateColors
({
color
=
primaryColor
,
mixLighten
,
mixDarken
,
tinycolor
,
}:
GenerateColorsParams
)
{
export
function
generateColors
({
color
=
primaryColor
,
mixLighten
,
mixDarken
,
tinycolor
}:
GenerateColorsParams
)
{
const
arr
=
new
Array
(
19
).
fill
(
0
)
const
lightens
=
arr
.
map
((
_t
,
i
)
=>
{
return
mixLighten
(
color
,
i
/
5
)
...
...
build/generate/icon/index.ts
浏览文件 @
6a182a2c
import
path
from
'path'
import
path
from
'
node:
path'
import
fs
from
'fs-extra'
import
inquirer
from
'inquirer'
import
colors
from
'picocolors'
...
...
@@ -30,7 +30,7 @@ async function generateIcon() {
{
type
:
'list'
,
name
:
'iconSet'
,
choices
:
choices
,
choices
,
message
:
'Select the icon set that needs to be generated?'
,
},
{
...
...
@@ -51,25 +51,17 @@ async function generateIcon() {
if
(
data
)
{
const
{
prefix
}
=
data
const
isLocal
=
useType
===
'local'
const
icons
=
Object
.
keys
(
data
.
icons
).
map
(
(
item
)
=>
`
${
isLocal
?
prefix
+
':'
:
''
}${
item
}
`
,
)
const
icons
=
Object
.
keys
(
data
.
icons
).
map
((
item
)
=>
`
${
isLocal
?
`
${
prefix
}
:`
:
''
}${
item
}
`
)
await
fs
.
writeFileSync
(
path
.
join
(
output
,
`icons.data.ts`
),
`export default
${
isLocal
?
JSON
.
stringify
(
icons
)
:
JSON
.
stringify
({
prefix
,
icons
})
}
`
,
`export default
${
isLocal
?
JSON
.
stringify
(
icons
)
:
JSON
.
stringify
({
prefix
,
icons
})}
`
,
)
prefixSet
.
push
(
prefix
)
}
}
fs
.
emptyDir
(
path
.
join
(
process
.
cwd
(),
'node_modules/.vite'
))
console
.
log
(
`✨
${
colors
.
cyan
(
`[
${
pkg
.
name
}
]`
)}
`
+
' - Icon generated successfully:'
+
`[
${
prefixSet
}
]`
,
)
console
.
log
(
`✨
${
colors
.
cyan
(
`[
${
pkg
.
name
}
]`
)}
`
+
' - Icon generated successfully:'
+
`[
${
prefixSet
}
]`
)
})
}
...
...
build/utils.ts
浏览文件 @
6a182a2c
import
fs
from
'fs'
import
path
from
'path'
import
fs
from
'
node:
fs'
import
path
from
'
node:
path'
import
dotenv
from
'dotenv'
export
function
isDevFn
(
mode
:
string
):
boolean
{
...
...
@@ -50,7 +50,7 @@ export function wrapperEnv(envConf: Recordable): ViteEnv {
*/
function
getConfFiles
()
{
const
script
=
process
.
env
.
npm_lifecycle_script
const
reg
=
new
RegExp
(
'--mode ([a-z_
\\
d]+)'
)
const
reg
=
/--mode
([
a-z_
\d]
+
)
/
const
result
=
reg
.
exec
(
script
as
string
)
as
any
if
(
result
)
{
const
mode
=
result
[
1
]
as
string
...
...
build/vite/plugin/styleImport.ts
浏览文件 @
6a182a2c
...
...
@@ -70,7 +70,7 @@ export function configStyleImportPlugin(_isBuild: boolean) {
return
ignoreList
.
includes
(
name
)
?
''
:
replaceList
.
hasOwnProperty
(
name
)
:
Object
.
prototype
.
hasOwnProperty
.
call
(
replaceList
,
name
)
?
`ant-design-vue/es/
${
replaceList
[
name
]}
/style/index`
:
`ant-design-vue/es/
${
name
}
/style/index`
},
...
...
build/vite/plugin/svgSprite.ts
浏览文件 @
6a182a2c
...
...
@@ -3,8 +3,8 @@
* https://github.com/anncwb/vite-plugin-svg-icons
*/
import
path
from
'node:path'
import
{
createSvgIconsPlugin
}
from
'vite-plugin-svg-icons'
import
path
from
'path'
export
function
configSvgIconsPlugin
(
isBuild
:
boolean
)
{
const
svgIconsPlugin
=
createSvgIconsPlugin
({
...
...
build/vite/plugin/theme.ts
浏览文件 @
6a182a2c
...
...
@@ -2,16 +2,10 @@
* Vite plugin for website theme color switching
* https://github.com/anncwb/vite-plugin-theme
*/
import
path
from
'node:path'
import
type
{
PluginOption
}
from
'vite'
import
path
from
'path'
import
{
viteThemePlugin
,
antdDarkThemePlugin
,
mixLighten
,
mixDarken
,
tinycolor
,
}
from
'vite-plugin-theme'
import
{
getThemeColors
,
generateColors
}
from
'../../config/themeConfig'
import
{
antdDarkThemePlugin
,
mixDarken
,
mixLighten
,
tinycolor
,
viteThemePlugin
}
from
'vite-plugin-theme'
import
{
generateColors
,
getThemeColors
}
from
'../../config/themeConfig'
import
{
generateModifyVars
}
from
'../../generate/generateModifyVars'
export
function
configThemePlugin
(
isBuild
:
boolean
):
PluginOption
[]
{
...
...
@@ -48,7 +42,7 @@ export function configThemePlugin(isBuild: boolean): PluginOption[] {
antdDarkThemePlugin
({
preloadFiles
:
[
path
.
resolve
(
process
.
cwd
(),
'node_modules/ant-design-vue/dist/antd.less'
),
//path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'),
//
path.resolve(process.cwd(), 'node_modules/ant-design-vue/dist/antd.dark.less'),
path
.
resolve
(
process
.
cwd
(),
'src/design/index.less'
),
],
filter
:
(
id
)
=>
(
isBuild
?
!
id
.
endsWith
(
'antd.less'
)
:
true
),
...
...
build/vite/proxy.ts
浏览文件 @
6a182a2c
...
...
@@ -22,7 +22,7 @@ export function createProxy(list: ProxyList = []) {
// https://github.com/http-party/node-http-proxy#options
ret
[
prefix
]
=
{
target
:
target
,
target
,
changeOrigin
:
true
,
ws
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
new
RegExp
(
`^
${
prefix
}
`
),
''
),
...
...
pont-template.ts
浏览文件 @
6a182a2c
// import * as Pont from 'pont-engine'
import
{
Interface
,
BaseClass
,
Property
,
CodeGenerator
}
from
'pont-engine'
import
type
{
BaseClass
,
Interface
}
from
'pont-engine'
import
{
CodeGenerator
,
Property
}
from
'pont-engine'
// 接口 API 前缀
// 通常与项目的 env 配置中的 VITE_GLOB_API_URL_PREFIX 相同
...
...
@@ -38,7 +39,7 @@ export default class BasicGenerator extends CodeGenerator {
return
`
${
requestParams
.
replace
(
'options?: any'
,
`config?: http.RequestConfig<
${
bodyTypeDef
?
bodyTypeDef
:
`Params
${
requestParams
.
includes
(
'form'
)
?
' | FormData'
:
''
}
`
bodyTypeDef
||
`Params
${
requestParams
.
includes
(
'form'
)
?
' | FormData'
:
''
}
`
}
>`
,
)}
, options?: http.RequestOptions`
}
...
...
pont-transform.ts
浏览文件 @
6a182a2c
import
{
StandardDataSource
}
from
'pont-engine'
import
type
{
StandardDataSource
}
from
'pont-engine'
export
default
function
transform
(
dataSource
:
StandardDataSource
):
StandardDataSource
{
console
.
log
(
dataSource
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论