bm-admin-ui 1.0.82-alpha → 1.0.83-alpha
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/components/attachment/index.js +273 -0
- package/es/components/breadcrumb/index.js +158 -0
- package/es/components/button/index.js +49 -0
- package/es/components/edit-form/index.js +1186 -0
- package/es/components/editor/index.js +12554 -0
- package/es/components/feedback/index.js +295 -0
- package/es/components/float-table/index.js +3511 -0
- package/es/components/flow-designer/index.js +1317 -0
- package/es/components/form-create/index.js +20978 -0
- package/es/components/form-designer/index.js +4514 -0
- package/es/components/index.js +19 -0
- package/es/components/input-tags-display/index.js +226 -0
- package/es/components/over-tooltips/index.js +133 -0
- package/es/components/search-filter/index.js +441 -0
- package/es/components/select-all/index.js +165 -0
- package/es/components/shops-filter/index.js +453 -0
- package/es/components/staffs-selector/index.js +728 -0
- package/es/components/timeline/index.js +168 -0
- package/es/components/upload/index.js +909 -0
- package/es/components/videoView/index.js +100 -0
- package/lib/components/attachment/index.js +278 -0
- package/lib/components/breadcrumb/index.js +168 -0
- package/lib/components/button/index.js +58 -0
- package/lib/components/edit-form/index.js +1195 -0
- package/lib/components/editor/index.js +12559 -0
- package/lib/components/feedback/index.js +309 -0
- package/lib/components/float-table/index.js +3516 -0
- package/lib/components/flow-designer/index.js +1329 -0
- package/lib/components/form-create/index.js +20990 -0
- package/lib/components/form-designer/index.js +4525 -0
- package/lib/components/index.js +140 -0
- package/lib/components/input-tags-display/index.js +237 -0
- package/lib/components/over-tooltips/index.js +138 -0
- package/lib/components/search-filter/index.js +451 -0
- package/lib/components/select-all/index.js +174 -0
- package/lib/components/shops-filter/index.js +465 -0
- package/lib/components/staffs-selector/index.js +733 -0
- package/lib/components/timeline/index.js +174 -0
- package/lib/components/upload/index.js +914 -0
- package/lib/components/videoView/index.js +105 -0
- package/package.json +1 -1
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { notification, Modal, Button } from 'ant-design-vue';
|
|
2
|
+
import { CheckCircleFilled, ExclamationCircleFilled, CloseCircleFilled, InfoCircleFilled, CheckCircleOutlined, ExclamationCircleOutlined, CloseCircleOutlined, InfoCircleOutlined, CloseOutlined } from '@ant-design/icons-vue';
|
|
3
|
+
import { withInstall } from 'bm-admin-ui/es/utils/with-install';
|
|
4
|
+
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, resolveDynamicComponent, renderSlot, useSlots, resolveComponent, createSlots, createElementVNode, createVNode, createTextVNode, h } from 'vue';
|
|
5
|
+
import AAlert from 'ant-design-vue/lib/alert';
|
|
6
|
+
import AModal$1 from 'ant-design-vue/lib/modal';
|
|
7
|
+
import message from 'ant-design-vue/lib/message';
|
|
8
|
+
|
|
9
|
+
/******************************************************************************
|
|
10
|
+
Copyright (c) Microsoft Corporation.
|
|
11
|
+
|
|
12
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
+
purpose with or without fee is hereby granted.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
+
***************************************************************************** */
|
|
23
|
+
|
|
24
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
25
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
26
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
27
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
28
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
29
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
30
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var _export_sfc = (sfc, props) => {
|
|
35
|
+
const target = sfc.__vccOpts || sfc;
|
|
36
|
+
for (const [key, val] of props) {
|
|
37
|
+
target[key] = val;
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const __default__$1 = {
|
|
43
|
+
name: "BmAlert"
|
|
44
|
+
};
|
|
45
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
46
|
+
...__default__$1,
|
|
47
|
+
props: {
|
|
48
|
+
type: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "info"
|
|
51
|
+
},
|
|
52
|
+
message: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ""
|
|
55
|
+
},
|
|
56
|
+
description: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
setup(__props) {
|
|
62
|
+
const props = __props;
|
|
63
|
+
const getIconCmp = computed(() => {
|
|
64
|
+
if (props.message !== "" && props.description !== "") {
|
|
65
|
+
return {
|
|
66
|
+
success: CheckCircleFilled,
|
|
67
|
+
warning: ExclamationCircleFilled,
|
|
68
|
+
error: CloseCircleFilled,
|
|
69
|
+
info: InfoCircleFilled
|
|
70
|
+
}[props.type || "info"];
|
|
71
|
+
} else {
|
|
72
|
+
return {
|
|
73
|
+
success: CheckCircleOutlined,
|
|
74
|
+
warning: ExclamationCircleOutlined,
|
|
75
|
+
error: CloseCircleOutlined,
|
|
76
|
+
info: InfoCircleOutlined
|
|
77
|
+
}[props.type || "info"];
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return (_ctx, _cache) => {
|
|
81
|
+
return openBlock(), createBlock(unref(AAlert), {
|
|
82
|
+
message: props.message,
|
|
83
|
+
description: props.description,
|
|
84
|
+
type: props.type,
|
|
85
|
+
"show-icon": ""
|
|
86
|
+
}, {
|
|
87
|
+
icon: withCtx(() => [
|
|
88
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(getIconCmp))))
|
|
89
|
+
]),
|
|
90
|
+
default: withCtx(() => [
|
|
91
|
+
renderSlot(_ctx.$slots, "default")
|
|
92
|
+
]),
|
|
93
|
+
_: 3
|
|
94
|
+
}, 8, ["message", "description", "type"]);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var Alert = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "bmAlert.vue"]]);
|
|
99
|
+
|
|
100
|
+
const _hoisted_1 = {
|
|
101
|
+
ref: "modalBody",
|
|
102
|
+
class: "bm-modal-body"
|
|
103
|
+
};
|
|
104
|
+
const __default__ = {
|
|
105
|
+
name: "BmModal"
|
|
106
|
+
};
|
|
107
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
108
|
+
...__default__,
|
|
109
|
+
props: {
|
|
110
|
+
width: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: ""
|
|
113
|
+
},
|
|
114
|
+
visible: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false,
|
|
117
|
+
require: true
|
|
118
|
+
},
|
|
119
|
+
size: {
|
|
120
|
+
type: String,
|
|
121
|
+
default: "small"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
emits: ["close", "ok"],
|
|
125
|
+
setup(__props, { emit }) {
|
|
126
|
+
const props = __props;
|
|
127
|
+
const slots = useSlots();
|
|
128
|
+
const caculWidth = computed(() => {
|
|
129
|
+
if (props.width && props.width !== "")
|
|
130
|
+
return props.width;
|
|
131
|
+
if (props.size === "middle")
|
|
132
|
+
return "640px";
|
|
133
|
+
if (props.size === "large")
|
|
134
|
+
return "900px";
|
|
135
|
+
return "480px";
|
|
136
|
+
});
|
|
137
|
+
function onOkCallback(e) {
|
|
138
|
+
emit("ok", e);
|
|
139
|
+
emit("close", false);
|
|
140
|
+
}
|
|
141
|
+
return (_ctx, _cache) => {
|
|
142
|
+
const _component_a_button = resolveComponent("a-button");
|
|
143
|
+
return openBlock(), createBlock(unref(AModal$1), {
|
|
144
|
+
"wrap-class-name": "bm-modal-dialog",
|
|
145
|
+
width: unref(caculWidth),
|
|
146
|
+
visible: props.visible,
|
|
147
|
+
onChange: _cache[1] || (_cache[1] = (v) => _ctx.$emit("close", v))
|
|
148
|
+
}, createSlots({
|
|
149
|
+
default: withCtx(() => [
|
|
150
|
+
createElementVNode("div", _hoisted_1, [
|
|
151
|
+
renderSlot(_ctx.$slots, "default")
|
|
152
|
+
], 512)
|
|
153
|
+
]),
|
|
154
|
+
_: 2
|
|
155
|
+
}, [
|
|
156
|
+
unref(slots) && unref(slots).title ? {
|
|
157
|
+
name: "title",
|
|
158
|
+
fn: withCtx(() => [
|
|
159
|
+
renderSlot(_ctx.$slots, "title")
|
|
160
|
+
]),
|
|
161
|
+
key: "0"
|
|
162
|
+
} : void 0,
|
|
163
|
+
unref(slots) && unref(slots).footer ? {
|
|
164
|
+
name: "footer",
|
|
165
|
+
fn: withCtx(() => [
|
|
166
|
+
renderSlot(_ctx.$slots, "footer")
|
|
167
|
+
]),
|
|
168
|
+
key: "1"
|
|
169
|
+
} : {
|
|
170
|
+
name: "footer",
|
|
171
|
+
fn: withCtx(() => [
|
|
172
|
+
createVNode(_component_a_button, {
|
|
173
|
+
type: "second",
|
|
174
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
|
|
175
|
+
}, {
|
|
176
|
+
default: withCtx(() => [
|
|
177
|
+
createTextVNode("\u53D6\u6D88")
|
|
178
|
+
]),
|
|
179
|
+
_: 1
|
|
180
|
+
}),
|
|
181
|
+
createVNode(_component_a_button, {
|
|
182
|
+
type: "primary",
|
|
183
|
+
onClick: onOkCallback
|
|
184
|
+
}, {
|
|
185
|
+
default: withCtx(() => [
|
|
186
|
+
createTextVNode("\u786E\u5B9A")
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
})
|
|
190
|
+
]),
|
|
191
|
+
key: "2"
|
|
192
|
+
}
|
|
193
|
+
]), 1032, ["width", "visible"]);
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
var AModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "bmModal.vue"]]);
|
|
198
|
+
|
|
199
|
+
const idGenerator = (function () {
|
|
200
|
+
let id = 0;
|
|
201
|
+
return function () {
|
|
202
|
+
return (Math.random().toString(36) + Number(`${Date.now()}${++id}`).toString(36)).slice(2);
|
|
203
|
+
};
|
|
204
|
+
})();
|
|
205
|
+
var feedbackType;
|
|
206
|
+
(function (feedbackType) {
|
|
207
|
+
feedbackType["SUCCESS"] = "success";
|
|
208
|
+
feedbackType["ERROR"] = "error";
|
|
209
|
+
feedbackType["INFO"] = "info";
|
|
210
|
+
feedbackType["WARNING"] = "warning";
|
|
211
|
+
feedbackType["CONFIRM"] = "confirm";
|
|
212
|
+
feedbackType["WARN"] = "warn";
|
|
213
|
+
})(feedbackType || (feedbackType = {}));
|
|
214
|
+
var feedbackColor;
|
|
215
|
+
(function (feedbackColor) {
|
|
216
|
+
feedbackColor["SUCCESS"] = "#29CC7A";
|
|
217
|
+
feedbackColor["ERROR"] = "#E64C2E";
|
|
218
|
+
feedbackColor["INFO"] = "#2F4EED";
|
|
219
|
+
feedbackColor["WARNING"] = "#FF9019";
|
|
220
|
+
feedbackColor["CONFIRM"] = "#2F4EED";
|
|
221
|
+
feedbackColor["WARN"] = "#FF9019";
|
|
222
|
+
})(feedbackColor || (feedbackColor = {}));
|
|
223
|
+
const feedbackIcon = {
|
|
224
|
+
success: () => h(CheckCircleFilled, { style: `color: ${feedbackColor.SUCCESS}` }),
|
|
225
|
+
error: () => h(CloseCircleFilled, { style: `color: ${feedbackColor.ERROR}` }),
|
|
226
|
+
warning: () => h(ExclamationCircleFilled, { style: `color: ${feedbackColor.WARNING}` }),
|
|
227
|
+
info: () => h(InfoCircleFilled, { style: `color: ${feedbackColor.INFO}` }),
|
|
228
|
+
confirm: () => h(InfoCircleFilled, { style: `color: ${feedbackColor.INFO}` }),
|
|
229
|
+
warn: () => h(ExclamationCircleFilled, { style: `color: ${feedbackColor.WARNING}` }),
|
|
230
|
+
};
|
|
231
|
+
function __createBtn(btnText = '确定', onClick = (() => '点击'), style = '', type = 'primary', size = 'small') {
|
|
232
|
+
return h(Button, {
|
|
233
|
+
type,
|
|
234
|
+
size,
|
|
235
|
+
onClick,
|
|
236
|
+
style,
|
|
237
|
+
}, { default: () => btnText });
|
|
238
|
+
}
|
|
239
|
+
const BmNotification = (config) => {
|
|
240
|
+
const type = config['type'] || feedbackType.INFO;
|
|
241
|
+
let btn = undefined;
|
|
242
|
+
const key = config['key'] || `${type}${Date.now()}`;
|
|
243
|
+
if (config['onConfirm']) {
|
|
244
|
+
btn = __createBtn('确定', (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
245
|
+
e.stopPropagation();
|
|
246
|
+
e.preventDefault();
|
|
247
|
+
yield config['onConfirm']();
|
|
248
|
+
notification.close(key);
|
|
249
|
+
}), 'margin-left: 8px');
|
|
250
|
+
}
|
|
251
|
+
if (config['onCancel']) {
|
|
252
|
+
const cancel = __createBtn('取消', (e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
253
|
+
e.stopPropagation();
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
yield notification.close(key);
|
|
256
|
+
config['onCancel']();
|
|
257
|
+
}), '', 'second');
|
|
258
|
+
btn = (btn ? h('div', {}, [cancel, btn]) : cancel);
|
|
259
|
+
}
|
|
260
|
+
if (btn)
|
|
261
|
+
config['btn'] = btn;
|
|
262
|
+
if ([feedbackType.WARNING, feedbackType.WARN].indexOf(type) !== -1) {
|
|
263
|
+
notification.warning(Object.assign({ key, icon: feedbackIcon['warning'] }, config));
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
notification[type](Object.assign({ key }, config));
|
|
267
|
+
};
|
|
268
|
+
const StaticBmModal = (config) => {
|
|
269
|
+
const type = config['type'] || feedbackType.INFO;
|
|
270
|
+
return Modal[type](Object.assign({ cancelButtonProps: { type: 'second' }, okType: 'primary', cancelText: '取消', okText: '确认', autoFocusButton: null, icon: feedbackIcon[type] }, config));
|
|
271
|
+
};
|
|
272
|
+
const BmMessage = (config) => {
|
|
273
|
+
const type = config.type;
|
|
274
|
+
if (!type || !message[type]) {
|
|
275
|
+
throw new Error('请输入正确的message类型type值');
|
|
276
|
+
}
|
|
277
|
+
const key = config.key || idGenerator();
|
|
278
|
+
const content = config.closable
|
|
279
|
+
? h('div', { class: 'bm-message-content-fade-div' }, [
|
|
280
|
+
config.content,
|
|
281
|
+
h(CloseOutlined, {
|
|
282
|
+
onClick(e) {
|
|
283
|
+
e.stopPropagation();
|
|
284
|
+
message.destroy(key);
|
|
285
|
+
},
|
|
286
|
+
}),
|
|
287
|
+
])
|
|
288
|
+
: config.content;
|
|
289
|
+
message[type](Object.assign(Object.assign({ class: `bm-message-${type}` }, config), { key,
|
|
290
|
+
content }));
|
|
291
|
+
};
|
|
292
|
+
const BmModal = withInstall(AModal);
|
|
293
|
+
const BmAlert = withInstall(Alert);
|
|
294
|
+
|
|
295
|
+
export { BmAlert, BmMessage, BmModal, BmNotification, StaticBmModal };
|