10.10综合交易所原始源码-管理后台
admin
2026-01-06 a3cc41349752d6fb067df2a58e4e4b723a915f21
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<template>
  <div class="mod-role">
    <avue-crud
      ref="crud"
      :page.sync="page"
      :data="sortedDataList"
      :option="tableOption"
      @search-change="searchChange"
      @selection-change="selectionChange"
      :cell-class-name="addClasscolor"
      @on-load="getDataList"
      @refresh-change="getDataList"
    >
      <template slot="menuLeft">
        <!-- 搜索 -->
        <!-- <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList(this.page)">
          
          <el-form-item label="用户名/UID:">
            <el-input v-model="dataForm.userName"
                      placeholder="用户名/UID"
                      clearable></el-input>
          </el-form-item>
          <el-form-item label="证件号码:">
            <el-input v-model="dataForm.idNumber"
                      placeholder="证件号码查询"
                      clearable></el-input>
          </el-form-item>
          <el-form-item label="账号类型">
            <el-select v-model="dataForm.roleName" placeholder="所有账号">
              <el-option label="所有账号" value=""></el-option>
              <el-option label="正式账号" value="MEMBER"></el-option>
              <el-option label="演示账号" value="MEMBER1"></el-option>
              <el-option label="试用账号" value="MEMBER2"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button type="primary"
                      icon="el-icon-search"
                      size="small"
                      @click="getList()">查询</el-button>
            <el-button @click="clearDatas()"
                      size="small">清空</el-button> -->
        <!-- </el-form-item>
        </el-form> -->
        <!-- Tag页 -->
        <!-- <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="全部" name="1"></el-tab-pane>
          <el-tab-pane label="待审核" name="2"></el-tab-pane>
          <el-tab-pane label="审核通过" name="3"></el-tab-pane>
          <el-tab-pane label="未通过" name="4"></el-tab-pane>
        </el-tabs> -->
        <avue-tabs :option="option" @change="handleChange"></avue-tabs>
        <span v-if="type.prop === 'tab1'"></span>
        <span v-else-if="type.prop === 'tab2'"></span>
        <span v-else-if="type.prop === 'tab3'"></span>
        <span v-else-if="type.prop === 'tab4'"></span>
      </template>
      <!-- 用户名 -->
      <template slot-scope="scope" slot="userName">
        <span @click="searchName(scope.row)" class="speacButton">{{
          scope.row.userName
        }}</span>
      </template>
      <template slot-scope="scope" slot="recomUserName">
        <span @click="searchName(scope.row)" class="speacButton">{{
          scope.row.recomUserName
        }}</span>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          v-if="scope.row.status !== 2 && isAuth('user:senior:review')"
          @click.stop="addOrUpdateHandle(scope.row.uuid)"
          >审核通过</el-button
        >
 
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="small"
          v-if="scope.row.status !== 2 &&isAuth('user:senior:review')"
          @click.stop="deleteHandle(scope.row.uuid)"
          >驳回</el-button
        >
      </template>
    </avue-crud>
    <!-- 弹窗, 新增 / 修改 -->
    <add-or-update
      v-if="addOrUpdateVisible"
      ref="addOrUpdate"
      @refreshDataList="getDataList"
    ></add-or-update>
    <!-- 参数管理 -->
    <parameters v-if="parametersFlag" ref="parameters"> </parameters>
  </div>
</template>
 
