Commit fd35d4c6 authored by 黄奎's avatar 黄奎

新增页面

parent 08017d7a
......@@ -27,36 +27,47 @@
<template>
<div class="menuDiv">
<div class="query-box">
名称: <el-input type="text" style="width:234px;" size="small" v-model="msg.MenuName" clearable @keyup.enter.native="msg.pageIndex=1,getPageList()"></el-input>
等级: <el-select style="width:234px;" size="small" v-model="msg.MenuLevel">
<el-option label="全部" :key="0" :value="0"></el-option>
<el-option label="一级" :key="1" :value="1"></el-option>
<el-option label="二级" :key="2" :value="2"></el-option>
<el-option label="三级" :key="3" :value="3"></el-option>
</el-select>
<button type="button" class="normalBtn" @click="msg.pageIndex=1,getPageList()">查询</button>
<button type="button" class="normalBtn" @click="menuDialog=true,resetMsg()">新增</button>
</div>
<table class="commonTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading">
<tr>
<th>菜单编号</th>
<th>菜单名称</th>
<th>菜单</th>
<th>菜单</th>
<th>菜单等级</th>
<th>父级菜单编号</th>
<th>状态</th>
<th>操作</th>
</tr>
<tr v-for="(item,index) in dataList" :key="index">
<td>{{item.MenuId}}</td>
<td>{{item.MenuName}}</td>
<td>{{item.MenuUrl}}</td>
<td>{{item.MenuLevel}}</td>
<td>{{item.ParentId}}</td>
<td>{{item.StatusStr}}</td>
<td>
<el-tooltip class="item" effect="dark" content="修改" placement="top-start">
<el-button type="primary" icon="el-icon-edit" @click="getMenu(item.MenuId)" circle style="padding:6px;"></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<el-button v-if="item.Status==0" type="danger" icon="el-icon-delete" @click="delMenu(item.MenuId)" circle style="padding:6px;"></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="恢复" placement="top-start">
<el-button v-if="item.Status==1" type="primary" icon="iconfont icon-icon_huifu" @click="recoverMenu(item.MenuId)" circle style="padding:5px;"></el-button>
</el-tooltip>
</td>
<td>{{item.MenuId}}</td>
<td>{{item.MenuName}}</td>
<td>{{item.MenuUrl}}</td>
<td>{{item.MenuLevel}}</td>
<td>{{item.ParentId}}</td>
<td>{{item.StatusStr}}</td>
<td>
<el-tooltip class="item" effect="dark" content="修改" placement="top-start">
<el-button type="primary" icon="el-icon-edit" @click="getMenu(item.MenuId)" circle style="padding:6px;">
</el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<el-button v-if="item.Status==0" type="danger" icon="el-icon-delete" @click="delMenu(item.MenuId)" circle
style="padding:6px;"></el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="恢复" placement="top-start">
<el-button v-if="item.Status==1" type="primary" icon="iconfont icon-icon_huifu"
@click="recoverMenu(item.MenuId)" circle style="padding:5px;"></el-button>
</el-tooltip>
</td>
</tr>
</table>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage"
......@@ -73,7 +84,8 @@
<el-input type="text" style="width:234px" size="small" maxlength="25" v-model="addMsg.MenuUrl"></el-input>
</el-form-item>
<el-form-item label="菜单等级" prop="MenuLevel">
<el-select style="width:234px;" size="small" v-model="addMsg.MenuLevel" @change="getChildMenuList(addMsg.MenuLevel)">
<el-select style="width:234px;" size="small" v-model="addMsg.MenuLevel"
@change="getChildMenuList(addMsg.MenuLevel)">
<el-option label="一级" :key="1" :value="1"></el-option>
<el-option label="二级" :key="2" :value="2"></el-option>
<el-option label="三级" :key="3" :value="3"></el-option>
......@@ -81,11 +93,7 @@
</el-form-item>
<el-form-item label="父级菜单编号" v-if="addMsg.MenuLevel!=1" prop="ParentId">
<el-select style="width:234px;" size="small" v-model="addMsg.ParentId">
<el-option
v-for="item in parentList"
:key="item.MenuId"
:label="item.MenuName"
:value="item.MenuId">
<el-option v-for="item in parentList" :key="item.MenuId" :label="item.MenuName" :value="item.MenuId">
</el-option>
</el-select>
</el-form-item>
......@@ -93,7 +101,8 @@
<el-input type="text" style="width:234px" size="small" maxlength="25" v-model="addMsg.IconClass"></el-input>
</el-form-item>
<el-form-item label="排序">
<el-input type="text" style="width:234px" @keyup.native="checkInteger(addMsg,'SortNum')" size="small" maxlength="25" v-model="addMsg.SortNum"></el-input>
<el-input type="text" style="width:234px" @keyup.native="checkInteger(addMsg,'SortNum')" size="small"
maxlength="25" v-model="addMsg.SortNum"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
......@@ -113,7 +122,9 @@
total: 0,
msg: {
pageIndex: 1,
pageSize: 20
pageSize: 20,
MenuLevel: 0,
MenuName: "", //菜单名称
},
dataList: [],
addMsg: {
......@@ -125,18 +136,13 @@
Status: 0,
SortNum: 0,
},
parentList:[],
parentList: [],
menurules: {
MenuName: [{
required: true,
message: '请填写菜单名称。',
trigger: 'blur'
}],
// MenuUrl: [{
// required: true,
// message: '请填写菜单链接。',
// trigger: 'blur'
// }]
}
};
},
......@@ -159,7 +165,7 @@
});
},
//重置菜单
resetMsg(){
resetMsg() {
let msg = {
MenuName: '',
MenuUrl: '',
......@@ -187,7 +193,7 @@
this.apipost("/api/Tenant/SetMenu", this.addMsg, res => {
if (res.data.resultCode == 1) {
this.getPageList();
this.menuDialog=false;
this.menuDialog = false;
} else {
this.Info(res.data.message);
}
......@@ -200,7 +206,7 @@
}, res => {
if (res.data.resultCode == 1) {
this.addMsg = res.data.data;
this.menuDialog=true;
this.menuDialog = true;
this.getChildMenuList(this.addMsg.MenuLevel);
} else {
this.Info(res.data.message);
......@@ -211,17 +217,17 @@
delMenu(Id) {
var that = this;
that.Confirm("是否删除?", function () {
that.apipost("/api/Tenant/SetMenuStatus", {
MenuId: Id,
Status: 1
}, res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getPageList();
} else {
that.Info(res.data.message);
}
})
that.apipost("/api/Tenant/SetMenuStatus", {
MenuId: Id,
Status: 1
}, res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.getPageList();
} else {
that.Info(res.data.message);
}
})
});
},
//恢复菜单
......@@ -231,8 +237,8 @@
Status: 0
}, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message);
this.getPageList();
this.Success(res.data.message);
this.getPageList();
} else {
this.Info(res.data.message);
}
......@@ -240,12 +246,12 @@
},
//获取父级菜单编号
getChildMenuList(MenuLevel) {
this.parentList=[];
this.parentList = [];
this.apipost("/api/Tenant/GetMenuChildList", {
MenuLevel: MenuLevel-1,
MenuLevel: MenuLevel - 1,
}, res => {
if (res.data.resultCode == 1) {
this.parentList=res.data.data;
this.parentList = res.data.data;
} else {
this.Info(res.data.message);
}
......
......@@ -35,6 +35,11 @@ export default new Router({
name: 'menu',
component: resolve => require(['@/components/system/menu'], resolve),
},
{
path: '/minimenu',//小程序菜单管理
name: 'minimenu',
component: resolve => require(['@/components/system/minimenu'], resolve),
},
{
path: '/mall',
name: 'mall',
......
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