@web-utils/component 2.8.0 → 2.8.2
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/base.css +1 -1
- package/card/index.mjs +33 -37
- package/chat/index.mjs +132 -123
- package/chunks/{dataformat.25e22176.mjs → dataformat.ab62230f.mjs} +1 -1
- package/chunks/{detail.6e53ede8.mjs → detail.6e46de33.mjs} +1 -1
- package/chunks/dic.7f13b573.mjs +130 -0
- package/chunks/{event.a018cb06.mjs → event.1ac32f1d.mjs} +2 -2
- package/chunks/{init.f04c7036.mjs → init.47ce5ed9.mjs} +2 -2
- package/chunks/json-beautifier.21cfffea.mjs +126 -0
- package/chunks/util.505913d9.mjs +266 -0
- package/column/index.mjs +2 -2
- package/column-default/index.mjs +1 -1
- package/column-dynamic/index.mjs +1 -1
- package/column-menu/index.mjs +81 -79
- package/column-slot/index.mjs +8 -7
- package/comment/index.mjs +6 -10
- package/data-pay/index.mjs +16 -13
- package/data-table-picker/index.mjs +22 -22
- package/dialog-excel/index.mjs +8 -8
- package/dialog-filter/index.mjs +4 -2
- package/dialog-form/index.mjs +6 -6
- package/dynamic-table/index.mjs +8 -8
- package/editable-tree/index.mjs +5 -5
- package/flow/index.mjs +11 -11
- package/flow/style.css +1 -1
- package/flow-node/index.mjs +2 -2
- package/form-block/index.mjs +156 -0
- package/form-block/style.css +1 -0
- package/form-button/index.mjs +16 -38
- package/form-group/index.mjs +28 -33
- package/form-input-tag/index.mjs +99 -0
- package/form-temp/index.mjs +15 -27
- package/fy-array/index.mjs +44 -42
- package/fy-cascader/index.mjs +1 -1
- package/fy-checkbox/index.mjs +2 -1
- package/fy-code/index.mjs +1 -1
- package/fy-curd/index.mjs +29 -31
- package/fy-date/index.mjs +1 -1
- package/fy-dialog-form/index.mjs +5 -11
- package/fy-draggable/index.mjs +3 -3
- package/fy-dynamic/index.mjs +3 -3
- package/fy-empty/index.mjs +1 -1
- package/fy-form/index.mjs +133 -122
- package/fy-form-design/index.mjs +2596 -2893
- package/fy-form-design/style.css +1 -1
- package/fy-input/index.mjs +10 -15
- package/fy-input-color/index.mjs +1 -1
- package/fy-input-icon/index.mjs +21 -16
- package/fy-input-map/index.mjs +22 -19
- package/fy-input-number/index.mjs +1 -1
- package/fy-input-table/index.mjs +1 -1
- package/fy-input-tree/index.mjs +5 -6
- package/fy-radio/index.mjs +3 -1
- package/fy-rate/index.mjs +2 -1
- package/fy-select/index.mjs +29 -28
- package/fy-slider/index.mjs +2 -2
- package/fy-switch/index.mjs +2 -1
- package/fy-tabs/index.mjs +19 -17
- package/fy-time/index.mjs +1 -1
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +8 -6
- package/fy-u-editor/index.mjs +10 -14
- package/fy-upload/index.mjs +85 -84
- package/header-menu/index.mjs +1 -1
- package/header-search/index.mjs +7 -5
- package/image-cropper/index.mjs +1 -1
- package/image-preview/index.mjs +1 -1
- package/index.cjs +62 -38
- package/index.css +1 -1
- package/index.mjs +17121 -16215
- package/license/index.mjs +1 -1
- package/login/index.mjs +1 -1
- package/monaco-editor/index.mjs +196 -0
- package/package.json +3 -2
- package/present-view/index.mjs +360 -0
- package/present-view/style.css +1 -0
- package/process-designer/index.mjs +10 -2
- package/queue/index.mjs +3 -8
- package/queue/style.css +1 -0
- package/record-video/index.mjs +1 -1
- package/search/index.mjs +2 -2
- package/search-popover/index.mjs +25 -24
- package/sign/index.mjs +17 -18
- package/sign/style.css +1 -1
- package/swiper/index.mjs +1 -1
- package/table-page/index.mjs +21 -23
- package/text-ellipsis/index.mjs +1 -1
- package/tinymce-editor/style.css +1 -1
- package/tinymce-wrapper/index.mjs +290 -97
- package/verify/index.mjs +1 -1
- package/web-types.json +829 -320
- package/x-input-tag/index.mjs +182 -0
- package/x-input-tag/style.css +1 -0
- package/chunks/dic.e8280157.mjs +0 -130
- package/chunks/util.17330567.mjs +0 -266
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
var f = Object.defineProperty, _ = Object.defineProperties;
|
|
2
|
+
var v = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
|
+
var y = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (t, a, e) => a in t ? f(t, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[a] = e, m = (t, a) => {
|
|
6
|
+
for (var e in a || (a = {}))
|
|
7
|
+
y.call(a, e) && h(t, e, a[e]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var e of p(a))
|
|
10
|
+
b.call(a, e) && h(t, e, a[e]);
|
|
11
|
+
return t;
|
|
12
|
+
}, d = (t, a) => _(t, v(a));
|
|
13
|
+
var u = (t, a, e) => new Promise((s, n) => {
|
|
14
|
+
var o = (i) => {
|
|
15
|
+
try {
|
|
16
|
+
l(e.next(i));
|
|
17
|
+
} catch (r) {
|
|
18
|
+
n(r);
|
|
19
|
+
}
|
|
20
|
+
}, c = (i) => {
|
|
21
|
+
try {
|
|
22
|
+
l(e.throw(i));
|
|
23
|
+
} catch (r) {
|
|
24
|
+
n(r);
|
|
25
|
+
}
|
|
26
|
+
}, l = (i) => i.done ? s(i.value) : Promise.resolve(i.value).then(o, c);
|
|
27
|
+
l((e = e.apply(t, a)).next());
|
|
28
|
+
});
|
|
29
|
+
import { n as V } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
30
|
+
var w = function() {
|
|
31
|
+
var t = this, a = t.$createElement, e = t._self._c || a;
|
|
32
|
+
return e("div", {
|
|
33
|
+
staticClass: "fy-input-tag"
|
|
34
|
+
}, [t._l(t.tags, function(s, n) {
|
|
35
|
+
return e("ElTag", {
|
|
36
|
+
key: s.id,
|
|
37
|
+
attrs: {
|
|
38
|
+
closable: !t.inputDisabled,
|
|
39
|
+
"disable-transitions": !t.arrayMode
|
|
40
|
+
},
|
|
41
|
+
on: {
|
|
42
|
+
close: function(o) {
|
|
43
|
+
return t.handleClose(s, n);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [t._v(" " + t._s(s.tagName) + " ")]);
|
|
47
|
+
}), !t.inputDisabled && t.inputVisible ? e("ElInput", {
|
|
48
|
+
ref: "saveTagInput",
|
|
49
|
+
staticClass: "input-new-tag",
|
|
50
|
+
attrs: {
|
|
51
|
+
size: "small"
|
|
52
|
+
},
|
|
53
|
+
on: {
|
|
54
|
+
blur: t.handleInputConfirm
|
|
55
|
+
},
|
|
56
|
+
nativeOn: {
|
|
57
|
+
keyup: function(s) {
|
|
58
|
+
return !s.type.indexOf("key") && t._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : t.handleInputConfirm.apply(null, arguments);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
model: {
|
|
62
|
+
value: t.inputValue,
|
|
63
|
+
callback: function(s) {
|
|
64
|
+
t.inputValue = s;
|
|
65
|
+
},
|
|
66
|
+
expression: "inputValue"
|
|
67
|
+
}
|
|
68
|
+
}) : t._e(), !t.inputDisabled && !t.inputVisible ? e("ElButton", {
|
|
69
|
+
directives: [{
|
|
70
|
+
name: "show",
|
|
71
|
+
rawName: "v-show",
|
|
72
|
+
value: t.tags.length < t.maxTag,
|
|
73
|
+
expression: "tags.length < maxTag"
|
|
74
|
+
}],
|
|
75
|
+
staticClass: "button-new-tag",
|
|
76
|
+
attrs: {
|
|
77
|
+
size: "small"
|
|
78
|
+
},
|
|
79
|
+
on: {
|
|
80
|
+
click: t.showInput
|
|
81
|
+
}
|
|
82
|
+
}, [t._v(" + 添加 ")]) : t._e()], 2);
|
|
83
|
+
}, x = [];
|
|
84
|
+
const I = {
|
|
85
|
+
name: "XInputTag",
|
|
86
|
+
inject: {
|
|
87
|
+
elForm: {
|
|
88
|
+
default: ""
|
|
89
|
+
},
|
|
90
|
+
elFormItem: {
|
|
91
|
+
default: ""
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
props: {
|
|
95
|
+
value: {
|
|
96
|
+
type: [Array, String],
|
|
97
|
+
default: () => []
|
|
98
|
+
},
|
|
99
|
+
disabled: Boolean,
|
|
100
|
+
separator: {
|
|
101
|
+
type: String,
|
|
102
|
+
default: ","
|
|
103
|
+
},
|
|
104
|
+
arrayMode: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: !0
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
data() {
|
|
110
|
+
return {
|
|
111
|
+
inputVisible: !1,
|
|
112
|
+
inputValue: "",
|
|
113
|
+
maxTag: 20
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
computed: {
|
|
117
|
+
inputDisabled() {
|
|
118
|
+
return this.disabled || (this.elForm || {}).disabled;
|
|
119
|
+
},
|
|
120
|
+
tags: {
|
|
121
|
+
get() {
|
|
122
|
+
var t, a;
|
|
123
|
+
if (this.arrayMode)
|
|
124
|
+
return (t = this.value) != null && t.length ? this.value.map((e) => e.id > 0 ? e : d(m({}, e), { id: Math.random() })) : [];
|
|
125
|
+
{
|
|
126
|
+
const e = ((a = this.value) == null ? void 0 : a.split(this.separator)) || [];
|
|
127
|
+
return e.length && e[0] ? e.map((s) => ({ tagName: s, id: Math.random() })) : [];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
methods: {
|
|
133
|
+
showInput() {
|
|
134
|
+
return u(this, null, function* () {
|
|
135
|
+
this.inputVisible = !0, yield this.$nextTick(), this.$refs.saveTagInput.$refs.input.focus();
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
handleClose(t) {
|
|
139
|
+
const a = this.tags.filter((e) => e !== t);
|
|
140
|
+
this.$emit("input", this.arrayMode ? a : a.map((e) => e.tagName).join(this.separator));
|
|
141
|
+
},
|
|
142
|
+
handleInputConfirm() {
|
|
143
|
+
return u(this, null, function* () {
|
|
144
|
+
var a;
|
|
145
|
+
if (this.tags.length >= this.maxTag) {
|
|
146
|
+
this.$message.warning({ message: "标签已达上限,请删除一些标签再添加!", showClose: !0 }), this.inputVisible = !1, this.inputValue = "";
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const t = this.inputValue;
|
|
150
|
+
if (t) {
|
|
151
|
+
if (this.tags.some((s) => s.tagName === t)) {
|
|
152
|
+
this.inputVisible = !1, this.inputValue = "", this.$message.warning({ message: "标签已存在!", showClose: !0 });
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const e = [...this.tags];
|
|
156
|
+
e.push({ id: Date.now(), tagName: this.inputValue }), this.$emit("input", this.arrayMode ? e : e.map((s) => s.tagName).join(this.separator)), yield this.$nextTick(), (a = this.elFormItem) == null || a.clearValidate();
|
|
157
|
+
}
|
|
158
|
+
this.inputVisible = !1, this.inputValue = "";
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}, g = {};
|
|
163
|
+
var C = /* @__PURE__ */ V(
|
|
164
|
+
I,
|
|
165
|
+
w,
|
|
166
|
+
x,
|
|
167
|
+
!1,
|
|
168
|
+
T,
|
|
169
|
+
null,
|
|
170
|
+
null,
|
|
171
|
+
null
|
|
172
|
+
);
|
|
173
|
+
function T(t) {
|
|
174
|
+
for (let a in g)
|
|
175
|
+
this[a] = g[a];
|
|
176
|
+
}
|
|
177
|
+
const $ = /* @__PURE__ */ function() {
|
|
178
|
+
return C.exports;
|
|
179
|
+
}();
|
|
180
|
+
export {
|
|
181
|
+
$ as default
|
|
182
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.el-form-item.is-error .fy-input-tag{border-color:#f56c6c}.fy-input-tag{height:120px;padding:0 10px 10px;overflow:auto;border:1px solid var(--border-color);border-radius:4px}.fy-input-tag .el-tag{margin-top:10px;margin-right:10px}.fy-input-tag .el-tag+.el-tag{margin-right:10px}.fy-input-tag .button-new-tag{height:28px;margin-top:10px;padding-top:0;padding-bottom:0;line-height:26px}.fy-input-tag .el-input.input-new-tag{width:170px;height:28px;margin-top:10px;line-height:26px;vertical-align:bottom}
|
package/chunks/dic.e8280157.mjs
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { isBlank as w } from "@web-utils/core";
|
|
2
|
-
import { l as D, m as E } from "./util.17330567.mjs";
|
|
3
|
-
const F = (d, t = []) => new Promise((i, o) => {
|
|
4
|
-
const c = [], a = [], s = {};
|
|
5
|
-
d.forEach((e) => {
|
|
6
|
-
e.parentProp && c.push(e);
|
|
7
|
-
}), t.forEach((e, n) => {
|
|
8
|
-
c.forEach((r) => {
|
|
9
|
-
r.hide !== !0 && r.dicFlag !== !1 && a.push(
|
|
10
|
-
new Promise((u) => {
|
|
11
|
-
w(e[r.parentProp]) ? u({
|
|
12
|
-
prop: r.prop,
|
|
13
|
-
data: [],
|
|
14
|
-
index: n
|
|
15
|
-
}) : r.dicUrl && g({
|
|
16
|
-
url: `${r.dicUrl.replace("{{key}}", e[r.parentProp])}`,
|
|
17
|
-
props: r.props,
|
|
18
|
-
method: r.dicMethod,
|
|
19
|
-
headers: r.dicHeaders,
|
|
20
|
-
formatter: r.dicFormatter,
|
|
21
|
-
query: r.dicQuery,
|
|
22
|
-
form: e
|
|
23
|
-
}).then((l) => {
|
|
24
|
-
u({
|
|
25
|
-
prop: r.prop,
|
|
26
|
-
data: l,
|
|
27
|
-
index: n
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
}), Promise.all(a).then((e) => {
|
|
34
|
-
e.forEach((n) => {
|
|
35
|
-
w(s[n.index]) && (s[n.index] = {}), s[n.index][n.prop] = n.data;
|
|
36
|
-
}), i(s);
|
|
37
|
-
});
|
|
38
|
-
}), U = (d) => {
|
|
39
|
-
let t = [];
|
|
40
|
-
return new Promise((i, o) => {
|
|
41
|
-
t = k(d).ajaxdic, j(t).then((a) => {
|
|
42
|
-
i(a);
|
|
43
|
-
}).catch((a) => {
|
|
44
|
-
o(a);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
}, K = (d) => {
|
|
48
|
-
const t = {}, i = d.dicData || {};
|
|
49
|
-
return d.column.forEach((o) => {
|
|
50
|
-
o.dicData && (t[o.prop] = D(o.dicData, o.props, o.dataType));
|
|
51
|
-
}), Object.assign(i, t);
|
|
52
|
-
};
|
|
53
|
-
function k(d) {
|
|
54
|
-
const t = d.column || [], i = [], o = {};
|
|
55
|
-
let c = [];
|
|
56
|
-
return t.forEach((a) => {
|
|
57
|
-
const s = a.dicData, e = a.dicUrl, n = a.prop, r = a.parentProp;
|
|
58
|
-
c = c.concat(a.cascader || []), Array.isArray(s) && (o[n] = s), !(a.dicFlag === !1 || a.lazy === !0 || c.includes(n)) && e && !r && i.push({
|
|
59
|
-
url: e,
|
|
60
|
-
name: n,
|
|
61
|
-
method: a.dicMethod,
|
|
62
|
-
headers: t.dicHeaders,
|
|
63
|
-
formatter: a.dicFormatter,
|
|
64
|
-
props: a.props,
|
|
65
|
-
dataType: a.dataType,
|
|
66
|
-
resKey: (a.props || {}).res,
|
|
67
|
-
query: a.dicQuery || {}
|
|
68
|
-
});
|
|
69
|
-
}), {
|
|
70
|
-
ajaxdic: i,
|
|
71
|
-
locationdic: o
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function j(d) {
|
|
75
|
-
const t = {}, i = [];
|
|
76
|
-
return new Promise((o) => {
|
|
77
|
-
d.forEach((c) => {
|
|
78
|
-
i.push(
|
|
79
|
-
new Promise((a) => {
|
|
80
|
-
g(Object.assign(c, {
|
|
81
|
-
url: `${c.url.replace("{{key}}", "")}`
|
|
82
|
-
})).then((s) => {
|
|
83
|
-
s = D(s, c.props, c.dataType), a(s);
|
|
84
|
-
}).catch(() => {
|
|
85
|
-
a([]);
|
|
86
|
-
});
|
|
87
|
-
})
|
|
88
|
-
);
|
|
89
|
-
}), Promise.all(i).then((c) => {
|
|
90
|
-
d.forEach((a, s) => {
|
|
91
|
-
t[a.name] = c[s];
|
|
92
|
-
}), o(t);
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
const g = (d) => {
|
|
97
|
-
let { url: t, query: i, method: o, resKey: c, props: a, formatter: s, headers: e = {}, value: n = "", column: r, form: u = {} } = d;
|
|
98
|
-
r && (t = r.dicUrl, o = r.dicMethod, e = r.headers || {}, i = r.dicQuery || {}, s = r.dicFormatter, a = r.props);
|
|
99
|
-
const l = "key";
|
|
100
|
-
t = t || "";
|
|
101
|
-
let m;
|
|
102
|
-
const y = {};
|
|
103
|
-
return m = t.match(/[^{}]+(?=})/g) || [], m.forEach((p) => {
|
|
104
|
-
const f = `{{${p}}}`, h = u[p];
|
|
105
|
-
p === l ? t = t.replace(f, n) : t = t.replace(f, h);
|
|
106
|
-
}), o === "post" && (m = Object.keys(i), m.forEach((p) => {
|
|
107
|
-
const f = i[p];
|
|
108
|
-
typeof f == "string" && f.match(/\{{|}}/g) ? y[p] = u[f.replace(/\{{|}}/g, "")] : y[p] = f;
|
|
109
|
-
})), a && (c = (a || {}).res || c), new Promise((p) => {
|
|
110
|
-
const f = (h) => {
|
|
111
|
-
let P = [];
|
|
112
|
-
typeof s == "function" ? P = s(h.data) : P = E(h.data, c), p(P);
|
|
113
|
-
};
|
|
114
|
-
o === "post" ? window.axios.post(t, y, { headers: e }).then(function(h) {
|
|
115
|
-
f(h);
|
|
116
|
-
}).catch(() => [
|
|
117
|
-
p([])
|
|
118
|
-
]) : window.axios.get(t, { params: i, headers: e }).then(function(h) {
|
|
119
|
-
f(h);
|
|
120
|
-
}).catch(() => [
|
|
121
|
-
p([])
|
|
122
|
-
]);
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
export {
|
|
126
|
-
U as a,
|
|
127
|
-
F as b,
|
|
128
|
-
K as l,
|
|
129
|
-
g as s
|
|
130
|
-
};
|
package/chunks/util.17330567.mjs
DELETED
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { isBlank, getObjType } from "@web-utils/core";
|
|
2
|
-
const KEY_COMPONENT_NAME = "fy-", DIC_PROPS = {
|
|
3
|
-
rowKey: "id",
|
|
4
|
-
rowParentKey: "parentId",
|
|
5
|
-
nodeKey: "id",
|
|
6
|
-
label: "label",
|
|
7
|
-
value: "value",
|
|
8
|
-
desc: "desc",
|
|
9
|
-
groups: "groups",
|
|
10
|
-
title: "title",
|
|
11
|
-
leaf: "leaf",
|
|
12
|
-
children: "children",
|
|
13
|
-
hasChildren: "hasChildren",
|
|
14
|
-
labelText: "名称",
|
|
15
|
-
disabled: "disabled"
|
|
16
|
-
}, DIC_HTTP_PROPS = {
|
|
17
|
-
name: "name",
|
|
18
|
-
url: "url",
|
|
19
|
-
fileName: "file",
|
|
20
|
-
res: ""
|
|
21
|
-
}, DATE_LIST = [
|
|
22
|
-
"dates",
|
|
23
|
-
"date",
|
|
24
|
-
"datetime",
|
|
25
|
-
"datetimerange",
|
|
26
|
-
"daterange",
|
|
27
|
-
"time",
|
|
28
|
-
"timerange",
|
|
29
|
-
"week",
|
|
30
|
-
"month",
|
|
31
|
-
"monthrange",
|
|
32
|
-
"year"
|
|
33
|
-
], INPUT_LIST = ["tree", "number", "icon", "color", "table", "map"], ARRAY_LIST = ["img", "array", "url"], MULTIPLE_LIST = ["cascader", "tree", "select"], RANGE_LIST = ["slider"], ARRAY_VALUE_LIST = ARRAY_LIST.concat(["upload", "dynamic", "map", "checkbox", "cascader", "dynamic", "timerange", "monthrange", "daterange", "datetimerange", "dates"]), SELECT_LIST = DATE_LIST.concat(["select", "checkbox", "radio", "cascader", "tree", "color", "icon", "table", "map"]), DIC_SHOW_SPLIT = " | ", DIC_SPLIT = ",", typeList = {
|
|
34
|
-
img: /\.(gif|jpg|jpeg|png|webp|svg|GIF|JPG|JPEG|PNG|WEBP|SVG)/,
|
|
35
|
-
video: /\.(swf|avi|flv|mpg|rm|mov|wav|asf|3gp|mkv|rmvb|ogg|mp4)/,
|
|
36
|
-
audio: /\.(mp3|wav|MP3|WAV)/
|
|
37
|
-
}, isMediaType = (e, n) => {
|
|
38
|
-
if (!isBlank(e))
|
|
39
|
-
return typeList.audio.test(e) || n === "audio" ? "audio" : typeList.video.test(e) || n === "video" ? "video" : typeList.img.test(e) || n === "img" ? "img" : !1;
|
|
40
|
-
};
|
|
41
|
-
function getFixed(e = 0, n = 2) {
|
|
42
|
-
return Number(e.toFixed(n));
|
|
43
|
-
}
|
|
44
|
-
function getAsVal(e, n = "") {
|
|
45
|
-
let r = deepClone(e);
|
|
46
|
-
return isBlank(n) || n.split(".").forEach((t) => {
|
|
47
|
-
r = isBlank(r[t]) ? "" : r[t];
|
|
48
|
-
}), r;
|
|
49
|
-
}
|
|
50
|
-
function setAsVal(obj, bind = "", value) {
|
|
51
|
-
let result;
|
|
52
|
-
const type = getObjType(value);
|
|
53
|
-
return isBlank(value) ? type === "array" ? result = `obj.${bind}=[]` : type === "object" ? result = `obj.${bind}={}` : ["number", "boolean"].includes(type) ? result = `obj.${bind}=undefined` : result = `obj.${bind}=''` : type === "string" ? result = `obj.${bind}='${value}'` : result = `obj.${bind}=${value}`, eval(result), obj;
|
|
54
|
-
}
|
|
55
|
-
function downFile(e, n) {
|
|
56
|
-
typeof e == "object" && e instanceof Blob && (e = URL.createObjectURL(e));
|
|
57
|
-
const r = document.createElement("a");
|
|
58
|
-
r.href = e, r.download = n || "";
|
|
59
|
-
let t;
|
|
60
|
-
window.MouseEvent ? t = new MouseEvent("click") : (t = document.createEvent("MouseEvents"), t.initMouseEvent(
|
|
61
|
-
"click",
|
|
62
|
-
!0,
|
|
63
|
-
!1,
|
|
64
|
-
window,
|
|
65
|
-
0,
|
|
66
|
-
0,
|
|
67
|
-
0,
|
|
68
|
-
0,
|
|
69
|
-
0,
|
|
70
|
-
!1,
|
|
71
|
-
!1,
|
|
72
|
-
!1,
|
|
73
|
-
!1,
|
|
74
|
-
0,
|
|
75
|
-
null
|
|
76
|
-
)), r.dispatchEvent(t);
|
|
77
|
-
}
|
|
78
|
-
function strCorNum(e) {
|
|
79
|
-
return e.forEach((n, r) => {
|
|
80
|
-
e[r] = Number(n);
|
|
81
|
-
}), e;
|
|
82
|
-
}
|
|
83
|
-
function extend(...e) {
|
|
84
|
-
let n = e[0] || {}, r = !1;
|
|
85
|
-
const t = Array.prototype.slice.call(e);
|
|
86
|
-
let s = 1, i, o, a, l, c = !1;
|
|
87
|
-
for (typeof n == "boolean" && (r = n, s++, n = e[1]); s < t.length; s++)
|
|
88
|
-
if ((i = t[s]) != null)
|
|
89
|
-
for (a in i)
|
|
90
|
-
l = i[a], o = n[a], r && (toString.call(l) === "[object Object]" || (c = toString.call(l) === "[object Array]")) ? (c ? o = toString.call(o) === "[object Array]" ? o : [] : o = toString.call(o) === "[object Object]" ? o : {}, n[a] = extend(r, o, l)) : l !== void 0 && l !== o && (n[a] = l);
|
|
91
|
-
return n;
|
|
92
|
-
}
|
|
93
|
-
function createObj(e, n) {
|
|
94
|
-
const r = n.split("."), t = r.splice(0, 1)[0], s = {};
|
|
95
|
-
if (s[t] = {}, r.length >= 2) {
|
|
96
|
-
const i = "{", o = "}";
|
|
97
|
-
let a = "";
|
|
98
|
-
r.forEach((l) => {
|
|
99
|
-
a = `${a}${i}"${l}":`;
|
|
100
|
-
}), a = `${a}""`;
|
|
101
|
-
for (let l = 0; l < r.length; l++)
|
|
102
|
-
a = `${a}${o}`;
|
|
103
|
-
a = JSON.parse(a), s[t] = a;
|
|
104
|
-
}
|
|
105
|
-
return e = extend(!0, e, s), e;
|
|
106
|
-
}
|
|
107
|
-
function dataURLtoFile(e, n) {
|
|
108
|
-
const r = e.split(","), t = r[0].match(/:(.*?);/)[1], s = atob(r[1]);
|
|
109
|
-
let i = s.length;
|
|
110
|
-
const o = new Uint8Array(i);
|
|
111
|
-
for (; i--; )
|
|
112
|
-
o[i] = s.charCodeAt(i);
|
|
113
|
-
return new File([o], n, {
|
|
114
|
-
type: t
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
function findObject(e, n, r = "prop") {
|
|
118
|
-
let t = -1;
|
|
119
|
-
const s = (() => {
|
|
120
|
-
let i;
|
|
121
|
-
return e.forEach((o) => {
|
|
122
|
-
o.column ? i = "group" : o.children && (i = "tree");
|
|
123
|
-
}), i;
|
|
124
|
-
})();
|
|
125
|
-
return s === "group" ? e.forEach((i) => {
|
|
126
|
-
const o = findArray(i.column, n, r, !0);
|
|
127
|
-
o !== -1 && (t = o);
|
|
128
|
-
}) : s === "tree" ? t = findLabelNode(e, n, { value: r }, !0) : t = findArray(e, n, r, !0), t;
|
|
129
|
-
}
|
|
130
|
-
function randomId() {
|
|
131
|
-
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", n = e.length;
|
|
132
|
-
let r = "";
|
|
133
|
-
for (let t = 0; t < 16; t++)
|
|
134
|
-
r += e.charAt(Math.floor(Math.random() * n));
|
|
135
|
-
return r;
|
|
136
|
-
}
|
|
137
|
-
const deepClone = (e) => {
|
|
138
|
-
const n = getObjType(e);
|
|
139
|
-
let r;
|
|
140
|
-
if (n === "array")
|
|
141
|
-
r = [];
|
|
142
|
-
else if (n === "object")
|
|
143
|
-
r = {};
|
|
144
|
-
else
|
|
145
|
-
return e;
|
|
146
|
-
if (n === "array") {
|
|
147
|
-
e = e;
|
|
148
|
-
let t = 0;
|
|
149
|
-
const s = e.length;
|
|
150
|
-
for (; t < s; t++)
|
|
151
|
-
e[t] && delete e[t].$parent, r.push(deepClone(e[t]));
|
|
152
|
-
} else if (n === "object")
|
|
153
|
-
for (const t in e) {
|
|
154
|
-
const s = e[t];
|
|
155
|
-
s && delete s.$parent, r[t] = deepClone(e[t]);
|
|
156
|
-
}
|
|
157
|
-
return r;
|
|
158
|
-
}, setPx = (e, n = "") => (e || (e = n), e ? (e = `${e}`, e.indexOf("%") === -1 && e.indexOf("px") === -1 && (e = `${e}px`), e) : ""), detailDataType = (e, n) => isBlank(e) ? e : n === "number" ? Number(e) : n === "string" ? `${e}` : e, detailDic = (e = [], n = {}, r) => {
|
|
159
|
-
const t = n.value || DIC_PROPS.value, s = n.children || DIC_PROPS.children;
|
|
160
|
-
return e.forEach((i) => {
|
|
161
|
-
i[t] = detailDataType(i[t], r), i[s] && detailDic(i[s], n, r);
|
|
162
|
-
}), e;
|
|
163
|
-
}, findByValue = (e, n, r) => {
|
|
164
|
-
if (isBlank(e))
|
|
165
|
-
return n;
|
|
166
|
-
const t = n instanceof Array, s = t ? n : [n];
|
|
167
|
-
r = r || DIC_PROPS;
|
|
168
|
-
const i = [];
|
|
169
|
-
for (let o = 0; o < s.length; o++)
|
|
170
|
-
i.push(findLabelNode(e, s[o], r) || s[o]);
|
|
171
|
-
return t ? i.join(DIC_SHOW_SPLIT) : i.join();
|
|
172
|
-
}, filterParams = (e, n = ["", "$"], r = !0) => {
|
|
173
|
-
const t = r ? deepClone(e) : e;
|
|
174
|
-
for (const s in t)
|
|
175
|
-
n.includes("") && isBlank(t[s]) && delete t[s], n.includes("$") && s.indexOf("$") !== -1 && delete t[s];
|
|
176
|
-
return t;
|
|
177
|
-
}, detailDicGroup = (e = [], n = {}) => {
|
|
178
|
-
let r = deepClone(e);
|
|
179
|
-
const t = n[DIC_PROPS.groups] || DIC_PROPS.groups;
|
|
180
|
-
return e.forEach((s) => {
|
|
181
|
-
s[t] && (r = r.concat(s[t]));
|
|
182
|
-
}), r;
|
|
183
|
-
}, findLabelNode = (e, n, r, t = null) => {
|
|
184
|
-
let s;
|
|
185
|
-
t || (e = detailDicGroup(e, r));
|
|
186
|
-
const i = (o) => {
|
|
187
|
-
const a = r.label || DIC_PROPS.label, l = r.value || DIC_PROPS.value, c = r.children || DIC_PROPS.children;
|
|
188
|
-
for (let u = 0; u < o.length; u++) {
|
|
189
|
-
const f = o[u], d = f[c] || [];
|
|
190
|
-
f[l] === n ? s = t ? f : f[a] : i(d);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
return i(e), s;
|
|
194
|
-
}, getDeepData = (e) => (Array.isArray(e) ? e : e.data) || [], getObjValue = (e, n = "", r = null) => {
|
|
195
|
-
const t = n.split(".");
|
|
196
|
-
let s = e;
|
|
197
|
-
return t[0] === "" && r !== "object" ? getDeepData(e) : (t[0] !== "" && t.forEach((i) => {
|
|
198
|
-
s = s[i];
|
|
199
|
-
}), s);
|
|
200
|
-
}, findArray = (e, n, r, t) => {
|
|
201
|
-
r = r || DIC_PROPS.value;
|
|
202
|
-
for (let s = 0; s < e.length; s++)
|
|
203
|
-
if (e[s][r] === n)
|
|
204
|
-
return t ? e[s] : s;
|
|
205
|
-
return -1;
|
|
206
|
-
}, getPasswordChar = (e = "", n) => {
|
|
207
|
-
const r = e.toString().length;
|
|
208
|
-
e = "";
|
|
209
|
-
for (let t = 0; t < r; t++)
|
|
210
|
-
e = e + n;
|
|
211
|
-
return e;
|
|
212
|
-
}, arraySort = (e = [], n, r) => e.filter((t) => !isBlank(t[n])).sort((t, s) => r(t, s)).concat(e.filter((t) => isBlank(t[n]))), clearVal = (e, n, r = []) => e ? (n.forEach((t) => {
|
|
213
|
-
if (!r.includes(t)) {
|
|
214
|
-
if (t.includes("$"))
|
|
215
|
-
delete e[t];
|
|
216
|
-
else if (!isBlank(e[t])) {
|
|
217
|
-
const s = getObjType(e[t]);
|
|
218
|
-
s === "array" ? e[t] = [] : s === "object" ? e[t] = {} : ["number", "boolean"].includes(s) ? e[t] = void 0 : e[t] = "";
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}), e) : {}, optVal = (e, n) => typeof e == "boolean" ? e : isBlank(e) ? n : e;
|
|
222
|
-
function uploadFun(e = {}, n) {
|
|
223
|
-
n = n || this;
|
|
224
|
-
const r = ["uploadPreview", "uploadBefore", "uploadAfter", "uploadDelete", "uploadError", "uploadExceed"], t = {};
|
|
225
|
-
return e.type === "upload" ? r.forEach((s) => {
|
|
226
|
-
e[s] || (t[s] = n[s]);
|
|
227
|
-
}) : r.forEach((s) => {
|
|
228
|
-
t[s] = n[s];
|
|
229
|
-
}), t;
|
|
230
|
-
}
|
|
231
|
-
export {
|
|
232
|
-
ARRAY_VALUE_LIST as A,
|
|
233
|
-
downFile as B,
|
|
234
|
-
DIC_PROPS as D,
|
|
235
|
-
INPUT_LIST as I,
|
|
236
|
-
KEY_COMPONENT_NAME as K,
|
|
237
|
-
MULTIPLE_LIST as M,
|
|
238
|
-
RANGE_LIST as R,
|
|
239
|
-
SELECT_LIST as S,
|
|
240
|
-
arraySort as a,
|
|
241
|
-
DIC_SHOW_SPLIT as b,
|
|
242
|
-
DIC_SPLIT as c,
|
|
243
|
-
deepClone as d,
|
|
244
|
-
strCorNum as e,
|
|
245
|
-
ARRAY_LIST as f,
|
|
246
|
-
getAsVal as g,
|
|
247
|
-
getPasswordChar as h,
|
|
248
|
-
isMediaType as i,
|
|
249
|
-
DATE_LIST as j,
|
|
250
|
-
findByValue as k,
|
|
251
|
-
detailDic as l,
|
|
252
|
-
getObjValue as m,
|
|
253
|
-
findObject as n,
|
|
254
|
-
optVal as o,
|
|
255
|
-
detailDataType as p,
|
|
256
|
-
createObj as q,
|
|
257
|
-
randomId as r,
|
|
258
|
-
setPx as s,
|
|
259
|
-
DIC_HTTP_PROPS as t,
|
|
260
|
-
uploadFun as u,
|
|
261
|
-
filterParams as v,
|
|
262
|
-
getFixed as w,
|
|
263
|
-
setAsVal as x,
|
|
264
|
-
clearVal as y,
|
|
265
|
-
dataURLtoFile as z
|
|
266
|
-
};
|