@panpanzhao/component-ui 0.0.46 → 0.0.48
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/lib/component-ui.common.js +74 -54
- package/lib/components/crud.js +12 -6
- package/lib/components/form-dialog.js +6 -2
- package/lib/components/form-drawer.js +6 -2
- package/lib/components/form-group.js +6 -2
- package/lib/components/formula.js +2 -2
- package/lib/components/table-operate.js +6 -2
- package/lib/components/table.js +53 -39
- package/lib/index.js +1 -1
- package/lib/utils/helper.js +12 -0
- package/lib/utils/index.js +6 -0
- package/package.json +1 -1
package/lib/utils/helper.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
+
exports.guid = guid;
|
|
4
5
|
exports.uuid = exports.isPermission = void 0;
|
|
5
6
|
// 参考 https://github.com/streamich/v4-uuid
|
|
6
7
|
var str = function str() {
|
|
@@ -11,7 +12,18 @@ var uuid = function uuid() {
|
|
|
11
12
|
var b = str();
|
|
12
13
|
return a.slice(0, 8) + '-' + a.slice(8, 12) + '-4' + a.slice(13) + '-a' + b.slice(1, 4) + '-' + b.slice(4);
|
|
13
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* 生成 8 位随机数字。
|
|
17
|
+
*
|
|
18
|
+
* @return {string} 8位随机数字
|
|
19
|
+
*/
|
|
14
20
|
exports.uuid = uuid;
|
|
21
|
+
function guid() {
|
|
22
|
+
function s4() {
|
|
23
|
+
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
24
|
+
}
|
|
25
|
+
return s4() + s4() + s4();
|
|
26
|
+
}
|
|
15
27
|
var isPermission = function isPermission(code, permission) {
|
|
16
28
|
if (!code || !permission) {
|
|
17
29
|
return true;
|
package/lib/utils/index.js
CHANGED
|
@@ -12,4 +12,10 @@ Object.keys(_tree).forEach(function (key) {
|
|
|
12
12
|
if (key === "default" || key === "__esModule") return;
|
|
13
13
|
if (key in exports && exports[key] === _tree[key]) return;
|
|
14
14
|
exports[key] = _tree[key];
|
|
15
|
+
});
|
|
16
|
+
var _index = require("./formula/index");
|
|
17
|
+
Object.keys(_index).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
20
|
+
exports[key] = _index[key];
|
|
15
21
|
});
|