Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
custom_form
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
2023-04-04 15:40:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
40d5574688b2b56104a91037fda2277a4671ff24
40d55746
1 parent
17d9c1de
✨ feat: 添加错误滚动功能
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
12 deletions
src/components/CheckboxField/index.vue
src/components/MultiRuleField/index.vue
src/components/RadioField/index.vue
src/components/TextField/index.vue
src/components/TextareaField/index.vue
src/pages/table/index.vue
src/components/CheckboxField/index.vue
View file @
40d5574
<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 1
1:03:21
* @LastEditTime: 2023-04-04 1
5:11:55
* @FilePath: /custom_form/src/components/CheckboxField/index.vue
* @Description: 多项选择控件
-->
...
...
@@ -142,7 +142,7 @@ const validCheckbox = () => {
return !show_error.value;
};
defineExpose({ validCheckbox });
defineExpose({ validCheckbox
, id: props.item.key
});
</script>
<style lang="less">
...
...
src/components/MultiRuleField/index.vue
View file @
40d5574
<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 15:0
0:16
* @LastEditTime: 2023-04-04 15:0
7:00
* @FilePath: /custom_form/src/components/MultiRuleField/index.vue
* @Description: 多选规则确认控件
-->
...
...
@@ -136,7 +136,7 @@ const validMultiRule= () => {
return !show_error.value;
};
defineExpose({ validMultiRule });
defineExpose({ validMultiRule
, id: props.item.key
});
</script>
<style lang="less">
...
...
src/components/RadioField/index.vue
View file @
40d5574
<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 1
4:58:27
* @LastEditTime: 2023-04-04 1
5:11:44
* @FilePath: /custom_form/src/components/RadioField/index.vue
* @Description: 单项选择控件
-->
...
...
@@ -156,7 +156,7 @@ const validRadio = () => {
return !show_error.value;
};
defineExpose({ validRadio });
defineExpose({ validRadio
, id: props.item.key
});
</script>
<style lang="less">
...
...
src/components/TextField/index.vue
View file @
40d5574
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-0
3 13:31:03
* @LastEditTime: 2023-04-0
4 15:11:19
* @FilePath: /custom_form/src/components/TextField/index.vue
* @Description: 单行文本输入框(微信扫描功能)
-->
...
...
@@ -168,7 +168,7 @@ const validInput = () => {
return !show_error.value;
};
defineExpose({ validInput });
defineExpose({ validInput
, id: props.item.key
});
</script>
<style lang="less">
...
...
src/components/TextareaField/index.vue
View file @
40d5574
<!--
* @Date: 2022-08-29 14:31:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-0
3 14:07:03
* @LastEditTime: 2023-04-0
4 15:11:32
* @FilePath: /custom_form/src/components/TextareaField/index.vue
* @Description: 多行文本输入框
-->
...
...
@@ -86,7 +86,7 @@ const validTextarea = () => {
return !show_error.value;
};
defineExpose({ validTextarea });
defineExpose({ validTextarea
, id: props.item.key
});
</script>
<style lang="less">
...
...
src/pages/table/index.vue
View file @
40d5574
<!--
* @Date: 2023-03-24 09:19:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-04-04 1
4:38:13
* @LastEditTime: 2023-04-04 1
5:38:07
* @FilePath: /custom_form/src/pages/table/index.vue
* @Description: 文件描述
-->
...
...
@@ -428,6 +428,7 @@ const validOther = () => {
let valid = {
status: true,
key: "",
id: ''
};
if (input.value) {
// 单行文本
...
...
@@ -436,6 +437,7 @@ const validOther = () => {
valid = {
status: input.value[index].validInput(),
key: "input",
id: multi_rule.value[index].id
};
return false;
}
...
...
@@ -448,6 +450,7 @@ const validOther = () => {
valid = {
status: textarea.value[index].validTextarea(),
key: "textarea",
id: multi_rule.value[index].id
};
return false;
}
...
...
@@ -460,6 +463,7 @@ const validOther = () => {
valid = {
status: radio.value[index].validRadio(),
key: "radio",
id: multi_rule.value[index].id
};
return false;
}
...
...
@@ -472,6 +476,7 @@ const validOther = () => {
valid = {
status: checkbox.value[index].validCheckbox(),
key: "checkbox",
id: multi_rule.value[index].id
};
return false;
}
...
...
@@ -484,6 +489,7 @@ const validOther = () => {
valid = {
status: multi_rule.value[index].validMultiRule(),
key: "multi_rule",
id: multi_rule.value[index].id
};
return false;
}
...
...
@@ -592,7 +598,13 @@ const onSubmit = async (values) => {
}
}
} else {
console.warn(validOther().key + "不通过验证");
console.warn(validOther().id + ' ' + validOther().key + "不通过验证");
if (validOther().id) {
Taro.pageScrollTo({
selector: `#${validOther().id}`,
duration: 300
})
}
// // 图片上传控件报错提示
// if (validOther().key === "image_uploader") {
// showFailToast("图片上传为空");
...
...
@@ -610,6 +622,7 @@ const onSubmit = async (values) => {
background-color: #FAF9DC;
min-height: calc(100vh);
position: relative;
overflow: auto;
}
.table-title {
padding: 30px;
...
...
Please
register
or
login
to post a comment