master
loveflow 1 year ago
parent 8ef8e63eea
commit a82dc8d046

@ -4,6 +4,19 @@
</div>
</template>
<script>
export default {
data(){
return{}
},
created(){
this.$router.push({
path:"/recordManage"
})
}
}
</script>
<style lang="less">
* {
box-sizing: border-box;

@ -5,7 +5,6 @@
<el-table-column
v-if="item.slot"
:key="item.prop + index"
:prop="item.prop"
:label="item.label"
v-bind="item.attrs || {}"
>
@ -25,6 +24,14 @@
</el-table-column>
</template>
</el-table>
<div class="gPagination" v-if="pagination">
<el-pagination
v-bind="{ ...pagination }"
@size-change="pageSizeChange"
@current-change="currentPageChange"
></el-pagination>
</div>
</div>
</template>
<script>
@ -39,9 +46,31 @@ export default {
type: Array,
required: true,
},
pagination: {
type: Object,
required: false,
},
},
data() {
return {};
},
methods: {
//
pageSizeChange() {
this.$emit("")
},
//
currentPageChange() {},
},
};
</script>
<style lang="less">
.gMainTable {
.gPagination {
display: flex;
justify-content: flex-end;
padding: 10px 10px;
background-color: #fff;
}
}
</style>

@ -1,6 +1,6 @@
import { deleteAction, getAction, downFile } from "../api/manage";
const tableListMixins = {
export const tableListMixins = {
data() {
return {
/* 查询条件 */
@ -9,14 +9,10 @@ const tableListMixins = {
dataSource: [],
/* 分页参数 */
ipagination: {
current: 1,
currentPage: 1,
pageSize: 10,
pageSizeOptions: ["10", "20", "30"],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条";
},
showQuickJumper: true,
showSizeChanger: true,
pageSizes: ["10", "20", "30"],
layout: "total, sizes, prev, pager, next, jumper",
total: 0,
},
/* 排序参数 */
@ -47,6 +43,9 @@ const tableListMixins = {
});
}
},
//每页条数发生改变
handlePageSizeChange() {},
//当前页码发生改变
handleCurrentPageChange() {},
},
};
export default tableListMixins;

@ -5,10 +5,8 @@ import box from '../components/box'
Vue.use(VueRouter)
import systemManagement from './routes/systemManagement'
import module from './routes/module'
import enterpriseManage from './routes/enterpriseManage'
const routes = [
...enterpriseManage,
{
path: '/',
name: 'box',
@ -101,6 +99,11 @@ const routes = [
name: 'login',
component: () => import('@/components/login'),
},
{
path: "/recordManage",
name: "recordManage",
component: () => import("@/views/enterpriseManage/recordManage/index"),
},
]
}]
console.log(routes)

@ -4,7 +4,19 @@
<el-button @click="add"></el-button>
<gMainTable :tableData="dataSource" :columns="columns"></gMainTable>
<div style="width: 800px">
<gMainTable
:tableData="dataSource"
:columns="columns"
:pagination="ipagination"
@pageSizeChange="handlePageSizeChange"
@currentPageChange="handleCurrentPageChange"
>
<template v-slot:vaeSlot="{ scope }">
<el-button type="primary">{{ scope.row.name }}</el-button>
</template>
</gMainTable>
</div>
<form-dialog
ref="formDialog"
@ -19,8 +31,8 @@
</template>
<script>
import { deleteAction, getAction, downFile } from "@/loveflow/api/manage";
import { tableListMixins } from "@/loveflow/mixins/tableList.global.mixins.js";
//import { deleteAction, getAction, downFile } from "@/loveflow/api/manage";
import { tableListMixins } from "@/loveflow/mixins/tableListMixins";
export default {
mixins: [tableListMixins],
data() {
@ -34,6 +46,11 @@ export default {
prop: "name",
label: "姓名",
},
{
slot: "vaeSlot",
prop: "name",
label: "自定义",
},
],
formItems: [
{

Loading…
Cancel
Save