@dt-frames/ui 1.0.3 → 1.0.6

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 (107) hide show
  1. package/es/assets/imgs/header/avatar.png +0 -0
  2. package/es/components/curd/src/components/dialog.d.ts +21 -58
  3. package/es/components/curd/src/types/curd.type.d.ts +2 -1
  4. package/es/components/dialog/index.d.ts +2 -0
  5. package/es/components/dialog/src/hooks/useDialog.d.ts +3 -0
  6. package/es/components/forms/index.d.ts +2 -2
  7. package/es/components/forms/src/components/formIcon.d.ts +4 -47
  8. package/es/components/forms/src/index.d.ts +2 -6
  9. package/es/components/iframe/index.d.ts +2 -2
  10. package/es/components/index.d.ts +3 -2
  11. package/es/components/modal/src/components/close-icon.d.ts +0 -43
  12. package/es/components/modal/src/index.d.ts +0 -43
  13. package/es/components/source/src/types/table.type.d.ts +1 -1
  14. package/es/components/table/index.d.ts +1 -1
  15. package/es/components/table/src/components/setting/Column.d.ts +6 -5
  16. package/es/components/table/src/hooks/useColumns.d.ts +1 -1
  17. package/es/components/table/src/hooks/useDataSource.d.ts +1 -3
  18. package/es/components/table/src/hooks/useHeaderCode.d.ts +2 -0
  19. package/es/components/table/src/hooks/useRowSelection.d.ts +2 -3
  20. package/es/components/table/src/index.d.ts +15 -3
  21. package/es/components/table/src/props.d.ts +7 -1
  22. package/es/index.js +284 -272
  23. package/es/style/components/forms/{src/index.less → index.less} +2 -0
  24. package/es/style/components/icons/index.less +1 -0
  25. package/es/style/components/iframe/index.less +3 -0
  26. package/es/style/components/modal/{src/index.less → index.less} +0 -0
  27. package/es/style/components/table/{src/index.less → index.less} +12 -1
  28. package/es/style/theme/header/index.less +8 -4
  29. package/es/style/theme/theme.less +2 -1
  30. package/es/theme/header/components/logo.d.ts +43 -0
  31. package/es/theme/header/components/notify.d.ts +0 -1
  32. package/package.json +1 -1
  33. package/src/assets/imgs/header/avatar.png +0 -0
  34. package/src/components/curd/src/components/dialog.vue +11 -5
  35. package/src/components/curd/src/hooks/useCurd.tsx +24 -9
  36. package/src/components/curd/src/types/curd.type.ts +3 -1
  37. package/src/components/dialog/index.ts +5 -0
  38. package/src/components/dialog/src/hooks/useDialog.ts +85 -0
  39. package/src/components/forms/{src/index.less → index.less} +2 -0
  40. package/src/components/forms/index.ts +3 -4
  41. package/src/components/forms/src/components/formButton.vue +1 -1
  42. package/src/components/icons/{src/index.less → index.less} +1 -0
  43. package/src/components/iframe/index.less +3 -0
  44. package/src/components/iframe/index.ts +2 -2
  45. package/src/components/index.ts +5 -3
  46. package/src/components/modal/{src/index.less → index.less} +0 -0
  47. package/src/components/modal/src/components/close-icon.vue +3 -4
  48. package/src/components/modal/src/components/modal.tsx +1 -1
  49. package/src/components/modal/src/components/modalFooter.vue +1 -1
  50. package/src/components/modal/src/hooks/useModal.ts +0 -1
  51. package/src/components/source/src/hooks/useFetch.ts +3 -4
  52. package/src/components/source/src/hooks/useSource.ts +4 -3
  53. package/src/components/source/src/types/table.type.ts +1 -1
  54. package/src/components/table/{src/index.less → index.less} +12 -1
  55. package/src/components/table/index.ts +1 -1
  56. package/src/components/table/src/components/TableActions.vue +2 -2
  57. package/src/components/table/src/components/setting/Column.vue +1 -2
  58. package/src/components/table/src/hooks/useColumns.ts +2 -2
  59. package/src/components/table/src/hooks/useHeaderCode.ts +82 -0
  60. package/src/components/table/src/hooks/useRowSelection.ts +2 -3
  61. package/src/components/table/src/hooks/useTable.ts +13 -1
  62. package/src/components/table/src/hooks/useTableScroll.ts +5 -3
  63. package/src/components/table/src/index.vue +18 -19
  64. package/src/components/table/src/props.ts +8 -3
  65. package/src/directives/index.ts +0 -1
  66. package/src/directives/permission.ts +2 -3
  67. package/src/theme/footer/index.vue +1 -1
  68. package/src/theme/header/components/bread-crumb.vue +1 -1
  69. package/src/theme/header/components/fullscreen.vue +0 -2
  70. package/src/theme/header/components/logo.vue +4 -2
  71. package/src/theme/header/components/notify.vue +1 -2
  72. package/src/theme/header/components/user-info.vue +22 -5
  73. package/src/theme/header/helper/menu-tree.ts +3 -6
  74. package/src/theme/header/index.less +8 -4
  75. package/src/theme/sider/helper/split-menu.ts +1 -2
  76. package/src/theme/tabs/components/TabContent.vue +0 -1
  77. package/src/theme/tabs/index.vue +1 -1
  78. package/src/theme/theme.less +2 -1
  79. package/src/theme/theme.vue +4 -3
  80. package/es/assets/app-antd-dark-theme-style.e3b0c442.css +0 -0
  81. package/es/assets/app-theme-style.e3b0c442.css +0 -0
  82. package/es/assets/data/icon.d.ts +0 -4
  83. package/es/assets/data/icon.ts +0 -69
  84. package/es/assets/data/icon11.ts +0 -69
  85. package/es/assets/style/var.less +0 -42
  86. package/es/components/icons/pick-icon.d.ts +0 -529
  87. package/es/components/icons/svg-icon.d.ts +0 -44
  88. package/es/components/table/src/hooks/useFormat.d.ts +0 -2
  89. package/es/components/table/src/hooks/useVirtualScroll.d.ts +0 -5
  90. package/es/components/table/src/utils/format.d.ts +0 -1
  91. package/es/index.css +0 -1
  92. package/es/style/assets/style/var.less +0 -42
  93. package/es/style/components/icons/src/index.less +0 -96
  94. package/es/theme/content/index.d.ts +0 -27
  95. package/es/theme/header/components/menu-search.d.ts +0 -528
  96. package/es/theme/header/components/setting-theme.d.ts +0 -2580
  97. package/es/theme/header/components/user-info.d.ts +0 -452
  98. package/es/theme/header/index.d.ts +0 -4369
  99. package/es/theme/header/multiple-header.d.ts +0 -2001
  100. package/es/theme/styles/hooks/changeTheme.d.ts +0 -1
  101. package/es/theme/styles/hooks/generate.d.ts +0 -13
  102. package/es/theme/styles/index.d.ts +0 -2
  103. package/es/theme/tabs/components/TabRedo.d.ts +0 -7
  104. package/es/theme/tabs/index.d.ts +0 -2478
  105. package/es/theme/theme/initTheme.d.ts +0 -3
  106. package/es/theme/theme/util.d.ts +0 -5
  107. package/es/theme/theme.d.ts +0 -22
