Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
new-sing
admin-base
Commits
f341d80b
Commit
f341d80b
authored
Jan 11, 2019
by
chenfenglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统配置
parent
fe54bff4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
0 deletions
+142
-0
index.vue
src/components/config/index.vue
+131
-0
menuList.js
src/util/menuList.js
+11
-0
No files found.
src/components/config/index.vue
0 → 100644
View file @
f341d80b
<
template
>
<div>
<div
style=
"margin-top:30px;"
>
</div>
<el-tabs
v-model=
"activeName"
type=
"card"
@
tab-click=
"handleClick"
>
<el-tab-pane
label=
"新用户跳转链接"
name=
"news_user"
>
<el-form
:model=
"form"
ref=
"form"
label-width=
"100px"
class=
"demo-ruleForm"
style=
"width:600px;"
>
<el-form-item
label=
"配置信息"
prop=
"msg"
:rules=
"[
{ required: true, message: '配置信息不能为空'}, ]">
<el-input
type=
"text"
v-model
.
number=
"form.msg"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('form')"
v-if=
"!$store.state.readonly"
>
修改
</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane
label=
"分享商品ID"
name=
"share_goods"
>
<el-form
:model=
"form2"
ref=
"form2"
label-width=
"150px"
class=
"demo-ruleForm"
style=
"width:600px;"
>
<el-form-item
label=
"分享商品ID"
prop=
"msg"
:rules=
"[
{ required: true, message: '配置信息不能为空'},]" >
<el-input
type=
"text"
v-model
.
number=
"form2.msg"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"submitForm('form2')"
v-if=
"!$store.state.readonly"
>
修改
</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
</div>
</
template
>
<
script
>
import
{
getConfigListApi
,
updateConfigApi
}
from
"../../service/api"
;
export
default
{
name
:
"entrance"
,
props
:
[
"entranceObj"
],
data
()
{
return
{
activeName
:
"news_user"
,
form
:
{
msg
:
""
},
form2
:
{
msg
:
""
},
thisList
:{},
thisList2
:{},
};
},
mounted
()
{
this
.
first
();
},
filters
:
{},
methods
:
{
handleClick
(
tab
)
{
this
.
activeName
=
tab
.
name
;
if
(
tab
.
name
===
'news_user'
)
{
this
.
first
();
}
else
{
this
.
second
();
}
},
first
()
{
getConfigListApi
({
key
:
'new_user_redirect'
}).
then
(
res
=>
{
let
thisList
=
res
.
list
[
0
]
this
.
form
.
msg
=
thisList
.
desc
;
this
.
thisList
=
thisList
;
})
},
second
()
{
getConfigListApi
({
key
:
'share_goods_id'
}).
then
(
res
=>
{
let
thisList2
=
res
.
list
[
0
]
this
.
form2
.
msg
=
thisList2
.
desc
;
this
.
thisList2
=
thisList2
;
})
},
submitForm
(
formName
)
{
this
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
formName
=
"form"
){
this
.
$confirm
(
'确认配置吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
let
json
=
{
key
:
this
.
thisList
.
key
,
value
:
this
.
thisList
.
value
,
desc
:
this
.
form
.
msg
,
}
let
id
=
this
.
thisList
.
id
;
console
.
log
(
id
,
json
)
updateConfigApi
(
id
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
});
});
}
else
{
this
.
$confirm
(
'确认配置吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
let
json
=
{
key
:
this
.
thisList2
.
key
,
value
:
this
.
thisList2
.
value
,
desc
:
this
.
form2
.
msg
}
let
id
=
this
.
thisList2
.
id
;
updateConfigApi
(
id
,
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'修改成功!'
});
});
});
}
}
else
{
console
.
log
(
"error submit!!"
);
return
false
;
}
});
}
}
};
</
script
>
<
style
scoped
lang=
"less"
>
</
style
>
src/util/menuList.js
View file @
f341d80b
...
...
@@ -428,6 +428,17 @@ export default [{
component
:
e
=>
require
([
'@/components/smsRecord'
],
e
),
}
},
{
value
:
'系统配置'
,
routerName
:
'config'
,
path
:
'/config'
,
cover
:
'10-3'
,
router
:
{
path
:
'/config'
,
name
:
'config'
,
component
:
e
=>
require
([
'@/components/config'
],
e
),
}
},
]
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment