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 9c985657
authored
Sep 18, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
3bade8f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
14 deletions
src/api/publicApi.ts
src/type/index.ts
src/views/publicConfig/AddConfig.vue
src/views/publicConfig/index.vue
src/api/publicApi.ts
View file @
9c98565
...
...
@@ -44,5 +44,5 @@ const modelUrl = {
return
request
.
post
(
configUrl
.
delete
,
params
);
};
export
const
configApiisUniqueName
=
(
params
:
any
)
=>
{
return
request
.
ge
t
(
configUrl
.
isUniqueName
,
params
);
return
request
.
pos
t
(
configUrl
.
isUniqueName
,
params
);
};
\ No newline at end of file
src/type/index.ts
View file @
9c98565
...
...
@@ -98,7 +98,6 @@ export interface ModelAdd {
}
export
interface
ConfigAdd
{
name
:
string
,
remark
:
string
,
content
:
string
,
uniqueName
:
string
...
...
src/views/publicConfig/AddConfig.vue
View file @
9c98565
...
...
@@ -20,7 +20,6 @@ const editorDom = ref();
type
Props
=
{
data
:
{
id
:
number
;
name
:
string
;
uniqueName
:
string
;
content
:
string
;
remark
:
string
;
...
...
@@ -29,12 +28,11 @@ type Props = {
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
data
:
()
=>
{
return
{
id
:
0
,
name
:
""
,
uniqueName
:
""
,
content
:
""
,
remark
:
""
};
return
{
id
:
0
,
uniqueName
:
""
,
content
:
""
,
remark
:
""
};
},
});
let
ruleForm
=
reactive
({
name
:
""
,
uniqueName
:
""
,
content
:
""
,
remark
:
""
,
...
...
@@ -51,7 +49,6 @@ watch(
if
(
keysLength
>
0
)
{
isEdit
.
value
=
true
;
//编辑
ruleForm
.
name
=
val
.
name
as
string
;
ruleForm
.
uniqueName
=
val
.
uniqueName
.
slice
(
1
)
as
string
;
ruleForm
.
remark
=
val
.
remark
as
string
;
ruleForm
.
content
=
val
.
content
as
string
;
...
...
@@ -69,7 +66,6 @@ watch(
);
const
rules
=
reactive
<
FormRules
>
({
name
:
[{
required
:
true
,
message
:
"请输入公共配置项名称"
,
trigger
:
"blur"
}],
uniqueName
:
{
required
:
true
,
message
:
"请输入公共配置项标识"
,
...
...
@@ -97,7 +93,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
// 新增
if
(
!
isEdit
.
value
)
{
ruleForm
.
uniqueName
=
'@'
+
ruleForm
.
uniqueName
;
console
.
log
(
ruleForm
);
let
{
code
,
message
}
=
await
configApiAdd
(
ruleForm
);
statusCode
=
code
;
statusMessage
=
code
===
200
?
"添加成功"
:
message
;
...
...
@@ -182,15 +177,12 @@ const isUniqueName = async () => {
label-width=
"140px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"公共配置项名称"
prop=
"name"
>
<el-input
v-model=
"ruleForm.name"
maxlength=
"20"
/>
</el-form-item>
<el-form-item
label=
"公共配置项标识"
prop=
"uniqueName"
>
<el-form-item
label=
"配置项标识"
prop=
"uniqueName"
>
<el-input
v-model=
"ruleForm.uniqueName"
:disabled=
"isEdit"
@
blur=
"isUniqueName"
>
<template
#
prepend
>
@
</
template
>
</el-input>
</el-form-item>
<el-form-item
label=
"
公共
配置项内容"
prop=
"content"
>
<el-form-item
label=
"配置项内容"
prop=
"content"
>
<!-- <el-input v-model="ruleForm.content" type="textarea" /> -->
<AceEditor
class=
"ace_editor"
...
...
src/views/publicConfig/index.vue
View file @
9c98565
...
...
@@ -18,7 +18,7 @@ type Comp = Pick<tabType, "tabComp">;
const
tabData
=
reactive
<
tabType
[]
>
([
{
label
:
"公共
配置项
"
,
label
:
"公共
标识
"
,
// proxy会代理reactive中的所有内容
// 无需对组件进行proxy代理
// 必须使用markRaw跳过对组件的代理,否则vue会给警告
...
...
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