提交 331a379b authored 作者: 钟是志's avatar 钟是志

打包优化. 把大依赖拆分出去

上级 6e9935a9
...@@ -5,11 +5,13 @@ import ButtonDiy from '@/baseComponent/ButtonDiy'; ...@@ -5,11 +5,13 @@ import ButtonDiy from '@/baseComponent/ButtonDiy';
import config from '@/config/config'; import config from '@/config/config';
import { connect } from 'dva'; import { connect } from 'dva';
import { exportExcel } from 'xlsx-oc'; // import { exportExcel } from 'xlsx-oc';
import { getToken } from '@/utils/authority'; import { getToken } from '@/utils/authority';
const Step = Steps.Step; const Step = Steps.Step;
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel;
// const exportExcel = null;
@connect(({ DataObj, loading }) => ({ @connect(({ DataObj, loading }) => ({
DataObj, DataObj,
...@@ -181,6 +183,10 @@ export default class ImportUtil extends React.PureComponent { ...@@ -181,6 +183,10 @@ export default class ImportUtil extends React.PureComponent {
this.setState({ currentKey: activeKey }); this.setState({ currentKey: activeKey });
}; };
exportError = (column, dataSource) => { exportError = (column, dataSource) => {
if(!exportExcel){
message.info('暂不支持此功能');
return null;
}
var _headers = []; var _headers = [];
for (var i = 0; i < column.length; i++) { for (var i = 0; i < column.length; i++) {
_headers.push({ k: column[i].dataIndex, v: column[i].title }); _headers.push({ k: column[i].dataIndex, v: column[i].title });
......
...@@ -13,7 +13,6 @@ const Modal = getModal(); ...@@ -13,7 +13,6 @@ const Modal = getModal();
const message = getMessage(); const message = getMessage();
const Step = Steps.Step; const Step = Steps.Step;
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel; const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel;
let tempCallback = () => { let tempCallback = () => {
}; };
......
...@@ -3528,9 +3528,9 @@ ${obj[dataColumn.base52]} ...@@ -3528,9 +3528,9 @@ ${obj[dataColumn.base52]}
} }
break; break;
case 'Cron': case 'Cron':
if(process.env.APP_TYPE === 'zyd'){ // 学工里面 打包优化 把这个组件过滤掉 没用 2022年6月30日 钟是志 if(typeof BUILD_TYPE !== 'undefined' && BUILD_TYPE === 'ZYD'){
cm = '暂不支持Cron组件'; cm = '暂不支持此组件'
} else{ }else{
const CronEditor = lazy(() => import('antd-cron-editor')); const CronEditor = lazy(() => import('antd-cron-editor'));
const CronFunctions = (props) => { const CronFunctions = (props) => {
<Suspense fallback={<div>loading...</div>}> <Suspense fallback={<div>loading...</div>}>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论