wangzhibo
2026-10-08 220e4fab27b7f419b3e89e2f2d28ae789aac09d7
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
<template>
  <el-dialog :visible.sync="dialogVisible" width="400px" center>
    <div
      style="margin: 0 10px 10px;display: flex;align-items: center;gap: 10px;font-weight: 700;font-size: 20px;text-align: left;color: #3d4566;">
      <div
        style="width: 40px;height: 40px;border-radius: 50%;background: #5778ff;display: flex;align-items: center;justify-content: center;">
        <img src="@/assets/login/shield.png" alt=""
          style="width: 19px;height: 23px; filter: brightness(0) invert(1);" />
      </div>
      用户新密码
    </div>
    <div style="height: 1px;background: #e8f0ff;" />
    <div style="margin: 22px 15px;">
      <div style="font-weight: 400;font-size: 14px;text-align: left;color: #3d4566;">
        <div style="color: red;display: inline-block;">*</div>
        用户新密码:
      </div>
      <div class="input-46" style="margin-top: 12px;">
        <el-input v-model="password" type="text" :readonly="true" style="font-weight: bold; color: #333;" />
      </div>
    </div>
    <div style="display: flex;margin: 15px 15px;gap: 7px;">
      <div class="dialog-btn" style="background: #e6ebff;border: 1px solid #adbdff;color: #5778ff;"
        @click="closeDialog">
        关闭
      </div>
      <div class="dialog-btn" style="background: #5778ff;color: white;" @click="copyPassword">
        复制密码
      </div>
    </div>
  </el-dialog>
</template>
 
<script>
export default {
  name: 'ViewPasswordDialog',
  props: {
    visible: { type: Boolean, required: true },
    password: { type: String, default: '' }
  },
  data() {
    return {
      dialogVisible: this.visible
    }
  },
  watch: {
    visible(val) {
      this.dialogVisible = val
    },
    dialogVisible(val) {
      this.$emit('update:visible', val)
    }
  },
  methods: {
    closeDialog() {
      this.dialogVisible = false
    },
    copyPassword() {
      navigator.clipboard.writeText(this.password)
      this.$message.success({
        message: '密码已复制',
        showClose: true
      })
    }
  }
}
</script>
 
<style scoped>
.input-46 {
  border: 1px solid #e4e6ef;
  background: #f6f8fb;
  border-radius: 15px;
}
 
.dialog-btn {
  cursor: pointer;
  flex: 1;
  border-radius: 23px;
  height: 40px;
  font-weight: 500;
  font-size: 12px;
  line-height: 40px;
  text-align: center;
}
 
::v-deep .el-dialog {
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
 
::v-deep .el-dialog__headerbtn {
  display: none;
}
 
::v-deep .el-dialog__body {
  padding: 4px 6px;
}
 
::v-deep .el-input__inner {
  background-color: #f6f8fb !important;
  cursor: default !important;
}
</style>