Commit 44c2a032 authored by 李纪文's avatar 李纪文

fix: 修改组件问题

parent a8144085
...@@ -14,7 +14,7 @@ const Demo = (props) => { ...@@ -14,7 +14,7 @@ const Demo = (props) => {
}; };
return ( return (
<> <>
<DatePickerCustom onChange={onChange} picker="day" style={{ marginRight: '10px' }} /> <DatePickerCustom onChange={onChange} picker="date" style={{ marginRight: '10px' }} />
<DatePickerCustom onChange={onChange} picker="week" style={{ marginRight: '10px' }} /> <DatePickerCustom onChange={onChange} picker="week" style={{ marginRight: '10px' }} />
<DatePickerCustom onChange={onChange} picker="month" style={{ marginRight: '10px' }} /> <DatePickerCustom onChange={onChange} picker="month" style={{ marginRight: '10px' }} />
<DatePickerCustom onChange={onChange} picker="year" style={{ marginRight: '10px' }} /> <DatePickerCustom onChange={onChange} picker="year" style={{ marginRight: '10px' }} />
......
...@@ -12,7 +12,7 @@ const FORMATS = { ...@@ -12,7 +12,7 @@ const FORMATS = {
const STANTFORMAT = 'YYYY-MM-DD 00:00:00'; const STANTFORMAT = 'YYYY-MM-DD 00:00:00';
const ENDFORMAT = 'YYYY-MM-DD 23:59:59'; const ENDFORMAT = 'YYYY-MM-DD 23:59:59';
const DatePickerCustom = (props) => { const DatePickerCustom = (props) => {
const modes = props.picker ? props.picker : 'day'; const modes = props.picker ? (props.picker !== 'date' ? props.picker : 'day') : 'day';
const selectedDate = props.value ? props.value : new Date(); const selectedDate = props.value ? props.value : new Date();
const onChange = (date, dateString) => { const onChange = (date, dateString) => {
const dateTime = moment(date).format('YYYY-MM-DD'); const dateTime = moment(date).format('YYYY-MM-DD');
......
...@@ -5,11 +5,11 @@ import JSZip from 'jszip'; ...@@ -5,11 +5,11 @@ import JSZip from 'jszip';
// 导出Excel表格 // 导出Excel表格
const ExportExcel = (props) => { const ExportExcel = (props) => {
var option = {}; let option = {};
option.fileName = props.name; option.fileName = props.name;
option.datas = props.content; option.datas = props.content;
var toExcel = new ExportJsonExcel(option); //new let toExcel = new ExportJsonExcel(option); //new
toExcel.saveExcel(); toExcel.saveExcel();
}; };
ExportExcel.defaultProps = { ExportExcel.defaultProps = {
...@@ -24,17 +24,17 @@ ExportExcel.propTypes = { ...@@ -24,17 +24,17 @@ ExportExcel.propTypes = {
// 导出压缩Excel表格 // 导出压缩Excel表格
const ExportExcelZip = (props) => { const ExportExcelZip = (props) => {
var option = {}; let option = {};
option.fileName = props.name; option.fileName = props.name;
option.saveAsBlob = true; option.saveAsBlob = true;
option.datas = props.content; option.datas = props.content;
var toExcel = new ExportJsonExcel(option); //new let toExcel = new ExportJsonExcel(option); //new
let file = toExcel.saveExcel(); let file = toExcel.saveExcel();
// 压缩文件 // 压缩文件
var zip = new JSZip(); let zip = new JSZip();
// 多个excel 依次加入(fileName不能相同) // 多个excel 依次加入(fileName不能相同)
zip.file(file.name, file); zip.file(file.name, file);
......
...@@ -41,7 +41,7 @@ const DeviceTree = (props) => { ...@@ -41,7 +41,7 @@ const DeviceTree = (props) => {
}, []); }, []);
const handleData = (data) => { const handleData = (data) => {
data.forEach((item) => { data.map((item) => {
item.title = item.deviceName; item.title = item.deviceName;
item.key = item.stationID; item.key = item.stationID;
item.children = handleData(item.children); item.children = handleData(item.children);
......
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