diff --git a/src/components/hooks/useTable/index.jsx b/src/components/hooks/useTable/index.jsx
index 37dfbc4f..44ee698d 100644
--- a/src/components/hooks/useTable/index.jsx
+++ b/src/components/hooks/useTable/index.jsx
@@ -27,7 +27,7 @@ const useTable = (props) => {
}
dataInterface({
...(isPagination ? { pageNum: page, pageSize } : {}),
- ...other,
+ ...other
}).then((resp) => {
if (resp && resp.status === 1) {
setPage(page)
@@ -73,7 +73,7 @@ const useTable = (props) => {
setCachePayload({ ...payload })
getTableList(dataInterface || props.dataInterface, {
...cachePayload,
- ...payload,
+ ...payload
})
}
@@ -101,16 +101,16 @@ const useTable = (props) => {
showQuickJumper: true,
showSizeChanger: true,
hideOnSinglePage: false,
- showTotal: (total) => {`共计 ${total} 条记录 第${page}/${Math.ceil(total / pageSize)}页`},
+ showTotal: (total) => {`共计 ${total} 条记录 第${page}/${Math.ceil(total / pageSize)}页`}
}
: false,
- scroll: dataSource.length ? { scrollToFirstRowOnChange: true, x: 'max-content' } : false,
+ scroll: dataSource.length ? { scrollToFirstRowOnChange: true, x: 'max-content' } : false
},
page,
pageSize,
rawData,
updateTable,
- resetTable,
+ resetTable
}
}
export default useTable
diff --git a/src/components/stateful/CheckableTags/index.jsx b/src/components/stateful/CheckableTags/index.jsx
index fb852aaf..00227731 100644
--- a/src/components/stateful/CheckableTags/index.jsx
+++ b/src/components/stateful/CheckableTags/index.jsx
@@ -27,7 +27,7 @@ const CheckableTags = forwardRef((props, ref) => {
useImperativeHandle(ref, () => ({
setSelectedTags,
- handleChange,
+ handleChange
}))
return (
diff --git a/src/components/stateful/TreeList/index.jsx b/src/components/stateful/TreeList/index.jsx
index b9fa72c9..df83fca6 100644
--- a/src/components/stateful/TreeList/index.jsx
+++ b/src/components/stateful/TreeList/index.jsx
@@ -13,7 +13,7 @@ const Index = forwardRef((props, ref) => {
selectedKeys, // 选中的节点
setSelectedKeys, // 选中外传函数
selectable = false, // 父级节点是否可以选中
- params = {}, // 额外的参数
+ params = {} // 额外的参数
} = props
const [treeList, setTreeList] = useState([]) // 全量数据源列表
const [treeData, setTreeData] = useState([])
@@ -87,7 +87,7 @@ const Index = forwardRef((props, ref) => {
return {
...item,
key: itemPath,
- ...(item.children?.length ? { children: setPath(item.children, itemPath) } : {}),
+ ...(item.children?.length ? { children: setPath(item.children, itemPath) } : {})
}
})
treeData = setPath(treeData)
@@ -123,7 +123,7 @@ const Index = forwardRef((props, ref) => {
const defaultKey = selectable
? {
selected: [treeData[0].key],
- expanded: [treeData[0].key],
+ expanded: [treeData[0].key]
}
: getDefaultKey(treeData)
selected = defaultKey.selected
@@ -133,7 +133,7 @@ const Index = forwardRef((props, ref) => {
const defaultKey = selectable
? {
selected: [treeData[0].key],
- expanded: [treeData[0].key],
+ expanded: [treeData[0].key]
}
: getDefaultKey(treeData)
selected = defaultKey.selected
@@ -159,7 +159,7 @@ const Index = forwardRef((props, ref) => {
})
selected = selectedKeys
- function loop(params) {
+ function loop (params) {
return params.some((item) => {
if (item.realId === selectedKeys[0]) {
expanded = [item.key]
@@ -176,7 +176,7 @@ const Index = forwardRef((props, ref) => {
const defaultKey = selectable
? {
selected: [treeData[0].key],
- expanded: [treeData[0].key],
+ expanded: [treeData[0].key]
}
: getDefaultKey(treeData)
selected = defaultKey.selected
@@ -214,14 +214,14 @@ const Index = forwardRef((props, ref) => {
expandedKeys,
setExpandedKeys,
setSelectedKeys: _setSelectedKeys,
- treeData,
+ treeData
}))
return (
{search && (
-
+
)}
{
if (item.children && item.children.length) {
return forFn(item.children, item.key)
@@ -19,14 +19,14 @@ export function getDefaultKey(treeData) {
return { selected, expanded }
}
-export function processTreeData(list, pid) {
+export function processTreeData (list, pid) {
return list
.filter((item) => item.pid === pid)
.map((item) => ({
pid,
key: item.id,
title: item.name,
- children: processTreeData(list, item.id),
+ children: processTreeData(list, item.id)
}))
}
@@ -38,16 +38,16 @@ export const loopTreeData = (data) =>
title,
key: item.key,
pid: item.pid,
- children: loopTreeData(item.children),
+ children: loopTreeData(item.children)
}
}
return {
title,
key: item.key,
- pid: item.pid,
+ pid: item.pid
}
})
-export function expandTree(a, b, setExpandedKeys) {
+export function expandTree (a, b, setExpandedKeys) {
if (b.expanded) {
if (a.length > 0) {
a.splice(0, a.length - 1)
@@ -77,27 +77,29 @@ export const loopTreeDataWithSearch = (data, searchValue) =>
const beforeStr = item.title.substr(0, index)
const afterStr = item.title.substr(index + searchValue.length)
const title =
- index > -1 ? (
-
- {beforeStr} {searchValue} {afterStr}
-
- ) : (
- {item.title}
- )
+ index > -1
+ ? (
+
+ {beforeStr} {searchValue} {afterStr}
+
+ )
+ : (
+ {item.title}
+ )
if (item.children) {
return {
title,
key: item.key,
pid: item.pid,
// selectable: item.flag,
- children: loopTreeDataWithSearch(item.children, searchValue),
+ children: loopTreeDataWithSearch(item.children, searchValue)
}
}
return {
title,
// selectable: item.flag,
key: item.key,
- pid: item.pid,
+ pid: item.pid
}
})
export const getParentKey = (key, tree) => {