提交 0416414f 作者: 翁进城

Merge remote-tracking branch 'origin/caoyun'

...@@ -29,16 +29,29 @@ export interface ListPageFlyingInfoResp { ...@@ -29,16 +29,29 @@ export interface ListPageFlyingInfoResp {
export interface SkillsType { export interface SkillsType {
type: string; type: string;
id: 1, id: number,
skillsName: string skillsName: string,
label:string | number,
value:string | number
} }
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 interface PilotRegistrationParams {
city?: number,
drivingLicense?: number,
industryAppAuth?: Array<number>,
province?: number,
remark?: string,
telephone?: string,
uavLicenseLevelOne?: number,
uavLicenseLevelTwo?: number
} }
export default { export default {
...@@ -55,4 +68,7 @@ export default { ...@@ -55,4 +68,7 @@ export default {
IndustryFlightSkills: (): Promise<Response<Array<SkillsType>>> => { IndustryFlightSkills: (): Promise<Response<Array<SkillsType>>> => {
return request('/release/curriculum/getIndustryFlightSkills'); return request('/release/curriculum/getIndustryFlightSkills');
}, },
PilotRegistrations: (params:PilotRegistrationParams): Promise<Response<Array<SkillsType>>> => {
return request('/release/curriculum/pilotRegistration',"post",params);
},
} }
\ No newline at end of file
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { Box } from "./styled"; import { Box } from "./styled";
import Image from "next/image"; import Image from "next/image";
import { Button, Select, Space, Pagination, Cascader, Modal } from "antd"; import { Button, Select, Space, Pagination, Cascader, Modal , Form ,Input,Checkbox, message} from "antd";
import type { CheckboxValueType } from 'antd/es/checkbox/Group';
import Layout from "~/components/layout"; import Layout from "~/components/layout";
import ContentBox from "~/components/contentBox"; import ContentBox from "~/components/contentBox";
import api, { Flying, SkillsType, RegionResp } from "./api"; import api, { Flying, SkillsType, RegionResp } from "./api";
...@@ -13,6 +14,7 @@ interface FilterInfoParams { ...@@ -13,6 +14,7 @@ interface FilterInfoParams {
} }
export default function FlyingHandService() { export default function FlyingHandService() {
const {Option} = Select
const router = useRouter(); const router = useRouter();
const [list, setList] = useState([ const [list, setList] = useState([
"https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/925072db-5872-44dd-8b71-e408ad3adf41.jpg", "https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/925072db-5872-44dd-8b71-e408ad3adf41.jpg",
...@@ -163,7 +165,12 @@ export default function FlyingHandService() { ...@@ -163,7 +165,12 @@ export default function FlyingHandService() {
setSkills(res.result || []); setSkills(res.result || []);
}); });
api.IndustryFlightSkills().then((res) => { api.IndustryFlightSkills().then((res) => {
setFlightSkillsList(res.result || []); const list = res.result?.map((item)=>{
item.label = item.skillsName
item.value = item.id
return item
})
setFlightSkillsList(list || []);
}); });
}, []); }, []);
...@@ -185,18 +192,29 @@ export default function FlyingHandService() { ...@@ -185,18 +192,29 @@ export default function FlyingHandService() {
//报名 //报名
const [isModalOpen, setIsModalOpen] = useState(false); const [isModalOpen, setIsModalOpen] = useState(false);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const handleOk = () => { const handleOk = async (values: any) => {
const value = form.getFieldsValue()
setLoading(true); setLoading(true);
setTimeout(() => { try{
const res = await api.PilotRegistrations(value)
setLoading(false); setLoading(false);
setIsModalOpen(false); setIsModalOpen(false);
}, 3000); form.resetFields()
message.success('报名成功')
}catch(e:any){
message.error(e.message)
}
}; };
const handleCancel = () => { const handleCancel = () => {
setIsModalOpen(false); setIsModalOpen(false);
}; };
const [form] = Form.useForm();
const onChangeCheck = (checkedValues: CheckboxValueType[]) => {
console.log('checked = ', checkedValues);
};
return ( return (
<Layout> <Layout>
<Box> <Box>
...@@ -272,7 +290,7 @@ export default function FlyingHandService() { ...@@ -272,7 +290,7 @@ export default function FlyingHandService() {
getContainer={false} getContainer={false}
footer={[ footer={[
<Button <Button
style={{ width: "100%" }} style={{ width: "100%" ,background: "linear-gradient(135deg, #278EFF 0%, #0052DA 100%)",height: 40 }}
key="submit" key="submit"
type="primary" type="primary"
loading={loading} loading={loading}
...@@ -282,9 +300,79 @@ export default function FlyingHandService() { ...@@ -282,9 +300,79 @@ export default function FlyingHandService() {
</Button>, </Button>,
]} ]}
> >
<p>Some contents...</p> <Form
<p>Some contents...</p> form={form}
<p>Some contents...</p> layout="vertical"
name="application"
initialValues={{ modifier: 'public' }}
>
<div style={{display:"flex",justifyContent:"space-between"}}>
<Form.Item style={{flex:1,marginRight:16}}
name="name"
rules={[{ required: true, message: 'Please input the title of collection!' }]}
>
<Input placeholder="姓名" />
</Form.Item>
<Form.Item style={{flex:1}} name="telephone">
<Input placeholder="手机号" />
</Form.Item>
</div>
<Form.Item
name="city"
rules={[{ required: true, message: 'Please select gender!' }]}
>
<Cascader
allowClear
placeholder="地域"
className="selectItem"
size="large"
fieldNames={{
label: "name",
value: "id",
children: "childInfo",
}}
options={secondDistrictInfo}
changeOnSelect
/>
</Form.Item>
<Form.Item
name="drivingLicense"
rules={[{ required: true, message: 'Please select gender!' }]}
>
<Select placeholder="是否有驾照">
<Option value="0"></Option>
<Option value="1"></Option>
</Select>
</Form.Item>
<Form.Item
name="uavLicenseLevelOne"
rules={[{ required: true, message: 'Please select gender!' }]}
>
<Cascader
allowClear
placeholder="是否有无人机执照"
className="selectItem"
size="large"
fieldNames={{
label: "licenseType",
value: "id",
children: "childLicenses",
}}
options={skills}
changeOnSelect
/>
</Form.Item>
<Form.Item name="industryAppAuth" label="行业应用认证(多选)" className="collection-create-form_last-form-item">
<Checkbox.Group
options={flightSkillsList}
onChange={onChangeCheck}
/>
</Form.Item>
<Form.Item name="remark">
<Input placeholder="备注" />
</Form.Item>
</Form>
</Modal> </Modal>
<ContentBox <ContentBox
......
import request, { Response } from "~/api/request"; import request, { Response } from "~/api/request";
export interface PositioningInfoParams { export interface PositioningInfoParams {
lat: number; lat?: number;
lon: number; lon?: number;
pageNo?:number,
pageSize?:number
} }
export interface Entiy { export interface Entiy {
...@@ -19,11 +21,46 @@ export interface ListPageJobInfoResp { ...@@ -19,11 +21,46 @@ export interface ListPageJobInfoResp {
locationList: Array<Entiy>; locationList: Array<Entiy>;
} }
export interface FlyerBitmapEntiy {
flyerName: string,
phoneNum: string,
lon: number,
lat: number,
distance: number
}
export interface UavBitmapEntiy {
uavName: string,
online: number,
lon: number,
lat: number,
distance: number,
id: string
}
export interface BitmapInfo<T> {
pageNo: number,
pageSize: number,
list: T[],
totalCount: number,
totalPage: number
}
export default { export default {
//web-作业服务-分页 //web-首页-地图-全国点位
listPositioningInfo: ( listPositioningInfo: (
params: PositioningInfoParams params: PositioningInfoParams
): Promise<Response<ListPageJobInfoResp[]>> => { ): Promise<Response<ListPageJobInfoResp[]>> => {
return request("/release/website/getWebsiteList", "get", params); return request("/release/website/getWebsiteList", "get", params);
}, },
//web-首页-地图-全国飞手
listFlyerBitmap: (
params: PositioningInfoParams
): Promise<Response<BitmapInfo<FlyerBitmapEntiy>>> => {
return request("/release/website/flyer/bitmap", "get", params);
},
//web-首页-地图-全国无人机
listUavBitmap: (
params: PositioningInfoParams
): Promise<Response<BitmapInfo<UavBitmapEntiy>>> => {
return request("/release/website/uav/bitmap", "get", params);
},
}; };
...@@ -129,8 +129,6 @@ export default function WaterfallFlowBody() { ...@@ -129,8 +129,6 @@ export default function WaterfallFlowBody() {
index: number, index: number,
option: [] option: []
) => { ) => {
console.log("跳转",value,index,option);
const [item] = option.filter((item: any) => item.name === value.value); const [item] = option.filter((item: any) => item.name === value.value);
routerPath(index, item); routerPath(index, item);
}; };
...@@ -156,37 +154,49 @@ export default function WaterfallFlowBody() { ...@@ -156,37 +154,49 @@ export default function WaterfallFlowBody() {
const resValuelist1 = res1 const resValuelist1 = res1
.map((item, index) => { .map((item, index) => {
if (item.code === "200") {
return item.result?.map((it) => { return item.result?.map((it) => {
it.type = eqApiTypeList[index]; it.type = eqApiTypeList[index];
return it; return it;
}); });
}
return {}
}) })
.flat(); .flat();
const resValuelist2 = res2 const resValuelist2 = res2
.map((item, index) => { .map((item, index) => {
if (item.code === "200") {
return item.result?.map((it) => { return item.result?.map((it) => {
it.type = mallApiTypeList[index]; it.type = mallApiTypeList[index];
return it; return it;
}); });
}
return {}
}) })
.flat(); .flat();
const resValuelist3 = res3 const resValuelist3 = res3
.map((item, index) => { .map((item, index) => {
if (item.code === "200") {
return item.result?.map((it) => { return item.result?.map((it) => {
it.type = flightApiTypeList[index]; it.type = flightApiTypeList[index];
it.name = it.name || it.skillsName || it.licenseType; it.name = it.name || it.skillsName || it.licenseType;
return it; return it;
}); });
}
return {}
}) })
.flat(); .flat();
const resValuelist4 = res4 const resValuelist4 = res4
.map((item, index) => { .map((item, index) => {
if (item.code === "200") {
return item.result?.map((it) => { return item.result?.map((it) => {
it.type = jobApiTypeList[index]; it.type = jobApiTypeList[index];
console.log(it);
it.name = it.name || it.appName; it.name = it.name || it.appName;
return it; return it;
}); });
}
return {}
}) })
.flat(); .flat();
...@@ -222,7 +232,6 @@ export default function WaterfallFlowBody() { ...@@ -222,7 +232,6 @@ export default function WaterfallFlowBody() {
resValuelist4, resValuelist4,
list2Option, list2Option,
]; ];
console.log(optionList);
setLeftDomList( setLeftDomList(
columns.map((item, index) => { columns.map((item, index) => {
...@@ -333,6 +342,7 @@ export default function WaterfallFlowBody() { ...@@ -333,6 +342,7 @@ export default function WaterfallFlowBody() {
}; };
const rightDom = (list: Array<NewsPageType>) => { const rightDom = (list: Array<NewsPageType>) => {
if(!list?.length) return;
return ( return (
<div key={1009} className="right-box-item right-item"> <div key={1009} className="right-box-item right-item">
<div className="title"> <div className="title">
...@@ -364,6 +374,7 @@ export default function WaterfallFlowBody() { ...@@ -364,6 +374,7 @@ export default function WaterfallFlowBody() {
}; };
const rightDom2 = (list: Array<NewsTenderType>) => { const rightDom2 = (list: Array<NewsTenderType>) => {
if(!list.length) return;
return ( return (
<div key={1008} className="right-box-item right-item-second"> <div key={1008} className="right-box-item right-item-second">
<div className="item-box"> <div className="item-box">
......
...@@ -102,6 +102,7 @@ export const Box = styled.div` ...@@ -102,6 +102,7 @@ export const Box = styled.div`
} }
} }
.right-item { .right-item {
background-color: #fff;
border-radius: 6px; border-radius: 6px;
.title { .title {
display: flex; display: flex;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论