@netang/quasar 0.2.38 → 0.2.40

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.2.38",
3
+ "version": "0.2.40",
4
4
 
5
5
  "description": "netang-quasar",
6
6
  "scripts": {
package/utils/$power.js CHANGED
@@ -1171,30 +1171,61 @@ async function request(options) {
1171
1171
  }
1172
1172
 
1173
1173
  // 判断是否有确认框
1174
- const isConfirm = $n_get(o.powerBtn.data, 'confirm')
1174
+ let isConfirm = $n_get(o.powerBtn.data, 'confirm')
1175
+ const isConfirmPassword = $n_get(o.powerBtn.data, 'confirmPassword')
1175
1176
  if (
1176
1177
  // 如果有确认框
1177
1178
  isConfirm
1178
1179
  // 如果有密码确认框
1179
- || $n_get(o.powerBtn.data, 'confirmPassword')
1180
+ || isConfirmPassword
1180
1181
  ) {
1182
+ // 如果是确认密码
1183
+ if (isConfirmPassword) {
1184
+
1185
+ const {
1186
+ confirmPassword,
1187
+ } = configs.power
1188
+
1189
+ // 如果确认密码方法存在
1190
+ if ($n_isFunction(confirmPassword)) {
1191
+
1192
+ // 确认框
1193
+ $n_confirm({
1194
+ message: $n_isValidString(isConfirmPassword) ? isConfirmPassword : '重要操作,请输入登录密码并确认后操作!',
1195
+ prompt: {
1196
+ model: '',
1197
+ isValid: val => val.length > 0,
1198
+ type: 'password',
1199
+ },
1200
+ persistent: true,
1201
+ })
1202
+ // 点击确认执行
1203
+ .onOk(function (e) {
1204
+ confirmPassword(e, onConfirmRequest)
1205
+ })
1206
+ return
1207
+ }
1208
+
1209
+ // 否则为普通确认框
1210
+ isConfirm = true
1211
+ }
1212
+
1181
1213
  // 如果需要先弹出确认框
1182
1214
  if (isConfirm) {
1183
-
1184
1215
  // 确认框
1185
1216
  $n_confirm({
1186
- // 重要操作,请输入登录密码并确认后操作
1187
1217
  message: $n_isValidString(isConfirm) ? isConfirm : '确认要执行该操作吗?',
1218
+ persistent: true,
1188
1219
  })
1189
1220
  // 点击确认执行
1190
1221
  .onOk(onConfirmRequest)
1191
-
1192
- return
1193
1222
  }
1223
+
1224
+ return
1194
1225
  }
1195
1226
 
1196
1227
  // 否则执行确认请求事件
1197
- await onConfirmRequest()
1228
+ onConfirmRequest()
1198
1229
 
1199
1230
  /**
1200
1231
  * 确认请求事件
package/utils/config.js CHANGED
@@ -31,6 +31,10 @@ export const configs = {
31
31
  components: {},
32
32
  // 对话框组件
33
33
  dialogComponents: {},
34
+ power: {
35
+ // 确认密码
36
+ confirmPassword: null,
37
+ },
34
38
  // 上传器配置
35
39
  uploader: {
36
40
  // 如果是 Minio 上传, 则在后面加上下划线
@@ -6,7 +6,6 @@ import $n_isFunction from 'lodash/isFunction'
6
6
  import $n_findIndex from 'lodash/findIndex'
7
7
 
8
8
  import $n_forEach from '@netang/utils/forEach'
9
- import $n_join from '@netang/utils/join'
10
9
  import $n_split from '@netang/utils/split'
11
10
  import $n_isJson from '@netang/utils/isJson'
12
11
  import $n_json from '@netang/utils/json'
@@ -68,6 +67,8 @@ function setItemCompare(item) {
68
67
  { label: '!=', value: dicts.SEARCH_COMPARE_TYPE__NOT_EQUAL },
69
68
  { label: '>', value: dicts.SEARCH_COMPARE_TYPE__GT },
70
69
  { label: '≥', value: dicts.SEARCH_COMPARE_TYPE__GTE },
70
+ { label: '<', value: dicts.SEARCH_COMPARE_TYPE__LT },
71
+ { label: '≤', value: dicts.SEARCH_COMPARE_TYPE__LTE },
71
72
  ]
72
73
 
73
74
  // 如果类型为日期