赞
踩
效果图
代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>员工列表</title> <!-- 引入样式 --> <script type="text/javascript" src="../js/vue.js"></script> <script type="text/javascript" src="../js/axios.min.js"></script> <!-- 引入样式 --> <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> <!-- 引入组件库 --> <script src="https://unpkg.com/element-ui/lib/index.js"></script> </head> <body> <div id="app"> <h2>{ { message }}</h2> </div> <div id="tableView"> <!--列表顶部搜索和工具条--> <el-row> <el-form :inline="true" :model="searchForm" class="demo-form-inline"> <el-form-item label="部门名称"> <el-input v-model="searchForm.user_dept" placeholder="账号"></el-input> </el-form-item> <el-button type="primary" icon="search" @click="searchClick">查询</el-button> <el-button type="success" icon="plus" @click="addClick">新增</el-button> <el-button type="success" icon="plus" @click="toPush">刷新</el-button> </el-form-item> </el-form> </el-row> <!--列表--> <el-row> <el-table :data="tableData" v-loading.body="loading" border @selection-change="selectionChange($event)" style="width: 100%"> <el-table-column type="selection" align="center"> </el-table-column> <el-table-column prop="user_id" label="员工编号" align="center"> </el-table-column> <el-table-column prop="user_name" label="员工名称" align="center"> </el-table-column> <el-table-column prop="user_sex" label="性别" align="center"> </el-table-column> <el-table-column prop="user_sal" label="薪水" align="center"> </el-table-column> <el-table-column prop="user_dept" label="部门" align="center"> </el-table-column> <el-table-column label="操作" align="center"> <template scope="scope"> <el-button :plain="true" type="success" size="small" icon="edit" @click="editClick(scope.row)">编辑</el-button> <el-button :plain="true" type="danger" size="small" icon="delete" @click="deleteClick(scope.row)">删除</el-button> </template> </el-table-column> </el-table> </el-row> <!--列表底部工具条和分页符--> <el-row style="margin-top: 20px" type="flex" justify="end"> <el-col :span="6" > <el-button :plain="true" type="danger" size="small" icon="delete" @click="removeSelection">删除所选</el-button> </el-col> <el-col :span="18" > <el-pagination style="float: right" @size-change="pageSizeChange" @current-change="currentPageChange" :current-page="currentPage" :page-sizes="[5, 10]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> </el-col> </el-row> <!--编辑界面--> <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false"> <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm"> <el-form-item label="员工编号" prop="user_id"> <el-input v-model="editForm.user_id" auto-complete="off"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。