<script>
import { tableOption } from "@/crud/user-relation/senior";
import AddOrUpdate from "./senior-add-or-update";
import parameters from "./senior-variety-add-or-update";
export default {
  data() {
    return {
      parametersFlag: false,
      activeName: "1",
      dataList: [],
      dataList2: [],
      dataListLoading: false,
      dataListSelections: [],
      addOrUpdateVisible: false,
      tableOption: tableOption,
      status: "",
      type: {},
      option: {
        column: [
          {
            label: "全部",
            prop: "",
          },
          {
            label: "待审核",
            prop: "1",
          },
          {
            label: "审核通过",
            prop: "2",
          },
          {
            label: "未通过",
            prop: "3",
          },
        ],
      },
      page: {
        total: 0, // 总页数
        currentPage: 1, // 当前页数
        pageSize: 10, // 每页显示多少条
      },
      searchParams: {}, // 搜索条件
      dataForm: {
        roleName: "",
      },
    };
  },
  components: {
    AddOrUpdate,
    parameters,
  },
  computed: {
    sortedDataList() {
      const dataListCopy = [...this.dataList];
      const statusZeroData = dataListCopy.filter((item) => item.status !== 2);
      const otherData = dataListCopy.filter((item) => item.status === 2);
      return [...statusZeroData, ...otherData];
    },
  },
  created() {
    this.type = this.option.column[0];
  },
  mounted() {
    this.$bus.$on('updateOfSenior', (data)=>{
      this.getDataList();
    })
  },
  beforeDestroy() {
    // 组件被销毁了,不能进行数据传输
    // 解绑事件
    this.$bus.$off('updateOfSenior')
  },
  methods: {
    // 获取数据列表
    getDataList(page, done) {
      const params = {
        current: page == null ? this.page.currentPage : page.currentPage,
        size: page == null ? this.page.pageSize : page.pageSize,
        ...this.searchParams,
      };
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl("/highLevelAuth/list"),
        method: "post",
        data: this.$http.adornData(
          Object.assign(
            {
              status: this.status,
              current: page == null ? this.page.currentPage : page.currentPage,
              size: page == null ? this.page.pageSize : page.pageSize,
              // type:"indices",
              // offset:"open",
            },
            params
          )
        ),
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dataList = data.data.records;
          this.page.total = data.data.total;
          this.dataListLoading = false;
          this.getList();
        } else {
          this.$message({
            message: data.msg,
            type: "error",
          });
        }
        if (done) {
          done();
        }
      });
    },
    addClasscolor({ column, row }) {
      //表单样式
      if (
        (column.property === "roleName" && row.roleName == "MEMBER") ||
        (column.property === "status" && row.status == 2)
      ) {
        return "green";
      } else if (column.property === "roleName" && row.roleName == "GUEST") {
        return "yellow";
      } else if (column.property === "status" && row.status == 3) {
        return "red";
      }
    },
    // 条件查询
    searchChange(params, done) {
      this.page.currentPage = 1; // 重置当前页为第一页
      this.searchParams = params;
      this.getDataList(this.page, done);
    },
    // 多选变化
    selectionChange(val) {
      this.dataListSelections = val;
    },
    //审核通过
    addOrUpdateHandle(id) {
      // this.addOrUpdateVisible = true
      // this.$nextTick(() => {
      //   this.$refs.addOrUpdate.init(id)
      // })
      this.$confirm(`提示:您确认要审核通过吗?`, "是否确认审核通过", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$http({
            url: this.$http.adornUrl("/highLevelAuth/examine"),
            method: "post",
            data: this.$http.adornData({
              content: "",
              id: id,
              type: 1,
            }),
          }).then(({ data }) => {
            if (data.code == 0) {
              this.$message({
                message: "操作成功",
                type: "success",
                duration: 1500,
                onClose: () => {
                  this.getDataList();
                },
              });
            } else {
              this.$message({
                message: data.msg,
                type: "error",
                duration: 1500,
                onClose: () => {},
              });
            }
          });
        })
        .catch(() => {});
    },
    // 驳回
    deleteHandle(id) {
      this.addOrUpdateVisible = true;
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(id);
      });
    },
    // tab切换
    handleChange(column, params, done) {
      this.type = column;
      this.status = column.prop;
      this.getDataList(this.page, params, done);
    },
    changeSelet(uid, val) {
      if (val) {
        let m = this.options[val - 1].label; //弹窗标题
        if (
          val == 1 ||
          val == 8 ||
          val == 7 ||
          val == 9 ||
          val == 6 ||
          val == 10
        ) {
          // 1资金账户 8谷歌验证 7密码 9资金密码 6提现限制流水 10强制退出
          this.addOrUpdateVisible = true;
          this.$nextTick(() => {
            this.$refs.addOrUpdate.init(uid, m, val);
          });
        } else {
          this.$message({
            message: "暂未开放该功能",
            type: "success",
          });
        }
      }
    },
    // 选项卡
    handleClick(tab, event) {
      this.getList();
    },
    getList() {
      //dataForm.userName
      //dataForm.idNumber
      //dataForm.roleName
      let call = (item, status) => {
        let flag0 =
          item.userName.indexOf(this.dataForm.userName) >= 0 ||
          item.userCode.indexOf(this.dataForm.userName) >= 0;
        let flag1 = item.status == status || status == -1;
        let flag2 =
          !this.dataForm.userName || (this.dataForm.userName && flag0);
        let flag3 =
          !this.dataForm.idNumber ||
          (this.dataForm.idNumber && item.idNumber == this.dataForm.idNumber);
        let flag4 =
          !this.dataForm.roleName ||
          (this.dataForm.roleName && item.roleName == this.dataForm.roleName);
        return flag1 && flag2 && flag3 && flag4;
      };
      //0已申请未审核 ,1.审核中 2 审核通过,3审核未通过
      switch (this.activeName) {
        case "1":
          {
            // this.dataList2 = [].concat(this.dataList);
            this.dataList2 = this.dataList.filter((item) => {
              return call(item, -1);
            });
          }
          break;
        case "2": //待审核
          {
            this.dataList2 = this.dataList.filter((item) => {
              return call(item, 1);
            });
          }
          break;
        case "3": //审核通过
          {
            this.dataList2 = this.dataList.filter((item) => {
              return call(item, 2);
            });
          }
          break;
        case "4": //未通过
          {
            this.dataList2 = this.dataList.filter((item) => {
              return call(item, 3);
            });
          }
          break;
      }
    },
    searchName(row) {
      //this.userNamevisible = true
      this.parametersFlag = true;
      this.$nextTick(() => {
        this.$refs.parameters.init(row);
      });
    },
  },
};
</script>
<style scoped>
.speacButton {
  color: rgb(69, 147, 235);
  cursor: pointer;
}
.speacButton:hover {
  color: #356ced;
}
</style>