Commit 295fd996 authored by 徐一鸣's avatar 徐一鸣

服务管理优化

parent 5e81398d
<template>
<div class="fwgl_container">
<side-nav-bar :nav-list="navList" :title-path="navList[0].path"></side-nav-bar>
<side-nav-bar
:nav-list="navList"
:title-path="navList[0] && navList[0].path"
></side-nav-bar>
<div class="main_container">
<router-view
:key="'type_' + $route.params && $route.params.type"
......@@ -18,66 +21,75 @@ export default {
},
data: () => ({
navList: [],
userLevel: 0,
}),
mounted() {
this.navList = [
watch: {
"$route.fullPath"(path) {
this.initNavList();
},
},
methods: {
initNavList() {
let level = parseInt(this.$route.params.level);
// 普通用户
if (level == 0) {
this.navList = [
{
level: 0,
name: "注册发布的服务",
path: "/fwgl/list/0/注册发布的服务",
path: `/fwgl/list/${level}/0`,
},
{
level: 0,
name: "申请的服务",
path: "/fwgl/list/1/申请的服务",
path: `/fwgl/list/${level}/1`,
},
{
level: 0,
name: "审批的服务",
path: "/fwgl/list/2/审批的服务",
path: `/fwgl/list/${level}/2`,
},
{
level: 0,
name: "云资源服务",
path: "/fwgl/list/3/云资源服务",
path: `/fwgl/list/${level}/3`,
},
];
}
// 组织管理员
else if (level == 1) {
this.navList = [
{
level: 1,
name: "组织服务管理",
path: "/fwgl/list/4/组织服务管理",
path: `/fwgl/list/${level}/0`,
},
{
level: 1,
name: "服务审批管理",
path: "/fwgl/list/5/服务审批管理",
path: `/fwgl/list/${level}/1`,
},
{
level: 1,
name: "云资源管理",
path: "/fwgl/list/6/云资源管理",
path: `/fwgl/list/${level}/2`,
},
];
}
// 超级管理员
else if (level == 2) {
this.navList = [
{
level: 2,
name: "平台服务管理",
path: "/fwgl/list/7/平台服务管理",
path: `/fwgl/list/${level}/0`,
},
{
level: 2,
name: "服务审批管理",
path: "/fwgl/list/8/服务审批管理",
path: `/fwgl/list/${level}/1`,
},
{
level: 2,
name: "云资源管理",
path: "/fwgl/list/9/云资源管理",
path: `/fwgl/list/${level}/2`,
},
].filter((nav) => nav.level === this.userLevel);
this.$router.push(this.navList[0].path);
];
}
},
},
mounted() {
this.initNavList();
},
};
</script>
......
......@@ -9,7 +9,7 @@
class="r_yhgl_table"
size="mini"
url="tableData"
detailsUrl="/fwgl/servicedetail/"
:detailsUrl="`/fwgl/servicedetail/${$route.params.level}/`"
:border="false"
:headers="headers"
:searchShow="true"
......@@ -104,7 +104,7 @@ export default {
this.$refs.myConfirm.showModel();
},
editItem(item) {
this.$router.push("/fwgl/serviceedit/" + item.id);
this.$router.push(`/fwgl/serviceedit/${this.$route.params.level}/${item.id}`);
},
soldOutItem(item) {
this.confirmOptions.title = "是否删除该条服务?";
......@@ -132,8 +132,10 @@ export default {
},
},
mounted() {
switch (parseInt(this.$route.params.type)) {
case 0:
let level = parseInt(this.$route.params.level);
let type = parseInt(this.$route.params.type);
if (level == 0 && type == 0) {
this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务url", prop: "date", type: "", align: "center" },
......@@ -169,8 +171,7 @@ export default {
],
},
];
break;
case 1:
} else if (level == 0 && type == 1) {
this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务领域", prop: "date", type: "", align: "center" },
......@@ -196,8 +197,7 @@ export default {
],
},
];
break;
case 2:
} else if (level == 0 && type == 2) {
this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务领域", prop: "address", type: "", align: "center" },
......@@ -225,8 +225,7 @@ export default {
],
},
];
break;
case 3:
} else if (level == 0 && type == 2) {
this.headers = [
{ label: "工作区域", prop: "name", type: "href", align: "left" },
{ label: "网络环境", prop: "name", type: "", align: "center" },
......@@ -249,8 +248,7 @@ export default {
],
},
];
break;
default:
} else {
this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务url", prop: "date", type: "", align: "center" },
......@@ -267,7 +265,7 @@ export default {
label: "操作",
type: "Button",
align: "center",
width: 160,
width: 240,
btnList: [
{
type: "action-edit",
......@@ -286,7 +284,6 @@ export default {
],
},
];
break;
}
},
};
......
......@@ -58,23 +58,23 @@ export default new Router({
],
},
{
path: "/fwgl", // 服务管理
path: "/fwgl/:level", // 服务管理 level:用户等级
name: "fwgl",
// redirect: "/fwgl/list",
redirect: "/fwgl/list/:level/0",
component: () => import("@/pages/fwgl"),
children: [
{
path: "/fwgl/list/:type/:name", // 服务管理/我的服务
path: "/fwgl/list/:level/:type", // 服务管理/我的服务
name: "fwglList",
component: () => import("@/pages/fwglList"),
},
{
path: "/fwgl/servicedetail/:id",
path: "/fwgl/servicedetail/:level/:id",
name: "servicedetail",
component: () => import("@/pages/serviceDetail"),
},
{
path: "/fwgl/serviceedit/:id",
path: "/fwgl/serviceedit/:level/:id",
name: "serviceedit",
component: () => import("@/pages/serviceEdit"),
},
......@@ -105,17 +105,17 @@ export default new Router({
{
path: "/example_topology", // 拓扑图实例
name: "example_topology",
component: () => import("@/pages/example_topology")
component: () => import("@/pages/example_topology"),
},
{
path: "/example_commodity", // 商品详情实例
name: "example_commodity",
component: () => import("@/pages/example_commodity")
component: () => import("@/pages/example_commodity"),
},
{
path: "/example_com_list", // 商品列表实例
name: "example_com_list",
component: () => import("@/pages/example_com_list")
}
]
component: () => import("@/pages/example_com_list"),
},
],
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment