@dt-frames/ui 1.0.17 → 1.0.21

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.
@@ -90,6 +90,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
90
90
  registerForm: (formInstance: import("../../../forms").FormActionType) => void;
91
91
  getFormValues: () => Recordable<any>;
92
92
  setFormValues: (values: Recordable<any>) => Promise<void>;
93
+ validate: (nameList?: (string | number)[]) => Promise<any>;
93
94
  handleSave: () => void;
94
95
  DtForm: import("vue").DefineComponent<{
95
96
  mode: {
package/es/index.js CHANGED
@@ -1,8 +1,9 @@
1
- import { defineComponent, resolveComponent, openBlock, createBlock, computed, unref, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, ref, watch, Fragment, renderList, createTextVNode, toDisplayString, KeepAlive, createVNode, withCtx, reactive, toRaw, getCurrentInstance, watchEffect, nextTick, onUnmounted, toRefs, isVNode, inject, h, provide, onMounted, onBeforeUnmount, resolveDynamicComponent, renderSlot, createCommentVNode, mergeProps, readonly, isRef, useAttrs as useAttrs$1, normalizeProps, guardReactiveProps, withDirectives, resolveDirective, render, createSlots, useSlots as useSlots$1, withModifiers, vShow, toRef, Transition } from "vue";
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, computed, unref, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, ref, watch, Fragment, renderList, createTextVNode, toDisplayString, KeepAlive, createVNode, withCtx, reactive, toRaw, getCurrentInstance, watchEffect, nextTick, toRefs, isVNode, inject, onUnmounted, h, provide, onMounted, onBeforeUnmount, resolveDynamicComponent, renderSlot, createCommentVNode, mergeProps, readonly, isRef, useAttrs as useAttrs$1, normalizeProps, guardReactiveProps, withDirectives, resolveDirective, render, createSlots, useSlots as useSlots$1, withModifiers, vShow, toRef, Transition } from "vue";
2
2
  import { isString, isArray as isArray$1, isObject, isFunction, error, useTimeoutFn, useAttrs, useSlots, dispatchResize, BAR_MAP, off, renderThumbStyle, on, useAppStore, addResizeListener, removeResizeListener, windowResizeFn, isNumber, isBoolean, isNull, DtCache, CacheKey, deepMerge, http, getDynamicProps, getDictValueByCode, formatNumber, isVnode, getPopupContainer, isNullAndUnDef, dateFormat, useMessage, isEmpty, useTheme, useMenu, useHeader, useGo, Pages, localeList, changeLocale, Theme, MenuMode, MenuType, useThemeStore, ContentMode, useMultipleTab, copyText, MenuSplitTye, isUrl, openWindow, RouteReuseStore, menuList2Map, useApp } from "@dt-frames/core";
3
3
  import { InputSearch, Tooltip, Modal as Modal$1, RadioGroup, RadioButton, InputGroup, Input, Button, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Form, FormItem, Row, Popover, Spin, Dropdown, Menu, MenuItem, CheckboxGroup, Table, Upload, Image, MenuDivider, Tree, Empty, BackTop, Breadcrumb, Avatar, Drawer, SubMenu, LayoutHeader, LayoutSider, Tabs, TabPane, LayoutFooter, LayoutContent, ConfigProvider, Layout } from "ant-design-vue";
4
4
  import { isEqual, omit, cloneDeep, upperFirst, set, uniqBy, difference, get, trim } from "lodash-es";
5
5
  import { tryOnUnmounted, isFunction as isFunction$1, useFullscreen, useDebounceFn, useThrottleFn } from "@vueuse/core";
6
+ import dayjs from "dayjs";
6
7
  import Sortablejs from "sortablejs";
7
8
  import * as xlsx from "xlsx";
8
9
  import { useRouter } from "vue-router";
@@ -2001,13 +2002,6 @@ function useModalOut() {
2001
2002
  throw new Error("useModal\u53EA\u80FD\u5728setup()\u6216\u8005\u51FD\u6570\u4E2D\u4F7F\u7528");
2002
2003
  }
2003
2004
  uid.value = uuid;
2004
- onUnmounted(() => {
2005
- modal.value = null;
2006
- loaded.value = false;
2007
- dataTransfer[unref(uid)] = null;
2008
- cbTransfer[unref(uid)] = (rsp) => {
2009
- };
2010
- });
2011
2005
  if (unref(loaded) && modalMethod === unref(modal))
2012
2006
  return;
2013
2007
  modal.value = modalMethod;
@@ -3044,11 +3038,7 @@ var _sfc_main$P = defineComponent({
3044
3038
  props: cProps = {}
3045
3039
  } = schema2;
3046
3040
  if (isFunction(cProps)) {
3047
- cProps = (_a = cProps({
3048
- schema: schema2,
3049
- formModel,
3050
- formActionType
3051
- })) != null ? _a : {};
3041
+ cProps = (_a = cProps(formModel)) != null ? _a : {};
3052
3042
  }
3053
3043
  if (schema2.component === "Divider") {
3054
3044
  cProps = Object.assign({
@@ -3538,213 +3528,6 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
3538
3528
  }
3539
3529
  var FormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$5]]);
3540
3530
  const isArray = Array.isArray;
3541
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3542
- var dayjs_min = { exports: {} };
3543
- (function(module, exports) {
3544
- !function(t, e) {
3545
- module.exports = e();
3546
- }(commonjsGlobal, function() {
3547
- var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h2 = "quarter", c = "year", d = "date", $ = "Invalid Date", l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") }, m = function(t2, e2, n2) {
3548
- var r2 = String(t2);
3549
- return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
3550
- }, g = { s: m, z: function(t2) {
3551
- var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
3552
- return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
3553
- }, m: function t2(e2, n2) {
3554
- if (e2.date() < n2.date())
3555
- return -t2(n2, e2);
3556
- var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f);
3557
- return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
3558
- }, a: function(t2) {
3559
- return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
3560
- }, p: function(t2) {
3561
- return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h2 }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
3562
- }, u: function(t2) {
3563
- return void 0 === t2;
3564
- } }, v = "en", D = {};
3565
- D[v] = M;
3566
- var p = function(t2) {
3567
- return t2 instanceof _;
3568
- }, S = function t2(e2, n2, r2) {
3569
- var i2;
3570
- if (!e2)
3571
- return v;
3572
- if ("string" == typeof e2) {
3573
- var s2 = e2.toLowerCase();
3574
- D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
3575
- var u2 = e2.split("-");
3576
- if (!i2 && u2.length > 1)
3577
- return t2(u2[0]);
3578
- } else {
3579
- var a2 = e2.name;
3580
- D[a2] = e2, i2 = a2;
3581
- }
3582
- return !r2 && i2 && (v = i2), i2 || !r2 && v;
3583
- }, w = function(t2, e2) {
3584
- if (p(t2))
3585
- return t2.clone();
3586
- var n2 = "object" == typeof e2 ? e2 : {};
3587
- return n2.date = t2, n2.args = arguments, new _(n2);
3588
- }, O = g;
3589
- O.l = S, O.i = p, O.w = function(t2, e2) {
3590
- return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
3591
- };
3592
- var _ = function() {
3593
- function M2(t2) {
3594
- this.$L = S(t2.locale, null, true), this.parse(t2);
3595
- }
3596
- var m2 = M2.prototype;
3597
- return m2.parse = function(t2) {
3598
- this.$d = function(t3) {
3599
- var e2 = t3.date, n2 = t3.utc;
3600
- if (null === e2)
3601
- return new Date(NaN);
3602
- if (O.u(e2))
3603
- return new Date();
3604
- if (e2 instanceof Date)
3605
- return new Date(e2);
3606
- if ("string" == typeof e2 && !/Z$/i.test(e2)) {
3607
- var r2 = e2.match(l);
3608
- if (r2) {
3609
- var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
3610
- return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
3611
- }
3612
- }
3613
- return new Date(e2);
3614
- }(t2), this.$x = t2.x || {}, this.init();
3615
- }, m2.init = function() {
3616
- var t2 = this.$d;
3617
- this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
3618
- }, m2.$utils = function() {
3619
- return O;
3620
- }, m2.isValid = function() {
3621
- return !(this.$d.toString() === $);
3622
- }, m2.isSame = function(t2, e2) {
3623
- var n2 = w(t2);
3624
- return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
3625
- }, m2.isAfter = function(t2, e2) {
3626
- return w(t2) < this.startOf(e2);
3627
- }, m2.isBefore = function(t2, e2) {
3628
- return this.endOf(e2) < w(t2);
3629
- }, m2.$g = function(t2, e2, n2) {
3630
- return O.u(t2) ? this[e2] : this.set(n2, t2);
3631
- }, m2.unix = function() {
3632
- return Math.floor(this.valueOf() / 1e3);
3633
- }, m2.valueOf = function() {
3634
- return this.$d.getTime();
3635
- }, m2.startOf = function(t2, e2) {
3636
- var n2 = this, r2 = !!O.u(e2) || e2, h3 = O.p(t2), $2 = function(t3, e3) {
3637
- var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
3638
- return r2 ? i2 : i2.endOf(a);
3639
- }, l2 = function(t3, e3) {
3640
- return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
3641
- }, y2 = this.$W, M3 = this.$M, m3 = this.$D, g2 = "set" + (this.$u ? "UTC" : "");
3642
- switch (h3) {
3643
- case c:
3644
- return r2 ? $2(1, 0) : $2(31, 11);
3645
- case f:
3646
- return r2 ? $2(1, M3) : $2(0, M3 + 1);
3647
- case o:
3648
- var v2 = this.$locale().weekStart || 0, D2 = (y2 < v2 ? y2 + 7 : y2) - v2;
3649
- return $2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
3650
- case a:
3651
- case d:
3652
- return l2(g2 + "Hours", 0);
3653
- case u:
3654
- return l2(g2 + "Minutes", 1);
3655
- case s:
3656
- return l2(g2 + "Seconds", 2);
3657
- case i:
3658
- return l2(g2 + "Milliseconds", 3);
3659
- default:
3660
- return this.clone();
3661
- }
3662
- }, m2.endOf = function(t2) {
3663
- return this.startOf(t2, false);
3664
- }, m2.$set = function(t2, e2) {
3665
- var n2, o2 = O.p(t2), h3 = "set" + (this.$u ? "UTC" : ""), $2 = (n2 = {}, n2[a] = h3 + "Date", n2[d] = h3 + "Date", n2[f] = h3 + "Month", n2[c] = h3 + "FullYear", n2[u] = h3 + "Hours", n2[s] = h3 + "Minutes", n2[i] = h3 + "Seconds", n2[r] = h3 + "Milliseconds", n2)[o2], l2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
3666
- if (o2 === f || o2 === c) {
3667
- var y2 = this.clone().set(d, 1);
3668
- y2.$d[$2](l2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
3669
- } else
3670
- $2 && this.$d[$2](l2);
3671
- return this.init(), this;
3672
- }, m2.set = function(t2, e2) {
3673
- return this.clone().$set(t2, e2);
3674
- }, m2.get = function(t2) {
3675
- return this[O.p(t2)]();
3676
- }, m2.add = function(r2, h3) {
3677
- var d2, $2 = this;
3678
- r2 = Number(r2);
3679
- var l2 = O.p(h3), y2 = function(t2) {
3680
- var e2 = w($2);
3681
- return O.w(e2.date(e2.date() + Math.round(t2 * r2)), $2);
3682
- };
3683
- if (l2 === f)
3684
- return this.set(f, this.$M + r2);
3685
- if (l2 === c)
3686
- return this.set(c, this.$y + r2);
3687
- if (l2 === a)
3688
- return y2(1);
3689
- if (l2 === o)
3690
- return y2(7);
3691
- var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[l2] || 1, m3 = this.$d.getTime() + r2 * M3;
3692
- return O.w(m3, this);
3693
- }, m2.subtract = function(t2, e2) {
3694
- return this.add(-1 * t2, e2);
3695
- }, m2.format = function(t2) {
3696
- var e2 = this, n2 = this.$locale();
3697
- if (!this.isValid())
3698
- return n2.invalidDate || $;
3699
- var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h3 = function(t3, n3, i3, s3) {
3700
- return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
3701
- }, c2 = function(t3) {
3702
- return O.s(s2 % 12 || 12, t3, "0");
3703
- }, d2 = n2.meridiem || function(t3, e3, n3) {
3704
- var r3 = t3 < 12 ? "AM" : "PM";
3705
- return n3 ? r3.toLowerCase() : r3;
3706
- }, l2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h3(n2.monthsShort, a2, f2, 3), MMMM: h3(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h3(n2.weekdaysMin, this.$W, o2, 2), ddd: h3(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 };
3707
- return r2.replace(y, function(t3, e3) {
3708
- return e3 || l2[t3] || i2.replace(":", "");
3709
- });
3710
- }, m2.utcOffset = function() {
3711
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
3712
- }, m2.diff = function(r2, d2, $2) {
3713
- var l2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, g2 = this - M3, v2 = O.m(this, M3);
3714
- return v2 = (l2 = {}, l2[c] = v2 / 12, l2[f] = v2, l2[h2] = v2 / 3, l2[o] = (g2 - m3) / 6048e5, l2[a] = (g2 - m3) / 864e5, l2[u] = g2 / n, l2[s] = g2 / e, l2[i] = g2 / t, l2)[y2] || g2, $2 ? v2 : O.a(v2);
3715
- }, m2.daysInMonth = function() {
3716
- return this.endOf(f).$D;
3717
- }, m2.$locale = function() {
3718
- return D[this.$L];
3719
- }, m2.locale = function(t2, e2) {
3720
- if (!t2)
3721
- return this.$L;
3722
- var n2 = this.clone(), r2 = S(t2, e2, true);
3723
- return r2 && (n2.$L = r2), n2;
3724
- }, m2.clone = function() {
3725
- return O.w(this.$d, this);
3726
- }, m2.toDate = function() {
3727
- return new Date(this.valueOf());
3728
- }, m2.toJSON = function() {
3729
- return this.isValid() ? this.toISOString() : null;
3730
- }, m2.toISOString = function() {
3731
- return this.$d.toISOString();
3732
- }, m2.toString = function() {
3733
- return this.$d.toUTCString();
3734
- }, M2;
3735
- }(), T = _.prototype;
3736
- return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) {
3737
- T[t2[1]] = function(e2) {
3738
- return this.$g(e2, t2[0], t2[1]);
3739
- };
3740
- }), w.extend = function(t2, e2) {
3741
- return t2.$i || (t2(e2, _, w), t2.$i = true), w;
3742
- }, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
3743
- return w(1e3 * t2);
3744
- }, w.en = D[v], w.Ls = D, w.p = {}, w;
3745
- });
3746
- })(dayjs_min);
3747
- var dayjs = dayjs_min.exports;
3748
3531
  function useFormValues({
3749
3532
  defaultValue,
3750
3533
  getSchema,
@@ -3777,7 +3560,7 @@ function useFormValues({
3777
3560
  const obj = {};
3778
3561
  schema.forEach((item) => {
3779
3562
  const { props = {}, name, component } = item;
3780
- let { defaultValue: defaultValue2, mode, format, treeCheckable } = isFunction(props) ? props() : props;
3563
+ let { defaultValue: defaultValue2, mode, format, treeCheckable } = isFunction(props) ? props({ formModel }) : props;
3781
3564
  const names = isString(name) ? [name] : name;
3782
3565
  if (defaultValue2 !== null && defaultValue2 !== void 0) {
3783
3566
  if (datePickerType.includes(component)) {
@@ -3829,6 +3612,7 @@ function useFormValues({
3829
3612
  initDefault
3830
3613
  };
3831
3614
  }
3615
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
3832
3616
  var weekday$1 = { exports: {} };
3833
3617
  (function(module, exports) {
3834
3618
  !function(e, t) {
@@ -5223,7 +5007,11 @@ var _sfc_main$J = defineComponent({
5223
5007
  }
5224
5008
  if (isFunction(render2)) {
5225
5009
  let afterRenderData = render2(record, index, text);
5226
- renderText.value = isVnode(afterRenderData) ? createVNode(Fragment, null, [afterRenderData]) : afterRenderData;
5010
+ if (afterRenderData.__v_isRef) {
5011
+ renderText = afterRenderData;
5012
+ } else {
5013
+ renderText.value = isVnode(afterRenderData) ? createVNode(Fragment, null, [afterRenderData]) : afterRenderData;
5014
+ }
5227
5015
  }
5228
5016
  }
5229
5017
  renderCell();
@@ -6984,6 +6772,8 @@ function useSource(opt) {
6984
6772
  search();
6985
6773
  }
6986
6774
  function search() {
6775
+ if (!queryPage)
6776
+ return;
6987
6777
  const { fetch } = useFetch(queryPage, baseUrl);
6988
6778
  loading.onQuerypage.value = true;
6989
6779
  fetch(toRaw(baseData)).then((rsp) => {
@@ -7006,6 +6796,8 @@ function useSource(opt) {
7006
6796
  });
7007
6797
  }
7008
6798
  function onAdd(model) {
6799
+ if (!add)
6800
+ return;
7009
6801
  const { fetch } = useFetch(add, baseUrl);
7010
6802
  return fetch(model, false).then((rsp) => {
7011
6803
  if ((rsp == null ? void 0 : rsp.code) === 0)
@@ -7014,10 +6806,14 @@ function useSource(opt) {
7014
6806
  });
7015
6807
  }
7016
6808
  async function onQueryById(id) {
6809
+ if (!queryById)
6810
+ return;
7017
6811
  const { fetch } = useFetch(queryById, baseUrl);
7018
6812
  return await fetch({ id });
7019
6813
  }
7020
6814
  function onUpdate(model) {
6815
+ if (!update)
6816
+ return;
7021
6817
  const { fetch } = useFetch(update, baseUrl);
7022
6818
  return fetch(model, false).then((rsp) => {
7023
6819
  if ((rsp == null ? void 0 : rsp.code) === 0)
@@ -7026,6 +6822,8 @@ function useSource(opt) {
7026
6822
  });
7027
6823
  }
7028
6824
  function onDeletes(ids) {
6825
+ if (!deletes)
6826
+ return;
7029
6827
  const { fetch } = useFetch(deletes, baseUrl);
7030
6828
  fetch(toRaw(ids), false).then((rsp) => {
7031
6829
  if ((rsp == null ? void 0 : rsp.code) === 0)
@@ -7126,7 +6924,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
7126
6924
  ]),
7127
6925
  destroyOnClose: true
7128
6926
  });
7129
- const [registerForm, { getFormValues, setFormValues }] = useForm({
6927
+ const [registerForm, { getFormValues, setFormValues, validate }] = useForm({
7130
6928
  ...props.formProps || {},
7131
6929
  schemas: props.schemas,
7132
6930
  mode: "dialog"
@@ -7140,8 +6938,11 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
7140
6938
  var _a;
7141
6939
  if (props.curd && isFunction((_a = props.curd) == null ? void 0 : _a.onAdd)) {
7142
6940
  let obj = Object.assign({}, props.formsVal.value || {}, getFormValues());
7143
- let pro = obj.id ? props.curd.onUpdate(obj) : props.curd.onAdd(obj);
7144
- pro == null ? void 0 : pro.then((rsp) => closeModal());
6941
+ validate().then(() => {
6942
+ let pro = obj.id ? props.curd.onUpdate(obj) : props.curd.onAdd(obj);
6943
+ pro == null ? void 0 : pro.then((rsp) => closeModal());
6944
+ }).catch((err) => {
6945
+ });
7145
6946
  }
7146
6947
  }
7147
6948
  return (_ctx, _cache) => {
@@ -8799,7 +8600,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
8799
8600
  },
8800
8601
  setup(__props) {
8801
8602
  const props = __props;
8802
- const title = "\u9686\u57FA\u7A0E\u52A1\u540E\u53F0\u7BA1\u7406\u7CFB\u7EDF";
8603
+ const title = "\u9686\u57FA\u96C6\u56E2\u6D77\u5916\u7A0E\u52A1\u7CFB\u7EDF";
8803
8604
  const { getCollapsedShowTitle } = useMenu();
8804
8605
  const getLogoClass = computed(() => {
8805
8606
  return [
@@ -10818,7 +10619,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
10818
10619
  var zhCn = { exports: {} };
10819
10620
  (function(module, exports) {
10820
10621
  !function(e, _) {
10821
- module.exports = _(dayjs_min.exports);
10622
+ module.exports = _(dayjs);
10822
10623
  }(commonjsGlobal, function(e) {
10823
10624
  function _(e2) {
10824
10625
  return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
@@ -10832,10 +10633,7 @@ var zhCn = { exports: {} };
10832
10633
  return t.default.locale(d, null, true), d;
10833
10634
  });
10834
10635
  })(zhCn);
10835
- const _hoisted_1 = {
10836
- key: 0,
10837
- class: "dt-theme"
10838
- };
10636
+ const _hoisted_1 = { class: "dt-theme" };
10839
10637
  const _sfc_main = /* @__PURE__ */ defineComponent({
10840
10638
  __name: "theme",
10841
10639
  setup(__props) {
@@ -10868,59 +10666,55 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10868
10666
  };
10869
10667
  });
10870
10668
  return (_ctx, _cache) => {
10871
- var _a;
10872
10669
  const _component_router_view = resolveComponent("router-view");
10873
- return unref(currentRoute).fullPath && ((_a = unref(getAppConf)) == null ? void 0 : _a.router.unRequireAuthPage.length) ? (openBlock(), createElementBlock("div", _hoisted_1, [
10670
+ return openBlock(), createElementBlock("div", _hoisted_1, [
10874
10671
  createVNode(unref(ConfigProvider), { locale: unref(zhCN) }, {
10875
- default: withCtx(() => {
10876
- var _a2;
10877
- return [
10878
- ((_a2 = unref(getAppConf)) == null ? void 0 : _a2.router.unRequireAuthPage.includes(unref(currentRoute).fullPath)) ? (openBlock(), createBlock(_component_router_view, { key: 0 })) : (openBlock(), createBlock(unref(Layout), {
10879
- key: 1,
10880
- class: "dt-theme"
10881
- }, {
10882
- default: withCtx(() => [
10883
- createVNode(_sfc_main$t),
10884
- unref(getShowFullHeaderRef) ? (openBlock(), createBlock(_sfc_main$a, {
10885
- key: 0,
10886
- fixed: ""
10887
- })) : createCommentVNode("", true),
10888
- createVNode(unref(Layout), {
10889
- class: normalizeClass(unref(layoutClass)),
10890
- style: normalizeStyle(unref(layoutOption))
10891
- }, {
10892
- default: withCtx(() => [
10893
- unref(getShowSidebar) ? (openBlock(), createBlock(_sfc_main$7, { key: 0 })) : createCommentVNode("", true),
10894
- createVNode(unref(_sfc_main$U), {
10895
- ref_key: "wrapperRef",
10896
- ref: wrapperRef,
10897
- class: normalizeClass({ "fixedWrap": unref(getFixed) })
10898
- }, {
10899
- default: withCtx(() => [
10900
- createVNode(unref(Layout), { class: "dt-theme-main" }, {
10901
- default: withCtx(() => [
10902
- createVNode(_sfc_main$3),
10903
- createVNode(_sfc_main$1, {
10904
- style: normalizeStyle(unref(getContentStyle))
10905
- }, null, 8, ["style"]),
10906
- unref(getFooter) && unref(getFooter)["show"] ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true)
10907
- ]),
10908
- _: 1
10909
- })
10910
- ]),
10911
- _: 1
10912
- }, 8, ["class"])
10913
- ]),
10914
- _: 1
10915
- }, 8, ["class", "style"])
10916
- ]),
10917
- _: 1
10918
- }))
10919
- ];
10920
- }),
10672
+ default: withCtx(() => [
10673
+ unref(currentRoute).name && !unref(getAppConf).router.unRequireAuthPage.includes(unref(currentRoute).fullPath) ? (openBlock(), createBlock(unref(Layout), {
10674
+ key: 0,
10675
+ class: "dt-theme"
10676
+ }, {
10677
+ default: withCtx(() => [
10678
+ createVNode(_sfc_main$t),
10679
+ unref(getShowFullHeaderRef) ? (openBlock(), createBlock(_sfc_main$a, {
10680
+ key: 0,
10681
+ fixed: ""
10682
+ })) : createCommentVNode("", true),
10683
+ createVNode(unref(Layout), {
10684
+ class: normalizeClass(unref(layoutClass)),
10685
+ style: normalizeStyle(unref(layoutOption))
10686
+ }, {
10687
+ default: withCtx(() => [
10688
+ unref(getShowSidebar) ? (openBlock(), createBlock(_sfc_main$7, { key: 0 })) : createCommentVNode("", true),
10689
+ createVNode(unref(_sfc_main$U), {
10690
+ ref_key: "wrapperRef",
10691
+ ref: wrapperRef,
10692
+ class: normalizeClass({ "fixedWrap": unref(getFixed) })
10693
+ }, {
10694
+ default: withCtx(() => [
10695
+ createVNode(unref(Layout), { class: "dt-theme-main" }, {
10696
+ default: withCtx(() => [
10697
+ createVNode(_sfc_main$3),
10698
+ createVNode(_sfc_main$1, {
10699
+ style: normalizeStyle(unref(getContentStyle))
10700
+ }, null, 8, ["style"]),
10701
+ unref(getFooter) && unref(getFooter)["show"] ? (openBlock(), createBlock(_sfc_main$2, { key: 0 })) : createCommentVNode("", true)
10702
+ ]),
10703
+ _: 1
10704
+ })
10705
+ ]),
10706
+ _: 1
10707
+ }, 8, ["class"])
10708
+ ]),
10709
+ _: 1
10710
+ }, 8, ["class", "style"])
10711
+ ]),
10712
+ _: 1
10713
+ })) : (openBlock(), createBlock(_component_router_view, { key: 1 }))
10714
+ ]),
10921
10715
  _: 1
10922
10716
  }, 8, ["locale"])
10923
- ])) : createCommentVNode("", true);
10717
+ ]);
10924
10718
  };
10925
10719
  }
10926
10720
  });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/index.html ADDED
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>dt-ui</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/index.ts"></script>
12
+ </body>
13
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "1.0.17",
3
+ "version": "1.0.21",
4
4
  "keywords": [
5
5
  "ui",
6
6
  "dt-ui"
@@ -28,14 +28,11 @@
28
28
  "vue-router": "^4.0.12",
29
29
  "xlsx": "^0.18.5"
30
30
  },
31
- "peerDependencies": {
32
- "@dt-frames/core": "1.0.0",
33
- "@dt-frames/plugins": "1.0.0"
34
- },
35
31
  "devDependencies": {
36
32
  "@iconify/json": "^1.1.460",
37
33
  "@vitejs/plugin-vue": "^2.2.0",
38
34
  "vite": "^2.8.0",
35
+ "vite-plugin-build": "^0.6.0",
39
36
  "vite-plugin-purge-icons": "^0.7.0",
40
37
  "vite-plugin-theme": "^0.8.6"
41
38
  }
@@ -1,10 +0,0 @@
1
- @import './reset.less';
2
-
3
- @import '../../theme/theme.less';
4
-
5
- @import '../../components/container/index.less';
6
- @import '../../components/modal/src/index.less';
7
- @import '../../components/forms/src/index.less';
8
- @import '../../components/table/src/index.less';
9
- @import '../../components/icons/src/index.less';
10
- @import '../../components/iframe/src/index.less';
@@ -1,17 +0,0 @@
1
- // 这里是需要覆盖的css样式
2
- .ant-btn{
3
- display: flex;
4
- padding: 0 10px;
5
- align-items: center;
6
- justify-content: center;
7
- svg{
8
- display: block;
9
- }
10
- .dt-icon{
11
- margin: 0 5px;
12
- }
13
- }
14
-
15
- .ant-picker{
16
- width: 100%;
17
- }