@@ -1,3 +1,5 @@
1
+ @import '../modal/index.less';
2
+
1
3
  .text-secondary{
2
4
  color: #666;
3
5
  }
@@ -9,6 +9,7 @@
9
9
  .dt-icon{
10
10
  display: inline-block;
11
11
  text-align: center;
12
+ vertical-align: middle;
12
13
  & > svg{
13
14
  vertical-align: middle;
14
15
  }
@@ -0,0 +1,3 @@
1
+ .iframe-page{
2
+ height: 100%;
3
+ }
@@ -82,6 +82,11 @@
82
82
  }
83
83
  }
84
84
 
85
+ .dt-table-action-dropdown{
86
+ vertical-align: middle;
87
+ cursor: pointer;
88
+ }
89
+
85
90
  .ant-table-fixed-left table, .ant-table-fixed-right table{
86
91
  width: min-content;
87
92
  }
@@ -115,12 +120,13 @@
115
120
  .ant-dropdown-menu-title-content{
116
121
  display: flex;
117
122
  align-items: center;
123
+ font-size: 13px;
118
124
  svg{
119
125
  display: block;
120
126
  }
121
127
 
122
128
  .dt-icon{
123
- padding: 0 8px;
129
+ padding-right: 8px;
124
130
  }
125
131
  }
