sun-form-v3 1.0.94 → 1.0.96
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{index-C5p41SA4.js → index-AhX140yR.js} +1 -1
- package/dist/{index-CCitDq_n.js → index-B1400HnI.js} +1 -1
- package/dist/{index-C7OcHL5P.js → index-Bhi1d8kQ.js} +1 -1
- package/dist/{index-0uHaNbAY.js → index-CMS6qaFZ.js} +1 -1
- package/dist/{index-B2sOA6Dw.js → index-CfzANjnG.js} +104 -52
- package/dist/{index-DjnpS_nN.js → index-Cgt0uLeE.js} +1 -1
- package/dist/{index-hn1cb6ui.js → index-id7WUfjP.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/sun-form-v3.es.js +1 -1
- package/dist/sun-form-v3.umd.js +29 -17
- package/package.json +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { computed as N, ref as y, resolveComponent as i, openBlock as C, createElementBlock as k, Fragment as O, createVNode as e, withCtx as l, createTextVNode as m, unref as d, isRef as j, createElementVNode as _, pushScopeId as I, popScopeId as J } from "vue";
|
2
|
-
import { _ as E } from "./index-
|
2
|
+
import { _ as E } from "./index-CfzANjnG.js";
|
3
3
|
const H = (p) => (I("data-v-4c8b2df2"), p = p(), J(), p), B = /* @__PURE__ */ H(() => /* @__PURE__ */ _("span", null, "数据配置", -1)), T = { class: "h-full flex flex-col" }, D = { class: "flex-1 overflow-hidden" }, F = {
|
4
4
|
__name: "dataConfig",
|
5
5
|
props: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { computed as j, ref as y, resolveComponent as i, openBlock as h, createElementBlock as k, Fragment as U, createVNode as e, withCtx as l, createTextVNode as V, unref as d, isRef as z, createElementVNode as m, pushScopeId as I, popScopeId as J } from "vue";
|
2
|
-
import { _ as E, c as H } from "./index-
|
2
|
+
import { _ as E, c as H } from "./index-CfzANjnG.js";
|
3
3
|
const B = (r) => (I("data-v-657a5bea"), r = r(), J(), r), T = /* @__PURE__ */ B(() => /* @__PURE__ */ m("span", null, "数据配置", -1)), D = { class: "h-full flex flex-col" }, F = { class: "flex-1 overflow-hidden" }, M = /* @__PURE__ */ Object.assign({ name: "commonStyleConfig" }, {
|
4
4
|
__name: "dataConfig",
|
5
5
|
props: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { computed as j, ref as g, onMounted as $, resolveComponent as f, openBlock as _, createElementBlock as v, Fragment as x, createVNode as r, withCtx as o, createTextVNode as C, createElementVNode as u, renderList as B, unref as V, toDisplayString as N, nextTick as U, createBlock as D } from "vue";
|
2
|
-
import { e as E, i as M } from "./index-
|
2
|
+
import { e as E, i as M } from "./index-CfzANjnG.js";
|
3
3
|
const R = /* @__PURE__ */ u("span", null, "图表选择", -1), S = { class: "flex-wrap flex" }, T = ["onClick"], z = { class: "inner cursor-pointer hover:shadow-md hover:shadow-blue-200 border w-full h-full p-1 flex flex-col overflow-hidden items-center rounded-md shadow-sm" }, F = { class: "lab border-t w-full text-center mt-1 font-bold" }, L = /* @__PURE__ */ Object.assign({ name: "chatChoose" }, {
|
4
4
|
__name: "chartChoose",
|
5
5
|
props: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ref as g, resolveComponent as u, openBlock as b, createElementBlock as V, Fragment as w, createVNode as e, withCtx as n, unref as a } from "vue";
|
2
|
-
import { c } from "./index-
|
2
|
+
import { c } from "./index-CfzANjnG.js";
|
3
3
|
const k = /* @__PURE__ */ Object.assign({ name: "config-text" }, {
|
4
4
|
__name: "index",
|
5
5
|
props: {
|
@@ -76542,7 +76542,7 @@ const PXe = {
|
|
76542
76542
|
}
|
76543
76543
|
}, d = async () => {
|
76544
76544
|
let p = r.value.formType;
|
76545
|
-
if (
|
76545
|
+
if (p === "Detail" || p === "Update")
|
76546
76546
|
try {
|
76547
76547
|
if (!r.value.apiSetDetail.apiurl)
|
76548
76548
|
return;
|
@@ -76645,7 +76645,7 @@ const PXe = {
|
|
76645
76645
|
]);
|
76646
76646
|
};
|
76647
76647
|
}
|
76648
|
-
}), LXe = /* @__PURE__ */ uu(kXe, [["__scopeId", "data-v-
|
76648
|
+
}), LXe = /* @__PURE__ */ uu(kXe, [["__scopeId", "data-v-f8ada729"]]), FXe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
76649
76649
|
__proto__: null,
|
76650
76650
|
default: LXe
|
76651
76651
|
}, Symbol.toStringTag, { value: "Module" })), jXe = /* @__PURE__ */ Object.assign({ name: "widget-homepage" }, {
|
@@ -86599,46 +86599,87 @@ class cwt {
|
|
86599
86599
|
});
|
86600
86600
|
}
|
86601
86601
|
}
|
86602
|
-
function fwt(e, t, n) {
|
86603
|
-
let
|
86604
|
-
for (let
|
86605
|
-
|
86606
|
-
let
|
86607
|
-
|
86608
|
-
let
|
86609
|
-
|
86610
|
-
let
|
86611
|
-
|
86612
|
-
let
|
86613
|
-
e.forEach((
|
86614
|
-
|
86615
|
-
|
86616
|
-
|
86617
|
-
|
86618
|
-
|
86619
|
-
|
86620
|
-
|
86621
|
-
|
86622
|
-
|
86623
|
-
|
86602
|
+
function fwt(e, t, n, r) {
|
86603
|
+
let i = r.$utils.clone(ll, !0);
|
86604
|
+
for (let C in i)
|
86605
|
+
i[C].type = C;
|
86606
|
+
let o = [], a = [], s = r.getChosenInitData(i.homepage);
|
86607
|
+
s.props.style.height = "100%";
|
86608
|
+
let l = r.getChosenInitData(i.modal);
|
86609
|
+
l.props.hasFooter = !1;
|
86610
|
+
let u = r.getChosenInitData(i.form);
|
86611
|
+
u.props.style.height = "100%";
|
86612
|
+
let c = r.getChosenInitData(i.datatable), f = "", d = "";
|
86613
|
+
e.forEach((C) => {
|
86614
|
+
(C.dataSource || C.dict) && (C.controlType = "select");
|
86615
|
+
let A = r.getChosenInitData(i[C.controlType]), M = A.props;
|
86616
|
+
if (M.required = !0, M.label = C.comment, M.zdname = C.fieldName, C.dataSource && C.dataSourceShowField && C.dataSourceRealField && (M.apiSet = {
|
86617
|
+
method: "post",
|
86618
|
+
apiurl: "/common/" + C.dataSource.replace("tb_", "") + "/list",
|
86619
|
+
params: [],
|
86620
|
+
headers: [],
|
86621
|
+
contentType: "JSON",
|
86622
|
+
paramsFormat: "",
|
86623
|
+
headersFormat: "",
|
86624
|
+
successFormat: `return res.data.map(e => {
|
86625
|
+
return {
|
86626
|
+
label:e.${C.dataSourceShowField},
|
86627
|
+
value:e.${C.dataSourceRealField}
|
86628
|
+
}
|
86629
|
+
})`,
|
86630
|
+
errorFormat: ""
|
86631
|
+
}), !C.isPrimary && C.fieldName != "createdAt" && C.fieldName != "updatedAt" && (u.widgetList.push(A), C.isCreate || o.push(A.id), C.isUpdate || a.push(A.id)), C.isTable) {
|
86632
|
+
let P = r.getTableCompInitData("datatableitem", i.datatableitem, 2);
|
86633
|
+
P.props.label = C.comment, P.props.zdname = C.fieldName, c.widgetList.push(P);
|
86634
|
+
}
|
86635
|
+
if (C.isQuery) {
|
86636
|
+
let P = r.getTableCompInitData(C.controlType, i[C.controlType], 1);
|
86637
|
+
C.dataSource && C.dataSourceShowField && C.dataSourceRealField && (P.props.apiSet = {
|
86638
|
+
method: "post",
|
86639
|
+
apiurl: "/common/" + C.dataSource.replace("tb_", "") + "/list",
|
86640
|
+
params: [],
|
86641
|
+
headers: [],
|
86642
|
+
contentType: "JSON",
|
86643
|
+
paramsFormat: "",
|
86644
|
+
headersFormat: "",
|
86645
|
+
successFormat: `return res.data.map(e => {
|
86646
|
+
return {
|
86647
|
+
label:e.${C.dataSourceShowField},
|
86648
|
+
value:e.${C.dataSourceRealField}
|
86649
|
+
}
|
86650
|
+
})`,
|
86651
|
+
errorFormat: ""
|
86652
|
+
});
|
86653
|
+
let I = {};
|
86654
|
+
I[C.fieldName] = {}, I[C.fieldName][C.matchType] = "params." + C.fieldName;
|
86655
|
+
let R = `${C.fieldName}:{${C.matchType}:params.${C.fieldName}},
|
86656
|
+
`;
|
86657
|
+
d += R, P.props.label = C.comment, P.props.zdname = C.fieldName, c.widgetList.push(P);
|
86658
|
+
}
|
86659
|
+
}), f = `{${d}}`, c.props.style.height = "100%", c.props.rows = "rows", c.props.count = "total";
|
86660
|
+
let p = "";
|
86661
|
+
n.forEach((C) => {
|
86662
|
+
p && (p += ","), C.showInTable && (p += `"${C.tableName}"`);
|
86663
|
+
}), console.log(p), c.props.apiSet = {
|
86624
86664
|
method: "post",
|
86625
86665
|
apiurl: "/common/" + t.replace("tb_", "") + "/pageList",
|
86626
86666
|
params: [],
|
86627
86667
|
headers: [],
|
86628
86668
|
contentType: "JSON",
|
86629
|
-
paramsFormat:
|
86669
|
+
paramsFormat: `return {filters:${f},
|
86670
|
+
include:[${p}]}`,
|
86630
86671
|
headersFormat: "",
|
86631
86672
|
successFormat: "return res.data",
|
86632
86673
|
errorFormat: ""
|
86633
86674
|
};
|
86634
|
-
let
|
86635
|
-
|
86636
|
-
let
|
86637
|
-
|
86638
|
-
|
86675
|
+
let g = r.getTableCompInitData("button", i.button, 0);
|
86676
|
+
g.props.label = "新增", g.props.icon = "Plus";
|
86677
|
+
let y = "";
|
86678
|
+
o.forEach((C) => {
|
86679
|
+
y += `app.setVisible("${C}", false)
|
86639
86680
|
`;
|
86640
|
-
}),
|
86641
|
-
app.getMethodById("${
|
86681
|
+
}), g.props.onItemClick = `app.setFormType("${u.id}","Create");
|
86682
|
+
app.getMethodById("${l.id}").open(() => { ${y}})`, u.props.apiSetCreate = {
|
86642
86683
|
method: "post",
|
86643
86684
|
apiurl: "/common/" + t.replace("tb_", "") + "/create",
|
86644
86685
|
params: [],
|
@@ -86647,15 +86688,15 @@ app.getMethodById("${s.id}").open(() => { ${f}})`, l.props.apiSetCreate = {
|
|
86647
86688
|
paramsFormat: "",
|
86648
86689
|
headersFormat: "",
|
86649
86690
|
successFormat: `if (res.success) {
|
86650
|
-
app.getMethodById("${
|
86691
|
+
app.getMethodById("${l.id}").close(() => {
|
86651
86692
|
app.$message.success('新增数据成功');
|
86652
|
-
app.getMethodById("${
|
86693
|
+
app.getMethodById("${c.id}").refresh()
|
86653
86694
|
})
|
86654
86695
|
} else {
|
86655
86696
|
app.$message.err(res.msg);
|
86656
86697
|
}`,
|
86657
86698
|
errorFormat: ""
|
86658
|
-
},
|
86699
|
+
}, u.props.apiSetDetail = {
|
86659
86700
|
method: "post",
|
86660
86701
|
apiurl: "/common/" + t.replace("tb_", "") + "/detail",
|
86661
86702
|
params: [],
|
@@ -86670,7 +86711,7 @@ app.getMethodById("${s.id}").open(() => { ${f}})`, l.props.apiSetCreate = {
|
|
86670
86711
|
app.$message.error(res.msg)
|
86671
86712
|
}`,
|
86672
86713
|
errorFormat: ""
|
86673
|
-
},
|
86714
|
+
}, u.props.apiSetUpdate = {
|
86674
86715
|
method: "post",
|
86675
86716
|
apiurl: "/common/" + t.replace("tb_", "") + "/update",
|
86676
86717
|
params: [],
|
@@ -86680,38 +86721,38 @@ app.getMethodById("${s.id}").open(() => { ${f}})`, l.props.apiSetCreate = {
|
|
86680
86721
|
return params`,
|
86681
86722
|
headersFormat: "",
|
86682
86723
|
successFormat: `if (res.success) {
|
86683
|
-
app.getMethodById("${
|
86724
|
+
app.getMethodById("${l.id}").close(() => {
|
86684
86725
|
app.$message.success('修改数据成功');
|
86685
|
-
app.getMethodById("${
|
86726
|
+
app.getMethodById("${c.id}").refresh()
|
86686
86727
|
})
|
86687
86728
|
} else {
|
86688
86729
|
app.$message.err(res.msg);
|
86689
86730
|
}`,
|
86690
86731
|
errorFormat: ""
|
86691
86732
|
};
|
86692
|
-
let
|
86693
|
-
|
86733
|
+
let _ = r.getTableCompInitData("button", i.button, 0);
|
86734
|
+
_.props.label = "删除", _.props.icon = "Close", _.props.isSide = !0, _.props.type = "danger", _.props.onItemClick = `app.$confirm("是否确定删除?", "提示")
|
86694
86735
|
.then(async () => {
|
86695
86736
|
let res = await app.$http.post("/common/${t.replace("tb_", "")}/delete", { id: value.id })
|
86696
86737
|
if (res.success) {
|
86697
86738
|
app.$message.success('删除成功')
|
86698
|
-
app.getMethodById("${
|
86739
|
+
app.getMethodById("${c.id}").refresh()
|
86699
86740
|
} else {
|
86700
86741
|
app.$message.warning(res.msg)
|
86701
86742
|
}
|
86702
86743
|
})
|
86703
86744
|
.catch(() => { });`;
|
86704
|
-
let
|
86705
|
-
|
86706
|
-
let
|
86707
|
-
|
86708
|
-
|
86745
|
+
let x = r.getTableCompInitData("button", i.button, 0);
|
86746
|
+
x.props.label = "修改", x.props.icon = "EditPen", x.props.isSide = !0, x.props.type = "warning";
|
86747
|
+
let S = "";
|
86748
|
+
a.forEach((C) => {
|
86749
|
+
S += `app.setVisible("${C}", false)
|
86709
86750
|
`;
|
86710
|
-
}),
|
86711
|
-
app.setFormType("${
|
86712
|
-
app.getMethodById("${
|
86751
|
+
}), x.props.onItemClick = `app.setParam("id", value.id)
|
86752
|
+
app.setFormType("${u.id}", "Update")
|
86753
|
+
app.getMethodById("${l.id}").open(() => { ${S}})`, c.widgetList.push(g), c.widgetList.push(_), c.widgetList.push(x), l.widgetList.push(u), s.widgetList.push(l), s.widgetList.push(c), r.updateWidget(
|
86713
86754
|
"homepage",
|
86714
|
-
|
86755
|
+
s,
|
86715
86756
|
!0
|
86716
86757
|
);
|
86717
86758
|
}
|
@@ -86753,6 +86794,17 @@ class che {
|
|
86753
86794
|
immediate: !0
|
86754
86795
|
});
|
86755
86796
|
}
|
86797
|
+
/**
|
86798
|
+
* 异步事件处理函数
|
86799
|
+
* @param {Object} params - 事件处理函数的参数对象
|
86800
|
+
* @param {any} [params.value=null] - 事件相关的值
|
86801
|
+
* @param {string} params.eventType - 事件类型
|
86802
|
+
* @param {Object} params.widget - 事件相关的组件
|
86803
|
+
* @param {Function} params.cb - 回调函数,用于处理事件处理结果
|
86804
|
+
* @param {Object} params.tableItemData - 表格项数据
|
86805
|
+
* @param {Object} params.tableColumn - 表格列信息
|
86806
|
+
* @param {boolean} params.showInDesign - 设计模式下是否显示
|
86807
|
+
*/
|
86756
86808
|
async eventHandle({
|
86757
86809
|
value: t = null,
|
86758
86810
|
eventType: n,
|
@@ -86935,7 +86987,7 @@ class che {
|
|
86935
86987
|
});
|
86936
86988
|
}
|
86937
86989
|
initFormFromTableFields(t) {
|
86938
|
-
t && fwt(t.config, t.tableName, this);
|
86990
|
+
t && fwt(t.config, t.tableName, t.associations, this);
|
86939
86991
|
}
|
86940
86992
|
/**
|
86941
86993
|
* 根据ID获取组件
|
@@ -90488,7 +90540,7 @@ const h8 = /* @__PURE__ */ Object.assign({ name: "sunForm" }, {
|
|
90488
90540
|
},
|
90489
90541
|
setup(e) {
|
90490
90542
|
const n = Object.fromEntries(
|
90491
|
-
Object.entries(/* @__PURE__ */ Object.assign({ "../widgetConfigComps/config-alert/index.vue": () => import("./index-ZVIqhtUw.js"), "../widgetConfigComps/config-button/index.vue": () => import("./index-CvnfmMTc.js"), "../widgetConfigComps/config-card/index.vue": () => import("./index-BJ0vPF5A.js"), "../widgetConfigComps/config-checkCode/index.vue": () => import("./index-kUQct_cM.js"), "../widgetConfigComps/config-checkbox/index.vue": () => import("./index-DM5DPltp.js"), "../widgetConfigComps/config-codeEditor/index.vue": () => import("./index-CzkuANsf.js"), "../widgetConfigComps/config-datatable/index.vue": () => import("./index-
|
90543
|
+
Object.entries(/* @__PURE__ */ Object.assign({ "../widgetConfigComps/config-alert/index.vue": () => import("./index-ZVIqhtUw.js"), "../widgetConfigComps/config-button/index.vue": () => import("./index-CvnfmMTc.js"), "../widgetConfigComps/config-card/index.vue": () => import("./index-BJ0vPF5A.js"), "../widgetConfigComps/config-checkCode/index.vue": () => import("./index-kUQct_cM.js"), "../widgetConfigComps/config-checkbox/index.vue": () => import("./index-DM5DPltp.js"), "../widgetConfigComps/config-codeEditor/index.vue": () => import("./index-CzkuANsf.js"), "../widgetConfigComps/config-datatable/index.vue": () => import("./index-id7WUfjP.js"), "../widgetConfigComps/config-date/index.vue": () => import("./index-C0NmmaE2.js"), "../widgetConfigComps/config-div/index.vue": () => import("./index-BAEL_Fhr.js"), "../widgetConfigComps/config-echarts/index.vue": () => import("./index-Bhi1d8kQ.js"), "../widgetConfigComps/config-editor/index.vue": () => import("./index-CXNYHPLK.js"), "../widgetConfigComps/config-file/index.vue": () => import("./index-BU3xx_sm.js"), "../widgetConfigComps/config-form/index.vue": () => import("./index-CIaeKFCl.js"), "../widgetConfigComps/config-homepage/index.vue": () => import("./index-CifChfEv.js"), "../widgetConfigComps/config-image/index.vue": () => import("./index-dGJDj4ro.js"), "../widgetConfigComps/config-input/index.vue": () => import("./index-BYSQOsYK.js"), "../widgetConfigComps/config-modal/index.vue": () => import("./index-DIwhu60e.js"), "../widgetConfigComps/config-progress/index.vue": () => import("./index-c0zw96Jm.js"), "../widgetConfigComps/config-radio/index.vue": () => import("./index-DVgKDMax.js"), "../widgetConfigComps/config-rate/index.vue": () => import("./index-XP0bVDnU.js"), "../widgetConfigComps/config-select/index.vue": () => import("./index-Bb57DL9x.js"), "../widgetConfigComps/config-selects/index.vue": () => import("./index-eJQFWCeP.js"), "../widgetConfigComps/config-statistic/index.vue": () => import("./index-B1400HnI.js"), "../widgetConfigComps/config-steps/index.vue": () => import("./index-AhX140yR.js"), "../widgetConfigComps/config-switch/index.vue": () => import("./index-BVfC-7wG.js"), "../widgetConfigComps/config-tag/index.vue": () => import("./index-CMS6qaFZ.js"), "../widgetConfigComps/config-text/index.vue": () => import("./index-BYbxnzUx.js"), "../widgetConfigComps/config-time/index.vue": () => import("./index-zkXVDNsL.js"), "../widgetConfigComps/config-timeline/index.vue": () => import("./index-Cgt0uLeE.js") })).map(([p, g]) => {
|
90492
90544
|
const y = p.match(/\/([^/]+)\/index\.vue$/);
|
90493
90545
|
return [y ? y[1] : null, b0e(g)];
|
90494
90546
|
})
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { computed as N, ref as h, resolveComponent as u, openBlock as C, createElementBlock as U, Fragment as k, createVNode as e, withCtx as l, createTextVNode as g, unref as d, isRef as j, createElementVNode as c, pushScopeId as I, popScopeId as J } from "vue";
|
2
|
-
import { _ as T } from "./index-
|
2
|
+
import { _ as T } from "./index-CfzANjnG.js";
|
3
3
|
const E = (m) => (I("data-v-ede8dcab"), m = m(), J(), m), H = /* @__PURE__ */ E(() => /* @__PURE__ */ c("span", null, "数据配置", -1)), B = { class: "h-full flex flex-col" }, D = { class: "flex-1 overflow-hidden" }, F = {
|
4
4
|
__name: "dataConfig",
|
5
5
|
props: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ref as x, resolveComponent as s, openBlock as k, createElementBlock as T, Fragment as E, createVNode as e, unref as l, withCtx as a, createTextVNode as _, isRef as L, createElementVNode as f, toDisplayString as h, createCommentVNode as D, pushScopeId as B, popScopeId as J } from "vue";
|
2
|
-
import { _ as R } from "./index-
|
2
|
+
import { _ as R } from "./index-CfzANjnG.js";
|
3
3
|
const I = (c) => (B("data-v-75dc2686"), c = c(), J(), c), W = /* @__PURE__ */ I(() => /* @__PURE__ */ f("span", null, "复杂表头配置", -1)), q = {
|
4
4
|
key: 0,
|
5
5
|
class: "flex h-full flex-col"
|