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
cfb2884e
Commit
cfb2884e
authored
Aug 31, 2018
by
王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公众号bug
parent
4e44ee79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
17 deletions
+65
-17
index.vue
src/components/weChat/index.vue
+54
-11
weChatResource.vue
src/components/weChat/weChatResource.vue
+11
-6
No files found.
src/components/weChat/index.vue
View file @
cfb2884e
...
...
@@ -54,8 +54,8 @@
<div
class=
"menu_form_hd flex-bt"
>
<h4
class=
"global_info"
>
{{
selectedItem
&&
selectedItem
.
name
}}
</h4>
<div
class=
"global_extra"
>
<a
v-if=
"selectedChildIndex === -1"
href=
"javascript:void(0);"
>
删除菜单
</a>
<a
v-else
href=
"javascript:void(0);"
>
删除子菜单
</a>
<a
v-if=
"selectedChildIndex === -1"
href=
"javascript:void(0);"
@
click=
"delMenu"
>
删除菜单
</a>
<a
v-else
href=
"javascript:void(0);"
@
click=
"delSubMenu"
>
删除子菜单
</a>
</div>
</div>
<div
class=
"menu_form_bd"
id=
"view"
>
...
...
@@ -121,6 +121,7 @@
<
script
>
import
{
getPublicMenuApi
,
savePublicMenuApi
}
from
"../../service/api"
;
import
{
MessageBox
}
from
'element-ui'
;
export
default
{
name
:
"index"
,
data
(){
...
...
@@ -184,19 +185,33 @@
getPublicMenuApi
().
then
(
res
=>
{
if
(
res
.
menu
&&
res
.
menu
.
button
)
{
this
.
buttonList
=
res
.
menu
.
button
let
selectedMenu
=
this
.
buttonList
[
this
.
selectedIndex
]
let
subButton
=
selectedMenu
.
sub_button
this
.
selectedItem
=
{
name
:
'子菜单名'
,
sub_button
:
[],
type
:
'view'
,
url
:
''
}
subB
utton
.
push
(
this
.
selectedItem
)
this
.
selectedChildIndex
=
subB
utton
.
length
-
1
this
.
buttonList
[
this
.
selectedIndex
].
sub_b
utton
.
push
(
this
.
selectedItem
)
this
.
selectedChildIndex
=
this
.
buttonList
[
this
.
selectedIndex
].
sub_b
utton
.
length
-
1
}
})
},
delSubMenu
(){
this
.
$confirm
(
'此操作将删除该子菜单?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
getPublicMenuApi
().
then
(
res
=>
{
if
(
res
.
menu
&&
res
.
menu
.
button
)
{
this
.
buttonList
=
res
.
menu
.
button
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
.
splice
(
this
.
selectedChildIndex
,
1
)
this
.
selectedChildIndex
=
this
.
buttonList
[
this
.
selectedIndex
].
sub_button
.
length
-
1
this
.
selectedItem
=
this
.
selectedChildIndex
>
-
1
?
this
.
buttonList
[
this
.
selectedIndex
][
this
.
selectedChildIndex
]
:
this
.
buttonList
[
this
.
selectedIndex
]
}
});
});
},
onAddMenu
(){
getPublicMenuApi
().
then
(
res
=>
{
if
(
res
.
menu
&&
res
.
menu
.
button
)
{
...
...
@@ -213,6 +228,26 @@
}
})
},
delMenu
(){
this
.
$confirm
(
'此操作将删除该菜单?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
getPublicMenuApi
().
then
(
res
=>
{
if
(
res
.
menu
&&
res
.
menu
.
button
)
{
this
.
buttonList
=
res
.
menu
.
button
this
.
buttonList
.
splice
(
this
.
selectedIndex
,
1
)
this
.
selectedItem
=
this
.
buttonList
.
length
>
0
?
this
.
buttonList
[
0
]
:
{
name
:
'菜单名'
,
sub_button
:
[],
type
:
'view'
,
url
:
''
}
this
.
selectedChildIndex
=
-
1
}
})
});
},
onTypeChange
(
val
){
console
.
log
(
'onTypeChange'
,
val
)
},
...
...
@@ -228,11 +263,19 @@
buttons
:
JSON
.
stringify
(
buttonList
)
}
savePublicMenuApi
(
json
).
then
(
res
=>
{
this
.
$message
({
type
:
'success'
,
message
:
'保存成功!'
});
this
.
getMenu
();
if
(
res
.
errcode
===
0
){
this
.
$message
({
type
:
'success'
,
message
:
'保存成功!'
});
this
.
getMenu
();
}
else
{
MessageBox
({
title
:
'错误!'
,
message
:
res
.
errmsg
,
type
:
'error'
,
})
}
})
}
...
...
src/components/weChat/weChatResource.vue
View file @
cfb2884e
...
...
@@ -28,10 +28,9 @@
class=
"upload-demo"
ref=
"upload"
action=
"/api/public/upload/zone"
:data=
"uploadParam"
:show-file-list=
"false"
:on-success=
"handleUploadSuccess"
>
:http-request=
"uploadFile"
:show-file-list=
"false"
>
<!--:on-success="handleUploadSuccess"-->
<el-button
style=
"order:2;"
slot=
"trigger"
size=
"small"
type=
"primary"
>
选取文件
</el-button>
<!--
<div
slot=
"tip"
class=
"el-upload__tip"
>
大小不超过5M
</div>
-->
</el-upload>
...
...
@@ -66,9 +65,9 @@
</template>
<
script
>
import
{
getMediaListApi
}
from
"../../service/api"
;
import
{
getMediaListApi
,
uploadFileApi
}
from
"../../service/api"
;
export
default
{
name
:
"
weChatR
esource"
,
name
:
"
r
esource"
,
data
()
{
return
{
mediaList
:
[],
...
...
@@ -119,6 +118,12 @@
if
(
res
.
code
===
200
)
{
this
.
imageList
=
[{
name
:
res
.
data
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
data
.
url
}]
}
},
uploadFile
(
a
)
{
this
.
$store
.
dispatch
(
'setProgress'
,{
type
:
'new'
,
id
:
a
.
file
.
uid
});
uploadFileApi
({
file
:
a
.
file
,
type
:
'wechat'
}).
then
(
res
=>
{
this
.
imageList
=
[{
name
:
res
.
data
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
data
.
url
}]
})
}
}
}
...
...
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