fix[任务模块]:排队信息返回价格优化,用户昵称头像更新逻辑,新增获取可查看文件接口等
This commit is contained in:
@@ -6,11 +6,12 @@ import {
|
||||
ModalForm,
|
||||
PageContainer,
|
||||
ProForm,
|
||||
ProFormSelect,
|
||||
ProFormText,
|
||||
ProTable,
|
||||
QueryFilter,
|
||||
} from '@ant-design/pro-components';
|
||||
import { Typography, Popconfirm, Space, message, Image, Button } from 'antd';
|
||||
import { Typography, Popconfirm, Space, message, Image, Button, Tag } from 'antd';
|
||||
import React, { useRef, useState } from 'react';
|
||||
import UpdateForm from './components/UpdateForm';
|
||||
import Upload, { RcFile } from 'antd/lib/upload';
|
||||
@@ -90,7 +91,18 @@ const handleImport = async (file: RcFile) => {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
// 类型颜色映射
|
||||
const typeColorMap = {
|
||||
0: { color: 'yellow', text: '首页轮播' },
|
||||
1: { color: 'orange', text: '活动' },
|
||||
2: { color: 'red', text: '其他' },
|
||||
};
|
||||
|
||||
// 类型渲染标签
|
||||
const renderType = (type: {} | null | undefined) => {
|
||||
const typeInfo = typeColorMap[type] || { color: 'gray', text: '未知状态' };
|
||||
return <Tag color={typeInfo.color}>{typeInfo.text}</Tag>;
|
||||
};
|
||||
const TableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [params, setParams] = useState<Record<string, string | number>>({ });
|
||||
@@ -119,6 +131,11 @@ const TableList: React.FC = () => {
|
||||
title: '跳转链接',
|
||||
dataIndex: 'redirectUrl',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
render: (type) => renderType(type),
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'description',
|
||||
@@ -235,6 +252,18 @@ const TableList: React.FC = () => {
|
||||
label="链接url"
|
||||
placeholder="输入url"
|
||||
/>
|
||||
<ProFormSelect
|
||||
width="md"
|
||||
name="type"
|
||||
label="类型"
|
||||
placeholder="请选择类型"
|
||||
options={[
|
||||
{ label: '首页轮播', value: 0 },
|
||||
{ label: '活动', value: 1 },
|
||||
{ label: '其他', value: 2 },
|
||||
// 添加更多选项...
|
||||
]}
|
||||
/>
|
||||
<ProFormText
|
||||
width="md"
|
||||
name="description"
|
||||
|
||||
@@ -76,7 +76,7 @@ const TableList: React.FC = () => {
|
||||
dataIndex: 'fileType',
|
||||
},
|
||||
{
|
||||
title: '订单编号',
|
||||
title: '任务编号',
|
||||
dataIndex: 'orderNo',
|
||||
},
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ declare namespace ORDERS {
|
||||
id: number;
|
||||
imageUrl: string;
|
||||
redirectUrl: string;
|
||||
type: string;
|
||||
type: number;
|
||||
title: string;
|
||||
description: string;
|
||||
sortOrder: number;
|
||||
|
||||
Reference in New Issue
Block a user