no message

This commit is contained in:
小陌 2023-06-16 16:39:46 +08:00
parent 4200a06ee7
commit 2ff0bcdf47
3 changed files with 30 additions and 35 deletions

View File

@ -13,7 +13,7 @@
<span class="label"> <span class="label">
{{ node.label }} {{ node.label }}
</span> </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> <el-button icon="el-icon-plus" size="small" @click.stop="add(node, data)"></el-button>
</span> </span>
</span> </span>
@ -68,13 +68,13 @@
// //
async getMenu(){ async getMenu(){
this.menuloading = true this.menuloading = true
var res = await this.$api.system.index.get(); var res = await this.$http.get('system/menu');
this.menuloading = false this.menuloading = false
this.menuList = res.data.menu; this.menuList = res.data;
}, },
// //
menuClick(data, node){ 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.save.setData(data, pid)
this.$refs.main.$el.scrollTop = 0 this.$refs.main.$el.scrollTop = 0
}, },
@ -93,8 +93,8 @@
async add(node, data){ async add(node, data){
var newMenuName = "未命名" + newMenuIndex++; var newMenuName = "未命名" + newMenuIndex++;
var newMenuData = { var newMenuData = {
parentId: data ? data.id : "", parentid: data ? data.id : 0,
name: newMenuName, name: "",
path: "", path: "",
component: "", component: "",
meta:{ meta:{
@ -103,13 +103,19 @@
} }
} }
this.menuloading = true 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 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.append(newMenuData, node)
this.$refs.menu.setCurrentKey(newMenuData.id) 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) this.$refs.save.setData(newMenuData, pid)
}, },
// //
@ -133,7 +139,7 @@
var reqData = { var reqData = {
ids: CheckedNodes.map(item => item.id) 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 this.menuloading = false
if(res.code == 200){ if(res.code == 200){

View File

@ -10,8 +10,8 @@
<el-form-item label="显示名称" prop="meta.title"> <el-form-item label="显示名称" prop="meta.title">
<el-input v-model="form.meta.title" clearable placeholder="菜单显示名字"></el-input> <el-input v-model="form.meta.title" clearable placeholder="菜单显示名字"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上级菜单" prop="parentId"> <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-cascader v-model="form.parentid" :options="menuOptions" :props="menuProps" :show-all-levels="false" placeholder="顶级菜单" clearable disabled></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="meta.type"> <el-form-item label="类型" prop="meta.type">
<el-radio-group v-model="form.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> <sc-icon-select v-model="form.meta.icon" clearable></sc-icon-select>
</el-form-item> </el-form-item>
<el-form-item label="路由地址" prop="path"> <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>
<el-form-item label="重定向" prop="redirect"> <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>
<el-form-item label="菜单高亮" prop="active"> <el-form-item label="菜单高亮" prop="meta.active">
<el-input v-model="form.active" clearable placeholder=""></el-input> <el-input v-model="form.meta.active" clearable placeholder=""></el-input>
<div class="el-form-item-msg">子节点或详情页需要高亮的上级菜单路由地址</div> <div class="el-form-item-msg">子节点或详情页需要高亮的上级菜单路由地址</div>
</el-form-item> </el-form-item>
<el-form-item label="视图" prop="component"> <el-form-item label="视图" prop="component">
@ -67,7 +67,7 @@
</el-col> </el-col>
<el-col :lg="12" class="apilist"> <el-col :lg="12" class="apilist">
<h2>接口权限</h2> <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"> <el-table-column prop="code" label="标识" width="150">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.code" placeholder="请输入内容"></el-input> <el-input v-model="scope.row.code" placeholder="请输入内容"></el-input>
@ -99,7 +99,7 @@
return { return {
form: { form: {
id: "", id: "",
parentId: "", parentid: "",
name: "", name: "",
path: "", path: "",
component: "", component: "",
@ -113,7 +113,7 @@
fullpage: false, fullpage: false,
tag: "", tag: "",
}, },
apiList: [] apilist: []
}, },
menuOptions: [], menuOptions: [],
menuProps: { menuProps: {
@ -131,7 +131,7 @@
'#c71585' '#c71585'
], ],
rules: [], rules: [],
apiListAddTemplate: { apilistAddTemplate: {
code: "", code: "",
url: "" url: ""
}, },
@ -156,7 +156,7 @@
tree.forEach(item => { tree.forEach(item => {
var obj = { var obj = {
id: item.id, id: item.id,
parentId: item.parentId, parentid: item.parentid,
title: item.meta.title, title: item.meta.title,
children: item.children&&item.children.length>0 ? this.treeToMap(item.children) : null children: item.children&&item.children.length>0 ? this.treeToMap(item.children) : null
} }
@ -167,7 +167,7 @@
// //
async save(){ async save(){
this.loading = true 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 this.loading = false
if(res.code == 200){ if(res.code == 200){
this.$message.success("保存成功") this.$message.success("保存成功")
@ -178,8 +178,8 @@
// //
setData(data, pid){ setData(data, pid){
this.form = data this.form = data
this.form.apiList = data.apiList || [] this.form.apilist = data.apilist || []
this.form.parentId = pid this.form.parentid = pid
} }
} }
} }

View File

@ -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> <template>
<el-main> <el-main>
<el-row :gutter="15"> <el-row :gutter="15">
@ -165,11 +156,9 @@
.task-item li h4 {font-size: 12px;font-weight: normal;color: #999;} .task-item li h4 {font-size: 12px;font-weight: normal;color: #999;}
.task-item li p {margin-top: 5px;} .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-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 {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:hover {color: #409EFF;}
.task-add i {font-size: 30px;} .task-add i {font-size: 30px;}
.task-add p {font-size: 12px;margin-top: 20px;} .task-add p {font-size: 12px;margin-top: 20px;}
.dark .task-item .bottom {border-color: var(--el-border-color-light);} .dark .task-item .bottom {border-color: var(--el-border-color-light);}
</style> </style>