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

修改菜单切换

parent 11000e35
......@@ -24,9 +24,8 @@
"js-cookie": "2.2.1",
"jsencrypt": "3.0.0-rc.1",
"json-bigint": "^0.3.0",
"jwt-decode": "^3.1.2",
"jwt-decode": "3.1.2",
"moment": "^2.29.4",
"muse-ui": "^3.0.2",
"nprogress": "^0.2.0",
"quill": "1.3.7",
"screenfull": "5.0.2",
......@@ -40,9 +39,7 @@
"vue-router": "3.4.9",
"vue-template-compiler": "^2.6.14",
"vue2-org-tree": "^1.3.5",
"vuex": "3.6.0",
"jwt-decode": "3.1.2"
"vuex": "3.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
......
......@@ -92,6 +92,31 @@ export default {
showIcon(row, column) {
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) {
return (
......@@ -112,6 +137,7 @@ export default {
},
data() {
return {
value: '1',
config: {
isshowTabPane:true,
/** 树表是否默认展开 */
......@@ -156,7 +182,24 @@ export default {
prop: 'status',
label: '状态',
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: "操作",
......
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