新版交易所前段管理后台
1
admin
2026-01-04 bfdea10fd9474ef84fe56892b1922223b4b07582
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
<template>
  <el-dialog
    :title="''"
    :close-on-click-modal="false"
    :visible.sync="visible"
    @close="handClose"
    width="600px"
  >
    <el-form
      :model="dataForm"
      ref="dataForm"
      :rules="dataRule"
      @keyup.enter.native="dataFormSubmit()"
      label-width="120px"
      label-position="top"
      style="width: auto"
      size="mini"
    >
      <span>详细信息</span>
      <el-divider></el-divider>
 
      <el-form-item label="实名姓名" prop="userName" style="width: auto">
        <el-input
          v-model="dataForm.userName"
          placeholder=""
          disabled
          style="width: 510px"
        ></el-input>
      </el-form-item>
 
      <el-form-item label="证件名称" prop="idName" style="width: auto">
        <el-input
          v-model="dataForm.idName"
          placeholder=""
          disabled
          style="width: 510px"
        ></el-input>
      </el-form-item>
 
      <el-form-item label="证件号码" prop="idNumber" style="width: auto">
        <el-input
          v-model="dataForm.idNumber"
          placeholder=""
          disabled
          style="width: 510px"
        ></el-input>
      </el-form-item>
 
      <el-form-item label="国籍" prop="nationality" style="width: auto">
        <el-input
          v-model="dataForm.nationality"
          placeholder=""
          disabled
          style="width: 510px"
        ></el-input>
      </el-form-item>
 
      <span>证件照</span>
      <el-divider></el-divider>
      <el-row>
        <el-col :span="8">
          <el-form-item label="证件正面照" prop="methodImg">
            <el-upload
              class="avatar-uploader"
              :action="$http.adornUrl('/api/uploadFile')"
              :headers="{ Authorization: $cookie.get('Authorization') }"
              :show-file-list="false"
              :on-success="handleAvatarSuccess0"
              :before-upload="beforeAvatarUpload0"
            >
              <img v-if="idFrontImg" :src="idFrontImg" class="avatar" />
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="证件背面照" prop="methodImg">
            <el-upload
              class="avatar-uploader"
              :action="$http.adornUrl('/api/uploadFile')"
              :headers="{ Authorization: $cookie.get('Authorization') }"
              :show-file-list="false"
              :on-success="handleAvatarSuccess1"
              :before-upload="beforeAvatarUpload1"
            >
              <img v-if="idBackImg" :src="idBackImg" class="avatar" />
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="手持正面照" prop="methodImg">
            <el-upload
              class="avatar-uploader"
              :action="$http.adornUrl('/api/uploadFile')"
              :headers="{ Authorization: $cookie.get('Authorization') }"
              :show-file-list="false"
              :on-success="handleAvatarSuccess2"
              :before-upload="beforeAvatarUpload2"
            >
              <img v-if="handheldPhoto" :src="handheldPhoto" class="avatar" />
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
    <!-- 确认弹窗-end -->
  </el-dialog>
</template>
 
