@dt-frames/ui 2.0.17 → 2.0.19

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.
Files changed (35) hide show
  1. package/es/components/drawer/index.d.ts +3 -4
  2. package/es/components/drawer/index.js +11 -15
  3. package/es/components/drawer/index.less +6 -0
  4. package/es/components/drawer/src/index.d.ts +5 -7
  5. package/es/components/drawer/src/types/index.type.d.ts +3 -1
  6. package/es/components/form/index.js +62 -65
  7. package/es/components/form/src/components/FormButtons.d.ts +3056 -4
  8. package/es/components/form/src/components/FormItem.d.ts +3 -4
  9. package/es/components/form/src/components/formIcon.d.ts +0 -1209
  10. package/es/components/form/src/components/formInputUseDialog.d.ts +0 -894
  11. package/es/components/form/src/props.d.ts +8 -8
  12. package/es/components/form/src/types/form.type.d.ts +1 -0
  13. package/es/components/form/src/types/items.type.d.ts +8 -0
  14. package/es/components/modal/index.js +19 -7
  15. package/es/components/modal/index.less +1 -9
  16. package/es/components/source/index.js +20 -10
  17. package/es/components/table/index.js +262 -150
  18. package/es/components/table/index.less +5 -1
  19. package/es/components/table/src/types/table.type.d.ts +1 -0
  20. package/es/components/tree/index.js +59 -57
  21. package/es/components/tree/index.less +6 -0
  22. package/es/components/tree/src/type/tree.d.ts +0 -4
  23. package/es/components/tree/src/utils/tree.d.ts +3 -1
  24. package/es/components/upload/index.js +103 -41
  25. package/es/components/upload/src/basicProps.d.ts +5 -1
  26. package/es/components/upload/src/hooks/useFile.d.ts +7 -6
  27. package/es/components/upload/src/index.d.ts +16 -0
  28. package/es/components/upload/src/type/file.d.ts +9 -2
  29. package/es/components/upload/src/utils/fileSize.d.ts +1 -0
  30. package/es/theme/index.js +149 -97
  31. package/es/theme/index.less +14 -0
  32. package/es/theme/src/components/sider/index.d.ts +1 -1
  33. package/es/theme/src/components/sider/mix-sider.d.ts +1 -1
  34. package/es/theme/src/index.d.ts +1 -1
  35. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { Recordable } from "@dt-frames/core";
