|
@@ -1,118 +1,127 @@
|
|
|
<template>
|
|
|
<div id="index">
|
|
|
- <el-row class="main">
|
|
|
- <el-col :span="24" class="top">
|
|
|
- <!-- <el-button><el-link href="./detail">添加</el-link></el-button> -->
|
|
|
- <el-col :span="1" class="home">
|
|
|
- <i class="el-icon-s-home"></i>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="info">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <topInfo :topTitle="topTitle"></topInfo>
|
|
|
</el-col>
|
|
|
- <el-col :span="23">
|
|
|
- <el-breadcrumb separator-class="el-icon-arrow-right">
|
|
|
- <el-breadcrumb-item :to="{ path: '/' }"> 我的主页</el-breadcrumb-item>
|
|
|
- <el-breadcrumb-item>专家智库</el-breadcrumb-item>
|
|
|
- </el-breadcrumb>
|
|
|
+ <el-col :span="24" class="search">
|
|
|
+ <el-col :span="8" class="left">
|
|
|
+ <span>查询身份证:</span>
|
|
|
+ <el-input v-model="input" placeholder="请输入身份证"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="left">
|
|
|
+ <span>查询名称:</span>
|
|
|
+ <el-input v-model="input" placeholder="请输入名称"></el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8" class="right">
|
|
|
+ <el-button size="mini" type="primary" icon="el-icon-search">查询</el-button>
|
|
|
+ <el-button size="mini" type="success" icon="el-icon-check" @click="addData()">添加用户</el-button>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
- </el-col>
|
|
|
- <el-col :span="22" class="sousuo">
|
|
|
- 查询身份证 <el-input v-model="input" placeholder="查询身份证" size="mini" style="width:200px"></el-input>
|
|
|
-
|
|
|
- 查询名称<el-input v-model="input" placeholder="查询名称" size="mini" style="width:200px;margin-left: 10px"></el-input>
|
|
|
- <el-button type="primary" icon="el-icon-search" @click="onSubmit" size="mini">查询</el-button>
|
|
|
- <el-button type="success" icon="el-icon-check" @click="openDialog()" size="mini">添加用户</el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24" class="biaoge">
|
|
|
- <el-table :data="tableData" style="width: 100%" border>
|
|
|
- <el-table-column label="序号" type="index" width="50" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="name" label="姓名" width="100" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="sfzh" label="身份证号" width="160" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="title" label="登陆名称" width="100" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="tel" label="联系电话" width="120" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="email" label="电子邮箱" width="208" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="date" label="创建时间" width="120" align="center"> </el-table-column>
|
|
|
- <el-table-column label="操作" width="180" align="center">
|
|
|
- <template slot-scope="scoped">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="openDialog(scoped.$index)"></el-button>
|
|
|
-
|
|
|
- <el-button type="text" size="mini" icon="el-icon-document" @click="openDialogs(scoped.$index.tableData)"></el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click.prevent="deleteRow(scoped.$index.tableData)"> </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-dialog title="详情页" :visible.sync="dialog" width="30%">
|
|
|
- <el-col>
|
|
|
- <el-col :span="24"> 姓名 </el-col>
|
|
|
- <el-col :span="24">身份证号</el-col>
|
|
|
- <el-col :span="24">登陆名称</el-col>
|
|
|
- <el-col :span="24">联系电话</el-col>
|
|
|
- <el-col :span="24">联系电话</el-col>
|
|
|
- <el-col :span="24">电子邮箱</el-col>
|
|
|
- <el-col :span="24">创建时间</el-col>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-table :data="tableData" style="width: 100%" border>
|
|
|
+ <el-table-column label="序号" type="index" width="50" align="left"> </el-table-column>
|
|
|
+ <el-table-column prop="name" label="名称" width="80" align="left"> </el-table-column>
|
|
|
+ <el-table-column prop="sfzh" label="身份证号" width="180" align="left"> </el-table-column>
|
|
|
+ <el-table-column prop="loginName" label="登录名称" width="80" align="left"> </el-table-column>
|
|
|
+ <el-table-column prop="tel" label="联系电话" width="120" align="left"> </el-table-column>
|
|
|
+ <el-table-column prop="email" label="邮箱" align="left"> </el-table-column>
|
|
|
+ <el-table-column prop="date" label="创建时间" align="left"> </el-table-column>
|
|
|
+ <el-table-column label="操作" align="left">
|
|
|
+ <template slot-scope="scoped">
|
|
|
+ <el-button size="mini" type="primary" icon="el-icon-view" @click="openDialog(scoped.$index)"></el-button>
|
|
|
+ <el-button size="mini" type="primary" icon="el-icon-edit" @click="addData(scoped.$index)"></el-button>
|
|
|
+ <el-button size="mini" type="danger" icon="el-icon-delete" @click.native.prevent="deleteRow(scoped.$index, tableData)"></el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-col :span="24" class="page">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="1"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
</el-col>
|
|
|
- <el-button>取 消</el-button>
|
|
|
- <el-button type="primary">确 定</el-button>
|
|
|
- </el-dialog>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-dialog title="详细信息" :visible.sync="dialog">
|
|
|
+ <el-col :span="24" class="dataInfo">
|
|
|
+ <el-col :span="24"> 姓名:{{ info.name }} </el-col>
|
|
|
+ <el-col :span="24"> 身份证号:{{ info.sfzh }} </el-col>
|
|
|
+ <el-col :span="24"> 登录名称:{{ info.loginName }} </el-col>
|
|
|
+ <el-col :span="24"> 联系电话:{{ info.tel }} </el-col>
|
|
|
+ <el-col :span="24"> 邮箱:{{ info.email }} </el-col>
|
|
|
+ <el-col :span="24"> 创建时间:{{ info.date }} </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import topInfo from '@/layout/top.vue';
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
props: {},
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ topInfo, //头部标题
|
|
|
+ },
|
|
|
data: () => ({
|
|
|
- dialog: false,
|
|
|
- currentPage: 1,
|
|
|
+ topTitle: '用户管理',
|
|
|
input: '',
|
|
|
tableData: [
|
|
|
{
|
|
|
- name: '王小开虎',
|
|
|
- sfzh: '1234568912345689',
|
|
|
- title: '测试',
|
|
|
- tel: '1234568901',
|
|
|
+ name: '测试人员',
|
|
|
+ sfzh: '220182199603257019',
|
|
|
+ loginName: '测试人员',
|
|
|
+ tel: '17319450324',
|
|
|
+ email: '17319450324@163.com',
|
|
|
+ date: '2019-01-10',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '十条数据',
|
|
|
+ sfzh: '220182199603257019',
|
|
|
+ loginName: '测试人员',
|
|
|
+ tel: '17319450324',
|
|
|
email: '17319450324@163.com',
|
|
|
- date: '2019-01-08',
|
|
|
+ date: '2019-01-10',
|
|
|
},
|
|
|
],
|
|
|
+ currentPage: 1,
|
|
|
+ dialog: false,
|
|
|
+ info: {},
|
|
|
}),
|
|
|
created() {},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
- openDialogs(index) {
|
|
|
- this.dialog = true;
|
|
|
- },
|
|
|
- openDialog(index) {
|
|
|
- if (index !== undefined) {
|
|
|
- let data = JSON.parse(JSON.stringify(this.tableData[index]));
|
|
|
- data[`index`] = index;
|
|
|
- this.$set(this, `form`, data);
|
|
|
- this.$router.push({ path: './detail' });
|
|
|
- } else {
|
|
|
- this.form = {};
|
|
|
- this.$router.push({ path: './detail' });
|
|
|
- }
|
|
|
- },
|
|
|
handleSizeChange(val) {
|
|
|
console.log(`每页 ${val} 条`);
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
console.log(`当前页: ${val}`);
|
|
|
},
|
|
|
+ addData(index) {
|
|
|
+ if (index !== undefined) {
|
|
|
+ let data = this.tableData[index];
|
|
|
+ } else {
|
|
|
+ this.form = {};
|
|
|
+ }
|
|
|
+ this.$router.push({ path: './detail' });
|
|
|
+ },
|
|
|
deleteRow(index, rows) {
|
|
|
rows.splice(index, 1);
|
|
|
},
|
|
|
- // toadd() {
|
|
|
- // this.$router.push({ path: './detail' });
|
|
|
- // },
|
|
|
- onSubmit() {
|
|
|
- console.log('submit!');
|
|
|
- },
|
|
|
- handleEdit(index, row) {
|
|
|
- console.log(index, row);
|
|
|
- },
|
|
|
- handleDelete(index, row) {
|
|
|
- console.log(index, row);
|
|
|
+ openDialog(index) {
|
|
|
+ if (index !== undefined) {
|
|
|
+ let data = JSON.parse(JSON.stringify(this.tableData[index]));
|
|
|
+ data[`index`] = index;
|
|
|
+ this.$set(this, `info`, data);
|
|
|
+ }
|
|
|
+ this.dialog = true;
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -121,49 +130,49 @@ export default {
|
|
|
<style lang="less" scoped>
|
|
|
.top {
|
|
|
height: 40px;
|
|
|
- width: 100%;
|
|
|
- border-bottom: 1px solid #e5e5e5;
|
|
|
background-color: #f5f5f5;
|
|
|
}
|
|
|
-.home {
|
|
|
- font-size: 15px;
|
|
|
- padding: 10px 0px 0px 20px;
|
|
|
-}
|
|
|
-
|
|
|
-/deep/.el-breadcrumb {
|
|
|
- font-size: 14px;
|
|
|
- line-height: 3;
|
|
|
-}
|
|
|
-.sousuo {
|
|
|
+.search {
|
|
|
height: 40px;
|
|
|
- width: 100%;
|
|
|
- padding: 0 20px;
|
|
|
- font-size: 10px;
|
|
|
line-height: 40px;
|
|
|
+ padding: 0 15px;
|
|
|
}
|
|
|
-.biaoge {
|
|
|
- padding: 0 20px;
|
|
|
+.search .left span {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #393939;
|
|
|
}
|
|
|
-/deep/.el-input__inner {
|
|
|
- border-radius: 0px;
|
|
|
+.search .left .el-input {
|
|
|
+ width: 50%;
|
|
|
}
|
|
|
-
|
|
|
-.el-button {
|
|
|
- border-radius: 0px;
|
|
|
- margin: 0 0 0 10px;
|
|
|
+/deep/.search .left .el-input .el-input__inner {
|
|
|
+ height: 28px;
|
|
|
}
|
|
|
-
|
|
|
-/deep/.el-table__header tr,
|
|
|
-/deep/.el-table__header th {
|
|
|
- padding: 0;
|
|
|
- height: 40px;
|
|
|
+.main {
|
|
|
+ width: 97%;
|
|
|
+ margin: 0 15px;
|
|
|
}
|
|
|
-/deep/.el-table__body tr,
|
|
|
-/deep/.el-table__body td {
|
|
|
- padding: 0;
|
|
|
- height: 40px;
|
|
|
+/deep/.el-table th {
|
|
|
+ padding: 5px 0;
|
|
|
+ background: #f2f2f2;
|
|
|
+}
|
|
|
+/deep/.el-table td {
|
|
|
+ padding: 5px 0;
|
|
|
+}
|
|
|
+/deep/.el-table tr {
|
|
|
+ background: #f9f9f9;
|
|
|
+}
|
|
|
+/deep/.el-table tr:nth-child(2n) {
|
|
|
+ background: #fff;
|
|
|
}
|
|
|
.page {
|
|
|
text-align: center;
|
|
|
+ padding: 30px 0;
|
|
|
+}
|
|
|
+/deep/ .el-dialog__body {
|
|
|
+ min-height: 300px;
|
|
|
+}
|
|
|
+.dataInfo .el-col {
|
|
|
+ font-size: 18px;
|
|
|
+ padding: 0 0 20px 0;
|
|
|
}
|
|
|
</style>
|