element-less 0.0.33 → 0.0.34

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.
@@ -15298,7 +15298,8 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
15298
15298
  ...{ name: "ElsMenuTool" },
15299
15299
  __name: "menuTool",
15300
15300
  props: menuToolProps,
15301
- setup(__props, { expose: __expose }) {
15301
+ emits: ["callback"],
15302
+ setup(__props, { expose: __expose, emit: __emit }) {
15302
15303
  const container = useContainer();
15303
15304
  const props = __props;
15304
15305
  const menuConfig = utils.getMenuConfig();
@@ -15323,6 +15324,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
15323
15324
  previewImg: "",
15324
15325
  uploadUrl: ""
15325
15326
  });
15327
+ const emits2 = __emit;
15326
15328
  watch(() => props.url, (val) => {
15327
15329
  if (val) {
15328
15330
  val.post({}).then((res) => {
@@ -15413,7 +15415,9 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
15413
15415
  uploadUrl: menu.TargetUrl
15414
15416
  };
15415
15417
  } else if (container.$menuCommand) {
15416
- container.$menuCommand(menu);
15418
+ container.$menuCommand(menu).then((res) => {
15419
+ emits2("callback", res);
15420
+ });
15417
15421
  }
15418
15422
  }
15419
15423
  function uploadSuccess(res) {
@@ -37495,45 +37499,45 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
37495
37499
  });
37496
37500
  const completeReadTableIds = ref([]);
37497
37501
  function validate() {
37498
- return new Promise((resolve) => {
37502
+ return new Promise((resolve2) => {
37499
37503
  const currValidates = [...elsPageStore.value.validates];
37500
37504
  if (elsPageStore.value.childContainer.length) {
37501
37505
  currValidates.push(...elsPageStore.value.childContainer);
37502
37506
  }
37503
37507
  Promise.all(currValidates.map((ele) => ele.validate())).then((res) => {
37504
37508
  if (res.every((ele) => ele == true)) {
37505
- resolve(true);
37509
+ resolve2(true);
37506
37510
  emits2("validate", true);
37507
37511
  } else {
37508
- resolve(false);
37512
+ resolve2(false);
37509
37513
  emits2("validate", false);
37510
37514
  }
37511
37515
  });
37512
37516
  });
37513
37517
  }
37514
37518
  function save(url) {
37515
- return new Promise((resolve, reject) => {
37519
+ return new Promise((resolve2, reject) => {
37516
37520
  if (elsPageStore.value.saveForms.length) {
37517
37521
  validate().then((res) => {
37518
37522
  if (res) {
37519
37523
  Promise.all(elsPageStore.value.saveForms.map((ele) => ele.save(url))).then(() => {
37520
- resolve(true);
37524
+ resolve2(true);
37521
37525
  }).catch((error) => {
37522
37526
  reject(error);
37523
37527
  });
37524
37528
  } else {
37525
- resolve(false);
37529
+ resolve2(false);
37526
37530
  }
37527
37531
  });
37528
37532
  } else {
37529
- resolve(true);
37533
+ resolve2(true);
37530
37534
  }
37531
37535
  });
37532
37536
  }
37533
37537
  async function query(initPage = false, tableRef = "") {
37534
37538
  const parentRefs = ctx._.parent.refs;
37535
37539
  completeReadTableIds.value.length = 0;
37536
- return new Promise(async (resolve) => {
37540
+ return new Promise(async (resolve2) => {
37537
37541
  if (tableRef) {
37538
37542
  const currForm = elsPageStore.value.queryForms.find((ele) => ele.tableRef == tableRef);
37539
37543
  if (currForm) {
@@ -37546,13 +37550,13 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
37546
37550
  if (currTable && (currTable.initReadData || !initPage)) {
37547
37551
  completeReadTableIds.value.push(currTable.tagID);
37548
37552
  currTable.query(initPage, res).then(() => {
37549
- resolve(true);
37553
+ resolve2(true);
37550
37554
  });
37551
37555
  }
37552
37556
  }
37553
37557
  });
37554
37558
  } else {
37555
- resolve(false);
37559
+ resolve2(false);
37556
37560
  }
37557
37561
  return;
37558
37562
  }
@@ -37588,7 +37592,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
37588
37592
  });
37589
37593
  }
37590
37594
  Promise.all(queryAsyncs).then(() => {
37591
- resolve(true);
37595
+ resolve2(true);
37592
37596
  });
37593
37597
  } else if (elsPageStore.value.dataTables.length) {
37594
37598
  const queryAsyncs = [];
@@ -37596,182 +37600,203 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
37596
37600
  queryAsyncs.push(item.query(initPage, {}));
37597
37601
  });
37598
37602
  Promise.all(queryAsyncs).then(() => {
37599
- resolve(true);
37603
+ resolve2(true);
37600
37604
  });
37601
37605
  } else {
37602
- resolve(true);
37606
+ resolve2(true);
37603
37607
  }
37604
37608
  });
