2024/02/29
<template> <div> <el-container style="height: 700px; border: 1px solid #eee"> <el-header style="font-size:40px; background-color: rgb(238, 241, 246)">研究生调试复试系统</el-header> <el-container> <el-aside width="230px" style="border: 1px solid #eee"> <el-menu :default-openeds="['1', '3']"> <el-submenu index="1"> <template slot="title"><i class="el-icon-message"></i>系统信息管理</template> <el-menu-item index="1-1"> <router-link to="/dept">部门管理</router-link> </el-menu-item> <el-menu-item index="1-2"> <router-link to="/emp">员工管理</router-link> </el-menu-item> </el-submenu> </el-menu> </el-aside> <el-main> <!-- 表格 --> <el-table :data="tableData" border> <el-table-column prop="name" label="名称" width="250"></el-table-column> <el-table-column prop="updatetime" label="最后操作时间" width="250"></el-table-column> <el-table-column label="操作"> <el-button type="primary" size="mini">编辑</el-button> <el-button type="danger" size="mini">删除</el-button> </el-table-column> </el-table> </el-main> </el-container> </el-container> </div> </template> <script> export default { data() { return { tableData: [{ id:1, name:"学工部", updatetime:"2010-01-01 12:00:00" },{ id:2, name:"教研部", updatetime:"2010-01-01 12:00:00" },{ id:3, name:"就业部", updatetime:"2010-01-01 12:00:00" },{ id:4, name:"人事部", updatetime:"2010-01-01 12:00:00" },{ id:5, name:"行政部", updatetime:"2010-01-01 12:00:00" }] } }, methods: { } } </script> <style> </style>
<template> <div> <el-container style="height: 700px; border: 1px solid #eee"> <el-header style="font-size: 40px;background-color: rgb(238, 241, 246)">研究生调试复试系统</el-header> <el-container> <el-aside width="220px" style="border: 1px solid #eee"> <el-menu :default-openeds="['1', '3']"> <el-submenu index="1"> <template slot="title"><i class="el-icon-message"></i>系统信息管理</template> <el-menu-item-group> <template slot="title">分组一</template> <el-menu-item index="1-1"> <router-link to="/dept">部门管理</router-link> </el-menu-item> <el-menu-item index="1-2"> <router-link to="/emp">员工管理</router-link> </el-menu-item> </el-menu-item-group> </el-submenu> </el-menu> </el-aside> <el-main> <el-form :inline="true" :model="SearchForm" class="demo-form-inline"> <el-form-item label="姓名"> <el-input v-model="SearchForm.name" placeholder="姓名"></el-input> </el-form-item> <el-form-item label="性别"> <el-select v-model="SearchForm.gender" placeholder="性别"> <el-option label="男" value="1"></el-option> <el-option label="女" value="2"></el-option> </el-select> </el-form-item> <el-form-item label="入职日期"> <!-- 日期选择器--> <div class="block"> <el-date-picker v-model="SearchForm.entrydate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker> </div> </el-form-item> <el-form-item> <el-button type="primary" @click="onSubmit">查询</el-button> </el-form-item> </el-form> <el-table :data="tableData" border> <el-table-column prop="name" label="姓名" width="180"></el-table-column> <el-table-column prop="image" label="图像" width="180"> <!-- 制定插槽--> <template slot-scope="scope"> <img :src="scope.row.image" width="100px" height="100px"> </template> </el-table-column> <el-table-column label="性别" width="140"> <template slot-scope="scope"> {{ scope.row.gender == 1 ? '男' : '女' }} </template> </el-table-column> <el-table-column prop="job" label="职位" width="140"></el-table-column> <el-table-column prop="entrydate" label="入职日期" width="180"></el-table-column> <el-table-column prop="updatetime" label="最后操作时间" width="230"></el-table-column> <el-table-column label="操作"> <el-button type="primary" size="mini">编辑</el-button> <el-button type="danger" size="mini">删除</el-button> </el-table-column> </el-table> <br> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" background layout="sizes,prev, pager, next,total,jumper" :total="1000"> </el-pagination> </el-main> </el-container> </el-container> </div> </template> <script> import axios from 'axios'; export default { data() { return { tableData: [], SearchForm: { name: '', gender: '', entrydate: [] } }; }, methods: { onSubmit() { alert("查询"); }, handleSizeChange(val) { alert("当前页面显示容量改变" + val) }, handleCurrentChange(val) { alert("当前页面改变" + val) }} , mounted() { axios.get("https://mock.apifox.cn/m1/3128855-0-default/emp/list").then((result)=>{ this.tableData=result.data.data; }); } } </script> <style> .el-header { background-color: #B3C0D1; color: #333; line-height: 60px; } .el-aside { color: #333; } </style>