Commit 31facdf9 authored by 陈龙's avatar 陈龙

fix: 修复组件引入错误

parent 0ffab69a
......@@ -120,7 +120,6 @@ const FileUpload = ({ value, onChange, schema }) => {
return _obj[type].join(',');
};
useEffect(() => {
debugger;
let fileList = [];
(file || '').split(',').forEach((item, index) => {
if (item && filenameVerification({ name: item }, true).type !== 'error') {
......
......@@ -3,11 +3,13 @@ import extraComponents from '../extra/extraComponents';
import moment from 'moment';
import { Tag } from 'antd';
import { hasMoney, isNumber } from './utils';
import { tagColors, tagBackgroundColors } from './constant';
/**
* @params: config下的数值的configRule结构如下,[{最大值: 10,最小值: 0,颜色:'#AAAAAA'}];
* @business: configRule有值,则按照configRule设置;没有,按照color设置; 有最大值,无最小值;['', 1]
* 有最大值,有最小值;[2,
*
* 有最大值,有最小值;[2,
*
* 10]
* 有最小值,无最大值;[11,'']
......@@ -69,12 +71,6 @@ const clickModal = (config, showModal, setExtra) => {
showModal(true);
return setExtra(extraComponents[_fn](_data));
};
const returnOpacity = (rgba) => {
if (!rgba) rgba = 'rgba(0,0,0,.65)';
let _str = rgba.replace('rgba(', '').replace(')', '');
let _splitStr = _str.split(',');
return `rgba(${_splitStr[0]},${_splitStr[1]},${_splitStr[2]},.25)`;
};
export const handleNumber = (config, number) => {
let _color = '';
let _number;
......
......@@ -24,7 +24,7 @@ const hasMoney = (configItems) => {
const returnHandledNumber = (configItems, num) => {
// 精度、前缀、后缀、倍率
// $_d|_d%|_d*0.0001|金额|0.00
if (isNaN(num)) return '-';
if (isNaN(Number(num))) return '-';
if (!configItems) return num;
num = Number(num);
let _items = configItems.split('|');
......@@ -51,7 +51,7 @@ const returnHandledNumber = (configItems, num) => {
let final = _items.includes('金额')
? Number((num * rate).toFixed(precision)).toLocaleString()
: Number((num * rate).toFixed(precision));
return template.replace(/_d/, final);
return template.replace(/_d/, isString(final) ? final : '-');
};
/**
* @description: 返回configItems内配置的默认值、默认模式等等
......@@ -61,9 +61,11 @@ const returnHandledNumber = (configItems, num) => {
* @params:
* configItems 报表字段的配置 例如 defaultValue=智慧水务
*
*
* defaultDateModel=customer|defaultDateValue=2022-01-01,2022-12-31;
* keysArray
*
*
* 所需要返回的值的key的集合,比如你需要获取configItems中的’defaultValue‘,那么keysArray=['defaultValue'];
* @returns:
* defaultValue 通用参数 默认值
......@@ -96,7 +98,6 @@ function downloadFunc(url, name, target = '_self') {
* @returns {Object} {type: error | success ,content: 提示...}
*/
function filenameVerification(file, special) {
debugger;
// 文件名含有特殊字符 提示不能上传 {+,:/?#[]@!$&\\*+;=}
// 规则对象(flag)
var flag = !special
......
......@@ -4,7 +4,7 @@ import BasicReport from '../index';
const Demo = () => {
return (
<div>
<h3>折线图</h3>
<h3>报表</h3>
<div style={{ height: '600px' }}>
<BasicReport
params={{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment