st-comp 0.0.149 → 0.0.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/es/ChartLayout.cjs +1 -1
  2. package/es/ChartLayout.js +5 -4
  3. package/es/Dialog.cjs +1 -1
  4. package/es/Dialog.js +24 -22
  5. package/es/FactorWarning.cjs +1 -1
  6. package/es/FactorWarning.js +52 -50
  7. package/es/Kline.cjs +1 -1
  8. package/es/Kline.js +18 -16
  9. package/es/KlineBasic.cjs +1 -1
  10. package/es/KlineBasic.js +26 -24
  11. package/es/KlineNew.cjs +1 -1
  12. package/es/KlineNew.js +16 -14
  13. package/es/Pagination.cjs +1 -1
  14. package/es/Pagination.js +58 -56
  15. package/es/PasswordPrompt.cjs +1 -0
  16. package/es/PasswordPrompt.js +13 -0
  17. package/es/Table.cjs +1 -1
  18. package/es/Table.js +105 -103
  19. package/es/User.cjs +1 -1
  20. package/es/User.js +400 -378
  21. package/es/VarietySearch.cjs +1 -1
  22. package/es/VarietySearch.js +230 -228
  23. package/es/VirtualTable.cjs +3 -3
  24. package/es/VirtualTable.js +196 -194
  25. package/es/_initCloneObject-47814efa.cjs +1 -0
  26. package/es/{_initCloneObject-14b53c6f.js → _initCloneObject-e3d8a9ab.js} +21 -21
  27. package/es/base-0ca7c43a.cjs +5 -0
  28. package/es/base-19787dfb.js +303 -0
  29. package/es/{castArray-4251bbe4.js → castArray-8405000b.js} +1 -1
  30. package/es/castArray-a78ae889.cjs +1 -0
  31. package/es/{config-provider-55482a43.js → config-provider-0f6672af.js} +3 -3
  32. package/es/{config-provider-7cdfca4d.cjs → config-provider-cfbb9cd8.cjs} +1 -1
  33. package/es/{debounce-ac30be50.js → debounce-6cb0781f.js} +19 -19
  34. package/es/debounce-cf26af24.cjs +1 -0
  35. package/es/{dropdown-634b5e27.js → dropdown-17b3ef6a.js} +4 -4
  36. package/es/{dropdown-d7c59a21.cjs → dropdown-790d31ea.cjs} +1 -1
  37. package/es/{el-button-e1665717.js → el-button-0bf1d532.js} +17 -16
  38. package/es/el-button-62966947.cjs +1 -0
  39. package/es/{el-checkbox-group-492b95cc.cjs → el-checkbox-group-45247bbf.cjs} +1 -1
  40. package/es/{el-checkbox-group-e8fece80.js → el-checkbox-group-d53bc316.js} +5 -5
  41. package/es/el-empty-2ece1134.cjs +1 -0
  42. package/es/{el-empty-bacc6613.js → el-empty-bd5343a7.js} +10 -9
  43. package/es/{el-form-item-af1855f0.js → el-form-item-05c0e335.js} +52 -51
  44. package/es/el-form-item-47e255d4.cjs +12 -0
  45. package/es/{el-input-4961b99f.js → el-input-1e309239.js} +79 -78
  46. package/es/el-input-6a3805c5.cjs +1 -0
  47. package/es/{el-input-number-610fc8ba.js → el-input-number-60ebc58f.js} +57 -55
  48. package/es/el-input-number-96ff2e47.cjs +1 -0
  49. package/es/el-menu-item-4c9eb7ad.cjs +1 -0
  50. package/es/{el-menu-item-7d04c11a.js → el-menu-item-6c6236a1.js} +84 -83
  51. package/es/{el-message-c3b3ac96.js → el-message-7d927756.js} +55 -54
  52. package/es/el-message-d5ed7a4f.cjs +1 -0
  53. package/es/{el-overlay-12dd9b35.js → el-overlay-26bf0945.js} +73 -71
  54. package/es/el-overlay-41994f67.cjs +1 -0
  55. package/es/{el-popover-0aa071f2.js → el-popover-17e2e66c.js} +26 -24
  56. package/es/el-popover-7bd8a7c3.cjs +1 -0
  57. package/es/el-popper-7adbf1c6.cjs +1 -0
  58. package/es/{el-popper-50100766.js → el-popper-b6527ae2.js} +194 -193
  59. package/es/{el-scrollbar-562d0595.js → el-scrollbar-29bcab5f.js} +28 -28
  60. package/es/{el-scrollbar-d1c3e7f7.cjs → el-scrollbar-ac525239.cjs} +1 -1
  61. package/es/el-select-31f8ac8a.cjs +1 -0
  62. package/es/{el-select-9381b156.js → el-select-7395562b.js} +42 -40
  63. package/es/{el-table-column-55bffba5.js → el-table-column-47d80736.js} +329 -327
  64. package/es/el-table-column-bdc46568.cjs +14 -0
  65. package/es/{el-tag-985d9aff.js → el-tag-7414e0c7.js} +78 -77
  66. package/es/el-tag-9732314f.cjs +1 -0
  67. package/es/{index-deb8de52.cjs → index-1d85ba4b.cjs} +1 -1
  68. package/es/{index-39ec9741.js → index-273822d1.js} +21 -20
  69. package/es/index-2f958e56.cjs +3 -0
  70. package/es/index-375e8de4.cjs +5 -0
  71. package/es/{index-0cb48e01.js → index-621b092b.js} +1 -1
  72. package/es/{index-3bf8d597.cjs → index-65b4113e.cjs} +1 -1
  73. package/es/index-70372cdb.js +519 -0
  74. package/es/{use-form-common-props-f377e500.js → index-72151b24.js} +150 -312
  75. package/es/index-9e6e8d03.cjs +1 -0
  76. package/es/index-ab96bbf4.js +156 -0
  77. package/es/index-afc88a4b.cjs +1 -0
  78. package/es/{index-09e01b1d.js → index-c066fe0d.js} +32 -31
  79. package/es/index-ce3223db.cjs +1 -0
  80. package/es/{index-a902a0d9.js → index-dc22ffe4.js} +2 -2
  81. package/es/{raf-b128c7b7.js → raf-a532c514.js} +1 -1
  82. package/es/{raf-8fc301fd.cjs → raf-f46caea0.cjs} +1 -1
  83. package/es/{scroll-41224831.cjs → scroll-339681d4.cjs} +1 -1
  84. package/es/{scroll-387fcfdb.js → scroll-d787d648.js} +1 -1
  85. package/es/style.css +1 -1
  86. package/es/use-form-common-props-5ff2f51b.js +171 -0
  87. package/es/use-form-common-props-74a96df2.cjs +2 -0
  88. package/es/{vnode-7dfd4ed5.js → vnode-6a0c7411.js} +1 -1
  89. package/es/{vnode-7fbc61e1.cjs → vnode-b15eb11b.cjs} +1 -1
  90. package/es/{zh-cn-ab9a583d.cjs → zh-cn-36f34912.cjs} +1 -1
  91. package/es/{zh-cn-eb9c2820.js → zh-cn-f37255ae.js} +2 -2
  92. package/lib/bundle.js +1 -1
  93. package/lib/bundle.umd.cjs +136 -136
  94. package/lib/{index-d2de454d.js → index-d0cb2fa2.js} +14674 -14502
  95. package/lib/{python-22975586.js → python-050ba5a4.js} +1 -1
  96. package/lib/style.css +1 -1
  97. package/package.json +1 -1
  98. package/packages/PasswordPrompt/index.ts +8 -0
  99. package/packages/PasswordPrompt/index.vue +266 -0
  100. package/packages/User/index.vue +97 -58
  101. package/packages/index.ts +2 -0
  102. package/src/pages/PasswordPrompt/index.vue +12 -0
  103. package/src/router/routes.ts +5 -0
  104. package/es/_initCloneObject-441db749.cjs +0 -1
  105. package/es/base-437d17f3.js +0 -816
  106. package/es/base-ec05f348.cjs +0 -9
  107. package/es/castArray-a45823fe.cjs +0 -1
  108. package/es/debounce-b2ff12bd.cjs +0 -1
  109. package/es/el-button-196807af.cjs +0 -1
  110. package/es/el-empty-19ea04f4.cjs +0 -1
  111. package/es/el-form-item-5bdffd07.cjs +0 -12
  112. package/es/el-input-23e2bac3.cjs +0 -1
  113. package/es/el-input-number-40a81eb5.cjs +0 -1
  114. package/es/el-menu-item-78b858f2.cjs +0 -1
  115. package/es/el-message-d4df8136.cjs +0 -1
  116. package/es/el-overlay-bc0790a2.cjs +0 -1
  117. package/es/el-popover-8a77e015.cjs +0 -1
  118. package/es/el-popper-746070ba.cjs +0 -1
  119. package/es/el-select-b162dffc.cjs +0 -1
  120. package/es/el-table-column-6d761fce.cjs +0 -14
  121. package/es/el-tag-c51a6490.cjs +0 -1
  122. package/es/index-8a0b1c53.cjs +0 -3
  123. package/es/index-a387515d.cjs +0 -1
  124. package/es/use-form-common-props-1b84d8f4.cjs +0 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.149",
