@lingshugroup/web-plus 1.0.28 → 1.0.30
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/README.md +3 -1
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/node_modules/.pnpm/jszip@3.10.1/node_modules/jszip/dist/jszip.min/index.js.gz +0 -0
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.cjs +1 -1
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.js +72 -67
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.js.br +0 -0
- package/lib/packages/ls-components/components/_hooks/useTableListHook/index.js.gz +0 -0
- package/lib/packages/ls-components/components/button/Button.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/button/Button.vue/index.js +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js +2 -1
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/dialog/Index.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/form/Form.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index.js +2 -2
- package/lib/packages/ls-components/components/form/Form.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/Form.vue/index2.js +105 -91
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/Form.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/FormItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index.js +2 -2
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js +98 -99
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/form/FormItem.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/form/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/form/types/index.js +4 -0
- package/lib/packages/ls-components/components/form/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/form/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/list/List.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/list/List.vue/index.js +2 -2
- package/lib/packages/ls-components/components/list/List.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/list/List.vue/index2.js +133 -127
- package/lib/packages/ls-components/components/list/List.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/list/List.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/preview/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js +42 -34
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/table/Table.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/table/Table.vue/index.js +2 -2
- package/lib/packages/ls-components/components/table/Table.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/table/Table.vue/index2.js +145 -136
- package/lib/packages/ls-components/components/table/Table.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/table/Table.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
- package/package.json +1 -1
package/lib/index.css.br
CHANGED
|
Binary file
|
package/lib/index.css.gz
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var E=Object.defineProperty;var
|
|
1
|
+
"use strict";var E=Object.defineProperty;var l=(c,f)=>E(c,"name",{value:f,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const H=require("../useDelayLoader/index.cjs"),t=require("vue");function O(c,f,M){const{currentPageProp:N=1,pageSizeProp:R=10,pageSizesProp:q=[10,20,30,40,50,100],isDelayLoader:y=!1,delayLoaderTime:F=300,isFullDose:P=!1,autoFetch:_=!0,hasPanigation:S=!0,dealParams:D,dealData:o,callbackAfter:h}=M||{},b=t.ref(!0),v=t.ref(!1),u=t.ref(N),r=t.ref(R),x=t.ref(q),i=t.ref([]),T=t.ref([]),d=t.ref(0),z=l(e=>{if(S){if(P){let a=e||[],n=a.length;if(o&&typeof o=="function"){const{data:p,total:s=0}=o(e);a=p||[],n=Number(s||0)}T.value=a,d.value=n,m()}else if(o&&typeof o=="function"){const{data:a,total:n=0}=o(e);i.value=a||[],d.value=Number(n||0)}else{const{records:a=[],total:n}=e||{};i.value=a||[],d.value=Number(n)}h&&h(e,{tableData:i,total:d})}else i.value=e,h&&h(e,{})},"disposeResponseData"),w=l(()=>new Promise((e,a)=>{if(!c){a(new Error("requestFn is required"));return}const n=(typeof f=="function"?f():f)||{};let p={currentPage:S?u.value:null,pageSize:S?r.value:null,...n};D&&(p=D(p)),c(p).then(s=>{y||z(s),e(s)}).catch(s=>{a(s)}).finally(()=>{v.value=!1,setTimeout(()=>{b.value=!1},400)})}),"requestData"),L=H.default(F||300,e=>{z(e)});function m(){i.value=T.value.slice((u.value-1)*r.value,u.value*r.value)}l(m,"sliceTableData");const g=l((e=!0,a=!1)=>{if(c&&!(e&&v.value)){if(e&&(v.value=!0),a&&(b.value=!0),y){L.loadData(w);return}w().finally(()=>{v.value=!1})}},"loadData");t.watch(u,e=>{k(e)}),t.watch(r,e=>{C(e)});const k=l(e=>{u.value=e,P?m():g()},"handleCurrentPageChange"),C=l(e=>{r.value=e,u.value=1,P?m():g()},"handleSizeChange"),A=l(()=>{u.value=1,t.nextTick(()=>{g()})},"handleReset");return t.onMounted(()=>{_&&(b.value=!0,g())}),{isFirst:b,loading:y?L.loading:v,pageSize:r,pageSizes:x,currentPage:u,tableData:i,total:d,handleCurrentPageChange:k,handleSizeChange:C,handleReset:A,loadData:g}}l(O,"useTableListHook");exports.default=O;
|
|
@@ -1,103 +1,108 @@
|
|
|
1
1
|
var B = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var t = (c, f) => B(c, "name", { value: f, configurable: !0 });
|
|
3
3
|
import G from "../useDelayLoader/index.js";
|
|
4
|
-
import { ref as
|
|
5
|
-
function U(
|
|
4
|
+
import { ref as n, watch as N, onMounted as I, nextTick as J } from "vue";
|
|
5
|
+
function U(c, f, R) {
|
|
6
6
|
const {
|
|
7
|
-
currentPageProp:
|
|
8
|
-
pageSizeProp:
|
|
7
|
+
currentPageProp: x = 1,
|
|
8
|
+
pageSizeProp: F = 10,
|
|
9
9
|
pageSizesProp: A = [10, 20, 30, 40, 50, 100],
|
|
10
|
-
isDelayLoader:
|
|
10
|
+
isDelayLoader: y = !1,
|
|
11
11
|
delayLoaderTime: E = 300,
|
|
12
|
-
isFullDose:
|
|
12
|
+
isFullDose: P = !1,
|
|
13
13
|
autoFetch: H = !0,
|
|
14
|
-
hasPanigation:
|
|
15
|
-
dealParams:
|
|
16
|
-
dealData:
|
|
17
|
-
callbackAfter:
|
|
18
|
-
} =
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
hasPanigation: b = !0,
|
|
15
|
+
dealParams: S,
|
|
16
|
+
dealData: u,
|
|
17
|
+
callbackAfter: m
|
|
18
|
+
} = R || {}, h = n(!0), v = n(!1), l = n(x), i = n(F), M = n(A), s = n([]), z = n([]), d = n(0), T = /* @__PURE__ */ t((e) => {
|
|
19
|
+
if (b) {
|
|
20
|
+
if (P) {
|
|
21
|
+
let a = e || [], o = a.length;
|
|
22
|
+
if (u && typeof u == "function") {
|
|
23
|
+
const { data: g, total: r = 0 } = u(e);
|
|
24
|
+
a = g || [], o = Number(r || 0);
|
|
25
|
+
}
|
|
26
|
+
z.value = a, d.value = o, D();
|
|
27
|
+
} else if (u && typeof u == "function") {
|
|
28
|
+
const { data: a, total: o = 0 } = u(e);
|
|
29
|
+
s.value = a || [], d.value = Number(o || 0);
|
|
26
30
|
} else {
|
|
27
|
-
const { records: a = [], total:
|
|
28
|
-
|
|
31
|
+
const { records: a = [], total: o } = e || {};
|
|
32
|
+
s.value = a || [], d.value = Number(o);
|
|
29
33
|
}
|
|
30
|
-
|
|
34
|
+
m && m(e, { tableData: s, total: d });
|
|
31
35
|
} else
|
|
32
|
-
|
|
33
|
-
}, "disposeResponseData"), w = /* @__PURE__ */
|
|
34
|
-
if (!
|
|
36
|
+
s.value = e, m && m(e, {});
|
|
37
|
+
}, "disposeResponseData"), w = /* @__PURE__ */ t(() => new Promise((e, a) => {
|
|
38
|
+
if (!c) {
|
|
35
39
|
a(new Error("requestFn is required"));
|
|
36
40
|
return;
|
|
37
41
|
}
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
currentPage:
|
|
41
|
-
pageSize:
|
|
42
|
-
...
|
|
42
|
+
const o = (typeof f == "function" ? f() : f) || {};
|
|
43
|
+
let g = {
|
|
44
|
+
currentPage: b ? l.value : null,
|
|
45
|
+
pageSize: b ? i.value : null,
|
|
46
|
+
...o
|
|
43
47
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}).catch((
|
|
47
|
-
a(
|
|
48
|
+
S && (g = S(g)), c(g).then((r) => {
|
|
49
|
+
y || T(r), e(r);
|
|
50
|
+
}).catch((r) => {
|
|
51
|
+
a(r);
|
|
48
52
|
}).finally(() => {
|
|
49
|
-
|
|
53
|
+
v.value = !1, setTimeout(() => {
|
|
50
54
|
h.value = !1;
|
|
51
55
|
}, 400);
|
|
52
56
|
});
|
|
53
|
-
}), "requestData"),
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
}), "requestData"), L = G(E || 300, (e) => {
|
|
58
|
+
T(e);
|
|
59
|
+
});
|
|
60
|
+
function D() {
|
|
61
|
+
s.value = z.value.slice((l.value - 1) * i.value, l.value * i.value);
|
|
62
|
+
}
|
|
63
|
+
t(D, "sliceTableData");
|
|
64
|
+
const p = /* @__PURE__ */ t((e = !0, a = !1) => {
|
|
65
|
+
if (c && !(e && v.value)) {
|
|
66
|
+
if (e && (v.value = !0), a && (h.value = !0), y) {
|
|
67
|
+
L.loadData(w);
|
|
59
68
|
return;
|
|
60
69
|
}
|
|
61
70
|
w().finally(() => {
|
|
62
|
-
|
|
71
|
+
v.value = !1;
|
|
63
72
|
});
|
|
64
73
|
}
|
|
65
74
|
}, "loadData");
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
-
|
|
75
|
+
N(l, (e) => {
|
|
76
|
+
k(e);
|
|
77
|
+
}), N(i, (e) => {
|
|
78
|
+
C(e);
|
|
70
79
|
});
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
}, "handleCurrentPageChange"),
|
|
74
|
-
|
|
75
|
-
}, "handleSizeChange"), q = /* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
const k = /* @__PURE__ */ t((e) => {
|
|
81
|
+
l.value = e, P ? D() : p();
|
|
82
|
+
}, "handleCurrentPageChange"), C = /* @__PURE__ */ t((e) => {
|
|
83
|
+
i.value = e, l.value = 1, P ? D() : p();
|
|
84
|
+
}, "handleSizeChange"), q = /* @__PURE__ */ t(() => {
|
|
85
|
+
l.value = 1, J(() => {
|
|
86
|
+
p();
|
|
78
87
|
});
|
|
79
88
|
}, "handleReset");
|
|
80
89
|
return I(() => {
|
|
81
|
-
H && (h.value = !0,
|
|
90
|
+
H && (h.value = !0, p());
|
|
82
91
|
}), {
|
|
83
92
|
isFirst: h,
|
|
84
|
-
loading:
|
|
85
|
-
pageSize:
|
|
93
|
+
loading: y ? L.loading : v,
|
|
94
|
+
pageSize: i,
|
|
86
95
|
pageSizes: M,
|
|
87
|
-
currentPage:
|
|
88
|
-
tableData:
|
|
89
|
-
total:
|
|
90
|
-
handleCurrentPageChange:
|
|
91
|
-
handleSizeChange:
|
|
96
|
+
currentPage: l,
|
|
97
|
+
tableData: s,
|
|
98
|
+
total: d,
|
|
99
|
+
handleCurrentPageChange: k,
|
|
100
|
+
handleSizeChange: C,
|
|
92
101
|
handleReset: q,
|
|
93
|
-
loadData:
|
|
102
|
+
loadData: p
|
|
94
103
|
};
|
|
95
104
|
}
|
|
96
|
-
|
|
97
|
-
function N(t, s, D, d, g) {
|
|
98
|
-
t.value = s.value.slice((d.value - 1) * g.value, d.value * g.value), D.value = t.value.length;
|
|
99
|
-
}
|
|
100
|
-
l(N, "sliceTableData");
|
|
105
|
+
t(U, "useTableListHook");
|
|
101
106
|
export {
|
|
102
107
|
U as default
|
|
103
108
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-e70ddbd2"]]);exports.default=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e70ddbd2"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var N=Object.defineProperty;var l=(n,a)=>N(n,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),_=,/* empty css */k=,/* empty css */s=,/* empty css */D=,/* empty css */x=,/* empty css */M=,/* empty css */P={key:1,class:"content-wrap"},$={class:"dialog-footer"},E=e.defineComponent({name:"LSDialog",inheritAttrs:!1,__name:"Index",props:e.mergeModels(k.lsDialogProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(k.lsEmitNames,["update:modelValue"]),setup(n,{expose:a,emit:S}){const r=n,i=S,v=e.useSlots(),t=e.useModel(n,"modelValue"),y=_.useNamespace("dialog").b(),d=e.ref(),u=e.ref({width:"50%",closeOnClickModal:!1,closeOnPressEscape:!1,zIndex:2e3}),c=e.ref(0);e.watch(()=>t==null?void 0:t.value,o=>{o&&r.openScroll&&p()},{immediate:!0,deep:!0});const f=e.computed(()=>s.default({txt:"取消"},r.btnCancelConfig)),m=e.computed(()=>s.default({type:"primary",txt:"确认"},r.btnConfirmConfig));function g(){t.value=!1,i("onCancel")}l(g,"handleClose");function B(){i("onConfirm")}l(B,"handleConfirm");async function p(){await e.nextTick();const o=r.hasFooter?108:60;c.value=parseInt(getComputedStyle(d.value.querySelector(".el-dialog")).height)-o}return l(p,"updateHeight"),a({updateHeight:p}),(o,
|
|
1
|
+
"use strict";var N=Object.defineProperty;var l=(n,a)=>N(n,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),_=,/* empty css */k=,/* empty css */s=,/* empty css */D=,/* empty css */x=,/* empty css */M=,/* empty css */P={key:1,class:"content-wrap"},$={class:"dialog-footer"},E=e.defineComponent({name:"LSDialog",inheritAttrs:!1,__name:"Index",props:e.mergeModels(k.lsDialogProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(k.lsEmitNames,["update:modelValue"]),setup(n,{expose:a,emit:S}){const r=n,i=S,v=e.useSlots(),t=e.useModel(n,"modelValue"),y=_.useNamespace("dialog").b(),d=e.ref(),u=e.ref({width:"50%",closeOnClickModal:!1,closeOnPressEscape:!1,zIndex:2e3,alignCenter:!0}),c=e.ref(0);e.watch(()=>t==null?void 0:t.value,o=>{o&&r.openScroll&&p()},{immediate:!0,deep:!0});const f=e.computed(()=>s.default({txt:"取消"},r.btnCancelConfig)),m=e.computed(()=>s.default({type:"primary",txt:"确认"},r.btnConfirmConfig));function g(){t.value=!1,i("onCancel")}l(g,"handleClose");function B(){i("onConfirm")}l(B,"handleConfirm");async function p(){await e.nextTick();const o=r.hasFooter?108:60;c.value=parseInt(getComputedStyle(d.value.querySelector(".el-dialog")).height)-o}return l(p,"updateHeight"),a({updateHeight:p}),(o,C)=>{const q=D.ElScrollbar,h=e.resolveComponent("LSButton"),w=x.ElDialog,V=M.vLoading;return e.openBlock(),e.createBlock(w,e.mergeProps({ref_key:"lsDialogRef",ref:d,class:e.unref(y),modelValue:t.value,"onUpdate:modelValue":C[0]||(C[0]=b=>t.value=b)},e.unref(s.default)(e.unref(u),o.$attrs),{"show-close":!o.loading,onClose:g}),e.createSlots({header:e.withCtx(()=>[e.renderSlot(o.$slots,"header")]),default:e.withCtx(()=>[o.openScroll?e.withDirectives((e.openBlock(),e.createBlock(q,e.mergeProps({key:0},e.unref(s.default)(e.unref(u),o.$attrs),{"max-height":e.unref(c)}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16,["max-height"])),[[V,o.contentLoading]]):(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(o.$slots,"default")]))]),_:2},[o.hasFooter?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",$,[e.unref(v).footer?e.renderSlot(o.$slots,"footer",{key:0}):e.createCommentVNode("",!0),o.hasCancelBtn?(e.openBlock(),e.createBlock(h,e.mergeProps({key:1},e.unref(f),{disabled:o.loading,onClick:g}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f).txt),1)]),_:1},16,["disabled"])):e.createCommentVNode("",!0),e.createVNode(h,e.mergeProps(e.unref(m),{loading:o.loading,disabled:o.loading,onClick:B}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m).txt),1)]),_:1},16,["loading","disabled"])])]),key:"0"}:void 0]),1040,["class","modelValue","show-close"])}}});exports.default=E;
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */r=t.default(e.default,[["__scopeId","data-v-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */r=t.default(e.default,[["__scopeId","data-v-61d73833"]]);exports.default=r;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-61d73833"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _=Object.defineProperty;var
|
|
1
|
+
"use strict";var _=Object.defineProperty;var u=(a,m)=>_(a,"name",{value:m,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),B=,/* empty css */I=,/* empty css */L=,/* empty css */p=,/* empty css */T=,/* empty css */D=,/* empty css */O=,/* empty css */M=,/* empty css */S=,/* empty css */z=,/* empty css */A=u(a=>(e.pushScopeId("data-v-61d73833"),a=a(),e.popScopeId(),a),"_withScopeId"),U={class:"ls-form"},j=A(()=>e.createElementVNode("span",null,null,-1)),W=e.defineComponent({name:"LSForm"}),Y=e.defineComponent({...W,props:I.lsFormProps,emits:["submit","reset","update:form-data","onChange"],setup(a,{expose:m,emit:q}){const $=a,k=q,l=e.useAttrs(),F=e.computed(()=>l&&l.hasOwnProperty("inline")?typeof l.inline=="boolean"&&l.inline===!1?{label:""}:l&&l["label-position"]==="top"?{label:"",class:"form-item-buttons "}:{label:""}:l&&l["label-position"]==="top"?{label:"","label-position":"top"}:{label:""}),i=e.ref(),y=["label","input","textarea","number","radio","checkbox","select","date","datetimerange","timePicker","timeSelect","cascader","multipleCascader","switch","inputRange","inputNumberRange","slot","itemSlot"];let r=e.reactive({});function C(o){o&&(o.resetFields(),k("reset",r))}u(C,"resetForm");async function h(o){o&&await o.validate((n,s)=>{n?k("submit",r):console.warn("error submit!",s)})}u(h,"submitForm");function E(){return new Promise((o,n)=>{if(!i.value)return o(!1);i.value.validate((s,f)=>{s?o(r):(console.warn("error submit!",f),n(f))})})}u(E,"validate");function d(o,n){T.default(r,o,n)}u(d,"updateFormData"),e.watch(()=>$.formData,o=>{r=o||{}},{deep:!0,immediate:!0});function g(o,n,s){k("onChange",o,n,s)}return u(g,"onChange"),m({FormRef:i,validate:E,submitForm:h,resetForm:C}),(o,n)=>{const s=D.ElCol,f=O.ElRow,w=M.ElButton,P=S.ElFormItem,R=S.ElForm,N=z.ElConfigProvider;return e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N,{locale:e.unref(L.default),"value-on-clear":void 0,"empty-values":[void 0,null]},{default:e.withCtx(()=>[e.createVNode(R,e.mergeProps({ref_key:"FormRef",ref:i,"label-position":"left","require-asterisk-position":"right","label-width":o.labelWidth,"hide-required-asterisk":!!o.read},o.$attrs,{model:e.unref(r),disabled:o.loading||o.disabled,class:[o.read&&o.hasDefReadStyle?"show-label":""]}),{default:e.withCtx(()=>[o.column>1?(e.openBlock(),e.createBlock(f,{key:0,gutter:10},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.formItems,(t,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.prop},[t.hideColumn?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s,{key:0,span:t.isRow?24:24/o.column},{default:e.withCtx(()=>[t.type==="slot"?e.renderSlot(o.$slots,t.prop,{key:0,slotRow:{...t},value:e.unref(p.default)(e.unref(r),t.prop),updateFormData:d},void 0,!0):y.includes(t.type)?(e.openBlock(),e.createBlock(B.default,e.mergeProps({key:1,"is-value":!0,value:e.unref(p.default)(e.unref(r),t.prop),colon:o.colon,read:o.read,"label-empty":o.labelEmpty,index:b,ref_for:!0},t,{"onUpdate:value":d,onOnChange:g}),e.createSlots({_:2},[e.renderList(o.$slots,(V,c)=>({name:c,fn:e.withCtx(v=>[e.renderSlot(o.$slots,c,e.mergeProps({ref_for:!0},v),void 0,!0)])}))]),1040,["value","colon","read","label-empty","index"])):e.renderSlot(o.$slots,t.type,{key:2,slotRow:{...t},value:e.unref(p.default)(e.unref(r),t.prop),updateFormData:d},void 0,!0)]),_:2},1032,["span"]))],64))),128))]),_:3})):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(o.formItems,(t,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:t.prop},[t.hideColumn?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.type==="slot"?e.renderSlot(o.$slots,t.prop,{key:0,slotRow:{...t},value:e.unref(p.default)(e.unref(r),t.prop),updateFormData:d},void 0,!0):y.includes(t.type)?(e.openBlock(),e.createBlock(B.default,e.mergeProps({key:1,"is-value":!0,value:e.unref(p.default)(e.unref(r),t.prop),colon:o.colon,read:o.read,"label-empty":o.labelEmpty,index:b,ref_for:!0},t,{"onUpdate:value":d,onOnChange:g}),e.createSlots({_:2},[e.renderList(o.$slots,(V,c)=>({name:c,fn:e.withCtx(v=>[e.renderSlot(o.$slots,c,e.mergeProps({ref_for:!0},v),void 0,!0)])}))]),1040,["value","colon","read","label-empty","index"])):e.renderSlot(o.$slots,t.type,{key:2,slotRow:{...t},value:e.unref(p.default)(e.unref(r),t.prop),updateFormData:d},void 0,!0)],64))],64))),128)),e.renderSlot(o.$slots,"default",{},void 0,!0),o.showButtons?(e.openBlock(),e.createBlock(P,e.mergeProps({key:2},e.unref(F),{class:o.buttonsClass}),e.createSlots({default:e.withCtx(()=>[o.$slots["buttons-prepend"]?e.renderSlot(o.$slots,"buttons-prepend",{key:0},void 0,!0):e.createCommentVNode("",!0),o.showSubmit?(e.openBlock(),e.createBlock(w,{key:1,type:"primary",class:e.normalizeClass(o.confirmClassName),loading:o.loading&&o.showBtnLoading,onClick:n[0]||(n[0]=t=>h(i.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.confirmText),1)]),_:1},8,["class","loading"])):e.createCommentVNode("",!0),o.showReset?(e.openBlock(),e.createBlock(w,{key:2,onClick:n[1]||(n[1]=t=>C(i.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.resetText||"重置"),1)]),_:1})):e.createCommentVNode("",!0)]),_:2},[o.buttonsLeft?void 0:{name:"label",fn:e.withCtx(()=>[j]),key:"0"}]),1040,["class"])):e.createCommentVNode("",!0)]),_:3},16,["label-width","hide-required-asterisk","model","disabled","class"])]),_:3},8,["locale"])])}}});exports.default=Y;
|