@dt-frames/ui 1.0.13 → 1.0.15
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/es/components/curd/src/components/dialog.d.ts +20 -20
- package/es/components/curd/src/components/props.d.ts +2 -1
- package/es/components/curd/src/hooks/useCurd.d.ts +1 -0
- package/es/components/curd/src/types/curd.type.d.ts +2 -2
- package/es/components/forms/src/components/formButton.d.ts +1 -2
- package/es/components/forms/src/components/formIcon.d.ts +15 -15
- package/es/components/forms/src/hooks/useFormActions.d.ts +2 -2
- package/es/components/forms/src/index.d.ts +2 -2
- package/es/components/forms/src/types/form.type.d.ts +3 -17
- package/es/components/index.d.ts +1 -1
- package/es/components/modal/src/components/modal.d.ts +2 -2
- package/es/components/modal/src/components/modalFooter.d.ts +1 -1
- package/es/components/modal/src/index.d.ts +15 -15
- package/es/components/modal/src/props.d.ts +1 -1
- package/es/components/source/src/hooks/useFetch.d.ts +1 -1
- package/es/components/table/src/index.d.ts +3 -3
- package/es/components/table/src/props.d.ts +1 -2
- package/es/components/tree/src/props.d.ts +8 -1
- package/es/components/upload/src/upload.d.ts +3 -3
- package/es/index.js +43 -19
- package/es/style/components/icons/index.less +1 -1
- package/package.json +1 -10
- package/vite.config.js +10 -0
- package/src/assets/data/icons/actions.ts +0 -427
- package/src/assets/data/icons/code.ts +0 -10
- package/src/assets/data/icons/commuticate.ts +0 -190
- package/src/assets/data/icons/currency.ts +0 -46
- package/src/assets/data/icons/devices.ts +0 -128
- package/src/assets/data/icons/edit.ts +0 -165
- package/src/assets/data/icons/file.ts +0 -104
- package/src/assets/data/icons/math.ts +0 -53
- package/src/assets/data/icons/message.ts +0 -75
- package/src/assets/data/icons/navigate.ts +0 -181
- package/src/assets/data/icons/other.ts +0 -333
- package/src/assets/data/icons.ts +0 -58
- package/src/assets/imgs/header/avatar.png +0 -0
- package/src/assets/imgs/logo/logo.png +0 -0
- package/src/assets/locales/en_US.json +0 -3
- package/src/assets/locales/zh_CN.json +0 -3
- package/src/assets/style/index.less +0 -10
- package/src/assets/style/reset.less +0 -17
- package/src/components/container/index.less +0 -85
- package/src/components/container/index.ts +0 -8
- package/src/components/container/src/bar.ts +0 -107
- package/src/components/container/src/lazy-container.vue +0 -9
- package/src/components/container/src/scroll-bar.vue +0 -117
- package/src/components/container/src/scroll-container.vue +0 -61
- package/src/components/curd/index.ts +0 -5
- package/src/components/curd/src/components/dialog.vue +0 -73
- package/src/components/curd/src/components/props.ts +0 -32
- package/src/components/curd/src/hooks/useCurd.tsx +0 -87
- package/src/components/curd/src/types/curd.type.ts +0 -32
- package/src/components/excel/index.ts +0 -6
- package/src/components/excel/src/export2Excel.ts +0 -44
- package/src/components/forms/index.less +0 -107
- package/src/components/forms/index.ts +0 -11
- package/src/components/forms/src/componentMap.ts +0 -46
- package/src/components/forms/src/components/formButton.vue +0 -150
- package/src/components/forms/src/components/formIcon.vue +0 -51
- package/src/components/forms/src/components/formInputUseDialog.vue +0 -43
- package/src/components/forms/src/components/formItem.vue +0 -420
- package/src/components/forms/src/components/radioButton.vue +0 -58
- package/src/components/forms/src/const/form.const.ts +0 -7
- package/src/components/forms/src/hooks/helper.ts +0 -70
- package/src/components/forms/src/hooks/useForm.ts +0 -130
- package/src/components/forms/src/hooks/useFormActions.ts +0 -63
- package/src/components/forms/src/hooks/useFormEvents.ts +0 -248
- package/src/components/forms/src/hooks/useFormValue.ts +0 -49
- package/src/components/forms/src/hooks/useFormValues.ts +0 -131
- package/src/components/forms/src/hooks/useLabelWidth.ts +0 -57
- package/src/components/forms/src/index.vue +0 -310
- package/src/components/forms/src/prop.ts +0 -80
- package/src/components/forms/src/types/form.type.ts +0 -275
- package/src/components/icons/index.less +0 -101
- package/src/components/icons/index.ts +0 -7
- package/src/components/icons/src/pick-icon.vue +0 -119
- package/src/components/icons/src/svg-icon.vue +0 -117
- package/src/components/iframe/index.less +0 -3
- package/src/components/iframe/index.ts +0 -5
- package/src/components/iframe/src/index.less +0 -3
- package/src/components/iframe/src/index.vue +0 -38
- package/src/components/index.ts +0 -53
- package/src/components/modal/index.less +0 -60
- package/src/components/modal/index.ts +0 -8
- package/src/components/modal/src/components/close-icon.vue +0 -46
- package/src/components/modal/src/components/modal-wrap.vue +0 -128
- package/src/components/modal/src/components/modal.tsx +0 -30
- package/src/components/modal/src/components/modalFooter.vue +0 -46
- package/src/components/modal/src/hooks/useDrag.ts +0 -107
- package/src/components/modal/src/hooks/useFullScreen.ts +0 -29
- package/src/components/modal/src/hooks/useModal.ts +0 -200
- package/src/components/modal/src/index.vue +0 -184
- package/src/components/modal/src/props.ts +0 -44
- package/src/components/modal/src/types/modal.type.ts +0 -30
- package/src/components/router/base-router.vue +0 -11
- package/src/components/router/index.ts +0 -3
- package/src/components/source/index.ts +0 -1
- package/src/components/source/src/hooks/useFetch.ts +0 -42
- package/src/components/source/src/hooks/usePage.ts +0 -3
- package/src/components/source/src/hooks/useSource.ts +0 -214
- package/src/components/source/src/index.ts +0 -5
- package/src/components/source/src/types/source.type.ts +0 -58
- package/src/components/source/src/types/table.type.ts +0 -8
- package/src/components/table/index.less +0 -179
- package/src/components/table/index.ts +0 -7
- package/src/components/table/src/components/TableActions.vue +0 -108
- package/src/components/table/src/components/TableHeader.vue +0 -78
- package/src/components/table/src/components/TableRender.vue +0 -76
- package/src/components/table/src/components/editable/CellComponent.ts +0 -57
- package/src/components/table/src/components/editable/EditTableCell.vue +0 -181
- package/src/components/table/src/components/editable/componentMap.ts +0 -18
- package/src/components/table/src/components/editable/index.ts +0 -58
- package/src/components/table/src/components/setting/Column.vue +0 -354
- package/src/components/table/src/components/setting/Download.vue +0 -55
- package/src/components/table/src/components/setting/Fullscreen.vue +0 -43
- package/src/components/table/src/components/setting/Size.vue +0 -42
- package/src/components/table/src/components/setting/index.vue +0 -64
- package/src/components/table/src/const.ts +0 -13
- package/src/components/table/src/hooks/useColumns.ts +0 -326
- package/src/components/table/src/hooks/useCustomRow.ts +0 -86
- package/src/components/table/src/hooks/useDataSource.ts +0 -97
- package/src/components/table/src/hooks/useHeaderCode.ts +0 -89
- package/src/components/table/src/hooks/useLoading.ts +0 -29
- package/src/components/table/src/hooks/usePagination.ts +0 -76
- package/src/components/table/src/hooks/useRowSelection.ts +0 -145
- package/src/components/table/src/hooks/useRows.ts +0 -30
- package/src/components/table/src/hooks/useTable.ts +0 -90
- package/src/components/table/src/hooks/useTableHeader.ts +0 -48
- package/src/components/table/src/hooks/useTableInstance.ts +0 -29
- package/src/components/table/src/hooks/useTableScroll.ts +0 -229
- package/src/components/table/src/index.vue +0 -212
- package/src/components/table/src/props.ts +0 -160
- package/src/components/table/src/types/table.type.ts +0 -160
- package/src/components/table/src/types/tableHeader.type.ts +0 -27
- package/src/components/tree/index.less +0 -41
- package/src/components/tree/index.ts +0 -5
- package/src/components/tree/src/components/TreeHeader.vue +0 -97
- package/src/components/tree/src/hooks/useTree.ts +0 -239
- package/src/components/tree/src/index.vue +0 -392
- package/src/components/tree/src/props.ts +0 -133
- package/src/components/tree/src/type/tree.ts +0 -105
- package/src/components/tree/src/utils/tree.ts +0 -73
- package/src/components/type.ts +0 -0
- package/src/components/upload/index.less +0 -35
- package/src/components/upload/index.ts +0 -5
- package/src/components/upload/src/helper.ts +0 -60
- package/src/components/upload/src/props.ts +0 -51
- package/src/components/upload/src/upload.vue +0 -191
- package/src/directives/icon.ts +0 -36
- package/src/directives/index.ts +0 -26
- package/src/directives/permission.ts +0 -20
- package/src/global.d.ts +0 -8
- package/src/index.ts +0 -4
- package/src/theme/content/index.vue +0 -37
- package/src/theme/feature/back-top.vue +0 -11
- package/src/theme/feature/index.vue +0 -7
- package/src/theme/footer/index.less +0 -16
- package/src/theme/footer/index.vue +0 -24
- package/src/theme/header/components/bread-crumb.vue +0 -26
- package/src/theme/header/components/fullscreen.vue +0 -12
- package/src/theme/header/components/handler.ts +0 -81
- package/src/theme/header/components/index.ts +0 -21
- package/src/theme/header/components/lang-picker.vue +0 -36
- package/src/theme/header/components/logo.vue +0 -35
- package/src/theme/header/components/menu-search.vue +0 -62
- package/src/theme/header/components/notify.vue +0 -22
- package/src/theme/header/components/setting-theme.vue +0 -123
- package/src/theme/header/components/theme-drawer/enum.ts +0 -12
- package/src/theme/header/components/theme-drawer/feature.vue +0 -75
- package/src/theme/header/components/theme-drawer/index.ts +0 -7
- package/src/theme/header/components/theme-drawer/menu-type.vue +0 -40
- package/src/theme/header/components/theme-drawer/select-item.vue +0 -46
- package/src/theme/header/components/theme-drawer/switch-item.vue +0 -39
- package/src/theme/header/components/theme-drawer/theme-color.vue +0 -26
- package/src/theme/header/components/trigger.vue +0 -14
- package/src/theme/header/components/user-info.vue +0 -60
- package/src/theme/header/const/index.ts +0 -40
- package/src/theme/header/helper/menu-tree.ts +0 -64
- package/src/theme/header/index.less +0 -442
- package/src/theme/header/index.ts +0 -0
- package/src/theme/header/index.vue +0 -96
- package/src/theme/header/multiple-header.vue +0 -67
- package/src/theme/header/set-theme.less +0 -68
- package/src/theme/index.ts +0 -3
- package/src/theme/sider/components/basic-menu/basic-menu-item.vue +0 -14
- package/src/theme/sider/components/basic-menu/basic-menu.vue +0 -122
- package/src/theme/sider/components/basic-menu/basic-sub-menu-item.vue +0 -46
- package/src/theme/sider/components/basic-menu/menu-item-content.vue +0 -13
- package/src/theme/sider/components/drag-bar.vue +0 -26
- package/src/theme/sider/components/layout-menu.vue +0 -132
- package/src/theme/sider/components/props.ts +0 -97
- package/src/theme/sider/components/sider-trigger.vue +0 -24
- package/src/theme/sider/helper/sider.ts +0 -52
- package/src/theme/sider/helper/split-menu.ts +0 -146
- package/src/theme/sider/hooks/useDragLine.ts +0 -86
- package/src/theme/sider/hooks/useOpenKeys.ts +0 -57
- package/src/theme/sider/index.less +0 -203
- package/src/theme/sider/index.vue +0 -88
- package/src/theme/tabs/components/TabContent.vue +0 -36
- package/src/theme/tabs/components/TabRedo.vue +0 -18
- package/src/theme/tabs/hooks/useMultifyTabs.ts +0 -96
- package/src/theme/tabs/hooks/useTabDropdown.ts +0 -89
- package/src/theme/tabs/index.less +0 -165
- package/src/theme/tabs/index.vue +0 -98
- package/src/theme/tabs/types/tabs.type.ts +0 -8
- package/src/theme/theme.less +0 -67
- package/src/theme/theme.vue +0 -90
- package/src/theme/transition.less +0 -99
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { http, isString, JsonResult, Recordable, ApiType, isObject } from "@dt-frames/core";
|
|
2
|
-
|
|
3
|
-
export function useFetch(api: string | ApiType, baseUrl: string = '') {
|
|
4
|
-
/**
|
|
5
|
-
* 发送请求
|
|
6
|
-
* handleParams 记录返回的值
|
|
7
|
-
*/
|
|
8
|
-
function fetch(params: any) {
|
|
9
|
-
let type, header = { }, model = {}
|
|
10
|
-
if(isString( api )) {
|
|
11
|
-
api = baseUrl + api
|
|
12
|
-
} else {
|
|
13
|
-
type = api.type
|
|
14
|
-
if( api.api.indexOf(baseUrl) === -1 ) {
|
|
15
|
-
api.api = `${baseUrl}${api.api}`
|
|
16
|
-
}
|
|
17
|
-
header = api.header
|
|
18
|
-
model = api.model
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return new Promise(( resolve, reject ) => {
|
|
22
|
-
let param = isObject(params) ? Object.assign({}, model, params) : params
|
|
23
|
-
|
|
24
|
-
http[type || 'post']( api, param, {
|
|
25
|
-
...header,
|
|
26
|
-
...{ onlyData: false }
|
|
27
|
-
}).then(
|
|
28
|
-
(data: JsonResult) => {
|
|
29
|
-
resolve( data?.data )
|
|
30
|
-
},
|
|
31
|
-
(error) => {
|
|
32
|
-
reject( error )
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
fetch
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { ref, reactive, toRaw, Ref } from 'vue'
|
|
2
|
-
import { isFunction, isString, Recordable, useMessage } from "@dt-frames/core"
|
|
3
|
-
import { BaseDataType, SourceType } from "../types/source.type"
|
|
4
|
-
import { useFetch } from './useFetch'
|
|
5
|
-
import { TableParamsType } from '../types/table.type'
|
|
6
|
-
import { DownloadType } from '../../../table/src/types/tableHeader.type'
|
|
7
|
-
import { handleDownloadPage } from '../../../excel/index'
|
|
8
|
-
import { useAppStore, ApiType } from '@dt-frames/core'
|
|
9
|
-
|
|
10
|
-
export function useSource(opt: SourceType) {
|
|
11
|
-
const loading: {
|
|
12
|
-
[key: string]: Ref<boolean>
|
|
13
|
-
} = {
|
|
14
|
-
onSearch: ref(false),
|
|
15
|
-
onReset: ref(false)
|
|
16
|
-
}
|
|
17
|
-
const { baseUrl = '', api = {}, exportName = '' } = opt
|
|
18
|
-
const { add, deletes, update, queryById, queryPage } = api
|
|
19
|
-
|
|
20
|
-
const { message } = useMessage()
|
|
21
|
-
const apiFul: Recordable = {}
|
|
22
|
-
const apiPath: Recordable = {}
|
|
23
|
-
|
|
24
|
-
// 定义加载状态
|
|
25
|
-
for( let it in api ) {
|
|
26
|
-
loading['on' + it.slice(0,1).toUpperCase() + it.slice(1).toLowerCase()] = ref(false)
|
|
27
|
-
|
|
28
|
-
if( isString(api[it] )) {
|
|
29
|
-
apiFul[it] = baseUrl + api[it]
|
|
30
|
-
} else {
|
|
31
|
-
apiFul[it] = {
|
|
32
|
-
...(api[it] as ApiType),
|
|
33
|
-
api: baseUrl + (api[it] as ApiType).api
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
apiPath[it] = baseUrl + (isString(api[it]) ? api[it] : (api[it] as ApiType).api)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// 定义分页数据
|
|
41
|
-
const { appConf } = useAppStore()
|
|
42
|
-
const pagination = ref({
|
|
43
|
-
current: appConf?.ui?.table?.defaultPageNo || 1,
|
|
44
|
-
pageSize: appConf?.ui?.table?.defaultPageSize || 10,
|
|
45
|
-
total: 0
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const dataSource = ref([])
|
|
49
|
-
const baseData = reactive<BaseDataType>({
|
|
50
|
-
entityDTO: {},
|
|
51
|
-
pageDTO: {
|
|
52
|
-
pageNo: 0,
|
|
53
|
-
pageSize: 10
|
|
54
|
-
},
|
|
55
|
-
orderDTOs: []
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* 分页查询
|
|
61
|
-
*/
|
|
62
|
-
function onSearch(model: Recordable = {}) {
|
|
63
|
-
baseData.entityDTO = { ...model }
|
|
64
|
-
baseData.pageDTO.pageNo = 0
|
|
65
|
-
loading.onSearch.value = true
|
|
66
|
-
|
|
67
|
-
search()
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// 重置
|
|
71
|
-
function onReset(model: Recordable) {
|
|
72
|
-
baseData.entityDTO = { ...model }
|
|
73
|
-
baseData.pageDTO.pageNo = 0
|
|
74
|
-
loading.onReset.value = true
|
|
75
|
-
|
|
76
|
-
search()
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* table 表单发生改变时, 进行分页查询
|
|
82
|
-
* 如果为首次 则为数据初始化 不需要查询
|
|
83
|
-
*/
|
|
84
|
-
function onTableChange( params: TableParamsType, needSearch: boolean = true ) {
|
|
85
|
-
const { pagination, showBtnLoading, sort, filter } = params
|
|
86
|
-
|
|
87
|
-
baseData.pageDTO = {
|
|
88
|
-
pageNo: pagination.current - 1,
|
|
89
|
-
pageSize: pagination.pageSize
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const { field, order } = sort
|
|
93
|
-
|
|
94
|
-
if( field ) {
|
|
95
|
-
baseData.orderDTOs = [{
|
|
96
|
-
propertyName: field,
|
|
97
|
-
dir: order === 'ascend' ? 'asc' : 'desc'
|
|
98
|
-
}]
|
|
99
|
-
} else {
|
|
100
|
-
baseData.orderDTOs = []
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if( needSearch ) search()
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// 查询
|
|
108
|
-
function search() {
|
|
109
|
-
const { fetch } = useFetch(queryPage, baseUrl)
|
|
110
|
-
loading.onQuerypage.value = true
|
|
111
|
-
|
|
112
|
-
fetch(
|
|
113
|
-
toRaw(baseData)
|
|
114
|
-
).then( (rsp: any) => {
|
|
115
|
-
const { records, pageDTO } = rsp
|
|
116
|
-
|
|
117
|
-
dataSource.value.splice(0, dataSource.value.length, ...records)
|
|
118
|
-
|
|
119
|
-
pagination.value = {
|
|
120
|
-
current: (pageDTO?.pageNo??0) + 1,
|
|
121
|
-
pageSize: (pageDTO?.pageSize??10),
|
|
122
|
-
total: pageDTO?.totalCount??0
|
|
123
|
-
}
|
|
124
|
-
} )
|
|
125
|
-
.finally(() => {
|
|
126
|
-
loading.onSearch.value = false
|
|
127
|
-
loading.onQuerypage.value = false
|
|
128
|
-
loading.onReset.value = false
|
|
129
|
-
})
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// 新增
|
|
134
|
-
function onAdd(model: Recordable) {
|
|
135
|
-
const { fetch } = useFetch(add, baseUrl)
|
|
136
|
-
|
|
137
|
-
return fetch(model).then( (rsp: any) => {
|
|
138
|
-
message.success('新增成功')
|
|
139
|
-
search()
|
|
140
|
-
} )
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// 根据id查询
|
|
145
|
-
async function onQueryById(id: string) {
|
|
146
|
-
const { fetch } = useFetch(queryById, baseUrl)
|
|
147
|
-
return await fetch( { id } )
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
// 修改
|
|
152
|
-
function onUpdate(model: Recordable) {
|
|
153
|
-
const { fetch } = useFetch(update, baseUrl)
|
|
154
|
-
return fetch(model).then( (rsp: any) => {
|
|
155
|
-
message.success('更新数据成功')
|
|
156
|
-
search()
|
|
157
|
-
} )
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
// 删除
|
|
162
|
-
function onDeletes(ids: any) {
|
|
163
|
-
const { fetch } = useFetch(deletes, baseUrl)
|
|
164
|
-
|
|
165
|
-
fetch(toRaw(ids)).then( (rsp: any) => {
|
|
166
|
-
message.success(`${ ids.length > 1 ? '批量' : '' } 删除成功!`)
|
|
167
|
-
search()
|
|
168
|
-
} )
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// 导出
|
|
173
|
-
function onDownload( excelData: DownloadType ) {
|
|
174
|
-
handleDownloadPage(excelData, exportName)
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const form = {
|
|
178
|
-
onSearch,
|
|
179
|
-
onReset,
|
|
180
|
-
loading
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const table = {
|
|
184
|
-
dataSource,
|
|
185
|
-
pagination,
|
|
186
|
-
onTableChange,
|
|
187
|
-
onDownload,
|
|
188
|
-
loading: loading.onQuerypage
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const curd = {
|
|
192
|
-
onAdd,
|
|
193
|
-
onQueryById,
|
|
194
|
-
onUpdate,
|
|
195
|
-
onDeletes
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return {
|
|
199
|
-
api: apiFul,
|
|
200
|
-
apiPath,
|
|
201
|
-
form,
|
|
202
|
-
table,
|
|
203
|
-
curd,
|
|
204
|
-
loading,
|
|
205
|
-
onAdd,
|
|
206
|
-
onQueryById,
|
|
207
|
-
onDeletes,
|
|
208
|
-
onUpdate,
|
|
209
|
-
onTableChange,
|
|
210
|
-
onDownload,
|
|
211
|
-
onSearch,
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Recordable, ApiType } from "@dt-frames/core"
|
|
2
|
-
|
|
3
|
-
export type PageQueryType = {
|
|
4
|
-
entityDTO: Recordable,
|
|
5
|
-
orderDTOs: Recordable[],
|
|
6
|
-
pageDTO: {
|
|
7
|
-
pageNo: number
|
|
8
|
-
pageSize: number
|
|
9
|
-
[key: string]: any
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type ApiObjType = {
|
|
15
|
-
// 新增
|
|
16
|
-
add?: string | ApiType
|
|
17
|
-
|
|
18
|
-
// 修改
|
|
19
|
-
update?: string | ApiType
|
|
20
|
-
|
|
21
|
-
// 保存
|
|
22
|
-
save?: string | ApiType
|
|
23
|
-
|
|
24
|
-
// 删除
|
|
25
|
-
deletes?: string | ApiType
|
|
26
|
-
|
|
27
|
-
// 查找
|
|
28
|
-
queryById?: string | ApiType
|
|
29
|
-
|
|
30
|
-
// 分页查询
|
|
31
|
-
queryPage?: string | ApiType
|
|
32
|
-
|
|
33
|
-
// 其它接口
|
|
34
|
-
[key: string]: string | ApiType
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export type SourceType = {
|
|
39
|
-
// 基础路径
|
|
40
|
-
baseUrl?: string
|
|
41
|
-
|
|
42
|
-
// 文件导出名称
|
|
43
|
-
exportName?: string
|
|
44
|
-
|
|
45
|
-
// api接口
|
|
46
|
-
api: ApiObjType
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export type BaseDataType = {
|
|
50
|
-
entityDTO?: any
|
|
51
|
-
|
|
52
|
-
pageDTO?: {
|
|
53
|
-
pageNo: Number
|
|
54
|
-
pageSize: Number
|
|
55
|
-
} | null
|
|
56
|
-
|
|
57
|
-
orderDTOs: any
|
|
58
|
-
}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
.table-striped td {
|
|
2
|
-
background-color: #fafafa;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.dt-table-header{
|
|
6
|
-
.dt-table-header-actions{
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
justify-content: space-between;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.dt-table-header-actions__right{
|
|
13
|
-
display: flex;
|
|
14
|
-
.dt-icon{
|
|
15
|
-
margin: 0 5px;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.column-setting{
|
|
22
|
-
&__check-item{
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
min-width: 100%;
|
|
26
|
-
padding: 4px 16px 8px 0;
|
|
27
|
-
}
|
|
28
|
-
&__popover-title {
|
|
29
|
-
display: flex;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.column-setting__cloumn-list {
|
|
34
|
-
.ant-popover-inner-content{
|
|
35
|
-
padding: 12px 0 0 0;
|
|
36
|
-
}
|
|
37
|
-
.ant-checkbox-group {
|
|
38
|
-
width: 100%;
|
|
39
|
-
min-width: 260px;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.drag-icon{
|
|
43
|
-
margin: 0 5px;
|
|
44
|
-
cursor: move;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.ant-checkbox-wrapper{
|
|
48
|
-
flex: 1;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.dt-icon{
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
display: flex;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.disabled{
|
|
57
|
-
.dt-icon{
|
|
58
|
-
cursor: not-allowed;
|
|
59
|
-
opacity: 0.5;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.active{
|
|
64
|
-
.dt-icon{
|
|
65
|
-
color: @primary-color !important;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.ant-popover-inner-content {
|
|
70
|
-
max-height: 400px;
|
|
71
|
-
overflow-y: auto;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.dt-table-action-btn{
|
|
76
|
-
width: 24px;
|
|
77
|
-
display: inline-block;
|
|
78
|
-
vertical-align: middle;
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
i{
|
|
81
|
-
color: @primary-color;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.dt-table-action-dropdown{
|
|
86
|
-
vertical-align: middle;
|
|
87
|
-
cursor: pointer;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.ant-table-fixed-left table, .ant-table-fixed-right table{
|
|
91
|
-
width: min-content;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.ant-table-cell {
|
|
95
|
-
height: 44px !important;
|
|
96
|
-
line-height: 24px !important;
|
|
97
|
-
font-size: 14px !important;
|
|
98
|
-
padding: 4px 8px !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.ant-table-small{
|
|
102
|
-
.ant-table-cell {
|
|
103
|
-
height: 32px !important;
|
|
104
|
-
line-height: 16px !important;
|
|
105
|
-
font-size: 12px !important;
|
|
106
|
-
padding: 2px 8px !important;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.ant-table-middle{
|
|
111
|
-
.ant-table-cell {
|
|
112
|
-
height: 38px !important;
|
|
113
|
-
line-height: 20px !important;
|
|
114
|
-
font-size: 13px !important;
|
|
115
|
-
padding: 4px 8px !important;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.dt-action-select{
|
|
120
|
-
.ant-dropdown-menu-title-content{
|
|
121
|
-
display: flex;
|
|
122
|
-
align-items: center;
|
|
123
|
-
font-size: 13px;
|
|
124
|
-
svg{
|
|
125
|
-
display: block;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.dt-icon{
|
|
129
|
-
padding-right: 8px;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
.dt-table{
|
|
136
|
-
.ant-table-pagination{
|
|
137
|
-
margin: 0 !important;
|
|
138
|
-
padding: 10px 0;
|
|
139
|
-
border: 1px solid #f0f0f0;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.ant-table-title{
|
|
143
|
-
padding: 8px 0 !important;
|
|
144
|
-
border: none !important;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
.ant-table-resize-handle{
|
|
148
|
-
right: -7px;
|
|
149
|
-
.ant-table-resize-handle-line{
|
|
150
|
-
width: 2px;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.ant-table-body {
|
|
155
|
-
position: relative;
|
|
156
|
-
table{
|
|
157
|
-
position: absolute;
|
|
158
|
-
top: 0;
|
|
159
|
-
left: 0;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.form-btns{
|
|
164
|
-
button:first-of-type {
|
|
165
|
-
margin-left: 0;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.ant-table-thead > tr > th{
|
|
170
|
-
font-weight: bolder;
|
|
171
|
-
color: #333;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.edit-cell-rule-popover .ant-popover-inner-content{
|
|
176
|
-
padding: 4px 8px;
|
|
177
|
-
color: #ed6f6f;
|
|
178
|
-
border-radius: 2px;
|
|
179
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<template v-if="props.expand">
|
|
3
|
-
<span v-for="item in props.btns" class="dt-table-action-btn">
|
|
4
|
-
<Tooltip placement="bottom" v-if="item.ifShow">
|
|
5
|
-
<template #title>{{ item.title }}</template>
|
|
6
|
-
<span v-icon="item.icon" :color="item.color" @click="handleAction(item)"></span>
|
|
7
|
-
</Tooltip>
|
|
8
|
-
</span>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<template v-else>
|
|
12
|
-
<Dropdown
|
|
13
|
-
:getPopupContainer="getPopupContainer"
|
|
14
|
-
:trigger="['click']"
|
|
15
|
-
>
|
|
16
|
-
<DtIcon :icon-class="'ic:baseline-settings'" class-name="dt-table-action-dropdown"></DtIcon>
|
|
17
|
-
|
|
18
|
-
<template #overlay>
|
|
19
|
-
<Menu class="dt-action-select">
|
|
20
|
-
<template v-for="item in props.btns">
|
|
21
|
-
<MenuItem
|
|
22
|
-
v-if="item.ifShow"
|
|
23
|
-
@click="handleAction(item)"
|
|
24
|
-
>
|
|
25
|
-
<DtIcon :icon-class="item.icon" :color="item.color" :size="16"></DtIcon>
|
|
26
|
-
<span>{{ item.title }}</span>
|
|
27
|
-
</MenuItem>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
</Menu>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
</Dropdown>
|
|
34
|
-
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script lang="ts" setup>
|
|
40
|
-
import { PropType, watch, useAttrs } from 'vue';
|
|
41
|
-
import { Tooltip, Dropdown, Menu, MenuItem } from 'ant-design-vue'
|
|
42
|
-
import { BtnsType } from '../types/table.type';
|
|
43
|
-
import { DtIcon } from '../../../icons/index'
|
|
44
|
-
import { isBoolean, isFunction, getPopupContainer as getParentContainer } from '@dt-frames/core';
|
|
45
|
-
|
|
46
|
-
const props = defineProps({
|
|
47
|
-
fixed: {
|
|
48
|
-
type: String as PropType<boolean | 'left' | 'right' | undefined>,
|
|
49
|
-
default: 'right'
|
|
50
|
-
},
|
|
51
|
-
title: {
|
|
52
|
-
type: String
|
|
53
|
-
},
|
|
54
|
-
expand: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false
|
|
57
|
-
},
|
|
58
|
-
width: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: '70px'
|
|
61
|
-
},
|
|
62
|
-
btns: {
|
|
63
|
-
type: Array as PropType<BtnsType[]>,
|
|
64
|
-
default: []
|
|
65
|
-
},
|
|
66
|
-
flag: {
|
|
67
|
-
type: String as PropType<'ACTION'>
|
|
68
|
-
},
|
|
69
|
-
record: {
|
|
70
|
-
default: { }
|
|
71
|
-
},
|
|
72
|
-
index: {
|
|
73
|
-
type: Number
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
watch(
|
|
78
|
-
() => props.btns,
|
|
79
|
-
(btns) => {
|
|
80
|
-
btns.map( it => {
|
|
81
|
-
it.ifShow = isBoolean( it.ifShow )
|
|
82
|
-
? it.ifShow
|
|
83
|
-
: isFunction( it.ifShow )
|
|
84
|
-
? it.ifShow( props.record )
|
|
85
|
-
: true
|
|
86
|
-
} )
|
|
87
|
-
},{
|
|
88
|
-
immediate: true
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
function handleAction(it: BtnsType) {
|
|
93
|
-
if( isFunction( it.action ) ) {
|
|
94
|
-
it.action({
|
|
95
|
-
row: props.record,
|
|
96
|
-
index: props.index
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const attrs = useAttrs()
|
|
102
|
-
function getPopupContainer() {
|
|
103
|
-
return isFunction(attrs.getPopupContainer)
|
|
104
|
-
? attrs.getPopupContainer()
|
|
105
|
-
: getParentContainer();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
</script>
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="dt-table-header">
|
|
3
|
-
<div class="dt-table-header-actions">
|
|
4
|
-
<div class="dt-table-header-actions__left">
|
|
5
|
-
<FormButtons
|
|
6
|
-
v-bind="getActionsProps"
|
|
7
|
-
@handle-method="handleMethod"
|
|
8
|
-
></FormButtons>
|
|
9
|
-
<slot name="toolbar"></slot>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="dt-table-header-actions__right" v-if="tableTools">
|
|
13
|
-
<TableSettinCom
|
|
14
|
-
:setting="tableTools"
|
|
15
|
-
@columns-change="handleColumnChange"
|
|
16
|
-
></TableSettinCom>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div v-if="$slots.headerTop" style="margin: 5px">
|
|
21
|
-
<slot name="headerTop"></slot>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<script lang="ts">
|
|
27
|
-
import { defineComponent, PropType } from "vue"
|
|
28
|
-
import { Button } from 'ant-design-vue'
|
|
29
|
-
import type { BtnsType, ColumnChangeParam, TableSetting } from "../types/table.type"
|
|
30
|
-
import TableSettinCom from './setting/index.vue'
|
|
31
|
-
import { DtIcon } from '../../../icons/index'
|
|
32
|
-
import { FormButtons } from "../../../forms"
|
|
33
|
-
import { isFunction } from "@dt-frames/core"
|
|
34
|
-
|
|
35
|
-
export default defineComponent({
|
|
36
|
-
name: 'table-header',
|
|
37
|
-
components: {
|
|
38
|
-
TableSettinCom,
|
|
39
|
-
Button,
|
|
40
|
-
DtIcon,
|
|
41
|
-
FormButtons
|
|
42
|
-
},
|
|
43
|
-
props: {
|
|
44
|
-
tableTools: {
|
|
45
|
-
type: [Object, Boolean] as PropType<TableSetting | boolean>
|
|
46
|
-
},
|
|
47
|
-
toolbar: {
|
|
48
|
-
type: Array as PropType<BtnsType[]>,
|
|
49
|
-
default: []
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
emits: ['columns-change'],
|
|
53
|
-
setup(props, { emit }) {
|
|
54
|
-
function handleColumnChange(data: ColumnChangeParam[]) {
|
|
55
|
-
emit('columns-change', data);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function handleMethod( e ) {
|
|
59
|
-
if( isFunction(e.onClick) ) {
|
|
60
|
-
e.onClick()
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const getActionsProps = {
|
|
65
|
-
mode: null,
|
|
66
|
-
showAdvancedButton: false,
|
|
67
|
-
show: true,
|
|
68
|
-
buttonList: props.toolbar
|
|
69
|
-
} as any
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
getActionsProps,
|
|
73
|
-
handleColumnChange,
|
|
74
|
-
handleMethod
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
</script>
|