4
+ "version": "0.0.150",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -0,0 +1,8 @@
1
+ import { App } from "vue";
2
+ import StPasswordPrompt from "./index.vue";
3
+
4
+ export default {
5
+ install(app: App) {
6
+ app.component("st-passwordPrompt", StPasswordPrompt);
7
+ },
8
+ }
@@ -0,0 +1,266 @@
1
+ <script setup>
2
+ import { CircleCheck } from "@element-plus/icons-vue";
3
+ import { computed } from "vue";
4
+
5
+ const props = defineProps({
6
+ // 密码
7
+ value: {
8
+ type: String,
9
+ default: "",
10
+ },
11
+ // 是否聚焦密码框
12
+ isFocus: {
13
+ type: Boolean,
14
+ default: false,
15
+ },
16
+ // 文案颜色
17
+ textColor: {
18
+ type: [String, null],
19
+ default: null,
20
+ },
21
+ });
22
+
23
+ // 密码统一校验
24
+ const pwdValidators = [
25
+ {
26
+ text: "不能包含空格",
27
+ validator: (val) => {
28
+ return !/\s/.test(val);
29
+ },
30
+ },
31
+ {
32
+ text: "长度为8-18个字符",
33
+ validator: (val) => {
34
+ return val.length >= 8 && val.length <= 18;
35
+ },
36
+ },
37
+ {
38
+ text: "必须包含字母、数字、符号中至少2种",
39
+ validator: (val) => {
40
+ const hasLetter = /[a-zA-Z]/.test(val);
41
+ const hasNumber = /\d/.test(val);
42
+ const hasSymbol = /[^a-zA-Z0-9]/.test(val);
43
+ return [hasLetter, hasNumber, hasSymbol].filter(Boolean).length >= 2;
44
+ },
45
+ },
46
+ {
47
+ text: "请勿输入连续、重复6位以上字母或数字, 0123456, 1111111",
48
+ validator: (val) => {
49
+ // 检查是否有6位以上的重复字符
50
+ const repeatingChars = /([a-zA-Z0-9])\1{6,}/;
51
+ if (repeatingChars.test(val)) return false;
52
+
53
+ // 检查是否有6位以上的连续数字
54
+ const consecutiveNumbers = /(?:0123456|1234567|2345678|3456789|9876543|8765432|7654321|6543210)/;
55
+ if (consecutiveNumbers.test(val)) return false;
56
+
57
+ // 检查是否有6位以上的连续字母
58
+ const lowerVal = val.toLowerCase();
59
+ const isConsecutiveLetters = (str) => {
60
+ if (!/^[a-z]+$/.test(str)) return false;
61
+ for (let i = 1; i < str.length; i++) {
62
+ if (str.charCodeAt(i) !== str.charCodeAt(i - 1) + 1) {
63
+ return false;
64
+ }
65
+ }
66
+ return true;
67
+ };
68
+ for (let i = 0; i <= lowerVal.length - 7; i++) {
69
+ const segment = lowerVal.substr(i, 7);
70
+ if (isConsecutiveLetters(segment)) {
71
+ return false;
72
+ }
73
+ }
74
+ return true;
75
+ },
76
+ },
77
+ ];
78
+
79
+ // 基础规则校验是否全部通过
80
+ const allSuccessValidator = computed(() => {
81
+ const result = pwdValidators.map((item) => item.validator(props.value));
82
+ return !result.includes(false);
83
+ });
84
+
85
+ // 密码强度等级(得分制)
86
+ const levelValue = computed(() => {
87
+ const password = props.value;
88
+ if (!password) return 0;
89
+ // 初始得分
90
+ let score = 0;
91
+ {
92
+ // 长度检查
93
+ if (password.length >= 8) score++;
94
+ if (password.length >= 12) score++;
95
+ // 包含数字
96
+ if (/\d/.test(password)) score++;
97
+ // 包含小写字母
98
+ if (/[a-z]/.test(password)) score++;
99
+ // 包含大写字母
100
+ if (/[A-Z]/.test(password)) score++;
101
+ // 包含特殊字符
102
+ if (/[^a-zA-Z0-9]/.test(password)) score++;
103
+ }
104
+ // 将分数映射到1-3的强度等级
105
+ if (score <= 2) return 1;
106
+ else if (score <= 4) return 2;
107
+ else return 3;
108
+ });
109
+ const levelClass = computed(() => {
110
+ switch (levelValue.value) {
111
+ case 1:
112
+ return "lv1";
113
+ case 2:
114
+ return "lv2";
115
+ case 3:
116
+ return "lv3";
117
+ default:
118
+ return "";
119
+ }
120
+ });
121
+ const levelText = computed(() => {
122
+ switch (levelValue.value) {
123
+ case 1:
124
+ return "弱";
125
+ case 2:
126
+ return "中";
127
+ case 3:
128
+ return "强";
129
+ default:
130
+ return "";
131
+ }
132
+ });
133
+
134
+ defineExpose({
135
+ pwdValidators,
136
+ // 提供给表单校验使用
137
+ ruleFormPassword: [
138
+ { required: true, trigger: "blur", message: "密码不能为空" },
139
+ ...pwdValidators.map((item) => {
140
+ return {
141
+ trigger: "blur",
142
+ validator: (rule, value, callback) => {
143
+ if (!item.validator(value)) callback(item.text);
144
+ else callback();
145
+ },
146
+ };
147
+ }),
148
+ ],
149
+ });
150
+ </script>
151
+
152
+ <template>
153
+ <div
154
+ class="password-prompt"
155
+ :style="{ color: textColor ?? 'var(--el-color-info)' }"
156
+ >
157
+ <transition name="slide-down">
158
+ <div
159
+ v-if="isFocus"
160
+ class="rule-box"
161
+ >
162
+ <div
163
+ class="rule-item"
164
+ v-for="(item, index) in pwdValidators"
165
+ :key="index"
166
+ >
167
+ <el-icon v-show="item.validator(value)">
168
+ <CircleCheck />
169
+ </el-icon>
170
+ <span>{{ item.text }}</span>
171
+ </div>
172
+ </div>
173
+ </transition>
174
+ <div
175
+ v-if="!isFocus && allSuccessValidator"
176
+ class="level-box"
177
+ >
178
+ <div class="level-color">
179
+ <div
180
+ class="levelValue-block"
181
+ :class="[levelValue >= 1 ? levelClass : '']"
182
+ />
183
+ <div
184
+ class="levelValue-block"
185
+ :class="[levelValue >= 2 ? levelClass : '']"
186
+ />
187
+ <div
188
+ class="levelValue-block"
189
+ :class="[levelValue >= 3 ? levelClass : '']"
190
+ />
191
+ </div>
192
+ <div class="level-text">密码强度: {{ levelText }}</div>
193
+ </div>
194
+ </div>
195
+ </template>
196
+
197
+ <style scoped>
198
+ .password-prompt {
199
+ width: 100%;
200
+ position: relative;
201
+ .rule-box {
202
+ .rule-item {
203
+ position: relative;
204
+ .el-icon {
205
+ font-size: 16px;
206
+ color: green;
207
+ position: absolute;
208
+ left: 0;
209
+ top: 9px;
210
+ }
211
+ span {
212
+ font-size: 12px;
213
+ display: inline-block;
214
+ padding-left: 20px;
215
+ }
216
+ }
217
+ }
218
+ .level-box {
219
+ position: absolute;
220
+ top: -7px;
221
+ width: 100%;
222
+ display: flex;
223
+ align-items: center;
224
+ justify-content: end;
225
+ gap: 10px;
226
+ .level-color {
227
+ display: flex;
228
+ gap: 4px;
229
+ .levelValue-block {
230
+ width: 30px;
231
+ height: 8px;
232
+ background-color: #ebeef5;
233
+ border-radius: 2px;
234
+ transition: all 0.3s;
235
+ }
236
+ .lv1 {
237
+ background-color: #f33434;
238
+ }
239
+ .lv2 {
240
+ background-color: #e6a23c;
241
+ }
242
+ .lv3 {
243
+ background-color: #67c23a;
244
+ }
245
+ }
246
+ .level-text {
247
+ font-size: 12px;
248
+ color: #909399;
249
+ }
250
+ }
251
+
252
+ /* 校验规则平滑过渡效果 */
253
+ .slide-down-enter-active,
254
+ .slide-down-leave-active {
255
+ transition: all 0.3s ease;
256
+ max-height: 200px;
257
+ overflow: hidden;
258
+ }
259
+ .slide-down-enter-from,
260
+ .slide-down-leave-to {
261
+ opacity: 0;
262
+ max-height: 0;
263
+ transform: translateY(0px);
264
+ }
265
+ }
266
+ </style>
@@ -23,11 +23,14 @@
23
23
  前往登录
