提交 958e3ada 作者: 翁进城

优化打包时eslint错误

上级 208ee747
...@@ -49,6 +49,25 @@ const BrandSelectSearch: React.FC<propType> = (props) => { ...@@ -49,6 +49,25 @@ const BrandSelectSearch: React.FC<propType> = (props) => {
if (!columns.some((i) => i.type === 'Alphabet')) return; if (!columns.some((i) => i.type === 'Alphabet')) return;
// 获取字母列表 // 获取字母列表
const options = columns.find((i) => i.type === 'Alphabet')?.options; const options = columns.find((i) => i.type === 'Alphabet')?.options;
var _options;
var temp = new Set(
(_options = options) === null || _options === void 0
? void 0
: _options.map(function (i) {
var _pinyin, _pinyin$at, _pinyin$at$at;
return (_pinyin = pinyin(i.label, {
toneType: "none",
type: "array",
})) === null || _pinyin === void 0
? void 0
: (_pinyin$at = _pinyin.at(0)) === null || _pinyin$at === void 0
? void 0
: (_pinyin$at$at = _pinyin$at.at(0)) === null ||
_pinyin$at$at === void 0
? void 0
: _pinyin$at$at.toUpperCase();
})
);
// 获取开头字母列表(去重) // 获取开头字母列表(去重)
const arr = [ const arr = [
...new Set( ...new Set(
......
...@@ -18,7 +18,6 @@ export const Uploader: React.FC<PropsType> = (props) => { ...@@ -18,7 +18,6 @@ export const Uploader: React.FC<PropsType> = (props) => {
fileSize: 2, fileSize: 2,
fileLength: 1, fileLength: 1,
fileType: ['image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/bmp'], fileType: ['image/png', 'image/jpeg', 'image/jpg', 'image/gif', 'image/bmp'],
// eslint-disable-next-line @typescript-eslint/no-empty-function
onChange: () => {}, onChange: () => {},
onRemove: () => {}, onRemove: () => {},
}; };
......
import { useEffect } from "react"; /* import { useEffect } from "react";
import Router from "next/router"; import Router from "next/router";
import request from '~/api/request'; import request from '~/api/request';
import useSWR, { SWRResponse } from "swr"; import useSWR, { SWRResponse } from "swr"; */
/* /*
const fetcher = (url) => const fetcher = (url) =>
fetch(url) fetch(url)
...@@ -12,7 +12,7 @@ const fetcher = (url) => ...@@ -12,7 +12,7 @@ const fetcher = (url) =>
export function useUser({ redirectTo, redirectIfFound } = {}) { export function useUser({ redirectTo, redirectIfFound } = {}) {
return {}; return {};
const { data, error } = useSWR("/api/user", request); /* const { data, error } = useSWR("/api/user", request);
const user = data?.user; const user = data?.user;
const finished = Boolean(data); const finished = Boolean(data);
const hasUser = Boolean(user); const hasUser = Boolean(user);
...@@ -29,5 +29,5 @@ export function useUser({ redirectTo, redirectIfFound } = {}) { ...@@ -29,5 +29,5 @@ export function useUser({ redirectTo, redirectIfFound } = {}) {
} }
}, [redirectTo, redirectIfFound, finished, hasUser]); }, [redirectTo, redirectIfFound, finished, hasUser]);
return error ? null : user; return error ? null : user; */
} }
...@@ -10,7 +10,7 @@ const nextConfig = { ...@@ -10,7 +10,7 @@ const nextConfig = {
permanent: true, permanent: true,
}, },
]; ];
} },
}; };
module.exports = nextConfig; module.exports = nextConfig;
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
"next-connect": "^1.0.0", "next-connect": "^1.0.0",
"passport": "^0.6.0", "passport": "^0.6.0",
"passport-local": "^1.0.0", "passport-local": "^1.0.0",
"pinyin-pro": "^3.14.0",
"styled-components": "^6.0.0-rc.1", "styled-components": "^6.0.0-rc.1",
"swr": "^2.1.5", "swr": "^2.1.5",
"uuid": "^9.0.0" "uuid": "^9.0.0"
......
...@@ -18,21 +18,8 @@ type Props = { ...@@ -18,21 +18,8 @@ type Props = {
onCancel?: () => void; onCancel?: () => void;
}; };
export default function publishMessage(props: Props) { export default function PublishMessage(props: Props) {
const [confirmLoading, setConfirmLoading] = useState(false); const [confirmLoading, setConfirmLoading] = useState(false);
const handleOk = () => {
setConfirmLoading(true);
setTimeout(() => {
handleCancel();
setConfirmLoading(false);
}, 2000);
};
const handleCancel = () => {
props.onCancel && props.onCancel();
};
const [previewOpen, setPreviewOpen] = useState(false); const [previewOpen, setPreviewOpen] = useState(false);
const [previewImage, setPreviewImage] = useState(""); const [previewImage, setPreviewImage] = useState("");
const [previewTitle, setPreviewTitle] = useState(""); const [previewTitle, setPreviewTitle] = useState("");
...@@ -75,6 +62,18 @@ export default function publishMessage(props: Props) { ...@@ -75,6 +62,18 @@ export default function publishMessage(props: Props) {
}, },
]); ]);
const handleOk = () => {
setConfirmLoading(true);
setTimeout(() => {
handleCancel();
setConfirmLoading(false);
}, 2000);
};
const handleCancel = () => {
props.onCancel && props.onCancel();
};
const handlePreviewCancel = () => setPreviewOpen(false); const handlePreviewCancel = () => setPreviewOpen(false);
const handlePreview = async (file: UploadFile) => { const handlePreview = async (file: UploadFile) => {
......
...@@ -6,7 +6,7 @@ import { RightOutlined } from "@ant-design/icons"; ...@@ -6,7 +6,7 @@ import { RightOutlined } from "@ant-design/icons";
import { useState } from "react"; import { useState } from "react";
import PublishMessage from './components/publishMessage' import PublishMessage from './components/publishMessage'
export default function forum() { export default function Forum() {
const [isModalOpen, setIsModalOpen] = useState(false); const [isModalOpen, setIsModalOpen] = useState(false);
const showModal = () => { const showModal = () => {
setIsModalOpen(true); setIsModalOpen(true);
......
...@@ -10,8 +10,8 @@ export default function index() { ...@@ -10,8 +10,8 @@ export default function index() {
return ( return (
<Box> <Box>
{ {
list.map(item=>( list.map((item, i)=>(
<div className='item'> <div className='item' key={i}>
<div className='item-user'> <div className='item-user'>
<div className='item-user-image'> <div className='item-user-image'>
<Image className='image' height={42} width={42} src="" alt='#'/> <Image className='image' height={42} width={42} src="" alt='#'/>
......
...@@ -60,9 +60,10 @@ export default function Mall(props: Props) { ...@@ -60,9 +60,10 @@ export default function Mall(props: Props) {
<div className={styles.title}>四旋翼无人机</div> <div className={styles.title}>四旋翼无人机</div>
<div className={styles.main}> <div className={styles.main}>
<ul className={styles.listWrap}> <ul className={styles.listWrap}>
{productList.map((item) => { {productList.map((item, i) => {
return ( return (
<li <li
key={i}
className={styles.item} className={styles.item}
onClick={() => router.push("/mall/detail/1")} onClick={() => router.push("/mall/detail/1")}
> >
......
...@@ -55,7 +55,7 @@ const options: Option[] = [ ...@@ -55,7 +55,7 @@ const options: Option[] = [
}, },
]; ];
const onChange = (value: string[]) => { const onChange = (value: string) => {
console.log(value); console.log(value);
}; };
...@@ -65,12 +65,15 @@ const onDateChange: DatePickerProps["onChange"] = (date, dateString) => { ...@@ -65,12 +65,15 @@ const onDateChange: DatePickerProps["onChange"] = (date, dateString) => {
const operations = ( const operations = (
<Space size={8} style={{ marginRight: 25 }}> <Space size={8} style={{ marginRight: 25 }}>
<Cascader {
options={options} <Cascader
onChange={onChange} options={options}
placeholder="Please select" //@ts-ignore
borderRadiusSM={6} onChange={onChange}
/> placeholder="Please select"
borderRadiusSM={6}
/>
}
<DatePicker onChange={onDateChange} /> <DatePicker onChange={onDateChange} />
</Space> </Space>
); );
......
{ {
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"downlevelIteration": true,
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论