@web-utils/component 3.0.2 → 3.0.3
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/address-input/index.mjs +14 -14
- package/chat/index.mjs +39 -40
- package/chunk-file-uploader/index.mjs +35 -594
- package/chunk-file-uploader/style.css +1 -1
- package/chunks/FormTemp.d079292b.mjs +139 -0
- package/chunks/{dataformat.816df805.mjs → dataformat.e655611c.mjs} +6 -6
- package/chunks/detail.d6f8e347.mjs +29 -0
- package/chunks/{dic.3b4ba802.mjs → dic.eaac0823.mjs} +40 -40
- package/chunks/{event.4377230d.mjs → event.10295951.mjs} +2 -2
- package/chunks/form-input-mixin.78a567bc.mjs +24 -0
- package/chunks/form-item-mixin.57cb2019.mjs +140 -0
- package/chunks/{index.d91bd77a.mjs → index.57f871af.mjs} +7 -7
- package/chunks/{init.f0a03127.mjs → init.47f219b4.mjs} +2 -2
- package/chunks/input-number-mixin.41a066be.mjs +60 -0
- package/chunks/{util.7844e2c2.mjs → util.ae730cde.mjs} +21 -21
- package/count-up/index.mjs +17 -14
- package/data-box/index.mjs +18 -19
- package/data-display/index.mjs +17 -18
- package/data-icons/index.mjs +16 -17
- package/data-panel/index.mjs +20 -21
- package/data-pay/index.mjs +15 -16
- package/data-progress/index.mjs +19 -20
- package/data-rotate/index.mjs +35 -36
- package/data-table-picker/index.mjs +23 -25
- package/data-tabs/index.mjs +15 -16
- package/dialog-form/index.mjs +11 -12
- package/dynamic-table/index.mjs +34 -35
- package/easy-popup/index.mjs +56 -29
- package/editable-tree/index.mjs +485 -134
- package/element-dialog/index.mjs +127 -37
- package/empty-view/index.mjs +31 -13
- package/flex-column/index.mjs +1 -1
- package/flex-item/index.mjs +1 -1
- package/flex-row/index.mjs +1 -1
- package/flow/index.mjs +40 -105
- package/flow-designer/index.mjs +555 -615
- package/flow-node/index.mjs +47 -15
- package/flow-viewer/index.mjs +78 -167
- package/form-cascader/index.mjs +24 -24
- package/form-checkbox-group/index.mjs +35 -79
- package/form-date-picker/index.mjs +22 -22
- package/form-holder/index.mjs +1 -1
- package/form-input/index.mjs +86 -28
- package/form-input-email/index.mjs +18 -18
- package/form-input-id-card/index.mjs +27 -27
- package/form-input-number/index.mjs +59 -219
- package/form-input-phone-number/index.mjs +27 -27
- package/form-input-tag/index.mjs +38 -160
- package/form-input-time/index.mjs +16 -16
- package/form-item/index.mjs +146 -15
- package/form-item-group/index.mjs +164 -14
- package/form-radio-group/index.mjs +41 -41
- package/form-select/index.mjs +20 -20
- package/form-switch/index.mjs +19 -19
- package/form-textarea/index.mjs +29 -29
- package/form-view/index.mjs +42 -46
- package/fy-array/index.mjs +2 -2
- package/fy-cascader/index.mjs +15 -15
- package/fy-checkbox/index.mjs +1 -1
- package/fy-code/index.mjs +1 -1
- package/fy-curd/index.mjs +2824 -210
- package/fy-date/index.mjs +59 -17
- package/fy-draggable/index.mjs +1 -1
- package/fy-dynamic/index.mjs +208 -64
- package/fy-empty/index.mjs +29 -12
- package/fy-form/index.mjs +743 -178
- package/fy-form-design/index.mjs +1013 -1540
- package/fy-input/index.mjs +105 -17
- package/fy-input-color/index.mjs +67 -16
- package/fy-input-icon/index.mjs +119 -23
- package/fy-input-map/index.mjs +14 -15
- package/fy-input-number/index.mjs +1 -1
- package/fy-input-table/index.mjs +19 -21
- package/fy-input-tree/index.mjs +3 -3
- package/fy-radio/index.mjs +1 -1
- package/fy-rate/index.mjs +50 -16
- package/fy-select/index.mjs +126 -29
- package/fy-slider/index.mjs +2 -2
- package/fy-switch/index.mjs +1 -1
- package/fy-tabs/index.mjs +51 -15
- package/fy-time/index.mjs +1 -1
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +23 -25
- package/fy-u-editor/index.mjs +1 -1
- package/fy-upload/index.mjs +2 -2
- package/highlight-j-s/index.mjs +29 -19
- package/icon-temp/index.mjs +30 -12
- package/iframe-window/index.mjs +18 -19
- package/image-cropper/index.mjs +22 -23
- package/image-preview/index.mjs +1 -1
- package/input-number/index.mjs +173 -63
- package/license/index.mjs +1 -1
- package/loading-view/index.mjs +33 -15
- package/login/index.mjs +1 -1
- package/nav-bar/index.mjs +31 -15
- package/package.json +1 -1
- package/page/index.mjs +20 -12
- package/page-header/index.mjs +34 -13
- package/page-index-top/index.mjs +53 -100
- package/page-skeleton/index.mjs +35 -18
- package/page-skeleton-new/index.mjs +15 -16
- package/pageable-table/index.mjs +228 -86
- package/pageable-view/index.mjs +1 -1
- package/present-view/index.mjs +71 -75
- package/record-video/index.mjs +1 -1
- package/resize-observer/index.mjs +29 -21
- package/search/index.mjs +9 -9
- package/search-popover/index.mjs +1 -1
- package/sign/index.mjs +1 -1
- package/split-pane/index.mjs +45 -40
- package/swiper/index.mjs +13 -14
- package/table-view/index.mjs +97 -631
- package/text-ellipsis/index.mjs +1 -1
- package/tinymce-editor/index.mjs +63 -63
- package/toolbar/index.mjs +208 -15
- package/toolbar-button/index.mjs +56 -30
- package/verify/index.mjs +1 -1
- package/watermark/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +118 -49
- package/chunks/CountUp.f1a19f35.mjs +0 -124
- package/chunks/CountUp.vue_vue_type_template_lang.1f68c96e.mjs +0 -8
- package/chunks/EasyPopup.vue_vue_type_style_index_0_lang.89350bda.mjs +0 -32
- package/chunks/EditableTree.vue_vue_type_style_index_0_lang.5dba9f89.mjs +0 -356
- package/chunks/ElementDialog.d8f3105c.mjs +0 -211
- package/chunks/ElementDialog.vue_vue_type_style_index_0_lang.57cb8e07.mjs +0 -95
- package/chunks/EmptyView.e2430422.mjs +0 -51
- package/chunks/EmptyView.vue_vue_type_style_index_0_lang.ffa84770.mjs +0 -23
- package/chunks/FlowNode.vue_vue_type_template_lang.662bdcfa.mjs +0 -37
- package/chunks/FormInput.vue_vue_type_template_lang.3cb79386.mjs +0 -65
- package/chunks/FormItem.2920ac0c.mjs +0 -45
- package/chunks/FormItem.vue_vue_type_style_index_0_lang.970bd712.mjs +0 -258
- package/chunks/FormItemGroup.41daddb6.mjs +0 -64
- package/chunks/FormItemGroup.vue_vue_type_style_index_0_lang.b588a8ea.mjs +0 -155
- package/chunks/FyCurd.8acd2983.mjs +0 -548
- package/chunks/FyCurd.vue_vue_type_style_index_0_lang.4fbd4b30.mjs +0 -2945
- package/chunks/FyDate.vue_vue_type_style_index_0_lang.429c03e3.mjs +0 -47
- package/chunks/FyDynamic.vue_vue_type_style_index_0_lang.304417ce.mjs +0 -151
- package/chunks/FyEmpty.vue_vue_type_style_index_0_lang.fc8bd24c.mjs +0 -22
- package/chunks/FyForm.0294e494.mjs +0 -439
- package/chunks/FyForm.vue_vue_type_style_index_0_lang.6e64daee.mjs +0 -737
- package/chunks/FyInput.vue_vue_type_template_lang.d2c56811.mjs +0 -93
- package/chunks/FyInputColor.vue_vue_type_template_lang.6eca0ddd.mjs +0 -56
- package/chunks/FyInputIcon.vue_vue_type_style_index_0_lang.11a6a221.mjs +0 -158
- package/chunks/FyRate.vue_vue_type_style_index_0_lang.82174185.mjs +0 -39
- package/chunks/FySelect.vue_vue_type_style_index_0_lang.5f0f3244.mjs +0 -102
- package/chunks/FyTabs.vue_vue_type_template_lang.66af5ac9.mjs +0 -41
- package/chunks/HighlightJS.vue_vue_type_style_index_0_lang.fefeaa3b.mjs +0 -15
- package/chunks/IconTemp.42c48e1f.mjs +0 -32
- package/chunks/IconTemp.vue_vue_type_style_index_0_lang.a0777b31.mjs +0 -23
- package/chunks/InputNumber.vue_vue_type_style_index_0_lang.18046bd3.mjs +0 -172
- package/chunks/LoadingView.vue_vue_type_style_index_0_lang.4c3fff2a.mjs +0 -23
- package/chunks/NavBar.vue_vue_type_style_index_0_lang.e21b57f3.mjs +0 -21
- package/chunks/Page.81f4b8d9.mjs +0 -32
- package/chunks/Page.vue_vue_type_style_index_0_lang.cb4f9bf2.mjs +0 -13
- package/chunks/PageHeader.vue_vue_type_style_index_0_lang.3bcca5aa.mjs +0 -26
- package/chunks/PageSkeleton.vue_vue_type_style_index_0_lang.8621381f.mjs +0 -88
- package/chunks/PageableTable.333cbdc1.mjs +0 -335
- package/chunks/PageableTable.vue_vue_type_style_index_0_lang.fd89fb43.mjs +0 -148
- package/chunks/ResizeObserver.60f728f0.mjs +0 -54
- package/chunks/ResizeObserver.vue_vue_type_style_index_0_lang.7079029c.mjs +0 -13
- package/chunks/TableColumn.8503272e.mjs +0 -106
- package/chunks/Toolbar.5c539dbb.mjs +0 -24
- package/chunks/Toolbar.vue_vue_type_style_index_0_lang.7594243c.mjs +0 -275
- package/chunks/ToolbarButton.vue_vue_type_style_index_0_lang.e2cb14ba.mjs +0 -31
- package/chunks/XInputTag.vue_vue_type_style_index_0_lang.7ad045b3.mjs +0 -74
package/fy-form/index.mjs
CHANGED
|
@@ -1,30 +1,595 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var x = (e, i, r) => new Promise((s, p) => {
|
|
2
|
+
var t = (o) => {
|
|
3
3
|
try {
|
|
4
|
-
r
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
a(r.next(o));
|
|
5
|
+
} catch (d) {
|
|
6
|
+
p(d);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, l = (o) => {
|
|
9
9
|
try {
|
|
10
|
-
r
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
a(r.throw(o));
|
|
11
|
+
} catch (d) {
|
|
12
|
+
p(d);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, a = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(t, l);
|
|
15
|
+
a((r = r.apply(e, i)).next());
|
|
16
16
|
});
|
|
17
|
-
import {
|
|
18
|
-
import { i as
|
|
19
|
-
import { s as
|
|
20
|
-
import {
|
|
21
|
-
import { s as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
17
|
+
import { d as V } from "../chunks/detail.d6f8e347.mjs";
|
|
18
|
+
import { i as I } from "../chunks/init.47f219b4.mjs";
|
|
19
|
+
import { s as S, d as F, u as A, x as W, p as G, j as $, a as H, o as R, y as U } from "../chunks/util.ae730cde.mjs";
|
|
20
|
+
import { a as q, c as K, b as J, d as Q, f as X } from "../chunks/dataformat.e655611c.mjs";
|
|
21
|
+
import { s as Y } from "../chunks/dic.eaac0823.mjs";
|
|
22
|
+
import { p as Z } from "../chunks/packages.1fc9ccba.mjs";
|
|
23
|
+
import { isBlank as f } from "@web-utils/core";
|
|
24
|
+
import ee from "element-ui/lib/collapse-item";
|
|
25
|
+
import te from "element-ui/lib/collapse";
|
|
26
|
+
import { n as g } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
27
|
+
import _ from "element-ui/lib/button";
|
|
28
|
+
import N from "element-ui/lib/form-item";
|
|
29
|
+
import E from "element-ui/lib/col";
|
|
30
|
+
import ie from "../chunks/FormTemp.d079292b.mjs";
|
|
31
|
+
import re from "element-ui/lib/tooltip";
|
|
32
|
+
import se from "element-ui/lib/tab-pane";
|
|
33
|
+
import ae from "element-ui/lib/tabs";
|
|
34
|
+
import oe from "element-ui/lib/row";
|
|
35
|
+
import ne from "element-ui/lib/form";
|
|
36
|
+
const le = (e, i, r, s) => {
|
|
37
|
+
if (!s)
|
|
38
|
+
return;
|
|
39
|
+
if (!window.Mock) {
|
|
40
|
+
Z.logs("mock");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const t = (window.Mock || {}).Random, l = {};
|
|
44
|
+
function a({ en: c }) {
|
|
45
|
+
return c ? t.name(!0) : t.cname();
|
|
46
|
+
}
|
|
47
|
+
function o({ max: c, min: n, precision: u }) {
|
|
48
|
+
if (u) {
|
|
49
|
+
const h = `${t.float(n, c, u)}`, m = h.indexOf(".") + 1;
|
|
50
|
+
return Number(h.substring(0, m + u));
|
|
51
|
+
} else
|
|
52
|
+
return t.integer(n, c);
|
|
53
|
+
}
|
|
54
|
+
function d({ header: c }) {
|
|
55
|
+
let n = t.url();
|
|
56
|
+
const u = n.indexOf("://");
|
|
57
|
+
return c === !1 ? n = n.substring(u + 3) : n = `http://${n.substring(u + 3)}`, n;
|
|
58
|
+
}
|
|
59
|
+
function P({ format: c, now: n }) {
|
|
60
|
+
return n ? t.now(c) : t.datetime(c);
|
|
61
|
+
}
|
|
62
|
+
function z({ min: c, max: n }) {
|
|
63
|
+
return t.csentence(c, n);
|
|
64
|
+
}
|
|
65
|
+
function j() {
|
|
66
|
+
return t.county(!0);
|
|
67
|
+
}
|
|
68
|
+
function M({ dic: c, props: n, columnType: u, multiple: h }) {
|
|
69
|
+
const m = n.value || "value", b = c.length;
|
|
70
|
+
if (["checkbox"].includes(u) || h) {
|
|
71
|
+
const v = o({ min: 1, max: b }), y = [];
|
|
72
|
+
for (let O = 0; O < v; O++) {
|
|
73
|
+
let k = !0;
|
|
74
|
+
for (; k; ) {
|
|
75
|
+
const L = o({ min: 0, max: b - 1 }), D = c[L][m];
|
|
76
|
+
y.includes(D) || (y.push(D), k = !1);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return y;
|
|
80
|
+
} else {
|
|
81
|
+
const v = o({ min: 0, max: b - 1 });
|
|
82
|
+
return c[v][m];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function B() {
|
|
86
|
+
Object.keys(e).forEach((c) => {
|
|
87
|
+
const n = e[c];
|
|
88
|
+
if (n.mock && typeof n.mock == "object") {
|
|
89
|
+
const u = n.mock;
|
|
90
|
+
switch (u.dic = typeof n.dicData == "string" ? i[n.dicData] : n.dicData || [], u.props = n.props || {}, u.columnType = n.type, u.multiple = n.multiple, u.type) {
|
|
91
|
+
case "name":
|
|
92
|
+
l[n.prop] = a(u);
|
|
93
|
+
break;
|
|
94
|
+
case "number":
|
|
95
|
+
l[n.prop] = o(u);
|
|
96
|
+
break;
|
|
97
|
+
case "datetime":
|
|
98
|
+
l[n.prop] = P(u);
|
|
99
|
+
break;
|
|
100
|
+
case "word":
|
|
101
|
+
l[n.prop] = z(u);
|
|
102
|
+
break;
|
|
103
|
+
case "url":
|
|
104
|
+
l[n.prop] = d(u);
|
|
105
|
+
break;
|
|
106
|
+
case "county":
|
|
107
|
+
l[n.prop] = j();
|
|
108
|
+
break;
|
|
109
|
+
case "dic":
|
|
110
|
+
l[n.prop] = M(u);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
} else
|
|
114
|
+
n.mock instanceof Function && (l[n.prop] = n.mock(r));
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return B(), l;
|
|
118
|
+
};
|
|
119
|
+
var pe = function() {
|
|
120
|
+
var e = this, i = e.$createElement, r = e._self._c || i;
|
|
121
|
+
return e.display ? r("div", {
|
|
122
|
+
class: ["avue-group", {
|
|
123
|
+
"avue-group--header": !e.isHeader,
|
|
124
|
+
"avue-group__arrow": !e.arrow
|
|
125
|
+
}]
|
|
126
|
+
}, [e._t("tabs"), r(te, {
|
|
127
|
+
attrs: {
|
|
128
|
+
value: e.text
|
|
129
|
+
},
|
|
130
|
+
on: {
|
|
131
|
+
change: e.handleChange
|
|
132
|
+
},
|
|
133
|
+
model: {
|
|
134
|
+
value: e.activeName,
|
|
135
|
+
callback: function(s) {
|
|
136
|
+
e.activeName = s;
|
|
137
|
+
},
|
|
138
|
+
expression: "activeName"
|
|
139
|
+
}
|
|
140
|
+
}, [r(ee, {
|
|
141
|
+
attrs: {
|
|
142
|
+
name: 1,
|
|
143
|
+
disabled: !e.arrow
|
|
144
|
+
},
|
|
145
|
+
scopedSlots: e._u([{
|
|
146
|
+
key: "title",
|
|
147
|
+
fn: function() {
|
|
148
|
+
return [r("div", {
|
|
149
|
+
staticClass: "avue-group__header"
|
|
150
|
+
}, [e._t("header", function() {
|
|
151
|
+
return [e.icon ? r("i", {
|
|
152
|
+
class: [e.icon, "avue-group__icon"]
|
|
153
|
+
}) : e._e(), e.label ? r("h1", {
|
|
154
|
+
staticClass: "avue-group__title"
|
|
155
|
+
}, [e._v(" " + e._s(e.label) + " ")]) : e._e()];
|
|
156
|
+
})], 2)];
|
|
157
|
+
},
|
|
158
|
+
proxy: !0
|
|
159
|
+
}], null, !0)
|
|
160
|
+
}, [e._t("default")], 2)], 1)], 2) : e._e();
|
|
161
|
+
}, ue = [];
|
|
162
|
+
const fe = {
|
|
163
|
+
name: "FormGroup",
|
|
164
|
+
props: {
|
|
165
|
+
arrow: {
|
|
166
|
+
type: Boolean,
|
|
167
|
+
default: !0
|
|
168
|
+
},
|
|
169
|
+
collapse: {
|
|
170
|
+
type: Boolean,
|
|
171
|
+
default: !0
|
|
172
|
+
},
|
|
173
|
+
header: {
|
|
174
|
+
type: Boolean,
|
|
175
|
+
default: !0
|
|
176
|
+
},
|
|
177
|
+
icon: {
|
|
178
|
+
type: String
|
|
179
|
+
},
|
|
180
|
+
display: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: !0
|
|
183
|
+
},
|
|
184
|
+
label: {
|
|
185
|
+
type: String
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
data() {
|
|
189
|
+
return {
|
|
190
|
+
activeName: ""
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
computed: {
|
|
194
|
+
text() {
|
|
195
|
+
return this.collapse ? 1 : 0;
|
|
196
|
+
},
|
|
197
|
+
isHeader() {
|
|
198
|
+
return this.$slots.header && this.header || (this.label || this.icon) && this.header;
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
watch: {
|
|
202
|
+
text(e) {
|
|
203
|
+
this.activeName = [e];
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
created() {
|
|
207
|
+
this.activeName = [this.text];
|
|
208
|
+
},
|
|
209
|
+
methods: {
|
|
210
|
+
handleChange(e) {
|
|
211
|
+
this.$emit("change", e);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}, C = {};
|
|
215
|
+
var ce = /* @__PURE__ */ g(
|
|
216
|
+
fe,
|
|
217
|
+
pe,
|
|
218
|
+
ue,
|
|
219
|
+
!1,
|
|
220
|
+
de,
|
|
221
|
+
null,
|
|
222
|
+
null,
|
|
223
|
+
null
|
|
224
|
+
);
|
|
225
|
+
function de(e) {
|
|
226
|
+
for (let i in C)
|
|
227
|
+
this[i] = C[i];
|
|
228
|
+
}
|
|
229
|
+
const he = /* @__PURE__ */ function() {
|
|
230
|
+
return ce.exports;
|
|
231
|
+
}();
|
|
232
|
+
var me = function() {
|
|
233
|
+
var e = this, i = e.$createElement, r = e._self._c || i;
|
|
234
|
+
return e.formSafe.parentOption.menuBtn !== !1 ? r(E, {
|
|
235
|
+
class: ["menu", e.formSafe.menuPosition, "no-print"],
|
|
236
|
+
style: e.styleName,
|
|
237
|
+
attrs: {
|
|
238
|
+
span: e.menuSpan,
|
|
239
|
+
md: e.menuSpan
|
|
240
|
+
}
|
|
241
|
+
}, [r(N, {
|
|
242
|
+
staticStyle: {
|
|
243
|
+
"text-align": "center"
|
|
244
|
+
},
|
|
245
|
+
attrs: {
|
|
246
|
+
"label-width": "0px"
|
|
247
|
+
}
|
|
248
|
+
}, [e.formSafe.isMock ? r(_, {
|
|
249
|
+
attrs: {
|
|
250
|
+
type: "primary",
|
|
251
|
+
size: e.formSafe.controlSize,
|
|
252
|
+
icon: "el-icon-edit-outline",
|
|
253
|
+
disabled: e.formSafe.allDisabled
|
|
254
|
+
},
|
|
255
|
+
on: {
|
|
256
|
+
click: e.formSafe.handleMock
|
|
257
|
+
}
|
|
258
|
+
}, [e._v(" " + e._s(e.formSafe.parentOption.mockText || "模拟") + " ")]) : e._e(), e.formSafe.isPrint ? r(_, {
|
|
259
|
+
attrs: {
|
|
260
|
+
type: "primary",
|
|
261
|
+
size: e.formSafe.controlSize,
|
|
262
|
+
icon: "el-icon-printer",
|
|
263
|
+
disabled: e.formSafe.allDisabled
|
|
264
|
+
},
|
|
265
|
+
on: {
|
|
266
|
+
click: e.formSafe.handlePrint
|
|
267
|
+
}
|
|
268
|
+
}, [e._v(" " + e._s(e.formSafe.parentOption.printText || "打印") + " ")]) : e._e(), e.formSafe.parentOption.submitBtn !== !1 ? r(_, {
|
|
269
|
+
attrs: {
|
|
270
|
+
type: "primary",
|
|
271
|
+
size: e.formSafe.controlSize,
|
|
272
|
+
icon: e.formSafe.parentOption.submitIcon || "el-icon-check",
|
|
273
|
+
loading: e.formSafe.allDisabled
|
|
274
|
+
},
|
|
275
|
+
on: {
|
|
276
|
+
click: e.formSafe.submit
|
|
277
|
+
}
|
|
278
|
+
}, [e._v(" " + e._s(e.formSafe.parentOption.submitText || "提交") + " ")]) : e._e(), e.formSafe.parentOption.emptyBtn !== !1 ? r(_, {
|
|
279
|
+
attrs: {
|
|
280
|
+
icon: e.formSafe.parentOption.emptyIcon || "el-icon-delete",
|
|
281
|
+
size: e.formSafe.controlSize,
|
|
282
|
+
disabled: e.formSafe.allDisabled
|
|
283
|
+
},
|
|
284
|
+
on: {
|
|
285
|
+
click: e.formSafe.resetForm
|
|
286
|
+
}
|
|
287
|
+
}, [e._v(" " + e._s(e.formSafe.parentOption.emptyText || "清空") + " ")]) : e._e(), e._t("menuForm", null, {
|
|
288
|
+
disabled: e.formSafe.allDisabled,
|
|
289
|
+
size: e.formSafe.controlSize
|
|
290
|
+
})], 2)], 1) : e._e();
|
|
291
|
+
}, _e = [];
|
|
292
|
+
const be = {
|
|
293
|
+
name: "FyFormMenu",
|
|
294
|
+
inject: ["formSafe"],
|
|
295
|
+
computed: {
|
|
296
|
+
menuSpan() {
|
|
297
|
+
return this.formSafe.parentOption.menuSpan || 24;
|
|
298
|
+
},
|
|
299
|
+
styleName() {
|
|
300
|
+
return this.menuSpan !== 24 ? {
|
|
301
|
+
padding: 0
|
|
302
|
+
} : {};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}, w = {};
|
|
306
|
+
var ve = /* @__PURE__ */ g(
|
|
307
|
+
be,
|
|
308
|
+
me,
|
|
309
|
+
_e,
|
|
310
|
+
!1,
|
|
311
|
+
ye,
|
|
312
|
+
null,
|
|
313
|
+
null,
|
|
314
|
+
null
|
|
315
|
+
);
|
|
316
|
+
function ye(e) {
|
|
317
|
+
for (let i in w)
|
|
318
|
+
this[i] = w[i];
|
|
319
|
+
}
|
|
320
|
+
const Se = /* @__PURE__ */ function() {
|
|
321
|
+
return ve.exports;
|
|
322
|
+
}();
|
|
323
|
+
var $e = function() {
|
|
324
|
+
var e = this, i = e.$createElement, r = e._self._c || i;
|
|
325
|
+
return r("div", {
|
|
326
|
+
class: ["avue-form", {
|
|
327
|
+
"avue--detail": e.isDetail
|
|
328
|
+
}],
|
|
329
|
+
style: {
|
|
330
|
+
width: e.setPx(e.parentOption.formWidth, "100%")
|
|
331
|
+
}
|
|
332
|
+
}, [r(ne, {
|
|
333
|
+
ref: "form",
|
|
334
|
+
attrs: {
|
|
335
|
+
"status-icon": e.parentOption.statusIcon,
|
|
336
|
+
model: e.form,
|
|
337
|
+
"label-suffix": e.labelSuffix,
|
|
338
|
+
size: e.$AVUE.formSize || e.controlSize,
|
|
339
|
+
"label-position": e.parentOption.labelPosition,
|
|
340
|
+
"label-width": e.setPx(e.parentOption.labelWidth, e.labelWidth)
|
|
341
|
+
},
|
|
342
|
+
nativeOn: {
|
|
343
|
+
submit: function(s) {
|
|
344
|
+
s.preventDefault();
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}, [r(oe, {
|
|
348
|
+
class: {
|
|
349
|
+
"avue-form__tabs": e.isTabs
|
|
350
|
+
},
|
|
351
|
+
attrs: {
|
|
352
|
+
span: 24
|
|
353
|
+
}
|
|
354
|
+
}, [e._l(e.columnOption, function(s, p) {
|
|
355
|
+
return r("FormGroup", {
|
|
356
|
+
key: s.prop,
|
|
357
|
+
attrs: {
|
|
358
|
+
tabs: e.isTabs,
|
|
359
|
+
arrow: s.arrow,
|
|
360
|
+
collapse: s.collapse,
|
|
361
|
+
display: e.vaildDisplay(s),
|
|
362
|
+
icon: s.icon,
|
|
363
|
+
index: p,
|
|
364
|
+
header: !e.isTabs,
|
|
365
|
+
active: e.activeName,
|
|
366
|
+
label: s.label
|
|
367
|
+
},
|
|
368
|
+
on: {
|
|
369
|
+
change: e.handleGroupClick
|
|
370
|
+
},
|
|
371
|
+
scopedSlots: e._u([{
|
|
372
|
+
key: "tabs",
|
|
373
|
+
fn: function() {
|
|
374
|
+
return [e.isTabs && p === 1 ? r(ae, {
|
|
375
|
+
staticClass: "avue-form__tabs",
|
|
376
|
+
attrs: {
|
|
377
|
+
type: e.tabsType
|
|
378
|
+
},
|
|
379
|
+
on: {
|
|
380
|
+
"tab-click": e.handleTabClick
|
|
381
|
+
},
|
|
382
|
+
model: {
|
|
383
|
+
value: e.activeName,
|
|
384
|
+
callback: function(t) {
|
|
385
|
+
e.activeName = t;
|
|
386
|
+
},
|
|
387
|
+
expression: "activeName"
|
|
388
|
+
}
|
|
389
|
+
}, [e._l(e.columnOption, function(t, l) {
|
|
390
|
+
return [e.vaildDisplay(t) && l !== 0 ? r(se, {
|
|
391
|
+
key: l,
|
|
392
|
+
attrs: {
|
|
393
|
+
name: `${l}`
|
|
394
|
+
},
|
|
395
|
+
scopedSlots: e._u([{
|
|
396
|
+
key: "label",
|
|
397
|
+
fn: function() {
|
|
398
|
+
return [r("span", [e.getSlotName(t, "H", e.$scopedSlots) ? e._t(e.getSlotName(t, "H"), null, {
|
|
399
|
+
column: e.column
|
|
400
|
+
}) : [r("i", {
|
|
401
|
+
class: t.icon
|
|
402
|
+
}, [e._v(" ")]), e._v(" " + e._s(t.label) + " ")]], 2)];
|
|
403
|
+
},
|
|
404
|
+
proxy: !0
|
|
405
|
+
}], null, !0)
|
|
406
|
+
}) : e._e()];
|
|
407
|
+
})], 2) : e._e()];
|
|
408
|
+
},
|
|
409
|
+
proxy: !0
|
|
410
|
+
}, e.getSlotName(s, "H", e.$scopedSlots) ? {
|
|
411
|
+
key: "header",
|
|
412
|
+
fn: function() {
|
|
413
|
+
return [e._t(e.getSlotName(s, "H"), null, {
|
|
414
|
+
column: s
|
|
415
|
+
})];
|
|
416
|
+
},
|
|
417
|
+
proxy: !0
|
|
418
|
+
} : null], null, !0)
|
|
419
|
+
}, [r("div", {
|
|
420
|
+
directives: [{
|
|
421
|
+
name: "show",
|
|
422
|
+
rawName: "v-show",
|
|
423
|
+
value: e.isGroupShow(s, p),
|
|
424
|
+
expression: "isGroupShow(item, index)"
|
|
425
|
+
}],
|
|
426
|
+
class: ["avue-form__group", {
|
|
427
|
+
"avue-form__group--flex": s.flex === !1
|
|
428
|
+
}]
|
|
429
|
+
}, [e._l(s.column, function(t, l) {
|
|
430
|
+
return [e.vaildDisplay(t) ? r(E, {
|
|
431
|
+
key: l,
|
|
432
|
+
class: ["avue-form__row", {
|
|
433
|
+
"avue--detail avue--detail__column": e.vaildDetail(t)
|
|
434
|
+
}, t.className],
|
|
435
|
+
style: {
|
|
436
|
+
paddingLeft: e.gutter,
|
|
437
|
+
paddingRight: e.gutter
|
|
438
|
+
},
|
|
439
|
+
attrs: {
|
|
440
|
+
span: e.getSpan(t),
|
|
441
|
+
md: e.getSpan(t),
|
|
442
|
+
sm: t.smSpan || s.smSpan || 12,
|
|
443
|
+
xs: t.xsSpan || s.xmSpan || 24,
|
|
444
|
+
offset: t.offset || s.offset,
|
|
445
|
+
push: t.push || s.push,
|
|
446
|
+
pull: t.pull || s.pull
|
|
447
|
+
}
|
|
448
|
+
}, [r(N, {
|
|
449
|
+
class: `avue-form__item--${t.labelPosition || s.labelPosition || ""}`,
|
|
450
|
+
attrs: {
|
|
451
|
+
prop: t.prop,
|
|
452
|
+
label: t.label,
|
|
453
|
+
rules: t.rules,
|
|
454
|
+
"label-position": t.labelPosition || s.labelPosition || e.parentOption.labelPosition,
|
|
455
|
+
"label-width": e.getLabelWidth(t, s)
|
|
456
|
+
},
|
|
457
|
+
scopedSlots: e._u([e.getSlotName(t, "L", e.$scopedSlots) ? {
|
|
458
|
+
key: "label",
|
|
459
|
+
fn: function() {
|
|
460
|
+
return [e._t(e.getSlotName(t, "L"), null, {
|
|
461
|
+
column: t,
|
|
462
|
+
value: e.form[t.prop],
|
|
463
|
+
readonly: t.readonly || e.readonly,
|
|
464
|
+
disabled: e.getDisabled(t),
|
|
465
|
+
size: t.size || e.controlSize,
|
|
466
|
+
dic: e.DIC[t.prop]
|
|
467
|
+
})];
|
|
468
|
+
},
|
|
469
|
+
proxy: !0
|
|
470
|
+
} : t.labelTip ? {
|
|
471
|
+
key: "label",
|
|
472
|
+
fn: function() {
|
|
473
|
+
return [r(re, {
|
|
474
|
+
staticClass: "item",
|
|
475
|
+
attrs: {
|
|
476
|
+
effect: "dark",
|
|
477
|
+
placement: t.labelTipPlacement || "top-start"
|
|
478
|
+
},
|
|
479
|
+
scopedSlots: e._u([{
|
|
480
|
+
key: "content",
|
|
481
|
+
fn: function() {
|
|
482
|
+
return [r("div", {
|
|
483
|
+
domProps: {
|
|
484
|
+
innerHTML: e._s(t.labelTip)
|
|
485
|
+
}
|
|
486
|
+
})];
|
|
487
|
+
},
|
|
488
|
+
proxy: !0
|
|
489
|
+
}], null, !0)
|
|
490
|
+
}, [r("i", {
|
|
491
|
+
staticClass: "el-icon-info"
|
|
492
|
+
})]), r("span", [e._v(" " + e._s(t.label) + e._s(e.labelSuffix))])];
|
|
493
|
+
},
|
|
494
|
+
proxy: !0
|
|
495
|
+
} : null, e.getSlotName(t, "E", e.$scopedSlots) ? {
|
|
496
|
+
key: "error",
|
|
497
|
+
fn: function(a) {
|
|
498
|
+
return [e._t(e.getSlotName(t, "E"), null, null, Object.assign(a, {
|
|
499
|
+
column: t,
|
|
500
|
+
value: e.form[t.prop],
|
|
501
|
+
readonly: e.readonly || t.readonly,
|
|
502
|
+
disabled: e.getDisabled(t),
|
|
503
|
+
size: t.size || e.controlSize,
|
|
504
|
+
dic: e.DIC[t.prop]
|
|
505
|
+
}))];
|
|
506
|
+
}
|
|
507
|
+
} : null], null, !0)
|
|
508
|
+
}, [r(e.validTip(t) ? "div" : "elTooltip", {
|
|
509
|
+
tag: "Component",
|
|
510
|
+
attrs: {
|
|
511
|
+
disabled: e.validTip(t),
|
|
512
|
+
content: t.tip || e.getPlaceholder(t),
|
|
513
|
+
placement: t.tipPlacement
|
|
514
|
+
}
|
|
515
|
+
}, [e.$scopedSlots[t.prop] ? e._t(t.prop, null, {
|
|
516
|
+
value: e.form[t.prop],
|
|
517
|
+
column: t,
|
|
518
|
+
label: e.form[`$${t.prop}`],
|
|
519
|
+
size: t.size || e.controlSize,
|
|
520
|
+
readonly: e.readonly || t.readonly,
|
|
521
|
+
disabled: e.getDisabled(t),
|
|
522
|
+
dic: e.DIC[t.prop]
|
|
523
|
+
}) : r("FormTemp", e._b({
|
|
524
|
+
ref: t.prop,
|
|
525
|
+
refInFor: !0,
|
|
526
|
+
attrs: {
|
|
527
|
+
column: t,
|
|
528
|
+
dic: e.DIC[t.prop],
|
|
529
|
+
props: e.parentOption.props,
|
|
530
|
+
"props-http": e.parentOption.propsHttp,
|
|
531
|
+
disabled: e.getDisabled(t),
|
|
532
|
+
readonly: t.readonly || e.readonly,
|
|
533
|
+
enter: e.parentOption.enter,
|
|
534
|
+
size: t.size || e.controlSize,
|
|
535
|
+
"column-slot": e.columnSlot
|
|
536
|
+
},
|
|
537
|
+
on: {
|
|
538
|
+
enter: e.submit,
|
|
539
|
+
change: function(a) {
|
|
540
|
+
return e.propChange(s.column, t);
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
scopedSlots: e._u([e._l(e.getSlotName(t, "T", e.$scopedSlots) ? [t] : [], function(a) {
|
|
544
|
+
return {
|
|
545
|
+
key: e.getSlotName(t, "T"),
|
|
546
|
+
fn: function(o) {
|
|
547
|
+
return [e._t(e.getSlotName(a, "T"), null, null, o)];
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
}), e._l(e.columnSlot, function(a) {
|
|
551
|
+
return {
|
|
552
|
+
key: a,
|
|
553
|
+
fn: function(o) {
|
|
554
|
+
return [e._t(a, null, null, o)];
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
})], null, !0),
|
|
558
|
+
model: {
|
|
559
|
+
value: e.form[t.prop],
|
|
560
|
+
callback: function(a) {
|
|
561
|
+
e.$set(e.form, t.prop, a);
|
|
562
|
+
},
|
|
563
|
+
expression: "form[column.prop]"
|
|
564
|
+
}
|
|
565
|
+
}, "FormTemp", e.uploadFun(t), !1))], 2)], 1)], 1) : e._e(), e.vaildDisplay(t) && t.row && t.span !== 24 && t.count ? r("div", {
|
|
566
|
+
key: `line${l}`,
|
|
567
|
+
staticClass: "avue-form__line",
|
|
568
|
+
style: {
|
|
569
|
+
width: `${t.count / 24 * 100}%`
|
|
570
|
+
}
|
|
571
|
+
}) : e._e()];
|
|
572
|
+
}), !e.isDetail && !e.isMenu ? r("FyFormMenu", {
|
|
573
|
+
scopedSlots: e._u([{
|
|
574
|
+
key: "menuForm",
|
|
575
|
+
fn: function(t) {
|
|
576
|
+
return [e._t("menuForm", null, null, t)];
|
|
577
|
+
}
|
|
578
|
+
}], null, !0)
|
|
579
|
+
}) : e._e()], 2)]);
|
|
580
|
+
}), !e.isDetail && e.isMenu ? r("FyFormMenu", {
|
|
581
|
+
scopedSlots: e._u([{
|
|
582
|
+
key: "menuForm",
|
|
583
|
+
fn: function(s) {
|
|
584
|
+
return [e._t("menuForm", null, null, s)];
|
|
585
|
+
}
|
|
586
|
+
}], null, !0)
|
|
587
|
+
}) : e._e()], 2)], 1)], 1);
|
|
588
|
+
}, ge = [];
|
|
589
|
+
const Oe = {
|
|
25
590
|
name: "FyForm",
|
|
26
|
-
components: { FormTemp:
|
|
27
|
-
mixins: [
|
|
591
|
+
components: { FormTemp: ie, FyFormMenu: Se, FormGroup: he },
|
|
592
|
+
mixins: [I],
|
|
28
593
|
provide() {
|
|
29
594
|
return {
|
|
30
595
|
formSafe: this
|
|
@@ -68,7 +633,7 @@ const S = {
|
|
|
68
633
|
},
|
|
69
634
|
computed: {
|
|
70
635
|
columnSlot() {
|
|
71
|
-
return Object.keys(this.$scopedSlots).filter((
|
|
636
|
+
return Object.keys(this.$scopedSlots).filter((e) => !this.propOption.map((i) => i.prop).includes(e));
|
|
72
637
|
},
|
|
73
638
|
labelSuffix() {
|
|
74
639
|
return this.parentOption.labelSuffix || ":";
|
|
@@ -92,7 +657,7 @@ const S = {
|
|
|
92
657
|
return this.boxType === "view";
|
|
93
658
|
},
|
|
94
659
|
gutter() {
|
|
95
|
-
return
|
|
660
|
+
return S((this.parentOption.gutter || 10) / 2);
|
|
96
661
|
},
|
|
97
662
|
detail() {
|
|
98
663
|
return this.parentOption.detail;
|
|
@@ -110,35 +675,35 @@ const S = {
|
|
|
110
675
|
return this.columnOption.length;
|
|
111
676
|
},
|
|
112
677
|
dynamicOption() {
|
|
113
|
-
const
|
|
114
|
-
return this.propOption.forEach((
|
|
115
|
-
|
|
116
|
-
}),
|
|
678
|
+
const e = [];
|
|
679
|
+
return this.propOption.forEach((i) => {
|
|
680
|
+
i.type === "dynamic" && this.vaildDisplay(i) && e.push(i);
|
|
681
|
+
}), e;
|
|
117
682
|
},
|
|
118
683
|
propOption() {
|
|
119
|
-
const
|
|
120
|
-
return this.columnOption.forEach((
|
|
121
|
-
|
|
122
|
-
|
|
684
|
+
const e = [];
|
|
685
|
+
return this.columnOption.forEach((i) => {
|
|
686
|
+
i.display !== !1 && i.column.forEach((r) => {
|
|
687
|
+
e.push(r);
|
|
123
688
|
});
|
|
124
|
-
}),
|
|
689
|
+
}), e;
|
|
125
690
|
},
|
|
126
691
|
parentOption() {
|
|
127
692
|
return this.tableOption || {};
|
|
128
693
|
},
|
|
129
694
|
columnOption() {
|
|
130
|
-
const
|
|
131
|
-
return
|
|
132
|
-
header: !1,
|
|
133
|
-
column: i
|
|
134
|
-
}), e.length !== 0 && t.push({
|
|
695
|
+
const e = this.tableOption.column || [], i = F(this.tableOption.group) || [], r = this.tableOption.footer || [];
|
|
696
|
+
return i.unshift({
|
|
135
697
|
header: !1,
|
|
136
698
|
column: e
|
|
137
|
-
}),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
699
|
+
}), r.length !== 0 && i.push({
|
|
700
|
+
header: !1,
|
|
701
|
+
column: r
|
|
702
|
+
}), i.forEach((s) => {
|
|
703
|
+
s.column = s.column || [], s.column.forEach((p, t) => {
|
|
704
|
+
p.display !== !1 && !this.isMobile && (p = q(p, this.itemSpanDefault, t === 0));
|
|
705
|
+
}), s.column = K(s.column), s.column = s.column.sort((p, t) => (t.order || 0) - (p.order || 0));
|
|
706
|
+
}), i;
|
|
142
707
|
},
|
|
143
708
|
menuPosition: function() {
|
|
144
709
|
return this.parentOption.menuPosition ? this.parentOption.menuPosition : "center";
|
|
@@ -183,8 +748,8 @@ const S = {
|
|
|
183
748
|
immediate: !0
|
|
184
749
|
},
|
|
185
750
|
allDisabled: {
|
|
186
|
-
handler(
|
|
187
|
-
this.$emit("update:status",
|
|
751
|
+
handler(e) {
|
|
752
|
+
this.$emit("update:status", e);
|
|
188
753
|
},
|
|
189
754
|
deep: !0,
|
|
190
755
|
immediate: !0
|
|
@@ -196,118 +761,118 @@ const S = {
|
|
|
196
761
|
});
|
|
197
762
|
},
|
|
198
763
|
beforeDestroy() {
|
|
199
|
-
Object.keys(this.formBind).forEach((
|
|
200
|
-
this.formBind[
|
|
201
|
-
|
|
764
|
+
Object.keys(this.formBind).forEach((e) => {
|
|
765
|
+
this.formBind[e].forEach((i) => {
|
|
766
|
+
i();
|
|
202
767
|
});
|
|
203
768
|
});
|
|
204
769
|
},
|
|
205
770
|
methods: {
|
|
206
|
-
setPx:
|
|
207
|
-
deepClone:
|
|
208
|
-
getComponent:
|
|
209
|
-
getPlaceholder:
|
|
210
|
-
uploadFun:
|
|
211
|
-
getDisabled(
|
|
212
|
-
return this.vaildDetail(
|
|
771
|
+
setPx: S,
|
|
772
|
+
deepClone: F,
|
|
773
|
+
getComponent: J,
|
|
774
|
+
getPlaceholder: Q,
|
|
775
|
+
uploadFun: A,
|
|
776
|
+
getDisabled(e) {
|
|
777
|
+
return this.vaildDetail(e) || this.isDetail || this.vaildDisabled(e) || this.allDisabled;
|
|
213
778
|
},
|
|
214
|
-
getSpan(
|
|
215
|
-
return
|
|
779
|
+
getSpan(e) {
|
|
780
|
+
return e.span || this.parentOption.span || this.itemSpanDefault;
|
|
216
781
|
},
|
|
217
|
-
isGroupShow(
|
|
218
|
-
return this.isTabs ? `${
|
|
782
|
+
isGroupShow(e, i) {
|
|
783
|
+
return this.isTabs ? `${i}` === this.activeName || i === 0 : !0;
|
|
219
784
|
},
|
|
220
785
|
// 初始化表单
|
|
221
786
|
dataFormat() {
|
|
222
|
-
const
|
|
223
|
-
Object.entries(Object.assign(
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
}), this.$set(this, "form",
|
|
787
|
+
const e = X(this.propOption).tableForm, i = this.value, r = {};
|
|
788
|
+
Object.entries(Object.assign(e, i)).forEach((s) => {
|
|
789
|
+
const p = s[0], t = s[1];
|
|
790
|
+
f(i[p]) ? r[p] = t : r[p] = i[p];
|
|
791
|
+
}), this.$set(this, "form", r), this.setLabel(), this.setControl(), this.setVal(), setTimeout(() => {
|
|
227
792
|
this.formCreate = !0, this.clearValidate();
|
|
228
793
|
});
|
|
229
794
|
},
|
|
230
795
|
setControl() {
|
|
231
|
-
this.propOption.forEach((
|
|
232
|
-
const
|
|
233
|
-
if (!this.formBind[
|
|
234
|
-
const
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
}),
|
|
239
|
-
|
|
796
|
+
this.propOption.forEach((e) => {
|
|
797
|
+
const i = e.prop, r = e.bind, s = e.control;
|
|
798
|
+
if (!this.formBind[i]) {
|
|
799
|
+
const p = [];
|
|
800
|
+
if (r) {
|
|
801
|
+
const t = this.$watch(`form.${i}`, (a, o) => {
|
|
802
|
+
a !== o && W(this.form, r, a);
|
|
803
|
+
}), l = this.$watch(`form.${r}`, (a, o) => {
|
|
804
|
+
a !== o && this.$set(this.form, i, a);
|
|
240
805
|
});
|
|
241
|
-
|
|
806
|
+
p.push(t), p.push(l), this.$set(this.form, i, G(this.form, r));
|
|
242
807
|
}
|
|
243
|
-
if (
|
|
244
|
-
const
|
|
245
|
-
const
|
|
246
|
-
Object.keys(
|
|
247
|
-
const
|
|
248
|
-
this.$set(this.objectOption,
|
|
808
|
+
if (s) {
|
|
809
|
+
const t = () => {
|
|
810
|
+
const a = s(this.form[e.prop], this.form) || {};
|
|
811
|
+
Object.keys(a).forEach((o) => {
|
|
812
|
+
const d = Object.assign(this.objectOption[o] || {}, a[o]);
|
|
813
|
+
this.$set(this.objectOption, o, d), a[o].dicData && (this.DIC[o] = a[o].dicData);
|
|
249
814
|
});
|
|
250
|
-
},
|
|
251
|
-
|
|
815
|
+
}, l = this.$watch(`form.${i}`, () => {
|
|
816
|
+
t();
|
|
252
817
|
});
|
|
253
|
-
|
|
818
|
+
p.push(l), t();
|
|
254
819
|
}
|
|
255
|
-
this.formBind[
|
|
820
|
+
this.formBind[i] = p;
|
|
256
821
|
}
|
|
257
822
|
});
|
|
258
823
|
},
|
|
259
824
|
setForm() {
|
|
260
|
-
Object.keys(this.value).forEach((
|
|
261
|
-
this.$set(this.form,
|
|
825
|
+
Object.keys(this.value).forEach((e) => {
|
|
826
|
+
this.$set(this.form, e, this.value[e]);
|
|
262
827
|
});
|
|
263
828
|
},
|
|
264
829
|
setVal() {
|
|
265
830
|
this.$emit("input", this.form), this.$emit("change", this.form);
|
|
266
831
|
},
|
|
267
832
|
setLabel() {
|
|
268
|
-
this.tableOption.filterNull === !0 && (this.form =
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
833
|
+
this.tableOption.filterNull === !0 && (this.form = $(this.form, [""], !1)), this.tableOption.filterDic === !0 ? this.form = $(this.form, ["$"], !1) : this.propOption.forEach((e) => {
|
|
834
|
+
const i = this.DIC[e.prop];
|
|
835
|
+
if (f(i))
|
|
271
836
|
return;
|
|
272
|
-
const
|
|
273
|
-
|
|
837
|
+
const r = V(this.form, e, this.tableOption, i);
|
|
838
|
+
r ? this.$set(this.form, `$${e.prop}`, r) : this.$delete(this.form, `$${e.prop}`);
|
|
274
839
|
});
|
|
275
840
|
},
|
|
276
|
-
handleGroupClick(
|
|
277
|
-
this.$emit("tab-click",
|
|
841
|
+
handleGroupClick(e) {
|
|
842
|
+
this.$emit("tab-click", e);
|
|
278
843
|
},
|
|
279
|
-
handleTabClick(
|
|
280
|
-
this.$emit("tab-click",
|
|
844
|
+
handleTabClick(e, i) {
|
|
845
|
+
this.$emit("tab-click", e, i);
|
|
281
846
|
},
|
|
282
|
-
getLabelWidth(
|
|
283
|
-
let
|
|
284
|
-
return
|
|
847
|
+
getLabelWidth(e, i) {
|
|
848
|
+
let r;
|
|
849
|
+
return f(e.labelWidth) ? f(i.labelWidth) ? r = this.parentOption.labelWidth : r = i.labelWidth : r = e.labelWidth, S(r, this.labelWidth);
|
|
285
850
|
},
|
|
286
851
|
// 对部分表单字段进行校验的方法
|
|
287
|
-
validateField(
|
|
288
|
-
return this.$refs.form.validateField(
|
|
852
|
+
validateField(e) {
|
|
853
|
+
return this.$refs.form.validateField(e);
|
|
289
854
|
},
|
|
290
|
-
validTip(
|
|
291
|
-
return !
|
|
855
|
+
validTip(e) {
|
|
856
|
+
return !e.tip || e.type === "upload";
|
|
292
857
|
},
|
|
293
|
-
getPropRef(
|
|
294
|
-
return this.$refs[
|
|
858
|
+
getPropRef(e) {
|
|
859
|
+
return this.$refs[e][0];
|
|
295
860
|
},
|
|
296
|
-
handleChange(
|
|
861
|
+
handleChange(e, i) {
|
|
297
862
|
this.$nextTick(() => {
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
this.form[
|
|
303
|
-
}), !(
|
|
304
|
-
column:
|
|
305
|
-
value:
|
|
863
|
+
const r = i.cascader, s = r.join(",");
|
|
864
|
+
r.forEach((p) => {
|
|
865
|
+
const t = p, l = this.form[i.prop], a = this.findObject(e, t);
|
|
866
|
+
f(a) || (this.formList.includes(s) && r.forEach((o) => {
|
|
867
|
+
this.form[o] = "", this.$set(this.DIC, o, []);
|
|
868
|
+
}), !(f(r) || f(l) || f(a)) && Y({
|
|
869
|
+
column: a,
|
|
870
|
+
value: l,
|
|
306
871
|
form: this.form
|
|
307
|
-
}).then((
|
|
308
|
-
this.formList.includes(
|
|
309
|
-
const
|
|
310
|
-
this.$set(this.DIC,
|
|
872
|
+
}).then((o) => {
|
|
873
|
+
this.formList.includes(s) || this.formList.push(s);
|
|
874
|
+
const d = o || [];
|
|
875
|
+
this.$set(this.DIC, t, d), !f(d) && !f(d) && !f(a.cascaderIndex) && f(this.form[t]) && (this.form[t] = d[a.cascaderIndex][(a.props || {}).value || H.value]);
|
|
311
876
|
}));
|
|
312
877
|
});
|
|
313
878
|
});
|
|
@@ -315,87 +880,87 @@ const S = {
|
|
|
315
880
|
handlePrint() {
|
|
316
881
|
this.$Print(this.$el);
|
|
317
882
|
},
|
|
318
|
-
propChange(
|
|
319
|
-
|
|
883
|
+
propChange(e, i) {
|
|
884
|
+
i.cascader && this.handleChange(e, i);
|
|
320
885
|
},
|
|
321
886
|
handleMock() {
|
|
322
|
-
this.isMock && (this.columnOption.forEach((
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
this.form[
|
|
887
|
+
this.isMock && (this.columnOption.forEach((e) => {
|
|
888
|
+
const i = le(e.column, this.DIC, this.form, this.isMock);
|
|
889
|
+
f(i) || Object.keys(i).forEach((r) => {
|
|
890
|
+
this.form[r] = i[r];
|
|
326
891
|
});
|
|
327
892
|
}), this.$nextTick(() => {
|
|
328
893
|
this.clearValidate(), this.$emit("mock-change", this.form);
|
|
329
894
|
}));
|
|
330
895
|
},
|
|
331
|
-
vaildDetail(
|
|
332
|
-
let
|
|
896
|
+
vaildDetail(e) {
|
|
897
|
+
let i;
|
|
333
898
|
if (this.detail)
|
|
334
899
|
return !1;
|
|
335
|
-
if (!
|
|
336
|
-
|
|
900
|
+
if (!f(e.detail))
|
|
901
|
+
i = "detail";
|
|
337
902
|
else if (this.isAdd)
|
|
338
|
-
|
|
903
|
+
i = "addDetail";
|
|
339
904
|
else if (this.isEdit)
|
|
340
|
-
|
|
905
|
+
i = "editDetail";
|
|
341
906
|
else if (this.isView)
|
|
342
907
|
return !1;
|
|
343
|
-
return
|
|
908
|
+
return i ? e[i] === !0 : !1;
|
|
344
909
|
},
|
|
345
910
|
// 验证表单是否禁止
|
|
346
|
-
vaildDisabled(
|
|
347
|
-
let
|
|
911
|
+
vaildDisabled(e) {
|
|
912
|
+
let i;
|
|
348
913
|
if (this.disabled)
|
|
349
914
|
return !0;
|
|
350
|
-
if (!
|
|
351
|
-
|
|
915
|
+
if (!f(e.disabled))
|
|
916
|
+
i = "disabled";
|
|
352
917
|
else if (this.isAdd)
|
|
353
|
-
|
|
918
|
+
i = "addDisabled";
|
|
354
919
|
else if (this.isEdit)
|
|
355
|
-
|
|
920
|
+
i = "editDisabled";
|
|
356
921
|
else if (this.isView)
|
|
357
922
|
return !0;
|
|
358
|
-
return
|
|
923
|
+
return i ? e[i] === !0 : !1;
|
|
359
924
|
},
|
|
360
925
|
// 验证表单是否显隐
|
|
361
|
-
vaildDisplay(
|
|
362
|
-
let
|
|
363
|
-
return
|
|
364
|
-
},
|
|
365
|
-
clearValidate(
|
|
366
|
-
return
|
|
367
|
-
var
|
|
368
|
-
(
|
|
926
|
+
vaildDisplay(e) {
|
|
927
|
+
let i;
|
|
928
|
+
return f(e.display) ? this.isAdd ? i = "addDisplay" : this.isEdit ? i = "editDisplay" : this.isView && (i = "viewDisplay") : i = "display", i ? R(e[i], !0) : !0;
|
|
929
|
+
},
|
|
930
|
+
clearValidate(e) {
|
|
931
|
+
return x(this, null, function* () {
|
|
932
|
+
var i;
|
|
933
|
+
(i = this.$refs.form) == null || i.clearValidate(e);
|
|
369
934
|
});
|
|
370
935
|
},
|
|
371
936
|
validateCellForm() {
|
|
372
|
-
return new Promise((
|
|
373
|
-
this.$refs.form.validate((
|
|
374
|
-
|
|
937
|
+
return new Promise((e) => {
|
|
938
|
+
this.$refs.form.validate((i, r) => {
|
|
939
|
+
e(r);
|
|
375
940
|
});
|
|
376
941
|
});
|
|
377
942
|
},
|
|
378
|
-
validate(
|
|
379
|
-
this.$refs.form.validate((
|
|
380
|
-
const
|
|
381
|
-
this.dynamicOption.forEach((
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
}) :
|
|
386
|
-
}), Promise.all(
|
|
387
|
-
|
|
388
|
-
|
|
943
|
+
validate(e) {
|
|
944
|
+
this.$refs.form.validate((i, r) => {
|
|
945
|
+
const s = [], p = [], t = {};
|
|
946
|
+
this.dynamicOption.forEach((l) => {
|
|
947
|
+
const a = l.children.type === "form";
|
|
948
|
+
p.push(l.prop), a ? f(this.$refs[l.prop][0].$refs.temp.$refs.main) || this.$refs[l.prop][0].$refs.temp.$refs.main.forEach((o) => {
|
|
949
|
+
s.push(o.validateCellForm());
|
|
950
|
+
}) : s.push(this.$refs[l.prop][0].$refs.temp.$refs.main.validateCellForm());
|
|
951
|
+
}), Promise.all(s).then((l) => {
|
|
952
|
+
l.forEach((o, d) => {
|
|
953
|
+
f(o) || (t[p[d]] = o);
|
|
389
954
|
});
|
|
390
|
-
const
|
|
391
|
-
|
|
955
|
+
const a = Object.assign(t, r);
|
|
956
|
+
f(a) ? (this.show(), e(!0, this.hide)) : e(!1, this.hide, a);
|
|
392
957
|
});
|
|
393
958
|
});
|
|
394
959
|
},
|
|
395
|
-
resetForm(
|
|
396
|
-
if (
|
|
397
|
-
const
|
|
398
|
-
this.form =
|
|
960
|
+
resetForm(e = !0) {
|
|
961
|
+
if (e) {
|
|
962
|
+
const i = this.propOption.map((r) => r.prop);
|
|
963
|
+
this.form = U(this.form, i, (this.tableOption.filterParams || []).concat([this.rowKey]));
|
|
399
964
|
}
|
|
400
965
|
this.$nextTick(() => {
|
|
401
966
|
this.clearValidate(), this.$emit("reset-change");
|
|
@@ -411,29 +976,29 @@ const S = {
|
|
|
411
976
|
this.allDisabled = !1;
|
|
412
977
|
},
|
|
413
978
|
submit() {
|
|
414
|
-
this.validate((
|
|
415
|
-
|
|
979
|
+
this.validate((e, i) => {
|
|
980
|
+
e ? this.$emit("submit", $(this.form, ["$"]), this.hide) : this.$emit("error", i);
|
|
416
981
|
});
|
|
417
982
|
}
|
|
418
983
|
}
|
|
419
|
-
},
|
|
420
|
-
var
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
984
|
+
}, T = {};
|
|
985
|
+
var ke = /* @__PURE__ */ g(
|
|
986
|
+
Oe,
|
|
987
|
+
$e,
|
|
988
|
+
ge,
|
|
424
989
|
!1,
|
|
425
|
-
|
|
990
|
+
De,
|
|
426
991
|
null,
|
|
427
992
|
null,
|
|
428
993
|
null
|
|
429
994
|
);
|
|
430
|
-
function
|
|
431
|
-
for (let
|
|
432
|
-
this[
|
|
995
|
+
function De(e) {
|
|
996
|
+
for (let i in T)
|
|
997
|
+
this[i] = T[i];
|
|
433
998
|
}
|
|
434
|
-
const
|
|
435
|
-
return
|
|
999
|
+
const Ue = /* @__PURE__ */ function() {
|
|
1000
|
+
return ke.exports;
|
|
436
1001
|
}();
|
|
437
1002
|
export {
|
|
438
|
-
|
|
1003
|
+
Ue as default
|
|
439
1004
|
};
|