24
24
  <el-icon class="user-login-icon"><Right /></el-icon>
25
25
  </div>
26
+
27
+ <!-- 修改密码弹窗 -->
26
28
  <el-dialog
27
29
  v-model="changePasswordVisible"
28
30
  title="修改密码"
29
31
  width="500"
30
32
  :z-index="200"
33
+ @opened="changePasswordDialogOpen"
31
34
  @closed="changePasswordDialogClose"
32
35
  >
33
36
  <el-form
@@ -38,21 +41,42 @@
38
41
  @keyup.enter.native="changePasswordFn"
39
42
  label-width="auto"
40
43
  >
41
- <el-form-item label="原密码" prop="oldPassword">
44
+ <el-form-item
45
+ label="原密码"
46
+ prop="oldPassword"
47
+ >
42
48
  <el-input
43
49
  v-model="changePasswordForm.oldPassword"
44
50
  type="password"
45
51
  :show-password="true"
46
52
  />
47
53
  </el-form-item>
48
- <el-form-item label="新密码" prop="newPassword">
54
+ <el-form-item
55
+ label="新密码"
56
+ prop="newPassword"
57
+ >
49
58
  <el-input
50
59
  v-model="changePasswordForm.newPassword"
51
60
  type="password"
52
61
  :show-password="true"
