@dt-frames/ui 1.0.38 → 1.0.40

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.
@@ -6,7 +6,7 @@ export declare function useCurd(curdOpt: CrudOptType): {
6
6
  }>;
7
7
  add: () => void;
8
8
  del: ({ row }: Recordable) => void;
9
- dels: (ids?: string[]) => void;
9
+ dels: (ids: string[], cb: Function) => void;
10
10
  update: ({ row }: Recordable) => void;
11
11
  closeModal: () => void;
12
12
  openModal: (data?: {
@@ -76,6 +76,7 @@
76
76
  padding: 4px;
77
77
  transform: all 0.2s;
78
78
  border: 1px solid #fff;
79
+ color: rgba(0,0,0,.45);
79
80
  &:hover, &.active-icon{
80
81
  border: 1px solid @primary-color;
81
82
  border-radius: 4px;
@@ -106,5 +106,6 @@ export declare type TableActionType = {
106
106
  getSelectRowKeys: () => string[];
107
107
  updateTableDataRecord: (rowKey: string | number, record: Recordable) => Recordable | undefined;
108
108
  findTableDataRecord: (rowKey: string | number) => void;
109
+ clearSelectedRowKeys: () => void;
109
110
  emit?: any;
110
111
  };
package/es/index.js CHANGED
@@ -8,6 +8,7 @@ import Sortablejs from "sortablejs";
8
8
  import * as xlsx from "xlsx";
9
9
  import { useRouter } from "vue-router";
10
10
  import zhCN from "ant-design-vue/es/locale/zh_CN";
11
+ import en from "ant-design-vue/es/locale/en_US";
11
12
  var _export_sfc = (sfc, props) => {
12
13
  const target = sfc.__vccOpts || sfc;
13
14
  for (const [key, val] of props) {
@@ -4856,6 +4857,9 @@ function useTable(tableProps) {
4856
4857
  return table;
4857
4858
  }
4858
4859
  const methods = {
4860
+ clearSelectedRowKeys: () => {
4861
+ getTableInstance2().clearSelectedRowKeys();
4862
+ },
4859
4863
  setProps: (props) => {
4860
4864
  getTableInstance2().setProps(props);
4861
4865
  },
@@ -6711,6 +6715,7 @@ const _sfc_main$A = defineComponent({
6711
6715
  getSelectRowKeys,
6712
6716
  updateTableDataRecord,
6713
6717
  findTableDataRecord,
6718
+ clearSelectedRowKeys,
6714
6719
  emit,
6715
6720
  getSize: () => {
6716
6721
  return unref(getBind).size;
@@ -6870,15 +6875,23 @@ function useDownload(exportUrl, exportName) {
6870
6875
  const rowData = columns.map((column) => {
6871
6876
  let value = it[column.dataIndex.toString()];
6872
6877
  if (column.render && isObject(column.render) && value !== void 0) {
6873
- const { dict, date, number, percent } = column.render;
6874
- if (date) {
6878
+ const { dict, date, number, percent, struc } = column.render;
6879
+ if (struc) {
6880
+ const { appConf } = useAppStore();
6881
+ let apiStruc = appConf.structure[struc];
6882
+ if (!apiStruc) {
6883
+ error(`${struc}\u672A\u5728structure\u4E2D\u914D\u7F6E`);
6884
+ } else {
6885
+ return getDictValueByCode(value, apiStruc);
6886
+ }
6887
+ } else if (date) {
6875
6888
  return dayjs(value).format(date);
6876
6889
  } else if (dict) {
6877
6890
  return unref(getDictValueByCode(value, dict));
6878
6891
  } else if (percent) {
6879
- return (value * 100).toFixed(2) + "%";
6892
+ return formatNumber((value || 0) * 100, percent) + "%";
6880
6893
  } else if (number) {
6881
- return (value * 100).toFixed(number || 2);
6894
+ return formatNumber(value, number);
6882
6895
  }
6883
6896
  }
6884
6897
  return value;
@@ -7239,7 +7252,7 @@ function useCurd(curdOpt) {
7239
7252
  });
7240
7253
  openModal();
7241
7254
  }
7242
- function dels(ids = []) {
7255
+ function dels(ids = [], cb) {
7243
7256
  if (!ids.length) {
7244
7257
  message.error(t("EMPTY"));
7245
7258
  return;
@@ -7254,6 +7267,7 @@ function useCurd(curdOpt) {
7254
7267
  iconType: "warning",
7255
7268
  onOk() {
7256
7269
  curd.onDeletes(ids);
7270
+ cb();
7257
7271
  }
7258
7272
  });
7259
7273
  } else {
@@ -10265,13 +10279,28 @@ var zhCn = { exports: {} };
10265
10279
  return t.default.locale(d, null, true), d;
10266
10280
  });
10267
10281
  })(zhCn);
10282
+ var esUs = { exports: {} };
10283
+ (function(module, exports) {
10284
+ !function(e, s) {
10285
+ module.exports = s(dayjs);
10286
+ }(commonjsGlobal, function(e) {
10287
+ function s(e2) {
10288
+ return e2 && "object" == typeof e2 && "default" in e2 ? e2 : { default: e2 };
10289
+ }
10290
+ var o = s(e), d = { name: "es-us", weekdays: "domingo_lunes_martes_mi\xE9rcoles_jueves_viernes_s\xE1bado".split("_"), weekdaysShort: "dom._lun._mar._mi\xE9._jue._vie._s\xE1b.".split("_"), weekdaysMin: "do_lu_ma_mi_ju_vi_s\xE1".split("_"), months: "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), monthsShort: "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"), relativeTime: { future: "en %s", past: "hace %s", s: "unos segundos", m: "un minuto", mm: "%d minutos", h: "una hora", hh: "%d horas", d: "un d\xEDa", dd: "%d d\xEDas", M: "un mes", MM: "%d meses", y: "un a\xF1o", yy: "%d a\xF1os" }, ordinal: function(e2) {
10291
+ return e2 + "\xBA";
10292
+ }, formats: { LT: "h:mm A", LTS: "h:mm:ss A", L: "MM/DD/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY h:mm A", LLLL: "dddd, D [de] MMMM [de] YYYY h:mm A" } };
10293
+ return o.default.locale(d, null, true), d;
10294
+ });
10295
+ })(esUs);
10268
10296
  const _hoisted_1 = { class: "dt-theme" };
10269
10297
  const _sfc_main = /* @__PURE__ */ defineComponent({
10270
10298
  __name: "theme",
10271
10299
  setup(__props) {
10272
- dayjs.locale("zh-cn");
10300
+ const { getIsZH } = useHeader();
10273
10301
  const wrapperRef = ref(null);
10274
10302
  const { getUiSize } = useApp();
10303
+ dayjs.locale(unref(getIsZH) ? "zh-cn" : "en");
10275
10304
  const { currentRoute } = useRouter();
10276
10305
  const { getShowFullHeaderRef, getFixed, getHeaderHeight } = useHeader();
10277
10306
  const { getSplit, getShowMenu, getShowSidebar } = useMenu();
@@ -10302,7 +10331,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10302
10331
  const _component_router_view = resolveComponent("router-view");
10303
10332
  return openBlock(), createElementBlock("div", _hoisted_1, [
10304
10333
  createVNode(unref(ConfigProvider), {
10305
- locale: unref(zhCN),
10334
+ locale: unref(getIsZH) ? unref(zhCN) : unref(en),
10306
10335
  "component-size": unref(getUiSize)
10307
10336
  }, {
10308
10337
  default: withCtx(() => [
@@ -303,6 +303,7 @@
303
303
 
304
304
  .user-info__popover{
305
305
  width: 120px;
306
+ z-index: 930 !important;
306
307
  .ant-popover-inner-content{
307
308
  padding: 8px 0;
308
309
  .user-operate{
@@ -385,6 +386,8 @@
385
386
  line-height: 28px;
386
387
  outline: none;
387
388
  box-shadow: none;
389
+ padding: 0 7px 0 15px;
390
+ font-size: 13px;
388
391
  }
389
392
  }
390
393
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "keywords": [
5
5
  "ui",
6
6
  "dt-ui"