<script>
import { Debounce } from "@/utils/debounce";
export default {
  data() {
    return {
      idFrontImg1: "",
      idBackImg1: "",
      handheldPhoto1: "",
      idFrontImg: "",
      idBackImg: "",
      handheldPhoto: "",
      visible: false,
      dialogFormVisible: true,
      formLabelWidth: "120px",
      menuList: [],
      menuListTreeProps: {
        label: "name",
        children: "children",
      },
      options: [],
      row: "",
      dataForm: {
        id: "",
        idCode: "",
        projectName: "",
        issuePrice: "",
        currency: "usdt",
        expectedLaunchTime: "",
        subscriptionEndTime: "",
        subscriptionStartTime: "",
        publishTime: "",
        minQuantity: "",
        maxQuantity: "",
        whitePagerAddress: "",
        relatedStockName: [],
      },
      fixstork: [], //返回的相关股票品种
      stocks: [],
      dataRule: {
        relatedStockName: [
          { required: true, message: "成分股不能为空", trigger: "blur" },
        ],
        projectName: [{ required: true, message: "不能为空", trigger: "blur" }],
        turnover: [
          { required: true, message: "成交量不能为空", trigger: "blur" },
        ],
        initPrice: [
          { required: true, message: "初始化价格不能为空", trigger: "blur" },
        ],
        minProfitLoss: [
          {
            required: true,
            message: "最小变动单位的盈亏金额不能为空",
            trigger: "blur",
          },
        ],
        minUnit: [
          { required: true, message: "最小变动单位不能为空", trigger: "blur" },
        ],
        fee: [
          { required: true, message: "每张手续费不能为空", trigger: "blur" },
        ],
        amount: [
          { required: true, message: "每张金额不能为空", trigger: "blur" },
        ],
      },
    };
  },
  methods: {
    init(row) {
      //console.log(row);
 
      let id = row.uuid;
      this.dataForm = {};
      this.visible = true;
 
      this.getDesc(id);
    },
    handClose() {
      this.$data.dataForm = JSON.parse(
        JSON.stringify(this.$options.data().dataForm)
      );
      this.$nextTick(() => {
        this.$refs["dataForm"].clearValidate(); // 清除表单验证
      });
    },
    changeVal(val) {
      this.$forceUpdate();
    },
    dataFormSubmit: Debounce(function () {
      this.UpdateProjectBreed();
    }),
    handleAvatarSuccess0(res, file) {
      if (res.code == 0) {
        this.dataForm.idFrontImg = URL.createObjectURL(file.raw); //显示地址
        this.dataForm.imgUrl = res.data.path; //接口传递
        this.idFrontImg = this.dataForm.idFrontImg;
        this.idFrontImg1 = this.dataForm.imgUrl;
      } else {
        this.$message({
          message: res.msg,
          type: "error",
          duration: 1500,
          onClose: () => {},
        });
      }
    },
    beforeAvatarUpload0(file) {
      // const isJPG = file.type === 'image/jpeg';
      const isLt2M = file.size / 1024 / 1024 < 10;
      if (!isLt2M) {
        this.$message.error("上传图片大小不能超过 10MB!");
      }
      return isLt2M;
    },
    handleAvatarSuccess1(res, file) {
      if (res.code == 0) {
        this.dataForm.idBackImg = URL.createObjectURL(file.raw); //显示地址
        this.dataForm.imgUrl = res.data.path; //接口传递
        this.idBackImg = this.dataForm.idBackImg || "";
        this.idBackImg1 = this.dataForm.imgUrl;
      } else {
        this.$message({
          message: res.msg,
          type: "error",
          duration: 1500,
          onClose: () => {},
        });
      }
    },
    beforeAvatarUpload1(file) {
      // const isJPG = file.type === 'image/jpeg';
      const isLt2M = file.size / 1024 / 1024 < 10;
      if (!isLt2M) {
        this.$message.error("上传图片大小不能超过 10MB!");
      }
      return isLt2M;
    },
    handleAvatarSuccess2(res, file) {
      if (res.code == 0) {
        this.dataForm.handheldPhoto = URL.createObjectURL(file.raw); //显示地址
        this.dataForm.imgUrl = res.data.path; //接口传递
        this.handheldPhoto = this.dataForm.handheldPhoto || "";
        this.handheldPhoto1 = this.dataForm.imgUrl;
      } else {
        this.$message({
          message: res.msg,
          type: "error",
          duration: 1500,
          onClose: () => {},
        });
      }
    },
    beforeAvatarUpload2(file) {
      // const isJPG = file.type === 'image/jpeg';
      const isLt2M = file.size / 1024 / 1024 < 10;
      if (!isLt2M) {
        this.$message.error("上传图片大小不能超过 10MB!");
      }
      return isLt2M;
    },
    UpdateProjectBreed() {
      //start
      this.$refs["dataForm"].validate((valid) => {
        //修改
        if (valid) {
          this.$http({
            url: this.$http.adornUrl(`/edit`),
            method: "put",
            data: this.$http.adornData({
              uuid: this.dataForm.uuid,
              idFrontImg: this.idFrontImg1,
              idBackImg: this.idBackImg1,
              handheldPhoto: this.handheldPhoto1,
            }),
          }).then(({ data }) => {
            if (data.code == 0) {
              this.$message({
                message: "操作成功",
                type: "success",
                duration: 1500,
                onClose: () => {
                  this.dialogFormVisible = false;
                  this.visible = false;
                  this.$emit("refreshDataList");
                },
              });
            } else {
              this.$message({
                message: data.msg,
                type: "error",
                duration: 1500,
                onClose: () => {
                  this.dialogFormVisible = false;
                  this.visible = false;
                },
              });
            }
          });
        }
      });
      //end
    },
    //获取详情
    getDesc(uuid) {
      this.$http({
        url: this.$http.adornUrl("/getById/" + uuid),
        method: "get",
      }).then(({ data }) => {
        if (data.code == 0) {
          this.dataForm = data.data;
 
          this.idFrontImg = this.dataForm.idFrontImg || "";
          this.idBackImg = this.dataForm.idBackImg || "";
          this.handheldPhoto = this.dataForm.handheldPhoto || "";
        } else {
          this.$message({
            message: data.msg,
            type: "error",
            duration: 1500,
          });
        }
      });
    },
  },
};
</script>
 
<style scoped>
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
 
.frame {
  width: 700px;
}
 
.customWidth1 {
  position: relative;
  margin: 0 auto 50px;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  width: 60%;
}
/* 
  ::deep .customWidth {
     width: 45%;
  }  */
</style>