62
+ @focus="
63
+ () => {
64
+ changePasswordFormRef.clearValidate(['newPassword']);
65
+ isFocusNewPassword = true;
66
+ }
67
+ "
68
+ @blur="isFocusNewPassword = false"
69
+ />
70
+ <PasswordPrompt
71
+ ref="PasswordPromptRef"
72
+ :value="changePasswordForm.newPassword"
73
+ :isFocus="isFocusNewPassword"
53
74
  />
54
75
  </el-form-item>
55
- <el-form-item label="确认密码" prop="confirmPassword">
76
+ <el-form-item
77
+ label="确认密码"
78
+ prop="confirmPassword"
79
+ >
56
80
  <el-input
57
81
  v-model="changePasswordForm.confirmPassword"
58
82
  type="password"
@@ -63,7 +87,10 @@
63
87
  <template #footer>
64
88
  <div class="dialog-footer">
65
89
  <el-button @click="changePasswordVisible = false">取消</el-button>
66
- <el-button type="primary" @click="changePasswordFn">
90
+ <el-button
91
+ type="primary"
92
+ @click="changePasswordFn"
93
+ >
67
94
  修改
68
95
  </el-button>
69
96
  </div>
@@ -73,86 +100,98 @@
73
100
  </template>
74
101
 
75
102
  <script setup>
