提交 958e3ada 作者: 翁进城

优化打包时eslint错误

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