@@ -101,6 +195,7 @@ const QrcodeListModal: React.FC
= ({ open, onOpenChange, t
search={false}
pagination={{ showSizeChanger: true, showQuickJumper: true }}
toolBarRender={false}
+ scroll={{ x: 1200 }}
/>
@@ -146,6 +241,25 @@ const QrcodeListModal: React.FC = ({ open, onOpenChange, t
}
}}
/>
+
+ {/* 二维码预览 */}
+ setPreviewOpen(false)}
+ footer={null}
+ width={600}
+ centered
+ destroyOnClose
+ >
+
+

+
+
>
);
};
diff --git a/zlt-web/react-web-next/src/pages/orders/Tourism/index.tsx b/zlt-web/react-web-next/src/pages/orders/Tourism/index.tsx
index c99cb701..fe613861 100644
--- a/zlt-web/react-web-next/src/pages/orders/Tourism/index.tsx
+++ b/zlt-web/react-web-next/src/pages/orders/Tourism/index.tsx
@@ -1,5 +1,5 @@
-import React, { useEffect, useState } from 'react';
-import { PageContainer, ProFormText, ProTable } from '@ant-design/pro-components';
+import React, { useEffect, useRef, useState } from 'react';
+import { PageContainer, ProFormText, ProTable, type ActionType } from '@ant-design/pro-components';
import { Popconfirm, Space, Tag, message } from 'antd';
import { ActionBar, GlassCard, GradientButton, SearchBarPlus } from '@/components/ui';
import { PlusOutlined } from '@ant-design/icons';
@@ -15,6 +15,7 @@ const TourismPage: React.FC = () => {
const [params, setParams] = useState>({});
const [qrcodeOpen, setQrcodeOpen] = useState(false);
const [qrcodeTourism, setQrcodeTourism] = useState(undefined);
+ const actionRef = useRef();
// 首次进入时,默认按“当前租户 + 包含下级租户”查询,避免全量数据
useEffect(() => {
@@ -36,7 +37,7 @@ const TourismPage: React.FC = () => {
const columns: any[] = [
{ dataIndex: 'index', valueType: 'indexBorder', width: 48 },
- { title: '旅游项目', dataIndex: 'tourismName' },
+ { title: '景区名称', dataIndex: 'tourismName' },
{ title: '地址', dataIndex: 'tourismAddress' },
{ title: '经度', dataIndex: 'longitude' },
{ title: '纬度', dataIndex: 'latitude' },
@@ -57,7 +58,7 @@ const TourismPage: React.FC = () => {
key: 'action',
render: (_: any, record: TourismItem) => (
- { setQrcodeTourism(record); setQrcodeOpen(true); }}>打卡点
+ { setQrcodeTourism(record); setQrcodeOpen(true); }}>二维码
{ setCurrent(record); setEditOpen(true); }}>编辑
{
try {
await ordersApi.deleteTourism(record.id!);
message.success('删除成功');
+ actionRef.current?.reload();
} catch {
message.error('删除失败');
} finally { hide(); }
@@ -79,15 +81,22 @@ const TourismPage: React.FC = () => {
];
return (
-
+
{
setParams((prev) => ({ ...(prev || {}), tenantId, includeChildren }));
+ // 强制刷新表格
+ actionRef.current?.reload();
+ }}
+ onFinish={async (values) => {
+ setParams((prev) => ({ ...(prev || {}), ...values }));
+ // 即使查询条件未变化也再次请求
+ actionRef.current?.reload();
}}
- onFinish={async (values) => setParams((prev) => ({ ...(prev || {}), ...values }))}
>
@@ -104,6 +113,7 @@ const TourismPage: React.FC = () => {
{params?.tenantId ? (
rowKey="id"
+ actionRef={actionRef}
params={params}
request={(p) => ordersApi.tourism({ ...(p as any), ...params })}
columns={columns}
@@ -123,6 +133,8 @@ const TourismPage: React.FC = () => {
try {
await ordersApi.saveOrUpdateTourism(values);
message.success('新增成功');
+ // 新增成功后刷新表格
+ actionRef.current?.reload();
return true;
} catch {
message.error('新增失败');
@@ -141,6 +153,7 @@ const TourismPage: React.FC = () => {
try {
await ordersApi.saveOrUpdateTourism({ ...(current as any), ...values });
message.success('修改成功');
+ actionRef.current?.reload();
return true;
} catch {
message.error('修改失败');
@@ -162,3 +175,4 @@ const TourismPage: React.FC = () => {
};
export default TourismPage;
+
diff --git a/zlt-web/react-web-next/src/services/orders.ts b/zlt-web/react-web-next/src/services/orders.ts
index 0124ecf4..be502b0c 100644
--- a/zlt-web/react-web-next/src/services/orders.ts
+++ b/zlt-web/react-web-next/src/services/orders.ts
@@ -67,7 +67,8 @@ export const ordersApi = {
return (res as any).data || res;
},
deleteTourism: async (id: number) => {
- const res = await request(`/api-order/tourism/${id}`, { method: 'DELETE' });
+ // 后端删除接口为 DELETE /tourism(从请求体读取 id),不支持 path 变量
+ const res = await request('/api-order/tourism', { method: 'DELETE', data: { id } });
return (res as any).data || res;
},