Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
陆宇天
/
config-center-front
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6710e433
authored
Sep 20, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改重置
1 parent
51a89c5c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
src/views/publicConfig/AddConfig.vue
src/views/publicConfig/AddModel.vue
src/views/publicConfig/AddConfig.vue
View file @
6710e43
...
@@ -83,9 +83,11 @@ const rules = reactive<FormRules>({
...
@@ -83,9 +83,11 @@ const rules = reactive<FormRules>({
remark
:
{
required
:
true
,
message
:
"请输入描述"
,
trigger
:
"blur"
},
remark
:
{
required
:
true
,
message
:
"请输入描述"
,
trigger
:
"blur"
},
});
});
const
resetForm
=
(
formEl
:
FormInstance
|
undefined
)
=>
{
const
resetForm
=
()
=>
{
if
(
!
formEl
)
return
;
ruleForm
.
remark
=
''
formEl
.
resetFields
();
if
(
!
isEdit
.
value
)
{
ruleForm
.
uniqueName
=
''
}
editorDom
.
value
?.
setValue
();
editorDom
.
value
?.
setValue
();
};
};
...
@@ -98,7 +100,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -98,7 +100,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if
(
valid
)
{
if
(
valid
)
{
// 判断唯一标识
// 判断唯一标识
isUniqueName
().
then
(
async
(
result
)
=>
{
isUniqueName
().
then
(
async
(
result
)
=>
{
console
.
log
(
result
);
if
(
!
result
)
return
;
if
(
!
result
)
return
;
//发起请求(新增或编辑)
//发起请求(新增或编辑)
...
...
src/views/publicConfig/AddModel.vue
View file @
6710e43
...
@@ -81,9 +81,9 @@ const rules = reactive<FormRules>({
...
@@ -81,9 +81,9 @@ const rules = reactive<FormRules>({
});
});
// 重置表单
// 重置表单
const
resetForm
=
(
formEl
:
FormInstance
|
undefined
)
=>
{
const
resetForm
=
()
=>
{
if
(
!
formEl
)
return
;
ruleForm
.
remark
=
''
formEl
.
resetFields
();
ruleForm
.
templateName
=
''
editorDom
.
value
?.
setValue
();
editorDom
.
value
?.
setValue
();
};
};
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment