@netang/quasar 0.2.34 → 0.2.37

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.34",
3
+ "version": "0.2.37",
4
4
 
5
5
  "description": "netang-quasar",
6
6
  "scripts": {
@@ -203,7 +203,7 @@
203
203
 
204
204
  .q-field__native,
205
205
  .q-field__input {
206
- z-index: 2;
206
+ z-index: 1;
207
207
  }
208
208
 
209
209
  // 底部
@@ -136,25 +136,29 @@ export function setItemValue(value, val) {
136
136
 
137
137
  // 如果值为数组
138
138
  if (Array.isArray(val)) {
139
- // 比较类型为 in
140
- value[0].compare = dicts.SEARCH_COMPARE_TYPE__IN
141
- // 设置值为将数组转为逗号分隔的字符串
142
- value[0].value = $n_join(val, ',')
143
139
 
144
- // 如果值是逗号隔开
145
- } else if ($n_split(val, ',').length > 1) {
146
140
  // 比较类型为 in
147
141
  value[0].compare = dicts.SEARCH_COMPARE_TYPE__IN
148
- // 设置值为将数组转为逗号分隔的字符串
149
- value[0].value = val
150
142
 
151
- // 否则为单个值
152
143
  } else {
153
- // 比较类型为 ==
154
- value[0].compare = dicts.SEARCH_COMPARE_TYPE__EQUAL
155
- // 设置值为当前值
156
- value[0].value = val
144
+
145
+ // 如果值是逗号隔开
146
+ const arr = $n_split(val, ',')
147
+ if (arr.length > 1) {
148
+ // 比较类型为 in
149
+ value[0].compare = dicts.SEARCH_COMPARE_TYPE__IN
150
+ val = arr
151
+
152
+ // 否则为单个值
153
+ } else {
154
+
155
+ // 比较类型为 ==
156
+ value[0].compare = dicts.SEARCH_COMPARE_TYPE__EQUAL
157
+ }
157
158
  }
159
+
160
+ // 设置值为当前值
161
+ value[0].value = $n_numberDeep(val)
158
162
  }
159
163
 
160
164
  /**
@@ -278,14 +282,28 @@ export function getRawData(tableColumns, query, searchFromQuery = true) {
278
282
  newVal = decodeURIComponent(newVal)
279
283
  if ($n_isJson(newVal)) {
280
284
  $n_forEach($n_json.parse(newVal), function (v, i) {
285
+
281
286
  if (
282
287
  i <= 1
283
288
  && $n_isValidArray(v)
284
289
  && v.length >= 2
285
290
  ) {
291
+ let newVal = v[1]
292
+
293
+ // 如果比较类型为 in / not in
294
+ if ($n_indexOf([ dicts.SEARCH_COMPARE_TYPE__IN, dicts.SEARCH_COMPARE_TYPE__NOT_IN ], v[0]) > -1) {
295
+ // 如果不为数组
296
+ if (! Array.isArray(v[1])) {
297
+ newVal = $n_split(newVal, ',')
298
+ }
299
+
300
+ } else if (! $n_isRequired(newVal)) {
301
+ newVal = ''
302
+ }
303
+
286
304
  value[i] = {
287
305
  compare: v[0],
288
- value: $n_isRequired(v[1]) ? v[1] : '',
306
+ value: $n_numberDeep(newVal),
289
307
  }
290
308
  }
291
309
  })