Commit 8f0a0a8c authored by zhengke's avatar zhengke

修改

parent 1429f257
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
</script> </script>
<style> <style>
@import "//at.alicdn.com/t/font_1769104_25q16n3sqko.css"; @import "//at.alicdn.com/t/font_1769104_sg5novwcbz.css";
@import "./assets/css/common.css"; @import "./assets/css/common.css";
@import "./assets/css/zkcss.css"; @import "./assets/css/zkcss.css";
html, html,
......
...@@ -79,22 +79,26 @@ ...@@ -79,22 +79,26 @@
<el-option label="三级" :key="3" :value="3"></el-option> <el-option label="三级" :key="3" :value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="父级菜单编号" prop="ParentId"> <el-form-item label="父级菜单编号" v-if="addMsg.MenuLevel!=1" prop="ParentId">
<el-select style="width:234px;" size="small" v-model="addMsg.ParentId"> <el-select style="width:234px;" size="small" v-model="addMsg.ParentId">
<el-option label="编号1" :key="0" :value="0"></el-option> <el-option
<el-option label="编号2" :key="1" :value="1"></el-option> v-for="item in parentList"
:key="item.MenuId"
:label="item.MenuName"
:value="item.MenuId">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="图标" prop="IconClass"> <el-form-item label="图标" prop="IconClass">
<el-input type="text" style="width:234px" size="small" maxlength="25" v-model="addMsg.IconClass"></el-input> <el-input type="text" style="width:234px" size="small" maxlength="25" v-model="addMsg.IconClass"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="排序"> <el-form-item label="排序">
<el-input type="text" style="width:234px" 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-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="menuDialog = false">取 消</el-button> <el-button size="small" @click="menuDialog = false">取 消</el-button>
<el-button size="small" type="primary" @click="addMenu()">确 定</el-button> <el-button size="small" type="primary" @click="submitForm('addMsg')">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -121,8 +125,18 @@ ...@@ -121,8 +125,18 @@
Status: 0, Status: 0,
SortNum: 0, SortNum: 0,
}, },
parentList:[],
menurules: { menurules: {
MenuName: [{
required: true,
message: '请填写菜单名称。',
trigger: 'blur'
}],
// MenuUrl: [{
// required: true,
// message: '请填写菜单链接。',
// trigger: 'blur'
// }]
} }
}; };
}, },
...@@ -134,6 +148,16 @@ ...@@ -134,6 +148,16 @@
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getPageList(); this.getPageList();
}, },
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.addMenu();
} else {
return false;
}
});
},
//重置菜单 //重置菜单
resetMsg(){ resetMsg(){
let msg = { let msg = {
...@@ -177,6 +201,7 @@ ...@@ -177,6 +201,7 @@
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.addMsg = res.data.data; this.addMsg = res.data.data;
this.menuDialog=true; this.menuDialog=true;
this.getChildMenuList(this.addMsg.MenuLevel);
} else { } else {
this.Info(res.data.message); this.Info(res.data.message);
} }
...@@ -213,14 +238,14 @@ ...@@ -213,14 +238,14 @@
} }
}) })
}, },
//恢复菜单 //获取父级菜单编号
getChildMenuList(MenuLevel) { getChildMenuList(MenuLevel) {
this.parentList=[];
this.apipost("/api/Tenant/GetMenuChildList", { this.apipost("/api/Tenant/GetMenuChildList", {
MenuLevel: MenuLevel, MenuLevel: MenuLevel-1,
}, res => { }, res => {
console.log(res);
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.parentList=res.data.data;
} else { } else {
this.Info(res.data.message); this.Info(res.data.message);
} }
...@@ -229,6 +254,7 @@ ...@@ -229,6 +254,7 @@
}, },
mounted() { mounted() {
this.getPageList(); this.getPageList();
this.getChildMenuList(1);
} }
}; };
......
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