前端更新
This commit is contained in:
Binary file not shown.
@@ -24,7 +24,7 @@
|
||||
></v-text-field>
|
||||
|
||||
<v-btn
|
||||
v-if="axiosUrls.hasOwnProperty('add')"
|
||||
v-if="axiosUrls.add!=''"
|
||||
color="primary"
|
||||
dark
|
||||
class="mb-2 mx-2"
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
<!-- 添加提示框 -->
|
||||
<v-dialog
|
||||
v-if="axiosUrls.hasOwnProperty('add')"
|
||||
v-if="axiosUrls.add!=''"
|
||||
v-model="dialog"
|
||||
max-width="500px"
|
||||
>
|
||||
@@ -72,7 +72,7 @@
|
||||
</v-dialog>
|
||||
|
||||
<v-btn
|
||||
v-if="axiosUrls.hasOwnProperty('del')"
|
||||
v-if="axiosUrls.del!=''"
|
||||
color="secondary"
|
||||
|
||||
class="mb-2"
|
||||
@@ -89,7 +89,7 @@
|
||||
<slot name="action" :item="item"></slot>
|
||||
|
||||
<v-icon
|
||||
v-if="axiosUrls.hasOwnProperty('update')"
|
||||
v-if="axiosUrls.update!=''"
|
||||
small
|
||||
class="mr-2"
|
||||
@click="editItem(item)"
|
||||
@@ -97,7 +97,7 @@
|
||||
mdi-pencil
|
||||
</v-icon>
|
||||
<v-icon
|
||||
v-if="axiosUrls.hasOwnProperty('del')"
|
||||
v-if="axiosUrls.del!=''"
|
||||
small
|
||||
@click="deleteItem(item)"
|
||||
>
|
||||
|
||||
@@ -103,6 +103,7 @@ export default {
|
||||
icon: "mdi-start",
|
||||
router: "test",
|
||||
menu_name: "测试",
|
||||
is_show:1
|
||||
},
|
||||
}),
|
||||
computed: {
|
||||
|
||||
@@ -81,7 +81,9 @@ export default {
|
||||
title: "用户管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admuser/",
|
||||
children: [],
|
||||
children: [
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "角色管理",
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
function getUrl(menuList, menuStr) {
|
||||
for (var i = 0; i < menuList.length; i++) {
|
||||
if (menuList[i].menu_name == menuStr) {
|
||||
console.log(handUrl(menuList[i]))
|
||||
return 1;
|
||||
} else {
|
||||
if (menuList[i].children != undefined) {
|
||||
getUrl(menuList[i].children, menuStr);
|
||||
}
|
||||
var start = true;
|
||||
|
||||
function getUrl(menuList, menuStr) {
|
||||
|
||||
if (start) {
|
||||
for (var i = 0; i < menuList.length; i++) {
|
||||
if (menuList[i].menu_name == menuStr) {
|
||||
alert(777)
|
||||
start = false;
|
||||
console.log(handUrl(menuList[i]))
|
||||
return handUrl(menuList[i])
|
||||
} else {
|
||||
if (menuList[i].children != undefined && start) {
|
||||
alert(666)
|
||||
getUrl(menuList[i].children, menuStr);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function handUrl(menu) {
|
||||
var axiosUrls = {
|
||||
@@ -42,4 +49,8 @@ function handUrl(menu) {
|
||||
});
|
||||
return axiosUrls;
|
||||
}
|
||||
export default { getUrl }
|
||||
|
||||
export {
|
||||
getUrl,
|
||||
handUrl
|
||||
}
|
||||
@@ -12,93 +12,109 @@
|
||||
</material-card>
|
||||
</template>
|
||||
<script>
|
||||
import getUrl from '../util/getMould'
|
||||
import {handUrl} from '../util/getMould'
|
||||
export default {
|
||||
created(){
|
||||
this.init();
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
const resp= [
|
||||
{
|
||||
menu_name: "首页",
|
||||
icon: "mdi-view-dashboard",
|
||||
to: "/",
|
||||
},
|
||||
{
|
||||
menu_name: "用户角色管理",
|
||||
icon: "mdi-account",
|
||||
to: "",
|
||||
children: [
|
||||
{
|
||||
menu_name: "用户管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admuser/",
|
||||
children: [
|
||||
{
|
||||
menu_name: "get",
|
||||
icon: "mdi-account",
|
||||
to: "/admrole/",
|
||||
mould:{
|
||||
mould_name:"get",
|
||||
url: "666666无敌",
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
menu_name: "角色管理",
|
||||
icon: "mdi-account-tie",
|
||||
to: "/admrole/",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
menu_name: "菜单接口管理",
|
||||
icon: "mdi-clipboard-outline",
|
||||
to: "",
|
||||
children: [
|
||||
{
|
||||
menu_name: "菜单管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admMenu/",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
menu_name: "接口管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admMould/",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
menu_name: "角色菜单分配管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admRoleMenu/",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
menu_name: "测试路由",
|
||||
icon: "mdi-clipboard-outline",
|
||||
to: "",
|
||||
children: [
|
||||
{
|
||||
menu_name: "用户信息",
|
||||
icon: "mdi-account",
|
||||
to: "/userinfo/",
|
||||
children: [],
|
||||
methods: {
|
||||
recursiveFun(menuList, menuStr) {
|
||||
if (this.start) {
|
||||
this.getUrlFun(menuList, menuStr);
|
||||
}
|
||||
},
|
||||
getUrlFun(menuList, menuStr) {
|
||||
for (var i = 0; i < menuList.length; i++) {
|
||||
if (menuList[i].menu_name == menuStr) {
|
||||
this.start = false;
|
||||
this.axiosUrls= handUrl(menuList[i]);
|
||||
} else {
|
||||
if (menuList[i].children != undefined && this.start) {
|
||||
this.recursiveFun(menuList[i].children, menuStr);
|
||||
}
|
||||
],
|
||||
},
|
||||
];
|
||||
var mytest= getUrl.getUrl(resp,"用户管理")
|
||||
console.log(mytest);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
init() {
|
||||
const resp = [
|
||||
{
|
||||
menu_name: "首页",
|
||||
icon: "mdi-view-dashboard",
|
||||
to: "/",
|
||||
},
|
||||
{
|
||||
menu_name: "用户角色管理",
|
||||
icon: "mdi-account",
|
||||
to: "",
|
||||
children: [
|
||||
{
|
||||
menu_name: "用户管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admuser/",
|
||||
children: [
|
||||
{
|
||||
menu_name: "",
|
||||
icon: "mdi-account",
|
||||
to: "/admrole/",
|
||||
mould: {
|
||||
mould_name: "get",
|
||||
url: "/role/getrole",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
menu_name: "角色管理",
|
||||
icon: "mdi-account-tie",
|
||||
to: "/admrole/",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
menu_name: "菜单接口管理",
|
||||
icon: "mdi-clipboard-outline",
|
||||
to: "",
|
||||
children: [
|
||||
{
|
||||
menu_name: "菜单管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admMenu/",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
menu_name: "接口管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admMould/",
|
||||
children: [],
|
||||
},
|
||||
{
|
||||
menu_name: "角色菜单分配管理",
|
||||
icon: "mdi-account",
|
||||
to: "/admRoleMenu/",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
menu_name: "测试路由",
|
||||
icon: "mdi-clipboard-outline",
|
||||
to: "",
|
||||
children: [
|
||||
{
|
||||
menu_name: "用户信息",
|
||||
icon: "mdi-account",
|
||||
to: "/userinfo/",
|
||||
children: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
this.recursiveFun(resp, "用户管理");
|
||||
},
|
||||
},
|
||||
data: () => ({
|
||||
start: true,
|
||||
axiosUrls: {
|
||||
get: "role/getrole",
|
||||
update: "role/updaterole",
|
||||
|
||||
Reference in New Issue
Block a user