master
loveflow 1 year ago
parent 8ef8e63eea
commit a82dc8d046

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

@ -5,7 +5,6 @@
<el-table-column <el-table-column
v-if="item.slot" v-if="item.slot"
:key="item.prop + index" :key="item.prop + index"
:prop="item.prop"
:label="item.label" :label="item.label"
v-bind="item.attrs || {}" v-bind="item.attrs || {}"
> >
@ -25,6 +24,14 @@
</el-table-column> </el-table-column>
</template> </template>
</el-table> </el-table>
<div class="gPagination" v-if="pagination">
<el-pagination
v-bind="{ ...pagination }"
@size-change="pageSizeChange"
@current-change="currentPageChange"
></el-pagination>
</div>
</div> </div>
</template> </template>
<script> <script>
@ -39,9 +46,31 @@ export default {
type: Array, type: Array,
required: true, required: true,
}, },
pagination: {
type: Object,
required: false,
},
}, },
data() { data() {
return {}; return {};
}, },
methods: {
//
pageSizeChange() {
this.$emit("")
},
//
currentPageChange() {},
},
}; };
</script> </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"; import { deleteAction, getAction, downFile } from "../api/manage";
const tableListMixins = { export const tableListMixins = {
data() { data() {
return { return {
/* 查询条件 */ /* 查询条件 */
@ -9,14 +9,10 @@ const tableListMixins = {
dataSource: [], dataSource: [],
/* 分页参数 */ /* 分页参数 */
ipagination: { ipagination: {
current: 1, currentPage: 1,
pageSize: 10, pageSize: 10,
pageSizeOptions: ["10", "20", "30"], pageSizes: ["10", "20", "30"],
showTotal: (total, range) => { layout: "total, sizes, prev, pager, next, jumper",
return range[0] + "-" + range[1] + " 共" + total + "条";
},
showQuickJumper: true,
showSizeChanger: true,
total: 0, 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) Vue.use(VueRouter)
import systemManagement from './routes/systemManagement' import systemManagement from './routes/systemManagement'
import module from './routes/module' import module from './routes/module'
import enterpriseManage from './routes/enterpriseManage'
const routes = [ const routes = [
...enterpriseManage,
{ {
path: '/', path: '/',
name: 'box', name: 'box',
@ -101,6 +99,11 @@ const routes = [
name: 'login', name: 'login',
component: () => import('@/components/login'), component: () => import('@/components/login'),
}, },
{
path: "/recordManage",
name: "recordManage",
component: () => import("@/views/enterpriseManage/recordManage/index"),
},
] ]
}] }]
console.log(routes) console.log(routes)

@ -4,7 +4,19 @@
<el-button @click="add"></el-button> <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 <form-dialog
ref="formDialog" ref="formDialog"
@ -19,8 +31,8 @@
</template> </template>
<script> <script>
import { deleteAction, getAction, downFile } from "@/loveflow/api/manage"; //import { deleteAction, getAction, downFile } from "@/loveflow/api/manage";
import { tableListMixins } from "@/loveflow/mixins/tableList.global.mixins.js"; import { tableListMixins } from "@/loveflow/mixins/tableListMixins";
export default { export default {
mixins: [tableListMixins], mixins: [tableListMixins],
data() { data() {
@ -34,6 +46,11 @@ export default {
prop: "name", prop: "name",
label: "姓名", label: "姓名",
}, },
{
slot: "vaeSlot",
prop: "name",
label: "自定义",
},
], ],
formItems: [ formItems: [
{ {

Loading…
Cancel
Save