2
- import { PropType, Ref } from "vue";
3
- import { ButtonProps, ColEx, FormSchema } from "./types/form.type";
4
- import { FormActionType } from "./types/actions.type";
1
+ import { Recordable } from '@dt-frames/core';
2
+ import { PropType, Ref } from 'vue';
3
+ import { ButtonProps, ColEx, FormSchema } from './types/form.type';
4
+ import { FormActionType } from './types/actions.type';
5
5
  export declare const BasicProps: {
6
6
  mode: {
7
7
  type: PropType<"search" | "dialog">;
@@ -16,7 +16,7 @@ export declare const BasicProps: {
16
16
  default: () => {};
17
17
  };
18
18
  layout: {
19
- type: PropType<"vertical" | "inline" | "horizontal">;
19
+ type: PropType<"inline" | "horizontal" | "vertical">;
20
20
  default: string;
21
21
  };
22
22
  labelWidth: {
@@ -41,8 +41,8 @@ export declare const BasicProps: {
41
41
  };
42
42
  rowProps: {
43
43
  type: PropType<Partial<import("vue").ExtractPropTypes<{
44
- align: PropType<"middle" | "top" | "bottom" | "stretch">;
45
- justify: PropType<"center" | "space-around" | "space-between" | "end" | "start">;
44
+ align: PropType<"stretch" | "bottom" | "top" | "middle">;
45
+ justify: PropType<"space-around" | "space-between" | "center" | "end" | "start">;
46
46
  prefixCls: StringConstructor;
47
47
  gutter: {
48
48
  type: PropType<import("ant-design-vue/lib/grid/Row").Gutter | [import("ant-design-vue/lib/grid/Row").Gutter, import("ant-design-vue/lib/grid/Row").Gutter]>;
@@ -62,7 +62,7 @@ export declare const BasicProps: {
62
62
  type: NumberConstructor;
63
63
  };
64
64
  size: {
65
- type: PropType<"small" | "large" | "middle">;
65
+ type: PropType<"large" | "small" | "middle">;
66
66
  };
67
67
  disabled: {
68
68
  type: BooleanConstructor;
@@ -56,6 +56,7 @@ declare type Schema<ComponentType, T> = {
56
56
  wrapperCol?: Partial<ColEx>;
57
57
  isAdvanced?: boolean;
58
58
  extraName?: string[];
59
+ description: String;
59
60
  };
60
61
  export declare type FormSchema = Schema<'Input', Input> | Schema<'InputWithDialog', InputWithDialog> | Schema<'InputGroup', InputGroup> | Schema<'InputPassword', InputPassword> | Schema<'InputSearch', InputSearch> | Schema<'InputTextArea', InputTextArea> | Schema<'InputNumber', InputNumber> | Schema<'Select', Select> | Schema<'TreeSelect', TreeSelect> | Schema<'Radio', Radio> | Schema<'RadioButtonGroup', Radio> | Schema<'RadioGroup', RadioGroup> | Schema<'Checkbox', Checkbox> | Schema<'CheckboxGroup', CheckboxGroup> | Schema<'AutoComplete', Recordable> | Schema<'Cascader', Cascader> | Schema<'DatePicker', DatePicker> | Schema<'MonthPicker', DatePicker> | Schema<'RangePicker', RangePicker> | Schema<'WeekPicker', DatePicker> | Schema<'TimePicker', TimePicker> | Schema<'Switch', Switch> | Schema<'Slider', {
61
62
  disabled?: boolean;
@@ -383,12 +383,20 @@ export declare type Divider = {
383
383
  export declare type InputWithDialog = Input & {
384
384
  openDialog?: (model: Recordable) => void;
385
385
  };
386
+ export declare type FieldNames = {
387
+ fileId?: string;
388
+ fileName?: string;
389
+ filePath?: string;
390
+ fileSize?: string;
391
+ fileType?: string;
392
+ };
386
393
  export declare type Upload = {
387
394
  uploadUrl?: string;
388
395
  downloadUrl?: string;
389
396
  buttonText?: string;
390
397
  preIcon?: string;
391
398
  data?: object | ((file: UploadFile) => object);
399
+ fieldNames?: FieldNames;
392
400
  filename?: string;
393
401
  accept?: string[];
394
402
  customRequest?: (params: UploadRequestOption) => void;
@@ -3,7 +3,7 @@ import { reactive, ref, getCurrentInstance, watchEffect, unref, nextTick, onUnmo
3
3
  import { Tooltip, Spin } from "ant-design-vue/es";
4
4
  import "ant-design-vue/es/spin/style";
5
5
  import { omit } from "lodash-es";
6
- import { Modal } from "ant-design-vue";
6
+ import { Modal as Modal$1 } from "ant-design-vue";
7
7
  import "ant-design-vue/es/modal/style";
8
8
  import "ant-design-vue/es/tooltip/style";
9
9
  import { DtFormButtons } from "../form";
@@ -318,16 +318,25 @@ const _sfc_main$3 = {
318
318
  ...props,
319
319
  destroyOnClose: true,
320
320
  onCancel,
321
+ centered: true,
321
322
  getContainer: getPopupContainer()
322
323
  };
323
324
  if (!propsData?.visible)
324
325
  return null;
325
- return createVNode(Modal, propsData, _isSlot(_slot = extendSlots(slots)) ? _slot : {
326
+ return createVNode(Modal$1, propsData, _isSlot(_slot = extendSlots(slots)) ? _slot : {
326
327
  default: () => [_slot]
327
328
  });
328
329
  };
329
330
  }
330
331
  };
332
+ const _export_sfc = (sfc, props) => {
333
+ const target = sfc.__vccOpts || sfc;
334
+ for (const [key, val] of props) {
335
+ target[key] = val;
336
+ }
337
+ return target;
338
+ };
339
+ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/components/Modal.vue"]]);
331
340
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
332
341
  __name: "CloseIcon",
333
342
  props: {
@@ -386,7 +395,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
386
395
  ]),
387
396
  _: 1
388
397
  }, 8, ["title"]))
389
- ], 64)) : createCommentVNode("", true),
398
+ ], 64)) : createCommentVNode("v-if", true),
390
399
  createElementVNode("i", {
391
400
  class: "i mdi:close h-14 w-10 pr-4",
392
401
  onClick: handleCancel
@@ -395,6 +404,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
395
404
  };
396
405
  }
397
406
  });
407
+ const CloseIcon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/components/CloseIcon.vue"]]);
398
408
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
399
409
  __name: "ModalFooter",
400
410
  props: {
@@ -448,6 +458,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
448
458
  };
449
459
  }
450
460
  });
