@lingshugroup/web-plus 1.0.29 → 1.0.31
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 +1 -1
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.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 +73 -68
- 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/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/components/Pdf.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index.js +1 -1
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index2.js +61 -62
- package/lib/packages/ls-components/components/preview/components/Pdf.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview/components/Pdf.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 +163 -154
- 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
|
|
@@ -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"),k=l(e=>{u.value=e,P?m():g()},"handleCurrentPageChange"),C=l(e=>{r.value=e,u.value=1,P?m():g()},"handleSizeChange");t.watch(u,e=>{k(e)}),t.watch(r,e=>{C(e)});const 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
|
-
}, "loadData")
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
}, "loadData"), k = /* @__PURE__ */ t((e) => {
|
|
75
|
+
l.value = e, P ? D() : p();
|
|
76
|
+
}, "handleCurrentPageChange"), C = /* @__PURE__ */ t((e) => {
|
|
77
|
+
i.value = e, l.value = 1, P ? D() : p();
|
|
78
|
+
}, "handleSizeChange");
|
|
79
|
+
N(l, (e) => {
|
|
80
|
+
k(e);
|
|
81
|
+
}), N(i, (e) => {
|
|
82
|
+
C(e);
|
|
70
83
|
});
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
r.value = e, u.value = 1, b ? N(n, z, i, u, r) : f();
|
|
75
|
-
}, "handleSizeChange"), q = /* @__PURE__ */ l(() => {
|
|
76
|
-
u.value = 1, J(() => {
|
|
77
|
-
f();
|
|
84
|
+
const 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";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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var G = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var d = (u, $) => G(u, "name", { value: $, configurable: !0 });
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
@@ -7,31 +7,37 @@ var f = (C, $) => G(C, "name", { value: $, configurable: !0 });
|
|
|
7
7
|
/* empty css */
|
|
8
8
|
/* empty css */
|
|
9
9
|
/* empty css */
|
|
10
|
-
import { defineComponent as
|
|
11
|
-
import
|
|
12
|
-
import { lsFormProps as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { ElCol as
|
|
17
|
-
import { ElRow as
|
|
18
|
-
import { ElButton as
|
|
19
|
-
import { ElFormItem as
|
|
20
|
-
import { ElConfigProvider as
|
|
21
|
-
const
|
|
10
|
+
import { defineComponent as q, useAttrs as H, computed as J, ref as K, reactive as Q, watch as X, openBlock as r, createElementBlock as c, createVNode as T, unref as t, withCtx as s, mergeProps as v, createBlock as m, Fragment as w, renderList as C, renderSlot as i, createSlots as E, createCommentVNode as y, normalizeClass as Z, createTextVNode as D, toDisplayString as N, pushScopeId as x, popScopeId as ee, createElementVNode as oe } from "vue";
|
|
11
|
+
import V from "../FormItem.vue/index.js";
|
|
12
|
+
import { lsFormProps as te } from "../types/index.js";
|
|
13
|
+
import re from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/dist/locale/zh-cn/index.js";
|
|
14
|
+
import k from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get/index.js";
|
|
15
|
+
import le from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/set/index.js";
|
|
16
|
+
import { ElCol as ne } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/col/index/index.js";
|
|
17
|
+
import { ElRow as se } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/row/index/index.js";
|
|
18
|
+
import { ElButton as ae } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/button/index/index.js";
|
|
19
|
+
import { ElFormItem as ie, ElForm as ue } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/form/index/index.js";
|
|
20
|
+
import { ElConfigProvider as pe } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/config-provider/index/index.js";
|
|
21
|
+
const de = /* @__PURE__ */ d((u) => (x("data-v-61d73833"), u = u(), ee(), u), "_withScopeId"), me = { class: "ls-form" }, fe = /* @__PURE__ */ de(() => /* @__PURE__ */ oe("span", null, null, -1)), be = q({
|
|
22
22
|
name: "LSForm"
|
|
23
|
-
}),
|
|
24
|
-
...
|
|
25
|
-
props:
|
|
23
|
+
}), De = /* @__PURE__ */ q({
|
|
24
|
+
...be,
|
|
25
|
+
props: te,
|
|
26
26
|
emits: ["submit", "reset", "update:form-data", "onChange"],
|
|
27
|
-
setup(
|
|
28
|
-
const z =
|
|
27
|
+
setup(u, { expose: $, emit: O }) {
|
|
28
|
+
const z = u, S = O, a = H(), A = J(() => a && a.hasOwnProperty("inline") ? typeof a.inline == "boolean" && a.inline === !1 ? {
|
|
29
|
+
label: ""
|
|
30
|
+
} : a && a["label-position"] === "top" ? {
|
|
31
|
+
label: "",
|
|
29
32
|
class: "form-item-buttons "
|
|
30
|
-
} : {
|
|
33
|
+
} : {
|
|
34
|
+
label: ""
|
|
35
|
+
} : a && a["label-position"] === "top" ? {
|
|
36
|
+
label: "",
|
|
31
37
|
"label-position": "top"
|
|
32
38
|
} : {
|
|
33
|
-
label: "
|
|
34
|
-
}),
|
|
39
|
+
label: ""
|
|
40
|
+
}), f = K(), _ = [
|
|
35
41
|
"label",
|
|
36
42
|
"input",
|
|
37
43
|
"textarea",
|
|
@@ -52,29 +58,29 @@ const ie = { class: "ls-form" }, ue = O({
|
|
|
52
58
|
"itemSlot"
|
|
53
59
|
];
|
|
54
60
|
let l = Q({});
|
|
55
|
-
function
|
|
56
|
-
e && (e.resetFields(),
|
|
61
|
+
function I(e) {
|
|
62
|
+
e && (e.resetFields(), S("reset", l));
|
|
57
63
|
}
|
|
58
|
-
|
|
59
|
-
async function
|
|
60
|
-
e && await e.validate((n,
|
|
61
|
-
n ?
|
|
64
|
+
d(I, "resetForm");
|
|
65
|
+
async function P(e) {
|
|
66
|
+
e && await e.validate((n, p) => {
|
|
67
|
+
n ? S("submit", l) : console.warn("error submit!", p);
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
|
-
|
|
70
|
+
d(P, "submitForm");
|
|
65
71
|
function U() {
|
|
66
72
|
return new Promise((e, n) => {
|
|
67
|
-
if (!
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
if (!f.value) return e(!1);
|
|
74
|
+
f.value.validate((p, g) => {
|
|
75
|
+
p ? e(l) : (console.warn("error submit!", g), n(g));
|
|
70
76
|
});
|
|
71
77
|
});
|
|
72
78
|
}
|
|
73
|
-
|
|
74
|
-
function
|
|
75
|
-
|
|
79
|
+
d(U, "validate");
|
|
80
|
+
function b(e, n) {
|
|
81
|
+
le(l, e, n);
|
|
76
82
|
}
|
|
77
|
-
|
|
83
|
+
d(b, "updateFormData"), X(
|
|
78
84
|
() => z.formData,
|
|
79
85
|
(e) => {
|
|
80
86
|
l = e || {};
|
|
@@ -84,45 +90,45 @@ const ie = { class: "ls-form" }, ue = O({
|
|
|
84
90
|
immediate: !0
|
|
85
91
|
}
|
|
86
92
|
);
|
|
87
|
-
function B(e, n,
|
|
88
|
-
|
|
93
|
+
function B(e, n, p) {
|
|
94
|
+
S("onChange", e, n, p);
|
|
89
95
|
}
|
|
90
|
-
return
|
|
91
|
-
FormRef:
|
|
96
|
+
return d(B, "onChange"), $({
|
|
97
|
+
FormRef: f,
|
|
92
98
|
validate: U,
|
|
93
|
-
submitForm:
|
|
94
|
-
resetForm:
|
|
99
|
+
submitForm: P,
|
|
100
|
+
resetForm: I
|
|
95
101
|
}), (e, n) => {
|
|
96
|
-
const
|
|
97
|
-
return
|
|
102
|
+
const p = ne, g = se, L = ae, M = ie, W = ue, Y = pe;
|
|
103
|
+
return r(), c("div", me, [
|
|
98
104
|
T(Y, {
|
|
99
|
-
locale:
|
|
105
|
+
locale: t(re),
|
|
100
106
|
"value-on-clear": void 0,
|
|
101
107
|
"empty-values": [void 0, null]
|
|
102
108
|
}, {
|
|
103
109
|
default: s(() => [
|
|
104
|
-
T(W,
|
|
110
|
+
T(W, v({
|
|
105
111
|
ref_key: "FormRef",
|
|
106
|
-
ref:
|
|
112
|
+
ref: f,
|
|
107
113
|
"label-position": "left",
|
|
108
114
|
"require-asterisk-position": "right",
|
|
109
115
|
"label-width": e.labelWidth,
|
|
110
116
|
"hide-required-asterisk": !!e.read
|
|
111
117
|
}, e.$attrs, {
|
|
112
|
-
model:
|
|
118
|
+
model: t(l),
|
|
113
119
|
disabled: e.loading || e.disabled,
|
|
114
120
|
class: [e.read && e.hasDefReadStyle ? "show-label" : ""]
|
|
115
121
|
}), {
|
|
116
122
|
default: s(() => [
|
|
117
|
-
e.column > 1 ? (
|
|
123
|
+
e.column > 1 ? (r(), m(g, {
|
|
118
124
|
key: 0,
|
|
119
125
|
gutter: 10
|
|
120
126
|
}, {
|
|
121
127
|
default: s(() => [
|
|
122
|
-
(
|
|
128
|
+
(r(!0), c(w, null, C(e.formItems, (o, F) => (r(), c(w, {
|
|
123
129
|
key: o.prop
|
|
124
130
|
}, [
|
|
125
|
-
o.hideColumn ?
|
|
131
|
+
o.hideColumn ? y("", !0) : (r(), m(p, {
|
|
126
132
|
key: 0,
|
|
127
133
|
span: o.isRow ? 24 : 24 / e.column
|
|
128
134
|
}, {
|
|
@@ -130,32 +136,32 @@ const ie = { class: "ls-form" }, ue = O({
|
|
|
130
136
|
o.type === "slot" ? i(e.$slots, o.prop, {
|
|
131
137
|
key: 0,
|
|
132
138
|
slotRow: { ...o },
|
|
133
|
-
value:
|
|
134
|
-
updateFormData:
|
|
135
|
-
}, void 0, !0) :
|
|
139
|
+
value: t(k)(t(l), o.prop),
|
|
140
|
+
updateFormData: b
|
|
141
|
+
}, void 0, !0) : _.includes(o.type) ? (r(), m(V, v({
|
|
136
142
|
key: 1,
|
|
137
143
|
"is-value": !0,
|
|
138
|
-
value:
|
|
144
|
+
value: t(k)(t(l), o.prop),
|
|
139
145
|
colon: e.colon,
|
|
140
146
|
read: e.read,
|
|
141
147
|
"label-empty": e.labelEmpty,
|
|
142
|
-
index:
|
|
148
|
+
index: F,
|
|
143
149
|
ref_for: !0
|
|
144
150
|
}, o, {
|
|
145
|
-
"onUpdate:value":
|
|
151
|
+
"onUpdate:value": b,
|
|
146
152
|
onOnChange: B
|
|
147
|
-
}),
|
|
148
|
-
|
|
149
|
-
name:
|
|
150
|
-
fn: s((
|
|
151
|
-
i(e.$slots,
|
|
153
|
+
}), E({ _: 2 }, [
|
|
154
|
+
C(e.$slots, (j, h) => ({
|
|
155
|
+
name: h,
|
|
156
|
+
fn: s((R) => [
|
|
157
|
+
i(e.$slots, h, v({ ref_for: !0 }, R), void 0, !0)
|
|
152
158
|
])
|
|
153
159
|
}))
|
|
154
160
|
]), 1040, ["value", "colon", "read", "label-empty", "index"])) : i(e.$slots, o.type, {
|
|
155
161
|
key: 2,
|
|
156
162
|
slotRow: { ...o },
|
|
157
|
-
value:
|
|
158
|
-
updateFormData:
|
|
163
|
+
value: t(k)(t(l), o.prop),
|
|
164
|
+
updateFormData: b
|
|
159
165
|
}, void 0, !0)
|
|
160
166
|
]),
|
|
161
167
|
_: 2
|
|
@@ -163,70 +169,78 @@ const ie = { class: "ls-form" }, ue = O({
|
|
|
163
169
|
], 64))), 128))
|
|
164
170
|
]),
|
|
165
171
|
_: 3
|
|
166
|
-
})) : (
|
|
172
|
+
})) : (r(!0), c(w, { key: 1 }, C(e.formItems, (o, F) => (r(), c(w, {
|
|
167
173
|
key: o.prop
|
|
168
174
|
}, [
|
|
169
|
-
o.hideColumn ?
|
|
175
|
+
o.hideColumn ? y("", !0) : (r(), c(w, { key: 0 }, [
|
|
170
176
|
o.type === "slot" ? i(e.$slots, o.prop, {
|
|
171
177
|
key: 0,
|
|
172
178
|
slotRow: { ...o },
|
|
173
|
-
value:
|
|
174
|
-
updateFormData:
|
|
175
|
-
}, void 0, !0) :
|
|
179
|
+
value: t(k)(t(l), o.prop),
|
|
180
|
+
updateFormData: b
|
|
181
|
+
}, void 0, !0) : _.includes(o.type) ? (r(), m(V, v({
|
|
176
182
|
key: 1,
|
|
177
183
|
"is-value": !0,
|
|
178
|
-
value:
|
|
184
|
+
value: t(k)(t(l), o.prop),
|
|
179
185
|
colon: e.colon,
|
|
180
186
|
read: e.read,
|
|
181
187
|
"label-empty": e.labelEmpty,
|
|
182
|
-
index:
|
|
188
|
+
index: F,
|
|
183
189
|
ref_for: !0
|
|
184
190
|
}, o, {
|
|
185
|
-
"onUpdate:value":
|
|
191
|
+
"onUpdate:value": b,
|
|
186
192
|
onOnChange: B
|
|
187
|
-
}),
|
|
188
|
-
|
|
189
|
-
name:
|
|
190
|
-
fn: s((
|
|
191
|
-
i(e.$slots,
|
|
193
|
+
}), E({ _: 2 }, [
|
|
194
|
+
C(e.$slots, (j, h) => ({
|
|
195
|
+
name: h,
|
|
196
|
+
fn: s((R) => [
|
|
197
|
+
i(e.$slots, h, v({ ref_for: !0 }, R), void 0, !0)
|
|
192
198
|
])
|
|
193
199
|
}))
|
|
194
200
|
]), 1040, ["value", "colon", "read", "label-empty", "index"])) : i(e.$slots, o.type, {
|
|
195
201
|
key: 2,
|
|
196
202
|
slotRow: { ...o },
|
|
197
|
-
value:
|
|
198
|
-
updateFormData:
|
|
203
|
+
value: t(k)(t(l), o.prop),
|
|
204
|
+
updateFormData: b
|
|
199
205
|
}, void 0, !0)
|
|
200
206
|
], 64))
|
|
201
207
|
], 64))), 128)),
|
|
202
208
|
i(e.$slots, "default", {}, void 0, !0),
|
|
203
|
-
e.showButtons ? (
|
|
209
|
+
e.showButtons ? (r(), m(M, v({ key: 2 }, t(A), { class: e.buttonsClass }), E({
|
|
204
210
|
default: s(() => [
|
|
205
|
-
e.$slots["buttons-prepend"] ? i(e.$slots, "buttons-prepend", { key: 0 }, void 0, !0) :
|
|
206
|
-
e.showSubmit ? (
|
|
211
|
+
e.$slots["buttons-prepend"] ? i(e.$slots, "buttons-prepend", { key: 0 }, void 0, !0) : y("", !0),
|
|
212
|
+
e.showSubmit ? (r(), m(L, {
|
|
207
213
|
key: 1,
|
|
208
214
|
type: "primary",
|
|
209
215
|
class: Z(e.confirmClassName),
|
|
210
216
|
loading: e.loading && e.showBtnLoading,
|
|
211
|
-
onClick: n[0] || (n[0] = (o) =>
|
|
217
|
+
onClick: n[0] || (n[0] = (o) => P(f.value))
|
|
212
218
|
}, {
|
|
213
219
|
default: s(() => [
|
|
214
|
-
|
|
220
|
+
D(N(e.confirmText), 1)
|
|
215
221
|
]),
|
|
216
222
|
_: 1
|
|
217
|
-
}, 8, ["class", "loading"])) :
|
|
218
|
-
e.showReset ? (
|
|
223
|
+
}, 8, ["class", "loading"])) : y("", !0),
|
|
224
|
+
e.showReset ? (r(), m(L, {
|
|
219
225
|
key: 2,
|
|
220
|
-
onClick: n[1] || (n[1] = (o) =>
|
|
226
|
+
onClick: n[1] || (n[1] = (o) => I(f.value))
|
|
221
227
|
}, {
|
|
222
228
|
default: s(() => [
|
|
223
|
-
|
|
229
|
+
D(N(e.resetText || "重置"), 1)
|
|
224
230
|
]),
|
|
225
231
|
_: 1
|
|
226
|
-
})) :
|
|
232
|
+
})) : y("", !0)
|
|
227
233
|
]),
|
|
228
|
-
_:
|
|
229
|
-
},
|
|
234
|
+
_: 2
|
|
235
|
+
}, [
|
|
236
|
+
e.buttonsLeft ? void 0 : {
|
|
237
|
+
name: "label",
|
|
238
|
+
fn: s(() => [
|
|
239
|
+
fe
|
|
240
|
+
]),
|
|
241
|
+
key: "0"
|
|
242
|
+
}
|
|
243
|
+
]), 1040, ["class"])) : y("", !0)
|
|
230
244
|
]),
|
|
231
245
|
_: 3
|
|
232
246
|
}, 16, ["label-width", "hide-required-asterisk", "model", "disabled", "class"])
|
|
@@ -238,5 +252,5 @@ const ie = { class: "ls-form" }, ue = O({
|
|
|
238
252
|
}
|
|
239
253
|
});
|
|
240
254
|
export {
|
|
241
|
-
|
|
255
|
+
De as default
|
|
242
256
|
};
|
|
Binary file
|
|
Binary file
|