|
@@ -18,7 +18,7 @@
|
|
|
|
|
|
查询名称<el-input v-model="input" placeholder="查询名称" size="mini" style="width:200px;margin-left: 10px"></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="primary" icon="el-icon-search" @click="onSubmit" size="mini">查询</el-button>
|
|
- <el-button type="success" icon="el-icon-check" @click="toadd()" size="mini">添加用户</el-button>
|
|
|
|
|
|
+ <el-button type="success" icon="el-icon-check" @click="openDialog()" size="mini">添加用户</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" class="biaoge">
|
|
<el-col :span="24" class="biaoge">
|
|
<el-table :data="tableData" style="width: 100%" border>
|
|
<el-table :data="tableData" style="width: 100%" border>
|
|
@@ -30,11 +30,27 @@
|
|
<el-table-column prop="email" label="电子邮箱" width="208" 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 prop="date" label="创建时间" width="120" align="center"> </el-table-column>
|
|
<el-table-column label="操作" width="180" align="center">
|
|
<el-table-column label="操作" width="180" align="center">
|
|
- <el-button type="text" size="mini" icon="el-icon-edit" @click="onSubmit"></el-button>
|
|
|
|
- <el-button type="text" size="mini" icon="el-icon-document" @click="onSubmit"></el-button>
|
|
|
|
- <el-button type="text" size="mini" icon="el-icon-delete" @click="onSubmit"></el-button>
|
|
|
|
|
|
+ <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-column>
|
|
</el-table>
|
|
</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>
|
|
|
|
+ <el-button>取 消</el-button>
|
|
|
|
+ <el-button type="primary">确 定</el-button>
|
|
|
|
+ </el-dialog>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
</div>
|
|
</div>
|
|
@@ -46,12 +62,9 @@ export default {
|
|
props: {},
|
|
props: {},
|
|
components: {},
|
|
components: {},
|
|
data: () => ({
|
|
data: () => ({
|
|
|
|
+ dialog: false,
|
|
|
|
+ currentPage: 1,
|
|
input: '',
|
|
input: '',
|
|
- formInline: {
|
|
|
|
- card: '',
|
|
|
|
- name: '',
|
|
|
|
- region: '',
|
|
|
|
- },
|
|
|
|
tableData: [
|
|
tableData: [
|
|
{
|
|
{
|
|
name: '王小开虎',
|
|
name: '王小开虎',
|
|
@@ -61,22 +74,37 @@ export default {
|
|
email: '17319450324@163.com',
|
|
email: '17319450324@163.com',
|
|
date: '2019-01-08',
|
|
date: '2019-01-08',
|
|
},
|
|
},
|
|
- {
|
|
|
|
- name: '王小虎',
|
|
|
|
- sfzh: '1234568912345689',
|
|
|
|
- title: '测试',
|
|
|
|
- tel: '0431-123456',
|
|
|
|
- email: '123456@163.com',
|
|
|
|
- date: '2019-01-08',
|
|
|
|
- },
|
|
|
|
],
|
|
],
|
|
}),
|
|
}),
|
|
created() {},
|
|
created() {},
|
|
computed: {},
|
|
computed: {},
|
|
methods: {
|
|
methods: {
|
|
- toadd() {
|
|
|
|
- this.$router.push({ path: './detail' });
|
|
|
|
|
|
+ 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}`);
|
|
|
|
+ },
|
|
|
|
+ deleteRow(index, rows) {
|
|
|
|
+ rows.splice(index, 1);
|
|
|
|
+ },
|
|
|
|
+ // toadd() {
|
|
|
|
+ // this.$router.push({ path: './detail' });
|
|
|
|
+ // },
|
|
onSubmit() {
|
|
onSubmit() {
|
|
console.log('submit!');
|
|
console.log('submit!');
|
|
},
|
|
},
|
|
@@ -135,4 +163,7 @@ export default {
|
|
padding: 0;
|
|
padding: 0;
|
|
height: 40px;
|
|
height: 40px;
|
|
}
|
|
}
|
|
|
|
+.page {
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|