Merge branch 'master' of http://192.168.11.14:51037/zhangtao/restructure
This commit is contained in:
commit
27310d0324
|
|
@ -12,6 +12,14 @@ export const tableProps = {
|
|||
type: [Object, Boolean],
|
||||
default: () => {}
|
||||
},
|
||||
/* 数据格式 */
|
||||
dataType: {
|
||||
type: String,
|
||||
default: 'flat',
|
||||
validator: (value) => {
|
||||
return ['flat', 'tree'].indexOf(value) !== -1
|
||||
}
|
||||
},
|
||||
/* 分页设置信息 */
|
||||
paginationSetting: {
|
||||
type: Object,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export function useDataSource(propsRef, { getPaginationInfo, setPagination, setL
|
|||
try {
|
||||
/* 设置loading */
|
||||
setLoading(true)
|
||||
const { request, pagination, paginationSetting } = unref(propsRef)
|
||||
const { request, pagination, paginationSetting, dataType } = unref(propsRef)
|
||||
/* 无接口请求中断 */
|
||||
if (!request) return
|
||||
/* 获取分页信息 */
|
||||
|
|
@ -43,7 +43,7 @@ export function useDataSource(propsRef, { getPaginationInfo, setPagination, setL
|
|||
}
|
||||
}
|
||||
const resultInfo = res[listField] ? res[listField] : []
|
||||
dataSourceRef.value = resultInfo
|
||||
dataSourceRef.value = dataType === 'tree' ? dealTree(resultInfo) : resultInfo
|
||||
setPagination({
|
||||
[pageField]: currentPage,
|
||||
[totalField]: Math.ceil(resultTotal / pageSize)
|
||||
|
|
@ -67,6 +67,11 @@ export function useDataSource(propsRef, { getPaginationInfo, setPagination, setL
|
|||
}
|
||||
}
|
||||
|
||||
function dealTree() {
|
||||
const tree = []
|
||||
return tree
|
||||
}
|
||||
|
||||
const getDataSourceRef = computed(() => {
|
||||
const dataSource = unref(dataSourceRef)
|
||||
if (!dataSource || dataSource.length === 0) {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ const props = defineProps({
|
|||
})
|
||||
|
||||
/* 白名单 */
|
||||
const whiteList = ['Login', 'NOT_FOUND']
|
||||
const whiteList = ['Login', 'Redirect', 'NOT_FOUND']
|
||||
/* 基础页面 */
|
||||
const baseMenu = '/home'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue