123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <template>
- <div id="one">
- <el-row>
- <el-col :span="24">
- <el-table :data="list" style="width: 100%" border>
- <el-table-column prop="name" label="用户名称" align="center"> </el-table-column>
- <el-table-column prop="phone" label="用户ID" align="center"> </el-table-column>
- <el-table-column label="用户类型" align="center">
- <template v-slot="scoped">
- {{ `${scoped.row.role}` == `4` ? '个人用户' : `${scoped.row.role}` == `5` ? '机构用户' : `${scoped.row.role}` == `6` ? '专家用户' : '临时用户' }}
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center">
- <template v-slot="scoped">
- {{ `${scoped.row.status}` == `0` ? '审核中' : `${scoped.row.status}` == `1` ? '审核通过' : `${scoped.row.status}` == `2` ? '审核拒绝' : '草稿' }}
- </template>
- </el-table-column>
- <el-table-column fixed="right" label="操作" align="center">
- <template slot-scope="scoped">
- <el-tooltip content="审核" placement="bottom" effect="light">
- <el-button type="text" size="small" @click="handleEdit(scoped.row)"><i class="el-icon-view"></i></el-button>
- </el-tooltip>
- <el-tooltip content="删除" placement="bottom" effect="light">
- <el-button type="text" size="small" @click="handleDelete(scoped.row)"><i class="el-icon-delete"></i></el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- <el-col :span="24" class="page">
- <el-pagination
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- layout="total, prev, pager, next, jumper"
- :total="total"
- :page-size="pageSize"
- >
- </el-pagination>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import { mapState, createNamespacedHelpers } from 'vuex';
- export default {
- name: 'one',
- props: {
- oneList: { type: Array, default: () => [] },
- total: { type: Number, default: 0 },
- },
- components: {},
- data: function() {
- return {
- currentPage: 1,
- pageSize: 10,
- origin: [],
- list: [],
- };
- },
- created() {},
- methods: {
- search(page = 1) {
- this.$set(this, `list`, this.origin[page - 1]);
- },
- handleCurrentChange(currentPage) {
- this.search(currentPage);
- },
- handleEdit(data) {
- this.$emit('handleEdit', data);
- },
- handleDelete(data) {
- this.$emit('handleDelete', data);
- },
- },
- computed: {
- ...mapState(['user']),
- pageTitle() {
- return `${this.$route.meta.title}`;
- },
- },
- metaInfo() {
- return { title: this.$route.meta.title };
- },
- watch: {
- oneList: {
- immediate: true,
- deep: true,
- handler(val) {
- if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
- this.search();
- },
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .page {
- text-align: center;
- padding: 15px 0;
- }
- </style>
|