Commit 5442d286 authored by 赵啸非's avatar 赵啸非

修改菜单切换

parent 11000e35
...@@ -24,9 +24,8 @@ ...@@ -24,9 +24,8 @@
"js-cookie": "2.2.1", "js-cookie": "2.2.1",
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"json-bigint": "^0.3.0", "json-bigint": "^0.3.0",
"jwt-decode": "^3.1.2", "jwt-decode": "3.1.2",
"moment": "^2.29.4", "moment": "^2.29.4",
"muse-ui": "^3.0.2",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",
...@@ -40,9 +39,7 @@ ...@@ -40,9 +39,7 @@
"vue-router": "3.4.9", "vue-router": "3.4.9",
"vue-template-compiler": "^2.6.14", "vue-template-compiler": "^2.6.14",
"vue2-org-tree": "^1.3.5", "vue2-org-tree": "^1.3.5",
"vuex": "3.6.0", "vuex": "3.6.0"
"jwt-decode": "3.1.2"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "4.4.6", "@vue/cli-plugin-babel": "4.4.6",
......
<template> <template>
<div className="page"> <div className="page">
<el-card> <el-card>
<LayoutTable notPagination ref="layoutTable" :data="tableData" :config="tableConfig"/> <LayoutTable notPagination ref="layoutTable" :data="tableData" :config="tableConfig"/>
</el-card> </el-card>
<dialog-show ref="dialogform" @ok="getData"/> <dialog-show ref="dialogform" @ok="getData"/>
</div> </div>
...@@ -92,6 +92,31 @@ export default { ...@@ -92,6 +92,31 @@ export default {
showIcon(row, column) { showIcon(row, column) {
return <i class={'el-icon-'+row.imgPath}></i> return <i class={'el-icon-'+row.imgPath}></i>
}, },
handleStatus(row){
if(row.status==1){
this.$post("/menu/change/status", {id:row.id,status:0})
.then(res => {
if(res.code==1){
row.status=0;
}
})
.catch(error => {
this.$message.error(error.message);
})
}else{
this.$post("/menu/change/status", {id:row.id,status:1})
.then(res => {
if(res.code==1){
row.status=1;
}
})
.catch(error => {
this.$message.error(error.message);
})
}
},
// 操作菜单状态 // 操作菜单状态
changeStatus(row, column) { changeStatus(row, column) {
return ( return (
...@@ -112,6 +137,7 @@ export default { ...@@ -112,6 +137,7 @@ export default {
}, },
data() { data() {
return { return {
value: '1',
config: { config: {
isshowTabPane:true, isshowTabPane:true,
/** 树表是否默认展开 */ /** 树表是否默认展开 */
...@@ -156,7 +182,24 @@ export default { ...@@ -156,7 +182,24 @@ export default {
prop: 'status', prop: 'status',
label: '状态', label: '状态',
width: 100, width: 100,
formatter: this.changeStatus, formatter: row => {
return (
<div>
<el-switch
value={row.status+""}
active-color="#13ce66"
inactive-color="#ff4949"
active-value='1'
inactive-value='0'
onChange={() => {
this.handleStatus(row);
}}
>
</el-switch>
</div>
);
}
}, },
{ {
label: "操作", label: "操作",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment