Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Dr.Disrespect
vue-vben-admin
提交
4c16ffa3
V
vue-vben-admin
项目概览
Dr.Disrespect
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4c16ffa3
编写于
5月 12, 2021
作者:
Z
zuihou
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/main'
上级
56d8af14
a7c8c67c
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
1917 addition
and
534 deletion
+1917
-534
build/vite/plugin/styleImport.ts
build/vite/plugin/styleImport.ts
+2
-2
package.json
package.json
+28
-28
src/components/CodeEditor/src/CodeEditor.vue
src/components/CodeEditor/src/CodeEditor.vue
+5
-1
src/components/Modal/src/BasicModal.vue
src/components/Modal/src/BasicModal.vue
+3
-1
src/components/Qrcode/src/index.vue
src/components/Qrcode/src/index.vue
+11
-7
src/components/Qrcode/src/types.ts
src/components/Qrcode/src/types.ts
+5
-0
src/components/Table/src/hooks/useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+3
-4
src/locales/setupI18n.ts
src/locales/setupI18n.ts
+5
-0
src/locales/useLocale.ts
src/locales/useLocale.ts
+4
-0
src/utils/env.ts
src/utils/env.ts
+1
-1
src/views/demo/comp/qrcode/index.vue
src/views/demo/comp/qrcode/index.vue
+33
-0
vite.config.ts
vite.config.ts
+1
-1
yarn.lock
yarn.lock
+1816
-489
未找到文件。
build/vite/plugin/styleImport.ts
浏览文件 @
4c16ffa3
...
...
@@ -7,7 +7,7 @@ import styleImport from 'vite-plugin-style-import';
export
function
configStyleImportPlugin
(
isBuild
:
boolean
)
{
if
(
!
isBuild
)
return
[];
const
pwa
Plugin
=
styleImport
({
const
styleImport
Plugin
=
styleImport
({
libs
:
[
{
libraryName
:
'
ant-design-vue
'
,
...
...
@@ -18,5 +18,5 @@ export function configStyleImportPlugin(isBuild: boolean) {
},
],
});
return
pwa
Plugin
;
return
styleImport
Plugin
;
}
package.json
浏览文件 @
4c16ffa3
...
...
@@ -32,17 +32,17 @@
"postinstall"
:
"npm run install:husky"
},
"dependencies"
:
{
"
@iconify/iconify
"
:
"
^2.0.0
-rc.6
"
,
"
@logicflow/core
"
:
"
^0.3.
4
"
,
"
@logicflow/extension
"
:
"
^0.3.
4
"
,
"
@vueuse/core
"
:
"
^4.9.
0
"
,
"
@iconify/iconify
"
:
"
^2.0.0
"
,
"
@logicflow/core
"
:
"
^0.3.
6
"
,
"
@logicflow/extension
"
:
"
^0.3.
6
"
,
"
@vueuse/core
"
:
"
^4.9.
2
"
,
"
@zxcvbn-ts/core
"
:
"
^0.3.0
"
,
"
ant-design-vue
"
:
"
^2.1.3
"
,
"
axios
"
:
"
^0.21.1
"
,
"
codemirror
"
:
"
^5.61.0
"
,
"
cropperjs
"
:
"
^1.5.11
"
,
"
crypto-js
"
:
"
^4.0.0
"
,
"
echarts
"
:
"
^5.1.
0
"
,
"
echarts
"
:
"
^5.1.
1
"
,
"
lodash-es
"
:
"
^4.17.21
"
,
"
mockjs
"
:
"
^1.1.0
"
,
"
nprogress
"
:
"
^0.2.0
"
,
...
...
@@ -51,7 +51,7 @@
"
print-js
"
:
"
^1.6.0
"
,
"
qrcode
"
:
"
^1.4.4
"
,
"
sortablejs
"
:
"
^1.13.0
"
,
"
tinymce
"
:
"
^5.
7.1
"
,
"
tinymce
"
:
"
^5.
8.0
"
,
"
vditor
"
:
"
^3.8.4
"
,
"
vue
"
:
"
3.0.11
"
,
"
vue-i18n
"
:
"
9.0.0
"
,
...
...
@@ -63,9 +63,9 @@
"devDependencies"
:
{
"
@commitlint/cli
"
:
"
^12.1.1
"
,
"
@commitlint/config-conventional
"
:
"
^12.1.1
"
,
"
@iconify/json
"
:
"
^1.1.3
33
"
,
"
@iconify/json
"
:
"
^1.1.3
40
"
,
"
@purge-icons/generated
"
:
"
^0.7.0
"
,
"
@types/codemirror
"
:
"
^
0.0.109
"
,
"
@types/codemirror
"
:
"
^
5.60.0
"
,
"
@types/crypto-js
"
:
"
^4.0.1
"
,
"
@types/fs-extra
"
:
"
^9.0.11
"
,
"
@types/inquirer
"
:
"
^7.3.1
"
,
...
...
@@ -75,59 +75,59 @@
"
@types/qrcode
"
:
"
^1.4.0
"
,
"
@types/qs
"
:
"
^6.9.6
"
,
"
@types/sortablejs
"
:
"
^1.10.6
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.22.
0
"
,
"
@typescript-eslint/parser
"
:
"
^4.22.
0
"
,
"
@vitejs/plugin-legacy
"
:
"
^1.3.
2
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^4.22.
1
"
,
"
@typescript-eslint/parser
"
:
"
^4.22.
1
"
,
"
@vitejs/plugin-legacy
"
:
"
^1.3.
3
"
,
"
@vitejs/plugin-vue
"
:
"
^1.2.2
"
,
"
@vitejs/plugin-vue-jsx
"
:
"
^1.1.
3
"
,
"
@vitejs/plugin-vue-jsx
"
:
"
^1.1.
4
"
,
"
@vue/compiler-sfc
"
:
"
3.0.11
"
,
"
autoprefixer
"
:
"
^10.2.5
"
,
"
commitizen
"
:
"
^4.2.
3
"
,
"
commitizen
"
:
"
^4.2.
4
"
,
"
conventional-changelog-cli
"
:
"
^2.1.1
"
,
"
cross-env
"
:
"
^7.0.3
"
,
"
dotenv
"
:
"
^
8.2.0
"
,
"
eslint
"
:
"
^7.2
5
.0
"
,
"
dotenv
"
:
"
^
9.0.1
"
,
"
eslint
"
:
"
^7.2
6
.0
"
,
"
eslint-config-prettier
"
:
"
^8.3.0
"
,
"
eslint-define-config
"
:
"
^1.0.8
"
,
"
eslint-plugin-prettier
"
:
"
^3.4.0
"
,
"
eslint-plugin-vue
"
:
"
^7.9.0
"
,
"
esno
"
:
"
^0.5.0
"
,
"
fs-extra
"
:
"
^
9.1
.0
"
,
"
fs-extra
"
:
"
^
10.0
.0
"
,
"
http-server
"
:
"
^0.12.3
"
,
"
husky
"
:
"
^6.0.0
"
,
"
inquirer
"
:
"
^8.0.0
"
,
"
is-ci
"
:
"
^3.0.0
"
,
"
less
"
:
"
^4.1.1
"
,
"
lint-staged
"
:
"
^1
0.5.4
"
,
"
postcss
"
:
"
^8.2.1
2
"
,
"
lint-staged
"
:
"
^1
1.0.0
"
,
"
postcss
"
:
"
^8.2.1
4
"
,
"
prettier
"
:
"
^2.2.1
"
,
"
pretty-quick
"
:
"
^3.1.0
"
,
"
rimraf
"
:
"
^3.0.2
"
,
"
rollup-plugin-visualizer
"
:
"
5.
3.4
"
,
"
stylelint
"
:
"
^13.13.
0
"
,
"
rollup-plugin-visualizer
"
:
"
5.
5.0
"
,
"
stylelint
"
:
"
^13.13.
1
"
,
"
stylelint-config-prettier
"
:
"
^8.0.2
"
,
"
stylelint-config-standard
"
:
"
^22.0.0
"
,
"
stylelint-order
"
:
"
^4.1.0
"
,
"
ts-node
"
:
"
^9.1.1
"
,
"
typescript
"
:
"
4.2.4
"
,
"
vite
"
:
"
2.2.
3
"
,
"
vite-plugin-compression
"
:
"
^0.2.
4
"
,
"
vite
"
:
"
2.2.
4
"
,
"
vite-plugin-compression
"
:
"
^0.2.
5
"
,
"
vite-plugin-html
"
:
"
^2.0.7
"
,
"
vite-plugin-imagemin
"
:
"
^0.3.
0
"
,
"
vite-plugin-imagemin
"
:
"
^0.3.
2
"
,
"
vite-plugin-mock
"
:
"
^2.5.0
"
,
"
vite-plugin-purge-icons
"
:
"
^0.7.0
"
,
"
vite-plugin-pwa
"
:
"
^0.7.
2
"
,
"
vite-plugin-pwa
"
:
"
^0.7.
3
"
,
"
vite-plugin-style-import
"
:
"
^0.10.0
"
,
"
vite-plugin-svg-icons
"
:
"
^0.
4.3
"
,
"
vite-plugin-svg-icons
"
:
"
^0.
5.0
"
,
"
vite-plugin-theme
"
:
"
^0.7.1
"
,
"
vite-plugin-windicss
"
:
"
0.1
4.6
"
,
"
vite-plugin-windicss
"
:
"
0.1
5.10
"
,
"
vue-eslint-parser
"
:
"
^7.6.0
"
,
"
vue-tsc
"
:
"
^0.
0.25
"
"
vue-tsc
"
:
"
^0.
1.2
"
},
"resolutions"
:
{
"//"
:
"Used to install imagemin dependencies, because imagemin may not be installed in China.If it is abroad, you can delete it"
,
"bin-wrapper"
:
"npm:bin-wrapper-china"
,
"rollup"
:
"^2.4
5.2
"
"rollup"
:
"^2.4
7.0
"
},
"repository"
:
{
"type"
:
"git"
,
...
...
src/components/CodeEditor/src/CodeEditor.vue
浏览文件 @
4c16ffa3
<
template
>
<div
class=
"h-full"
>
<CodeMirrorEditor
:value=
"getValue"
@
change=
"handleValueChange"
:mode=
"mode"
/>
<CodeMirrorEditor
:value=
"getValue"
@
change=
"handleValueChange"
:mode=
"mode"
:readonly=
"readonly"
/>
</div>
</
template
>
<
script
lang=
"ts"
>
...
...
@@ -24,6 +24,10 @@
type
:
String
,
default
:
MODE
.
JSON
,
},
readonly
:
{
type
:
Boolean
,
default
:
false
,
},
},
emits
:
[
'
change
'
],
setup
(
props
,
{
emit
})
{
...
...
src/components/Modal/src/BasicModal.vue
浏览文件 @
4c16ffa3
...
...
@@ -122,12 +122,14 @@
wrapClassName
:
toRef
(
getMergeProps
.
value
,
'
wrapClassName
'
),
});
// modal component does not need title
// modal component does not need title
and origin buttons
const
getProps
=
computed
(
():
ModalProps
=>
{
const
opt
=
{
...
unref
(
getMergeProps
),
visible
:
unref
(
visibleRef
),
okButtonProps
:
undefined
,
cancelButtonProps
:
undefined
,
title
:
undefined
,
};
return
{
...
...
src/components/Qrcode/src/index.vue
浏览文件 @
4c16ffa3
...
...
@@ -8,6 +8,7 @@
import
{
toCanvas
,
QRCodeRenderersOptions
,
LogoType
}
from
'
./qrcodePlus
'
;
import
{
toDataURL
}
from
'
qrcode
'
;
import
{
downloadByUrl
}
from
'
/@/utils/file/download
'
;
import
{
QrcodeDoneEventParams
}
from
'
./types
'
;
export
default
defineComponent
({
name
:
'
QrCode
'
,
...
...
@@ -38,10 +39,9 @@
validator
:
(
v
:
string
)
=>
[
'
canvas
'
,
'
img
'
].
includes
(
v
),
},
},
emits
:
{
done
:
(
url
:
string
)
=>
!!
url
,
error
:
(
error
:
any
)
=>
!!
error
},
emits
:
{
done
:
(
data
:
QrcodeDoneEventParams
)
=>
!!
data
,
error
:
(
error
:
any
)
=>
!!
error
},
setup
(
props
,
{
emit
})
{
const
wrapRef
=
ref
<
HTMLCanvasElement
|
HTMLImageElement
|
null
>
(
null
);
const
urlRef
=
ref
<
string
>
(
''
);
async
function
createQrcode
()
{
try
{
const
{
tag
,
value
,
options
=
{},
width
,
logo
}
=
props
;
...
...
@@ -58,8 +58,7 @@
content
:
renderValue
,
options
:
options
||
{},
});
urlRef
.
value
=
url
;
emit
(
'
done
'
,
url
);
emit
(
'
done
'
,
{
url
,
ctx
:
(
wrapEl
as
HTMLCanvasElement
).
getContext
(
'
2d
'
)
});
return
;
}
...
...
@@ -70,8 +69,7 @@
...
options
,
});
(
unref
(
wrapRef
)
as
HTMLImageElement
).
src
=
url
;
urlRef
.
value
=
url
;
emit
(
'
done
'
,
url
);
emit
(
'
done
'
,
{
url
});
}
}
catch
(
error
)
{
emit
(
'
error
'
,
error
);
...
...
@@ -81,7 +79,13 @@
* file download
*/
function
download
(
fileName
?:
string
)
{
const
url
=
unref
(
urlRef
);
let
url
=
''
;
const
wrapEl
=
unref
(
wrapRef
);
if
(
wrapEl
instanceof
HTMLCanvasElement
)
{
url
=
wrapEl
.
toDataURL
();
}
else
if
(
wrapEl
instanceof
HTMLImageElement
)
{
url
=
wrapEl
.
src
;
}
if
(
!
url
)
return
;
downloadByUrl
({
url
,
...
...
src/components/Qrcode/src/types.ts
浏览文件 @
4c16ffa3
...
...
@@ -31,3 +31,8 @@ export type ToCanvasFn = (options: RenderQrCodeParams) => Promise<unknown>;
export
interface
QrCodeActionType
{
download
:
(
fileName
?:
string
)
=>
void
;
}
export
interface
QrcodeDoneEventParams
{
url
:
string
;
ctx
?:
CanvasRenderingContext2D
|
null
;
}
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
4c16ffa3
...
...
@@ -113,7 +113,7 @@ export function useColumns(
let
cacheColumns
=
unref
(
propsRef
).
columns
;
const
getColumnsRef
=
computed
(()
=>
{
const
columns
=
unref
(
columnsRef
);
const
columns
=
cloneDeep
(
unref
(
columnsRef
)
);
handleIndexColumn
(
propsRef
,
getPaginationRef
,
columns
);
handleActionColumn
(
propsRef
,
columns
);
...
...
@@ -122,8 +122,7 @@ export function useColumns(
}
const
{
ellipsis
}
=
unref
(
propsRef
);
const
cloneColumns
=
cloneDeep
(
columns
);
cloneColumns
.
forEach
((
item
)
=>
{
columns
.
forEach
((
item
)
=>
{
const
{
customRender
,
slots
}
=
item
;
handleItem
(
...
...
@@ -131,7 +130,7 @@ export function useColumns(
Reflect
.
has
(
item
,
'
ellipsis
'
)
?
!!
item
.
ellipsis
:
!!
ellipsis
&&
!
customRender
&&
!
slots
);
});
return
c
loneC
olumns
;
return
columns
;
});
function
isIfShow
(
column
:
BasicColumn
):
boolean
{
...
...
src/locales/setupI18n.ts
浏览文件 @
4c16ffa3
...
...
@@ -3,6 +3,7 @@ import type { I18n, I18nOptions } from 'vue-i18n';
import
{
createI18n
}
from
'
vue-i18n
'
;
import
{
setLoadLocalePool
}
from
'
./useLocale
'
;
import
{
localeSetting
}
from
'
/@/settings/localeSetting
'
;
import
{
useLocaleStoreWithOut
}
from
'
/@/store/modules/locale
'
;
...
...
@@ -16,6 +17,10 @@ async function createI18nOptions(): Promise<I18nOptions> {
const
defaultLocal
=
await
import
(
`./lang/
${
locale
}
.ts`
);
const
message
=
defaultLocal
.
default
?.
message
??
{};
setLoadLocalePool
((
loadLocalePool
)
=>
{
loadLocalePool
.
push
(
locale
);
});
return
{
legacy
:
false
,
locale
,
...
...
src/locales/useLocale.ts
浏览文件 @
4c16ffa3
...
...
@@ -17,6 +17,10 @@ interface LangModule {
const
loadLocalePool
:
LocaleType
[]
=
[];
export
function
setLoadLocalePool
(
cb
:
(
loadLocalePool
:
LocaleType
[])
=>
void
)
{
cb
(
loadLocalePool
);
}
function
setI18nLanguage
(
locale
:
LocaleType
)
{
const
localeStore
=
useLocaleStoreWithOut
();
...
...
src/utils/env.ts
浏览文件 @
4c16ffa3
...
...
@@ -30,7 +30,7 @@ export function getAppEnvConfig() {
VITE_GLOB_UPLOAD_URL
,
}
=
ENV
;
if
(
!
/
[
a-zA-Z
\_]
*
/
.
test
(
VITE_GLOB_APP_SHORT_NAME
))
{
if
(
!
/
^
[
a-zA-Z
\_]
*$
/
.
test
(
VITE_GLOB_APP_SHORT_NAME
))
{
warn
(
`VITE_GLOB_APP_SHORT_NAME Variables can only be characters/underscores, please modify in the environment variables and re-running.`
);
...
...
src/views/demo/comp/qrcode/index.vue
浏览文件 @
4c16ffa3
...
...
@@ -58,6 +58,19 @@
<CollapseContainer
title=
"配置大小示例"
class=
"text-center qrcode-demo-item"
>
<QrCode
:value=
"qrCodeUrl"
:width=
"300"
/>
</CollapseContainer>
<CollapseContainer
title=
"扩展绘制示例"
class=
"text-center qrcode-demo-item"
>
<QrCode
:value=
"qrCodeUrl"
:width=
"200"
:options=
"
{ margin: 5 }"
ref="qrDiyRef"
:logo="LogoImg"
@done="onQrcodeDone"
/>
<a-button
class=
"mb-2"
type=
"primary"
@
click=
"downloadDiy"
>
下载
</a-button>
<div
class=
"msg"
>
要进行扩展绘制则不能将tag设为img
</div>
</CollapseContainer>
</div>
</PageWrapper>
</
template
>
...
...
@@ -73,16 +86,36 @@
components
:
{
CollapseContainer
,
QrCode
,
PageWrapper
},
setup
()
{
const
qrRef
=
ref
<
Nullable
<
QrCodeActionType
>>
(
null
);
const
qrDiyRef
=
ref
<
Nullable
<
QrCodeActionType
>>
(
null
);
function
download
()
{
const
qrEl
=
unref
(
qrRef
);
if
(
!
qrEl
)
return
;
qrEl
.
download
(
'
文件名
'
);
}
function
downloadDiy
()
{
const
qrEl
=
unref
(
qrDiyRef
);
if
(
!
qrEl
)
return
;
qrEl
.
download
(
'
Qrcode
'
);
}
function
onQrcodeDone
({
ctx
})
{
if
(
ctx
instanceof
CanvasRenderingContext2D
)
{
// 额外绘制
ctx
.
fillStyle
=
'
black
'
;
ctx
.
font
=
'
16px "微软雅黑"
'
;
ctx
.
textBaseline
=
'
bottom
'
;
ctx
.
textAlign
=
'
center
'
;
ctx
.
fillText
(
'
你帅你先扫
'
,
100
,
195
,
200
);
}
}
return
{
onQrcodeDone
,
qrCodeUrl
,
LogoImg
,
download
,
downloadDiy
,
qrRef
,
qrDiyRef
,
};
},
});
...
...
vite.config.ts
浏览文件 @
4c16ffa3
...
...
@@ -69,7 +69,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
},
// Turning off brotliSize display can slightly reduce packaging time
brotliSize
:
false
,
chunkSizeWarningLimit
:
15
00
,
chunkSizeWarningLimit
:
20
00
,
},
define
:
{
// setting vue-i18-next
...
...
yarn.lock
浏览文件 @
4c16ffa3
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录