no message
This commit is contained in:
parent
4200a06ee7
commit
2ff0bcdf47
@ -13,7 +13,7 @@
|
||||
<span class="label">
|
||||
{{ node.label }}
|
||||
</span>
|
||||
<span class="do">
|
||||
<span class="do" v-if="!data.parentid">
|
||||
<el-button icon="el-icon-plus" size="small" @click.stop="add(node, data)"></el-button>
|
||||
</span>
|
||||
</span>
|
||||
@ -68,13 +68,13 @@
|
||||
//加载树数据
|
||||
async getMenu(){
|
||||
this.menuloading = true
|
||||
var res = await this.$api.system.index.get();
|
||||
var res = await this.$http.get('system/menu');
|
||||
this.menuloading = false
|
||||
this.menuList = res.data.menu;
|
||||
this.menuList = res.data;
|
||||
},
|
||||
//树点击
|
||||
menuClick(data, node){
|
||||
var pid = node.level==1?undefined:node.parent.data.id;
|
||||
var pid = node.level==1 ? undefined : node.parent.data.id;
|
||||
this.$refs.save.setData(data, pid)
|
||||
this.$refs.main.$el.scrollTop = 0
|
||||
},
|
||||
@ -93,8 +93,8 @@
|
||||
async add(node, data){
|
||||
var newMenuName = "未命名" + newMenuIndex++;
|
||||
var newMenuData = {
|
||||
parentId: data ? data.id : "",
|
||||
name: newMenuName,
|
||||
parentid: data ? data.id : 0,
|
||||
name: "",
|
||||
path: "",
|
||||
component: "",
|
||||
meta:{
|
||||
@ -103,13 +103,19 @@
|
||||
}
|
||||
}
|
||||
this.menuloading = true
|
||||
var res = await this.$api.demo.post.post(newMenuData)
|
||||
var res = await this.$http.post('system/menu/submit',newMenuData)
|
||||
this.menuloading = false
|
||||
newMenuData.id = res.data
|
||||
|
||||
if(res.code !== 200){
|
||||
this.$message.warning(res.message);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
newMenuData.id = res.data
|
||||
this.$refs.menu.append(newMenuData, node)
|
||||
this.$refs.menu.setCurrentKey(newMenuData.id)
|
||||
var pid = node ? node.data.id : ""
|
||||
var pid = node ? node.data.id : 0
|
||||
this.$refs.save.setData(newMenuData, pid)
|
||||
},
|
||||
//删除菜单
|
||||
@ -133,7 +139,7 @@
|
||||
var reqData = {
|
||||
ids: CheckedNodes.map(item => item.id)
|
||||
}
|
||||
var res = await this.$api.demo.post.post(reqData)
|
||||
var res = await this.$http.post('system/menu/delete',reqData)
|
||||
this.menuloading = false
|
||||
|
||||
if(res.code == 200){
|
||||
|
@ -10,8 +10,8 @@
|
||||
<el-form-item label="显示名称" prop="meta.title">
|
||||
<el-input v-model="form.meta.title" clearable placeholder="菜单显示名字"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级菜单" prop="parentId">
|
||||
<el-cascader v-model="form.parentId" :options="menuOptions" :props="menuProps" :show-all-levels="false" placeholder="顶级菜单" clearable disabled></el-cascader>
|
||||
<el-form-item label="上级菜单" prop="parentid">
|
||||
<el-cascader v-model="form.parentid" :options="menuOptions" :props="menuProps" :show-all-levels="false" placeholder="顶级菜单" clearable disabled></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="meta.type">
|
||||
<el-radio-group v-model="form.meta.type">
|
||||
@ -29,13 +29,13 @@
|
||||
<sc-icon-select v-model="form.meta.icon" clearable></sc-icon-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="路由地址" prop="path">
|
||||
<el-input v-model="form.path" clearable placeholder=""></el-input>
|
||||
<el-input v-model="form.path" clearable placeholder="路由地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="重定向" prop="redirect">
|
||||
<el-input v-model="form.redirect" clearable placeholder=""></el-input>
|
||||
<el-input v-model="form.redirect" clearable placeholder="重定向"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单高亮" prop="active">
|
||||
<el-input v-model="form.active" clearable placeholder=""></el-input>
|
||||
<el-form-item label="菜单高亮" prop="meta.active">
|
||||
<el-input v-model="form.meta.active" clearable placeholder=""></el-input>
|
||||
<div class="el-form-item-msg">子节点或详情页需要高亮的上级菜单路由地址</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="视图" prop="component">
|
||||
@ -67,7 +67,7 @@
|
||||
</el-col>
|
||||
<el-col :lg="12" class="apilist">
|
||||
<h2>接口权限</h2>
|
||||
<sc-form-table v-model="form.apiList" :addTemplate="apiListAddTemplate" placeholder="暂无匹配接口权限">
|
||||
<sc-form-table v-model="form.apilist" :addTemplate="apilistAddTemplate" placeholder="暂无匹配接口权限">
|
||||
<el-table-column prop="code" label="标识" width="150">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.code" placeholder="请输入内容"></el-input>
|
||||
@ -99,7 +99,7 @@
|
||||
return {
|
||||
form: {
|
||||
id: "",
|
||||
parentId: "",
|
||||
parentid: "",
|
||||
name: "",
|
||||
path: "",
|
||||
component: "",
|
||||
@ -113,7 +113,7 @@
|
||||
fullpage: false,
|
||||
tag: "",
|
||||
},
|
||||
apiList: []
|
||||
apilist: []
|
||||
},
|
||||
menuOptions: [],
|
||||
menuProps: {
|
||||
@ -131,7 +131,7 @@
|
||||
'#c71585'
|
||||
],
|
||||
rules: [],
|
||||
apiListAddTemplate: {
|
||||
apilistAddTemplate: {
|
||||
code: "",
|
||||
url: ""
|
||||
},
|
||||
@ -156,7 +156,7 @@
|
||||
tree.forEach(item => {
|
||||
var obj = {
|
||||
id: item.id,
|
||||
parentId: item.parentId,
|
||||
parentid: item.parentid,
|
||||
title: item.meta.title,
|
||||
children: item.children&&item.children.length>0 ? this.treeToMap(item.children) : null
|
||||
}
|
||||
@ -167,7 +167,7 @@
|
||||
//保存
|
||||
async save(){
|
||||
this.loading = true
|
||||
var res = await this.$api.demo.post.post(this.form)
|
||||
var res = await this.$http.post('system/menu/submit',this.form)
|
||||
this.loading = false
|
||||
if(res.code == 200){
|
||||
this.$message.success("保存成功")
|
||||
@ -178,8 +178,8 @@
|
||||
//表单注入数据
|
||||
setData(data, pid){
|
||||
this.form = data
|
||||
this.form.apiList = data.apiList || []
|
||||
this.form.parentId = pid
|
||||
this.form.apilist = data.apilist || []
|
||||
this.form.parentid = pid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,3 @@
|
||||
<!--
|
||||
* @Descripttion: 系统计划任务配置
|
||||
* @version: 1.2
|
||||
* @Author: sakuya
|
||||
* @Date: 2021年7月7日09:28:32
|
||||
* @LastEditors: sakuya
|
||||
* @LastEditTime: 2021年7月10日20:56:47
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-main>
|
||||
<el-row :gutter="15">
|
||||
@ -165,11 +156,9 @@
|
||||
.task-item li h4 {font-size: 12px;font-weight: normal;color: #999;}
|
||||
.task-item li p {margin-top: 5px;}
|
||||
.task-item .bottom {border-top: 1px solid #EBEEF5;text-align: right;padding-top:10px;display: flex;justify-content: space-between;align-items: center;}
|
||||
|
||||
.task-add {display: flex;flex-direction: column;align-items: center;justify-content: center;text-align: center;cursor: pointer;color: #999;}
|
||||
.task-add:hover {color: #409EFF;}
|
||||
.task-add i {font-size: 30px;}
|
||||
.task-add p {font-size: 12px;margin-top: 20px;}
|
||||
|
||||
.dark .task-item .bottom {border-color: var(--el-border-color-light);}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user