76
- import { ref, inject } from 'vue'
77
- import { UserFilled, ArrowDown, Right } from "@element-plus/icons-vue"
78
- import { getUserData, login, loginout } from 'st-func'
103
+ import { ref, inject, nextTick } from "vue";
104
+ import { UserFilled, ArrowDown, Right } from "@element-plus/icons-vue";
105
+ import { getUserData, login, loginout } from "st-func";
106
+ import PasswordPrompt from "../PasswordPrompt/index.vue";
79
107
 
80
108
  const stConfig = inject("stConfig");
81
- const userData = getUserData()
109
+ const userData = getUserData();
110
+ const PasswordPromptRef = ref(null); // 密码校验强度组件
82
111
 
83
- const emit = defineEmits(['loginout'])
112
+ const emit = defineEmits(["loginout"]);
84
113
  const props = defineProps({
85
114
  config: {
86
115
  type: Object,
87
- default: () => ({ }), // loginUrl: 登录后的跳转地址 loginoutToLogin: 是否跳转到登录页 loginoutUrl: 退出登录后的跳转地址
116
+ default: () => ({}), // loginUrl: 登录后的跳转地址 loginoutToLogin: 是否跳转到登录页 loginoutUrl: 退出登录后的跳转地址
88
117
  },
89
- })
118
+ });
90
119
 
