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