Please enter the commit message for your changes. Lines starting
with '#' will be ignored, and an empty message aborts the commit. On branch develop Your branch is ahead of 'goflyapp/develop' by 1 commit. (use "git push" to publish your local commits) Changes to be committed: new file: zlt-business/device-center/src/main/java/com/central/device/listener/DeviceImportListener.java new file: zlt-business/device-center/src/main/java/com/central/device/model/excel/AgeDeviceExcel.java new file: zlt-business/order-center/src/main/java/com/central/order/feign/DeviceCenterService.java new file: zlt-business/order-center/src/main/java/com/central/order/feign/fallback/DeviceCenterServiceFallbackFactory.java modified: zlt-web/react-web/src/main/frontend/Dockerfile modified: zlt-web/react-web/src/main/frontend/deploy.sh modified: zlt-web/react-web/src/main/frontend/docker-compose.yml modified: zlt-web/react-web/src/main/frontend/nginx.conf modified: zlt-web/react-web/src/main/frontend/src/pages/orders/TourismFile/components/UpdateForm.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/orders/TourismFile/index.tsx Changes not staged for commit: modified: README.md modified: pom.xml modified: zlt-business/device-center/pom.xml modified: zlt-business/device-center/src/main/java/com/central/device/controller/AgeDeviceController.java modified: zlt-business/device-center/src/main/java/com/central/device/controller/ApiDeviceController.java modified: zlt-business/device-center/src/main/java/com/central/device/controller/LineFileController.java modified: zlt-business/device-center/src/main/java/com/central/device/feign/OrderCenterService.java modified: zlt-business/device-center/src/main/java/com/central/device/feign/fallback/OrderCenterServiceFallbackFactory.java modified: zlt-business/device-center/src/main/java/com/central/device/listener/DeviceImportListener.java modified: zlt-business/device-center/src/main/java/com/central/device/model/AgeDevice.java modified: zlt-business/device-center/src/main/java/com/central/device/model/LineFile.java modified: zlt-business/device-center/src/main/java/com/central/device/model/excel/AgeDeviceExcel.java modified: zlt-business/device-center/src/main/java/com/central/device/service/IAgeDeviceService.java modified: zlt-business/device-center/src/main/java/com/central/device/service/ILineFileService.java modified: zlt-business/device-center/src/main/java/com/central/device/service/impl/AgeDeviceServiceImpl.java modified: zlt-business/device-center/src/main/java/com/central/device/service/impl/LineFileServiceImpl.java modified: zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java modified: zlt-business/file-center/src/main/java/com/central/file/service/impl/OssService.java modified: zlt-business/file-center/src/main/resources/application.yml modified: zlt-business/order-center/src/main/java/com/central/order/controller/OrderController.java modified: zlt-business/order-center/src/main/java/com/central/order/controller/QrCodeController.java modified: zlt-business/order-center/src/main/java/com/central/order/feign/DeviceCenterService.java modified: zlt-business/order-center/src/main/java/com/central/order/feign/fallback/DeviceCenterServiceFallbackFactory.java modified: zlt-business/order-center/src/main/java/com/central/order/model/Order.java modified: zlt-commons/zlt-common-core/src/main/java/com/central/common/model/FileInfo.java modified: zlt-web/react-web/src/main/frontend/config/config.ts modified: zlt-web/react-web/src/main/frontend/config/routes.ts modified: zlt-web/react-web/src/main/frontend/nginx.conf modified: zlt-web/react-web/src/main/frontend/package.json modified: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline/components/UpdateForm.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline/index.tsx deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/components/UpdateForm.tsx deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/index.less deleted: zlt-web/react-web/src/main/frontend/src/pages/device/Wayline1/index.tsx modified: zlt-web/react-web/src/main/frontend/src/pages/orders/OrderFile/index.tsx modified: zlt-web/react-web/src/main/frontend/src/services/device/api.ts modified: zlt-web/react-web/src/main/frontend/src/services/device/typings.d.ts Untracked files: zlt-web/react-web/src/main/frontend/src/pages/device/Device/
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package com.central.device.model;
|
||||||
|
|
||||||
|
public class DeviceImportListener {
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package com.central.device.model;
|
||||||
|
|
||||||
|
public class AgeDeviceExcel {
|
||||||
|
}
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
package com.central.order.feign;
|
||||||
|
|
||||||
|
import com.central.common.constant.ServiceNameConstants;
|
||||||
|
import com.central.common.model.FileInfo;
|
||||||
|
import com.central.common.model.Result;
|
||||||
|
import com.central.order.feign.fallback.FileCenterServiceFallbackFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* user-center模块远程调用
|
||||||
|
*
|
||||||
|
* @author lsl
|
||||||
|
* @version 1.0
|
||||||
|
* @description user-center模块远程调用
|
||||||
|
* @create 2025/1/13
|
||||||
|
**/
|
||||||
|
@FeignClient(name = ServiceNameConstants.FILE_SERVICE, fallbackFactory = FileCenterServiceFallbackFactory.class, dismiss404 = true)
|
||||||
|
public interface FileCenterService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID查询预览地址
|
||||||
|
*
|
||||||
|
* @param id 文件ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/file/{id}")
|
||||||
|
String getFileViewUrl(@PathVariable("id") String id);
|
||||||
|
|
||||||
|
@GetMapping("/type/{id}")
|
||||||
|
String getFileContentType(@PathVariable("id") String id);
|
||||||
|
|
||||||
|
@GetMapping("/qrcode/{codeId}")
|
||||||
|
Result<Map> uploadQrCodeFile(@PathVariable("codeId") String codeId) throws Exception;
|
||||||
|
|
||||||
|
@PostMapping("/path")
|
||||||
|
FileInfo creatFileInfo(@RequestBody String path);
|
||||||
|
|
||||||
|
@GetMapping("/files/path")
|
||||||
|
String getViewUrlByPath(@RequestParam("path") String path) ;
|
||||||
|
|
||||||
|
@GetMapping("/files/path/style")
|
||||||
|
String getViewUrlByPathStyle(@RequestParam("params") Map<String,String> params) ;
|
||||||
|
}
|
||||||
+60
@@ -0,0 +1,60 @@
|
|||||||
|
package com.central.order.feign.fallback;
|
||||||
|
|
||||||
|
import com.central.common.model.FileInfo;
|
||||||
|
import com.central.common.model.Result;
|
||||||
|
import com.central.order.feign.FileCenterService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件中心调用失败回调
|
||||||
|
*
|
||||||
|
* @author lsl
|
||||||
|
* @version 1.0
|
||||||
|
* @description 用户中心调用失败回调
|
||||||
|
* @create 2025/1/17 11:33
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class FileCenterServiceFallbackFactory implements FallbackFactory<FileCenterService> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileCenterService create(Throwable cause) {
|
||||||
|
return new FileCenterService() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFileViewUrl(String id) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFileContentType(String id) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<Map> uploadQrCodeFile(String codeId) throws Exception {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileInfo creatFileInfo(String path) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getViewUrlByPath(String path) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getViewUrlByPathStyle(Map<String, String> params) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,5 +7,9 @@ COPY dist/ /usr/share/nginx/html/
|
|||||||
# 复制 nginx 配置文件
|
# 复制 nginx 配置文件
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
# 设置正确的权限
|
||||||
|
RUN chown -R nginx:nginx /usr/share/nginx/html && \
|
||||||
|
chmod -R 755 /usr/share/nginx/html
|
||||||
|
|
||||||
# 暴露 8080 端口
|
# 暴露 8080 端口
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
@@ -2,13 +2,50 @@
|
|||||||
|
|
||||||
echo "开始部署前端项目..."
|
echo "开始部署前端项目..."
|
||||||
|
|
||||||
|
# 首先构建项目
|
||||||
|
echo "构建前端项目..."
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# 检查构建是否成功
|
||||||
|
if [ ! -d "dist" ]; then
|
||||||
|
echo "错误:dist 目录不存在,构建可能失败"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查必要文件
|
||||||
|
if [ ! -f "dist/index.html" ]; then
|
||||||
|
echo "错误:index.html 不存在,构建可能不完整"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "开始 Docker 部署..."
|
||||||
|
|
||||||
# 停止并删除旧容器
|
# 停止并删除旧容器
|
||||||
docker compose down
|
docker compose down
|
||||||
|
|
||||||
|
# 清理旧的构建缓存
|
||||||
|
docker builder prune -f
|
||||||
|
|
||||||
# 重新构建并启动
|
# 重新构建并启动
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
|
|
||||||
# 检查容器状态
|
# 检查容器状态
|
||||||
docker compose ps
|
docker compose ps
|
||||||
|
|
||||||
echo "部署完成!项目已启动在 8080 端口"
|
# 验证部署
|
||||||
|
echo "验证部署..."
|
||||||
|
curl -I http://localhost:8080
|
||||||
|
|
||||||
|
echo "部署完成!项目已启动在 8080 端口"
|
||||||
|
|
||||||
|
# 显示容器日志
|
||||||
|
docker compose logs frontend
|
||||||
|
|
||||||
|
# 进入容器检查文件
|
||||||
|
docker exec frontend ls -la /usr/share/nginx/html
|
||||||
|
|
||||||
|
# 检查 nginx 配置
|
||||||
|
docker exec frontend nginx -t
|
||||||
|
|
||||||
|
# 查看 nginx 日志
|
||||||
|
docker exec frontend cat /var/log/nginx/error.log
|
||||||
@@ -12,16 +12,6 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
# 如果有后端服务,可以添加依赖
|
|
||||||
# depends_on:
|
|
||||||
# - backend
|
|
||||||
|
|
||||||
# 如果有后端服务,可以添加后端服务配置
|
|
||||||
# backend:
|
|
||||||
# image: your-backend-image
|
|
||||||
# container_name: backend
|
|
||||||
# networks:
|
|
||||||
# - app-network
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
app-network:
|
app-network:
|
||||||
|
|||||||
@@ -29,21 +29,26 @@ server {
|
|||||||
|
|
||||||
# API-UAA 服务代理
|
# API-UAA 服务代理
|
||||||
location /api-uaa/ {
|
location /api-uaa/ {
|
||||||
proxy_pass http://119.45.169.13:9900/api-uaa/; # 替换为实际的后端地址
|
proxy_pass http://119.45.169.13:9900/api-uaa/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
# 添加跨域支持
|
# 确保 Authorization 头可以传递
|
||||||
add_header Access-Control-Allow-Origin *;
|
proxy_set_header Authorization $http_authorization;
|
||||||
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
|
proxy_pass_header Authorization;
|
||||||
add_header Access-Control-Allow-Headers '*';
|
}
|
||||||
add_header Access-Control-Expose-Headers '*';
|
|
||||||
|
# 用户服务代理
|
||||||
|
location /api-user/ {
|
||||||
|
proxy_pass http://119.45.169.13:9900/api-user/;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
# 处理 OPTIONS 请求
|
# 确保 Authorization 头可以传递
|
||||||
if ($request_method = 'OPTIONS') {
|
proxy_set_header Authorization $http_authorization;
|
||||||
return 204;
|
proxy_pass_header Authorization;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# 其他 API 服务代理(如果需要)
|
# 其他 API 服务代理(如果需要)
|
||||||
|
|||||||
+55
-65
@@ -6,7 +6,7 @@ import {
|
|||||||
ProFormSelect,
|
ProFormSelect,
|
||||||
ProFormText,
|
ProFormText,
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
import { Button, Upload, Image, message } from 'antd';
|
import { Button, Upload, Image, message, Form } from 'antd';
|
||||||
import type { RcFile } from 'antd/lib/upload';
|
import type { RcFile } from 'antd/lib/upload';
|
||||||
import React, { useState, useEffect, useCallback } from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
import { TOURISM_OPTIONS, TYPE_OPTIONS } from '../constants';
|
import { TOURISM_OPTIONS, TYPE_OPTIONS } from '../constants';
|
||||||
@@ -23,58 +23,52 @@ interface UpdateFormProps {
|
|||||||
typeOptions: typeof TYPE_OPTIONS;
|
typeOptions: typeof TYPE_OPTIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UpdateForm: React.FC<UpdateFormProps> = ({
|
const UpdateForm: React.FC<UpdateFormProps> = (props) => {
|
||||||
onSubmit,
|
const [imageUrl, setImageUrl] = useState<string>();
|
||||||
onVisibleChange,
|
const [imagePath, setImagePath] = useState<string>();
|
||||||
updateModalVisible,
|
|
||||||
values,
|
|
||||||
tourismOptions,
|
|
||||||
statusOptions,
|
|
||||||
typeOptions,
|
|
||||||
}) => {
|
|
||||||
const [uploading, setUploading] = useState(false);
|
|
||||||
const [updateImageUrl, setUpdateImageUrl] = useState<string>();
|
|
||||||
const [updateImagePath, setUpdateImagePath] = useState<string>();
|
|
||||||
|
|
||||||
// 处理文件上传
|
|
||||||
const handleUpload = async (file: RcFile) => {
|
const handleUpload = async (file: RcFile) => {
|
||||||
setUploading(true);
|
|
||||||
const hide = message.loading('正在上传...');
|
const hide = message.loading('正在上传...');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
const result = await importImage(formData);
|
const result = await importImage(formData);
|
||||||
|
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
if (result.url && result.path) {
|
if (result.url && result.path) {
|
||||||
message.success('上传成功');
|
message.success('上传成功');
|
||||||
setUpdateImageUrl(result.url);
|
setImageUrl(result.url);
|
||||||
setUpdateImagePath(result.path);
|
setImagePath(result.path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.error('上传失败:未获取到文件信息');
|
message.error('上传失败:未获取到文件信息');
|
||||||
return false;
|
return false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Upload error:', error);
|
|
||||||
hide();
|
hide();
|
||||||
message.error('上传失败:' + (error.message || '未知错误'));
|
message.error('上传失败:' + (error.message || '未知错误'));
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
|
||||||
setUploading(false);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalForm
|
<ModalForm
|
||||||
title="修改素材"
|
title="修改素材"
|
||||||
visible={updateModalVisible}
|
visible={props.updateModalVisible}
|
||||||
onVisibleChange={onVisibleChange}
|
onVisibleChange={props.onVisibleChange}
|
||||||
modalProps={{ destroyOnClose: true }}
|
modalProps={{ destroyOnClose: true }}
|
||||||
initialValues={values}
|
onFinish={async (values) => {
|
||||||
onFinish={onSubmit}
|
// 如果上传了新图片,使用新的图片路径
|
||||||
|
if (imagePath) {
|
||||||
|
values.imageUrl = imagePath;
|
||||||
|
}
|
||||||
|
const success = await props.onSubmit(values);
|
||||||
|
if (success) {
|
||||||
|
setImageUrl(undefined);
|
||||||
|
setImagePath(undefined);
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
}}
|
||||||
|
initialValues={props.values}
|
||||||
>
|
>
|
||||||
<ProForm.Group>
|
<ProForm.Group>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
@@ -83,7 +77,7 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
|||||||
name="tourismId"
|
name="tourismId"
|
||||||
label="景区"
|
label="景区"
|
||||||
placeholder="请选择景区"
|
placeholder="请选择景区"
|
||||||
options={tourismOptions}
|
options={props.tourismOptions}
|
||||||
showSearch
|
showSearch
|
||||||
/>
|
/>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
@@ -92,7 +86,7 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
|||||||
name="type"
|
name="type"
|
||||||
label="素材类型"
|
label="素材类型"
|
||||||
placeholder="请选择素材类型"
|
placeholder="请选择素材类型"
|
||||||
options={typeOptions}
|
options={props.typeOptions}
|
||||||
/>
|
/>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
rules={[{ required: true, message: '请选择状态' }]}
|
rules={[{ required: true, message: '请选择状态' }]}
|
||||||
@@ -100,7 +94,7 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
|||||||
name="status"
|
name="status"
|
||||||
label="状态"
|
label="状态"
|
||||||
placeholder="请选择状态"
|
placeholder="请选择状态"
|
||||||
options={statusOptions}
|
options={props.statusOptions}
|
||||||
/>
|
/>
|
||||||
<ProFormText
|
<ProFormText
|
||||||
width="md"
|
width="md"
|
||||||
@@ -114,42 +108,38 @@ const UpdateForm: React.FC<UpdateFormProps> = ({
|
|||||||
label="素材描述"
|
label="素材描述"
|
||||||
placeholder="输入描述"
|
placeholder="输入描述"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Upload
|
|
||||||
maxCount={1}
|
|
||||||
accept="image/*"
|
|
||||||
showUploadList={false}
|
|
||||||
disabled={uploading}
|
|
||||||
customRequest={async ({ file, onSuccess, onError }) => {
|
|
||||||
try {
|
|
||||||
if (file instanceof File) {
|
|
||||||
const success = await handleUpload(file as RcFile);
|
|
||||||
if (success) {
|
|
||||||
onSuccess?.('ok');
|
|
||||||
} else {
|
|
||||||
onError?.(new Error('上传失败'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
onError?.(error);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button
|
|
||||||
icon={<UploadOutlined />}
|
|
||||||
loading={uploading}
|
|
||||||
>
|
|
||||||
更新素材
|
|
||||||
</Button>
|
|
||||||
</Upload>
|
|
||||||
|
|
||||||
<div style={{ marginTop: 16 }}>
|
<Form.Item label="素材图片" required>
|
||||||
<Image
|
<Upload
|
||||||
src={updateImageUrl || values?.imageUrl}
|
maxCount={1}
|
||||||
width={200}
|
accept="image/*"
|
||||||
style={{ objectFit: 'cover' }}
|
showUploadList={false}
|
||||||
/>
|
customRequest={async ({ file, onSuccess, onError }) => {
|
||||||
</div>
|
try {
|
||||||
|
if (file instanceof File) {
|
||||||
|
const success = await handleUpload(file as RcFile);
|
||||||
|
if (success) {
|
||||||
|
onSuccess?.('ok');
|
||||||
|
} else {
|
||||||
|
onError?.(new Error('上传失败'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
onError?.(error);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button icon={<UploadOutlined />}>上传素材</Button>
|
||||||
|
</Upload>
|
||||||
|
|
||||||
|
<div style={{ marginTop: 16 }}>
|
||||||
|
<Image
|
||||||
|
src={imageUrl || props.values?.imageUrl}
|
||||||
|
width={200}
|
||||||
|
style={{ objectFit: 'cover' }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Form.Item>
|
||||||
</ProForm.Group>
|
</ProForm.Group>
|
||||||
</ModalForm>
|
</ModalForm>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -85,8 +85,9 @@ const handleAdd = async (fields: ORDERS.TourismFile) => {
|
|||||||
const handleEdit = async (original: ORDERS.TourismFile, fields: Partial<ORDERS.TourismFile>) => {
|
const handleEdit = async (original: ORDERS.TourismFile, fields: Partial<ORDERS.TourismFile>) => {
|
||||||
return handleApiRequest(
|
return handleApiRequest(
|
||||||
() => saveOrUpdateTourismFile({
|
() => saveOrUpdateTourismFile({
|
||||||
|
...original, // 保留原有数据
|
||||||
|
...fields, // 使用新的数据覆盖
|
||||||
id: original.id,
|
id: original.id,
|
||||||
...fields
|
|
||||||
}),
|
}),
|
||||||
'正在更新',
|
'正在更新',
|
||||||
'修改成功'
|
'修改成功'
|
||||||
|
|||||||
Reference in New Issue
Block a user