Commit 3fb1c3c9 authored by 徐一鸣's avatar 徐一鸣

我的应用列表页

parent cd14bd33
<template> <template>
<div class="app_card"> <div class="app_card">
<a class="remove_btn" @click.prevent="deleteApp"> <a class="remove_btn" @click.prevent="deleteAction">
<i class="el-icon-close"></i> <i class="el-icon-close"></i>
</a> </a>
<div class="app_card-icon"> <div class="app_card-icon">
...@@ -10,18 +10,18 @@ ...@@ -10,18 +10,18 @@
<p class="app_card-name text_clip" v-text="data.name"></p> <p class="app_card-name text_clip" v-text="data.name"></p>
<p class="app_card-version text_clip" v-text="data.version"></p> <p class="app_card-version text_clip" v-text="data.version"></p>
</div> </div>
<div class="app_card-action"> <div class="app_card-action" v-if="cardType == 0">
<el-button type="primary" plain @click="deploymentAction"> <el-button type="primary" plain @click="deploymentAction">
一键部署 一键部署
</el-button> </el-button>
</div> </div>
<!-- <p class="app_card-text"> <p class="app_card-text" v-if="cardType == 1">
<span> <span>
<i class="el-icon-time"></i> <i class="el-icon-time"></i>
<span>上线时间:</span> <span>上线时间:</span>
</span> </span>
<span class="text_clip" v-text="data.time"></span> <span class="text_clip" v-text="data.time"></span>
</p> --> </p>
</div> </div>
</template> </template>
...@@ -32,13 +32,17 @@ export default { ...@@ -32,13 +32,17 @@ export default {
type: Object, type: Object,
default: {}, default: {},
}, },
cardType: {
type: [String, Number],
default: 0,
},
}, },
methods: { methods: {
deploymentAction() { deploymentAction() {
console.log("一键部署 --- " + this.data.id); this.$emit("deployment-action", this.data);
}, },
deleteApp() { deleteAction() {
console.log("删除应用 --- " + this.data.id); this.$emit("delete-action", this.data);
}, },
}, },
}; };
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
v-for="(item, index) in data" v-for="(item, index) in data"
:key="'app_card_' + index" :key="'app_card_' + index"
:data="item" :data="item"
:card-type="cardType"
@deployment-action="deploymentAction"
@delete-action="deleteAction"
></app-card> ></app-card>
</div> </div>
</template> </template>
...@@ -20,6 +23,18 @@ export default { ...@@ -20,6 +23,18 @@ export default {
type: Array, type: Array,
default: [], default: [],
}, },
cardType: {
type: [String, Number],
default: 0,
},
},
methods: {
deploymentAction(item) {
this.$emit("deployment-action", item);
},
deleteAction(item) {
this.$emit("delete-action", item);
},
}, },
}; };
</script> </script>
......
<template> <template>
<div class="side_nav_bar"> <div class="side_nav_bar">
<h3 class="side_nav_bar_title" @click="titleAction"> <h3 class="side_nav_bar_title" @click="titleAction">
<img <img :src="titleIcon" width="20" style="margin-right: 10px;" />
:src="require('../assets/imgs/tool_fuwu.png')"
width="20"
style="margin-right: 10px;"
/>
<span v-text="title"></span> <span v-text="title"></span>
</h3> </h3>
<ul class="side_nav_bar_list"> <ul class="side_nav_bar_list">
...@@ -31,6 +27,10 @@ export default { ...@@ -31,6 +27,10 @@ export default {
type: String, type: String,
default: () => "我的服务", default: () => "我的服务",
}, },
titleIcon: {
type: String,
default: () => require("../assets/imgs/tool_fuwu.png"),
},
titlePath: { titlePath: {
type: String, type: String,
default: () => "", default: () => "",
......
...@@ -30,18 +30,17 @@ ...@@ -30,18 +30,17 @@
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
v-if="searchShow" v-if="searchShow"
v-model="search" v-model="search"
placeholder="请输入账号、中文名" :placeholder="inputPlaceholder"
style="max-width:220px;" style="width:180px;"
size="mini"
@input="searchVal" @input="searchVal"
class="ces_toolbar_inp" class="ces_toolbar_inp"
></el-input> ></el-input>
</div> </div>
<v-apaas-table-filter <v-apaas-table-filter
:show="showFliterList" :show="showFliterList"
:filter-list="filterList" :filter-list="filterList"
@filter-change="filterChange" @filter-change="filterChange"
></v-apaas-table-filter> ></v-apaas-table-filter>
<el-table <el-table
:data="selectedTabsPage" :data="selectedTabsPage"
:size="size" :size="size"
...@@ -104,6 +103,28 @@ ...@@ -104,6 +103,28 @@
</em> </em>
</em> </em>
<em v-if="btn.type == 'goods-shelf'">
<em
v-if="scope.row.state == 0"
class="cur_pointer"
style="color: #0f2683"
@click="handleClick(btn.type, scope.row)"
>
上架
</em>
<em
v-if="scope.row.state == 1"
class="cur_pointer"
style="color: #0f2683"
@click="handleClick(btn.type, scope.row)"
>
下架
</em>
<em v-if="scope.row.state == 2">
下架
</em>
</em>
<em <em
class="cur_pointer" class="cur_pointer"
v-else-if="btn.label == '删除' && btn.local" v-else-if="btn.label == '删除' && btn.local"
...@@ -237,7 +258,7 @@ export default { ...@@ -237,7 +258,7 @@ export default {
"v-apaas-table-select": tableSelect, "v-apaas-table-select": tableSelect,
"v-apaas-table-umhref": tableUmhref, "v-apaas-table-umhref": tableUmhref,
"d-confirm": DConfirm, "d-confirm": DConfirm,
"v-apaas-table-filter": tableFilter "v-apaas-table-filter": tableFilter,
}, },
props: { props: {
// 表格型号:mini,medium,small // 表格型号:mini,medium,small
...@@ -264,6 +285,10 @@ export default { ...@@ -264,6 +285,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
inputPlaceholder: {
type: String,
default: "请输入账号、中文名",
},
url: { url: {
type: String, type: String,
default: "", default: "",
...@@ -515,7 +540,7 @@ export default { ...@@ -515,7 +540,7 @@ export default {
}, },
filterChange(filter) { filterChange(filter) {
console.log(filter); console.log(filter);
} },
}, },
}; };
</script> </script>
...@@ -669,9 +694,6 @@ em { ...@@ -669,9 +694,6 @@ em {
.ces_toolbar .ces_toolbar_btn { .ces_toolbar .ces_toolbar_btn {
margin-right: 10px; margin-right: 10px;
} }
.ces_toolbar .ces_toolbar_inp {
margin-right: 10px;
}
.ces-pagination { .ces-pagination {
margin-top: 20px; margin-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
......
...@@ -392,10 +392,9 @@ export default { ...@@ -392,10 +392,9 @@ export default {
}, },
]; ];
} }
// Error // Error
else { else {
this.headers = [];
throw Error("The page doesn't exist"); throw Error("The page doesn't exist");
} }
}, },
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
<div class="yygl_container"> <div class="yygl_container">
<side-nav-bar <side-nav-bar
:nav-list="navList" :nav-list="navList"
title="我的应用"
:title-icon="require('../assets/imgs/tool_yingyong.png')"
:title-path="navList[0] && navList[0].path" :title-path="navList[0] && navList[0].path"
></side-nav-bar> ></side-nav-bar>
<div class="main_container"> <div class="main_container">
......
...@@ -6,21 +6,31 @@ ...@@ -6,21 +6,31 @@
<el-breadcrumb-item>{{ pathName }}</el-breadcrumb-item> <el-breadcrumb-item>{{ pathName }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="main_container"> <div class="main_container card" v-if="listType == 'card'">
<div class="filter_contaner"> <div class="filter_contaner">
<el-button <div class="filter_action">
v-if="filterList && filterList.length" <el-button
size="small" v-if="filterList && filterList.length"
@click="showFliterList = !showFliterList" size="small"
> @click="showFliterList = !showFliterList"
{{ showFliterList ? "收起" : "筛选" }} >
<i {{ showFliterList ? "收起" : "筛选" }}
class="el-icon--right" <i
:class=" class="el-icon--right"
showFliterList ? 'el-icon-caret-bottom' : 'el-icon-caret-top' :class="
" showFliterList ? 'el-icon-caret-bottom' : 'el-icon-caret-top'
></i> "
</el-button> ></i>
</el-button>
<el-input
v-model="search"
prefix-icon="el-icon-search"
placeholder="请输入应用名称"
style="width:180px;"
@input="searchChange"
class="ces_toolbar_inp"
></el-input>
</div>
<table-filter <table-filter
:show="showFliterList" :show="showFliterList"
:filter-list="filterList" :filter-list="filterList"
...@@ -28,7 +38,13 @@ ...@@ -28,7 +38,13 @@
style="margin-top: 5px;" style="margin-top: 5px;"
></table-filter> ></table-filter>
</div> </div>
<app-list :data="appList"></app-list> <app-list
:data="appList"
:card-type="cardType"
@deployment-action="deploymentAction"
@delete-action="deleteAction"
></app-list>
<div class="flex_grow"></div>
<comments-pagination <comments-pagination
:total="100" :total="100"
:page-sizes="pageSizes" :page-sizes="pageSizes"
...@@ -38,13 +54,41 @@ ...@@ -38,13 +54,41 @@
@current-change="changeCurrentPage" @current-change="changeCurrentPage"
></comments-pagination> ></comments-pagination>
</div> </div>
<div class="main_container" v-if="listType == 'table'">
<ces-table
class="r_yhgl_table"
size="mini"
url="tableData"
input-placeholder="请输入应用名称"
empty-text="暂时没数据"
:detailsUrl="detailsUrl"
:border="false"
:headers="headers"
:searchShow="true"
:autoAdd="false"
:stripe="true"
:pageSizeShow="true"
:filterList="filterList"
:isIndex="false"
@action-approval="approvalItem"
@action-delete="deleteItem"
@action-edit="editItem"
@off-line="offLine"
@goods-shelf="goodsShelf"
style="margin-top: 44px;"
></ces-table>
</div>
<dialog-action
ref="myConfirm"
:confirm-options="confirmOptions"
></dialog-action>
</div> </div>
</template> </template>
<script> <script>
import tableFilter from "@/components/table-filter"; import tableFilter from "@/components/table-filter";
import appList from "@/components/app-list"; import appList from "@/components/app-list";
import tableUm from "@/components/table-um"; import cesTable from "@/components/table-um";
import dialogAction from "@/components/dialog-action"; import dialogAction from "@/components/dialog-action";
import commentsPagination from "@/components/comments-pagination"; import commentsPagination from "@/components/comments-pagination";
import { mapState } from "vuex"; import { mapState } from "vuex";
...@@ -53,13 +97,15 @@ export default { ...@@ -53,13 +97,15 @@ export default {
components: { components: {
tableFilter, tableFilter,
appList, appList,
tableUm, cesTable,
dialogAction, dialogAction,
commentsPagination, commentsPagination,
}, },
data: () => ({ data: () => ({
level: 0, // 用户等级 level: 0, // 用户等级
type: 0, // 访问的页面 type: 0, // 访问的页面
listType: "",
cardType: "",
showFliterList: false, showFliterList: false,
filterList: [ filterList: [
{ {
...@@ -172,9 +218,17 @@ export default { ...@@ -172,9 +218,17 @@ export default {
time: "2019-04-11 12:50:30", time: "2019-04-11 12:50:30",
}, },
], ],
search: "",
pageSizes: [10, 50, 100], pageSizes: [10, 50, 100],
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
confirmOptions: {
title: "",
message: "",
btnCancelText: "",
btnSubmitText: "",
item: null,
},
}), }),
computed: { computed: {
...mapState({ ...mapState({
...@@ -183,11 +237,53 @@ export default { ...@@ -183,11 +237,53 @@ export default {
pathName() { pathName() {
return this.yyglNav[this.level][this.type]; return this.yyglNav[this.level][this.type];
}, },
detailsUrl() {
let url = "";
if (this.level == 0 && this.type == 1) {
url = `/fwgl/${this.level}/${this.type}/applyserviceedit/`;
} else {
url = `/fwgl/${this.level}/${this.type}/servicedetail/`;
}
return url;
},
}, },
methods: { methods: {
searchChange(value) {
console.log(value);
},
filterChange(filter) { filterChange(filter) {
console.log(filter); console.log(filter);
}, },
deploymentAction(item) {
console.log("deployment " + item.name);
},
deleteAction(item) {
if (this.cardType === 0) {
this.confirmOptions.title = "删除提示";
this.confirmOptions.message =
"您需要先进行应用商店下架申请,应用处于下架状态时才能进行删除操作。";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "";
this.confirmOptions.confirmSubmit = () => {
console.log("deleteItem - " + item.name);
this.$refs.myConfirm.hideModel();
};
} else if (this.cardType === 1) {
this.confirmOptions.title = "是否删除部署的应用";
this.confirmOptions.message =
"该操作会导致正在调用该应用的用户被迫终止对应用的调用,删除前需向正在调用该应用的用户发送通知,自通知发送之日起,2日后应用将被删除。";
this.confirmOptions.btnCancelText = "";
this.confirmOptions.btnSubmitText = "发送通知";
this.confirmOptions.confirmSubmit = () => {
console.log("deleteItem - " + item.name);
this.$refs.myConfirm.hideModel();
};
}
this.$refs.myConfirm.showModel();
},
changePageSize(value) { changePageSize(value) {
this.pageSize = value; this.pageSize = value;
this.currentPage = 1; this.currentPage = 1;
...@@ -195,16 +291,249 @@ export default { ...@@ -195,16 +291,249 @@ export default {
changeCurrentPage(value) { changeCurrentPage(value) {
this.currentPage = value; this.currentPage = value;
}, },
approvalItem(item) {
console.log("approval --- " + item.id);
},
deleteItem(item) {
console.log("delete --- " + item.id);
},
editItem(item) {
console.log("edit --- " + item.id);
/* this.$router.push(
`/fwgl/${this.level}/${this.type}/serviceedit/${item.id}`
); */
},
offLine(item) {
console.log("off line --- " + item.id);
},
goodsShelf(item) {
console.log("goods shelf", item.state);
},
}, },
created() { created() {
this.level = parseInt(this.$route.params.level); this.level = parseInt(this.$route.params.level);
this.type = parseInt(this.$route.params.type); this.type = parseInt(this.$route.params.type);
let level = this.level;
let type = this.type;
// 普通用户 --- 应用仓库 card列表形式
if (level === 0 && type === 0) {
this.listType = "card";
this.cardType = 0;
}
// 普通用户 --- 我部署的应用
else if (level === 0 && type === 1) {
this.listType = "card";
this.cardType = 1;
}
// 普通用户 --- 申请的应用 card列表形式
else if (level === 0 && type === 2) {
this.listType = "table";
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: "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" },
];
}
// 普通用户 --- 审批的应用
else if (level === 0 && type === 3) {
this.listType = "table";
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: "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: "操作",
type: "Button",
align: "center",
width: 160,
btnList: [
{
type: "action-approval",
label: "审批",
line: "|",
},
{
type: "action-delete",
label: "删除",
},
],
},
];
}
// 组织管理员 --- 应用仓库管理
else if (level === 1 && type === 0) {
this.listType = "table";
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: "center" },
{ label: "在线状态", prop: "address", type: "", align: "center" },
{ label: "创建时间", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
align: "center",
width: 160,
btnList: [
{
type: "goods-shelf",
},
],
},
];
}
// 组织管理员 --- 部署的应用
else if (level === 1 && type === 1) {
this.listType = "table";
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: "center" },
{ label: "上架区域", prop: "address", type: "", align: "center" },
{ label: "部署时间", prop: "address", type: "", align: "center" },
{ label: "部署区域", prop: "address", type: "", align: "center" },
];
}
// 组织管理员 --- 应用审批管理
else if (level === 1 && type === 2) {
this.listType = "table";
this.headers = [
{ label: "应用名称", prop: "name", type: "", align: "left" },
{ label: "应用版本", prop: "date", 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" },
{ label: "申请状态", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
align: "center",
width: 160,
btnList: [
{
type: "action-approval",
label: "审批",
line: "|",
},
{
type: "action-delete",
label: "删除",
},
],
},
];
}
// 超级管理员 --- 平台应用管理
else if (level === 2 && type === 0) {
this.listType = "table";
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: "center" },
{ label: "在线状态", prop: "address", type: "", align: "center" },
{ label: "所属组织", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
align: "center",
width: 240,
btnList: [
{
type: "action-edit",
label: "编辑",
line: "|",
},
{
type: "off-line",
label: "下线",
line: "|",
},
{
type: "action-delete",
label: "删除",
},
],
},
];
}
// 超级管理员 --- 应用部署管理
else if (level === 2 && type === 1) {
this.listType = "table";
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: "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" },
];
}
// 超级管理员 --- 应用审批管理
else if (level === 2 && type === 2) {
this.listType = "table";
this.headers = [
{ label: "应用名称", prop: "name", type: "", align: "left" },
{ label: "应用版本", prop: "date", 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" },
{ label: "申请状态", prop: "address", type: "", align: "center" },
{
label: "操作",
type: "Button",
align: "center",
width: 160,
btnList: [
{
type: "action-approval",
label: "审批",
line: "|",
},
{
type: "action-delete",
label: "删除",
},
],
},
];
}
// Error
else {
throw Error("The page doesn't exist");
}
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.list_container { .list_container {
height: 100%;
padding: 0 20px; padding: 0 20px;
} }
.main_container { .main_container {
...@@ -214,7 +543,18 @@ export default { ...@@ -214,7 +543,18 @@ export default {
overflow: hidden; overflow: hidden;
background-color: #fff; background-color: #fff;
} }
.main_container .ces-table-page { .main_container.card {
margin-top: 18px; display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
}
.flex_grow {
flex-grow: 1;
}
.filter_action {
display: flex;
justify-content: space-between;
align-items: center;
} }
</style> </style>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
"name": "王小虎", "name": "王小虎",
"address": "0", "address": "0",
"id": "ssss22", "id": "ssss22",
"state": 0 "state": 2
} }
], ],
"tableData1": [ "tableData1": [
......
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