import React from 'react'; import { inject, observer } from 'mobx-react'; import {toJS} from "mobx" import {WeaSearchGroup,WeaBrowser,WeaSelect,WeaUpload,WeaLocaleProvider,WeaError} from "ecCom" import { Button ,Row,Col,Spin} from 'antd'; import WbsFieldSet from "../dialog/wbsFieldSetDialog" const getLabel = WeaLocaleProvider.getLabel; @inject('prjImportStore') @observer class TaskImport extends React.Component { constructor(props) { super(props); this.state={ } } componentDidMount(){ const {prjImportStore} = this.props; const {initTaskDatas,} = prjImportStore; initTaskDatas({imptype:'task',isdata:'2'}); } getCircle() { let style = { width: 20, height: 20, backgroundColor: '#D8D8D8', webkitBorderRadius: 10, mozBorderRadius: 10, msBorderRadius: 10, oBorderRadius: 10, borderRadius: 10, textAlign: 'center', } return style; } getForm() { const{ prjImportStore} = this.props; const{taskmandstr,taskotherstr,filetype,taskwbsfieldstr,taskmsg,imp_totalCount,imp_successCount} = prjImportStore; const require = ""+getLabel(18019,"必填")+": "+getLabel(1352,"任务名称")+" "+getLabel(2097,"负责人")+" "+getLabel(26797,"项目阶段")+" "+ taskmandstr + ""; let other = ""+getLabel(375,"其他")+": "+getLabel(15486,"序号")+" "+getLabel(23785,"上级任务")+" "+getLabel(1322,"起始日期")+" "+ getLabel(741,"结束日期")+" "+getLabel(15274,"项目预算")+" "+getLabel(2232,"里程碑任务")+" "+getLabel(2233,"前置任务")+" "+getLabel(2240,"任务说明")+" "+taskotherstr+" "; let str2 = getLabel(32986,"第二步,下载后,填写内容,注意,要填写的内容在下边的说明中有详细的说明,请一定要确定你的Excel文档的格式是模板中的格式,而没有被修改掉"); let str3 = getLabel(32987,"第三步,选择填写好的Excel文档,点击提交按钮进行批量导入"); let str4 = getLabel(32988,"第四步,如果以上步骤和Excel文档正确的话,数据会被正确的导入,导入成功会有提示。如果有问题,则会提示Excel文档的错误之处"); let str5 = getLabel(18617,"请按下列顺序排列需导入的EXCEL文档中各字段的顺序,其中红色的部分为必填字段,不能为空!"); if(filetype==='2'){ str2 = getLabel(516145,"第二步,配置任务字段后,按照字段格式以及任务必填字段维护好WBS文档内容"); str3 = getLabel(516146,"第三步,选择填写好的WBS文档,点击提交按钮进行批量导入"); str4 = getLabel(516147,"第四步,如果以上步骤和WBS文档正确的话,数据会被正确的导入,导入成功会有提示。如果有问题,则会提示WBS文档的错误之处"); str5 = getLabel(516148,"请按下列已配置字段关系维护WBS文档,其中红色的部分为必填字段,不能为空!"); other = ""+getLabel(516149,"已配置:")+taskwbsfieldstr+" "; } let condition = [{ "title": getLabel(24893, "基础信息"), "defaultshow": true, "items": [{ "checkbox": false, "colSpan": 2, "conditionType": "BROWSER", "detailtype": 1, "domkey": ["prjtype"], "fieldcol": 18, "hasBorder": false, "helpfulTipProps": {}, "isQuickSearch": false, "label": getLabel(522069 ,"选择项目"), "labelcol": 5, "length": 0, "precision": 0, "showOrder": 0, "stringLength": 0, "tipPosition": "bottom", "viewAttr": 2, "value":"" },{ "colSpan": 2, "conditionType": "SELECT", "domkey": [ "filetype" ], "fieldcol": 18, "isQuickSearch": false, "label": getLabel(24863,"导入类型"), "labelcol": 5, "options": [ { "key": "1", "selected": filetype==1?true:false, "showname": "Excel" }, { "key": "2", "selected": filetype==2?true:false, "showname": "WBS" } ], "viewAttr": 3 }, { "checkbox": false, "colSpan": 2, "conditionType": "RESOURCEIMG", "detailtype": 1, "domkey": ["excelfile"], "fieldcol": 18, "hasBorder": false, "helpfulTipProps": {}, "isQuickSearch": false, "label": getLabel(18493, "文件"), "labelcol": 5, "length": 0, "precision": 0, "showOrder": 0, "stringLength": 0, "tipPosition": "bottom", "viewAttr": 2 }] }, { "title": getLabel(19010,"操作说明"), "defaultshow": true, "items": [{ "index": 1, "value": getLabel(28447, "第一步,请先") }, { "index": 2, "value": str2 }, { "index": 3, "value": str3 }, { "index": 4, "value": str4 }] }, { "title": getLabel(24962,"字段说明"), "defaultshow": true, "items": [{ "index": 1, "value": str5 }, { "index": 2, "value":require }, { "index": 3, "value":other }] }, { "title": getLabel(502196,"注意事项"), "defaultshow": true, "items": [{ "index": 1, "value": getLabel(521942,"若要给已存在的任务导入子任务或后置任务时,则需要在Excel模板中的上级任务或前置任务字段输入已存在的任务,格式为:name_任务名称或者key_任务id") }] }] let _arr = []; condition.map((c, i) => { let arr = []; if (i == 0) { //基本信息 c.items.map((field, index) => { arr.push({ com: (
{getLabel(384040,"未选择任何文件")}
: taskfilelist.map(file =>{file.filename}
)}{val}:{getLabel(28446,"下载EXCEL文档模板")}
); }else{ p = ({val}{getLabel(516144,"请配置任务字段与WBS自定义字段对关系:")}
); } } else { p = (); } return p; } getIllustration1(val, url, index, link) { let p; if (index == 0) { p = (); } else if(index==1){ p = (); } else{ p = (); } return p; } render(){ const { prjImportStore } = this.props; const { spinning } = prjImportStore; return (