Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
95999d5b
authored
Sep 16, 2019
by
hanjixin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜单类型启用与关闭
parent
a4d27570
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
src/api/Menu.js
+1
-1
src/views/template/template-add-detail.vue
+3
-1
src/views/template/template-type.vue
+20
-10
No files found.
src/api/Menu.js
View file @
95999d5b
...
@@ -136,7 +136,7 @@ export function typeUpdateTagInfo(tagId, tagName) {
...
@@ -136,7 +136,7 @@ export function typeUpdateTagInfo(tagId, tagName) {
* @param {*} typeMenuType
* @param {*} typeMenuType
* 根据类型id修改状态
* 根据类型id修改状态
*/
*/
export
function
typeUpdateType
(
typeMenuId
,
typeMenuType
)
{
export
function
typeUpdateType
(
typeMenuId
,
typeMenuType
=
'OPEN'
)
{
return
request
({
return
request
({
url
:
'/type/update/type'
,
url
:
'/type/update/type'
,
method
:
'post'
,
method
:
'post'
,
...
...
src/views/template/template-add-detail.vue
View file @
95999d5b
...
@@ -340,7 +340,7 @@ export default {
...
@@ -340,7 +340,7 @@ export default {
if
(
id
)
{
if
(
id
)
{
getDetail
(
this
.
$route
.
query
.
templateId
).
then
(
response
=>
{
getDetail
(
this
.
$route
.
query
.
templateId
).
then
(
response
=>
{
const
tempData
=
JSON
.
parse
(
JSON
.
stringify
(
response
))
const
tempData
=
JSON
.
parse
(
JSON
.
stringify
(
response
))
tempData
.
templateShow
=
tempData
.
templateShow
.
toUpperCase
()
tempData
.
templateShow
=
tempData
.
templateShow
&&
tempData
.
templateShow
.
toUpperCase
()
tempData
.
templateProportion1
=
tempData
.
templateProportion
&&
tempData
.
templateProportion
.
split
(
'/'
)[
0
]
tempData
.
templateProportion1
=
tempData
.
templateProportion
&&
tempData
.
templateProportion
.
split
(
'/'
)[
0
]
tempData
.
templateProportion2
=
tempData
.
templateProportion
&&
tempData
.
templateProportion
.
split
(
'/'
)[
1
]
tempData
.
templateProportion2
=
tempData
.
templateProportion
&&
tempData
.
templateProportion
.
split
(
'/'
)[
1
]
this
.
temp
=
Object
.
assign
(
this
.
temp
,
tempData
)
this
.
temp
=
Object
.
assign
(
this
.
temp
,
tempData
)
...
@@ -406,6 +406,7 @@ export default {
...
@@ -406,6 +406,7 @@ export default {
duration
:
2000
duration
:
2000
})
})
this
.
getTempalteDetail
()
this
.
getTempalteDetail
()
this
.
$router
.
back
()
})
})
}
else
{
}
else
{
templateAdd
(
uploadTemp
).
then
(()
=>
{
templateAdd
(
uploadTemp
).
then
(()
=>
{
...
@@ -415,6 +416,7 @@ export default {
...
@@ -415,6 +416,7 @@ export default {
type
:
'success'
,
type
:
'success'
,
duration
:
2000
duration
:
2000
})
})
this
.
$router
.
back
()
})
})
}
}
}
}
...
...
src/views/template/template-type.vue
View file @
95999d5b
...
@@ -90,14 +90,22 @@
...
@@ -90,14 +90,22 @@
>
>
删除
删除
</el-button>
</el-button>
<!--
<el-button
type=
"info"
<el-button
v-if=
"row.typeMenuType === 'OPEN'"
type=
"info"
size=
"mini"
size=
"mini"
@
click=
"handleProhibit(row)"
>
@
click=
"handleProhibit(row)"
>
禁用
禁用
</el-button>
-->
</el-button>
<!--
<el-button
type=
"info"
size=
"mini"
@
click=
"handleUpdate(row)"
>
<el-button
v-else
type=
"info"
size=
"mini"
@
click=
"handleProhibit(row)"
>
启用
启用
</el-button>
-->
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -186,7 +194,7 @@
...
@@ -186,7 +194,7 @@
<
script
>
<
script
>
import
{
fetchPv
,
updateArticle
}
from
'@/api/article'
import
{
fetchPv
,
updateArticle
}
from
'@/api/article'
import
{
getTypeList
,
typeAdd
,
typeDel
}
from
'@/api/menu'
import
{
getTypeList
,
typeAdd
,
typeDel
,
typeUpdateType
}
from
'@/api/menu'
import
waves
from
'@/directive/waves'
// waves directive
import
waves
from
'@/directive/waves'
// waves directive
import
Pagination
from
'@/components/Pagination'
// secondary package based on el-pagination
import
Pagination
from
'@/components/Pagination'
// secondary package based on el-pagination
...
@@ -359,17 +367,19 @@ export default {
...
@@ -359,17 +367,19 @@ export default {
})
})
},
},
handleProhibit
(
row
)
{
handleProhibit
(
row
)
{
this
.
$confirm
(
'是否确认禁用?'
,
'提示'
,
{
const
str
=
row
.
typeMenuType
===
'OPEN'
?
'禁用'
:
'启用'
this
.
$confirm
(
`是否确认
${
str
}
?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
})
})
.
then
(()
=>
{
.
then
(()
=>
{
const
index
=
this
.
list
.
indexOf
(
row
)
typeUpdateType
(
row
.
typeId
,
row
.
typeMenuType
===
'OPEN'
?
'CLOSE'
:
'OPEN'
).
then
(()
=>
{
this
.
list
.
splice
(
index
,
1
)
row
.
typeMenuType
=
(
row
.
typeMenuType
===
'OPEN'
?
'CLOSE'
:
'OPEN'
)
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
'已禁用!'
message
:
`已
${
str
}
!`
})
})
})
})
})
.
catch
(()
=>
{})
.
catch
(()
=>
{})
...
...
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