Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
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
罗超
confucius
Commits
11811f64
Commit
11811f64
authored
Apr 07, 2021
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
9ebdf5e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
58 deletions
+76
-58
webkit.js
src/api/system/webkit.js
+12
-0
webmenu-form.vue
src/components/system/webmenu-form.vue
+64
-58
No files found.
src/api/system/webkit.js
View file @
11811f64
...
...
@@ -84,3 +84,15 @@ export function SetWebMenu(data) {
})
}
/**
* 获取网站菜单详情
*
*/
export
function
GetWebMenu
(
data
)
{
return
request
({
url
:
'/WebManager/GetWebMenu'
,
method
:
'post'
,
data
})
}
src/components/system/webmenu-form.vue
View file @
11811f64
...
...
@@ -10,18 +10,18 @@
<q-input
filled
stack-label
maxlength=
"20"
:dense=
"false"
v-model=
"objOption.Name"
ref=
"Name"
class=
"col-6 q-pr-lg q-pb-lg"
label=
"菜单名称"
:rules=
"[val => !!val || '请填写菜单名称']"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"objOption.MenuUrl"
ref=
"MenuUrl"
class=
"col-6 q-pb-lg"
label=
"菜单地址"
/>
<q-input
stack-label
maxlength=
"200"
:dense=
"false"
v-model=
"objOption.ParentId"
class=
"col-6 q-pr-lg q-pb-lg"
class=
"col-6 q-pb-lg"
label=
"菜单地址"
:rules=
"[val => !!val || '请填写菜单地址']"
/>
<q-select
class=
"col-6 q-pr-lg q-pb-lg"
v-model=
"objOption.MenuLevel"
:options=
"MenuLevelOpts"
emit-value
map-options
label=
"菜单等级"
/>
<q-input
stack-label
maxlength=
"200"
:dense=
"false"
v-model=
"objOption.ParentId"
class=
"col-6 q-pb-lg"
label=
"父级Id"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
@
keyup
.
native=
"checkInteger(objOption,'MenuLevel')"
v-model=
"objOption.MenuLevel"
ref=
"MenuLevel"
class=
"col-6 q-pb-lg"
label=
"菜单等级"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
v-model=
"objOption.ClassName"
ref=
"ClassName"
class=
"col-6 q-pb-lg q-pr-lg"
label=
"班级名称"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
@
keyup
.
native=
"checkInteger(objOption,'SortNum')"
v-model=
"objOption.SortNum"
ref=
"SortNum"
class=
"col-6 q-pb-lg"
label=
"排序"
/>
<q-input
filled
stack-label
maxlength=
"100"
:dense=
"false"
@
keyup
.
native=
"checkInteger(objOption,'SortNum')"
v-model=
"objOption.SortNum"
ref=
"SortNum"
class=
"col-6 q-pb-lg"
label=
"排序"
/>
<div
class=
"col-6 q-pb-lg q-pr-lg"
>
<q-uploader
:style=
"
{ backgroundImage: 'url(' + objOption.Icon + ')' }" style="width:auto;height:200px"
flat
hide-upload-btn max-files="1" label="菜单图标" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
<q-uploader
:style=
"
{ backgroundImage: 'url(' + objOption.Icon + ')' }" style="width:auto;height:200px"
flat
hide-upload-btn max-files="1" label="菜单图标" accept=".jpg, image/*" :factory="uploadFile" auto-upload>
</q-uploader>
</div>
</div>
...
...
@@ -38,9 +38,8 @@
<
script
>
import
{
GetNavTypeList
,
SetWebMenu
,
GetWeb
Nav
GetWeb
Menu
}
from
'../../api/system/webkit'
import
{
UploadSelfFile
...
...
@@ -55,9 +54,23 @@
data
()
{
return
{
//菜单等级
MenuLevelOpts
:
[],
//菜单类型
NavTypeList
:
[],
MenuLevelOpts
:
[{
label
:
'全部'
,
value
:
-
1
},
{
label
:
'一级'
,
value
:
1
},
{
label
:
'二级'
,
value
:
2
},
{
label
:
'三级'
,
value
:
3
}
],
persistent
:
true
,
objOption
:
{
Id
:
0
,
...
...
@@ -65,9 +78,9 @@
MenuUrl
:
''
,
ParentId
:
0
,
MenuLevel
:
''
,
ClassName
:
''
,
Icon
:
''
,
SortNum
:
''
ClassName
:
''
,
Icon
:
''
,
SortNum
:
''
},
optionTitle
:
""
,
//菜单列表
...
...
@@ -76,24 +89,9 @@
}
},
mounted
()
{
this
.
initNavType
();
this
.
initObj
()
},
methods
:
{
//初始化下拉框
initNavType
()
{
GetNavTypeList
().
then
(
res
=>
{
if
(
res
.
Code
==
1
)
{
this
.
NavTypeList
=
res
.
Data
;
}
else
{
this
.
$q
.
notify
({
type
:
'negative'
,
position
:
"top"
,
message
:
res
.
Message
})
}
})
},
uploadFile
(
files
)
{
UploadSelfFile
(
"course"
,
files
[
0
],
res
=>
{
if
(
res
.
Code
==
1
)
{
...
...
@@ -104,26 +102,30 @@
//初始化表单
initObj
()
{
if
(
this
.
saveObj
&&
this
.
saveObj
.
Id
>
0
)
{
GetWeb
Nav
({
GetWeb
Menu
({
Id
:
this
.
saveObj
.
Id
}).
then
(
res
=>
{
console
.
log
(
res
,
'数据'
);
this
.
objOption
.
Id
=
res
.
Data
.
Id
;
this
.
objOption
.
NavTitle
=
res
.
Data
.
NavTitle
;
this
.
objOption
.
SubTitle
=
res
.
Data
.
SubTitle
;
this
.
objOption
.
BgImg
=
res
.
Data
.
BgImg
;
this
.
objOption
.
LinkUrl
=
res
.
Data
.
LinkUrl
;
this
.
objOption
.
NavType
=
res
.
Data
.
NavType
;
this
.
objOption
.
Name
=
res
.
Data
.
Name
;
this
.
objOption
.
MenuUrl
=
res
.
Data
.
MenuUrl
;
this
.
objOption
.
ParentId
=
res
.
Data
.
ParentId
;
this
.
objOption
.
MenuLevel
=
res
.
Data
.
MenuLevel
;
this
.
objOption
.
ClassName
=
res
.
Data
.
ClassName
;
this
.
objOption
.
Icon
=
res
.
Data
.
Icon
;
this
.
objOption
.
SortNum
=
res
.
Data
.
SortNum
;
})
this
.
optionTitle
=
"修改网站
导航
信息"
this
.
optionTitle
=
"修改网站
菜单
信息"
}
else
{
this
.
optionTitle
=
"新增网站
导航
信息"
this
.
optionTitle
=
"新增网站
菜单
信息"
this
.
objOption
.
Id
=
0
;
this
.
objOption
.
NavTitle
=
''
;
this
.
objOption
.
SubTitle
=
''
;
this
.
objOption
.
BgImg
=
''
;
this
.
objOption
.
LinkUrl
=
''
;
this
.
objOption
.
NavType
=
0
;
this
.
objOption
.
Name
=
''
;
this
.
objOption
.
MenuUrl
=
''
;
this
.
objOption
.
ParentId
=
0
;
this
.
objOption
.
MenuLevel
=
0
;
this
.
objOption
.
ClassName
=
''
;
this
.
objOption
.
Icon
=
''
;
this
.
objOption
.
SortNum
=
0
;
}
},
//关闭弹窗
...
...
@@ -133,21 +135,25 @@
},
//保存菜单
saveWebkitMenu
()
{
this
.
saveLoading
=
true
SetWebMenu
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
this
.
$refs
.
Name
.
validate
();
this
.
$refs
.
MenuUrl
.
validate
();
if
(
!
this
.
$refs
.
Name
.
hasError
&&
!
this
.
$refs
.
MenuUrl
.
hasError
)
{
this
.
saveLoading
=
true
SetWebMenu
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveLoading
=
false
})
this
.
$emit
(
"success"
)
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveLoading
=
false
})
}
}
},
}
...
...
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