Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-07-27 08:13:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8233750a233ecdb0df337c4b5b2e7643ce05305e
8233750a
1 parent
d45d6a9c
🐞 fix(上传图片和上传文件组件): 通过规则隐藏的必填字段需要忽略校验
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
src/components/FileUploaderField/index.vue
src/components/ImageUploaderField/index.vue
src/components/FileUploaderField/index.vue
View file @
8233750
<!--
* @Date: 2022-08-31 16:16:49
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-0
6-17 09:57:29
* @LastEditTime: 2024-0
7-27 08:08:34
* @FilePath: /data-table/src/components/FileUploaderField/index.vue
* @Description: 文件上传控件
-->
...
...
@@ -329,11 +329,15 @@ const uploadQiniu = async (file, token, name, md5) => {
// 校验模块
const validFileUploader = () => {
// 必填项 未上传文件
if (props.item.component_props.required && !fileList.value.length) {
show_empty.value = true;
} else {
if (props.item.component_props.disabled) { // 通过规则隐藏的属性,不校验
show_empty.value = false;
} else {
// 必填项 未上传文件
if (props.item.component_props.required && !fileList.value.length) {
show_empty.value = true;
} else {
show_empty.value = false;
}
}
return !show_empty.value;
};
...
...
src/components/ImageUploaderField/index.vue
View file @
8233750
<!--
* @Date: 2022-08-31 16:16:49
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-0
6-17 10:04:35
* @LastEditTime: 2024-0
7-27 08:06:38
* @FilePath: /data-table/src/components/ImageUploaderField/index.vue
* @Description: 图片上传控件
-->
...
...
@@ -361,11 +361,15 @@ const uploadQiniu = async (file, token, name, md5) => {
// 校验模块
const validImageUploader = () => {
// 必填项 未上传图片
if (props.item.component_props.required && !fileList.value.length) {
show_empty.value = true;
} else {
if (props.item.component_props.disabled) { // 通过规则隐藏的属性,不校验
show_empty.value = false;
} else {
// 必填项 未上传图片
if (props.item.component_props.required && !fileList.value.length) {
show_empty.value = true;
} else {
show_empty.value = false;
}
}
return !show_empty.value;
};
...
...
Please
register
or
login
to post a comment