<el-descriptions title="用户信息" :column="2">
<el-form ref="form" :model="form" label-width="200px" :inline="true" :rules="rules">
<el-form-item label="值" prop="value">
:total="total" @size-change="handleSizeChange" @current-change="handePageChange">
@current-change="handleCurrentChange">
// import {getListInfo} from '...'
export default {
name: 'ItmanTable1',
data() {
return {
tableData: [],
form: {
value: '',
name: '',
searchAddr: ''
},
rules: {
name: [{
required: true, message: '请输入姓名', trigger: ['blur', 'change']
}]
},
PageNum: 1,
pageSize: 10,
total: 20,
dialogTableVisible: false,
currentRow: {},
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}]
};
},
mounted() {
this.getList()
},
methods: {
onSubmit() {
this.$refs['form'].validate((valid) => {
if (valid) {
this.getList()
} else {
console.log('error submit!!');
return false;
}
});
},
handleDialogDBClick(row, column, event) {
// console.log(row)
// console.log(column)
this.form.name = row.name
this.dialogTableVisible = false
},
handleCurrentChange(val) {
console.log(val)
this.currentRow = val;
},
handleDialogOK() {
this.form.name = this.currentRow.name
this.dialogTableVisible = false
},
handleSizeChange(val) {
this.pageSize = val
this.PageNum = 1
this.getList()
},
handePageChange(val) {
this.PageNum = val
this.getList()
},
handleSave(item) {
console.log(item)
},
handleView(row) {
this.$router.push({
name: 'Table2',
params: { id: row.id }
})
},
getList() {
//调接口,返回列表结果
// getListInfo(this.form).then(res=> {
// this.tableData = res.data
// this.total = res.data.total
// })
console.log(this.PageNum)
console.log(this.pageSize)
let list = [{
id: 1,
date: '2016-05-02',
name: '王小虎1',
sex: 1,
address: '上海市普陀区金沙江路 1518 弄'
}, {
id: 2,
date: '2016-05-04',
name: '王小虎2',
sex: 1,
address: '上海市普陀区金沙江路 1517 弄'
}, {
id: 3,
date: '2016-05-01',
name: '王小虎3',
sex: 1,
address: '上海市普陀区金沙江路 1519 弄'
}, {
id: 4,
date: '2016-05-03',
name: '王小虎4',
sex: 1,
address: '上海市普陀区金沙江路 1516 弄'
}]
list.forEach(item => {
item.sexStr = item.sex == 1 ? '男' : '女'
item.mark = '123'
})
this.tableData = list
}
},
};