461
+ const ModalFooter = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/components/ModalFooter.vue"]]);
451
462
  function useFullScreen(wrapClassName) {
452
463
  const fullScreenRef = ref(false);
453
464
  const getWrapClassName = computed(() => {
@@ -556,7 +567,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
556
567
  });
557
568
  return (_ctx, _cache) => {
558
569
  const _component_ASpin = Spin;
559
- return openBlock(), createBlock(_sfc_main$3, mergeProps(unref(getBindValue), { onCancel: handleCancel }), createSlots({
570
+ return openBlock(), createBlock(Modal, mergeProps(unref(getBindValue), { onCancel: handleCancel }), createSlots({
560
571
  default: withCtx(() => [
561
572
  createVNode(_component_ASpin, {
562
573
  spinning: unref(getBindValue).loading,
@@ -573,7 +584,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
573
584
  !_ctx.$slots.closeIcon ? {
574
585
  name: "closeIcon",
575
586
  fn: withCtx(() => [
576
- createVNode(_sfc_main$2, {
587
+ createVNode(CloseIcon, {
577
588
  canFullscreen: unref(getBindValue).canFullscreen,
578
589
  fullScreen: unref(fullScreenRef),
579
590
  onCancel: handleCancel,
@@ -592,7 +603,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
592
603
  !_ctx.$slots.footer ? {
593
604
  name: "footer",
594
605
  fn: withCtx(() => [
595
- createVNode(_sfc_main$1, {
606
+ createVNode(ModalFooter, {
596
607
  authPrefix: unref(getBindValue).authPrefix,
597
608
  buttons: propsRef.value?.footer,
598
609
  showSave: unref(getBindValue).showOkBtn,
@@ -626,8 +637,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
626
637
  };
627
638
  }
628
639
  });
640
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/index.vue"]]);
629
641
  export {
630
- _sfc_main as DtModal,
642
+ index as DtModal,
631
643
  basicProps,
632
644
  useModal,
633
645
  useModalOut
@@ -28,6 +28,7 @@
28
28
 
29
29
 
30
30
  .dt-modal{
31
+ overflow: hidden;
31
32
  .ant-modal {
32
33
  padding: 0;
33
34
  }
@@ -38,15 +39,6 @@
38
39
 
39
40
  &:not(.fullscreen-modal) {
40
41
  .ant-modal {
41
- padding: 0;
42
- position: absolute;
43
- left: 0;
44
- top: 0;
45
- right: 0;
46
- bottom: 0;
47
- margin: 0 auto;
48
- display: flex;
49
- align-items: center;
50
42
  .ant-modal-body{
51
43
  max-height: calc(100vh - 160px );
52
44
  min-height: 200px;
@@ -135,6 +135,8 @@ function useSource(props) {
135
135
  const { t } = useI18n("UI");
136
136
  const { confirm, message } = useMessage();
137
137
  const { appConf } = useAppStore();
138
+ let okCode = appConf?.http?.okCode;
139
+ let _okCode = isArray(okCode) ? okCode : [okCode];
138
140
  const { baseUrl, api: orgApi, exportName, queryAfterUpdate, beforeUpdate, afterUpdate, authPrefix } = props;
139
141
  const pagination = ref({
140
142
  current: appConf?.ui?.table?.defaultPageNo || 1,
@@ -190,13 +192,21 @@ function useSource(props) {
190
192
  dataSource.value.splice(0, dataSource.value.length, ...result);
191
193
  return;
192
194
  }
193
- const { records, total, size, current } = result;
195
+ const { records, total, size, current, pageDTO } = result;
194
196
  dataSource.value.splice(0, dataSource.value.length, ...records);
195
- pagination.value = {
196
- current,
197
- pageSize: size || appConf?.ui?.table?.defaultPageSize,
198
- total
199
- };
197
+ if (pageDTO) {
198
+ pagination.value = {
199
+ current: pageDTO.pageNo + 1,
200
+ pageSize: pageDTO.pageSize || appConf?.ui?.table?.defaultPageSize,
201
+ total: pageDTO.totalCount
202
+ };
203
+ } else {
204
+ pagination.value = {
205
+ current,
206
+ pageSize: size || appConf?.ui?.table?.defaultPageSize,
207
+ total
208
+ };
209
+ }
200
210
  } catch (err) {
201
211
  console.error(`\u5206\u9875\u67E5\u8BE2\u9519\u8BEF\uFF1A${err}`);
202
212
  } finally {
@@ -270,7 +280,7 @@ function useSource(props) {
270
280
  loading.onAdd.value = true;
271
281
  try {
272
282
  const result = await fetch(api.add, { ...model }, false);
273
- if (result?.code === appConf?.http?.okCode) {
283
+ if (_okCode.includes(result?.code)) {
274
284
  message.success(t("ADD_SUCCESS"));
275
285
  curdInstance && curdInstance.closeModal();
276
286
  if (queryAfterUpdate !== false)
@@ -286,7 +296,7 @@ function useSource(props) {
286
296
  loading.onUpdate.value = true;
287
297
  try {
288
298
  const result = await fetch(api.update, { ...model }, false);
289
- if (result?.code === appConf?.http?.okCode) {
299
+ if (_okCode.includes(result?.code)) {
290
300
  message.success(t("UPDATE_SUCCESS"));
291
301
  curdInstance && curdInstance.closeModal();
292
302
  if (queryAfterUpdate !== false)
@@ -300,7 +310,7 @@ function useSource(props) {
300
310
  }
301
311
  }
302
312
  } catch (err) {
303
- console.log("Err:" + err);
313
+ console.log("Err:", err);
304
314
  } finally {
305
315
  }
306
316
  }
@@ -324,7 +334,7 @@ function useSource(props) {
324
334
  iconType: "warning",
325
335
  onOk() {
326
336
  fetch(api.deletes, toRaw(_ids), false).then((rsp) => {
327
- if (rsp?.code === appConf?.http?.okCode) {
337
+ if (_okCode.includes(rsp?.code)) {
328
338
  message.success((isSingleDelete ? "" : t("MULTIFY")) + t("DELETE_SUCCESS"));
329
339
  !isSingleDelete && tableInstance.clearSelectedRowKeys();
330
340
  if (queryAfterUpdate !== false)