fix(web): 清理 TypeScript any 类型(16→1)
- api/client.ts: AxiosRequestConfig 模块增强 + AxiosHeaders 替代 {} as any(消 8 处)
- api/health/points.ts: 移除 7 处 as any(由 AxiosRequestConfig 增强解决)
- hooks/usePaginatedData.ts: 提取 OptionsConfig 类型消除 4 处 as any
- pages/health/MediaLibrary.tsx: Tree 组件使用 TreeNode 接口替代 any(消 2 处)
- pages/health/articleEditor/ArticleEditor.tsx: 保留 1 处 any(wangEditor 限制)
This commit is contained in:
@@ -194,9 +194,9 @@ export default function MediaLibrary() {
|
||||
</div>
|
||||
<div style={{ flex: 1, overflow: 'auto', padding: '8px 4px' }}>
|
||||
{foldersLoading ? <div style={{ textAlign: 'center', padding: 20 }}><Spin size="small" /></div> : (
|
||||
<Tree defaultExpandAll selectedKeys={folderId ? [folderId] : ['__all__']} treeData={treeData as any}
|
||||
<Tree defaultExpandAll selectedKeys={folderId ? [folderId] : ['__all__']} treeData={treeData}
|
||||
fieldNames={{ title: 'name', key: 'id', children: 'children' }} onSelect={handleFolderSelect}
|
||||
titleRender={(node: any) => {
|
||||
titleRender={(node: TreeNode) => {
|
||||
if (node.id === '__all__') return <span>{node.name}</span>;
|
||||
const matched = folders.find((f) => f.id === node.id);
|
||||
return (
|
||||
|
||||
@@ -200,7 +200,8 @@ export default function ArticleEditor() {
|
||||
style: el.getAttribute('style') || '',
|
||||
innerHtml: el.innerHTML,
|
||||
children: [{ text: '' }],
|
||||
} as any); // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- wangEditor custom element type not in Slate types
|
||||
} as any);
|
||||
} else {
|
||||
editor.dangerouslyInsertHtml(html);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user