yxuse 3.0.51 → 3.0.52

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.es6.js CHANGED
@@ -55,7 +55,7 @@ import { genFileId } from "element-plus";
55
55
  import { j as jumpToHome, b as getUserConfig } from "./index.es12.js";
56
56
  import { u as uploadResourceApi } from "./index.es13.js";
57
57
  const _hoisted_1$4 = { class: "dialog-footer flex justify-end" };
58
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
58
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
59
59
  __name: "index",
60
60
  setup(__props, { expose: __expose }) {
61
61
  const dialogOptions = reactive({
@@ -148,7 +148,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
148
148
  }
149
149
  });
150
150
  const _hoisted_1$3 = { class: "dialog-footer flex justify-end" };
151
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
151
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
152
152
  __name: "index",
153
153
  setup(__props, { expose: __expose }) {
154
154
  const drawerOptions = reactive({
@@ -240,7 +240,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
240
240
  };
241
241
  }
242
242
  });
243
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
243
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
244
244
  __name: "index",
245
245
  props: {
246
246
  conf: {},
@@ -20459,7 +20459,7 @@ const exportToExcel = ({ header, tableData, fileName }) => {
20459
20459
  function _isSlot$1(s) {
20460
20460
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
20461
20461
  }
20462
- const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
20462
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, {
20463
20463
  name: "YxTable"
20464
20464
  }), {
20465
20465
  __name: "index",
@@ -20550,7 +20550,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
20550
20550
  prop: cell.prop,
20551
20551
  config: cell.config
20552
20552
  };
20553
- return createVNode(_sfc_main$7, {
20553
+ return createVNode(_sfc_main$6, {
20554
20554
  "conf": conf,
20555
20555
  "model": scope.row,
20556
20556
  "onChange": cell == null ? void 0 : cell.change
@@ -20619,105 +20619,29 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
20619
20619
  default: () => [_slot]
20620
20620
  }), pagination()]);
20621
20621
  };
20622
- const exportDataToExcel = ({
20623
- header,
20624
- tableData,
20625
- fileName
20626
- }) => {
20622
+ const exportDataToExcel = (fileName) => {
20623
+ const header = columns.value.filter((cell) => cell.prop);
20624
+ const tableData = props.tableData;
20627
20625
  exportToExcel({
20628
20626
  header,
20629
20627
  tableData,
20630
- fileName
20628
+ fileName: fileName || Date.now()
20631
20629
  });
20632
20630
  };
20631
+ const updateColumns = (newColumns) => __async(this, null, function* () {
20632
+ if (!columns.value) return;
20633
+ columns.value = typeof newColumns === "function" ? yield newColumns() : newColumns;
20634
+ });
20633
20635
  __expose({
20634
20636
  tableRef,
20635
- exportDataToExcel
20637
+ exportDataToExcel,
20638
+ updateColumns
20636
20639
  });
20637
20640
  return (_ctx, _cache) => {
20638
20641
  return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
20639
20642
  };
20640
20643
  }
20641
20644
  }));
20642
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
20643
- __name: "index",
20644
- props: {
20645
- searchColumns: {},
20646
- searchParams: {},
20647
- showSearchBtn: {
20648
- type: Boolean,
20649
- default: true
20650
- },
20651
- showAddBtn: {
20652
- type: Boolean,
20653
- default: true
20654
- },
20655
- style: {},
20656
- labelStyle: {},
20657
- className: {},
20658
- classLabelName: {}
20659
- },
20660
- emits: ["search", "add"],
20661
- setup(__props, {
20662
- emit: __emit
20663
- }) {
20664
- const slots = useSlots();
20665
- const props = __props;
20666
- const emit = __emit;
20667
- const render2 = (props2) => {
20668
- const {
20669
- searchColumns,
20670
- searchParams,
20671
- showSearchBtn,
20672
- showAddBtn,
20673
- style,
20674
- labelStyle,
20675
- className,
20676
- classLabelName
20677
- } = props2;
20678
- const renderColumn = (searchColumns2) => {
20679
- return searchColumns2.filter((cell) => !cell.show || cell.show()).map((cell) => {
20680
- var _a, _b;
20681
- const conf = {
20682
- renderType: cell.renderType,
20683
- prop: cell.key,
20684
- config: cell.config
20685
- };
20686
- return createVNode("div", {
20687
- "class": `flex items-center search-item ${className != null ? className : ""} ${(_a = cell.className) != null ? _a : ""}`,
20688
- "style": __spreadValues(__spreadValues({}, style), cell.style)
20689
- }, [createVNode("span", {
20690
- "class": `whitespace-nowrap label ${classLabelName != null ? classLabelName : ""} ${(_b = cell.classLabelName) != null ? _b : ""}`,
20691
- "style": __spreadValues(__spreadValues({}, labelStyle), cell.labelStyle)
20692
- }, [createTextVNode(" "), cell.label, createTextVNode(" ")]), createVNode(_sfc_main$7, {
20693
- "class": cell.componentClassName,
20694
- "style": cell.componentStyle,
20695
- "conf": conf,
20696
- "model": searchParams,
20697
- "onChange": cell == null ? void 0 : cell.change
20698
- }, null)]);
20699
- });
20700
- };
20701
- return createVNode(Fragment, null, [createVNode("div", {
20702
- "class": "table-search flex gap-10"
20703
- }, [renderColumn(searchColumns), showSearchBtn && createVNode(resolveComponent("el-button"), {
20704
- "onClick": () => emit("search"),
20705
- "class": "search-item"
20706
- }, {
20707
- default: () => [createTextVNode("搜索"), " "]
20708
- }), showAddBtn && createVNode(resolveComponent("el-button"), {
20709
- "class": "search-item",
20710
- "onClick": () => emit("add")
20711
- }, {
20712
- default: () => [createTextVNode("添加")]
20713
- }), slots.default && slots.default()])]);
20714
- };
20715
- return (_ctx, _cache) => {
20716
- return openBlock(), createBlock(resolveDynamicComponent(render2(props)));
20717
- };
20718
- }
20719
- });
20720
- const index$2 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-c70da20e"]]);
20721
20645
  const _hoisted_1$2 = {
20722
20646
  xmlns: "http://www.w3.org/2000/svg",
20723
20647
  viewBox: "0 0 1024 1024"
@@ -20803,7 +20727,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
20803
20727
  if ((config == null ? void 0 : config.options) && (config == null ? void 0 : config.options.length) === 0 && (config == null ? void 0 : config.loadOptions) && typeof (config == null ? void 0 : config.loadOptions) === "function") {
20804
20728
  config.options = yield config == null ? void 0 : config.loadOptions();
20805
20729
  if (prop && ((_a = props == null ? void 0 : props.formParams) == null ? void 0 : _a[prop])) {
20806
- formData.value[prop] = props.formParams[prop];
20730
+ formData.value[prop] = props == null ? void 0 : props.formParams[prop];
20807
20731
  }
20808
20732
  }
20809
20733
  });
