完善菜单管理
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
|||||||
//暂未制作逻辑删除与多租户的过滤
|
//暂未制作逻辑删除与多租户的过滤
|
||||||
public async Task<Result> GetMenuTree()
|
public async Task<Result> GetMenuTree()
|
||||||
{
|
{
|
||||||
return Result.Success().SetData(await _iMenuService.GetMenuTreeAsync());
|
return Result.Success().SetData(await _iMenuService. GetMenuTreeAsync());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -23,6 +23,6 @@ namespace Yi.Framework.Repository
|
|||||||
public Task<bool> UpdateIgnoreNullAsync(T entity);
|
public Task<bool> UpdateIgnoreNullAsync(T entity);
|
||||||
public Task<List<S>> UseSqlAsync<S>(string sql);
|
public Task<List<S>> UseSqlAsync<S>(string sql);
|
||||||
public Task<bool> UseSqlAsync(string sql);
|
public Task<bool> UseSqlAsync(string sql);
|
||||||
|
ISugarQueryable<T> QueryConditionHandler(QueryCondition pars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ namespace Yi.Framework.Repository
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
private ISugarQueryable<T> QueryConditionHandler(QueryCondition pars)
|
public ISugarQueryable<T> QueryConditionHandler(QueryCondition pars)
|
||||||
{
|
{
|
||||||
var sugarParamters = pars.Parameters.Select(it => (IConditionalModel)new ConditionalModel()
|
var sugarParamters = pars.Parameters.Select(it => (IConditionalModel)new ConditionalModel()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,30 +6,23 @@ export default {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
addChildrenMenu(id, data) {
|
Update(data) {
|
||||||
return myaxios({
|
return myaxios({
|
||||||
url: '/Menu/addChildrenMenu',
|
url: '/Menu/Update',
|
||||||
method: 'post',
|
|
||||||
data: { parentId: id, data }
|
|
||||||
})
|
|
||||||
},
|
|
||||||
UpdateMenu(data) {
|
|
||||||
return myaxios({
|
|
||||||
url: '/Menu/UpdateMenu',
|
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
DelListMenu(ids) {
|
DeleteList(ids) {
|
||||||
return myaxios({
|
return myaxios({
|
||||||
url: '/Menu/DelListMenu',
|
url: '/Menu/DeleteList',
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
AddTopMenu(data) {
|
Add(data) {
|
||||||
return myaxios({
|
return myaxios({
|
||||||
url: '/Menu/AddTopMenu',
|
url: '/Menu/Add',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
</ccCombobox> -->
|
</ccCombobox> -->
|
||||||
<app-btn
|
<app-btn
|
||||||
@click="
|
@click="
|
||||||
parentId = item.id;
|
editedItem.parentId = item.id;
|
||||||
dialog = true;
|
dialog = true;
|
||||||
"
|
"
|
||||||
>添加子菜单</app-btn
|
>添加子菜单</app-btn
|
||||||
@@ -88,7 +88,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import mouldApi from "../api/mouldApi";
|
|
||||||
import menuApi from "../api/menuApi";
|
import menuApi from "../api/menuApi";
|
||||||
export default {
|
export default {
|
||||||
name: "ccTreeview",
|
name: "ccTreeview",
|
||||||
@@ -102,12 +101,12 @@ export default {
|
|||||||
dialog: false,
|
dialog: false,
|
||||||
editedItem: {},
|
editedItem: {},
|
||||||
editedIndex: -1,
|
editedIndex: -1,
|
||||||
parentId: 0,
|
|
||||||
defaultItem: {
|
defaultItem: {
|
||||||
icon: "mdi-start",
|
// icon: "mdi-start",
|
||||||
router: "test",
|
permissionCode: "test",
|
||||||
menu_name: "测试",
|
menuName: "管理",
|
||||||
is_show: 1,
|
parentId: 0,
|
||||||
|
MenuType:0
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
@@ -137,7 +136,7 @@ export default {
|
|||||||
this.mouldSelect = data;
|
this.mouldSelect = data;
|
||||||
},
|
},
|
||||||
async deleteItem(item) {
|
async deleteItem(item) {
|
||||||
this.editedIndex = this.desserts.indexOf(item);
|
this.editedIndex = 1;
|
||||||
this.editedItem = Object.assign({}, item);
|
this.editedItem = Object.assign({}, item);
|
||||||
var p = await this.$dialog.warning({
|
var p = await this.$dialog.warning({
|
||||||
text: "你确定要删除此条记录吗??",
|
text: "你确定要删除此条记录吗??",
|
||||||
@@ -160,7 +159,7 @@ export default {
|
|||||||
Ids.push(item.id);
|
Ids.push(item.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
menuApi.DelListMenu(Ids).then(() => this.init());
|
menuApi.DeleteList(Ids).then(() => this.init());
|
||||||
},
|
},
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
@@ -172,9 +171,6 @@ export default {
|
|||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.parentId = 0;
|
this.parentId = 0;
|
||||||
// mouldApi.getMould().then((resp) => {
|
|
||||||
// this.mouldList = resp.data;
|
|
||||||
// });
|
|
||||||
|
|
||||||
menuApi.getMenuTree().then((resp) => {
|
menuApi.getMenuTree().then((resp) => {
|
||||||
this.desserts = resp.data;
|
this.desserts = resp.data;
|
||||||
@@ -192,17 +188,11 @@ export default {
|
|||||||
|
|
||||||
save() {
|
save() {
|
||||||
if (this.editedIndex > -1) {
|
if (this.editedIndex > -1) {
|
||||||
menuApi.UpdateMenu(this.editedItem).then(() => this.init());
|
menuApi.Update(this.editedItem).then(() => this.init());
|
||||||
} else {
|
} else {
|
||||||
if (this.parentId == 0) {
|
menuApi.Add(this.editedItem).then(() => {
|
||||||
menuApi.AddTopMenu(this.editedItem).then(() => {
|
|
||||||
this.init();
|
this.init();
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
menuApi.addChildrenMenu(this.parentId, this.editedItem).then(() => {
|
|
||||||
this.init();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user