vue 后台管理系统 调接口, 分页,列表 查询

这是一个使用Vue.js编写的组件,展示了一个黑名单列表管理界面,包括公司名称、用户名、电话等信息的查询和筛选功能,以及恢复和彻底删除的操作。列表支持分页展示,每页显示数量可调整,并且监听参数变化实时刷新数据。
摘要由CSDN通过智能技术生成

逻辑代码

<template>
	<div class="app-container">
		<div class="power-list">
			<div class="power-list-top">
				<div class="power-list-top-left">黑名单列表</div>
				<div class="power-list-top-right">
					<div class="power-list-top-right-select">
						<el-input size="medium" placeholder="按公司名称查询" suffix-icon="el-icon-search" v-model="params.companyName">
						</el-input>
					</div>
					<div class="power-list-top-right-select">
						<el-input size="medium" placeholder="按用户名称查询" suffix-icon="el-icon-search" v-model="params.userName">
						</el-input>
					</div>
					<div class="power-list-top-right-select">
						<el-select v-model="params.roleType" placeholder="选择角色" size="medium">
							<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</div>
				</div>
			</div>
			<div class="power-list-bottom">
				<el-table :data="tableData" style="width: 100%">
					<el-table-column prop="xuhao" label="序号" width="80" type="index">
					</el-table-column>
					<el-table-column prop="companyName" label="公司名称" show-overflow-tooltip>
					</el-table-column>
					<el-table-column prop="userName" label="用户名" show-overflow-tooltip>
					</el-table-column>
					<el-table-column prop="realName" label="姓名" show-overflow-tooltip>
					</el-table-column>
					<el-table-column prop="phone" label="电话" show-overflow-tooltip>
					</el-table-column>
					<el-table-column prop="role" label="角色" show-overflow-tooltip>
					</el-table-column>
					<el-table-column label="操作" width="160">
						<template slot-scope="scope">
							<el-button type="text" size="small" class="modify-btn">恢复</el-button>
							<el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text" size="small" class="del-btn">
								彻底删除
							</el-button>
						</template>
					</el-table-column>
					<el-table-column prop="remark" label="备注" show-overflow-tooltip>
					</el-table-column>
				</el-table>
			</div>
			// 分页
			<div class="page-box">
				<!-- <el-pagination
					@current-change="handleCurrentChange"
					:current-page="page.currPage"
					layout="total, sizes, prev, pager, next, jumper"
					:total="page.totalCount">
				</el-pagination> -->
					<el-pagination background layout="prev, pager, next" @current-change="handleCurrentChange" :current-page="page.currPage" :total="page.totalCount" :page-size="10">
				</el-pagination>
			</div>
		</div>
	</div>
</template>

逻辑代码

script>
	// api接口引入进去的 
	import { blackAccountList } from "@/api/yonghuguanli"
	export default {
		data() {
			return {
				page: {
					pageSize: 2,
					totalCount: 14,
					totalPage: 7,
					currPage: 1,
					page: 1
				},
				params: {
					companyName: '',
					userName: '',
					roleType: ''
				},
				options: [{
					value: '选项1',
					label: '公章员'
				}, {
					value: '选项2',
					label: '业务员'
				}, {
					value: '选项3',
					label: '审核员'
				}],
				input3:'',
				input2:'',
				value: '',
				 tableData: [{
					companyName:'',
					delete:'',
					endTime:'',
					keyword:'',
				}],
			}
		},

		methods: {
			handleCurrentChange(nowPage){
				this.page.currPage = nowPage;
				this.page.page = nowPage;
				this.blackAccountList();
			},
			deleteRow(index, rows) {
				rows.splice(index, 1);
			},
			blackAccountList(){
				const params = Object.assign(this.page,this.params)
				blackAccountList(params).then(res=>{
					this.tableData = res.data.list;
					this.page = Object.assign(this.page, res.data)
				})
			}
		},
		created(){
			this.blackAccountList()
		},
		watch: {
			params: {
				deep: true,
				handler(value){
					this.blackAccountList();
				}
			}
		}
	}
</script>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值