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 f10d9758
authored
Aug 31, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
接口联调
1 parent
f651bf60
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
11 deletions
src/views/projectApi/AddApi.vue
src/views/publicConfig/AddConfig.vue
src/views/publicConfig/AddModel.vue
src/views/publicConfig/index.vue
src/views/projectApi/AddApi.vue
View file @
f10d975
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<div
class=
"name"
>
模板
</div>
<div
class=
"name"
>
模板
</div>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<!-- <el-input v-model="remark" placeholder="请输入描述"> </el-input> -->
<!-- <el-input v-model="remark" placeholder="请输入描述"> </el-input> -->
<el-select
v-model=
"selectModel"
class=
"m-2"
placeholder=
"Select"
>
<el-select
v-model=
"selectModel"
@
change=
"selectModelChange"
class=
"m-2"
placeholder=
"Select"
>
<el-option
<el-option
v-for=
"item in modelList"
v-for=
"item in modelList"
:key=
"item.id"
:key=
"item.id"
...
@@ -252,6 +252,12 @@ export default defineComponent({
...
@@ -252,6 +252,12 @@ export default defineComponent({
});
});
});
});
};
};
// 切换模板
const
selectModelChange
=
(
val
:
any
)
=>
{
console
.
log
(
val
);
editorContent
.
value
=
val
editorDom
.
value
.
setEditorContent
()
}
onBeforeRouteLeave
(()
=>
{
onBeforeRouteLeave
(()
=>
{
sessionStorage
.
removeItem
(
"editApiItem"
);
sessionStorage
.
removeItem
(
"editApiItem"
);
});
});
...
@@ -271,7 +277,8 @@ export default defineComponent({
...
@@ -271,7 +277,8 @@ export default defineComponent({
clearCodeFn
,
clearCodeFn
,
disabled
,
disabled
,
selectModel
,
selectModel
,
modelList
modelList
,
selectModelChange
};
};
},
},
components
:
{
components
:
{
...
...
src/views/publicConfig/AddConfig.vue
View file @
f10d975
...
@@ -15,6 +15,8 @@ import AceEditor from "@/components/AceEditor.vue";
...
@@ -15,6 +15,8 @@ import AceEditor from "@/components/AceEditor.vue";
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
editorDom
=
ref
();
type
Props
=
{
type
Props
=
{
data
:
{
data
:
{
id
:
number
;
id
:
number
;
...
@@ -43,8 +45,6 @@ const isEdit = ref<boolean>(false);
...
@@ -43,8 +45,6 @@ const isEdit = ref<boolean>(false);
watch
(
watch
(
()
=>
props
.
data
,
()
=>
props
.
data
,
(
val
)
=>
{
(
val
)
=>
{
console
.
log
(
444
);
// 获取编辑数据
// 获取编辑数据
let
keysLength
=
Object
.
keys
(
val
).
length
;
let
keysLength
=
Object
.
keys
(
val
).
length
;
...
@@ -55,6 +55,7 @@ watch(
...
@@ -55,6 +55,7 @@ watch(
ruleForm
.
uniqueName
=
val
.
uniqueName
.
slice
(
1
)
as
string
;
ruleForm
.
uniqueName
=
val
.
uniqueName
.
slice
(
1
)
as
string
;
ruleForm
.
remark
=
val
.
remark
as
string
;
ruleForm
.
remark
=
val
.
remark
as
string
;
ruleForm
.
content
=
val
.
content
as
string
;
ruleForm
.
content
=
val
.
content
as
string
;
editorDom
.
value
?.
setEditorContent
()
}
}
},
},
{
{
...
@@ -90,7 +91,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -90,7 +91,6 @@ 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
)
{
// console.log("submit!");
//发起请求(新增或编辑)
//发起请求(新增或编辑)
let
message
;
let
message
;
let
statusCode
;
let
statusCode
;
...
@@ -127,7 +127,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -127,7 +127,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
// 删除表单
// 删除表单
const
deletConfig
=
()
=>
{
const
deletConfig
=
()
=>
{
console
.
log
(
props
.
data
.
id
);
ElMessageBox
.
confirm
(
"确认删除此公共模板吗?"
,
"删除"
,
{
ElMessageBox
.
confirm
(
"确认删除此公共模板吗?"
,
"删除"
,
{
distinguishCancelAndClose
:
true
,
distinguishCancelAndClose
:
true
,
confirmButtonText
:
"确认"
,
confirmButtonText
:
"确认"
,
...
...
src/views/publicConfig/AddModel.vue
View file @
f10d975
...
@@ -16,6 +16,8 @@ import AceEditor from "@/components/AceEditor.vue";
...
@@ -16,6 +16,8 @@ import AceEditor from "@/components/AceEditor.vue";
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
ruleFormRef
=
ref
<
FormInstance
>
();
const
editorDom
=
ref
();
type
Props
=
{
type
Props
=
{
data
:
{
data
:
{
id
:
number
;
id
:
number
;
...
@@ -42,8 +44,6 @@ const isEdit = ref<boolean>(false);
...
@@ -42,8 +44,6 @@ const isEdit = ref<boolean>(false);
watch
(
watch
(
()
=>
props
.
data
,
()
=>
props
.
data
,
(
val
)
=>
{
(
val
)
=>
{
console
.
log
(
555
);
// 获取编辑数据
// 获取编辑数据
let
keysLength
=
Object
.
keys
(
val
).
length
;
let
keysLength
=
Object
.
keys
(
val
).
length
;
if
(
keysLength
>
0
)
{
if
(
keysLength
>
0
)
{
...
@@ -52,6 +52,7 @@ watch(
...
@@ -52,6 +52,7 @@ watch(
ruleForm
.
templateName
=
val
.
templateName
as
string
;
ruleForm
.
templateName
=
val
.
templateName
as
string
;
ruleForm
.
templateContent
=
val
.
templateContent
as
string
;
ruleForm
.
templateContent
=
val
.
templateContent
as
string
;
ruleForm
.
remark
=
val
.
remark
as
string
;
ruleForm
.
remark
=
val
.
remark
as
string
;
editorDom
.
value
?.
setEditorContent
()
}
}
},
},
{
{
...
@@ -84,14 +85,12 @@ const resetForm = (formEl: FormInstance | undefined) => {
...
@@ -84,14 +85,12 @@ const resetForm = (formEl: FormInstance | undefined) => {
const
emit
=
defineEmits
([
"modelRefresh"
]);
const
emit
=
defineEmits
([
"modelRefresh"
]);
const
editorDom
=
ref
();
// 提交表单
// 提交表单
const
submitForm
=
async
(
formEl
:
FormInstance
|
undefined
)
=>
{
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
)
{
// console.log("submit!");
//发起请求(新增或编辑)
//发起请求(新增或编辑)
let
message
;
let
message
;
let
statusCode
;
let
statusCode
;
...
@@ -128,7 +127,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
...
@@ -128,7 +127,6 @@ const submitForm = async (formEl: FormInstance | undefined) => {
// 删除表单
// 删除表单
const
deletModel
=
()
=>
{
const
deletModel
=
()
=>
{
console
.
log
(
props
.
data
.
id
);
ElMessageBox
.
confirm
(
"确认删除此公共模板吗?"
,
"删除"
,
{
ElMessageBox
.
confirm
(
"确认删除此公共模板吗?"
,
"删除"
,
{
distinguishCancelAndClose
:
true
,
distinguishCancelAndClose
:
true
,
confirmButtonText
:
"确认"
,
confirmButtonText
:
"确认"
,
...
...
src/views/publicConfig/index.vue
View file @
f10d975
...
@@ -97,6 +97,7 @@ let propsData = reactive({})
...
@@ -97,6 +97,7 @@ let propsData = reactive({})
const
clickSubItem
=
(
index
:
number
,
item
:
any
)
=>
{
const
clickSubItem
=
(
index
:
number
,
item
:
any
)
=>
{
console
.
log
(
index
,
item
);
console
.
log
(
index
,
item
);
propsData
=
{...
item
}
propsData
=
{...
item
}
currentTab
.
tabComp
=
''
currentTab
.
tabComp
=
tabData
[
index
].
tabComp
;
currentTab
.
tabComp
=
tabData
[
index
].
tabComp
;
}
}
</
script
>
</
script
>
...
...
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