根据订单编号获取航线文件
修改订单状态逻辑,实现超时逻辑根据drone_flight状态更新任务状态,当主动点击已到达则直接修改订单状态
This commit is contained in:
@@ -94,6 +94,11 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.8.25</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
+1
-2
@@ -126,7 +126,6 @@ public class ApiDeviceController {
|
|||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
JsonObject jsonObject = gson.fromJson(controlMessageConstant.CONTROL_MESSAGE_MAP.get(control), JsonObject.class);
|
JsonObject jsonObject = gson.fromJson(controlMessageConstant.CONTROL_MESSAGE_MAP.get(control), JsonObject.class);
|
||||||
JsonObject data = jsonObject.getAsJsonObject("data");
|
JsonObject data = jsonObject.getAsJsonObject("data");
|
||||||
|
|
||||||
// 设置订单信息
|
// 设置订单信息
|
||||||
data.addProperty("order_no", orderNo);
|
data.addProperty("order_no", orderNo);
|
||||||
|
|
||||||
@@ -134,7 +133,7 @@ public class ApiDeviceController {
|
|||||||
Map<String, Object> wayResult = orderCenterService.getWaylineByOrderNo(orderNo);
|
Map<String, Object> wayResult = orderCenterService.getWaylineByOrderNo(orderNo);
|
||||||
String waylineFilePath = MapUtil.getStrValue(wayResult, "waylineFilePath");
|
String waylineFilePath = MapUtil.getStrValue(wayResult, "waylineFilePath");
|
||||||
String waylineId = MapUtil.getStrValue(wayResult, "waylineId");
|
String waylineId = MapUtil.getStrValue(wayResult, "waylineId");
|
||||||
|
log.info("waylineFilePath:{}, waylineId:{}", waylineFilePath, waylineId);
|
||||||
data.addProperty("wayline_link_url", waylineFilePath);
|
data.addProperty("wayline_link_url", waylineFilePath);
|
||||||
LineFile lineFile = lineFileService.findLineFileByWaylineId(waylineId);
|
LineFile lineFile = lineFileService.findLineFileByWaylineId(waylineId);
|
||||||
Assert.notNull(lineFile,"航线文件签名不正确");
|
Assert.notNull(lineFile,"航线文件签名不正确");
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ public class DeviceImportListener implements ReadListener<AgeDeviceExcel> {
|
|||||||
validateData(data);
|
validateData(data);
|
||||||
|
|
||||||
// 转换为实体
|
// 转换为实体
|
||||||
AgeDevice device = data.convertToDevice();
|
AgeDevice device = data.toDevice();
|
||||||
|
|
||||||
// 设置默认值
|
// 设置默认值
|
||||||
if (device.getCreateTime() == null) {
|
if (device.getCreateTime() == null) {
|
||||||
|
|||||||
+7
-4
@@ -11,7 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.collections4.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -68,15 +68,18 @@ public class AgeDeviceServiceImpl extends SuperServiceImpl<AgeDeviceMapper, AgeD
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean importDevices(List<AgeDevice> deviceList) {
|
public boolean importDevices(List<AgeDevice> deviceList) {
|
||||||
if (CollUtil.isEmpty(deviceList)) {
|
if (CollectionUtils.isEmpty(deviceList)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 批量保存,每批100条
|
// 批量保存,每批100条
|
||||||
int batchSize = 100;
|
int batchSize = 100;
|
||||||
List<List<AgeDevice>> partition = CollUtil.partition(deviceList, batchSize);
|
int totalSize = deviceList.size();
|
||||||
for (List<AgeDevice> batch : partition) {
|
|
||||||
|
for (int i = 0; i < totalSize; i += batchSize) {
|
||||||
|
int endIndex = Math.min(i + batchSize, totalSize);
|
||||||
|
List<AgeDevice> batch = deviceList.subList(i, endIndex);
|
||||||
this.saveBatch(batch, batchSize);
|
this.saveBatch(batch, batchSize);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+37
-4
@@ -5,28 +5,61 @@ import {
|
|||||||
ProFormText,
|
ProFormText,
|
||||||
ProFormTextArea,
|
ProFormTextArea,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import React from 'react';
|
import React, { useEffect } from 'react';
|
||||||
|
|
||||||
interface UpdateFormProps {
|
interface UpdateFormProps {
|
||||||
onSubmit: (values: DEVICE.Device) => Promise<boolean>;
|
onSubmit: (values: DEVICE.Device) => Promise<boolean>;
|
||||||
onVisibleChange: (visible: boolean) => void;
|
onVisibleChange: (visible: boolean) => void;
|
||||||
updateModalVisible: boolean;
|
updateModalVisible: boolean;
|
||||||
values?: DEVICE.Device;
|
values?: DEVICE.Device;
|
||||||
|
waylineOptions: any[];
|
||||||
|
tourismOptions: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
||||||
const { onSubmit, onVisibleChange, updateModalVisible, values } = props;
|
const {
|
||||||
|
onSubmit,
|
||||||
|
onVisibleChange,
|
||||||
|
updateModalVisible,
|
||||||
|
values,
|
||||||
|
waylineOptions,
|
||||||
|
tourismOptions,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('当前航线选项:', waylineOptions);
|
||||||
|
console.log('当前表单值:', values);
|
||||||
|
}, [waylineOptions, values]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalForm
|
<ModalForm
|
||||||
title="修改设备信息"
|
title="修改设备"
|
||||||
width="800px"
|
width="800px"
|
||||||
visible={updateModalVisible}
|
visible={updateModalVisible}
|
||||||
onVisibleChange={onVisibleChange}
|
onVisibleChange={onVisibleChange}
|
||||||
|
initialValues={{
|
||||||
|
...values,
|
||||||
|
waylineId: values?.waylineId?.toString(), // 确保 waylineId 是字符串
|
||||||
|
}}
|
||||||
onFinish={onSubmit}
|
onFinish={onSubmit}
|
||||||
initialValues={values}
|
modalProps={{
|
||||||
|
destroyOnClose: true,
|
||||||
|
forceRender: true,
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
|
<ProFormSelect
|
||||||
|
name="waylineId"
|
||||||
|
label="航线"
|
||||||
|
options={waylineOptions}
|
||||||
|
rules={[{ required: true, message: '请选择航线' }]}
|
||||||
|
fieldProps={{
|
||||||
|
showSearch: true,
|
||||||
|
loading: !waylineOptions?.length,
|
||||||
|
filterOption: (input, option) =>
|
||||||
|
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
disabled
|
disabled
|
||||||
width="md"
|
width="md"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
deleteDevice,
|
deleteDevice,
|
||||||
updateDeviceBoundStatus,
|
updateDeviceBoundStatus,
|
||||||
} from '@/services/device/api';
|
} from '@/services/device/api';
|
||||||
|
import { request } from 'umi';
|
||||||
import { PlusOutlined, ExportOutlined, ImportOutlined, DownloadOutlined } from '@ant-design/icons';
|
import { PlusOutlined, ExportOutlined, ImportOutlined, DownloadOutlined } from '@ant-design/icons';
|
||||||
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
import type { ActionType, ProColumns } from '@ant-design/pro-components';
|
||||||
import {
|
import {
|
||||||
@@ -18,9 +19,10 @@ import {
|
|||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { Button, message, Popconfirm, Typography, Space, Switch, Upload } from 'antd';
|
import { Button, message, Popconfirm, Typography, Space, Switch, Upload } from 'antd';
|
||||||
import type { RcFile } from 'antd/lib/upload';
|
import type { RcFile } from 'antd/lib/upload';
|
||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState, useCallback, useEffect } from 'react';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import UpdateForm from './components/UpdateForm';
|
import UpdateForm from './components/UpdateForm';
|
||||||
|
import { getToken } from '@/utils/authority';
|
||||||
|
|
||||||
const { Link } = Typography;
|
const { Link } = Typography;
|
||||||
|
|
||||||
@@ -44,9 +46,11 @@ const COMPATIBLE_STATUS = {
|
|||||||
const TableList: React.FC = () => {
|
const TableList: React.FC = () => {
|
||||||
const [searchParams, setSearchParams] = useState<Record<string, string | number>>({});
|
const [searchParams, setSearchParams] = useState<Record<string, string | number>>({});
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const [createModalVisible, setCreateModalVisible] = useState<boolean>(false);
|
const [createModalVisible, handleModalVisible] = useState<boolean>(false);
|
||||||
const [updateModalVisible, setUpdateModalVisible] = useState<boolean>(false);
|
const [updateModalVisible, handleUpdateModalVisible] = useState<boolean>(false);
|
||||||
const [currentRow, setCurrentRow] = useState<DEVICE.Device>();
|
const [currentRow, setCurrentRow] = useState<ORDERS.Qrcode>();
|
||||||
|
const [waylineOptions, setWaylineOptions] = useState<any[]>([]);
|
||||||
|
const [tourismOptions, setTourismOptions] = useState<any[]>([]);
|
||||||
|
|
||||||
// 统一的API请求处理函数
|
// 统一的API请求处理函数
|
||||||
const handleRequest = async (
|
const handleRequest = async (
|
||||||
@@ -83,40 +87,104 @@ const TableList: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 处理导出
|
// 获取认证token
|
||||||
const handleExport = async () => {
|
const getAuthHeader = () => {
|
||||||
const hide = message.loading('正在导出...');
|
// 从sessionStorage中获取token
|
||||||
try {
|
const token = sessionStorage.getItem('access_token') || localStorage.getItem('access_token');
|
||||||
const response = await fetch('/api-device/device/export', {
|
return token ? `Bearer ${token}` : '';
|
||||||
method: 'POST',
|
|
||||||
});
|
|
||||||
if (response.ok) {
|
|
||||||
const blob = await response.blob();
|
|
||||||
const url = window.URL.createObjectURL(blob);
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = url;
|
|
||||||
link.download = `设备信息_${moment().format('YYYY-MM-DD')}.xlsx`;
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
window.URL.revokeObjectURL(url);
|
|
||||||
message.success('导出成功');
|
|
||||||
} else {
|
|
||||||
throw new Error('导出失败');
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
message.error('导出失败');
|
|
||||||
} finally {
|
|
||||||
hide();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 下载模板
|
// 打印token信息用于调试
|
||||||
|
console.log('当前token:', {
|
||||||
|
sessionToken: sessionStorage.getItem('access_token'),
|
||||||
|
localToken: localStorage.getItem('access_token'),
|
||||||
|
authHeader: getAuthHeader()
|
||||||
|
});
|
||||||
|
|
||||||
|
// 修改导出处理函数
|
||||||
|
const handleExport = () => {
|
||||||
|
// 创建一个隐藏的表单
|
||||||
|
const form = document.createElement('form');
|
||||||
|
form.method = 'POST';
|
||||||
|
form.action = '/api-device/device/export';
|
||||||
|
form.style.display = 'none';
|
||||||
|
|
||||||
|
// 添加token到请求头
|
||||||
|
const token = sessionStorage.getItem('access_token');
|
||||||
|
if (token) {
|
||||||
|
const tokenInput = document.createElement('input');
|
||||||
|
tokenInput.type = 'hidden';
|
||||||
|
tokenInput.name = '_token'; // 添加一个隐藏字段携带token
|
||||||
|
tokenInput.value = token;
|
||||||
|
form.appendChild(tokenInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
document.body.removeChild(form);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 修改模板下载函数
|
||||||
const handleDownloadTemplate = () => {
|
const handleDownloadTemplate = () => {
|
||||||
|
// 直接通过链接下载模板
|
||||||
window.location.href = '/api-device/device/template';
|
window.location.href = '/api-device/device/template';
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns: ProColumns<DEVICE.Device>[] = [
|
// 重写获取航线数据的函数
|
||||||
|
const loadWaylineOptions = async () => {
|
||||||
|
try {
|
||||||
|
const result = await wayline({
|
||||||
|
current: 1,
|
||||||
|
pageSize: 999 // 获取更多数据
|
||||||
|
});
|
||||||
|
|
||||||
|
if (result?.data) {
|
||||||
|
const options = result.data.map((item: any) => ({
|
||||||
|
label: item.name || item.waylineId,
|
||||||
|
value: item.waylineId
|
||||||
|
}));
|
||||||
|
setWaylineOptions(options);
|
||||||
|
console.log('加载的航线选项:', options);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载航线失败:', error);
|
||||||
|
message.error('获取航线列表失败');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 组件挂载时加载数据
|
||||||
|
useEffect(() => {
|
||||||
|
loadWaylineOptions();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// 添加操作处理函数
|
||||||
|
const handleTableAction = async (
|
||||||
|
action: 'add' | 'edit' | 'delete',
|
||||||
|
record?: ORDERS.Qrcode,
|
||||||
|
values?: any
|
||||||
|
) => {
|
||||||
|
try {
|
||||||
|
if (action === 'add') {
|
||||||
|
await addDevice(values);
|
||||||
|
message.success('添加成功');
|
||||||
|
} else if (action === 'edit') {
|
||||||
|
await updateDevice({ ...values, id: record?.id });
|
||||||
|
message.success('修改成功');
|
||||||
|
} else if (action === 'delete') {
|
||||||
|
await deleteDevice({ id: record?.id });
|
||||||
|
message.success('删除成功');
|
||||||
|
}
|
||||||
|
actionRef.current?.reload();
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('操作失败:', error);
|
||||||
|
message.error('操作失败');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 修改列定义,确保操作列正确显示
|
||||||
|
const columns: ProColumns<ORDERS.Qrcode>[] = [
|
||||||
{
|
{
|
||||||
dataIndex: 'index',
|
dataIndex: 'index',
|
||||||
valueType: 'indexBorder',
|
valueType: 'indexBorder',
|
||||||
@@ -184,34 +252,29 @@ const TableList: React.FC = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
dataIndex: 'option',
|
||||||
render: (_, record) => (
|
valueType: 'option',
|
||||||
<Space>
|
render: (_, record) => [
|
||||||
<Link
|
<a
|
||||||
|
key="edit"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentRow(record);
|
setCurrentRow(record);
|
||||||
setUpdateModalVisible(true);
|
handleUpdateModalVisible(true);
|
||||||
|
// 立即加载航线数据
|
||||||
|
loadWaylineOptions();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
</Link>
|
</a>,
|
||||||
<Popconfirm
|
<a
|
||||||
title={`确认删除设备[${record.deviceSn}]?`}
|
key="delete"
|
||||||
onConfirm={async () => {
|
onClick={() => {
|
||||||
const success = await handleRequest(
|
handleTableAction('delete', record);
|
||||||
() => deleteDevice(record.deviceSn),
|
|
||||||
'正在删除',
|
|
||||||
'删除成功'
|
|
||||||
);
|
|
||||||
if (success && actionRef.current) {
|
|
||||||
actionRef.current.reload();
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link>删除</Link>
|
删除
|
||||||
</Popconfirm>
|
</a>,
|
||||||
</Space>
|
],
|
||||||
),
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -265,6 +328,21 @@ const TableList: React.FC = () => {
|
|||||||
label="设备描述"
|
label="设备描述"
|
||||||
placeholder="请输入设备描述"
|
placeholder="请输入设备描述"
|
||||||
/>
|
/>
|
||||||
|
<ProFormSelect
|
||||||
|
width="md"
|
||||||
|
name="waylineId"
|
||||||
|
label="航线"
|
||||||
|
placeholder="请选择航线"
|
||||||
|
options={waylineOptions}
|
||||||
|
rules={[{ required: true, message: '请选择航线' }]}
|
||||||
|
fieldProps={{
|
||||||
|
loading: !waylineOptions.length,
|
||||||
|
showSearch: true,
|
||||||
|
filterOption: (input, option) =>
|
||||||
|
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||||
|
notFoundContent: waylineOptions.length === 0 ? '暂无数据' : undefined,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -287,7 +365,7 @@ const TableList: React.FC = () => {
|
|||||||
/>
|
/>
|
||||||
<ProFormText name="searchValue" />
|
<ProFormText name="searchValue" />
|
||||||
</QueryFilter>
|
</QueryFilter>
|
||||||
<ProTable<DEVICE.Device>
|
<ProTable<ORDERS.Qrcode>
|
||||||
rowKey="deviceSn"
|
rowKey="deviceSn"
|
||||||
headerTitle="设备管理"
|
headerTitle="设备管理"
|
||||||
actionRef={actionRef}
|
actionRef={actionRef}
|
||||||
@@ -326,7 +404,6 @@ const TableList: React.FC = () => {
|
|||||||
if (info.file.status === 'done') {
|
if (info.file.status === 'done') {
|
||||||
if (info.file.response.resp_code === 0) {
|
if (info.file.response.resp_code === 0) {
|
||||||
message.success('导入成功');
|
message.success('导入成功');
|
||||||
// 刷新表格数据
|
|
||||||
actionRef.current?.reload();
|
actionRef.current?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error(info.file.response.resp_msg || '导入失败');
|
message.error(info.file.response.resp_msg || '导入失败');
|
||||||
@@ -343,50 +420,73 @@ const TableList: React.FC = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
key="add"
|
key="add"
|
||||||
onClick={() => setCreateModalVisible(true)}
|
onClick={() => {
|
||||||
|
handleModalVisible(true);
|
||||||
|
// 打开新增modal时加载航线数据
|
||||||
|
loadWaylineOptions();
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<PlusOutlined /> 新增
|
<PlusOutlined /> 新增
|
||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<ModalForm
|
{updateModalVisible && (
|
||||||
title="新增设备"
|
|
||||||
width="800px"
|
|
||||||
visible={createModalVisible}
|
|
||||||
onVisibleChange={setCreateModalVisible}
|
|
||||||
onFinish={async (values) => {
|
|
||||||
const success = await handleRequest(
|
|
||||||
() => saveOrUpdateDevice(values as DEVICE.Device),
|
|
||||||
'正在添加',
|
|
||||||
'添加成功',
|
|
||||||
);
|
|
||||||
if (success) {
|
|
||||||
setCreateModalVisible(false);
|
|
||||||
actionRef.current?.reload();
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{renderModalContent()}
|
|
||||||
</ModalForm>
|
|
||||||
<UpdateForm
|
<UpdateForm
|
||||||
onSubmit={async (values) => {
|
onSubmit={async (values) => {
|
||||||
const success = await handleRequest(
|
const success = await handleTableAction('edit', currentRow, values);
|
||||||
() => saveOrUpdateDevice({ ...currentRow, ...values }),
|
|
||||||
'正在更新',
|
|
||||||
'更新成功',
|
|
||||||
);
|
|
||||||
if (success) {
|
if (success) {
|
||||||
setUpdateModalVisible(false);
|
handleUpdateModalVisible(false);
|
||||||
|
setCurrentRow(undefined);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onVisibleChange={(visible) => {
|
||||||
|
if (!visible) {
|
||||||
|
handleUpdateModalVisible(false);
|
||||||
setCurrentRow(undefined);
|
setCurrentRow(undefined);
|
||||||
actionRef.current?.reload();
|
|
||||||
}
|
}
|
||||||
return success;
|
|
||||||
}}
|
}}
|
||||||
onVisibleChange={setUpdateModalVisible}
|
|
||||||
updateModalVisible={updateModalVisible}
|
updateModalVisible={updateModalVisible}
|
||||||
values={currentRow}
|
values={currentRow}
|
||||||
|
waylineOptions={waylineOptions}
|
||||||
|
tourismOptions={tourismOptions}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
|
{createModalVisible && (
|
||||||
|
<ModalForm
|
||||||
|
title="新增二维码"
|
||||||
|
visible={createModalVisible}
|
||||||
|
onVisibleChange={(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
loadWaylineOptions();
|
||||||
|
}
|
||||||
|
handleModalVisible(visible);
|
||||||
|
}}
|
||||||
|
modalProps={{ destroyOnClose: true }}
|
||||||
|
onFinish={async (values) => {
|
||||||
|
const success = await handleTableAction('add', undefined, values);
|
||||||
|
if (success) {
|
||||||
|
handleModalVisible(false);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ProForm.Group>
|
||||||
|
<ProFormSelect
|
||||||
|
width="md"
|
||||||
|
name="waylineId"
|
||||||
|
label="航线"
|
||||||
|
placeholder="请选择航线"
|
||||||
|
options={waylineOptions}
|
||||||
|
rules={[{ required: true, message: '请选择航线' }]}
|
||||||
|
fieldProps={{
|
||||||
|
showSearch: true,
|
||||||
|
filterOption: (input, option) =>
|
||||||
|
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{renderModalContent()}
|
||||||
|
</ProForm.Group>
|
||||||
|
</ModalForm>
|
||||||
|
)}
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user