taylor
8 years ago
8 changed files with 118 additions and 55 deletions
-
9src/App.vue
-
4src/api/api.js
-
4src/main.js
-
19src/mock/mock.js
-
26src/mockdata/user.js
-
28src/pages/nav1/Page3.vue
-
10src/pages/nav1/Table.vue
-
73src/pages/nav1/user.vue
@ -1,28 +0,0 @@ |
|||
<template> |
|||
<el-tabs style="width:100%;" type="card" @tab-click="handleClick" @tab-remove="handleRemove"> |
|||
<el-tab-pane label="用户管理"> |
|||
<el-col :span="24" style="padding:10px;"> |
|||
<el-steps :space="100" direction="vertical" :active="1"> |
|||
<el-step title="步骤 1"></el-step> |
|||
<el-step title="步骤 2"></el-step> |
|||
<el-step title="步骤 3"></el-step> |
|||
</el-steps> |
|||
</el-col> |
|||
</el-tab-pane> |
|||
<el-tab-pane label="配置管理">222</el-tab-pane> |
|||
<el-tab-pane label="角色管理">333</el-tab-pane> |
|||
<el-tab-pane label="定时任务补偿">444</el-tab-pane> |
|||
</el-tabs> |
|||
</template> |
|||
<script> |
|||
export default { |
|||
methods: { |
|||
handleRemove(tab) { |
|||
console.log(tab); |
|||
}, |
|||
handleClick(tab) { |
|||
console.log(tab); |
|||
} |
|||
} |
|||
}; |
|||
</script> |
@ -0,0 +1,73 @@ |
|||
<template> |
|||
<section> |
|||
<!--工具条--> |
|||
<el-col :span="24" class="toolbar"> |
|||
<el-form :inline="true" :model="filters"> |
|||
<el-form-item> |
|||
<el-input v-model="filters.name" placeholder="姓名"></el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-on:click="getUser">查询</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-col> |
|||
|
|||
<!--列表--> |
|||
<template> |
|||
<el-table :data="users" highlight-current-row v-loading="loading" style="width: 100%;"> |
|||
<el-table-column type="index" width="50"> |
|||
</el-table-column> |
|||
<el-table-column prop="name" label="姓名" width="180" sortable> |
|||
</el-table-column> |
|||
<el-table-column prop="sex" label="性别" width="100" :formatter="formatSex" sortable> |
|||
</el-table-column> |
|||
<el-table-column prop="age" label="年龄" width="100" sortable> |
|||
</el-table-column> |
|||
<el-table-column prop="birth" label="生日" width="180" sortable> |
|||
</el-table-column> |
|||
<el-table-column prop="addr" label="地址" sortable> |
|||
</el-table-column> |
|||
</el-table> |
|||
</template> |
|||
|
|||
</section> |
|||
</template> |
|||
<script> |
|||
import { getUserList } from '../../api/api'; |
|||
export default { |
|||
data() { |
|||
return { |
|||
filters: { |
|||
name: '' |
|||
}, |
|||
loading: false, |
|||
users: [ |
|||
] |
|||
} |
|||
}, |
|||
methods: { |
|||
//性别显示转换 |
|||
formatSex: function (row, column) { |
|||
return row.sex == 1 ? '男' : row.sex == 0 ? '女' : '未知'; |
|||
}, |
|||
//获取用户列表 |
|||
getUser: function () { |
|||
let para = { |
|||
name: this.filters.name |
|||
}; |
|||
this.loading = true; |
|||
getUserList(para).then((res) => { |
|||
this.users = res.data.users; |
|||
this.loading = false; |
|||
}); |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.getUser(); |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue