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