Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
91e004e2
Commit
91e004e2
authored
Feb 05, 2021
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(upload): fix maxNumber not work #240
parent
22088e82
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
5 deletions
+18
-5
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
themeConfig.ts
build/config/themeConfig.ts
+1
-0
BasicUpload.vue
src/components/Upload/src/BasicUpload.vue
+6
-1
UploadModal.vue
src/components/Upload/src/UploadModal.vue
+9
-3
data.tsx
src/components/Upload/src/data.tsx
+1
-1
No files found.
CHANGELOG.zh_CN.md
View file @
91e004e2
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
### 🐛 Bug Fixes
### 🐛 Bug Fixes
-
修复菜单在 hmr 时数据被置空
-
修复菜单在 hmr 时数据被置空
-
修复 Upload 组件 maxNumber 失效问题
## 2.0.0-rc.18 (2021-02-05)
## 2.0.0-rc.18 (2021-02-05)
...
...
build/config/themeConfig.ts
View file @
91e004e2
import
{
generate
}
from
'
@ant-design/colors
'
;
import
{
generate
}
from
'
@ant-design/colors
'
;
export
const
primaryColor
=
'
#0084f4
'
;
export
const
primaryColor
=
'
#0084f4
'
;
export
const
themeMode
=
'
light
'
;
export
const
themeMode
=
'
light
'
;
...
...
src/components/Upload/src/BasicUpload.vue
View file @
91e004e2
...
@@ -20,7 +20,12 @@
...
@@ -20,7 +20,12 @@
</Tooltip>
</Tooltip>
</a-button-group>
</a-button-group>
<UploadModal
v-bind=
"bindValue"
@
register=
"registerUploadModal"
@
change=
"handleChange"
/>
<UploadModal
v-bind=
"bindValue"
:previewFileList=
"fileListRef"
@
register=
"registerUploadModal"
@
change=
"handleChange"
/>
<UploadPreviewModal
<UploadPreviewModal
:value=
"fileListRef"
:value=
"fileListRef"
...
...
src/components/Upload/src/UploadModal.vue
View file @
91e004e2
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</BasicModal>
</BasicModal>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
reactive
,
ref
,
toRefs
,
unref
,
computed
}
from
'
vue
'
;
import
{
defineComponent
,
reactive
,
ref
,
toRefs
,
unref
,
computed
,
PropType
}
from
'
vue
'
;
import
{
Upload
,
Alert
}
from
'
ant-design-vue
'
;
import
{
Upload
,
Alert
}
from
'
ant-design-vue
'
;
import
{
BasicModal
,
useModalInner
}
from
'
/@/components/Modal
'
;
import
{
BasicModal
,
useModalInner
}
from
'
/@/components/Modal
'
;
// import { BasicTable, useTable } from '/@/components/Table';
// import { BasicTable, useTable } from '/@/components/Table';
...
@@ -63,7 +63,13 @@
...
@@ -63,7 +63,13 @@
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
BasicModal
,
Upload
,
Alert
,
FileList
},
components
:
{
BasicModal
,
Upload
,
Alert
,
FileList
},
props
:
basicProps
,
props
:
{
...
basicProps
,
previewFileList
:
{
type
:
Array
as
PropType
<
string
[]
>
,
default
:
()
=>
[],
},
},
emits
:
[
'
change
'
,
'
register
'
],
emits
:
[
'
change
'
,
'
register
'
],
setup
(
props
,
{
emit
})
{
setup
(
props
,
{
emit
})
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
...
@@ -206,7 +212,7 @@
...
@@ -206,7 +212,7 @@
// 点击开始上传
// 点击开始上传
async
function
handleStartUpload
()
{
async
function
handleStartUpload
()
{
const
{
maxNumber
}
=
props
;
const
{
maxNumber
}
=
props
;
if
(
fileListRef
.
value
.
length
>
maxNumber
)
{
if
(
(
fileListRef
.
value
.
length
+
props
.
previewFileList
?.
length
??
0
)
>
maxNumber
)
{
return
createMessage
.
warning
(
t
(
'
component.upload.maxNumber
'
,
[
maxNumber
]));
return
createMessage
.
warning
(
t
(
'
component.upload.maxNumber
'
,
[
maxNumber
]));
}
}
try
{
try
{
...
...
src/components/Upload/src/data.tsx
View file @
91e004e2
...
@@ -156,7 +156,7 @@ export function createPreviewActionColumn({
...
@@ -156,7 +156,7 @@ export function createPreviewActionColumn({
// onClick: handlePreview.bind(null, record),
// onClick: handlePreview.bind(null, record),
// });
// });
// }
// }
return
<
TableAction
actions=
{
actions
}
/>;
return
<
TableAction
actions=
{
actions
}
outside=
{
true
}
/>;
},
},
};
};
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment