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 a66117bd
authored
Sep 20, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复bug
1 parent
9db3f5d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
src/views/publicConfig/AddConfig.vue
src/views/publicConfig/AddConfig.vue
View file @
a66117b
...
@@ -84,9 +84,9 @@ const rules = reactive<FormRules>({
...
@@ -84,9 +84,9 @@ const rules = reactive<FormRules>({
});
});
const
resetForm
=
()
=>
{
const
resetForm
=
()
=>
{
ruleForm
.
remark
=
''
ruleForm
.
remark
=
""
;
if
(
!
isEdit
.
value
)
{
if
(
!
isEdit
.
value
)
{
ruleForm
.
uniqueName
=
''
ruleForm
.
uniqueName
=
""
;
}
}
editorDom
.
value
?.
setValue
();
editorDom
.
value
?.
setValue
();
};
};
...
@@ -98,17 +98,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -98,17 +98,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
if
(
!
formEl
)
return
;
if
(
!
formEl
)
return
;
await
formEl
.
validate
(
async
(
valid
)
=>
{
await
formEl
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
if
(
valid
)
{
// 判断唯一标识
isUniqueName
().
then
(
async
(
result
)
=>
{
if
(
!
result
)
return
;
//发起请求(新增或编辑)
//发起请求(新增或编辑)
let
statusMessage
;
let
statusMessage
;
let
statusCode
;
let
statusCode
;
// 新增
// 新增
if
(
!
isEdit
.
value
)
{
if
(
!
isEdit
.
value
)
{
ruleForm
.
uniqueName
=
"@"
+
ruleForm
.
uniqueName
;
let
_data
=
JSON
.
parse
(
JSON
.
stringify
(
ruleForm
));
let
{
code
,
message
}
=
await
configApiAdd
(
ruleForm
);
_data
.
uniqueName
=
"@"
+
_data
.
uniqueName
;
let
{
code
,
message
}
=
await
configApiAdd
(
_data
);
statusCode
=
code
;
statusCode
=
code
;
statusMessage
=
code
===
200
?
"添加成功"
:
message
;
statusMessage
=
code
===
200
?
"添加成功"
:
message
;
}
else
{
}
else
{
...
@@ -128,7 +125,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -128,7 +125,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
}
else
{
}
else
{
ElMessage
.
error
(
statusMessage
);
ElMessage
.
error
(
statusMessage
);
}
}
});
}
}
});
});
};
};
...
...
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