sun-form-v3 1.0.95 → 1.0.96

Sign up to get free protection for your applications and to get access to all the features.
@@ -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-mUiSTJoV.js";
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-mUiSTJoV.js";
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-mUiSTJoV.js";
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-mUiSTJoV.js";
2
+ import { c } from "./index-CfzANjnG.js";
3
3
  const k = /* @__PURE__ */ Object.assign({ name: "config-text" }, {
4
4
  __name: "index",
5
5
  props: {
@@ -86599,23 +86599,23 @@ class cwt {
86599
86599
  });
86600
86600
  }
86601
86601
  }
86602
- function fwt(e, t, n) {
86603
- let r = n.$utils.clone(ll, !0);
86604
- for (let y in r)
86605
- r[y].type = y;
86606
- let i = [], o = [], a = n.getChosenInitData(r.homepage);
86607
- a.props.style.height = "100%";
86608
- let s = n.getChosenInitData(r.modal);
86609
- s.props.hasFooter = !1;
86610
- let l = n.getChosenInitData(r.form);
86611
- l.props.style.height = "100%";
86612
- let u = n.getChosenInitData(r.datatable);
86613
- e.forEach((y) => {
86614
- (y.dataSource || y.dict) && (y.controlType = "select");
86615
- let _ = n.getChosenInitData(r[y.controlType]), x = _.props;
86616
- if (x.required = !0, x.label = y.comment, x.zdname = y.fieldName, y.dataSource && y.dataSourceShowField && y.dataSourceRealField && (x.apiSet = {
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
86617
  method: "post",
86618
- apiurl: "/common/" + y.dataSource.replace("tb_", "") + "/list",
86618
+ apiurl: "/common/" + C.dataSource.replace("tb_", "") + "/list",
86619
86619
  params: [],
86620
86620
  headers: [],
86621
86621
  contentType: "JSON",
@@ -86623,38 +86623,63 @@ function fwt(e, t, n) {
86623
86623
  headersFormat: "",
86624
86624
  successFormat: `return res.data.map(e => {
86625
86625
  return {
86626
- label:e.${y.dataSourceShowField},
86627
- value:e.${y.dataSourceRealField}
86626
+ label:e.${C.dataSourceShowField},
86627
+ value:e.${C.dataSourceRealField}
86628
86628
  }
86629
86629
  })`,
86630
86630
  errorFormat: ""
86631
- }), !y.isPrimary && y.fieldName != "createdAt" && y.fieldName != "updatedAt" && (l.widgetList.push(_), y.isCreate || i.push(_.id), y.isUpdate || o.push(_.id)), y.isTable) {
86632
- let S = n.getTableCompInitData("datatableitem", r.datatableitem, 2);
86633
- S.props.label = y.comment, S.props.zdname = y.fieldName, u.widgetList.push(S);
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
86634
  }
86635
- if (y.isQuery) {
86636
- let S = n.getTableCompInitData(y.controlType, r[y.controlType], 1);
86637
- S.props.label = y.comment, S.props.zdname = y.fieldName, u.widgetList.push(S);
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}
86638
86649
  }
86639
- }), u.props.style.height = "100%", u.props.rows = "rows", u.props.count = "total", u.props.apiSet = {
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 = {
86640
86664
  method: "post",
86641
86665
  apiurl: "/common/" + t.replace("tb_", "") + "/pageList",
86642
86666
  params: [],
86643
86667
  headers: [],
86644
86668
  contentType: "JSON",
86645
- paramsFormat: "",
86669
+ paramsFormat: `return {filters:${f},
86670
+ include:[${p}]}`,
86646
86671
  headersFormat: "",
86647
86672
  successFormat: "return res.data",
86648
86673
  errorFormat: ""
86649
86674
  };
86650
- let c = n.getTableCompInitData("button", r.button, 0);
86651
- c.props.label = "新增", c.props.icon = "Plus";
86652
- let f = "";
86653
- i.forEach((y) => {
86654
- f += `app.setVisible("${y}", false)
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)
86655
86680
  `;
86656
- }), c.props.onItemClick = `app.setFormType("${l.id}","Create");
86657
- app.getMethodById("${s.id}").open(() => { ${f}})`, l.props.apiSetCreate = {
86681
+ }), g.props.onItemClick = `app.setFormType("${u.id}","Create");
86682
+ app.getMethodById("${l.id}").open(() => { ${y}})`, u.props.apiSetCreate = {
86658
86683
  method: "post",
86659
86684
  apiurl: "/common/" + t.replace("tb_", "") + "/create",
86660
86685
  params: [],
@@ -86663,15 +86688,15 @@ app.getMethodById("${s.id}").open(() => { ${f}})`, l.props.apiSetCreate = {
86663
86688
  paramsFormat: "",
86664
86689
  headersFormat: "",
86665
86690
  successFormat: `if (res.success) {
86666
- app.getMethodById("${s.id}").close(() => {
86691
+ app.getMethodById("${l.id}").close(() => {
86667
86692
  app.$message.success('新增数据成功');
86668
- app.getMethodById("${u.id}").refresh()
86693
+ app.getMethodById("${c.id}").refresh()
86669
86694
  })
86670
86695
  } else {
86671
86696
  app.$message.err(res.msg);
86672
86697
  }`,
86673
86698
  errorFormat: ""
86674
- }, l.props.apiSetDetail = {
86699
+ }, u.props.apiSetDetail = {
86675
86700
  method: "post",
86676
86701
  apiurl: "/common/" + t.replace("tb_", "") + "/detail",
86677
86702
  params: [],
@@ -86686,7 +86711,7 @@ app.getMethodById("${s.id}").open(() => { ${f}})`, l.props.apiSetCreate = {
86686
86711
  app.$message.error(res.msg)
86687
86712
  }`,
86688
86713
  errorFormat: ""
86689
- }, l.props.apiSetUpdate = {
86714
+ }, u.props.apiSetUpdate = {
86690
86715
  method: "post",
86691
86716
  apiurl: "/common/" + t.replace("tb_", "") + "/update",
86692
86717
  params: [],
@@ -86696,38 +86721,38 @@ app.getMethodById("${s.id}").open(() => { ${f}})`, l.props.apiSetCreate = {
86696
86721
  return params`,
86697
86722
  headersFormat: "",
86698
86723
  successFormat: `if (res.success) {
86699
- app.getMethodById("${s.id}").close(() => {
86724
+ app.getMethodById("${l.id}").close(() => {
86700
86725
  app.$message.success('修改数据成功');
86701
- app.getMethodById("${u.id}").refresh()
86726
+ app.getMethodById("${c.id}").refresh()
86702
86727
  })
86703
86728
  } else {
86704
86729
  app.$message.err(res.msg);
86705
86730
  }`,
86706
86731
  errorFormat: ""
86707
86732
  };
86708
- let d = n.getTableCompInitData("button", r.button, 0);
86709
- d.props.label = "删除", d.props.icon = "Close", d.props.isSide = !0, d.props.type = "danger", d.props.onItemClick = `app.$confirm("是否确定删除?", "提示")
86733
+ let _ = r.getTableCompInitData("button", i.button, 0);
86734
+ _.props.label = "删除", _.props.icon = "Close", _.props.isSide = !0, _.props.type = "danger", _.props.onItemClick = `app.$confirm("是否确定删除?", "提示")
86710
86735
  .then(async () => {
86711
86736
  let res = await app.$http.post("/common/${t.replace("tb_", "")}/delete", { id: value.id })
86712
86737
  if (res.success) {
86713
86738
  app.$message.success('删除成功')
86714
- app.getMethodById("${u.id}").refresh()
86739
+ app.getMethodById("${c.id}").refresh()
86715
86740
  } else {
86716
86741
  app.$message.warning(res.msg)
86717
86742
  }
86718
86743
  })
86719
86744
  .catch(() => { });`;
86720
- let p = n.getTableCompInitData("button", r.button, 0);
86721
- p.props.label = "修改", p.props.icon = "EditPen", p.props.isSide = !0, p.props.type = "warning";
86722
- let g = "";
86723
- o.forEach((y) => {
86724
- g += `app.setVisible("${y}", false)
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)
86725
86750
  `;
86726
- }), p.props.onItemClick = `app.setParam("id", value.id)
86727
- app.setFormType("${l.id}", "Update")
86728
- app.getMethodById("${s.id}").open(() => { ${g}})`, u.widgetList.push(c), u.widgetList.push(d), u.widgetList.push(p), s.widgetList.push(l), a.widgetList.push(s), a.widgetList.push(u), n.updateWidget(
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(
86729
86754
  "homepage",
86730
- a,
86755
+ s,
86731
86756
  !0
86732
86757
  );
86733
86758
  }
@@ -86962,7 +86987,7 @@ class che {
86962
86987
  });
86963
86988
  }
86964
86989
  initFormFromTableFields(t) {
86965
- t && fwt(t.config, t.tableName, this);
86990
+ t && fwt(t.config, t.tableName, t.associations, this);
86966
86991
  }
86967
86992
  /**
86968
86993
  * 根据ID获取组件
@@ -90515,7 +90540,7 @@ const h8 = /* @__PURE__ */ Object.assign({ name: "sunForm" }, {
90515
90540
  },
90516
90541
  setup(e) {
90517
90542
  const n = Object.fromEntries(
90518
- 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-D62T4a6W.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-yoPZClGY.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-pvDKBz_X.js"), "../widgetConfigComps/config-steps/index.vue": () => import("./index-CRe7mlio.js"), "../widgetConfigComps/config-switch/index.vue": () => import("./index-BVfC-7wG.js"), "../widgetConfigComps/config-tag/index.vue": () => import("./index-CKOWn9ta.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-COY4ZzZo.js") })).map(([p, g]) => {
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]) => {
90519
90544
  const y = p.match(/\/([^/]+)\/index\.vue$/);
90520
90545
  return [y ? y[1] : null, b0e(g)];
90521
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-mUiSTJoV.js";
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-mUiSTJoV.js";
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"
@@ -1,4 +1,4 @@
1
- import { a as f } from "./index-mUiSTJoV.js";
1
+ import { a as f } from "./index-CfzANjnG.js";
2
2
  export {
3
3
  f as default
4
4
  };