91
- const changePasswordFormRef = ref(null)
92
- const changePasswordVisible = ref(false)
120
+ const changePasswordFormRef = ref(null);
121
+ const changePasswordVisible = ref(false);
93
122
  const changePasswordForm = ref({
94
- oldPassword: '',
95
- newPassword: '',
96
- confirmPassword: '',
97
- })
98
- const checkPassword = (rule, value, callback) => {
99
- if (value === '') {
100
- callback(new Error('请输入确认密码'))
101
- } else if (value !== changePasswordForm.value.newPassword) {
102
- callback(new Error("两次输入密码不一致!"))
103
- } else {
104
- callback()
105
- }
106
- }
123
+ oldPassword: "",
124
+ newPassword: "",
125
+ confirmPassword: "",
126
+ });
107
127
  const changePasswordRules = ref({
108
128
  oldPassword: [
109
- { required: true, message: '请输入原密码', trigger: 'blur' },
110
- { min: 6, max: 18, trigger: "blur", message: "密码长度为6到18位" },
111
- ],
112
- newPassword: [
113
- { required: true, message: '请输入新密码', trigger: 'blur' },
129
+ { required: true, message: "请输入原密码", trigger: "blur" },
114
130
  { min: 6, max: 18, trigger: "blur", message: "密码长度为6到18位" },
115
131
  ],
132
+ newPassword: [],
116
133
  confirmPassword: [
117
- { required: true, message: '请输入确认密码', trigger: 'blur' },
118
- { validator: checkPassword, trigger: 'blur' },
134
+ { required: true, message: "请输入确认密码", trigger: "blur" },
135
+ {
136
+ validator: (rule, value, callback) => {
137
+ if (value === "") {
138
+ callback(new Error("请输入确认密码"));
139
+ } else if (value !== changePasswordForm.value.newPassword) {
140
+ callback(new Error("两次输入密码不一致!"));
141
+ } else {
142
+ callback();
143
+ }
144
+ },
145
+ trigger: "blur",
146
+ },
119
147
  { min: 6, max: 18, trigger: "blur", message: "密码长度为6到18位" },
120
148
  ],
121
- })
149
+ });
150
+ const isFocusNewPassword = ref(false); // 是否聚焦新密码
122
151
 
123
152
  const loginFn = () => {
124
- const { loginUrl } = props.config || {}
125
- login(loginUrl)
126
- }
127
-
153
+ const { loginUrl } = props.config || {};
154
+ login(loginUrl);
155
+ };
128
156
  const loginoutFn = () => {
129
- const { loginoutToLogin, loginoutUrl } = props.config || {}
130
- loginout(loginoutToLogin, loginoutUrl)
131
- emit('loginout')
132
- }
133
-
157
+ const { loginoutToLogin, loginoutUrl } = props.config || {};
158
+ loginout(loginoutToLogin, loginoutUrl);
159
+ emit("loginout");
160
+ };
134
161
  const changePasswordFn = () => {
135
- changePasswordFormRef.value.validate(async(valid, fields) => {
162
+ changePasswordFormRef.value.validate(async (valid, fields) => {
136
163
  if (valid) {
137
- const res = await stConfig.request.post('/invest/sys/user/password', {
164
+ const res = await stConfig.request.post("/invest/sys/user/password", {
138
165
  password: changePasswordForm.value.oldPassword,
139
166
  newPassword: changePasswordForm.value.newPassword,
140
167
  newPassword2: changePasswordForm.value.confirmPassword,
141
- })
142
- ElMessage.success(`修改成功!`)
143
- changePasswordVisible.value = false
144
- } else { }
145
- })
146
- }
147
-
168
+ });
169
+ ElMessage.success(`修改成功!`);
170
+ changePasswordVisible.value = false;
171
+ } else {
172
+ }
173
+ });
174
+ };
175
+ const changePasswordDialogOpen = () => {
176
+ if (changePasswordRules.value.newPassword.length === 0) {
177
+ nextTick(() => {
178
+ changePasswordRules.value.newPassword = PasswordPromptRef.value?.ruleFormPassword;
179
+ // 宏任务清除element-plus表单规则调整后的自动校验
180
+ let timer = setTimeout(() => {
181
+ changePasswordFormRef.value.resetFields();
182
+ clearTimeout(timer);
183
+ }, 0);
184
+ });
185
+ }
186
+ };
148
187
  const changePasswordDialogClose = () => {
149
188
  changePasswordForm.value = {
150
- oldPassword: '',
151
- newPassword: '',
152
- confirmPassword: '',
153
- }
154
- changePasswordFormRef.value.resetFields()
155
- }
189
+ oldPassword: "",
190
+ newPassword: "",
191
+ confirmPassword: "",
192
+ };
193
+ changePasswordFormRef.value.resetFields();
194
+ };
156
195
  </script>
