提交 62acacca 作者: 18928357778

改-跳转搜索条件

上级 918b9bdf
import request, { Response } from '~/api/request'; import request, { Response } from "~/api/request";
export interface FilterOptionResp { export interface FilterOptionResp {
id: number, id: number;
name: string name?: string;
appName?: string;
} }
export interface RegionResp { export interface RegionResp {
"childInfo": RegionResp[] | null, childInfo: RegionResp[] | null;
"id": number, id: number;
"level": number, level: number;
"name": string, name: string;
"pid": number pid: number;
} }
export default { export default {
category: (): Promise<Response<Array<FilterOptionResp>>> => { category: (): Promise<Response<Array<FilterOptionResp>>> => {
return request('/pms/webProductMall/category'); return request("/pms/webProductMall/category");
}, },
brand: (): Promise<Response<Array<FilterOptionResp>>> => { brand: (): Promise<Response<Array<FilterOptionResp>>> => {
return request('/pms/webDevice/brand'); return request("/pms/webDevice/brand");
}, },
model: (): Promise<Response<Array<FilterOptionResp>>> => { model: (): Promise<Response<Array<FilterOptionResp>>> => {
return request('/pms/webDevice/model'); return request("/pms/webDevice/model");
}, },
part: (): Promise<Response<Array<FilterOptionResp>>> => { part: (): Promise<Response<Array<FilterOptionResp>>> => {
return request('/pms/webProductMall/parts'); return request("/pms/webProductMall/parts");
}, },
quality: (): Promise<Response<Array<FilterOptionResp>>> => { quality: (): Promise<Response<Array<FilterOptionResp>>> => {
return request('/pms/webProductMall/quality'); return request("/pms/webProductMall/quality");
}, },
region: (): Promise<Response<Array<RegionResp>>> => { region: (): Promise<Response<Array<RegionResp>>> => {
return request('/pms/webDevice/getSecondDistrictInfo'); return request("/pms/webDevice/getSecondDistrictInfo");
}, },
industry: (): Promise<Response<Array<RegionResp>>> => { industry: (): Promise<Response<Array<RegionResp>>> => {
return request('/release/work/listAllIndustry'); return request("/release/work/listAllIndustry");
}, },
appType: (): Promise<Response<Array<RegionResp>>> => { appType: (): Promise<Response<Array<RegionResp>>> => {
return request('/release/work/listAllAppType'); return request("/release/work/listAllAppType");
}, },
deviceBrand: (): Promise<Response<Array<RegionResp>>> => { deviceBrand: (): Promise<Response<Array<RegionResp>>> => {
return request('/pms/webDevice/deviceBrand'); return request("/pms/webDevice/deviceBrand");
}, },
deviceModel: (): Promise<Response<Array<RegionResp>>> => { deviceModel: (): Promise<Response<Array<RegionResp>>> => {
return request('/pms/webDevice/deviceModel'); return request("/pms/webDevice/deviceModel");
}, },
} };
\ No newline at end of file
import { Space, Button, Select, Collapse } from 'antd'; import { Space, Button, Select, Collapse } from "antd";
import styles from '../../index.module.scss'; import styles from "../../index.module.scss";
import api, { FilterOptionResp } from "../../api"; import api, { FilterOptionResp } from "../../api";
import { useState, useEffect } from 'react'; import { useState, useEffect } from "react";
type Props = { type Props = {
onChange: (id: FilterOptionResp) => void; onChange: (id: FilterOptionResp) => void;
...@@ -19,7 +19,7 @@ export default function CategoryItem(props: Props) { ...@@ -19,7 +19,7 @@ export default function CategoryItem(props: Props) {
const onClick = (item: FilterOptionResp) => { const onClick = (item: FilterOptionResp) => {
props.onChange({ props.onChange({
id: item.id, id: item.id,
name: "应用:" + item.name, appName: "应用:" + item.appName,
}); });
}; };
...@@ -42,7 +42,7 @@ export default function CategoryItem(props: Props) { ...@@ -42,7 +42,7 @@ export default function CategoryItem(props: Props) {
key={item.id} key={item.id}
onClick={(e) => onClick(item)} onClick={(e) => onClick(item)}
> >
{item.name} {item.appName}
</Button> </Button>
); );
})} })}
...@@ -58,7 +58,7 @@ export default function CategoryItem(props: Props) { ...@@ -58,7 +58,7 @@ export default function CategoryItem(props: Props) {
key={item.id} key={item.id}
onClick={(e) => onClick(item)} onClick={(e) => onClick(item)}
> >
{item.name} {item.appName}
</Button> </Button>
); );
})} })}
...@@ -68,4 +68,4 @@ export default function CategoryItem(props: Props) { ...@@ -68,4 +68,4 @@ export default function CategoryItem(props: Props) {
</div> </div>
</div> </div>
); );
} }
\ No newline at end of file
...@@ -10,6 +10,9 @@ const nextConfig = { ...@@ -10,6 +10,9 @@ const nextConfig = {
distDir, distDir,
reactStrictMode: true, reactStrictMode: true,
transpilePackages: ["antd"], transpilePackages: ["antd"],
compiler: {
styledComponents: true,
},
redirects() { redirects() {
return [ return [
{ {
......
...@@ -96,11 +96,15 @@ export default function FlyingHandService() { ...@@ -96,11 +96,15 @@ export default function FlyingHandService() {
//端口列表请求 //端口列表请求
useEffect(() => { useEffect(() => {
let queryVal = JSON.parse(JSON.stringify(router.query));
for (const key in queryVal) {
queryVal[key] = Number(queryVal[key]);
}
api api
.listPageJobServicesInfo({ .listPageJobServicesInfo({
...pageParams, ...pageParams,
...filterParams, ...filterParams,
...router.query, ...queryVal,
}) })
.then((res) => { .then((res) => {
setProductList( setProductList(
...@@ -141,7 +145,7 @@ export default function FlyingHandService() { ...@@ -141,7 +145,7 @@ export default function FlyingHandService() {
useEffect(() => { useEffect(() => {
setRightDomList( setRightDomList(
list.map((item) => { list.map((item: string) => {
return { element: rightDom(item) }; return { element: rightDom(item) };
}) })
); );
...@@ -156,10 +160,14 @@ export default function FlyingHandService() { ...@@ -156,10 +160,14 @@ export default function FlyingHandService() {
useEffect(() => { useEffect(() => {
if (Object.keys(router.query).length) { if (Object.keys(router.query).length) {
let queryVal = JSON.parse(JSON.stringify(router.query));
for (const key in queryVal) {
queryVal[key] = Number(queryVal[key]);
}
setFilterParams((props) => { setFilterParams((props) => {
return { return {
...props, ...props,
...router.query, ...queryVal,
}; };
}); });
} }
...@@ -171,15 +179,6 @@ export default function FlyingHandService() { ...@@ -171,15 +179,6 @@ export default function FlyingHandService() {
<div className="flyingTop"> <div className="flyingTop">
<div className="flyingTop-left"> <div className="flyingTop-left">
<Space> <Space>
{/* <Select
className='selectItem'
bordered={false}
popupMatchSelectWidth={false}
placeholder="区域"
size="large"
onChange={onProvinceChange}
options={secondDistrictInfo}
/> */}
<Cascader <Cascader
allowClear allowClear
placeholder="地域" placeholder="地域"
......
...@@ -122,7 +122,7 @@ export default function WaterfallFlowBody() { ...@@ -122,7 +122,7 @@ export default function WaterfallFlowBody() {
const { deviceCategory, deviceBrand, deviceModel } = equipmentLeasingApi; const { deviceCategory, deviceBrand, deviceModel } = equipmentLeasingApi;
const eqApiTypeList = ["categoryId", "brandId", "modelId"]; const eqApiTypeList = ["categoryId", "brandId", "modelId"];
const { listAllAppType, listAllIndustry } = jobServicesApi; const { listAllIndustry, listAllAppType } = jobServicesApi;
const jobApiTypeList = ["industryId", "appTypeId"]; const jobApiTypeList = ["industryId", "appTypeId"];
const { listAllCategory, listAllParts, listAllQuality } = mallApi; const { listAllCategory, listAllParts, listAllQuality } = mallApi;
...@@ -151,7 +151,7 @@ export default function WaterfallFlowBody() { ...@@ -151,7 +151,7 @@ export default function WaterfallFlowBody() {
deviceBrand(), deviceBrand(),
deviceModel(), deviceModel(),
]); ]);
let res2 = await Promise.all([listAllAppType(), listAllIndustry()]); let res2 = await Promise.all([listAllIndustry(), listAllAppType()]);
let res3 = await Promise.all([ let res3 = await Promise.all([
listAllCategory(), listAllCategory(),
listAllParts(), listAllParts(),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论