@jetlinks-web/components 2.0.2 → 2.0.4-1
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/es/AMap/Map.js +125 -0
- package/es/AMap/index.js +2 -0
- package/es/AMap/util.js +56 -0
- package/es/BadgeStatus/Badge.js +54 -0
- package/es/BadgeStatus/color.js +21 -0
- package/es/BadgeStatus/index.js +3 -0
- package/es/CardSelect/CardSelect.js +123 -0
- package/es/CardSelect/index.js +2 -0
- package/es/CheckButton/CheckButton.js +120 -0
- package/es/CheckButton/index.js +2 -0
- package/es/CheckButton/style/index.css +37 -0
- package/es/CheckButton/style/index.less +40 -0
- package/es/ConfigProvider/context.js +12 -0
- package/es/ConfigProvider/index.js +31 -0
- package/es/Echarts/Echarts.js +47 -0
- package/es/Echarts/index.js +2 -0
- package/es/Ellipsis/Ellipsis.js +184 -0
- package/es/Ellipsis/index.js +2 -0
- package/es/Ellipsis/style/index.css +17 -0
- package/es/Ellipsis/style/index.less +20 -0
- package/es/Empty/Empty.js +56 -0
- package/es/Empty/image.js +2 -0
- package/es/Empty/index.js +2 -0
- package/es/FullPage/FullPage.js +31 -0
- package/es/FullPage/index.js +2 -0
- package/es/Icon/icon.js +42 -0
- package/{src/Icon/index.ts → es/Icon/index.js} +2 -3
- package/es/MonacoEditor/Monaco.js +238 -0
- package/es/MonacoEditor/index.js +2 -0
- package/es/PermissionButton/index.js +117 -0
- package/es/ProLayout/Basic/BasicLayout.js +259 -0
- package/es/ProLayout/Basic/Header.js +97 -0
- package/es/ProLayout/PageContainer/index.js +324 -0
- package/es/ProLayout/PageContainer/typings.js +1 -0
- package/es/ProLayout/RouteContext.js +22 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +285 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +278 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/typings.js +1 -0
- package/es/ProLayout/TopHeader/index.js +163 -0
- package/es/ProLayout/defaultSettings.js +66 -0
- package/{src/ProLayout/index.ts → es/ProLayout/index.js} +4 -6
- package/{src → es}/ProLayout/style/default.less +1 -1
- package/es/ProLayout/style/index.js +1 -0
- package/es/ProLayout/typings.js +1 -0
- package/es/ProLayout/util.js +61 -0
- package/es/ProTable/index.js +411 -0
- package/es/ProTable/proTableTypes.js +11 -0
- package/es/ProTable/style/index.css +65 -0
- package/es/ProTable/style/index.js +1 -0
- package/{src → es}/ProTable/style/index.less +92 -92
- package/es/Scrollbar/Bar.js +114 -0
- package/es/Scrollbar/Scrollbar.js +212 -0
- package/es/Scrollbar/Thumb.js +189 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +2 -0
- package/es/Scrollbar/scrollbarProps.js +100 -0
- package/es/Scrollbar/thumbProps.js +10 -0
- package/es/Scrollbar/util.js +30 -0
- package/es/Search/Advanced/History.js +183 -0
- package/es/Search/Advanced/SaveHistory.js +153 -0
- package/es/Search/Advanced/index.js +520 -0
- package/es/Search/Item.js +497 -0
- package/es/Search/Search.js +249 -0
- package/es/Search/hooks/index.js +1 -0
- package/es/Search/hooks/useSearchItems.js +40 -0
- package/es/Search/index.js +4 -0
- package/es/Search/setting.js +91 -0
- package/es/Search/style/Item.less +33 -0
- package/es/Search/style/Search.less +179 -0
- package/es/Search/style/index.js +2 -0
- package/es/Search/typing.js +1 -0
- package/es/Search/util.js +234 -0
- package/es/ValueItem/ValueItem.js +233 -0
- package/es/ValueItem/index.js +2 -0
- package/es/ValueItem/util.js +16 -0
- package/es/index.js +24 -0
- package/es/style/index.js +3 -0
- package/es/style/variable.css +0 -0
- package/{src → es}/style/variable.less +2 -4
- package/es/style.js +5 -0
- package/lib/AMap/Map.js +125 -0
- package/lib/AMap/index.js +9 -0
- package/lib/AMap/util.js +62 -0
- package/lib/BadgeStatus/Badge.js +54 -0
- package/lib/BadgeStatus/color.js +27 -0
- package/lib/BadgeStatus/index.js +22 -0
- package/lib/CardSelect/CardSelect.js +123 -0
- package/lib/CardSelect/index.js +9 -0
- package/lib/CheckButton/CheckButton.js +120 -0
- package/lib/CheckButton/index.js +9 -0
- package/lib/CheckButton/style/index.css +37 -0
- package/lib/CheckButton/style/index.less +40 -0
- package/lib/ConfigProvider/context.js +19 -0
- package/lib/ConfigProvider/index.js +37 -0
- package/lib/Echarts/Echarts.js +47 -0
- package/lib/Echarts/index.js +9 -0
- package/lib/Ellipsis/Ellipsis.js +184 -0
- package/lib/Ellipsis/index.js +9 -0
- package/lib/Ellipsis/style/index.css +17 -0
- package/lib/Ellipsis/style/index.less +20 -0
- package/lib/Empty/Empty.js +56 -0
- package/lib/Empty/image.js +8 -0
- package/lib/Empty/index.js +9 -0
- package/lib/FullPage/FullPage.js +31 -0
- package/lib/FullPage/index.js +9 -0
- package/lib/Icon/icon.js +52 -0
- package/lib/Icon/index.js +9 -0
- package/lib/MonacoEditor/Monaco.js +238 -0
- package/lib/MonacoEditor/index.js +9 -0
- package/lib/PermissionButton/index.js +124 -0
- package/lib/ProLayout/Basic/BasicLayout.js +268 -0
- package/lib/ProLayout/Basic/BasicLayout.less +66 -0
- package/lib/ProLayout/Basic/Header.js +103 -0
- package/lib/ProLayout/Basic/Header.less +8 -0
- package/lib/ProLayout/PageContainer/index.js +327 -0
- package/lib/ProLayout/PageContainer/index.less +103 -0
- package/lib/ProLayout/PageContainer/typings.js +5 -0
- package/lib/ProLayout/RouteContext.js +28 -0
- package/lib/ProLayout/SiderMenu/BaseMenu.js +290 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +287 -0
- package/lib/ProLayout/SiderMenu/index.js +20 -0
- package/lib/ProLayout/SiderMenu/index.less +212 -0
- package/lib/ProLayout/SiderMenu/typings.js +5 -0
- package/lib/ProLayout/TopHeader/index.js +168 -0
- package/lib/ProLayout/TopHeader/index.less +174 -0
- package/lib/ProLayout/defaultSettings.js +72 -0
- package/lib/ProLayout/index.js +16 -0
- package/lib/ProLayout/style/default.less +4 -0
- package/lib/ProLayout/style/index.js +3 -0
- package/lib/ProLayout/style/style.less +7 -0
- package/lib/ProLayout/typings.js +5 -0
- package/lib/ProLayout/util.js +72 -0
- package/lib/ProTable/index.js +417 -0
- package/lib/ProTable/proTableTypes.js +17 -0
- package/lib/ProTable/style/index.css +65 -0
- package/lib/ProTable/style/index.js +3 -0
- package/lib/ProTable/style/index.less +92 -0
- package/lib/Scrollbar/Bar.js +114 -0
- package/lib/Scrollbar/Scrollbar.js +212 -0
- package/lib/Scrollbar/Thumb.js +189 -0
- package/lib/Scrollbar/constants.js +7 -0
- package/lib/Scrollbar/index.js +9 -0
- package/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/scrollbarProps.js} +106 -108
- package/lib/Scrollbar/thumbProps.js +16 -0
- package/lib/Scrollbar/util.js +37 -0
- package/lib/Search/Advanced/History.js +183 -0
- package/lib/Search/Advanced/SaveHistory.js +153 -0
- package/lib/Search/Advanced/index.js +520 -0
- package/lib/Search/Item.js +497 -0
- package/lib/Search/Search.js +249 -0
- package/lib/Search/hooks/index.js +16 -0
- package/lib/Search/hooks/useSearchItems.js +47 -0
- package/lib/Search/index.js +16 -0
- package/lib/Search/setting.js +97 -0
- package/lib/Search/style/Item.less +33 -0
- package/lib/Search/style/Search.less +179 -0
- package/lib/Search/style/index.js +4 -0
- package/lib/Search/typing.js +5 -0
- package/lib/Search/util.js +241 -0
- package/lib/ValueItem/ValueItem.js +233 -0
- package/lib/ValueItem/index.js +9 -0
- package/lib/ValueItem/util.js +22 -0
- package/lib/index.js +158 -0
- package/lib/style/components.less +3 -0
- package/lib/style/index.js +4 -0
- package/lib/style/variable.css +0 -0
- package/lib/style/variable.less +2 -0
- package/lib/style.js +7 -0
- package/package.json +123 -13
- package/index.ts +0 -64
- package/src/AMap/Map.vue +0 -110
- package/src/AMap/index.ts +0 -1
- package/src/AMap/util.ts +0 -56
- package/src/BadgeStatus/Badge.vue +0 -41
- package/src/BadgeStatus/color.ts +0 -25
- package/src/BadgeStatus/index.ts +0 -4
- package/src/CardSelect/CardSelect.vue +0 -136
- package/src/CardSelect/index.ts +0 -3
- package/src/CheckButton/CheckButton.vue +0 -146
- package/src/CheckButton/index.md +0 -27
- package/src/CheckButton/index.ts +0 -3
- package/src/ConfigProvider/context.ts +0 -17
- package/src/ConfigProvider/index.tsx +0 -42
- package/src/Echarts/Echarts.vue +0 -43
- package/src/Echarts/index.ts +0 -3
- package/src/Ellipsis/Ellipsis.vue +0 -182
- package/src/Ellipsis/index.ts +0 -3
- package/src/Empty/Empty.vue +0 -43
- package/src/Empty/image.ts +0 -3
- package/src/Empty/index.ts +0 -2
- package/src/FullPage/FullPage.vue +0 -30
- package/src/FullPage/index.ts +0 -3
- package/src/Icon/icon.tsx +0 -40
- package/src/MonacoEditor/Monaco.vue +0 -242
- package/src/MonacoEditor/index.md +0 -26
- package/src/MonacoEditor/index.ts +0 -2
- package/src/PermissionButton/index.tsx +0 -110
- package/src/ProLayout/Basic/BasicLayout.tsx +0 -392
- package/src/ProLayout/Basic/Header.tsx +0 -115
- package/src/ProLayout/PageContainer/index.tsx +0 -441
- package/src/ProLayout/PageContainer/typings.ts +0 -56
- package/src/ProLayout/RouteContext.ts +0 -87
- package/src/ProLayout/SiderMenu/BaseMenu.tsx +0 -296
- package/src/ProLayout/SiderMenu/SiderMenu.tsx +0 -320
- package/src/ProLayout/SiderMenu/index.ts +0 -2
- package/src/ProLayout/SiderMenu/typings.ts +0 -49
- package/src/ProLayout/TopHeader/index.tsx +0 -210
- package/src/ProLayout/defaultSettings.ts +0 -106
- package/src/ProLayout/style/index.ts +0 -1
- package/src/ProLayout/typings.ts +0 -87
- package/src/ProLayout/util.ts +0 -64
- package/src/ProTable/index.md +0 -53
- package/src/ProTable/index.tsx +0 -551
- package/src/ProTable/proTableTypes.ts +0 -70
- package/src/ProTable/style/index.ts +0 -1
- package/src/Scrollbar/Bar.vue +0 -75
- package/src/Scrollbar/Scrollbar.vue +0 -260
- package/src/Scrollbar/Thumb.vue +0 -163
- package/src/Scrollbar/constants.ts +0 -10
- package/src/Scrollbar/index.ts +0 -4
- package/src/Scrollbar/thumb.ts +0 -16
- package/src/Scrollbar/util.ts +0 -38
- package/src/Search/Advanced/History.vue +0 -140
- package/src/Search/Advanced/SaveHistory.vue +0 -108
- package/src/Search/Advanced/index.vue +0 -435
- package/src/Search/Item.vue +0 -525
- package/src/Search/Search.vue +0 -398
- package/src/Search/hooks/index.ts +0 -1
- package/src/Search/hooks/useSearchItems.ts +0 -68
- package/src/Search/index.md +0 -57
- package/src/Search/index.ts +0 -5
- package/src/Search/setting.ts +0 -55
- package/src/Search/typing.ts +0 -76
- package/src/Search/util.ts +0 -263
- package/src/ValueItem/ValueItem.vue +0 -192
- package/src/ValueItem/index.ts +0 -3
- package/src/ValueItem/util.ts +0 -16
- package/src/style/index.ts +0 -3
- /package/{src → es}/ProLayout/Basic/BasicLayout.less +0 -0
- /package/{src → es}/ProLayout/Basic/Header.less +0 -0
- /package/{src → es}/ProLayout/PageContainer/index.less +0 -0
- /package/{src → es}/ProLayout/SiderMenu/index.less +0 -0
- /package/{src → es}/ProLayout/TopHeader/index.less +0 -0
- /package/{src → es}/ProLayout/style/style.less +0 -0
package/es/AMap/Map.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* Analyzed bindings: {
|
|
2
|
+
"style": "props",
|
|
3
|
+
"class": "props",
|
|
4
|
+
"AMapUI": "props",
|
|
5
|
+
"center": "props",
|
|
6
|
+
"plugins": "props",
|
|
7
|
+
"zooms": "props",
|
|
8
|
+
"JSKey": "props",
|
|
9
|
+
"WebKey": "props",
|
|
10
|
+
"ref": "setup-const",
|
|
11
|
+
"computed": "setup-const",
|
|
12
|
+
"inject": "setup-const",
|
|
13
|
+
"initAMapApiLoader": "setup-maybe-ref",
|
|
14
|
+
"ElAmap": "setup-maybe-ref",
|
|
15
|
+
"getAMapUiPromise": "setup-maybe-ref",
|
|
16
|
+
"MapProps": "setup-maybe-ref",
|
|
17
|
+
"MAPConfig": "setup-maybe-ref",
|
|
18
|
+
"Empty": "setup-maybe-ref",
|
|
19
|
+
"emit": "setup-const",
|
|
20
|
+
"props": "setup-reactive-const",
|
|
21
|
+
"config": "setup-maybe-ref",
|
|
22
|
+
"_mapStyle": "setup-ref",
|
|
23
|
+
"hasAMapKey": "setup-ref",
|
|
24
|
+
"uiLoading": "setup-ref",
|
|
25
|
+
"map": "setup-ref",
|
|
26
|
+
"isOpenUi": "setup-ref",
|
|
27
|
+
"getAMapUI": "setup-const",
|
|
28
|
+
"initMap": "setup-const"
|
|
29
|
+
} */
|
|
30
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
31
|
+
import { renderSlot as _renderSlot, unref as _unref, mergeProps as _mergeProps, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from "vue";
|
|
32
|
+
import { ref, computed, inject } from 'vue';
|
|
33
|
+
import { initAMapApiLoader, ElAmap } from '@vuemap/vue-amap';
|
|
34
|
+
import { getAMapUiPromise } from '@jetlinks-web/utils';
|
|
35
|
+
import { MapProps } from './util';
|
|
36
|
+
import { MAPConfig } from "@jetlinks-web/constants";
|
|
37
|
+
import Empty from '../Empty';
|
|
38
|
+
import '@vuemap/vue-amap/dist/style.css';
|
|
39
|
+
const __sfc_main__ = _defineComponent({
|
|
40
|
+
props: {
|
|
41
|
+
...MapProps(),
|
|
42
|
+
style: Object,
|
|
43
|
+
class: String,
|
|
44
|
+
AMapUI: [String, Boolean],
|
|
45
|
+
center: Array,
|
|
46
|
+
plugins: Array,
|
|
47
|
+
zooms: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: [3, 20]
|
|
50
|
+
},
|
|
51
|
+
JSKey: String,
|
|
52
|
+
WebKey: String,
|
|
53
|
+
},
|
|
54
|
+
emits: [
|
|
55
|
+
'initMap',
|
|
56
|
+
],
|
|
57
|
+
setup(__props, { emit: __emit }) {
|
|
58
|
+
const emit = __emit;
|
|
59
|
+
const props = __props;
|
|
60
|
+
const config = inject(MAPConfig);
|
|
61
|
+
const _mapStyle = computed(() => {
|
|
62
|
+
if (props.mapStyle) {
|
|
63
|
+
return `amap://styles/${props.mapStyle}`;
|
|
64
|
+
}
|
|
65
|
+
if (config.mapStyle) {
|
|
66
|
+
return config.mapStyle;
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
});
|
|
70
|
+
const hasAMapKey = computed(() => {
|
|
71
|
+
return !!(props.JSKey || config.JSKey);
|
|
72
|
+
});
|
|
73
|
+
initAMapApiLoader({
|
|
74
|
+
key: props.JSKey || config.JSKey || '',
|
|
75
|
+
securityJsCode: props.WebKey || config.WebKey,
|
|
76
|
+
plugins: props.plugins
|
|
77
|
+
});
|
|
78
|
+
const uiLoading = ref(false);
|
|
79
|
+
const map = ref(null);
|
|
80
|
+
const isOpenUi = computed(() => {
|
|
81
|
+
return 'AMapUI' in props || props.AMapUI;
|
|
82
|
+
});
|
|
83
|
+
const getAMapUI = () => {
|
|
84
|
+
const version = typeof props.AMapUI === 'string' ? props.AMapUI : '1.1';
|
|
85
|
+
getAMapUiPromise(version).then(() => {
|
|
86
|
+
uiLoading.value = true;
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
const initMap = (e) => {
|
|
90
|
+
map.value = e;
|
|
91
|
+
emit('initMap', e);
|
|
92
|
+
if (isOpenUi.value) {
|
|
93
|
+
getAMapUI();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return (_ctx, _cache) => {
|
|
97
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
98
|
+
style: _normalizeStyle(props.style || { width: '100%', height: '100%' }),
|
|
99
|
+
class: _normalizeClass(props.class)
|
|
100
|
+
}, [
|
|
101
|
+
(hasAMapKey.value)
|
|
102
|
+
? (_openBlock(), _createBlock(_unref(ElAmap), _mergeProps({
|
|
103
|
+
key: 0,
|
|
104
|
+
"map-style": _mapStyle.value
|
|
105
|
+
}, {
|
|
106
|
+
...props,
|
|
107
|
+
..._ctx.$attrs
|
|
108
|
+
}, { onInit: initMap }), {
|
|
109
|
+
default: _withCtx(() => [
|
|
110
|
+
(uiLoading.value)
|
|
111
|
+
? _renderSlot(_ctx.$slots, "default", { key: 0 })
|
|
112
|
+
: _renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
113
|
+
]),
|
|
114
|
+
_: 3 /* FORWARDED */
|
|
115
|
+
}, 16 /* FULL_PROPS */, ["map-style"]))
|
|
116
|
+
: (_openBlock(), _createBlock(_unref(Empty), {
|
|
117
|
+
key: 1,
|
|
118
|
+
description: "请配置高德地图key",
|
|
119
|
+
style: { "padding": "20%" }
|
|
120
|
+
}))
|
|
121
|
+
], 6 /* CLASS, STYLE */));
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
export default __sfc_main__;
|
package/es/AMap/index.js
ADDED
package/es/AMap/util.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export var MapProps = function MapProps() {
|
|
2
|
+
return {
|
|
3
|
+
// 响应式
|
|
4
|
+
center: Array,
|
|
5
|
+
labelzIndex: Number,
|
|
6
|
+
lang: String,
|
|
7
|
+
mapStyle: String,
|
|
8
|
+
// 静态属性
|
|
9
|
+
vid: String,
|
|
10
|
+
amapManager: Object,
|
|
11
|
+
defaultCursor: String,
|
|
12
|
+
animateEnable: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: true
|
|
15
|
+
},
|
|
16
|
+
isHotspot: Boolean,
|
|
17
|
+
rotateEnable: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
},
|
|
21
|
+
resizeEnable: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
showIndoorMap: Boolean,
|
|
26
|
+
expandZoomRange: Boolean,
|
|
27
|
+
dragEnable: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
zoomEnable: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
35
|
+
doubleClickZoom: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
keyboardEnable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
jogEnable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
scrollWheel: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
},
|
|
51
|
+
touchZoom: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* Analyzed bindings: {
|
|
2
|
+
"text": "props",
|
|
3
|
+
"status": "props",
|
|
4
|
+
"statusNames": "props",
|
|
5
|
+
"computed": "setup-const",
|
|
6
|
+
"getHexColor": "setup-maybe-ref",
|
|
7
|
+
"props": "setup-reactive-const",
|
|
8
|
+
"_color": "setup-ref"
|
|
9
|
+
} */
|
|
10
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
11
|
+
import { resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock } from "vue";
|
|
12
|
+
import { computed } from 'vue';
|
|
13
|
+
import { getHexColor } from './color';
|
|
14
|
+
const __sfc_main__ = _defineComponent({
|
|
15
|
+
props: {
|
|
16
|
+
text: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
status: {
|
|
20
|
+
type: [String, Number],
|
|
21
|
+
default: 'default',
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* 自定义status值颜色
|
|
25
|
+
* @example {
|
|
26
|
+
* 1: 'success',
|
|
27
|
+
* 0: 'error'
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
statusNames: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({
|
|
33
|
+
'success': 'success',
|
|
34
|
+
'warning': 'warning',
|
|
35
|
+
'error': 'error',
|
|
36
|
+
'default': 'default',
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
setup(__props) {
|
|
41
|
+
const props = __props;
|
|
42
|
+
const _color = computed(() => {
|
|
43
|
+
return getHexColor(props.status, props.statusNames, 1);
|
|
44
|
+
});
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
const _component_a_badge = _resolveComponent("a-badge");
|
|
47
|
+
return (_openBlock(), _createBlock(_component_a_badge, {
|
|
48
|
+
color: _color.value,
|
|
49
|
+
text: __props.text
|
|
50
|
+
}, null, 8 /* PROPS */, ["color", "text"]));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var colorMap = {
|
|
2
|
+
'success': '36, 178, 118',
|
|
3
|
+
'warning': '255, 144, 0',
|
|
4
|
+
'error': '229, 0, 18',
|
|
5
|
+
'processing': '9, 46, 231',
|
|
6
|
+
'default': '102, 102, 102'
|
|
7
|
+
};
|
|
8
|
+
export var getHexColor = function getHexColor(code, statusNames) {
|
|
9
|
+
var pe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.1;
|
|
10
|
+
if (!code) {
|
|
11
|
+
return "rgba(102, 102, 102, ".concat(pe, ")");
|
|
12
|
+
}
|
|
13
|
+
if (colorMap[code]) {
|
|
14
|
+
return "rgba(".concat(colorMap[code], ", ").concat(pe, ")");
|
|
15
|
+
}
|
|
16
|
+
if (Object.keys(statusNames).length) {
|
|
17
|
+
return statusNames[code];
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
};
|
|
21
|
+
export default colorMap;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* Analyzed bindings: {
|
|
2
|
+
"layout": "props",
|
|
3
|
+
"options": "props",
|
|
4
|
+
"disabled": "props",
|
|
5
|
+
"multiple": "props",
|
|
6
|
+
"column": "props",
|
|
7
|
+
"value": "props",
|
|
8
|
+
"itemLayout": "props",
|
|
9
|
+
"has": "setup-maybe-ref",
|
|
10
|
+
"props": "setup-reactive-const",
|
|
11
|
+
"emit": "setup-const",
|
|
12
|
+
"selectKeys": "setup-maybe-ref",
|
|
13
|
+
"CardSelectStyle": "setup-maybe-ref",
|
|
14
|
+
"isMultiple": "setup-maybe-ref",
|
|
15
|
+
"handleSelect": "setup-const"
|
|
16
|
+
} */
|
|
17
|
+
import { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
|
|
18
|
+
const _hoisted_1 = ["onClick"];
|
|
19
|
+
const _hoisted_2 = { class: "j-card-select-item-content" };
|
|
20
|
+
const _hoisted_3 = { class: "j-card-select-title" };
|
|
21
|
+
const _hoisted_4 = { class: "j-card-select-describe" };
|
|
22
|
+
import { has } from 'lodash-es';
|
|
23
|
+
const __sfc_main__ = {
|
|
24
|
+
props: {
|
|
25
|
+
layout: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'horizontal'
|
|
28
|
+
},
|
|
29
|
+
options: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: () => [],
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
multiple: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: false,
|
|
40
|
+
},
|
|
41
|
+
column: {
|
|
42
|
+
type: Number,
|
|
43
|
+
default: 3,
|
|
44
|
+
},
|
|
45
|
+
value: {
|
|
46
|
+
type: [String, Array],
|
|
47
|
+
default: undefined,
|
|
48
|
+
},
|
|
49
|
+
itemLayout: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'horizontal'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
emits: ['select', 'change', 'update:value'],
|
|
55
|
+
setup(__props, { emit: __emit }) {
|
|
56
|
+
const props = __props;
|
|
57
|
+
const emit = __emit;
|
|
58
|
+
const selectKeys = ref([]);
|
|
59
|
+
const CardSelectStyle = computed(() => {
|
|
60
|
+
const _column = props.column > 0 && props.layout === 'horizontal' ? props.column : 1;
|
|
61
|
+
return {
|
|
62
|
+
'grid-template-columns': `repeat(${_column}, 1fr)`
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
const isMultiple = computed(() => {
|
|
66
|
+
return has(props, 'multiple') && props.multiple !== false;
|
|
67
|
+
});
|
|
68
|
+
const handleSelect = (key, node) => {
|
|
69
|
+
if (props.disabled || node.disabled) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const selectKeysSet = new Set(selectKeys.value);
|
|
73
|
+
const isActive = selectKeysSet.has(key);
|
|
74
|
+
if (isMultiple.value) {
|
|
75
|
+
if (isActive) {
|
|
76
|
+
selectKeysSet.delete(key);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
selectKeysSet.add(key);
|
|
80
|
+
}
|
|
81
|
+
selectKeys.value = [...selectKeysSet.values()];
|
|
82
|
+
const nodes = props.options.filter(item => selectKeys.value.includes(item.value));
|
|
83
|
+
emit('select', selectKeys.value, nodes);
|
|
84
|
+
emit('change', selectKeys.value, nodes);
|
|
85
|
+
emit('update:value', selectKeys.value);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
selectKeys.value = [key];
|
|
89
|
+
emit('select', key, node);
|
|
90
|
+
emit('change', key, node);
|
|
91
|
+
emit('update:value', key);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
watch(() => props.value, () => {
|
|
95
|
+
selectKeys.value = isMultiple.value ? props.value : [props.value];
|
|
96
|
+
}, { immediate: true });
|
|
97
|
+
return (_ctx, _cache) => {
|
|
98
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
99
|
+
class: "j-card-select",
|
|
100
|
+
style: _normalizeStyle(_unref(CardSelectStyle))
|
|
101
|
+
}, [
|
|
102
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.options, (item) => {
|
|
103
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
104
|
+
class: _normalizeClass({
|
|
105
|
+
'j-card-select-item': true,
|
|
106
|
+
'disabled': __props.disabled || item.disabled,
|
|
107
|
+
'active': _unref(selectKeys).includes(item.value)
|
|
108
|
+
}),
|
|
109
|
+
onClick: () => handleSelect(item.value, item)
|
|
110
|
+
}, [
|
|
111
|
+
_renderSlot(_ctx.$slots, "itemRender", { node: item }, () => [
|
|
112
|
+
_createElementVNode("div", _hoisted_2, [
|
|
113
|
+
_createElementVNode("div", _hoisted_3, _toDisplayString(item.label), 1 /* TEXT */),
|
|
114
|
+
_createElementVNode("div", _hoisted_4, _toDisplayString(item.describe), 1 /* TEXT */)
|
|
115
|
+
])
|
|
116
|
+
])
|
|
117
|
+
], 10 /* CLASS, PROPS */, _hoisted_1));
|
|
118
|
+
}), 256 /* UNKEYED_FRAGMENT */))
|
|
119
|
+
], 4 /* STYLE */));
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* Analyzed bindings: {
|
|
2
|
+
"value": "props",
|
|
3
|
+
"options": "props",
|
|
4
|
+
"multiple": "props",
|
|
5
|
+
"disabled": "props",
|
|
6
|
+
"class": "props",
|
|
7
|
+
"style": "props",
|
|
8
|
+
"computed": "setup-const",
|
|
9
|
+
"CSSProperties": "setup-const",
|
|
10
|
+
"PropType": "setup-const",
|
|
11
|
+
"ref": "setup-const",
|
|
12
|
+
"watch": "setup-const",
|
|
13
|
+
"isArray": "setup-maybe-ref",
|
|
14
|
+
"props": "setup-reactive-const",
|
|
15
|
+
"emit": "setup-const",
|
|
16
|
+
"myValue": "setup-ref",
|
|
17
|
+
"optionsMap": "setup-ref",
|
|
18
|
+
"_options": "setup-ref",
|
|
19
|
+
"selected": "setup-const"
|
|
20
|
+
} */
|
|
21
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
22
|
+
import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from "vue";
|
|
23
|
+
const _hoisted_1 = ["onClick"];
|
|
24
|
+
import { computed, ref, watch } from 'vue';
|
|
25
|
+
import { isArray } from '@jetlinks-web/utils';
|
|
26
|
+
const __sfc_main__ = _defineComponent({
|
|
27
|
+
props: {
|
|
28
|
+
value: {
|
|
29
|
+
type: [String, Array],
|
|
30
|
+
default: undefined,
|
|
31
|
+
},
|
|
32
|
+
options: {
|
|
33
|
+
type: Array,
|
|
34
|
+
default: () => [],
|
|
35
|
+
},
|
|
36
|
+
multiple: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
class: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: undefined,
|
|
47
|
+
},
|
|
48
|
+
style: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => ({}),
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
emits: ['update:value', 'change', 'select'],
|
|
54
|
+
setup(__props, { emit: __emit }) {
|
|
55
|
+
const props = __props;
|
|
56
|
+
const emit = __emit;
|
|
57
|
+
const myValue = ref();
|
|
58
|
+
const optionsMap = ref(new Map());
|
|
59
|
+
const _options = computed(() => {
|
|
60
|
+
props.options.forEach((item) => {
|
|
61
|
+
if (props.disabled) {
|
|
62
|
+
item.display = props.disabled;
|
|
63
|
+
}
|
|
64
|
+
optionsMap.value.set(item.value, item);
|
|
65
|
+
});
|
|
66
|
+
return props.options;
|
|
67
|
+
});
|
|
68
|
+
watch(() => props.value, () => {
|
|
69
|
+
if (props.value) {
|
|
70
|
+
myValue.value = isArray(props.value) ? props.value : [props.value];
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
myValue.value = [];
|
|
74
|
+
}
|
|
75
|
+
}, { immediate: true, deep: true });
|
|
76
|
+
const selected = (key, disabled) => {
|
|
77
|
+
if (disabled)
|
|
78
|
+
return;
|
|
79
|
+
const values = new Set(myValue.value);
|
|
80
|
+
if (values.has(key)) {
|
|
81
|
+
values.delete(key);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (!props.multiple) {
|
|
85
|
+
values.clear();
|
|
86
|
+
}
|
|
87
|
+
values.add(key);
|
|
88
|
+
}
|
|
89
|
+
myValue.value = [...values.values()];
|
|
90
|
+
const optionsItems = myValue.value.map((_key) => {
|
|
91
|
+
return optionsMap.value.get(_key);
|
|
92
|
+
});
|
|
93
|
+
const _value = props.multiple ? myValue.value : myValue.value[0];
|
|
94
|
+
emit('update:value', _value);
|
|
95
|
+
emit('change', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
96
|
+
emit('select', _value, props.multiple ? optionsItems : optionsItems[0]);
|
|
97
|
+
};
|
|
98
|
+
return (_ctx, _cache) => {
|
|
99
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
100
|
+
class: _normalizeClass(['j-check-button', props.class]),
|
|
101
|
+
style: _normalizeStyle(__props.style)
|
|
102
|
+
}, [
|
|
103
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_options.value, (item) => {
|
|
104
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
105
|
+
key: item.value,
|
|
106
|
+
class: _normalizeClass([
|
|
107
|
+
'j-check-button-item',
|
|
108
|
+
myValue.value.includes(item.value) ? 'selected' : '',
|
|
109
|
+
item.disabled ? 'disabled' : '',
|
|
110
|
+
]),
|
|
111
|
+
onClick: () => {
|
|
112
|
+
selected(item.value, item.disabled);
|
|
113
|
+
}
|
|
114
|
+
}, _toDisplayString(item.label), 11 /* TEXT, CLASS, PROPS */, _hoisted_1));
|
|
115
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
116
|
+
], 6 /* CLASS, STYLE */));
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.j-check-button {
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 16px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
.j-check-button .j-check-button-item {
|
|
11
|
+
flex: 1;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
padding: 8px;
|
|
14
|
+
border-radius: 6px;
|
|
15
|
+
background-color: #f2f3f5;
|
|
16
|
+
transition: all 0.3s;
|
|
17
|
+
color: #333;
|
|
18
|
+
text-align: center;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
.j-check-button .j-check-button-item:hover {
|
|
22
|
+
background-color: #315EFB;
|
|
23
|
+
opacity: 0.85;
|
|
24
|
+
color: #fff;
|
|
25
|
+
}
|
|
26
|
+
.j-check-button .j-check-button-item.selected {
|
|
27
|
+
background-color: #315EFB;
|
|
28
|
+
color: #fff;
|
|
29
|
+
}
|
|
30
|
+
.j-check-button .j-check-button-item.disabled {
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
color: #00000060;
|
|
33
|
+
}
|
|
34
|
+
.j-check-button .j-check-button-item.disabled:hover {
|
|
35
|
+
background-color: #f2f3f5;
|
|
36
|
+
color: #00000060;
|
|
37
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import 'ant-design-vue/es/style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
.j-check-button {
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
width: 100%;
|
|
7
|
+
|
|
8
|
+
.j-check-button-item {
|
|
9
|
+
flex: 1;
|
|
10
|
+
min-width: 0;
|
|
11
|
+
padding: 8px;
|
|
12
|
+
border-radius: @border-radius-base;
|
|
13
|
+
background-color: #f2f3f5;
|
|
14
|
+
transition: all 0.3s;
|
|
15
|
+
color: #333;
|
|
16
|
+
text-align: center;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
background-color: @primary-color;
|
|
21
|
+
opacity: 0.85;
|
|
22
|
+
color: #fff;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.selected {
|
|
26
|
+
background-color: @primary-color;
|
|
27
|
+
color: #fff;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.disabled {
|
|
31
|
+
cursor: not-allowed;
|
|
32
|
+
color: #00000060;
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
background-color: #f2f3f5;
|
|
36
|
+
color: #00000060;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { configProviderProps } from 'ant-design-vue/es/config-provider/context';
|
|
3
|
+
export var configProps = function configProps() {
|
|
4
|
+
return _objectSpread(_objectSpread({}, configProviderProps()), {}, {
|
|
5
|
+
IconConfig: {
|
|
6
|
+
type: Object
|
|
7
|
+
},
|
|
8
|
+
MapConfig: {
|
|
9
|
+
type: Object
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import { defineComponent, provide, reactive, h } from 'vue';
|
|
4
|
+
import { configProps } from './context';
|
|
5
|
+
import { ComponentsEnum, MAPConfig } from '@jetlinks-web/constants';
|
|
6
|
+
import { ConfigProvider } from 'ant-design-vue';
|
|
7
|
+
import { omit } from 'lodash-es';
|
|
8
|
+
import Empty from '../Empty';
|
|
9
|
+
var JConfigProvider = defineComponent({
|
|
10
|
+
name: 'JConfigProvider',
|
|
11
|
+
inheritAttrs: false,
|
|
12
|
+
props: _objectSpread({}, configProps()),
|
|
13
|
+
setup: function setup(props, _ref) {
|
|
14
|
+
var slots = _ref.slots;
|
|
15
|
+
var _iconConfig = reactive(props.IconConfig || {});
|
|
16
|
+
var _mapConfig = reactive(props.MapConfig || {});
|
|
17
|
+
provide(ComponentsEnum.Icon, _iconConfig); // 全局Icon 配置
|
|
18
|
+
provide(MAPConfig, _mapConfig); // 全局地图配置
|
|
19
|
+
return function () {
|
|
20
|
+
return h(ConfigProvider, _objectSpread({}, omit(props, ['IconConfig', 'MapConfig'])), {
|
|
21
|
+
default: slots.default,
|
|
22
|
+
renderEmpty: function renderEmpty() {
|
|
23
|
+
var _slots$renderEmpty;
|
|
24
|
+
return ((_slots$renderEmpty = slots.renderEmpty) === null || _slots$renderEmpty === void 0 ? void 0 : _slots$renderEmpty.call(slots)) || _createVNode(Empty, null, null);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
JConfigProvider.config = ConfigProvider.config;
|
|
31
|
+
export default JConfigProvider;
|