157
196
 
158
197
  <style lang="scss" scoped>
package/packages/index.ts CHANGED
@@ -11,6 +11,7 @@ import StLinearLegend from "./LinearLegend/index.ts"
11
11
  import StMap from "./Map/index.ts"
12
12
  import StMonacoEditor from "./MonacoEditor/index.ts"
13
13
  import StPagination from "./Pagination/index.ts"
14
+ import StPasswordPrompt from "./PasswordPrompt/index.ts"
14
15
  import StPie from "./Pie/index.ts"
15
16
  import StTable from "./Table/index.ts"
16
17
  import StTreeMap from "./TreeMap/index.ts"
@@ -32,6 +33,7 @@ export default {
32
33
  StMap.install(app)
33
34
  StMonacoEditor.install(app)
34
35
  StPagination.install(app)
36
+ StPasswordPrompt.install(app)
35
37
  StPie.install(app)
36
38
  StTable.install(app)
37
39
  StTreeMap.install(app)
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <div>
3
+ PasswordPrompt
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ </script>
9
+
10
+ <style lang="scss" scoped>
11
+
12
+ </style>
@@ -59,6 +59,11 @@ export default [
59
59
  name: 'Pagination',
60
60
  component: () => import('../pages/Pagination/index.vue'),
61
61
  },
62
+ {
63
+ path: '/passwordPrompt',
64
+ name: 'PasswordPrompt',
65
+ component: () => import('../pages/PasswordPrompt/index.vue'),
66
+ },
62
67
  {
63
68
  path: '/pie',
64
69
  name: 'Pie',
@@ -1 +0,0 @@
1
- "use strict";const c=require("./use-form-common-props-1b84d8f4.cjs"),o=require("./el-popper-746070ba.cjs"),s=require("./base-ec05f348.cjs");var a=Object.create,P=function(){function e(){}return function(n){if(!s.isObject$1(n))return{};if(a)return a(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();const w=P;function A(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function b(e,n,r,t){var d=!r;r||(r={});for(var f=-1,h=n.length;++f<h;){var i=n[f],u=t?t(r[i],e[i],i,r,e):void 0;u===void 0&&(u=e[i]),d?c.baseAssignValue(r,i,u):c.assignValue(r,i,u)}return r}function C(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var x=Object.prototype,B=x.hasOwnProperty;function I(e){if(!s.isObject$1(e))return C(e);var n=o.isPrototype(e),r=[];for(var t in e)t=="constructor"&&(n||!B.call(e,t))||r.push(t);return r}function T(e){return o.isArrayLike(e)?o.arrayLikeKeys(e,!0):I(e)}var U=o.overArg(Object.getPrototypeOf,Object);const y=U;var g=typeof exports=="object"&&exports&&!exports.nodeType&&exports,l=g&&typeof module=="object"&&module&&!module.nodeType&&module,$=l&&l.exports===g,p=$?s.root.Buffer:void 0,v=p?p.allocUnsafe:void 0;function m(e,n){if(n)return e.slice();var r=e.length,t=v?v(r):new e.constructor(r);return e.copy(t),t}function O(e){var n=new e.constructor(e.byteLength);return new o.Uint8Array(n).set(new o.Uint8Array(e)),n}function q(e,n){var r=n?O(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function K(e){return typeof e.constructor=="function"&&!o.isPrototype(e)?w(y(e)):{}}exports.cloneArrayBuffer=O;exports.cloneBuffer=m;exports.cloneTypedArray=q;exports.copyArray=A;exports.copyObject=b;exports.getPrototype=y;exports.initCloneObject=K;exports.keysIn=T;