Commit b36f7cbd authored by 徐一鸣's avatar 徐一鸣

我的服务列表优化

parent 23bbf898
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<span v-text="title"></span> <span v-text="title"></span>
</h3> </h3>
<ul class="side_nav_bar_list"> <ul class="side_nav_bar_list">
<!-- active-class="current" -->
<router-link <router-link
tag="li" tag="li"
active-class="current"
v-for="(nav, index) in navList" v-for="(nav, index) in navList"
:class="{ current: $route.path.indexOf(nav.path) > -1 }" :class="{ current: $route.path.indexOf(nav.path) > -1 }"
:key="'nav' + index" :key="'nav' + index"
......
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
this.navList = this.fwglNav[level].map((item, index) => ({ this.navList = this.fwglNav[level].map((item, index) => ({
name: item, name: item,
path: `/fwgl/list/${level}/${index}`, path: `/fwgl/${level}/${index}`,
})); }));
}, },
}, },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
class="r_yhgl_table" class="r_yhgl_table"
size="mini" size="mini"
url="tableData" url="tableData"
:detailsUrl="`/fwgl/servicedetail/${level}/`" :detailsUrl="detailsUrl"
:border="false" :border="false"
:headers="headers" :headers="headers"
:searchShow="true" :searchShow="true"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
@action-sold-out="soldOutItem" @action-sold-out="soldOutItem"
@action-sold-out-2="soldOutItem2" @action-sold-out-2="soldOutItem2"
@action-cancel="cancelItem" @action-cancel="cancelItem"
@action-examine="examineItem" @action-approval="approvalItem"
@action-detail="detailItem" @action-detail="detailItem"
@action-allot="allotItem" @action-allot="allotItem"
></ces-table> ></ces-table>
...@@ -47,7 +47,6 @@ export default { ...@@ -47,7 +47,6 @@ export default {
type: 0, // 访问的页面 type: 0, // 访问的页面
headers: [], headers: [],
url: "", url: "",
detailsUrl: "ss/",
confirmOptions: { confirmOptions: {
title: "", title: "",
message: "", message: "",
...@@ -99,6 +98,17 @@ export default { ...@@ -99,6 +98,17 @@ export default {
pathName() { pathName() {
return this.fwglNav[this.level][this.type]; return this.fwglNav[this.level][this.type];
}, },
detailsUrl() {
let url = "";
if (this.level == 0 && this.type == 0) {
url = `/fwgl/${this.level}/${this.type}/servicedetail/`;
} else if (this.level == 0 && this.type == 1) {
url = `/fwgl/${this.level}/${this.type}/applyserviceedit/`;
}
return url;
},
}, },
components: { components: {
cesTable, cesTable,
...@@ -173,7 +183,7 @@ export default { ...@@ -173,7 +183,7 @@ export default {
// 普通用户 --- 审批的服务 // 普通用户 --- 审批的服务
else if (level == 0 && type == 2) { else if (level == 0 && type == 2) {
this.headers = [ this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" }, { label: "服务名称", prop: "name", type: "", align: "left" },
{ label: "服务领域", prop: "address", type: "", align: "center" }, { label: "服务领域", prop: "address", type: "", align: "center" },
{ label: "开放程度", prop: "address", type: "", align: "center" }, { label: "开放程度", prop: "address", type: "", align: "center" },
{ label: "请求方式", prop: "address", type: "", align: "center" }, { label: "请求方式", prop: "address", type: "", align: "center" },
...@@ -188,7 +198,7 @@ export default { ...@@ -188,7 +198,7 @@ export default {
width: 160, width: 160,
btnList: [ btnList: [
{ {
type: "action-examine", type: "action-approval",
label: "审批", label: "审批",
line: "|", line: "|",
}, },
...@@ -203,7 +213,7 @@ export default { ...@@ -203,7 +213,7 @@ export default {
// 普通用户 --- 云资源服务 // 普通用户 --- 云资源服务
else if (level == 0 && type == 3) { else if (level == 0 && type == 3) {
this.headers = [ this.headers = [
{ label: "工作区域", prop: "name", type: "href", align: "center" }, { label: "工作区域", prop: "name", type: "", align: "center" },
{ label: "网络环境", prop: "name", type: "", align: "center" }, { label: "网络环境", prop: "name", type: "", align: "center" },
{ label: "CPU(核)", prop: "name", type: "", align: "center" }, { label: "CPU(核)", prop: "name", type: "", align: "center" },
{ label: "内存(GB)", prop: "name", type: "", align: "center" }, { label: "内存(GB)", prop: "name", type: "", align: "center" },
...@@ -257,7 +267,7 @@ export default { ...@@ -257,7 +267,7 @@ export default {
width: 160, width: 160,
btnList: [ btnList: [
{ {
type: "action-examine", type: "action-approval",
label: "审批", label: "审批",
line: "|", line: "|",
}, },
...@@ -347,7 +357,7 @@ export default { ...@@ -347,7 +357,7 @@ export default {
width: 160, width: 160,
btnList: [ btnList: [
{ {
type: "action-examine", type: "action-approval",
label: "审批", label: "审批",
line: "|", line: "|",
}, },
...@@ -400,7 +410,7 @@ export default { ...@@ -400,7 +410,7 @@ export default {
}, },
editItem(item) { editItem(item) {
this.$router.push( this.$router.push(
`/fwgl/serviceedit/${this.$route.params.level}/${item.id}` `/fwgl/${this.level}/${this.type}/serviceedit/${item.id}`
); );
}, },
soldOutItem(item) { soldOutItem(item) {
...@@ -429,8 +439,10 @@ export default { ...@@ -429,8 +439,10 @@ export default {
cancelItem(item) { cancelItem(item) {
console.log("cancelItem - " + item.name); console.log("cancelItem - " + item.name);
}, },
examineItem(item) { approvalItem(item) {
console.log("examineItem - " + item.name); this.$router.push(
`/fwgl/${this.level}/${this.type}/approvalserviceedit/${item.id}`
);
}, },
detailItem(item) { detailItem(item) {
console.log("detailItem - " + item.name); console.log("detailItem - " + item.name);
......
...@@ -40,34 +40,34 @@ export default new Router({ ...@@ -40,34 +40,34 @@ export default new Router({
{ {
path: "/fwgl/:level", // 服务管理 level:用户等级 path: "/fwgl/:level", // 服务管理 level:用户等级
name: "fwgl", name: "fwgl",
redirect: "/fwgl/list/:level/0", redirect: "/fwgl/:level/0",
component: () => import("@/pages/fwgl"), component: () => import("@/pages/fwgl"),
children: [ children: [
{ {
path: "/fwgl/list/:level/:type", // 服务管理/我的服务 path: "/fwgl/:level/:type", // 服务管理列表页
name: "fwglList", name: "fwglList",
component: () => import("@/pages/fwglList"), component: () => import("@/pages/fwglList"),
}, },
{ {
path: "/fwgl/servicedetail/:level/:id", path: "/fwgl/:level/:type/servicedetail/:id",
name: "servicedetail", name: "servicedetail",
component: () => import("@/pages/serviceDetail"), component: () => import("@/pages/serviceDetail"),
}, }, // 注册发布的服务 - 详情
{ {
path: "/fwgl/serviceedit/:level/:id", path: "/fwgl/:level/:type/serviceedit/:id",
name: "serviceedit", name: "serviceedit",
component: () => import("@/pages/serviceEdit"), component: () => import("@/pages/serviceEdit"),
}, }, // 注册发布的服务 - 编辑
{ {
path: "/fwgl/applyserviceedit/:id", path: "/fwgl/:level/:type/applyserviceedit/:id",
name: "applyserviceedit", name: "applyserviceedit",
component: () => import("@/pages/apply_service_detail"), component: () => import("@/pages/apply_service_detail"),
}, }, // 申请的服务 - 详情
{ {
path: "/fwgl/approvalserviceedit/:id", path: "/fwgl/:level/:type/approvalserviceedit/:id",
name: "approvalserviceedit", name: "approvalserviceedit",
component: () => import("@/pages/approval_service_detail"), component: () => import("@/pages/approval_service_detail"),
}, }, // 审批的服务 - 详情
], ],
}, },
{ {
......
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