Commit c8d3e1e8 authored by 王's avatar

所有分页的添加

parent 00b2a719
......@@ -12,8 +12,8 @@ module.exports = {
//本地代理设置
proxyTable: {
'/api': {
target: 'http://local.base-api.sing.com', // 接口的域名
// target: 'http://wechat.test.singsingenglish.com/',
// target: 'http://local.base-api.sing.com', // 接口的域名
target: 'http://wechat.test.singsingenglish.com/',
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
}
},
......
......@@ -76,6 +76,7 @@
</el-table-column>
</el-table>
</div>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<class-dialog :dialogObj="dialogObj" @reflash="getClassList"></class-dialog>
<user-list :userObj="userObj" @reflash="getClassList"/>
</div>
......@@ -84,9 +85,13 @@
import {getGoodsListApi,getPeriodsApi,getClassListApi,getPeriodsTeacherApi,delClassApi} from "../../service/api";
import classDialog from './dialog'
import UserList from './userList'
import page from '../framework/page'
export default {
data(){
return {
nowPage: 1,
total: 0,
limit: 10,
periodsId:null,
goodsList:[],
teacher_id:'',
......@@ -109,7 +114,8 @@
},
components:{
UserList,
classDialog
classDialog,
page
},
mounted(){
this.initPage()
......@@ -152,9 +158,20 @@
this.getTeacher()
}
},
onPageChange(val){
this.nowPage = val;
this.getClassList();
},
getClassList(){
this.getTeacher();
getClassListApi(this.periods.id,{teacher_id:this.teacher_id}).then(res=>{
let json = {
limit: this.limit,
page: this.nowPage
}
if (this.teacher_id) {
json.teacher_id = this.teacher_id
}
getClassListApi(this.periods.id,json).then(res=>{
this.title = res.periods;
this.classList = res.list;
})
......
<template>
<div class="page-div">
<el-pagination
:current-page="nowPage"
:page-size="limit"
:current-page.sync="nowPage"
layout="total , prev, pager, next, jumper"
:total="total">
</el-pagination>
......@@ -11,13 +12,22 @@
<script>
export default {
name: "page",
props:[
'nowPage',
'total'
],
data() {
return {
nowPage: 1
}
},
props:{
'total' : {
required: true
},
'limit': {
default: 10
}
},
watch:{
nowPage(value){
this.$emit("pageChange", value);
}
}
}
......
......@@ -72,7 +72,7 @@
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
<dialog-com v-if="dialogObj.show" :dialogObj="dialogObj" @changeShow="changeShow" @reflash="getUser"/>
</div>
</template>
......@@ -93,7 +93,8 @@
},
userList:[],
total:0,
nowPage:0,
nowPage:1,
limit: 10,
dialogObj:{
type:0,
show:false,
......@@ -114,8 +115,23 @@
this.getUser()
},
methods:{
onPageChange(val){
this.nowPage = val
this.getUser()
},
getUser(){
getLessonApi(this.searchFrom).then(res=>{
this.searchFrom.page = this.nowPage;
let json = {
limit: this.limit,
page: this.nowPage
}
if (this.searchFrom.title) {
json.title = this.searchFrom.title
}
if (this.searchFrom.type) {
json.type = this.searchFrom.type
}
getLessonApi(json).then(res=>{
this.userList = res.list;
this.total = res.total
})
......
......@@ -168,7 +168,7 @@
<address-dialog v-if="dialogObj.show" :dialogObj="dialogObj" @reflash="onUpdateAddress"></address-dialog>
<refund-dialog :dialogObj="refundDialogObj" @reflash="onAfterRefund" @changeShow="changeShow"></refund-dialog>
<detail-dialog :dialogObj="dialogDetailObj" @changeShow="changeDetailShow"/>
<page :nowPage="nowPage" :total="total"/>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
</div>
</template>
......@@ -188,6 +188,7 @@
return {
nowPage: 1,
total: 0,
limit: 10,
searchFrom: {
nickname: '',
user_id: '',
......@@ -240,8 +241,15 @@
});
})
},
onPageChange(val){
this.nowPage = val
this.getOrderList()
},
getOrderList(){
let json = {};
let json = {
limit: this.limit,
page: this.nowPage
};
if (this.searchFrom.nickname) {
json.nickname = this.searchFrom.nickname
}
......
......@@ -98,7 +98,7 @@
</template>
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total"/>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<new-dialog v-if="newDialog.show" :dialogObj="newDialog" @reflash="onSave"></new-dialog>
</div>
</template>
......@@ -115,6 +115,7 @@
return {
nowPage: 1,
total: 0,
limit: 10,
title: '',
goodsId: null,
lessonId: null,
......@@ -153,8 +154,14 @@
page
},
methods: {
onPageChange(val){
this.nowPage = val
this.onSearch()
},
onSearch(){
let json={
limit: this.limit,
page: this.nowPage
}
if(this.title){
json.title = this.title;
......
......@@ -108,7 +108,7 @@
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total"/>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<el-dialog :title="dialogTitle" v-if="showDialog" :visible.sync="showDialog">
<el-form ref="saveuser" :model="nowObj" label-width="70px">
<el-form-item label="订单状态" v-if="!showDesc">
......@@ -144,6 +144,7 @@
return {
nowPage: 1,
total: 0,
limit: 10,
search:{
key:'',
status:0
......@@ -204,9 +205,14 @@
this.getList()
},
methods:{
onPageChange(val){
this.nowPage = val;
},
//获取列表
getList:function () {
let json = {
limit: this.limit,
page: this.nowPage
};
getWithdrawListApi(json).then(res=>{
this.tableData = res.list;
......
......@@ -87,7 +87,7 @@
</template>
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total"/>
<page :nowPage="nowPage" :total="total" @pageChange="onPageChange"/>
</div>
</template>
......@@ -103,6 +103,7 @@
return {
nowPage: 1,
total: 0,
limit: 10,
searchFrom: {
nickname:'',
user_id: ''
......@@ -142,8 +143,15 @@
});
})
},
onPageChange(val){
this.nowPage = val
this.getRefundList()
},
getRefundList(){
let json = {}
let json = {
limit: this.limit,
page: this.nowPage
}
if(this.searchFrom.nickname){
json.nickname = this.searchFrom.nickname
}
......
......@@ -9,7 +9,7 @@
</el-col>
<el-col :span="4">
<el-form-item>
<el-button type="primary" plain>搜索</el-button>
<el-button type="primary" plain @click="getUser">搜索</el-button>
</el-form-item>
</el-col>
<el-col :span="4" :offset="12">
......@@ -103,7 +103,7 @@
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
<dialog-com :dialogObj="dialogObj" @changeShow="changeShow" @reflash="getUser"/>
</div>
</template>
......@@ -122,7 +122,8 @@
},
userList:[],
total:0,
nowPage:0,
nowPage:1,
limit: 10,
dialogObj:{
type:0,
show:false,
......@@ -153,8 +154,19 @@
this.getUser()
},
methods:{
onPageChange(val){
this.nowPage = val
this.getUser()
},
getUser(){
getGoodsListApi(this.searchFrom).then(res=>{
let json = {
limit: this.limit,
page: this.nowPage
}
if (this.searchFrom.name) {
json.name = this.searchFrom.name
}
getGoodsListApi(json).then(res=>{
this.userList = res.list;
this.total = res.total
})
......
......@@ -65,7 +65,7 @@
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
<dialog-com :dialogObj="dialogObj" @changeShow="changeShow" @reflash="initPage"/>
</div>
</template>
......@@ -83,7 +83,8 @@
data(){
return {
total:0,
nowPage:0,
nowPage:1,
limit: 10,
searchFrom: {
name:''
},
......@@ -100,7 +101,10 @@
},
methods:{
initPage(){
let json = {}
let json = {
limit: this.limit,
page: this.nowPage
}
if (this.searchFrom.name) {
json.name = this.searchFrom.name
}
......@@ -112,6 +116,10 @@
this.total = res.total
})
},
onPageChange(val){
this.nowPage = val
this.initPage()
},
changeShow() {
},
......
......@@ -47,7 +47,7 @@
</template>
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total"/>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<el-dialog
:title="dialog.title"
center
......@@ -159,6 +159,7 @@
return {
nowPage:1,
total:0,
limit: 10,
adminList:[],
dialog:{
dialogType:0,
......@@ -208,8 +209,16 @@
}
})
},
onPageChange(val){
this.nowPage = val
this.getList()
},
getList(){
getAdminListApi().then(res=>{
let json = {
limit: this.limit,
page: this.nowPage
}
getAdminListApi(json).then(res=>{
this.adminList = res.list
this.total=Number(res.total)
this.$store.commit('mainCanShow')
......
......@@ -39,14 +39,11 @@
<el-form-item label="参数">
<span>{{ props.row.params }}</span>
</el-form-item>
<el-form-item label="功能名">
<span>{{ props.row.desc }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column
label="用户名"
label="登陆名"
prop="user_name">
</el-table-column>
<el-table-column
......@@ -54,16 +51,20 @@
prop="admin_id">
</el-table-column>
<el-table-column
label="用户详情"
label="用户"
prop="user_desc">
</el-table-column>
<el-table-column
label="功能名"
prop="desc">
</el-table-column>
</el-table-column>
<el-table-column
prop="created_at"
label="创建时间">
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
</div>
</template>
......@@ -80,6 +81,7 @@
list: [],
total:0,
nowPage:1,
limit: 10,
searchFrom: {
admin_id: '',
url: '',
......@@ -92,10 +94,28 @@
},
methods: {
getList(){
getAdminLogLisApi(this.searchFrom).then(res => {
this.searchFrom.page = this.nowPage;
let json = {
page: this.nowPage,
limit: this.limit
}
if (this.searchFrom.admin_id){
json.admin_id = this.searchFrom.admin_id
}
if (this.searchFrom.url){
json.url = this.searchFrom.url
}
if (this.searchFrom.desc){
json.desc = this.searchFrom.desc
}
getAdminLogLisApi(json).then(res => {
this.list = res.list
this.total = res.total
})
},
onPageChange(val){
this.nowPage = val;
this.getList();
}
}
}
......
......@@ -54,6 +54,7 @@
</template>
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<el-dialog
:title="dialog.title"
center
......@@ -91,15 +92,20 @@
<script>
import {getBannerListApi,addBannerApi,editBannerApi,getBannerDetailApi,delBannerApi,moveApi,uploadFileApi} from "../../service/api";
import page from '../framework/page'
export default {
name: "banner",
components:{
page
},
data(){
return {
loading: false,
bannerList: [],
total: 0,
nowPage: 1,
uploadShow: true,
limit: 1,
limit: 10,
dialog:{
title:'新增Banner',
show:false,
......@@ -125,9 +131,17 @@
this.getList()
},
methods: {
onPageChange(val){
this.nowPage = val;
this.getList()
},
getList(){
this.loading = true;
getBannerListApi().then(res=>{
let json = {
limit: this.limit,
page: this.nowPage
}
getBannerListApi(json).then(res=>{
if (res) {
this.bannerList = res.list;
this.total = res.total;
......
......@@ -31,7 +31,7 @@
</template>
</el-table-column>
</el-table>
<page :nowPage="nowPage" :total="total"/>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
<el-dialog
:title="dialog.title"
center
......@@ -82,6 +82,7 @@
return {
nowPage:1,
total:0,
limit: 10,
roleList:[],
dialog:{
title:'新增角色',
......@@ -120,8 +121,16 @@
}
})
},
onPageChange(val){
this.nowPage = val;
this.getList();
},
getList(){
getRoleListApi().then(res=>{
let json = {
limit: this.limit,
page: this.nowPage
}
getRoleListApi(json).then(res=>{
if (res) {
this.roleList = res.list;
this.total = res.total;
......
......@@ -52,16 +52,21 @@
</el-table-column>
</el-table>
<dialog-com :dialogObj="dialogObj" @changeShow="changeShow" @reflash="getList"/>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
</div>
</template>
<script>
import dialogCom from './sysConfigDialog'
import {getConfigListApi,deleteConfigApi,getConfigDetailApi} from "../../service/api";
import page from '../framework/page'
export default {
name: "sysConfig",
data() {
return {
total:0,
nowPage:1,
limit: 10,
dialogObj:{
value:'',
desc:'',
......@@ -72,7 +77,8 @@
}
},
components:{
dialogCom
dialogCom,
page
},
mounted(){
this.getList()
......@@ -82,10 +88,19 @@
this.dialogObj.show=data
},
getList(){
getConfigListApi().then(res => {
let json = {
limit: this.limit,
page: this.nowPage
}
getConfigListApi(json).then(res => {
this.list = res.list
this.total = res.total
})
},
onPageChange(val){
this.nowPage = val;
this.getList();
},
add(){
this.dialogObj.id = '';
this.dialogObj.key= '';
......
......@@ -86,7 +86,7 @@
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
<dialog-com :dialogObj="dialogObj" @changeShow="changeShow" @reflash="getUser"/>
</div>
</template>
......@@ -105,7 +105,8 @@
},
userList:[],
total:0,
nowPage:0,
nowPage:1,
limit: 10,
dialogObj:{
type:0,
show:false,
......@@ -149,8 +150,22 @@
this.getUser()
},
methods:{
onPageChange(val){
this.nowPage = val
this.getUser()
},
getUser(){
getTeacherListApi(this.searchFrom).then(res=>{
let json = {
limit: this.limit,
page: this.nowPage
}
if (this.searchFrom.type) {
json.type = this.searchFrom.type
}
if (this.searchFrom.name) {
json.name = this.searchFrom.name
}
getTeacherListApi(json).then(res=>{
this.userList = res.list;
this.total = res.total
})
......
......@@ -78,7 +78,7 @@
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<page :total="total" :limit="limit" @pageChange="onPageChange"/>
<detail-dialog :dialogObj="dialogDetailObj" @changeShow="changeShow"/>
<teacher-dialog :dialogObj="dialogObj" @reflash="getUser"></teacher-dialog>
</div>
......@@ -101,6 +101,7 @@
userList:[],
total:0,
nowPage:1,
limit: 10,
showDetail:false,
showId:'',
dialogObj:{
......@@ -124,8 +125,25 @@
this.getUser()
},
methods:{
onPageChange(val){
this.nowPage = val
this.getUser()
},
getUser(){
getUserListApi(this.searchFrom).then(res=>{
let json = {
page: this.nowPage,
limit: this.limit
}
if (this.searchFrom.nickName) {
json.nickname = this.searchFrom.nickName
}
if (this.searchFrom.mobile) {
json.mobile = this.searchFrom.mobile
}
if (this.searchFrom.level) {
json.level = this.searchFrom.level
}
getUserListApi(json).then(res=>{
this.userList = res.list;
this.total = res.total
})
......
......@@ -69,7 +69,7 @@
</template>
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange"/>
</div>
</div>
</div>
......@@ -86,6 +86,7 @@
mediaList: [],
nowPage: 1,
total: 0,
limit: 5,
loading: false,
type: 'image',
imageList: [],
......@@ -120,10 +121,15 @@
this.nowPage = 1;
this.getMediaList(type);
},
onPageChange(val){
this.nowPage = val
this.getMediaList(this.type)
},
getMediaList(type){
let json = {
type: type,
page: this.nowPage
page: this.nowPage,
limit: this.limit
};
this.loading = true;
getMediaListApi(json).then(res=>{
......
......@@ -20,8 +20,8 @@ export const logoutApi = function() {
};
//查询账号列表
const getAdminListUrl = `${_baseUrl}api/admin/user/list`;
export const getAdminListApi = function () {
return Vue.prototype.$fetch(getAdminListUrl)
export const getAdminListApi = function (json) {
return Vue.prototype.$fetch(getAdminListUrl,json)
};
//修改账号信息
const editAdminUrl = `${_baseUrl}api/admin/user/info`;
......@@ -329,8 +329,8 @@ export const delRoleApi = function (id) {
};
// 获取banner列表
const getBannerListUrl = `${_baseUrl}api/admin/banner/list`;
export const getBannerListApi = function () {
return Vue.prototype.$fetch(`${getBannerListUrl}`)
export const getBannerListApi = function (json) {
return Vue.prototype.$fetch(`${getBannerListUrl}`, json)
};
// 添加banner
const addBannerUrl = `${_baseUrl}api/admin/banner/add`;
......
......@@ -295,7 +295,7 @@ export default [
}
},
{
value:'管理员操作日志',
value:'操作日志',
routerName:'adminLog',
path:'/adminLog',
cover:'8-5',
......
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