@bdsoft/element 1.1.9 → 1.1.11
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/dist/BdElement.js +23111 -0
- package/package.json +2 -1
- package/global/index.ts +0 -6
- package/global/register-properties.ts +0 -10
- package/index.html +0 -13
- package/package-form/core/components/formCreate.js +0 -274
- package/package-form/core/components/fragment.js +0 -12
- package/package-form/core/factory/context.js +0 -257
- package/package-form/core/factory/creator.js +0 -63
- package/package-form/core/factory/maker.js +0 -17
- package/package-form/core/factory/manager.js +0 -79
- package/package-form/core/factory/node.js +0 -85
- package/package-form/core/factory/parser.js +0 -28
- package/package-form/core/frame/api.js +0 -599
- package/package-form/core/frame/attrs.js +0 -12
- package/package-form/core/frame/dataDriver.js +0 -76
- package/package-form/core/frame/fetch.js +0 -119
- package/package-form/core/frame/formCreate.js +0 -274
- package/package-form/core/frame/index.js +0 -760
- package/package-form/core/frame/provider.js +0 -288
- package/package-form/core/frame/util.js +0 -274
- package/package-form/core/handler/context.js +0 -380
- package/package-form/core/handler/effect.js +0 -122
- package/package-form/core/handler/index.js +0 -111
- package/package-form/core/handler/inject.js +0 -145
- package/package-form/core/handler/input.js +0 -197
- package/package-form/core/handler/lifecycle.js +0 -43
- package/package-form/core/handler/loader.js +0 -373
- package/package-form/core/handler/page.js +0 -46
- package/package-form/core/handler/render.js +0 -29
- package/package-form/core/index.js +0 -12
- package/package-form/core/package.json +0 -15
- package/package-form/core/parser/html.js +0 -17
- package/package-form/core/render/cache.js +0 -47
- package/package-form/core/render/index.js +0 -31
- package/package-form/core/render/render.js +0 -393
- package/package-form/element-form/components/checkbox/package.json +0 -17
- package/package-form/element-form/components/checkbox/src/component.jsx +0 -110
- package/package-form/element-form/components/checkbox/src/index.js +0 -3
- package/package-form/element-form/components/frame/package.json +0 -17
- package/package-form/element-form/components/frame/src/IconCircleClose.vue +0 -14
- package/package-form/element-form/components/frame/src/IconDelete.vue +0 -12
- package/package-form/element-form/components/frame/src/IconDocument.vue +0 -12
- package/package-form/element-form/components/frame/src/IconFolderOpened.vue +0 -12
- package/package-form/element-form/components/frame/src/IconView.vue +0 -12
- package/package-form/element-form/components/frame/src/component.jsx +0 -349
- package/package-form/element-form/components/frame/src/index.js +0 -3
- package/package-form/element-form/components/frame/src/style.css +0 -66
- package/package-form/element-form/components/group/package.json +0 -17
- package/package-form/element-form/components/group/src/component.jsx +0 -314
- package/package-form/element-form/components/group/src/index.js +0 -3
- package/package-form/element-form/components/group/src/style.css +0 -125
- package/package-form/element-form/components/index.js +0 -22
- package/package-form/element-form/components/radio/package.json +0 -17
- package/package-form/element-form/components/radio/src/component.jsx +0 -101
- package/package-form/element-form/components/radio/src/index.js +0 -3
- package/package-form/element-form/components/select/package.json +0 -17
- package/package-form/element-form/components/select/src/component.jsx +0 -52
- package/package-form/element-form/components/select/src/index.js +0 -3
- package/package-form/element-form/components/subform/package.json +0 -14
- package/package-form/element-form/components/subform/src/component.jsx +0 -76
- package/package-form/element-form/components/subform/src/index.js +0 -3
- package/package-form/element-form/components/tree/package.json +0 -17
- package/package-form/element-form/components/tree/src/component.jsx +0 -62
- package/package-form/element-form/components/tree/src/index.js +0 -3
- package/package-form/element-form/components/upload/package.json +0 -17
- package/package-form/element-form/components/upload/src/IconUpload.vue +0 -12
- package/package-form/element-form/components/upload/src/component.jsx +0 -129
- package/package-form/element-form/components/upload/src/index.js +0 -3
- package/package-form/element-form/components/upload/src/style.css +0 -11
- package/package-form/element-form/index.js +0 -8
- package/package-form/element-form/package.json +0 -16
- package/package-form/element-form/src/components/icon/IconWarning.vue +0 -12
- package/package-form/element-form/src/components/index.js +0 -22
- package/package-form/element-form/src/core/alias.js +0 -34
- package/package-form/element-form/src/core/api.js +0 -208
- package/package-form/element-form/src/core/config.js +0 -62
- package/package-form/element-form/src/core/index.js +0 -60
- package/package-form/element-form/src/core/maker.js +0 -76
- package/package-form/element-form/src/core/manager.js +0 -315
- package/package-form/element-form/src/core/provider.js +0 -79
- package/package-form/element-form/src/parsers/datePicker.js +0 -31
- package/package-form/element-form/src/parsers/hidden.js +0 -12
- package/package-form/element-form/src/parsers/index.js +0 -17
- package/package-form/element-form/src/parsers/input.js +0 -21
- package/package-form/element-form/src/parsers/row.js +0 -10
- package/package-form/element-form/src/parsers/select.js +0 -15
- package/package-form/element-form/src/parsers/slider.js +0 -21
- package/package-form/element-form/src/parsers/timePicker.js +0 -17
- package/package-form/element-form/src/style/index.css +0 -52
- package/src/App.vue +0 -28
- package/src/assets/css/element.scss +0 -196
- package/src/assets/css/layout.scss +0 -215
- package/src/assets/css/tailwind.scss +0 -67
- package/src/assets/images/banner.gif +0 -0
- package/src/assets/images/banner.png +0 -0
- package/src/assets/images/bg1.svg +0 -22
- package/src/assets/images/bg2.png +0 -0
- package/src/assets/images/ff.png +0 -0
- package/src/assets/images/home-file1.png +0 -0
- package/src/assets/images/ky.png +0 -0
- package/src/assets/images/menu/add.png +0 -0
- package/src/assets/images/menu/del.png +0 -0
- package/src/assets/images/menu/down.png +0 -0
- package/src/assets/images/menu/dr.png +0 -0
- package/src/assets/images/menu/edit.png +0 -0
- package/src/assets/images/menu/kx.png +0 -0
- package/src/assets/images/menu/mb.png +0 -0
- package/src/assets/images/menu/pz.png +0 -0
- package/src/assets/images/menu/save.png +0 -0
- package/src/assets/images/menu/sj.png +0 -0
- package/src/assets/images/menu/sjk.png +0 -0
- package/src/assets/images/menu/up.png +0 -0
- package/src/assets/images/po-i.png +0 -0
- package/src/assets/images/po1-i1.png +0 -0
- package/src/assets/images/po1-i2.png +0 -0
- package/src/assets/images/po1-i3.png +0 -0
- package/src/assets/images/po1-i4.png +0 -0
- package/src/assets/images/po1-i5.png +0 -0
- package/src/assets/images/po1-i6.png +0 -0
- package/src/assets/images/po1-i7.png +0 -0
- package/src/assets/images/po1-i8.png +0 -0
- package/src/assets/images/po2-i1.png +0 -0
- package/src/assets/images/po2-i2.png +0 -0
- package/src/assets/images/po3-i1.png +0 -0
- package/src/assets/images/po4-i1.png +0 -0
- package/src/assets/images/po5-i1.png +0 -0
- package/src/assets/images/po6-i1.png +0 -0
- package/src/assets/images/po6-i2.png +0 -0
- package/src/assets/images/po7-i1.png +0 -0
- package/src/assets/images/tj1.png +0 -0
- package/src/assets/images/tj2.png +0 -0
- package/src/assets/images/tj3.png +0 -0
- package/src/components/3dcloudwords/index.js +0 -346
- package/src/components/3dcloudwords/index.vue +0 -99
- package/src/components/3dcloudwords/readme.md +0 -66
- package/src/components/badge/index.js +0 -167
- package/src/components/badge/index.scss +0 -166
- package/src/components/badge/index.vue +0 -98
- package/src/components/badge/readme.md +0 -18
- package/src/components/basic/Finish.vue +0 -107
- package/src/components/basic/button.vue +0 -19
- package/src/components/basic/readme.md +0 -7
- package/src/components/button/index.vue +0 -48
- package/src/components/button/readme.md +0 -62
- package/src/components/carousel/index.vue +0 -104
- package/src/components/carousel/readme.md +0 -12
- package/src/components/chartconfig/index.vue +0 -141
- package/src/components/chartconfig/readme.md +0 -25
- package/src/components/contextMenu/hookContxtMenu.js +0 -41
- package/src/components/contextMenu/index.vue +0 -245
- package/src/components/contextMenu/readme.md +0 -55
- package/src/components/contextMenu/useElementBounding.js +0 -40
- package/src/components/countup/countUp.js +0 -196
- package/src/components/countup/index.vue +0 -114
- package/src/components/countup/readme.md +0 -9
- package/src/components/empty/assets/build.png +0 -0
- package/src/components/empty/assets/emptybg.gif +0 -0
- package/src/components/empty/assets/emptybg.png +0 -0
- package/src/components/empty/assets/emptybg2.jpg +0 -0
- package/src/components/empty/assets/emptybg3.jpg +0 -0
- package/src/components/empty/assets/wuxiao.png +0 -0
- package/src/components/empty/assets/wuxiao.webp +0 -0
- package/src/components/empty/building.vue +0 -117
- package/src/components/empty/empty.vue +0 -120
- package/src/components/empty/index.js +0 -12
- package/src/components/empty/invalid.vue +0 -56
- package/src/components/error/Error.vue +0 -79
- package/src/components/error/readme.md +0 -20
- package/src/components/form/Form.vue +0 -84
- package/src/components/form/FormItem.vue +0 -143
- package/src/components/form/data.js +0 -52
- package/src/components/form/readme.md +0 -69
- package/src/components/layout/banner.vue +0 -412
- package/src/components/layout/bar.vue +0 -43
- package/src/components/layout/layout1.vue +0 -60
- package/src/components/layout/layout2.vue +0 -134
- package/src/components/layout/layout3.vue +0 -107
- package/src/components/layout/layout4.vue +0 -66
- package/src/components/layout/nav.vue +0 -333
- package/src/components/layout/readme.md +0 -61
- package/src/components/loading/index.vue +0 -122
- package/src/components/loading/readme.md +0 -6
- package/src/components/notice/NoticeList.vue +0 -198
- package/src/components/notice/NoticeListPaging.vue +0 -281
- package/src/components/notice/NoticeView.vue +0 -92
- package/src/components/notice/readme.md +0 -1
- package/src/components/pagination/index.vue +0 -100
- package/src/components/pagination/readme.md +0 -19
- package/src/components/pagination/scroll-to.js +0 -51
- package/src/components/progress/bar.vue +0 -72
- package/src/components/progress/progress.vue +0 -58
- package/src/components/screenfull/index.js +0 -3
- package/src/components/screenfull/index.vue +0 -65
- package/src/components/screenfull/package.json +0 -15
- package/src/components/screenfull/readme.md +0 -6
- package/src/components/statisticalCount/index.vue +0 -80
- package/src/components/statisticalCount/readme.md +0 -21
- package/src/components/username/index.vue +0 -79
- package/src/components/username/readme.md +0 -22
- package/src/components/username//346/225/210/346/236/234/345/233/276.png +0 -0
- package/src/index.js +0 -88
- package/src/utils/index.js +0 -32
- package/src/xm_components/HeadSearch/hook/hookSearch.js +0 -96
- package/src/xm_components/HeadSearch/index.vue +0 -206
- package/src/xm_components/HeadSearch/readme.md +0 -12
- package/src/xm_components/HeadSearch//346/220/234/347/264/242/345/210/227/350/241/250.png +0 -0
- package/src/xm_components/Milestone/index.vue +0 -213
- package/src/xm_components/Milestone/readme.md +0 -15
- package/src/xm_components/MultiStatisticalCard/image.png +0 -0
- package/src/xm_components/MultiStatisticalCard/index.vue +0 -114
- package/src/xm_components/MultiStatisticalCard/readme.md +0 -29
- package/src/xm_components/StatisticalCard/image.png +0 -0
- package/src/xm_components/StatisticalCard/index.vue +0 -196
- package/src/xm_components/StatisticalCard/readme.md +0 -41
- package/src/xm_components/readme.md +0 -1
- package/utils/coms/load.jsx +0 -10
- package/utils/func.js +0 -32
- package/utils/hookDialog.js +0 -38
- package/utils/hookPage.js +0 -49
- package/utils/index.js +0 -5
- package/utils/lib/console.js +0 -39
- package/utils/lib/debounce.js +0 -19
- package/utils/lib/deepextend.js +0 -51
- package/utils/lib/deepset.js +0 -14
- package/utils/lib/extend.js +0 -28
- package/utils/lib/index.js +0 -13
- package/utils/lib/json.js +0 -90
- package/utils/lib/mergeprops.js +0 -62
- package/utils/lib/mitt.js +0 -43
- package/utils/lib/modify.js +0 -8
- package/utils/lib/slot.js +0 -19
- package/utils/lib/toarray.js +0 -5
- package/utils/lib/tocase.js +0 -11
- package/utils/lib/todate.js +0 -10
- package/utils/lib/toline.js +0 -10
- package/utils/lib/tostring.js +0 -7
- package/utils/lib/type.js +0 -45
- package/utils/lib/unique.js +0 -6
- package/utils/message.js +0 -164
- package/utils/package.json +0 -16
- package/utils/type.js +0 -45
- package/vite.config.js +0 -56
package/utils/lib/mergeprops.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
export const normalMerge = ['props'];
|
|
2
|
-
export const toArrayMerge = ['class', 'style', 'directives'];
|
|
3
|
-
export const functionalMerge = ['on', 'hook'];
|
|
4
|
-
|
|
5
|
-
const mergeProps = (objects, initial = {}, opt = {}) => {
|
|
6
|
-
const _normalMerge = [...normalMerge, ...opt['normal'] || []];
|
|
7
|
-
const _toArrayMerge = [...toArrayMerge, ...opt['array'] || []];
|
|
8
|
-
const _functionalMerge = [...functionalMerge, ...opt['functional'] || []];
|
|
9
|
-
const propsMerge = opt['props'] || [];
|
|
10
|
-
|
|
11
|
-
return objects.reduce((a, b) => {
|
|
12
|
-
for (const key in b) {
|
|
13
|
-
if (a[key]) {
|
|
14
|
-
if (propsMerge.indexOf(key) > -1) {
|
|
15
|
-
a[key] = mergeProps([b[key]], a[key]);
|
|
16
|
-
} else if (_normalMerge.indexOf(key) > -1) {
|
|
17
|
-
a[key] = {...a[key], ...b[key]}
|
|
18
|
-
} else if (_toArrayMerge.indexOf(key) > -1) {
|
|
19
|
-
const arrA = a[key] instanceof Array ? a[key] : [a[key]];
|
|
20
|
-
const arrB = b[key] instanceof Array ? b[key] : [b[key]];
|
|
21
|
-
a[key] = [...arrA, ...arrB]
|
|
22
|
-
} else if (_functionalMerge.indexOf(key) > -1) {
|
|
23
|
-
for (const event in b[key]) {
|
|
24
|
-
if (a[key][event]) {
|
|
25
|
-
const arrA = a[key][event] instanceof Array ? a[key][event] : [a[key][event]];
|
|
26
|
-
const arrB = b[key][event] instanceof Array ? b[key][event] : [b[key][event]];
|
|
27
|
-
a[key][event] = [...arrA, ...arrB]
|
|
28
|
-
} else {
|
|
29
|
-
a[key][event] = b[key][event]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
} else if (key === 'hook') {
|
|
33
|
-
for (let hook in b[key]) {
|
|
34
|
-
if (a[key][hook]) {
|
|
35
|
-
a[key][hook] = mergeFn(a[key][hook], b[key][hook])
|
|
36
|
-
} else {
|
|
37
|
-
a[key][hook] = b[key][hook]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
a[key] = b[key]
|
|
42
|
-
}
|
|
43
|
-
} else {
|
|
44
|
-
if (_normalMerge.indexOf(key) > -1 || _functionalMerge.indexOf(key) > -1 || propsMerge.indexOf(key) > -1) {
|
|
45
|
-
a[key] = {...b[key]}
|
|
46
|
-
} else if (_toArrayMerge.indexOf(key) > -1) {
|
|
47
|
-
a[key] = b[key] instanceof Array ? [...b[key]] : (typeof b[key] === 'object' ? {...b[key]} : b[key]);
|
|
48
|
-
} else
|
|
49
|
-
a[key] = b[key];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return a
|
|
53
|
-
}, initial);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const mergeFn = (fn1, fn2) =>
|
|
57
|
-
function () {
|
|
58
|
-
fn1 && fn1.apply(this, arguments);
|
|
59
|
-
fn2 && fn2.apply(this, arguments);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export default mergeProps;
|
package/utils/lib/mitt.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// https://github.com/developit/mitt
|
|
2
|
-
|
|
3
|
-
export default function Mitt(all) {
|
|
4
|
-
all = all || new Map();
|
|
5
|
-
|
|
6
|
-
const mitt = {
|
|
7
|
-
|
|
8
|
-
$on(type, handler) {
|
|
9
|
-
const handlers = all.get(type);
|
|
10
|
-
const added = handlers && handlers.push(handler);
|
|
11
|
-
if (!added) {
|
|
12
|
-
all.set(type, [handler]);
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
$once(type, handler) {
|
|
17
|
-
handler._once = true;
|
|
18
|
-
mitt.$on(type, handler);
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
$off(type, handler) {
|
|
22
|
-
const handlers = all.get(type);
|
|
23
|
-
if (handlers) {
|
|
24
|
-
handlers.splice(handlers.indexOf(handler) >>> 0, 1);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
$emit(type, ...args) {
|
|
29
|
-
(all.get(type) || []).slice().map((handler) => {
|
|
30
|
-
if (handler._once) {
|
|
31
|
-
mitt.$off(type, handler);
|
|
32
|
-
delete handler._once;
|
|
33
|
-
}
|
|
34
|
-
handler(...args);
|
|
35
|
-
});
|
|
36
|
-
(all.get('*') || []).slice().map((handler) => {
|
|
37
|
-
handler(type, args);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return mitt;
|
|
43
|
-
}
|
package/utils/lib/modify.js
DELETED
package/utils/lib/slot.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 从给定的 slots 对象中筛选出不需要排除的键值对,并返回一个新的对象。
|
|
3
|
-
*
|
|
4
|
-
* @param {Object} slots - 包含键值对的对象,键是字符串,值是函数。
|
|
5
|
-
* @param {Array} [exclude] - 可选的数组,包含需要排除的键。
|
|
6
|
-
* @returns {Object} - 包含不需要排除的键值对的新对象。
|
|
7
|
-
*/
|
|
8
|
-
export default function getSlot(slots, exclude) {
|
|
9
|
-
// 使用 reduce 方法遍历 slots 对象的所有键
|
|
10
|
-
return Object.keys(slots).reduce((lst, name) => {
|
|
11
|
-
// 检查 exclude 是否存在,并且当前键是否不在 exclude 数组中
|
|
12
|
-
if (!exclude || exclude.indexOf(name) === -1) {
|
|
13
|
-
// 如果不需要排除,则将当前键值对添加到结果对象中
|
|
14
|
-
lst[name] = slots[name];
|
|
15
|
-
}
|
|
16
|
-
// 返回结果对象,继续下一次迭代
|
|
17
|
-
return lst;
|
|
18
|
-
}, {}); // 初始值为空对象
|
|
19
|
-
}
|
package/utils/lib/toarray.js
DELETED
package/utils/lib/tocase.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default function toCase(str) {
|
|
2
|
-
const to = str.replace(/(-[a-z])/g, function (v) {
|
|
3
|
-
return v.replace('-', '').toLocaleUpperCase();
|
|
4
|
-
});
|
|
5
|
-
|
|
6
|
-
return lower(to);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function lower(str) {
|
|
10
|
-
return str.replace(str[0], str[0].toLowerCase());
|
|
11
|
-
}
|
package/utils/lib/todate.js
DELETED
package/utils/lib/toline.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default function toLine(name) {
|
|
2
|
-
let line = name.replace(/([A-Z])/g, '-$1').toLocaleLowerCase();
|
|
3
|
-
if (line.indexOf('-') === 0)
|
|
4
|
-
line = line.substr(1);
|
|
5
|
-
return line;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function upper(str) {
|
|
9
|
-
return str.replace(str[0], str[0].toLocaleUpperCase());
|
|
10
|
-
}
|
package/utils/lib/tostring.js
DELETED
package/utils/lib/type.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const is = {
|
|
2
|
-
type(arg, type) {
|
|
3
|
-
return Object.prototype.toString.call(arg) === '[object ' + type + ']'
|
|
4
|
-
},
|
|
5
|
-
Undef(v) {
|
|
6
|
-
return v === undefined || v === null
|
|
7
|
-
},
|
|
8
|
-
Element(arg) {
|
|
9
|
-
return typeof arg === 'object' && arg !== null && arg.nodeType === 1 && !is.Object(arg)
|
|
10
|
-
},
|
|
11
|
-
trueArray(data) {
|
|
12
|
-
return Array.isArray(data) && data.length > 0;
|
|
13
|
-
},
|
|
14
|
-
Function(v) {
|
|
15
|
-
const type = this.getType(v);
|
|
16
|
-
return type === 'Function' || type === 'AsyncFunction';
|
|
17
|
-
},
|
|
18
|
-
getType(v) {
|
|
19
|
-
const str = Object.prototype.toString.call(v)
|
|
20
|
-
return /^\[object (.*)\]$/.exec(str)[1]
|
|
21
|
-
},
|
|
22
|
-
empty(value) {
|
|
23
|
-
if (value === undefined || value === null) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (Array.isArray(value) && Array.isArray(value) && !value.length) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return typeof value === 'string' && !value;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
['Date', 'Object', 'String', 'Boolean', 'Array', 'Number'].forEach(t => {
|
|
36
|
-
is[t] = function (arg) {
|
|
37
|
-
return is.type(arg, t);
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
export function hasProperty(rule, k) {
|
|
42
|
-
return ({}).hasOwnProperty.call(rule, k)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default is;
|
package/utils/lib/unique.js
DELETED
package/utils/message.js
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { ElMessage, ElMessageBox, ElNotification, ElLoading, ElButton, ElIcon } from 'element-plus'
|
|
2
|
-
import { Warning } from '@element-plus/icons-vue'
|
|
3
|
-
import { h } from 'vue'
|
|
4
|
-
// !!!如果有方法报错 在执行方法外面添加nextTrick函数处理
|
|
5
|
-
export function showsuccess(msg, duration = 3000, showClose = true) {
|
|
6
|
-
ElMessage({
|
|
7
|
-
message: msg || '保存成功',
|
|
8
|
-
type: 'success',
|
|
9
|
-
duration: duration,
|
|
10
|
-
showClose: showClose
|
|
11
|
-
})
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function showerror(msg, duration = 3000, showClose = true) {
|
|
15
|
-
ElMessage({
|
|
16
|
-
message: msg || '保存失败',
|
|
17
|
-
type: 'error',
|
|
18
|
-
duration: duration,
|
|
19
|
-
showClose: showClose
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function showwarning(msg, duration = 3000, showClose = true, clostFn) {
|
|
24
|
-
ElMessage({
|
|
25
|
-
message: msg || '警告内容',
|
|
26
|
-
type: 'warning',
|
|
27
|
-
duration: duration,
|
|
28
|
-
showClose: showClose,
|
|
29
|
-
onClose: clostFn
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function showinfo(msg, duration = 3000, showClose = true) {
|
|
34
|
-
ElMessage({
|
|
35
|
-
message: msg || '提示信息',
|
|
36
|
-
duration: duration,
|
|
37
|
-
showClose: showClose
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function hideloading(msg) {
|
|
42
|
-
ElMessage.closeAll()
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function showconfirm(done, confirmtitle = '确认关闭?', showtext = { title: '提示', confirmButtonText: '确定', cancelButtonText: '取消' }, cancle) {
|
|
46
|
-
return ElMessageBox.confirm(confirmtitle, showtext.title, {
|
|
47
|
-
confirmButtonText: showtext.confirmButtonText,
|
|
48
|
-
cancelButtonText: showtext.cancelButtonText,
|
|
49
|
-
distinguishCancelAndClose: true,
|
|
50
|
-
type: 'warning'
|
|
51
|
-
})
|
|
52
|
-
.then((_) => {
|
|
53
|
-
done(_)
|
|
54
|
-
})
|
|
55
|
-
.catch((_) => {
|
|
56
|
-
console.info('showconfirm catch')
|
|
57
|
-
console.info(_)
|
|
58
|
-
cancle && cancle(_)
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 信息提示框
|
|
64
|
-
* @param {*} msg
|
|
65
|
-
* @param {*} type
|
|
66
|
-
* @param {*} title
|
|
67
|
-
* @param {*} position
|
|
68
|
-
* @param {*} dangerouslyUseHTMLString
|
|
69
|
-
*/
|
|
70
|
-
export function shownotiinfo(msg, type = 'info', title = '提示', position = 'bottom-right', dangerouslyUseHTMLString = false) {
|
|
71
|
-
ElNotification({
|
|
72
|
-
title: title,
|
|
73
|
-
position: position,
|
|
74
|
-
message: msg,
|
|
75
|
-
dangerouslyUseHTMLString: dangerouslyUseHTMLString,
|
|
76
|
-
type: type
|
|
77
|
-
})
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function showconfirminfo(msg = '确认删除?', showtext = { type: '', position: 'bottom-right', title: '提示', dangerouslyUseHTMLString: true }, fn1, fn2) {
|
|
81
|
-
// 按钮
|
|
82
|
-
const btn1 = h(ElButton, {
|
|
83
|
-
innerText: '立即刷新',
|
|
84
|
-
type: 'primary',
|
|
85
|
-
size: 'small',
|
|
86
|
-
style: { marginLeft: '16px', float: 'right' },
|
|
87
|
-
onclick: (_) => {
|
|
88
|
-
fn1(_)
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
const btn2 = h(ElButton, {
|
|
92
|
-
innerText: '暂不更新',
|
|
93
|
-
style: { float: 'right' },
|
|
94
|
-
size: 'small',
|
|
95
|
-
onclick: (_) => {
|
|
96
|
-
fn2(_)
|
|
97
|
-
}
|
|
98
|
-
})
|
|
99
|
-
// 信息div
|
|
100
|
-
const div = h('div', { style: { marginLeft: '8px', marginBottom: '16px', marginTop: '16px' } }, msg)
|
|
101
|
-
// 图标
|
|
102
|
-
const icon1 = h(Warning)
|
|
103
|
-
const icon = h(ElIcon, { style: { fontSize: '18px' } }, [icon1])
|
|
104
|
-
// 整体div
|
|
105
|
-
const msgDiv = h('div', { style: { display: 'flex', alignItems: 'center' } }, [icon, div])
|
|
106
|
-
ElNotification({
|
|
107
|
-
class: 'custom-notification',
|
|
108
|
-
title: showtext.title,
|
|
109
|
-
position: showtext.position,
|
|
110
|
-
dangerouslyUseHTMLString: showtext.dangerouslyUseHTMLString,
|
|
111
|
-
message: h('div', [msgDiv, btn1, btn2]),
|
|
112
|
-
type: showtext.type,
|
|
113
|
-
duration: 0,
|
|
114
|
-
showClose: false
|
|
115
|
-
})
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function showalert(done, alertMsg = 'This is a message', type = 'info', showtext = { title: '提示', confirmButtonText: '确定' }) {
|
|
119
|
-
return ElMessageBox.alert(alertMsg, showtext.title, {
|
|
120
|
-
confirmButtonText: showtext.confirmButtonText,
|
|
121
|
-
type: type
|
|
122
|
-
})
|
|
123
|
-
.then((_) => {
|
|
124
|
-
done(_)
|
|
125
|
-
})
|
|
126
|
-
.catch((_) => {
|
|
127
|
-
console.info('showalert catch')
|
|
128
|
-
console.info(_)
|
|
129
|
-
})
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export function confirm(confirmtitle = '确认关闭?') {
|
|
133
|
-
return ElMessageBox.confirm(confirmtitle)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function showloading(msg, duration = 0, showClose = true) {
|
|
137
|
-
ElMessage({
|
|
138
|
-
// <svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg>
|
|
139
|
-
icon: 'loadsvg',
|
|
140
|
-
message: msg || '正在保存,请稍后...',
|
|
141
|
-
duration: duration,
|
|
142
|
-
showClose: showClose
|
|
143
|
-
})
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// loading加载 closeLoading
|
|
147
|
-
let loadingObj = null
|
|
148
|
-
export function showLoading(msg, parm) {
|
|
149
|
-
let _parm = parm || {}
|
|
150
|
-
loadingObj = ElLoading.service({
|
|
151
|
-
// 默认配置
|
|
152
|
-
lock: true,
|
|
153
|
-
text: '加载中...',
|
|
154
|
-
spinner: 'el-icon-loading',
|
|
155
|
-
background: 'rgba(0, 0, 0, 0.7)',
|
|
156
|
-
// 展开 _parm,其属性会覆盖上面的默认配置
|
|
157
|
-
..._parm
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export function closeLoading() {
|
|
162
|
-
loadingObj.close()
|
|
163
|
-
}
|
|
164
|
-
export { ElMessage, ElMessageBox, ElNotification, ElLoading }
|
package/utils/package.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bdsoft-element/utils",
|
|
3
|
-
"version": "1.0.1",
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "./index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"README.md",
|
|
11
|
-
"package.json"
|
|
12
|
-
],
|
|
13
|
-
"keywords": [],
|
|
14
|
-
"author": "lbq",
|
|
15
|
-
"license": "MIT"
|
|
16
|
-
}
|
package/utils/type.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
const is = {
|
|
2
|
-
type(arg, type) {
|
|
3
|
-
return Object.prototype.toString.call(arg) === '[object ' + type + ']'
|
|
4
|
-
},
|
|
5
|
-
Undef(v) {
|
|
6
|
-
return v === undefined || v === null
|
|
7
|
-
},
|
|
8
|
-
Element(arg) {
|
|
9
|
-
return typeof arg === 'object' && arg !== null && arg.nodeType === 1 && !is.Object(arg)
|
|
10
|
-
},
|
|
11
|
-
trueArray(data) {
|
|
12
|
-
return Array.isArray(data) && data.length > 0;
|
|
13
|
-
},
|
|
14
|
-
Function(v) {
|
|
15
|
-
const type = this.getType(v);
|
|
16
|
-
return type === 'Function' || type === 'AsyncFunction';
|
|
17
|
-
},
|
|
18
|
-
getType(v) {
|
|
19
|
-
const str = Object.prototype.toString.call(v)
|
|
20
|
-
return /^\[object (.*)\]$/.exec(str)[1]
|
|
21
|
-
},
|
|
22
|
-
empty(value) {
|
|
23
|
-
if (value === undefined || value === null) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (Array.isArray(value) && Array.isArray(value) && !value.length) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return typeof value === 'string' && !value;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
['Date', 'Object', 'String', 'Boolean', 'Array', 'Number'].forEach(t => {
|
|
36
|
-
is[t] = function (arg) {
|
|
37
|
-
return is.type(arg, t);
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
export function hasProperty(rule, k) {
|
|
42
|
-
return ({}).hasOwnProperty.call(rule, k)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default is;
|
package/vite.config.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import { fileURLToPath } from 'node:url'
|
|
3
|
-
import { resolve } from 'path'
|
|
4
|
-
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
5
|
-
import vue from '@vitejs/plugin-vue'
|
|
6
|
-
import importToConst from 'rollup-plugin-import-to-const'
|
|
7
|
-
|
|
8
|
-
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
|
|
9
|
-
|
|
10
|
-
export default defineConfig({
|
|
11
|
-
resolve: {
|
|
12
|
-
alias: {
|
|
13
|
-
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
14
|
-
'~': fileURLToPath(new URL('./src/assets', import.meta.url))
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
build: {
|
|
18
|
-
lib: {
|
|
19
|
-
entry: './index.js',
|
|
20
|
-
name: '@bdsoft/element',
|
|
21
|
-
fileName: 'BdElement', // 输出的包文件名
|
|
22
|
-
formats: ['es', 'cjs'] // 这是默认值 'umd',
|
|
23
|
-
},
|
|
24
|
-
outDir: 'esaaa', // 根输出目录
|
|
25
|
-
minify: false,
|
|
26
|
-
rollupOptions: {
|
|
27
|
-
//忽略打包vue文件
|
|
28
|
-
external: ['vue', 'element-plus', '@element-plus/icons-vue', 'vue/server-renderer', '@vue/server-renderer'], // 这里列出你想排除的外部依赖
|
|
29
|
-
output: [
|
|
30
|
-
{
|
|
31
|
-
//配置打包根目录
|
|
32
|
-
dir: 'dist',
|
|
33
|
-
globals: {
|
|
34
|
-
vue: 'Vue',
|
|
35
|
-
'element-plus': 'ElementPlus',
|
|
36
|
-
'@element-plus/icons-vue': 'ElementPlusIconVue'
|
|
37
|
-
},
|
|
38
|
-
esModule: true // 强制 ES 模块输出格式的兼容性
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
// 优化依赖:提前预构建 dayjs,避免打包时解析错误
|
|
43
|
-
optimizeDeps: {
|
|
44
|
-
include: ['dayjs']
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
css: {
|
|
48
|
-
preprocessorOptions: {
|
|
49
|
-
scss: {
|
|
50
|
-
api: 'modern-compiler',
|
|
51
|
-
silenceDeprecations: ['legacy-js-api']
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
plugins: [vue(), vueJsx(), importToConst(), cssInjectedByJsPlugin()]
|
|
56
|
-
})
|