@jetlinks-web/components 2.0.2-2 → 2.0.2-4
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 +124 -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 +121 -0
- package/es/CheckButton/index.js +2 -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 +189 -0
- package/es/Ellipsis/index.js +2 -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 +43 -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 +255 -0
- package/es/ProLayout/Basic/Header.js +93 -0
- package/es/ProLayout/PageContainer/index.js +318 -0
- package/es/ProLayout/PageContainer/typings.js +1 -0
- package/es/ProLayout/RouteContext.js +22 -0
- package/es/ProLayout/SiderMenu/BaseMenu.js +262 -0
- package/es/ProLayout/SiderMenu/SiderMenu.js +258 -0
- package/es/ProLayout/SiderMenu/index.js +2 -0
- package/es/ProLayout/SiderMenu/typings.js +1 -0
- package/es/ProLayout/TopHeader/index.js +155 -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 +4 -4
- 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 +406 -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/es/Scrollbar/Bar.js +114 -0
- package/es/Scrollbar/Scrollbar.js +100 -0
- package/es/Scrollbar/Thumb.js +10 -0
- package/es/Scrollbar/constants.js +1 -0
- package/es/Scrollbar/index.js +2 -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/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 +0 -2
- package/lib/AMap/Map.js +124 -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 +121 -0
- package/lib/CheckButton/index.js +9 -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 +189 -0
- package/lib/Ellipsis/index.js +9 -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 +264 -0
- package/lib/ProLayout/Basic/BasicLayout.less +66 -0
- package/lib/ProLayout/Basic/Header.js +99 -0
- package/lib/ProLayout/Basic/Header.less +8 -0
- package/lib/ProLayout/PageContainer/index.js +323 -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 +268 -0
- package/lib/ProLayout/SiderMenu/SiderMenu.js +267 -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 +161 -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 +412 -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/{src/Scrollbar/scrollbar.ts → lib/Scrollbar/Scrollbar.js} +106 -108
- package/lib/Scrollbar/Thumb.js +16 -0
- package/lib/Scrollbar/constants.js +7 -0
- package/lib/Scrollbar/index.js +9 -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/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 +1 -0
- package/lib/style/index.js +4 -0
- package/lib/style/variable.css +0 -0
- package/lib/style/variable.less +2 -0
- package/package.json +121 -12
- 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 -40
- 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 -395
- 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/{src → es}/ProTable/style/index.less +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
|
+
const op = ops[i];
|
|
3
|
+
const fn = ops[i + 1];
|
|
4
|
+
i += 2;
|
|
5
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
9
|
+
lastAccessLHS = value;
|
|
10
|
+
value = fn(value);
|
|
11
|
+
}
|
|
12
|
+
else if (op === 'call' || op === 'optionalCall') {
|
|
13
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
14
|
+
lastAccessLHS = undefined;
|
|
15
|
+
}
|
|
16
|
+
} return value; }
|
|
17
|
+
/* Analyzed bindings: {
|
|
18
|
+
"modelValue": "props",
|
|
19
|
+
"itemType": "props",
|
|
20
|
+
"mode": "props",
|
|
21
|
+
"placeholder": "props",
|
|
22
|
+
"options": "props",
|
|
23
|
+
"style": "props",
|
|
24
|
+
"class": "props",
|
|
25
|
+
"valueFormat": "props",
|
|
26
|
+
"action": "props",
|
|
27
|
+
"headers": "props",
|
|
28
|
+
"CSSProperties": "setup-const",
|
|
29
|
+
"PropType": "setup-const",
|
|
30
|
+
"ref": "setup-const",
|
|
31
|
+
"watch": "setup-const",
|
|
32
|
+
"componentsType": "setup-maybe-ref",
|
|
33
|
+
"MonacoEditor": "setup-maybe-ref",
|
|
34
|
+
"Select": "setup-maybe-ref",
|
|
35
|
+
"DatePicker": "setup-maybe-ref",
|
|
36
|
+
"TimePicker": "setup-maybe-ref",
|
|
37
|
+
"Input": "setup-maybe-ref",
|
|
38
|
+
"InputNumber": "setup-maybe-ref",
|
|
39
|
+
"InputPassword": "setup-maybe-ref",
|
|
40
|
+
"Upload": "setup-maybe-ref",
|
|
41
|
+
"Modal": "setup-maybe-ref",
|
|
42
|
+
"emit": "setup-const",
|
|
43
|
+
"props": "setup-reactive-const",
|
|
44
|
+
"typeMap": "setup-maybe-ref",
|
|
45
|
+
"myValue": "setup-ref",
|
|
46
|
+
"modalVisible": "setup-ref",
|
|
47
|
+
"objectValue": "setup-ref",
|
|
48
|
+
"handleItemModalSubmit": "setup-const",
|
|
49
|
+
"onChange": "setup-const",
|
|
50
|
+
"handleFileChange": "setup-const"
|
|
51
|
+
} */
|
|
52
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
53
|
+
import { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock } from "vue";
|
|
54
|
+
const _hoisted_1 = { class: "value-item-warp" };
|
|
55
|
+
const _hoisted_2 = { style: { "width": "100%", "height": "300px" } };
|
|
56
|
+
import { ref, watch } from 'vue';
|
|
57
|
+
import { componentsType } from './util';
|
|
58
|
+
import { MonacoEditor } from '../../';
|
|
59
|
+
import { Select, DatePicker, TimePicker, Input, InputNumber, InputPassword, Upload, Modal, } from 'ant-design-vue';
|
|
60
|
+
const __sfc_main__ = _defineComponent({
|
|
61
|
+
props: {
|
|
62
|
+
// 组件双向绑定的值
|
|
63
|
+
modelValue: {
|
|
64
|
+
type: [Number, String],
|
|
65
|
+
default: '',
|
|
66
|
+
},
|
|
67
|
+
// 组件类型
|
|
68
|
+
itemType: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: () => 'string',
|
|
71
|
+
},
|
|
72
|
+
// 多选框
|
|
73
|
+
mode: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: '',
|
|
76
|
+
},
|
|
77
|
+
placeholder: String,
|
|
78
|
+
options: Array,
|
|
79
|
+
style: Object,
|
|
80
|
+
class: String,
|
|
81
|
+
valueFormat: String,
|
|
82
|
+
action: [String, Promise],
|
|
83
|
+
headers: Object,
|
|
84
|
+
},
|
|
85
|
+
emits: ["update:modelValue", "change"],
|
|
86
|
+
setup(__props, { emit: __emit }) {
|
|
87
|
+
const emit = __emit;
|
|
88
|
+
const props = __props;
|
|
89
|
+
const typeMap = new Map(Object.entries(componentsType));
|
|
90
|
+
const myValue = ref(undefined);
|
|
91
|
+
const modalVisible = ref(false);
|
|
92
|
+
const objectValue = ref('');
|
|
93
|
+
const handleItemModalSubmit = () => {
|
|
94
|
+
myValue.value = objectValue.value.replace(/[\r\n]\s*/g, '');
|
|
95
|
+
modalVisible.value = false;
|
|
96
|
+
emit('update:modelValue', objectValue.value);
|
|
97
|
+
emit('change', objectValue.value);
|
|
98
|
+
};
|
|
99
|
+
const onChange = (e) => {
|
|
100
|
+
emit('update:modelValue', myValue.value);
|
|
101
|
+
emit('change', e);
|
|
102
|
+
};
|
|
103
|
+
const handleFileChange = (info) => {
|
|
104
|
+
if (info.file.status === 'done') {
|
|
105
|
+
const url = _optionalChain([info, 'access', _2 => _2.file, 'access', _3 => _3.response, 'optionalAccess', _4 => _4.result]);
|
|
106
|
+
myValue.value = url;
|
|
107
|
+
emit('update:modelValue', url);
|
|
108
|
+
emit('change', url);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
watch(() => props.modelValue, () => {
|
|
112
|
+
myValue.value = props.modelValue;
|
|
113
|
+
if (props.itemType === 'object') {
|
|
114
|
+
objectValue.value = props.modelValue;
|
|
115
|
+
}
|
|
116
|
+
}, { immediate: true });
|
|
117
|
+
return (_ctx, _cache) => {
|
|
118
|
+
const _component_AIcon = _resolveComponent("AIcon");
|
|
119
|
+
return (_openBlock(), _createElementBlock("div", _hoisted_1, [
|
|
120
|
+
(_unref(typeMap).get(__props.itemType) === 'select')
|
|
121
|
+
? (_openBlock(), _createBlock(_unref(Select), _mergeProps({
|
|
122
|
+
key: 0,
|
|
123
|
+
value: myValue.value,
|
|
124
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((myValue).value = $event)),
|
|
125
|
+
allowClear: ""
|
|
126
|
+
}, props, {
|
|
127
|
+
onChange: _cache[1] || (_cache[1] = (_, options) => onChange(options))
|
|
128
|
+
}), null, 16 /* FULL_PROPS */, ["value"]))
|
|
129
|
+
: (_unref(typeMap).get(__props.itemType) === 'date')
|
|
130
|
+
? (_openBlock(), _createBlock(_unref(DatePicker), _mergeProps({
|
|
131
|
+
key: 1,
|
|
132
|
+
value: myValue.value,
|
|
133
|
+
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => ((myValue).value = $event)),
|
|
134
|
+
valueFormat: __props.valueFormat || 'YYYY-MM-DD HH:mm:ss',
|
|
135
|
+
allowClear: "",
|
|
136
|
+
showTime: ""
|
|
137
|
+
}, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value", "valueFormat"]))
|
|
138
|
+
: (_unref(typeMap).get(__props.itemType) === 'time')
|
|
139
|
+
? (_openBlock(), _createBlock(_unref(TimePicker), _mergeProps({
|
|
140
|
+
key: 2,
|
|
141
|
+
value: myValue.value,
|
|
142
|
+
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => ((myValue).value = $event)),
|
|
143
|
+
valueFormat: __props.valueFormat || 'HH:mm:ss',
|
|
144
|
+
allowClear: ""
|
|
145
|
+
}, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value", "valueFormat"]))
|
|
146
|
+
: (_unref(typeMap).get(__props.itemType) === 'inputNumber')
|
|
147
|
+
? (_openBlock(), _createBlock(_unref(InputNumber), _mergeProps({
|
|
148
|
+
key: 3,
|
|
149
|
+
value: myValue.value,
|
|
150
|
+
"onUpdate:value": _cache[4] || (_cache[4] = ($event) => ((myValue).value = $event)),
|
|
151
|
+
allowClear: ""
|
|
152
|
+
}, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value"]))
|
|
153
|
+
: (_unref(typeMap).get(__props.itemType) === 'object')
|
|
154
|
+
? (_openBlock(), _createBlock(_unref(Input), _mergeProps({
|
|
155
|
+
key: 4,
|
|
156
|
+
value: myValue.value,
|
|
157
|
+
"onUpdate:value": _cache[6] || (_cache[6] = ($event) => ((myValue).value = $event)),
|
|
158
|
+
allowClear: ""
|
|
159
|
+
}, props, { onChange: onChange }), {
|
|
160
|
+
addonAfter: _withCtx(() => [
|
|
161
|
+
_createVNode(_component_AIcon, {
|
|
162
|
+
type: "FormOutlined",
|
|
163
|
+
onClick: _cache[5] || (_cache[5] = ($event) => (modalVisible.value = true))
|
|
164
|
+
})
|
|
165
|
+
]),
|
|
166
|
+
_: 1 /* STABLE */
|
|
167
|
+
}, 16 /* FULL_PROPS */, ["value"]))
|
|
168
|
+
: (_unref(typeMap).get(__props.itemType) === 'file')
|
|
169
|
+
? (_openBlock(), _createBlock(_unref(Input), _mergeProps({
|
|
170
|
+
key: 5,
|
|
171
|
+
value: myValue.value,
|
|
172
|
+
"onUpdate:value": _cache[7] || (_cache[7] = ($event) => ((myValue).value = $event)),
|
|
173
|
+
allowClear: "",
|
|
174
|
+
placeholder: "请输入链接"
|
|
175
|
+
}, props, { onChange: onChange }), {
|
|
176
|
+
addonAfter: _withCtx(() => [
|
|
177
|
+
_createVNode(_unref(Upload), {
|
|
178
|
+
action: __props.action,
|
|
179
|
+
headers: __props.headers,
|
|
180
|
+
showUploadList: false,
|
|
181
|
+
name: "file",
|
|
182
|
+
onChange: handleFileChange
|
|
183
|
+
}, {
|
|
184
|
+
default: _withCtx(() => [
|
|
185
|
+
_createVNode(_component_AIcon, { type: "UploadOutlined" })
|
|
186
|
+
]),
|
|
187
|
+
_: 1 /* STABLE */
|
|
188
|
+
}, 8 /* PROPS */, ["action", "headers"])
|
|
189
|
+
]),
|
|
190
|
+
_: 1 /* STABLE */
|
|
191
|
+
}, 16 /* FULL_PROPS */, ["value"]))
|
|
192
|
+
: (_unref(typeMap).get(__props.itemType) === 'password')
|
|
193
|
+
? (_openBlock(), _createBlock(_unref(InputPassword), _mergeProps({
|
|
194
|
+
key: 6,
|
|
195
|
+
value: myValue.value,
|
|
196
|
+
"onUpdate:value": _cache[8] || (_cache[8] = ($event) => ((myValue).value = $event)),
|
|
197
|
+
allowClear: "",
|
|
198
|
+
type: "password"
|
|
199
|
+
}, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value"]))
|
|
200
|
+
: (_openBlock(), _createBlock(_unref(Input), _mergeProps({
|
|
201
|
+
key: 7,
|
|
202
|
+
value: myValue.value,
|
|
203
|
+
"onUpdate:value": _cache[9] || (_cache[9] = ($event) => ((myValue).value = $event)),
|
|
204
|
+
allowClear: "",
|
|
205
|
+
type: "text"
|
|
206
|
+
}, props, { onChange: onChange }), null, 16 /* FULL_PROPS */, ["value"])),
|
|
207
|
+
_createCommentVNode(" 代码编辑器弹窗 "),
|
|
208
|
+
_createVNode(_unref(Modal), {
|
|
209
|
+
visible: modalVisible.value,
|
|
210
|
+
"onUpdate:visible": _cache[11] || (_cache[11] = ($event) => ((modalVisible).value = $event)),
|
|
211
|
+
zIndex: 1100,
|
|
212
|
+
"cancel-text": "取消",
|
|
213
|
+
"ok-text": "确认",
|
|
214
|
+
title: "编辑",
|
|
215
|
+
width: "700px",
|
|
216
|
+
onCancel: _cache[12] || (_cache[12] = ($event) => (modalVisible.value = false)),
|
|
217
|
+
onOk: handleItemModalSubmit
|
|
218
|
+
}, {
|
|
219
|
+
default: _withCtx(() => [
|
|
220
|
+
_createElementVNode("div", _hoisted_2, [
|
|
221
|
+
_createVNode(_unref(MonacoEditor), {
|
|
222
|
+
modelValue: objectValue.value,
|
|
223
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => ((objectValue).value = $event))
|
|
224
|
+
}, null, 8 /* PROPS */, ["modelValue"])
|
|
225
|
+
])
|
|
226
|
+
]),
|
|
227
|
+
_: 1 /* STABLE */
|
|
228
|
+
}, 8 /* PROPS */, ["visible"])
|
|
229
|
+
]));
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export var componentsType = {
|
|
2
|
+
int: 'inputNumber',
|
|
3
|
+
long: 'inputNumber',
|
|
4
|
+
float: 'inputNumber',
|
|
5
|
+
double: 'inputNumber',
|
|
6
|
+
string: 'input',
|
|
7
|
+
array: 'input',
|
|
8
|
+
password: 'password',
|
|
9
|
+
enum: 'select',
|
|
10
|
+
boolean: 'select',
|
|
11
|
+
date: 'date',
|
|
12
|
+
time: 'time',
|
|
13
|
+
object: 'object',
|
|
14
|
+
geoPoint: 'geoPoint',
|
|
15
|
+
file: 'file'
|
|
16
|
+
};
|
package/es/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import InitAMap from './AMap';
|
|
2
|
+
import BadgeStatus from './BadgeStatus';
|
|
3
|
+
import CardSelect from './CardSelect';
|
|
4
|
+
import CheckButton from './CheckButton';
|
|
5
|
+
import ConfigProvider from './ConfigProvider';
|
|
6
|
+
import Echarts from './Echarts';
|
|
7
|
+
import Ellipsis from './Ellipsis';
|
|
8
|
+
import Empty from './Empty';
|
|
9
|
+
import FullPage from './FullPage';
|
|
10
|
+
import AIcon from './Icon';
|
|
11
|
+
import MonacoEditor from './MonacoEditor';
|
|
12
|
+
import PermissionButton from './PermissionButton';
|
|
13
|
+
import ProLayout, { PageContainer } from './ProLayout';
|
|
14
|
+
import ProTable from './ProTable';
|
|
15
|
+
import Scrollbar from './Scrollbar';
|
|
16
|
+
import Search, { AdvancedSearch } from './Search';
|
|
17
|
+
import ValueItem from './ValueItem';
|
|
18
|
+
export * from './style';
|
|
19
|
+
export { BadgeStatus, CardSelect, CheckButton, Echarts, Ellipsis, Empty, FullPage, AIcon, MonacoEditor, PermissionButton, ValueItem, ProTable, Scrollbar, Search, AdvancedSearch, ConfigProvider };
|
|
20
|
+
export default {
|
|
21
|
+
install: function install(app) {
|
|
22
|
+
app.component('JAMap', InitAMap).component('JBadgeStatus', BadgeStatus).component('JCardSelect', CardSelect).component('JCheckButton', CheckButton).component('JConfigProvider', ConfigProvider).component('JEcharts', Echarts).component('JEllipsis', Ellipsis).component('JEmpty', Empty).component('JFullPage', FullPage).component('AIcon', AIcon).component('JMonacoEditor', MonacoEditor).component('JPermissionButton', PermissionButton).component('JProLayout', ProLayout).component('JPageContainer', PageContainer).component('JProTable', ProTable).component('JScrollbar', Scrollbar).component('JSearch', Search).component('JAdvancedSearch', AdvancedSearch).component('JValueItem', ValueItem);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
File without changes
|
package/lib/AMap/Map.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
"initAMapApiLoader": "setup-maybe-ref",
|
|
13
|
+
"ElAmap": "setup-maybe-ref",
|
|
14
|
+
"getAMapUiPromise": "setup-maybe-ref",
|
|
15
|
+
"MapProps": "setup-maybe-ref",
|
|
16
|
+
"MAPConfig": "setup-maybe-ref",
|
|
17
|
+
"Empty": "setup-maybe-ref",
|
|
18
|
+
"emit": "setup-const",
|
|
19
|
+
"props": "setup-reactive-const",
|
|
20
|
+
"config": "setup-maybe-ref",
|
|
21
|
+
"_mapStyle": "setup-ref",
|
|
22
|
+
"hasAMapKey": "setup-ref",
|
|
23
|
+
"uiLoading": "setup-ref",
|
|
24
|
+
"map": "setup-ref",
|
|
25
|
+
"isOpenUi": "setup-ref",
|
|
26
|
+
"getAMapUI": "setup-const",
|
|
27
|
+
"initMap": "setup-const"
|
|
28
|
+
} */
|
|
29
|
+
import { defineComponent as _defineComponent } from 'vue';
|
|
30
|
+
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";
|
|
31
|
+
import { ref, computed } from 'vue';
|
|
32
|
+
import { initAMapApiLoader, ElAmap } from '@vuemap/vue-amap';
|
|
33
|
+
import { getAMapUiPromise } from '@jetlinks-web/utils';
|
|
34
|
+
import { MapProps } from './util';
|
|
35
|
+
import { MAPConfig } from "@jetlinks-web/constants";
|
|
36
|
+
import Empty from '../Empty';
|
|
37
|
+
import '@vuemap/vue-amap/dist/style.css';
|
|
38
|
+
const __sfc_main__ = _defineComponent({
|
|
39
|
+
props: {
|
|
40
|
+
...MapProps(),
|
|
41
|
+
style: Object,
|
|
42
|
+
class: String,
|
|
43
|
+
AMapUI: [String, Boolean],
|
|
44
|
+
center: Array,
|
|
45
|
+
plugins: Array,
|
|
46
|
+
zooms: {
|
|
47
|
+
type: Array,
|
|
48
|
+
default: [3, 20]
|
|
49
|
+
},
|
|
50
|
+
JSKey: String,
|
|
51
|
+
WebKey: String,
|
|
52
|
+
},
|
|
53
|
+
emits: [
|
|
54
|
+
'initMap',
|
|
55
|
+
],
|
|
56
|
+
setup(__props, { emit: __emit }) {
|
|
57
|
+
const emit = __emit;
|
|
58
|
+
const props = __props;
|
|
59
|
+
const config = inject(MAPConfig);
|
|
60
|
+
const _mapStyle = computed(() => {
|
|
61
|
+
if (props.mapStyle) {
|
|
62
|
+
return `amap://styles/${props.mapStyle}`;
|
|
63
|
+
}
|
|
64
|
+
if (config.mapStyle) {
|
|
65
|
+
return config.mapStyle;
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
});
|
|
69
|
+
const hasAMapKey = computed(() => {
|
|
70
|
+
return !!(props.JSKey || config.JSKey);
|
|
71
|
+
});
|
|
72
|
+
initAMapApiLoader({
|
|
73
|
+
key: props.JSKey || config.JSKey || '',
|
|
74
|
+
securityJsCode: props.WebKey || config.WebKey,
|
|
75
|
+
plugins: props.plugins
|
|
76
|
+
});
|
|
77
|
+
const uiLoading = ref(false);
|
|
78
|
+
const map = ref(null);
|
|
79
|
+
const isOpenUi = computed(() => {
|
|
80
|
+
return 'AMapUI' in props || props.AMapUI;
|
|
81
|
+
});
|
|
82
|
+
const getAMapUI = () => {
|
|
83
|
+
const version = typeof props.AMapUI === 'string' ? props.AMapUI : '1.1';
|
|
84
|
+
getAMapUiPromise(version).then(() => {
|
|
85
|
+
uiLoading.value = true;
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
const initMap = (e) => {
|
|
89
|
+
map.value = e;
|
|
90
|
+
emit('initMap', e);
|
|
91
|
+
if (isOpenUi.value) {
|
|
92
|
+
getAMapUI();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return (_ctx, _cache) => {
|
|
96
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
97
|
+
style: _normalizeStyle(props.style || { width: '100%', height: '100%' }),
|
|
98
|
+
class: _normalizeClass(props.class)
|
|
99
|
+
}, [
|
|
100
|
+
(hasAMapKey.value)
|
|
101
|
+
? (_openBlock(), _createBlock(_unref(ElAmap), _mergeProps({
|
|
102
|
+
key: 0,
|
|
103
|
+
"map-style": _mapStyle.value
|
|
104
|
+
}, {
|
|
105
|
+
...props,
|
|
106
|
+
..._ctx.$attrs
|
|
107
|
+
}, { onInit: initMap }), {
|
|
108
|
+
default: _withCtx(() => [
|
|
109
|
+
(uiLoading.value)
|
|
110
|
+
? _renderSlot(_ctx.$slots, "default", { key: 0 })
|
|
111
|
+
: _renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
112
|
+
]),
|
|
113
|
+
_: 3 /* FORWARDED */
|
|
114
|
+
}, 16 /* FULL_PROPS */, ["map-style"]))
|
|
115
|
+
: (_openBlock(), _createBlock(_unref(Empty), {
|
|
116
|
+
key: 1,
|
|
117
|
+
description: "请配置高德地图key",
|
|
118
|
+
style: { "padding": "20%" }
|
|
119
|
+
}))
|
|
120
|
+
], 6 /* CLASS, STYLE */));
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
export default __sfc_main__;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _Map = _interopRequireDefault(require("./Map.js"));
|
|
9
|
+
var _default = exports.default = _Map.default;
|
package/lib/AMap/util.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MapProps = void 0;
|
|
7
|
+
var MapProps = exports.MapProps = function MapProps() {
|
|
8
|
+
return {
|
|
9
|
+
// 响应式
|
|
10
|
+
center: Array,
|
|
11
|
+
labelzIndex: Number,
|
|
12
|
+
lang: String,
|
|
13
|
+
mapStyle: String,
|
|
14
|
+
// 静态属性
|
|
15
|
+
vid: String,
|
|
16
|
+
amapManager: Object,
|
|
17
|
+
defaultCursor: String,
|
|
18
|
+
animateEnable: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true
|
|
21
|
+
},
|
|
22
|
+
isHotspot: Boolean,
|
|
23
|
+
rotateEnable: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
26
|
+
},
|
|
27
|
+
resizeEnable: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: true
|
|
30
|
+
},
|
|
31
|
+
showIndoorMap: Boolean,
|
|
32
|
+
expandZoomRange: Boolean,
|
|
33
|
+
dragEnable: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
zoomEnable: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
doubleClickZoom: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: true
|
|
44
|
+
},
|
|
45
|
+
keyboardEnable: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true
|
|
48
|
+
},
|
|
49
|
+
jogEnable: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: true
|
|
52
|
+
},
|
|
53
|
+
scrollWheel: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: true
|
|
56
|
+
},
|
|
57
|
+
touchZoom: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: true
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -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,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getHexColor = exports.default = void 0;
|
|
7
|
+
var colorMap = {
|
|
8
|
+
'success': '36, 178, 118',
|
|
9
|
+
'warning': '255, 144, 0',
|
|
10
|
+
'error': '229, 0, 18',
|
|
11
|
+
'processing': '9, 46, 231',
|
|
12
|
+
'default': '102, 102, 102'
|
|
13
|
+
};
|
|
14
|
+
var getHexColor = exports.getHexColor = function getHexColor(code, statusNames) {
|
|
15
|
+
var pe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.1;
|
|
16
|
+
if (!code) {
|
|
17
|
+
return "rgba(102, 102, 102, ".concat(pe, ")");
|
|
18
|
+
}
|
|
19
|
+
if (colorMap[code]) {
|
|
20
|
+
return "rgba(".concat(colorMap[code], ", ").concat(pe, ")");
|
|
21
|
+
}
|
|
22
|
+
if (Object.keys(statusNames).length) {
|
|
23
|
+
return statusNames[code];
|
|
24
|
+
}
|
|
25
|
+
return;
|
|
26
|
+
};
|
|
27
|
+
var _default = exports.default = colorMap;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
var _exportNames = {};
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _Badge = _interopRequireDefault(require("./Badge.js"));
|
|
10
|
+
var _color = require("./color");
|
|
11
|
+
Object.keys(_color).forEach(function (key) {
|
|
12
|
+
if (key === "default" || key === "__esModule") return;
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
14
|
+
if (key in exports && exports[key] === _color[key]) return;
|
|
15
|
+
Object.defineProperty(exports, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _color[key];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
var _default = exports.default = _Badge.default;
|