- 集成 Tabs 组件实现发货单和利润表的标签页切换 - 实现利润表数据计算和展示功能 - 添加 Excel 导出和预览功能 - 增加利润表图片生成和保存功能 - 更新订单接口类型定义支持利润表相关字段 - 添加 ProfitTableTemplate 模板类用于生成利润表 HTML - 实现按月查询订单数据并计算单车利润逻辑 - 优化发货单预览界面样式和交互体验 - 增加 file-excel 图标支持 Excel 文件操作 - 更新应用版本号至 v0.0.66
90 lines
1.6 KiB
TypeScript
90 lines
1.6 KiB
TypeScript
import { View, type ViewProps } from "@tarojs/components";
|
|
import classNames from "classnames";
|
|
import React from "react";
|
|
|
|
export type IconNames =
|
|
| "file-excel"
|
|
| "copy"
|
|
| "wallet"
|
|
| "download"
|
|
| "file-pdf"
|
|
| "check-circle"
|
|
| "exclamation"
|
|
| "arrow-up"
|
|
| "arrow-down"
|
|
| "trash-can"
|
|
| "pen"
|
|
| "chevron-up"
|
|
| "building"
|
|
| "calculator"
|
|
| "compass"
|
|
| "eye"
|
|
| "eye-slash"
|
|
| "phone-flip"
|
|
| "address-book"
|
|
| "pen-to-square"
|
|
| "location-dot"
|
|
| "clock"
|
|
| "user-tie"
|
|
| "receipt"
|
|
| "file-signature"
|
|
| "chart-line"
|
|
| "chart-pie"
|
|
| "right-left"
|
|
| "circle-check"
|
|
| "bell"
|
|
| "chart-bar"
|
|
| "user-switch"
|
|
| "circle-question"
|
|
| "key"
|
|
| "arrow-right-from-bracket"
|
|
| "house"
|
|
| "check"
|
|
| "comment-dots"
|
|
| "circle-xmark"
|
|
| "phone"
|
|
| "weight-scale"
|
|
| "minus"
|
|
| "clipboard-list"
|
|
| "folder"
|
|
| "file-invoice"
|
|
| "camera"
|
|
| "id-card"
|
|
| "truck"
|
|
| "credit-card"
|
|
| "lock"
|
|
| "money-bill"
|
|
| "chevron-right"
|
|
| "circle-info"
|
|
| "user"
|
|
| "chevron-down"
|
|
| "plus"
|
|
| "chevron-left";
|
|
|
|
interface IconProps extends ViewProps {
|
|
name: IconNames;
|
|
size?: number;
|
|
color?: string;
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
const icon: React.FC<IconProps> = (props) => {
|
|
const { name, size, color = "var(--color-primary)" } = props;
|
|
const rootStyle = {
|
|
fontSize: Number.isInteger(size)
|
|
? `calc(var(--scale-factor) * ${size}px)`
|
|
: "calc(var(--text-xs) * 2)",
|
|
color,
|
|
};
|
|
|
|
return (
|
|
<View
|
|
{...props}
|
|
className={classNames(`iconfont icon-${name}`, props.className)}
|
|
style={rootStyle}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default icon;
|