@@ -20823,21 +20747,22 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
20823
20747
  });
20824
20748
  const getRules = () => {
20825
20749
  var _a;
20826
- let rules = {};
20750
+ const rules = {};
20827
20751
  if (!((_a = formColumn.value) == null ? void 0 : _a.length)) return;
20828
20752
  const handleRule = (item) => {
20829
20753
  var _a2;
20830
- if (!item.required) return;
20831
20754
  if (!item.prop) return;
20832
20755
  const isSelect = (item == null ? void 0 : item.renderType) && ["select", "cascader"].includes(item == null ? void 0 : item.renderType);
20833
20756
  const defaultRule = {
20834
20757
  required: true,
20835
- message: `${(_a2 = item.label) != null ? _a2 : ""}不能为空`,
20758
+ message: `${(_a2 = item.label) != null ? _a2 : "该字段"}不能为空`,
20836
20759
  trigger: isSelect ? "change" : "blur"
20837
20760
  };
20838
- rules[item.prop] = rules[item.prop] ? [...rules[item.prop], defaultRule] : [defaultRule];
20839
- if (item.rules) {
20840
- rules[item.prop] = [...rules[item.prop], ...item.rules];
20761
+ if (item.required) {
20762
+ rules[item.prop] = [defaultRule];
20763
+ }
20764
+ if (item.rules && item.rules.length > 0) {
20765
+ rules[item.prop] = [...rules[item == null ? void 0 : item.prop] || [], ...item.rules];
20841
20766
  }
20842
20767
  };
20843
20768
  formColumn.value.forEach((form) => {
@@ -21020,7 +20945,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
21020
20945
  };
21021
20946
  }
21022
20947
  }));
21023
- const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-2435d575"]]);
20948
+ const index$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-4196aa66"]]);
21024
20949
  let versionKey, curVersion, updateApp;
21025
20950
  const updateSysVersion = () => {
21026
20951
  localStorage.setItem(versionKey, curVersion);
@@ -21280,25 +21205,23 @@ const components2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
21280
21205
  LogoTitleRender,
21281
21206
  Toolbar,
21282
21207
  Update,
21283
- YxDialog: _sfc_main$9,
21284
- YxDrawer: _sfc_main$8,
21208
+ YxDialog: _sfc_main$8,
21209
+ YxDrawer: _sfc_main$7,
21285
21210
  YxForm: index$1,
21286
21211
  YxIcon: index,
21287
- YxSearchForm: index$2,
21288
- YxTable: _sfc_main$6,
21212
+ YxTable: _sfc_main$5,
21289
21213
  YxUpload: _sfc_main$1
21290
21214
  }, Symbol.toStringTag, { value: "Module" }));
21291
21215
  export {
21292
21216
  LogoTitleRender as L,
21293
21217
  Update as U,
21294
- _sfc_main$9 as _,
21295
- _sfc_main$8 as a,
21296
- _sfc_main$6 as b,
21218
+ _sfc_main$8 as _,
21219
+ _sfc_main$7 as a,
21220
+ _sfc_main$5 as b,
21297
21221
  components2 as c,
21298
- index$1 as d,
21299
- index as e,
21300
- _sfc_main$1 as f,
21301
- LogoTitle as g,
21302
- index$2 as i
21222
+ index as d,
21223
+ _sfc_main$1 as e,
21224
+ LogoTitle as f,
21225
+ index$1 as i
21303
21226
  };
21304
21227
  //# sourceMappingURL=index.es6.js.map
Binary file