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

我的服务页面优化

parent 40ef749f
...@@ -7,27 +7,35 @@ ...@@ -7,27 +7,35 @@
top="25vh" top="25vh"
> >
<h3 class="dialog_title" slot="title"> <h3 class="dialog_title" slot="title">
<span v-text="title"></span> <span v-text="title || '提示'"></span>
</h3> </h3>
<div v-if="$slots.content" class="dialog_content appas_table"> <div class="dialog_content appas_table" v-if="$slots.content">
<slot name="content"></slot> <slot name="content"></slot>
</div> </div>
<p v-else class="dialog_msg" v-text="msg"></p> <p class="dialog_msg" v-html="msg" v-else></p>
<div <div
v-if="$slots.action"
slot="footer" slot="footer"
class="dialog_action apass_button" class="dialog_action apass_button"
v-if="$slots.action"
> >
<slot name="action"></slot> <slot name="action"></slot>
</div> </div>
<div v-else slot="footer" class="dialog_action apass_button"> <div slot="footer" class="dialog_action apass_button" v-else>
<el-button type="defalut" size="mini" @click="hide"> <el-button
取消 type="defalut"
size="mini"
v-text="cancelText || '取消'"
@click="hide"
>
</el-button> </el-button>
<el-button type="primary" size="mini" @click="dialogSubmit"> <el-button
确定 type="primary"
size="mini"
v-text="sunbmitText || '确定'"
@click="dialogSubmit"
>
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -40,16 +48,28 @@ export default { ...@@ -40,16 +48,28 @@ export default {
props: { props: {
width: { width: {
type: String, type: String,
default: () => "400px", default: () => "420px",
}, },
title: { title: {
type: String, type: String,
default: () => "提示", default: () => "",
}, },
msg: { msg: {
type: String, type: String,
default: () => "", default: () => "",
}, },
cancelText: {
type: String,
default: () => "",
},
sunbmitText: {
type: String,
default: () => "",
},
submit: {
type: Function,
default: () => null,
},
}, },
data: () => ({ data: () => ({
showDialog: false, showDialog: false,
...@@ -62,7 +82,11 @@ export default { ...@@ -62,7 +82,11 @@ export default {
this.showDialog = false; this.showDialog = false;
}, },
dialogSubmit() { dialogSubmit() {
if (typeof this.submit === "function") {
this.submit();
} else {
this.$emit("submit"); this.$emit("submit");
}
this.hide(); this.hide();
}, },
}, },
......
...@@ -6,6 +6,18 @@ ...@@ -6,6 +6,18 @@
<div class="main-container"> <div class="main-container">
<div class="header-container" v-if="!hideHeader"> <div class="header-container" v-if="!hideHeader">
<div class="header-left apass_button"> <div class="header-left apass_button">
<el-button
v-if="listFilter.length"
@click="showListFilter = !showListFilter"
>
{{ showListFilter ? "收起" : "筛选" }}
<i
class="el-icon--right"
:class="
showListFilter ? 'el-icon-caret-bottom' : 'el-icon-caret-top'
"
></i>
</el-button>
<slot name="header-left"></slot> <slot name="header-left"></slot>
</div> </div>
<div class="header-center"> <div class="header-center">
...@@ -13,7 +25,7 @@ ...@@ -13,7 +25,7 @@
</div> </div>
<div class="header-right"> <div class="header-right">
<el-input <el-input
v-model="searchFilter" v-model="searchValue"
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
:placeholder="searchPlaceholder" :placeholder="searchPlaceholder"
style="width:240px;" style="width:240px;"
...@@ -21,10 +33,28 @@ ...@@ -21,10 +33,28 @@
></el-input> ></el-input>
</div> </div>
</div> </div>
<list-filter
v-if="!hideHeader"
class="apass_filter"
:show="showListFilter"
:filter-list="listFilter"
@filter-change="filterChange"
></list-filter>
<div class="cross_line" v-if="!hideHeader"></div> <div class="cross_line" v-if="!hideHeader"></div>
<div class="list-container appas_table">
<div class="list-container appas_table" v-if="$slots.content">
<slot name="list"></slot> <slot name="list"></slot>
</div> </div>
<div class="list-container appas_table" v-else>
<list-table
:header="listHeader"
:data="listData"
:padding-left="35"
></list-table>
</div>
<list-pagination <list-pagination
:total="listTotal" :total="listTotal"
:page-sizes="pageSizes" :page-sizes="pageSizes"
...@@ -38,28 +68,49 @@ ...@@ -38,28 +68,49 @@
</template> </template>
<script> <script>
import listTable from "@/components/apass-table";
import ListPagination from "@/components/comments-pagination"; import ListPagination from "@/components/comments-pagination";
import ListFilter from "@/components/table-filter";
export default { export default {
components: { components: {
ListFilter,
listTable,
ListPagination, ListPagination,
}, },
props: { props: {
listFilter: {
type: Array,
default: () => [],
},
listHeader: {
type: Array,
default: () => [],
},
listData: {
type: Array,
default: () => [],
},
listPaddingLeft: {
type: [Number, String],
},
listTotal: { listTotal: {
type: Number, type: Number,
default: 0, default: () => 0,
}, },
hideHeader: { hideHeader: {
type: Boolean, type: Boolean,
default: false, default: () => false,
}, },
searchPlaceholder: { searchPlaceholder: {
type: String, type: String,
default: "请输入关键字" default: () => "请输入关键字",
} },
}, },
data: () => ({ data: () => ({
searchFilter: "", showListFilter: false,
filter: {},
searchValue: "",
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
timer: null, timer: null,
...@@ -69,6 +120,10 @@ export default { ...@@ -69,6 +120,10 @@ export default {
searchAction(value) { searchAction(value) {
this.listAction(); this.listAction();
}, },
filterChange(filter) {
this.filter = filter;
this.listAction();
},
changePageSize(value) { changePageSize(value) {
this.pageSize = value; this.pageSize = value;
this.currentPage = 1; this.currentPage = 1;
...@@ -85,13 +140,17 @@ export default { ...@@ -85,13 +140,17 @@ export default {
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.$emit("list-action", { this.$emit("list-action", {
filter: this.searchFilter, ...this.filter,
pageSize: this.pageSize, keyword: this.searchValue,
currentPage: this.currentPage, size: this.pageSize,
page: this.currentPage,
}); });
}, 200); }, 200);
}, },
}, },
mounted() {
this.listAction();
},
}; };
</script> </script>
...@@ -125,6 +184,9 @@ export default { ...@@ -125,6 +184,9 @@ export default {
.header-container .el-button + .el-button { .header-container .el-button + .el-button {
margin-left: 25px; margin-left: 25px;
} }
.apass_filter {
margin-top: 10px;
}
.cross_line { .cross_line {
border-top: 1px solid #e3e5ef; border-top: 1px solid #e3e5ef;
margin: 20px -20px 0; margin: 20px -20px 0;
......
<template>
<div class="appas_table">
<el-table slot="list" :border="false" :data="data">
<el-table-column :width="paddingLeft - 10"></el-table-column>
<el-table-column
v-for="(item, index) in header"
:label="item.label"
:align="item.align || 'left'"
:width="item.width"
:key="'head_' + index"
>
<template slot-scope="scope">
<div v-if="item.type === 'buttons'" class="row_action">
<template v-for="(v, i) in item.actionList">
<a
class="btn"
:class="{ warn: v.label === '删除' }"
:key="'btn_' + index + '_' + i"
@click="v.callback && v.callback(scope.row)"
v-text="v.label"
>
</a>
<span
v-if="i < item.actionList.length - 1"
class="interval_line"
:key="'line_' + index + '_' + i"
>|</span
>
</template>
</div>
<div v-else-if="item.type === 'button'" class="row_action">
<a
class="btn"
v-text="scope.row[item.prop]"
@click="item.callback && item.callback(scope.row)"
></a>
</div>
<span v-else v-text="scope.row[item.prop]"></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props: {
header: {
type: Array,
default: () => [],
},
data: {
type: Array,
default: () => [],
},
paddingLeft: {
type: [Number, String],
default: () => 50,
},
},
};
</script>
This diff is collapsed.
...@@ -7,7 +7,7 @@ const store = new Vuex.Store({ ...@@ -7,7 +7,7 @@ const store = new Vuex.Store({
role: 2, // 0:普通用户,1:组织管理员,2:超级管理员 role: 2, // 0:普通用户,1:组织管理员,2:超级管理员
serviceShopMenu: "shopDataList", // 服务超市侧边栏 serviceShopMenu: "shopDataList", // 服务超市侧边栏
fwglNav: [ fwglNav: [
["注册发布的服务", "申请的服务", "审批的服务", "云资源服务"], // 普通用户 ["注册发布的服务", "申请的服务", "云资源服务"], // 普通用户
["组织服务管理", "服务审批管理", "云资源管理"], // 组织管理员 ["组织服务管理", "服务审批管理", "云资源管理"], // 组织管理员
["平台服务管理", "服务审批管理", "云资源管理"], // 超级管理员 ["平台服务管理", "服务审批管理", "云资源管理"], // 超级管理员
], // 服务管理列表,onlyRead ], // 服务管理列表,onlyRead
......
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