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

服务管理列表优化

parent 0e7a5982
......@@ -115,12 +115,14 @@
<span v-if="item.type === 'Button'">
<b v-for="(btn, key) in item.btnList" :key="key">
<em
class="action"
v-if="btn.label == '分配'||btn.label == '已分配'"
>
<em v-if="btn.label == '分配'&&scope.row.state == 0" style="color: #0f2683" @click="handleClick(btn.type, scope.row)">{{ btn.label }}</em>
<em v-if="btn.label == '已分配'&&scope.row.state == 1">{{ btn.label }}</em>
</em>
<em
class="action"
v-else
:class="btn.type"
:style="{color: btn.label=='删除' ? '#830f53' : '#0f2683'}"
......@@ -601,6 +603,10 @@ export default {
}
em {
font-style: normal;
user-select: none;
}
em.action {
cursor: pointer;
}
.ces-table .el-table--mini td,
.ces-table .el-table--mini th {
......
<template>
<div class="fwgl_container">
<side-nav-bar :nav-list="navList" title-path="/fwgl"></side-nav-bar>
<side-nav-bar :nav-list="navList" :title-path="navList[0].path"></side-nav-bar>
<div class="main_container">
<router-view
:key="'type_' + $route.params && $route.params.type"
......
......@@ -8,19 +8,23 @@
<ces-table
class="r_yhgl_table"
size="mini"
url="tableData"
detailsUrl="/fwgl/servicedetail/"
:border="false"
:headers="headers"
url="tableData"
:searchShow="true"
:autoAdd="false"
detailsUrl="/fwgl/servicedetail/"
@primary-del="deleteItem"
@primary-edit="editItem"
@sold-out="soldOutItem"
:emptyText="emptyText"
:stripe="true"
:pageSizeShow="true"
:filterList="filterList"
:isIndex="false"
@action-delete="deleteItem"
@action-edit="editItem"
@action-sold-out="soldOutItem"
@action-cancel="cancelItem"
@action-examine="examineItem"
@action-detail="detailItem"
></ces-table>
</div>
<dialog-action
......@@ -114,50 +118,66 @@ export default {
};
this.$refs.myConfirm.showModel();
},
cancelItem(item) {
console.log("cancelItem - " + item.name);
},
examineItem(item) {
console.log("examineItem - " + item.name);
},
detailItem(item) {
console.log("detailItem - " + item.name);
},
confirmSubmit(item) {
console.log(item.name);
},
},
mounted() {
this.headers = [];
this.headers.push(
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务url", prop: "date", type: "href", align: "center" },
{ label: "开放程度", prop: "address", type: "href", align: "center" },
{ label: "服务描述", prop: "address", type: "href", align: "left" },
{ label: "注册发布时间", prop: "address", type: "href", align: "center" },
{ label: "服务类型", prop: "address", type: "href", align: "center" }
);
switch (parseInt(this.$route.params.type)) {
case 0:
this.headers.push({
this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务url", prop: "date", type: "", align: "center" },
{ label: "开放程度", prop: "address", type: "", align: "center" },
{ label: "服务描述", prop: "address", type: "", align: "left" },
{
label: "注册发布时间",
prop: "address",
type: "",
align: "center",
},
{ label: "服务类型", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
align: "center",
width: 240,
btnList: [
{
type: "primary-edit",
type: "action-edit",
label: "编辑",
line: "|",
},
{
type: "sold-out",
type: "action-sold-out",
label: "申请下架",
line: "|",
},
{
type: "primary-del",
type: "action-delete",
label: "删除",
},
],
});
},
];
break;
case 1:
this.headers.push(
{ label: "申请状态", prop: "address", type: "href", align: "center" },
this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务领域", prop: "date", type: "", align: "center" },
{ label: "开放程度", prop: "address", type: "", align: "center" },
{ label: "服务描述", prop: "address", type: "", align: "left" },
{ label: "申请时间", prop: "address", type: "", align: "left" },
{ label: "服务类型", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
......@@ -165,22 +185,28 @@ export default {
width: 160,
btnList: [
{
type: "sold-out",
type: "action-cancel",
label: "取消",
line: "|",
},
{
type: "primary-del",
type: "action-delete",
label: "删除",
},
],
}
);
},
];
break;
case 2:
this.headers.push(
{ label: "审批时间", prop: "address", type: "href", align: "center" },
{ label: "审批状态", prop: "address", type: "href", align: "center" },
this.headers = [
{ label: "服务名称", prop: "name", type: "href", 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: "left" },
{ label: "审批时间", prop: "address", type: "", align: "center" },
{ label: "服务类型", prop: "address", type: "", align: "center" },
{ label: "审批状态", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
......@@ -188,17 +214,78 @@ export default {
width: 160,
btnList: [
{
type: "sold-out",
type: "action-examine",
label: "审批",
line: "|",
},
{
type: "primary-del",
type: "action-delete",
label: "删除",
},
],
}
);
},
];
break;
case 3:
this.headers = [
{ label: "工作区域", prop: "name", type: "href", align: "left" },
{ label: "网络环境", 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" },
{ label: "实例数(个)", prop: "name", type: "", align: "center" },
{ label: "申请时间", prop: "name", type: "", align: "center" },
{ label: "申请状态", prop: "name", type: "", align: "center" },
{
label: "操作",
type: "Button",
align: "center",
width: 160,
btnList: [
{
type: "action-detail",
label: "查看详情",
},
],
},
];
break;
default:
this.headers = [
{ label: "服务名称", prop: "name", type: "href", align: "left" },
{ label: "服务url", prop: "date", type: "", align: "center" },
{ label: "开放程度", prop: "address", type: "", align: "center" },
{ label: "服务描述", prop: "address", type: "", align: "left" },
{
label: "注册发布时间",
prop: "address",
type: "",
align: "center",
},
{ label: "服务类型", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
align: "center",
width: 160,
btnList: [
{
type: "action-edit",
label: "编辑",
line: "|",
},
{
type: "action-sold-out",
label: "申请下架",
line: "|",
},
{
type: "action-delete",
label: "删除",
},
],
},
];
break;
}
},
......
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