sh-tools 2.2.18 → 2.3.0
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 +37 -37
- package/packages/utils/other.js +20 -10
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
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
|
-
|
|
2
|
+
"name": "sh-tools",
|
|
3
|
+
"version": "2.3.0",
|
|
4
|
+
"description": "基于fetch和xe-utils二次封装,支持宏公式计算,及notification提示窗",
|
|
5
|
+
"main": "packages/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lib": "vue-cli-service build --target lib packages/index.js --name sh-tools --dest lib"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"sh-tools"
|
|
11
|
+
],
|
|
12
|
+
"author": "神秘的sh",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"hot-formula-parser": "^4.0.0",
|
|
16
|
+
"xe-utils": "^3.8.2"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@babel/core": "^7.12.16",
|
|
20
|
+
"@babel/eslint-parser": "^7.12.16",
|
|
21
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
22
|
+
"@vue/cli-plugin-babel": "~5.0.8",
|
|
23
|
+
"@vue/cli-plugin-eslint": "~5.0.8",
|
|
24
|
+
"@vue/cli-plugin-router": "~5.0.8",
|
|
25
|
+
"@vue/cli-plugin-vuex": "~5.0.8",
|
|
26
|
+
"@vue/cli-service": "~5.0.8",
|
|
27
|
+
"babel-loader": "^9.1.2",
|
|
28
|
+
"babel-plugin-import": "^1.13.6",
|
|
29
|
+
"compression-webpack-plugin": "~6.1.1",
|
|
30
|
+
"eslint": "^7.32.0",
|
|
31
|
+
"eslint-config-prettier": "^8.3.0",
|
|
32
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
33
|
+
"eslint-plugin-vue": "^8.0.3",
|
|
34
|
+
"html-webpack-tags-plugin": "^3.0.2",
|
|
35
|
+
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
36
|
+
"prettier": "^2.4.1",
|
|
37
|
+
"vue": "^3.3.4"
|
|
38
|
+
}
|
|
39
39
|
}
|
package/packages/utils/other.js
CHANGED
|
@@ -173,6 +173,9 @@ export default {
|
|
|
173
173
|
if (!$vUtils.isNone(defaultValue) && $vUtils.isNone(value)) {
|
|
174
174
|
rvalue = defaultValue
|
|
175
175
|
}
|
|
176
|
+
if ($vUtils.isString(rvalue)) {
|
|
177
|
+
rvalue = $vUtils.replaceNutrim(rvalue)
|
|
178
|
+
}
|
|
176
179
|
// 自定渲染器进行解析与重新赋值
|
|
177
180
|
switch (rname) {
|
|
178
181
|
case '$vInput':
|
|
@@ -197,6 +200,8 @@ export default {
|
|
|
197
200
|
rtext = $vUtils.truncate($vUtils.divide(rvalue, moneyUnit), digits)
|
|
198
201
|
} else if (rname === '$vInput' && format) {
|
|
199
202
|
rtext = $vUtils.format(format, rowData)
|
|
203
|
+
} else {
|
|
204
|
+
rtext = rvalue
|
|
200
205
|
}
|
|
201
206
|
break
|
|
202
207
|
case '$vTime':
|
|
@@ -207,6 +212,9 @@ export default {
|
|
|
207
212
|
rtext = rvalue.join(separator)
|
|
208
213
|
} else if (!$vUtils.isNone(value) && format) {
|
|
209
214
|
rvalue = $vUtils.toDateString(value, format)
|
|
215
|
+
rtext = rvalue
|
|
216
|
+
} else {
|
|
217
|
+
rtext = rvalue
|
|
210
218
|
}
|
|
211
219
|
break
|
|
212
220
|
case '$vSelect':
|
|
@@ -232,22 +240,25 @@ export default {
|
|
|
232
240
|
if (Array.isArray(value)) {
|
|
233
241
|
oriArray = value
|
|
234
242
|
} else if (!$vUtils.isNone(value)) {
|
|
235
|
-
oriArray = String(value)
|
|
236
|
-
.split(split)
|
|
237
|
-
.filter(_ => _ && _ !== 'undefined')
|
|
243
|
+
oriArray = String(value).split(split)
|
|
238
244
|
}
|
|
245
|
+
oriArray = oriArray.filter(item => !$vUtils.isNone(item))
|
|
239
246
|
if (options && options.length) {
|
|
240
247
|
let rns = oriArray.map(orv => {
|
|
241
248
|
let valueOption = options.find(option => $vUtils.isEqual(option[optionValue], orv))
|
|
242
249
|
return valueOption ? valueOption[optionLabel] : ''
|
|
243
250
|
})
|
|
244
251
|
rtext = rns.join(split)
|
|
252
|
+
} else {
|
|
253
|
+
rtext = oriArray.join(split)
|
|
245
254
|
}
|
|
246
255
|
rvalue = oriArray
|
|
247
256
|
} else {
|
|
248
257
|
if (options && options.length) {
|
|
249
258
|
let valueOption = options.find(option => $vUtils.isEqual(option[optionValue], value))
|
|
250
259
|
rtext = valueOption ? valueOption[optionLabel] : ''
|
|
260
|
+
} else {
|
|
261
|
+
rtext = rvalue
|
|
251
262
|
}
|
|
252
263
|
}
|
|
253
264
|
if (format) {
|
|
@@ -256,7 +267,10 @@ export default {
|
|
|
256
267
|
}
|
|
257
268
|
break
|
|
258
269
|
case '$vProgress':
|
|
259
|
-
if (!$vUtils.isNone(value))
|
|
270
|
+
if (!$vUtils.isNone(value)) {
|
|
271
|
+
rvalue = $vUtils.truncate(value, digits)
|
|
272
|
+
}
|
|
273
|
+
rtext = rvalue
|
|
260
274
|
break
|
|
261
275
|
case '$vSwitch':
|
|
262
276
|
if ($vUtils.isEqual(value, openValue)) {
|
|
@@ -265,12 +279,8 @@ export default {
|
|
|
265
279
|
rtext = closeLabel
|
|
266
280
|
}
|
|
267
281
|
break
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
rvalue = $vUtils.replaceNutrim(rvalue)
|
|
271
|
-
}
|
|
272
|
-
if ($vUtils.isNone(rtext) && !$vUtils.isNone(rvalue)) {
|
|
273
|
-
rtext = rvalue
|
|
282
|
+
default:
|
|
283
|
+
rtext = String(rvalue)
|
|
274
284
|
}
|
|
275
285
|
return { rvalue, rtext }
|
|
276
286
|
}
|