Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jxf111348
vue-vben-admin
提交
29461a85
V
vue-vben-admin
项目概览
jxf111348
/
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,发现更多精彩内容 >>
提交
29461a85
编写于
12月 08, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: file upload key loss #120
上级
bae53f3e
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
29 addition
and
12 deletion
+29
-12
.env.development
.env.development
+3
-0
.env.production
.env.production
+4
-0
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+3
-0
src/api/sys/upload.ts
src/api/sys/upload.ts
+3
-4
src/components/Excel/src/Export2Excel.ts
src/components/Excel/src/Export2Excel.ts
+1
-0
src/components/Excel/src/ImportExcel.vue
src/components/Excel/src/ImportExcel.vue
+2
-1
src/components/Excel/src/types.ts
src/components/Excel/src/types.ts
+1
-0
src/components/Form/src/types/index.ts
src/components/Form/src/types/index.ts
+0
-1
src/components/Menu/src/BasicMenu.tsx
src/components/Menu/src/BasicMenu.tsx
+1
-0
src/components/Upload/src/FileList.tsx
src/components/Upload/src/FileList.tsx
+2
-2
src/hooks/setting/index.ts
src/hooks/setting/index.ts
+2
-0
src/types/config.d.ts
src/types/config.d.ts
+2
-0
src/views/demo/excel/ArrayExport.vue
src/views/demo/excel/ArrayExport.vue
+2
-2
src/views/demo/excel/JsonExport.vue
src/views/demo/excel/JsonExport.vue
+3
-2
未找到文件。
.env.development
浏览文件 @
29461a85
...
...
@@ -14,5 +14,8 @@ VITE_DROP_CONSOLE = false
# Basic interface address SPA
VITE_GLOB_API_URL=/api
# File upload address, optional
VITE_GLOB_UPLOAD_URL=/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
.env.production
浏览文件 @
29461a85
...
...
@@ -13,6 +13,10 @@ VITE_BUILD_GZIP = false
# Basic interface address SPA
VITE_GLOB_API_URL=/api
# File upload address, optional
# It can be forwarded by nginx or write the actual address directly
VITE_GLOB_UPLOAD_URL=/upload
# Interface prefix
VITE_GLOB_API_URL_PREFIX=
...
...
CHANGELOG.zh_CN.md
浏览文件 @
29461a85
...
...
@@ -11,6 +11,7 @@
-
i18n 支持 vscode
`i18n-ally`
插件
-
新增多级路由缓存示例
-
打包代码拆分(试验)
-
提取上传地址到全局变量,打包可以动态配置
### ⚡ Performance Improvements
...
...
@@ -23,6 +24,7 @@
-
升级
`ant-design-vue`
到
`2.0.0-rc.3`
-
重新引入
`vueuse`
-
移除 route meta 内的
`afterCloseLoading`
属性
-
文档更新
### 🐛 Bug Fixes
...
...
@@ -31,6 +33,7 @@
-
修复顶部菜单宽度计算问题
-
修复表格 tabSetting 问题
-
修复文件上传删除失效
-
修复表格行编辑保存错误问题
## 2.0.0-rc.12 (2020-11-30)
...
...
src/api/sys/upload.ts
浏览文件 @
29461a85
import
{
UploadApiResult
}
from
'
./model/uploadModel
'
;
import
{
defHttp
}
from
'
/@/utils/http/axios
'
;
import
{
UploadFileParams
}
from
'
/@/utils/http/axios/types
'
;
import
{
useGlobSetting
}
from
'
/@/hooks/setting
'
;
enum
Api
{
UPLOAD_URL
=
'
/upload
'
,
}
const
{
uploadUrl
=
''
}
=
useGlobSetting
();
/**
* @description: Upload interface
...
...
@@ -15,7 +14,7 @@ export function uploadApi(
)
{
return
defHttp
.
uploadFile
<
UploadApiResult
>
(
{
url
:
Api
.
UPLOAD_URL
,
url
:
uploadUrl
,
onUploadProgress
,
},
params
...
...
src/components/Excel/src/Export2Excel.ts
浏览文件 @
29461a85
...
...
@@ -31,6 +31,7 @@ export function jsonToSheetXlsx<T = any>({
writeFile
(
workbook
,
filename
,
write2excelOpts
);
/* at this point, out.xlsb will have been downloaded */
}
export
function
aoaToSheetXlsx
<
T
=
any
>
({
data
,
header
,
...
...
src/components/Excel/src/ImportExcel.vue
浏览文件 @
29461a85
...
...
@@ -17,7 +17,7 @@
import
type
{
ExcelData
}
from
'
./types
'
;
export
default
defineComponent
({
name
:
'
ImportExcel
'
,
emits
:
[
'
success
'
],
emits
:
[
'
success
'
,
'
error
'
],
setup
(
_
,
{
emit
})
{
const
inputRef
=
ref
<
HTMLInputElement
|
null
>
(
null
);
const
loadingRef
=
ref
<
Boolean
>
(
false
);
...
...
@@ -82,6 +82,7 @@
resolve
(
''
);
}
catch
(
error
)
{
reject
(
error
);
emit
(
'
error
'
);
}
finally
{
loadingRef
.
value
=
false
;
}
...
...
src/components/Excel/src/types.ts
浏览文件 @
29461a85
...
...
@@ -17,6 +17,7 @@ export interface JsonToSheet<T = any> {
json2sheetOpts
?:
JSON2SheetOpts
;
write2excelOpts
?:
WritingOptions
;
}
export
interface
AoAToSheet
<
T
=
any
>
{
data
:
T
[][];
header
?:
T
[];
...
...
src/components/Form/src/types/index.ts
浏览文件 @
29461a85
...
...
@@ -93,7 +93,6 @@ export type ComponentType =
|
'
SelectOption
'
|
'
TreeSelect
'
|
'
Transfer
'
// | 'Radio'
|
'
RadioButtonGroup
'
|
'
RadioGroup
'
|
'
Checkbox
'
...
...
src/components/Menu/src/BasicMenu.tsx
浏览文件 @
29461a85
...
...
@@ -190,6 +190,7 @@ export default defineComponent({
const
{
appendClass
}
=
props
;
const
isAppendActiveCls
=
appendClass
&&
level
===
1
&&
menu
.
path
===
unref
(
currentParentPath
);
const
levelCls
=
[
`
${
prefixCls
}
-item__level
${
level
}
`
,
`
${
menuState
.
theme
}
`
,
...
...
src/components/Upload/src/FileList.tsx
浏览文件 @
29461a85
...
...
@@ -38,9 +38,9 @@ export default defineComponent({
</
tr
>
</
thead
>
<
tbody
>
{
dataSource
.
map
((
record
=
{})
=>
{
{
dataSource
.
map
((
record
=
{}
,
index
)
=>
{
return
(
<
tr
class
=
"file-table-tr"
key
=
{
record
.
uuid
}
>
<
tr
class
=
"file-table-tr"
key
=
{
`
${
index
+
record
.
name
||
''
}
`
}
>
{
columnList
.
map
((
item
)
=>
{
const
{
dataIndex
=
''
,
customRender
,
align
=
'
center
'
}
=
item
;
const
render
=
customRender
&&
isFunction
(
customRender
);
...
...
src/hooks/setting/index.ts
浏览文件 @
29461a85
...
...
@@ -18,6 +18,7 @@ const {
VITE_GLOB_API_URL
,
VITE_GLOB_APP_SHORT_NAME
,
VITE_GLOB_API_URL_PREFIX
,
VITE_GLOB_UPLOAD_URL
,
}
=
ENV
;
if
(
!
reg
.
test
(
VITE_GLOB_APP_SHORT_NAME
))
{
...
...
@@ -33,6 +34,7 @@ export const useGlobSetting = (): Readonly<GlobConfig> => {
apiUrl
:
VITE_GLOB_API_URL
,
shortName
:
VITE_GLOB_APP_SHORT_NAME
,
urlPrefix
:
VITE_GLOB_API_URL_PREFIX
,
uploadUrl
:
VITE_GLOB_UPLOAD_URL
,
};
return
glob
as
Readonly
<
GlobConfig
>
;
};
...
...
src/types/config.d.ts
浏览文件 @
29461a85
...
...
@@ -129,6 +129,7 @@ export interface GlobConfig {
title
:
string
;
// 项目路径
apiUrl
:
string
;
uploadUrl
?:
string
;
urlPrefix
?:
string
;
shortName
:
string
;
}
...
...
@@ -139,6 +140,7 @@ export interface GlobEnvConfig {
VITE_GLOB_API_URL
:
string
;
VITE_GLOB_API_URL_PREFIX
?:
string
;
VITE_GLOB_APP_SHORT_NAME
:
string
;
VITE_GLOB_UPLOAD_URL
?:
string
;
}
interface
GlobWrap
{
...
...
src/views/demo/excel/ArrayExport.vue
浏览文件 @
29461a85
...
...
@@ -11,11 +11,11 @@
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
import
{
BasicTable
}
from
'
/@/components/Table
'
;
import
{
aoaToSheetXlsx
,
ExportExcelModel
}
from
'
/@/components/Excel
'
;
import
{
aoaToSheetXlsx
}
from
'
/@/components/Excel
'
;
import
{
arrHeader
,
arrData
,
columns
,
data
}
from
'
./data
'
;
export
default
defineComponent
({
components
:
{
BasicTable
,
ExportExcelModel
},
components
:
{
BasicTable
},
setup
()
{
function
aoaToExcel
()
{
// 保证data顺序与header一致
...
...
src/views/demo/excel/JsonExport.vue
浏览文件 @
29461a85
...
...
@@ -12,11 +12,11 @@
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
import
{
BasicTable
}
from
'
/@/components/Table
'
;
import
{
jsonToSheetXlsx
,
ExportExcelModel
}
from
'
/@/components/Excel
'
;
import
{
jsonToSheetXlsx
}
from
'
/@/components/Excel
'
;
import
{
columns
,
data
}
from
'
./data
'
;
export
default
defineComponent
({
components
:
{
BasicTable
,
ExportExcelModel
},
components
:
{
BasicTable
},
setup
()
{
function
defaultHeader
()
{
// 默认Object.keys(data[0])作为header
...
...
@@ -25,6 +25,7 @@
filename
:
'
使用key作为默认头部.xlsx
'
,
});
}
function
customHeader
()
{
jsonToSheetXlsx
({
data
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录