37605
37609
  }
37606
37610
  function elsSaveTable() {
37607
- return new Promise(async (resolve) => {
37611
+ return new Promise(async (resolve2) => {
37608
37612
  const queryAsyncs = [];
37609
37613
  elsPageStore.value.dataTables.forEach((ele) => {
37610
37614
  queryAsyncs.push(ele.saveTableData());
37611
37615
  });
37612
37616
  if (queryAsyncs.length) {
37613
37617
  Promise.all(queryAsyncs).then(() => {
37614
- resolve(true);
37618
+ resolve2(true);
37615
37619
  }).catch(() => {
37616
- resolve(false);
37620
+ resolve2(false);
37617
37621
  });
37618
37622
  }
37619
37623
  });
37620
37624
  }
37621
37625
  function elsMenuCommand(menu) {
37622
- switch (menu[$actionField]) {
37623
- case "Save":
37624
- menu.IsLoading = true;
37625
- if (menu[$confirmField] && !menu[$confirmPasswordField]) {
37626
+ return new Promise((resolve2, reject) => {
37627
+ switch (menu[$actionField]) {
37628
+ case "Save":
37626
37629
  menu.IsLoading = true;
37627
- ElMessageBox.confirm(menu[$confirmField]).then((_) => {
37628
- save(menu[$urlField]).then(() => {
37629
- menu.IsLoading = false;
37630
+ if (menu[$confirmField] && !menu[$confirmPasswordField]) {
37631
+ menu.IsLoading = true;
37632
+ ElMessageBox.confirm(menu[$confirmField]).then((res) => {
37633
+ save(menu[$urlField]).then(() => {
37634
+ resolve2({ menu, res });
37635
+ menu.IsLoading = false;
37636
+ }).catch((err) => {
37637
+ reject(err);
37638
+ menu.IsLoading = false;
37639
+ });
37630
37640
  }).catch(() => {
37631
37641
  menu.IsLoading = false;
37632
37642
  });
37633
- }).catch(() => {
37634
- menu.IsLoading = false;
37635
- });
37636
- } else if (menu[$confirmField] && menu[$confirmPasswordField]) {
37637
- ElMessageBox.prompt(`请输入密码${menu.IsShowPassword ? `【${menu[$confirmPasswordField]}】` : ""}`, menu[$confirmField], {
37638
- confirmButtonText: "确定",
37639
- cancelButtonText: "取消",
37640
- closeOnHashChange: false,
37641
- closeOnClickModal: false,
37642
- inputValidator: (val) => {
37643
- return val == menu[$confirmPasswordField];
37644
- },
37645
- inputErrorMessage: "密码错误"
37646
- }).then(() => {
37647
- save(menu[$urlField]).then(() => {
37643
+ } else if (menu[$confirmField] && menu[$confirmPasswordField]) {
37644
+ ElMessageBox.prompt(`请输入密码${menu.IsShowPassword ? `【${menu[$confirmPasswordField]}】` : ""}`, menu[$confirmField], {
37645
+ confirmButtonText: "确定",
37646
+ cancelButtonText: "取消",
37647
+ closeOnHashChange: false,
37648
+ closeOnClickModal: false,
37649
+ inputValidator: (val) => {
37650
+ return val == menu[$confirmPasswordField];
37651
+ },
37652
+ inputErrorMessage: "密码错误"
37653
+ }).then(() => {
37654
+ save(menu[$urlField]).then((res) => {
37655
+ resolve2({ menu, res });
37656
+ menu.IsLoading = false;
37657
+ }).catch((err) => {
37658
+ reject(err);
37659
+ menu.IsLoading = false;
37660
+ });
37661
+ }).catch((err) => {
37662
+ reject(err);
37663
+ });
37664
+ } else {
37665
+ save(menu[$urlField]).then((res) => {
37648
37666
  menu.IsLoading = false;
37649
- }).catch(() => {
37667
+ resolve2({ menu, res });
37668
+ }).catch((err) => {
37650
37669
  menu.IsLoading = false;
37670
+ reject(err);
37651
37671
  });
37652
- }).catch(() => {
37653
- });
37654
- } else {
37655
- save(menu[$urlField]).then(() => {
37656
- menu.IsLoading = false;
37657
- }).catch(() => {
37658
- menu.IsLoading = false;
37659
- });
37660
- }
37661
- break;
37662
- case "Drawer":
37663
- drawerUrl.value = menu[$urlField];
37664
- drawerVisible.value = true;
37665
- break;
37666
- case "Dialog":
37667
- dialogUrl.value = menu[$urlField];
37668
- dialogVisible.value = true;
37669
- break;
37670
- case "Target":
37671
- menu.IsLoading = true;
37672
- if (menu.IsQueryState == 1) {
37673
- elsPageStore.value.queryForms.forEach((ele) => {
37674
- ele.cacheQueryState();
37675
- });
37676
- }
37677
- window.location.href = menu[$urlField];
37678
- break;
37679
- case "TargetBlank":
37680
- window.open(menu[$urlField]);
37681
- break;
37682
- case "Select":
37683
- const currSelectData = {};
37684
- elsPageStore.value.dataTables.forEach((ele) => {
37685
- let keyData = ele.getTableSelectionWithQuery(props.selectMenuPostQuery);
37686
- Object.assign(currSelectData, keyData);
37687
- });
37688
- if (menu[$confirmField] && !menu[$confirmPasswordField]) {
37672
+ }
37673
+ break;
37674
+ case "Drawer":
37675
+ drawerUrl.value = menu[$urlField];
37676
+ drawerVisible.value = true;
37677
+ break;
37678
+ case "Dialog":
37679
+ dialogUrl.value = menu[$urlField];
37680
+ dialogVisible.value = true;
37681
+ break;
37682
+ case "Target":
37689
37683
  menu.IsLoading = true;
37690
- ElMessageBox.confirm(menu[$confirmField]).then((_) => {
37684
+ if (menu.IsQueryState == 1) {
37685
+ elsPageStore.value.queryForms.forEach((ele) => {
37686
+ ele.cacheQueryState();
37687
+ });
37688
+ }
37689
+ window.location.href = menu[$urlField];
37690
+ break;
37691
+ case "TargetBlank":
37692
+ window.open(menu[$urlField]);
37693
+ break;
37694
+ case "Select":
37695
+ const currSelectData = {};
37696
+ elsPageStore.value.dataTables.forEach((ele) => {
37697
+ let keyData = ele.getTableSelectionWithQuery(props.selectMenuPostQuery);
37698
+ Object.assign(currSelectData, keyData);
37699
+ });
37700
+ if (menu[$confirmField] && !menu[$confirmPasswordField]) {
37701
+ menu.IsLoading = true;
37702
+ ElMessageBox.confirm(menu[$confirmField]).then((_) => {
37703
+ menu[$urlField].post(currSelectData).then((res) => {
37704
+ menu.IsLoading = false;
37705
+ resolve2({ menu, res });
37706
+ if (!res) {
37707
+ return;
37708
+ }
37709
+ elsApiResult(res);
37710
+ }).catch((err) => {
37711
+ console.log(err);
37712
+ inject(err);
37713
+ menu.IsLoading = false;
37714
+ });
37715
+ }).catch((err) => {
37716
+ menu.IsLoading = false;
37717
+ inject(err);
37718
+ });
37719
+ } else if (menu[$confirmField] && menu[$confirmPasswordField]) {
37720
+ ElMessageBox.prompt(`请输入密码${menu.IsShowPassword ? `【${menu[$confirmPasswordField]}】` : ""}`, menu[$confirmField], {
37721
+ confirmButtonText: "确定",
37722
+ cancelButtonText: "取消",
37723
+ closeOnHashChange: false,
37724
+ closeOnClickModal: false,
37725
+ inputValidator: (val) => {
37726
+ return val == menu[$confirmPasswordField];
37727
+ },
37728
+ inputErrorMessage: "密码错误"
37729
+ }).then(() => {
37730
+ menu.IsLoading = true;
37731
+ menu[$urlField].post(currSelectData).then((res) => {
37732
+ menu.IsLoading = false;
37733
+ resolve2({ menu, res });
37734
+ if (!res) {
37735
+ return;
37736
+ }
37737
+ elsApiResult(res);
37738
+ }).catch((err) => {
37739
+ console.log(err);
37740
+ inject(err);
37741
+ menu.IsLoading = false;
37742
+ });
37743
+ }).catch((err) => {
37744
+ inject(err);
37745
+ });
37746
+ } else {
37747
+ menu.IsLoading = true;
37691
37748
  menu[$urlField].post(currSelectData).then((res) => {
37692
37749
  menu.IsLoading = false;
37750
+ resolve2({ menu, res });
37693
37751
  if (!res) {
37694
37752
  return;
37695
37753
  }
37696
37754
  elsApiResult(res);
37697
37755
  }).catch((err) => {
37698
37756
  console.log(err);
37757
+ inject(err);
37699
37758
  menu.IsLoading = false;
37700
37759
  });
37701
- }).catch(() => {
37702
- menu.IsLoading = false;
37703
- });
37704
- } else if (menu[$confirmField] && menu[$confirmPasswordField]) {
37705
- ElMessageBox.prompt(`请输入密码${menu.IsShowPassword ? `【${menu[$confirmPasswordField]}】` : ""}`, menu[$confirmField], {
37706
- confirmButtonText: "确定",
37707
- cancelButtonText: "取消",
37708
- closeOnHashChange: false,
37709
- closeOnClickModal: false,
37710
- inputValidator: (val) => {
37711
- return val == menu[$confirmPasswordField];
37712
- },
37713
- inputErrorMessage: "密码错误"
37714
- }).then(() => {
37760
+ }
37761
+ break;
37762
+ case "Export":
37763
+ if (menu[$urlField] && menu[$urlField].split("?")[0]) {
37715
37764
  menu.IsLoading = true;
37716
- menu[$urlField].post(currSelectData).then((res) => {
37765
+ menu[$urlField].post((res) => {
37717
37766
  menu.IsLoading = false;
37767
+ resolve2({ menu, res: true });
37718
37768
  if (!res) {
37719
37769
  return;
37720
37770
  }
37721
- elsApiResult(res);
37722
- }).catch((err) => {
37723
- console.log(err);
37724
- menu.IsLoading = false;
37771
+ if (res[$codeField] == "0") {
37772
+ var currUrl = res.Data;
37773
+ if (currUrl.indexOf("txt") > -1) {
37774
+ utils.downLoadTxt(currUrl);
37775
+ } else {
37776
+ window.location.href = currUrl;
37777
+ }
37778
+ } else {
37779
+ ElMessage.error(res[$messageField]);
37780
+ }
37725
37781
  });
37726
- }).catch(() => {
37727
- });
37728
- } else {
37782
+ } else {
37783
+ elsExportAll();
37784
+ resolve2({ menu, res: true });
37785
+ menu.IsLoading = false;
37786
+ }
37787
+ break;
37788
+ case "Search":
37729
37789
  menu.IsLoading = true;
37730
- menu[$urlField].post(currSelectData).then((res) => {
37790
+ query().then(() => {
37731
37791
  menu.IsLoading = false;
37732
- if (!res) {
37733
- return;
37734
- }
37735
- elsApiResult(res);
37792
+ resolve2({ menu, res: true });
37736
37793
  }).catch((err) => {
37737
- console.log(err);
37738
- menu.IsLoading = false;
37739
- });
37740
- }
37741
- break;
37742
- case "Export":
37743
- if (menu[$urlField] && menu[$urlField].split("?")[0]) {
37744
- menu.IsLoading = true;
37745
- menu[$urlField].post((res) => {
37794
+ resolve2(err);
37746
37795
  menu.IsLoading = false;
37747
- if (!res) {
37748
- return;
37749
- }
37750
- if (res[$codeField] == "0") {
37751
- var currUrl = res.Data;
37752
- if (currUrl.indexOf("txt") > -1) {
37753
- utils.downLoadTxt(currUrl);
37754
- } else {
37755
- window.location.href = currUrl;
37756
- }
37757
- } else {
37758
- ElMessage.error(res[$messageField]);
37759
- }
37760
37796
  });
37761
- } else {
37762
- elsExportAll();
37763
- menu.IsLoading = false;
37764
- }
37765
- break;
37766
- case "Search":
37767
- menu.IsLoading = true;
37768
- query().then(() => {
37769
- menu.IsLoading = false;
37770
- }).catch(() => {
37771
- menu.IsLoading = false;
37772
- });
37773
- return false;
37774
- }
37797
+ return false;
37798
+ }
37799
+ });
37775
37800
  }
37776
37801
  function elsApiResult(res) {
37777
37802
  if (!res) {
@@ -37818,10 +37843,10 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
37818
37843
  dataTable.exportTable();
37819
37844
  }
37820
37845
  function elsExportHtml() {
37821
- return new Promise((resolve) => {
37846
+ return new Promise((resolve2) => {
37822
37847
  if (!elsPageStore) {
37823
37848
  ElMessage.warning("页面未包含在els-container中无法使用默认导出");
37824
- resolve(false);
37849
+ resolve2(false);
37825
37850
  return;
37826
37851
  }
37827
37852
  const dataTables = elsPageStore.value.dataTables;
@@ -37859,7 +37884,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
37859
37884
  ele.changePageReadData();
37860
37885
  }
37861
37886
  });
37862
- resolve(true);
37887
+ resolve2(true);
37863
37888
  });
37864
37889
  });
37865
37890
  }
@@ -38403,7 +38428,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
38403
38428
  emits: /* @__PURE__ */ mergeModels(["removeItem"], ["update:children"]),
38404
38429
  setup(__props, { emit: __emit }) {
38405
38430
  const DynamicDesignerInnerItem = defineAsyncComponent(() => {
38406
- return import("./innerItem-DgJGxuZt.js");
38431
+ return import("./innerItem-oVhiu6eJ.js");
38407
38432
  });
38408
38433
  const { getValue: getValue2 } = useProps();
38409
38434
  const tagID = getValue2("tagID");
@@ -39253,10 +39278,10 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
39253
39278
  emits: ["update:modelValue"],
39254
39279
  setup(__props, { expose: __expose, emit: __emit }) {
39255
39280
  const DynamicRenderInner = defineAsyncComponent(() => {
39256
- return import("./inner-FdQv7rum.js").then((n) => n.i);
39281
+ return import("./inner-7tCDHP4a.js").then((n) => n.i);
39257
39282
  });
39258
39283
  const DynamicRenderForm = defineAsyncComponent(() => {
39259
- return import("./inner-FdQv7rum.js").then((n) => n.f);
39284
+ return import("./inner-7tCDHP4a.js").then((n) => n.f);
39260
39285
  });
39261
39286
  const props = __props;
39262
39287
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props);
@@ -39486,10 +39511,10 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
39486
39511
  emits: ["update:modelValue"],
39487
39512
  setup(__props, { expose: __expose, emit: __emit }) {
39488
39513
  const DynamicRenderInnerAsync = defineAsyncComponent(() => {
39489
- return import("./inner-FdQv7rum.js").then((n) => n.i);
39514
+ return import("./inner-7tCDHP4a.js").then((n) => n.i);
39490
39515
  });
39491
39516
  const DynamicRenderFormAsync = defineAsyncComponent(() => {
39492
- return import("./inner-FdQv7rum.js").then((n) => n.f);
39517
+ return import("./inner-7tCDHP4a.js").then((n) => n.f);
39493
39518
  });
39494
39519
  const props = __props;
39495
39520
  const { getValue: getValue2, setValue, formNodeProps } = useProps(props);
@@ -44298,31 +44323,31 @@ let AceEditor$1 = class AceEditor extends TBaseFormItem {
44298
44323
  __publicField(this, "editor", ref());
44299
44324
  onMounted(() => {
44300
44325
  if (props.language === "json") {
44301
- const currModule = import("./mode-json-DrO1ZDr5.js").then((n) => n.m);
44326
+ const currModule = import("./mode-json-Chpf6R8h.js").then((n) => n.m);
44302
44327
  currModule.then((res) => {
44303
44328
  ace.config.setModuleUrl("ace/mode/json", res);
44304
44329
  this.init();
44305
44330
  });
44306
44331
  } else if (props.language === "javascript") {
44307
- const currModule = import("./mode-javascript-DDhGPTJK.js").then((n) => n.m);
44332
+ const currModule = import("./mode-javascript-Cy4e6XSt.js").then((n) => n.m);
44308
44333
  currModule.then((res) => {
44309
44334
  ace.config.setModuleUrl("ace/mode/javascript", res);
44310
44335
  this.init();
44311
44336
  });
44312
44337
  } else if (props.language === "csharp") {
44313
- const currModule = import("./mode-csharp-CTue9Lri.js").then((n) => n.m);
44338
+ const currModule = import("./mode-csharp-2uFK_Xfk.js").then((n) => n.m);
44314
44339
  currModule.then((res) => {
44315
44340
  ace.config.setModuleUrl("ace/mode/csharp", res);
44316
44341
  this.init();
44317
44342
  });
44318
44343
  } else if (props.language === "mysql") {
44319
- const currModule = import("./mode-mysql-BaPWW0Gn.js").then((n) => n.m);
44344
+ const currModule = import("./mode-mysql-B5NfPqi0.js").then((n) => n.m);
44320
44345
  currModule.then((res) => {
44321
44346
  ace.config.setModuleUrl("ace/mode/mysql", res);
44322
44347
  this.init();
44323
44348
  });
44324
44349
  } else if (props.language === "css") {
44325
- const currModule = import("./mode-css-CW7AJtik.js").then((n) => n.m);
44350
+ const currModule = import("./mode-css--MzwaiJV.js").then((n) => n.m);
44326
44351
  currModule.then((res) => {
44327
44352
  ace.config.setModuleUrl("ace/mode/css", res);
44328
44353
  this.init();