@zhangqingcq/vgce 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
package/dist/vgce.js CHANGED
@@ -3,7 +3,7 @@ import { ElProgress, ElTable, ElTableColumn, ElButton, ElTag as ElTag$1, ElMessa
3
3
  import "animate.css";
4
4
  import VChart, { THEME_KEY } from "vue-echarts";
5
5
  import { defineStore, createPinia } from "pinia";
6
- import { kebabCase, get as get$1, set as set$1, fromPairs, castArray, clone as clone$3, isNil, isUndefined as isUndefined$1, isEqual, debounce } from "lodash-es";
6
+ import { kebabCase, isEmpty, get as get$1, set as set$1, fromPairs, castArray, clone as clone$3, isNil, isUndefined as isUndefined$1, isEqual, debounce } from "lodash-es";
7
7
  import ace from "ace-builds";
8
8
  const windi = "";
9
9
  if (typeof window < "u") {
@@ -20543,38 +20543,40 @@ const _withScopeId$2 = (i) => (pushScopeId("data-v-62907637"), i = i(), popScope
20543
20543
  "element-ui",
20544
20544
  "custom-vue",
20545
20545
  "echarts"
20546
- ]), u = (f) => {
20547
- r.setCreateInfo(f);
20548
- }, c = (f) => {
20549
- var d;
20550
- if (((d = f.dataTransfer) == null ? void 0 : d.dropEffect) !== "copy") {
20546
+ ]), u = (d) => {
20547
+ r.setCreateInfo(c(d));
20548
+ }, c = (d) => (d != null && d.props && !isEmpty(d.props) && Object.keys(d.props).forEach((p, y) => {
20549
+ d.props[p].sort = String(y);
20550
+ }), d), f = (d) => {
20551
+ var p;
20552
+ if (((p = d.dataTransfer) == null ? void 0 : p.dropEffect) !== "copy") {
20551
20553
  ElMessage.warning("请将组件拖到画布中!"), r.intention = EGlobalStoreIntention.None;
20552
20554
  return;
20553
20555
  }
20554
20556
  };
20555
- return (f, d) => (openBlock(), createElementBlock("div", null, [
20557
+ return (d, p) => (openBlock(), createElementBlock("div", null, [
20556
20558
  createVNode$1(unref(ElCollapse), {
20557
20559
  modelValue: unref(a),
20558
- "onUpdate:modelValue": d[0] || (d[0] = (p) => isRef(a) ? a.value = p : null),
20560
+ "onUpdate:modelValue": p[0] || (p[0] = (y) => isRef(a) ? a.value = y : null),
20559
20561
  style: { "border-top": "none" }
20560
20562
  }, {
20561
20563
  default: withCtx(() => [
20562
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (p) => (openBlock(), createBlock(unref(ElCollapseItem), {
20563
- name: p.groupType,
20564
- key: p.title
20564
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (y) => (openBlock(), createBlock(unref(ElCollapseItem), {
20565
+ name: y.groupType,
20566
+ key: y.title
20565
20567
  }, {
20566
20568
  title: withCtx(() => [
20567
- createElementVNode("div", null, toDisplayString(p.title), 1)
20569
+ createElementVNode("div", null, toDisplayString(y.title), 1)
20568
20570
  ]),
20569
20571
  default: withCtx(() => [
20570
20572
  createElementVNode("div", _hoisted_1$g, [
20571
- (openBlock(!0), createElementBlock(Fragment, null, renderList(p.list, (y) => (openBlock(), createElementBlock("div", {
20573
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(y.list, (v) => (openBlock(), createElementBlock("div", {
20572
20574
  class: "ideal",
20573
- key: y.name,
20575
+ key: v.name,
20574
20576
  draggable: "true",
20575
- onDragstart: (v) => u(y),
20576
- onDragend: c,
20577
- title: y.title
20577
+ onDragstart: (g) => u(v),
20578
+ onDragend: f,
20579
+ title: v.title
20578
20580
  }, [
20579
20581
  createVNode$1(unref(ElIcon$1), {
20580
20582
  size: 35,
@@ -20582,8 +20584,8 @@ const _withScopeId$2 = (i) => (pushScopeId("data-v-62907637"), i = i(), popScope
20582
20584
  }, {
20583
20585
  default: withCtx(() => [
20584
20586
  createVNode$1(_sfc_main$D, {
20585
- name: y.name,
20586
- props: unref(prosToVBind)(y, ["width", "height", "maxHeight"])
20587
+ name: v.name,
20588
+ props: unref(prosToVBind)(v, ["width", "height", "maxHeight"])
20587
20589
  }, null, 8, ["name", "props"])
20588
20590
  ]),
20589
20591
  _: 2
@@ -20598,7 +20600,7 @@ const _withScopeId$2 = (i) => (pushScopeId("data-v-62907637"), i = i(), popScope
20598
20600
  }, 8, ["modelValue"])
20599
20601
  ]));
20600
20602
  }
20601
- }), leftPanel_vue_vue_type_style_index_0_scoped_d7403cfd_lang = "", LeftPanel = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__scopeId", "data-v-d7403cfd"]]), calculateLeftTop = (i, n, r) => {
20603
+ }), leftPanel_vue_vue_type_style_index_0_scoped_8aba8565_lang = "", LeftPanel = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__scopeId", "data-v-8aba8565"]]), calculateLeftTop = (i, n, r) => {
20602
20604
  const o = getCenterPoint(i, n), a = calculateRotatedPointCoordinate(i, o, -r), u = calculateRotatedPointCoordinate(n, o, -r);
20603
20605
  return {
20604
20606
  width: u.x - a.x,
@@ -22570,114 +22572,142 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
22570
22572
  },
22571
22573
  emits: ["change"],
22572
22574
  setup(i, { emit: n }) {
22573
- const r = i;
22574
- function o(a) {
22575
- let u = window.setTimeout(function() {
22576
- n("change", a), clearTimeout(u), u = null;
22575
+ const r = i, o = computed(() => {
22576
+ var d;
22577
+ const u = {};
22578
+ let c = 0, f = [];
22579
+ for (let p of Object.keys(r.objInfo)) {
22580
+ const y = (d = r.objInfo[p]) == null ? void 0 : d.sort;
22581
+ if (y) {
22582
+ const v = Number(y);
22583
+ v > c && (c = v);
22584
+ }
22585
+ if (y)
22586
+ u[y] = p;
22587
+ else
22588
+ return Object.keys(r.objInfo).map((v) => ({
22589
+ ...r.objInfo[v],
22590
+ _key: v
22591
+ }));
22592
+ }
22593
+ for (let p = 0; p < c + 1; p++) {
22594
+ const y = String(p);
22595
+ f.push({
22596
+ ...r.objInfo[u[y]],
22597
+ _key: u[y]
22598
+ });
22599
+ }
22600
+ return f;
22601
+ });
22602
+ function a(u) {
22603
+ let c = window.setTimeout(function() {
22604
+ n("change", u), clearTimeout(c), c = null;
22577
22605
  }, 200);
22578
22606
  }
22579
- return (a, u) => (openBlock(!0), createElementBlock(Fragment, null, renderList(r.objInfo, (c, f) => (openBlock(), createElementBlock("div", { key: f }, [
22607
+ return (u, c) => (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (f) => (openBlock(), createElementBlock("div", {
22608
+ key: f._key
22609
+ }, [
22580
22610
  r.code ? (openBlock(), createBlock(unref(ElFormItem$1), {
22581
22611
  key: 0,
22582
22612
  class: "props-row",
22583
22613
  size: "small"
22584
22614
  }, {
22585
22615
  label: withCtx(() => [
22586
- unref(getStringWidth)(String(f)) > 78 ? (openBlock(), createBlock(unref(ElTooltip$1), {
22616
+ unref(getStringWidth)(String(f._key)) > 78 ? (openBlock(), createBlock(unref(ElTooltip$1), {
22587
22617
  key: 0,
22588
- content: String(f),
22618
+ content: String(f._key),
22589
22619
  placement: "left",
22590
22620
  "popper-class": "props-popper"
22591
22621
  }, {
22592
22622
  default: withCtx(() => [
22593
- createElementVNode("div", _hoisted_1$b, toDisplayString(f), 1)
22623
+ createElementVNode("div", _hoisted_1$b, toDisplayString(f._key), 1)
22594
22624
  ]),
22595
22625
  _: 2
22596
- }, 1032, ["content"])) : (openBlock(), createElementBlock("span", _hoisted_2$8, toDisplayString(f), 1))
22626
+ }, 1032, ["content"])) : (openBlock(), createElementBlock("span", _hoisted_2$8, toDisplayString(f._key), 1))
22597
22627
  ]),
22598
22628
  default: withCtx(() => [
22599
- unref(getStringWidth)(String(c.val)) > 145 ? (openBlock(), createBlock(unref(ElTooltip$1), {
22629
+ unref(getStringWidth)(String(f.val)) > 145 ? (openBlock(), createBlock(unref(ElTooltip$1), {
22600
22630
  key: 0,
22601
- content: JSON.stringify(c.val),
22631
+ content: JSON.stringify(f.val),
22602
22632
  placement: "left",
22603
22633
  "popper-class": "props-popper"
22604
22634
  }, {
22605
22635
  default: withCtx(() => [
22606
- createElementVNode("div", _hoisted_3$7, toDisplayString(c.val), 1)
22636
+ createElementVNode("div", _hoisted_3$7, toDisplayString(f.val), 1)
22607
22637
  ]),
22608
22638
  _: 2
22609
- }, 1032, ["content"])) : (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(c.val), 1))
22639
+ }, 1032, ["content"])) : (openBlock(), createElementBlock("span", _hoisted_4$3, toDisplayString(f.val), 1))
22610
22640
  ]),
22611
22641
  _: 2
22612
22642
  }, 1024)) : createCommentVNode("", !0),
22613
- r.hide.indexOf(String(f)) < 0 ? (openBlock(), createBlock(unref(ElFormItem$1), {
22643
+ r.hide.indexOf(String(f._key)) < 0 ? (openBlock(), createBlock(unref(ElFormItem$1), {
22614
22644
  key: 1,
22615
- label: c.title,
22645
+ label: f.title,
22616
22646
  size: "small"
22617
22647
  }, {
22618
22648
  default: withCtx(() => [
22619
- c.type === unref(EConfigItemPropsType).Select ? (openBlock(), createBlock(unref(ElSelect$1), {
22649
+ f.type === unref(EConfigItemPropsType).Select ? (openBlock(), createBlock(unref(ElSelect$1), {
22620
22650
  key: 0,
22621
- modelValue: c.val,
22622
- "onUpdate:modelValue": (d) => c.val = d,
22651
+ modelValue: r.objInfo[f._key].val,
22652
+ "onUpdate:modelValue": (d) => r.objInfo[f._key].val = d,
22623
22653
  placeholder: "Select",
22624
22654
  size: "small",
22625
- disabled: !!(c != null && c.disabled),
22626
- onChange: o
22655
+ disabled: !!(f != null && f.disabled),
22656
+ onChange: a
22627
22657
  }, {
22628
22658
  default: withCtx(() => [
22629
- (openBlock(!0), createElementBlock(Fragment, null, renderList(c.options, (d) => (openBlock(), createBlock(unref(ElOption$1), {
22659
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(f.options, (d) => (openBlock(), createBlock(unref(ElOption$1), {
22630
22660
  key: d.value,
22631
22661
  label: d.label,
22632
22662
  value: d.value
22633
22663
  }, null, 8, ["label", "value"]))), 128))
22634
22664
  ]),
22635
22665
  _: 2
22636
- }, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.type === unref(EConfigItemPropsType).InputNumber ? (openBlock(), createBlock(unref(ElInputNumber), {
22666
+ }, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.type === unref(EConfigItemPropsType).InputNumber ? (openBlock(), createBlock(unref(ElInputNumber), {
22637
22667
  key: 1,
22638
- modelValue: c.val,
22639
- "onUpdate:modelValue": (d) => c.val = d,
22640
- disabled: !!(c != null && c.disabled),
22641
- onChange: o
22642
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.type === unref(EConfigItemPropsType).Input ? (openBlock(), createBlock(unref(ElInput$1), {
22668
+ modelValue: r.objInfo[f._key].val,
22669
+ "onUpdate:modelValue": (d) => r.objInfo[f._key].val = d,
22670
+ disabled: !!(f != null && f.disabled),
22671
+ onChange: a
22672
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.type === unref(EConfigItemPropsType).Input ? (openBlock(), createBlock(unref(ElInput$1), {
22643
22673
  key: 2,
22644
- modelValue: c.val,
22645
- "onUpdate:modelValue": (d) => c.val = d,
22646
- disabled: !!(c != null && c.disabled),
22647
- onChange: o
22648
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.type === unref(EConfigItemPropsType).Textarea ? (openBlock(), createBlock(unref(ElInput$1), {
22674
+ modelValue: r.objInfo[f._key].val,
22675
+ "onUpdate:modelValue": (d) => r.objInfo[f._key].val = d,
22676
+ disabled: !!(f != null && f.disabled),
22677
+ onChange: a
22678
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.type === unref(EConfigItemPropsType).Textarea ? (openBlock(), createBlock(unref(ElInput$1), {
22649
22679
  key: 3,
22650
- modelValue: c.val,
22651
- "onUpdate:modelValue": (d) => c.val = d,
22680
+ modelValue: r.objInfo[f._key].val,
22681
+ "onUpdate:modelValue": (d) => r.objInfo[f._key].val = d,
22652
22682
  autosize: "",
22653
22683
  type: "textarea",
22654
- disabled: !!(c != null && c.disabled),
22655
- onChange: o
22656
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.type === unref(EConfigItemPropsType).Color ? (openBlock(), createBlock(unref(ElColorPicker), {
22684
+ disabled: !!(f != null && f.disabled),
22685
+ onChange: a
22686
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.type === unref(EConfigItemPropsType).Color ? (openBlock(), createBlock(unref(ElColorPicker), {
22657
22687
  key: 4,
22658
- modelValue: c.val,
22659
- "onUpdate:modelValue": (d) => c.val = d,
22660
- disabled: !!(c != null && c.disabled),
22661
- onChange: o
22662
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.type === unref(EConfigItemPropsType).Switch ? (openBlock(), createBlock(unref(ElSwitch), {
22688
+ modelValue: r.objInfo[f._key].val,
22689
+ "onUpdate:modelValue": (d) => r.objInfo[f._key].val = d,
22690
+ disabled: !!(f != null && f.disabled),
22691
+ onChange: a
22692
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.type === unref(EConfigItemPropsType).Switch ? (openBlock(), createBlock(unref(ElSwitch), {
22663
22693
  key: 5,
22664
- modelValue: c.val,
22665
- "onUpdate:modelValue": (d) => c.val = d,
22666
- disabled: !!(c != null && c.disabled),
22667
- onChange: o
22668
- }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : c.type === unref(EConfigItemPropsType).JsonEdit ? (openBlock(), createBlock(_sfc_main$w, {
22694
+ modelValue: r.objInfo[f._key].val,
22695
+ "onUpdate:modelValue": (d) => r.objInfo[f._key].val = d,
22696
+ disabled: !!(f != null && f.disabled),
22697
+ onChange: a
22698
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : f.type === unref(EConfigItemPropsType).JsonEdit ? (openBlock(), createBlock(_sfc_main$w, {
22669
22699
  key: 6,
22670
- modelValue: c.val,
22671
- "onUpdate:modelValue": (d) => c.val = d,
22672
- disabled: !!(c != null && c.disabled),
22673
- onClose: o
22700
+ modelValue: r.objInfo[f._key].val,
22701
+ "onUpdate:modelValue": (d) => r.objInfo[f._key].val = d,
22702
+ disabled: !!(f != null && f.disabled),
22703
+ onClose: a
22674
22704
  }, null, 8, ["modelValue", "onUpdate:modelValue", "disabled"])) : createCommentVNode("", !0)
22675
22705
  ]),
22676
22706
  _: 2
22677
22707
  }, 1032, ["label"])) : createCommentVNode("", !0)
22678
22708
  ]))), 128));
22679
22709
  }
22680
- }), dynamicElFormItem_vue_vue_type_style_index_0_scoped_df8be28f_lang = "", dynamicElFormItem_vue_vue_type_style_index_1_lang = "", DynamicElFormItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__scopeId", "data-v-df8be28f"]]), _hoisted_1$a = { style: { height: "100%" } }, _hoisted_2$7 = { class: "flex flex-wrap" }, _hoisted_3$6 = ["onMouseenter", "onClick"], _sfc_main$u = /* @__PURE__ */ defineComponent({
22710
+ }), dynamicElFormItem_vue_vue_type_style_index_0_scoped_b2819020_lang = "", dynamicElFormItem_vue_vue_type_style_index_1_lang = "", DynamicElFormItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__scopeId", "data-v-b2819020"]]), _hoisted_1$a = { style: { height: "100%" } }, _hoisted_2$7 = { class: "flex flex-wrap" }, _hoisted_3$6 = ["onMouseenter", "onClick"], _sfc_main$u = /* @__PURE__ */ defineComponent({
22681
22711
  __name: "common-animate",
22682
22712
  props: {
22683
22713
  val: {}