126
132
  }
@@ -159,4 +165,9 @@
159
165
  margin-left: 0;
160
166
  }
161
167
  }
168
+
169
+ .ant-table-thead > tr > th{
170
+ font-weight: bolder;
171
+ color: #333;
172
+ }
162
173
  }
@@ -121,10 +121,6 @@
121
121
  color: #333;
122
122
  }
123
123
  }
124
-
125
- .icon{
126
- padding: 0 14px;
127
- }
128
124
  }
129
125
 
130
126
  &--light{
@@ -209,6 +205,14 @@
209
205
  right: 4px;
210
206
  top: 10px;
211
207
  }
208
+
209
+
210
+ }
211
+
212
+ .brand-logo{
213
+ width: 40px;
214
+ height: 60px;
215
+ margin-left: -7px;
212
216
  }
213
217
 
214
218
  .dt-multiple-header{
@@ -3,7 +3,8 @@
3
3
  @import './tabs/index.less';
4
4
  @import './footer/index.less';
5
5
  @import './transition.less';
6
-
6
+ @import '../components/icons/index.less';
7
+ @import '../components/container/index.less';
7
8
 
8
9
  @page-bg-color: #f0f2f5;
9
10
 
@@ -25,6 +25,49 @@ declare const _sfc_main: import("vue").DefineComponent<{
25
25
  getLogoClass: import("vue").ComputedRef<(string | {
26
26
  'collapsed-show-title': boolean;
27
27
  })[]>;
28
+ DtIcon: import("vue").DefineComponent<{
29
+ iconClass: {
30
+ type: StringConstructor;
31
+ required: true;
32
+ };
33
+ className: {
34
+ type: (StringConstructor | ArrayConstructor)[];
35
+ default: string;
36
+ };
37
+ color: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ size: {
42
+ type: NumberConstructor;
43
+ default: number;
44
+ };
45
+ }, {
46
+ isSvgIcon: import("vue").ComputedRef<boolean>;
47
+ iconName: import("vue").ComputedRef<string>;
48
+ clsName: import("vue").ComputedRef<string>;
49
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
50
+ iconClass: {
51
+ type: StringConstructor;
52
+ required: true;
53
+ };
54
+ className: {
55
+ type: (StringConstructor | ArrayConstructor)[];
56
+ default: string;
57
+ };
58
+ color: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ };
62
+ size: {
63
+ type: NumberConstructor;
64
+ default: number;
65
+ };
66
+ }>>, {
67
+ className: string | unknown[];
68
+ color: string;
69
+ size: number;
70
+ }>;
28
71
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
29
72
  theme: {
30
73
  type: StringConstructor;
@@ -1,5 +1,4 @@
1
1
  declare const _sfc_main: import("vue").DefineComponent<{}, {
2
- activeKey: import("vue").Ref<string>;
3
2
  getShowNotice: import("vue").ComputedRef<boolean | JSX.Element | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
4
3
  [key: string]: any;
5
4
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "keywords": [
5
5
  "ui",
6
6
  "dt-ui"
@@ -9,7 +9,7 @@
9
9
  import { isFunction, Recordable } from "@dt-frames/core";
10
10
  import { omit } from 'lodash-es'
11
11
  import { Ref, PropType, watch, toRaw, unref, watchEffect } from "vue";
12
- import { useForm, DtForm } from "../../../forms";
12
+ import { useForm, DtForm, FormProps } from "../../../forms";
13
13
  import { DtModal, useModal } from "../../../modal"
14
14
  import { basicProps } from "./props";
15
15
 
@@ -18,28 +18,34 @@
18
18
  ...{
19
19
  onRegister: { type: Function },
20
20
  formProps: {
21
+ type: Object as PropType<Ref<Partial<FormProps>>>
22
+ },
23
+ formsVal: {
21
24
  type: Object as PropType<Ref<Recordable>>
22
25
  }
23
26
  }
24
27
  } )
25
28
 
26
- const [registerDialog, { }] = useModal({
29
+ const [registerDialog] = useModal({
27
30
  ...omit(toRaw(props), [
28
31
  'actions',
29
32
  'curd',
30
33
  'formProps',
34
+ 'formsVal',
31
35
  'onRegister',
32
36
  'schemas'
33
- ])
37
+ ]),
38
+ destroyOnClose: true
34
39
  })
35
40
 
36
41
  const [ registerForm, { getFormValues, setFormValues } ] = useForm({
42
+ ...( props.formProps.value || {} ),
37
43
  schemas: props.schemas,
38
44
  mode: 'dialog'
39
45
  })
40
46
 
41
47
  watch(
42
- () => props.formProps.value,
48
+ () => props.formsVal.value,
43
49
  v => {
44
50
  if( v ) {
45
51
  setFormValues( toRaw(v) )
@@ -53,7 +59,7 @@
53
59
 
54
60
  let obj = Object.assign(
55
61
  {},
56
- props.formProps.value || {},
62
+ props.formsVal.value || {},
57
63
  getFormValues()
58
64
  )
59
65
 
@@ -1,21 +1,22 @@
1
- import { DtCreateDialog, error, isFunction, Recordable } from "@dt-frames/core";
2
- import { DtForm, useForm } from "../../../forms";
3
- import { h, ref, unref } from "vue"
4
- import { useModal, useModalOut } from "../../../modal"
1
+ import { error, isFunction, Recordable, useMessage } from "@dt-frames/core";
2
+ import { h, ref } from "vue"
3
+ import { useModalOut } from "../../../modal"
5
4
  import DtModal from "../components/dialog.vue";
6
5
  import { CrudOptType } from "../types/curd.type";
7
6
 
8
7
 
9
8
  export function useCurd(curdOpt: CrudOptType) {
10
- const formProps = ref<Recordable>()
9
+ const formsVal = ref<Recordable>()
11
10
  const [register, { closeModal, setModalProps, openModal }] = useModalOut()
11
+ const { confirm } = useMessage()
12
12
 
13
13
  const DtCurdModal = () => {
14
14
  return h(
15
15
  <div class="curdModal">
16
16
  <DtModal
17
17
  { ...curdOpt }
18
- formProps = { formProps }
18
+ formsVal = { formsVal }
19
+ formProps = { curdOpt.formProps }
19
20
  onRegister = { register }
20
21
  ></DtModal>
21
22
  </div>
@@ -32,7 +33,14 @@ export function useCurd(curdOpt: CrudOptType) {
32
33
  const { primaryKey = 'id', curd } = curdOpt
33
34
 
34
35
  if( curd && curd.onDeletes && isFunction( curd.onDeletes ) ) {
35
- curd.onDeletes( [row[ primaryKey ]] )
36
+ confirm({
37
+ title: '删除确认',
38
+ content: '确认要删除选中的数据?',
39
+ iconType: 'warning',
40
+ onOk() {
41
+ curd.onDeletes( [row[ primaryKey ]] )
42
+ }
43
+ })
36
44
  } else {
37
45
  error(`缺少curd函数配置, 请将useSource中返回的curd参数传入useCurd配置项中!`)
38
46
  }
@@ -43,7 +51,7 @@ export function useCurd(curdOpt: CrudOptType) {
43
51
  const { primaryKey = 'id', curd } = curdOpt
44
52
 
45
53
  curd.onQueryById(row[primaryKey]).then( rsp => {
46
- formProps.value = rsp
54
+ formsVal.value = rsp
47
55
  } )
48
56
 
49
57
  openModal()
@@ -55,7 +63,14 @@ export function useCurd(curdOpt: CrudOptType) {
55
63
  const { curd } = curdOpt
56
64
 
57
65
  if( curd && curd.onDeletes && isFunction( curd.onDeletes ) ) {
58
- curd.onDeletes( ids )
66
+ confirm({
67
+ title: '批量删除确认',
68
+ content: '确认要批量删除选中的数据?',
69
+ iconType: 'warning',
70
+ onOk() {
71
+ curd.onDeletes( ids )
72
+ }
73
+ })
59
74
  } else {
60
75
  error(`缺少curd函数配置, 请将useSource中返回的curd参数传入useCurd配置项中!`)
61
76
  }
@@ -1,5 +1,5 @@
1
1
  import { Recordable } from "@dt-frames/core"
2
- import { FormSchema, ButtonProps } from "../../../forms/src/types/form.type"
2
+ import { FormSchema, ButtonProps, FormProps } from "../../../forms/src/types/form.type"
3
3
 
4
4
  export type CrudOptType = {
5
5
  // 标题
@@ -16,6 +16,8 @@ export type CrudOptType = {
16
16
  showClose?: boolean
17
17
  // 物理主键
18
18
  primaryKey?: string
19
+ // 弹框中表格的属性
20
+ formProps?: Partial<FormProps>,
19
21
  // 增删改查接口
20
22
  curd?: {
21
23
  onAdd?: ( model: Recordable ) => void
@@ -0,0 +1,5 @@
1
+ import { useDialog } from './src/hooks/useDialog'
2
+
3
+ export {
4
+ useDialog
5
+ }
@@ -0,0 +1,85 @@
1
+ import { ModalProps, Recordable } from "@dt-frames/core"
2
+ import { VNode, h, createVNode, render as vueRender, Component } from "vue"
3
+
4
+ export function useDialog() {
5
+ function createDialog( component: any, options: any ) {
6
+ return new Promise( resolve => {
7
+ const div = document.createElement('div');
8
+ document.body.appendChild(div);
9
+
10
+ const wrapper = () => {
11
+ return h(component, {
12
+ params: {
13
+ ...options,
14
+ afterClose: ( data: any ) => destroy( data )
15
+ }
16
+
17
+ })
18
+ };
19
+
20
+ let dialogInstance = render();
21
+
22
+ function render() {
23
+ const vm = createVNode(component.children[0]);
24
+ vueRender(vm, div);
25
+ return vm;
26
+ }
27
+
28
+ function destroy( data: any ) {
29
+ if (dialogInstance && div.parentNode) {
30
+ vueRender(null, div);
31
+ dialogInstance.component.update();
32
+ dialogInstance = null;
33
+ div.parentNode.removeChild(div);
34
+ }
35
+
36
+ resolve( data );
37
+ }
38
+ } )
39
+ }
40
+ // function createDialog(component: any, props?: ModalProps) {
41
+ // const afterClose = (rsp: Recordable) => { }
42
+
43
+ // const div = document.createElement('div')
44
+ // document.body.appendChild(div)
45
+
46
+ // const wrapper = () => {
47
+ // return (
48
+ // h(component, {
49
+ // params: {
50
+ // ...props,
51
+ // afterClose: ( data: Recordable ) => destroy( data )
52
+ // }
53
+ // })
54
+ // )
55
+ // }
56
+
57
+ // let dialogInstance = render()
58
+
59
+ // function render(){
60
+ // const vm = createVNode(wrapper)
61
+ // vueRender(vm, div)
62
+ // return vm
63
+ // }
64
+
65
+ // const destroy = ( data: Recordable ) => {
66
+ // if (dialogInstance && div.parentNode) {
67
+ // vueRender(null, div)
68
+ // dialogInstance.component.update()
69
+ // dialogInstance = null
70
+ // div.parentNode.removeChild(div)
71
+ // }
72
+
73
+ // afterClose( data )
74
+ // }
75
+
76
+
77
+ // return {
78
+ // afterClose
79
+ // }
80
+ // }
81
+
82
+ return {
83
+ createDialog
84
+ }
85
+ }
@@ -1,3 +1,5 @@
1
+ @import '../modal/index.less';
2
+
1
3
  .text-secondary{
2
4
  color: #666;
3
5
  }
@@ -1,12 +1,11 @@
1
1
  import DtForm from './src/index.vue'
2
2
  import { useForm } from './src/hooks/useForm'
3
- import { ButtonProps, FormSchema } from './src/types/form.type'
4
3
  import FormButtons from './src/components/formButton.vue'
5
4
 
5
+ export * from './src/types/form.type'
6
+
6
7
  export {
7
8
  FormButtons,
8
9
  DtForm,
9
- useForm,
10
- FormSchema,
11
- ButtonProps
10
+ useForm
12
11
  }
@@ -29,7 +29,7 @@
29
29
  @click="toggleAdvanced">
30
30
  <span class="text">{{ advancedRef ? '收起' : '展开' }}</span>
31
31
  <span :class="getAdvanceClass">
32
- <DtIcon :icon-class="'ic:baseline-arrow-drop-down'" :size="22"></DtIcon>
32
+ <DtIcon icon-class="ic:baseline-arrow-drop-down" :size="22"></DtIcon>
33
33
  </span>
34
34
  </Button>
35
35
 
@@ -9,6 +9,7 @@
9
9
  .dt-icon{
10
10
  display: inline-block;
11
11
  text-align: center;
12
+ vertical-align: middle;
12
13
  & > svg{
13
14
  vertical-align: middle;
14
15
  }
@@ -0,0 +1,3 @@
1
+ .iframe-page{
2
+ height: 100%;
3
+ }
@@ -1,5 +1,5 @@
1
- import DtIFrame from './src/index.vue'
1
+ import DtIframe from './src/index.vue'
2
2
 
3
3
  export {
4
- DtIFrame
4
+ DtIframe
5
5
  }
@@ -7,7 +7,8 @@ import { DtTable, useTable } from './table'
7
7
  import { useSource } from './source'
8
8
  import { useCurd } from './curd'
9
9
  import { export2Excel } from './excel'
10
- import { DtIFrame } from './iframe'
10
+ import { DtIframe } from './iframe'
11
+ import { useDialog } from './dialog';
11
12
 
12
13
  const dtComponents = [
13
14
  { name: 'dt-base-router', component: DtBaseRouter },
@@ -35,12 +36,13 @@ export {
35
36
  DtForm,
36
37
  DtTable,
37
38
  FormButtons,
38
- DtIFrame,
39
+ DtIframe,
39
40
  useForm,
40
41
  useTable,
41
42
  useSource,
42
43
  useCurd,
43
44
  useModal,
44
45
  useModalOut,
45
- export2Excel
46
+ export2Excel,
47
+ useDialog
46
48
  }
@@ -2,21 +2,20 @@
2
2
  <div :class="getClass">
3
3
  <template v-if="canFullscreen">
4
4
  <Tooltip title="退出全屏" placement="bottom" v-if="fullScreen">
5
- <i v-icon="'ic:baseline-fullscreen-exit'" @click="handleFullScreen" />
5
+ <i class="i ic:baseline-fullscreen-exit" @click="handleFullScreen" />
6
6
  </Tooltip>
7
7
  <Tooltip title="全屏" placement="bottom" v-else>
8
- <i v-icon="'ic:baseline-fullscreen'" @click="handleFullScreen" />
8
+ <i class="i ic:baseline-fullscreen" @click="handleFullScreen" />
9
9
  </Tooltip>
10
10
  </template>
11
11
 
12
- <DtIcon icon-class="mdi:close" @click="handleCancel" />
12
+ <i class="i mdi:close" @click="handleCancel" />
13
13
  </div>
14
14
  </template>
15
15
 
16
16
  <script lang="ts" setup>
17
17
  import { computed } from 'vue';
18
18
  import { Tooltip } from 'ant-design-vue';
19
- import { DtIcon } from '../../../icons';
20
19
 
21
20
  const props = defineProps({
22
21
  canFullscreen: { type: Boolean, default: true },
@@ -1,4 +1,4 @@
1
- import { defineComponent, Slots, toRefs, unref } from "vue";
1
+ import { defineComponent, toRefs, unref } from "vue";
2
2
  import { Modal } from 'ant-design-vue';
3
3
  import { useAttrs, useSlots } from '@dt-frames/core';
4
4
  import { basicProps } from '../props';
@@ -23,7 +23,7 @@
23
23
  })
24
24
 
25
25
  const buttonActions: ButtonProps[] = [
26
- { name: '保存', preIcon: 'mdi:content-save', type: 'primary', flag: 'OK', show: props.showSave },
26
+ { name: '保存', preIcon: 'mdi:content-save', type: 'primary', flag: 'OK' },
27
27
  { name: '关闭', preIcon: 'mdi:close', flag: 'CANCEL' },
28
28
  ]
29
29
 
@@ -2,7 +2,6 @@ import { error, isFunction, Nullable } from "@dt-frames/core";
2
2
  import { ModalProps } from "@dt-frames/core"
3
3
  import { isEqual } from 'lodash-es'
4
4
  import { tryOnUnmounted } from '@vueuse/core'
5
- import { basicProps } from '../props'
6
5
  import { ModalMethods, ReturnInnerMethods, ReturnMethods, UseModalInnerReturnType, UseModalReturnType } from '../types/modal.type';
7
6
  import { computed, ExtractPropTypes, getCurrentInstance, nextTick, onUnmounted, reactive, ref, toRaw, unref, watch, watchEffect } from "vue";
8
7
 
@@ -48,13 +48,12 @@ export function useFetch(api: string | ApiType, baseUrl: string = '') {
48
48
  ...header,
49
49
  ...{ onlyData: false }
50
50
  }).then(
51
- (data: JsonResult) => {
51
+ (data: JsonResult) => {
52
52
  if( afterFetch && isFunction(afterFetch) ) {
53
53
  data = afterFetch( data )
54
54
  }
55
- if( data.status ) {
56
- resolve( data.data )
57
- }
55
+
56
+ resolve( data?.data )
58
57
  },
59
58
  (error) => {
60
59
  reject( error )
@@ -1,5 +1,5 @@
1
1
  import { computed, ref, reactive, toRaw, Ref } from 'vue'
2
- import { http, isFunction, isString, JsonResult, Recordable } from "@dt-frames/core"
2
+ import { http, isArray, isFunction, isObject, isString, JsonResult, Recordable } from "@dt-frames/core"
3
3
  import { BaseDataType, SourceType } from "../types/source.type"
4
4
  import { useFetch } from './useFetch'
5
5
  import { TableParamsType } from '../types/table.type'
@@ -74,7 +74,8 @@ export function useSource(opt: SourceType) {
74
74
  pageSize: pagination.pageSize
75
75
  }
76
76
 
77
- baseData.orderDTOs = sort
77
+ // baseData.orderDTOs = sort.length ?? null
78
+ baseData.orderDTOs = []
78
79
 
79
80
  if( needSearch ) search()
80
81
  }
@@ -90,7 +91,7 @@ export function useSource(opt: SourceType) {
90
91
  ).then( (rsp: any) => {
91
92
  const { records, pageDTO } = rsp
92
93
 
93
- dataSource.value = records
94
+ dataSource.value.splice(0, dataSource.value.length, ...records)
94
95
 
95
96
  pagination.value = {
96
97
  current: (pageDTO?.pageNo??0) + 1,
@@ -3,6 +3,6 @@ import { Recordable } from "@dt-frames/core";
3
3
  export type TableParamsType = {
4
4
  pagination: any,
5
5
  showBtnLoading: boolean,
6
- sort: Recordable,
6
+ sort: Recordable[],
7
7
  filter: any
8
8
  }
@@ -82,6 +82,11 @@
82
82
  }
83
83
  }
84
84
 
85
+ .dt-table-action-dropdown{
86
+ vertical-align: middle;
87
+ cursor: pointer;
88
+ }
89
+
85
90
  .ant-table-fixed-left table, .ant-table-fixed-right table{
86
91
  width: min-content;
87
92
  }
@@ -115,12 +120,13 @@
115
120
  .ant-dropdown-menu-title-content{
116
121
  display: flex;
117
122
  align-items: center;
123
+ font-size: 13px;
118
124
  svg{
119
125
  display: block;
120
126
  }
121
127
 
122
128
  .dt-icon{
123
- padding: 0 8px;
129
+ padding-right: 8px;
124
130
  }
125
131
  }
126
132
  }
@@ -159,4 +165,9 @@
159
165
  margin-left: 0;
160
166
  }
161
167
  }
168
+
169
+ .ant-table-thead > tr > th{
170
+ font-weight: bolder;
171
+ color: #333;
172
+ }
162
173
  }
@@ -3,5 +3,5 @@ import DtTable from "./src/index.vue"
3
3
 
4
4
  export {
5
5
  DtTable,
6
- useTable
6
+ useTable,
7
7
  }
@@ -13,7 +13,7 @@
13
13
  :getPopupContainer="getPopupContainer"
14
14
  :trigger="['click']"
15
15
  >
16
- <DtIcon :icon-class="'mdi:cog-outline'"></DtIcon>
16
+ <DtIcon :icon-class="'ic:baseline-settings'" class-name="dt-table-action-dropdown"></DtIcon>
17
17
 
18
18
  <template #overlay>
19
19
  <Menu class="dt-action-select">
@@ -22,7 +22,7 @@
22
22
  v-if="item.ifShow"
23
23
  @click="handleAction(item)"
24
24
  >
25
- <DtIcon :icon-class="item.icon" :color="item.color"></DtIcon>
25
+ <DtIcon :icon-class="item.icon" :color="item.color" :size="16"></DtIcon>
26
26
  <span>{{ item.title }}</span>
27
27
  </MenuItem>
28
28
  </template>