yangfeng
2024-01-03 6dcbb9b5e2b3355030a5e6e4ed44e7352338d3fb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<template>
  <div class="user-manage">
    <div class="top-card">
      <CommonSearch
        :show-add="false"
        :amount-view="false"
        placeholder="请输入用户名/手机号"
        @searchClick="onFilterSearch"
      >
        <!-- <template slot="leftButton">
          <el-button size="small" type="primary" @click="addBtnClick">新建</el-button>
        </template> -->
      </CommonSearch>
    </div>
 
    <div class="body">
      <div class="body-card">
        <div class="list-view">
          <TableCommonView
            ref="tableListRef"
            :table-list="tableList"
            :show-summary="showSummary"
            @selClientClick="selClientClick"
            @selMasterClick="selMasterClick"
            @selCommonClick="selCommonClick"
            @getSelectArray="getSelectArray"
            @selTableCol="selTableCol"
          >
            <template slot="tableButton">
              <el-table-column label="操作" width="90">
                <template slot-scope="scope">
                  <el-button @click="viewClick(scope.row)" type="text" size="small">查看</el-button>
                  <el-button @click="approveClick(scope.row)" type="text" size="small">审核</el-button>
                  <el-button @click="approveClick(scope.row)" type="text" size="small">启用</el-button>
                  <el-button @click="editClick(scope.row)" type="text" size="small">编辑</el-button>
                </template>
              </el-table-column>
            </template>
          </TableCommonView>
        </div>
        <div class="btn-pager">
          <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
        </div>
      </div>
    </div>
    <!-- 新建/编辑 -->
    <!-- <AddSubOrderDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> -->
  </div>
</template>
 
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
 
export default {
  name: "UserManage",
  props: {},
  mixins: [pageMixin],
  components: {},
  computed: {},
  data() {
    return {
      tableList: {},
      tableColumn: [
        { label: "序号", prop: "number", default: true },
        { label: "用户名", prop: "client_name" },
        { label: "手机号", prop: "signTime" }, // 签约日期
        { label: "公司名称", prop: "serviceContractType" },
        { label: "联系人姓名", prop: "serviceContractStatus" },
        { label: "邮箱", prop: "member_name" },
        { label: "行业", prop: "productName", isProductName: true },
        { label: "地区", prop: "startTime" },
        { label: "状态", prop: "endTime" }
      ],
      showCol: ["序号", "用户名", "手机号", "公司名称", "联系人姓名", "邮箱", "行业", "地区", "状态"]
    }
  },
  created() {
    this.setTable()
  },
  methods: {
    // 查看
    viewClick(row) {
      console.log(row)
    },
    // 审核
    approveClick(row) {
      console.log(row)
    },
    // 编辑
    editClick(row) {
      console.log(row)
    },
    // 列表初始化
    setTable() {
      this.tableList = {
        selectIndex: true,
        tableInfomation: [],
        allcol: [],
        showcol: this.showCol,
        tableColumn: this.setColumnVisible(this.showCol)
      }
      this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label)
      this.searchOptions = []
      for (let i = 0; i < this.tableList.tableColumn.length; i++) {
        const label = this.tableList.tableColumn[i].label
        const value = this.tableList.tableColumn[i].prop
        this.searchOptions.push({ value: value, label: label })
      }
    },
    setColumnVisible(showCol) {
      return this.tableColumn.map((ele) => {
        return {
          ...ele,
          isShowColumn: showCol.includes(ele.label)
        }
      })
    },
    selTableCol(val) {
      this.showcol = val
      this.tableList.tableColumn = this.setColumnVisible(val)
    }
  }
}
</script>
 
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
.user-manage {
  height: 100%;
  .top-card {
    height: 80px;
    display: flex;
    align-items: center;
    margin: 12px 20px 0 20px;
    border-radius: 12px;
    background-color: #fff;
    padding-left: 20px;
  }
  .body {
    box-sizing: border-box;
    padding: 10px 20px;
    border-radius: 12px;
    height: calc(100% - 92px);
    .body-card {
      background-color: #fff;
      border-radius: 12px;
      height: 100%;
      overflow: hidden;
    }
    .list-view {
      height: calc(100% - 60px);
      overflow: hidden;
    }
    .btn-pager {
      display: flex;
      margin-top: 10px;
      .page {
        margin-left: auto;
      }
    }
  }
}
 
::v-deep {
}
</style>