1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/DataBaseInfo.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.CodemirrorPage=t.DataBaseInfoPage=void 0;var o=S(a("./node_modules/antd/es/button/index.js")),d=S(a("./node_modules/babel-runtime/helpers/jsx.js")),s=S(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),i=S(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),n=S(a("./node_modules/babel-runtime/helpers/inherits.js")),r=S(a("./node_modules/antd/es/input/index.js")),l=S(a("./node_modules/antd/es/select/index.js"));a("./node_modules/antd/es/button/style/index.js"),a("./node_modules/antd/es/input/style/index.js"),a("./node_modules/antd/es/select/style/index.js");var u=S(a("./node_modules/react/index.js")),p=S(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),c=(S(a("./node_modules/prop-types/index.js")),S(a("./node_modules/lodash/lodash.js"))),f=S(a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/ModalArryTable.jsx")),h=S(a("./src/redux/selectors/enumDic.js")),m=a("./src/redux/reducers/dataSource.js"),g=a("./src/redux/selectors/dataSource.js"),v=a("./node_modules/@ant-design/icons/es/index.js"),x=a("./node_modules/@ant-design/compatible/es/index.js");a("./node_modules/@ant-design/compatible/assets/index.css");var C=a("./node_modules/react-redux/es/index.js"),b=a("./src/module/dataMgr/dataSource/util/formatData.js"),w=a("./src/redux/selectors/dataBases.js");function S(e){return e&&e.__esModule?e:{default:e}}var y=x.Form.Item,D=l.default.Option,F=r.default.TextArea,P=t.DataBaseInfoPage=p.default.div.withConfig({displayName:"DataBaseInfo__DataBaseInfoPage",componentId:"ubwh7a-0"})(["margin-left:-3%;"]),I=t.CodemirrorPage=p.default.div.withConfig({displayName:"DataBaseInfo__CodemirrorPage",componentId:"ubwh7a-1"})(["display:flex;margin-top:5;width:auto;"]),_=(0,d.default)(D,{value:""},void 0,"\u8bf7\u9009\u62e9\u6570\u636e\u5e93"),j=(0,d.default)(D,{value:""},void 0,"\u5f53\u524d\u65f6\u95f4"),M=(0,d.default)(v.SwapOutlined,{}),T=(0,d.default)(v.SwapOutlined,{}),R=(0,d.default)(D,{value:""},void 0,"\u5f53\u524d\u65f6\u95f4"),N=function(e){function t(a){(0,s.default)(this,t);var o=(0,i.default)(this,e.call(this,a));o.componentDidMount=function(){if("add"!==o.props.viewType&&"db"===o.props.dataSourceInfo.dataType){o.modelData.dbId=o.props.dataSourceInfo.dsConf.dbId,o.modelData.tableName=c.default.get(o.props.dataSourceInfo,"dsConf.tableName","");var e=c.default.defaultTo(c.default.get(o.props.dataSourceInfo,"dsConf.cycleMask"),"");o.modelData.cycleMask=e.split("@").length>0?e.split("@")[0]:e,o.modelData.sqlSentence=c.default.defaultTo(c.default.get(o.props.dataSourceInfo,"dsConf.sqlSentence"),""),o.setState({pattern:o.props.pattern,dbId:o.props.dataSourceInfo.dsConf.dbId,tableName:o.props.dataSourceInfo.dsConf.tableName,cycleMask:e.split("@").length>0?e.split("@")[0]:e,sqlSentence:c.default.get(o.props.dataSourceInfo,"dsConf.sqlSentence",""),excursion:e.split("@").length>1?e.split("@")[1]:""});for(var t=o.props.dataBasesArray.toJS().length>0?o.props.dataBasesArray.toJS():[],a=0;a<t.length;a++)if(t[a].dbId===o.props.dataSourceInfo.dsConf.dbId){var d=t[a].dbName;-1!==d.indexOf("DACP_")?o.props.onChange(d,"dacp"):o.props.onChange(d,"db")}}},o.componentWillUpdata=function(){setTimeout((function(){o.setState({pattern:null!==o.props.dataSourceInfo.dsConf.sqlSentence&&""!==o.props.dataSourceInfo.dsConf.sqlSentence?2:1}),o.updatePattern()}),2e3)},o.updatePattern=function(){o.props.setPattern(1===o.state.pattern?2:1),o.setState({pattern:1===o.state.pattern?2:1})},o.changeCodeSql=function(e){o.modelData.sqlSentence=e.target.value,o.props.onChange(o.modelData),o.setState({sqlSentence:e.target.value})},o.selectTableName=function(e){o.modelData.tableName=e.name,o.props.onChange(o.modelData),o.props.form.setFieldsValue({tableName:e.name}),o.setState({queryModalVisible:!1})},o.dbIdChange=function(e){for(var t=o.props.dataBasesArray.toJS().length>0?o.props.dataBasesArray.toJS():[],a=0;a<t.length;a++)if(t[a].dbId===e){var d=t[a].dbName;-1!==d.indexOf("DACP_")?o.props.onChange(d,"dacp"):o.props.onChange(d,"db")}o.modelData.dbId=e,o.props.onChange(o.modelData),o.props.form.setFieldsValue({dbId:e})},o.tableNameChange=function(e){o.modelData.tableName=e.target.value,o.props.onChange(o.modelData),o.props.form.setFieldsValue({tableName:e.target.value})},o.cycleMaskChange=function(e){o.modelData.cycleMask=e.target.value,o.props.onChange(o.modelData),o.props.form.setFieldsValue({cycleMask:e.target.value})},o.validateFun=function(){var e=!1;return o.props.form.validateFieldsAndScroll((function(t){null===t&&(e=!0)})),1===o.state.pattern&&o.modelData.cycleMask&&!(0,b.validatCycleTable)(o.modelData.tableName,o.modelData.cycleMask)?{validate:!1,errorMsg:"\u6570\u636e\u8868\u540d\u548c\u5468\u671f\u503c\u672a\u5bf9\u5e94"}:e?(o.state.excursion&&(o.modelData.cycleMask+="@"+o.state.excursion),1===o.state.pattern&&(o.modelData.sqlSentence=""),{validate:!0,moduleData:o.modelData}):{validate:!1,errorMsg:"\u8bf7\u586b\u5199\u9009\u62e9\u6765\u6e90\u6570\u636e"}},o.showPreview=function(){o.props.dispatch(m.dataSourceActions.resetTableName()),o.modelData.dbId&&o.props.dispatch(m.dataSourceActions.getTableNameRequest({dbName:o.modelData.dbId})),o.setState({queryModalVisible:!0})},o.queryCallVisible=function(){o.setState({queryModalVisible:!1})},o.excursionOnChange=function(e){o.setState({excursion:e})},o.state={pattern:a.pattern,dbId:"",tableName:"",cycleMask:"",sqlSentence:"select * from AAA",queryModalVisible:!1,excursion:""};var d=o.props.setValidateFunc;return c.default.isFunction(d)&&d("dataBaseInfo",o.validateFun),o.modelData={type:"",dbId:"",tableName:"",cycleMask:"",sqlSentence:""},o}return(0,n.default)(t,e),t.prototype.render=function(){var e=this,t=this.props.form.getFieldDecorator,a=this.props.tableNames.size>0?this.props.tableNames.toJS():[],s=this.props.dataBasesArray.toJS().length>0?this.props.dataBasesArray.toJS():[],i=this.props.dicHelper("EXCURSION_NUM").list();return(0,d.default)(P,{},void 0,(0,d.default)(f.default,{loading:this.props.tabLoading,closable:!0,onCancelType:!1,viewType:"view",modalTitle:"\u67e5\u770b\u6570\u636e\u5e93\u8868",width:700,selectTableName:this.selectTableName,data:a,callVisible:this.queryCallVisible,modalVisible:this.state.queryModalVisible}),(0,d.default)(x.Form,{style:{marginLeft:"3%",marginBottom:"2%"},layout:"inline"},void 0,(0,d.default)(y,{style:{display:"grid"},help:""},void 0,t("dbId",{rules:[{required:!0}],initialValue:this.state.dbId})((0,d.default)(l.default,{disabled:this.state.moduleDisabled,getPopupContainer:function(e){return e.parentNode},onChange:this.dbIdChange,style:{marginRight:"10px",width:"270px"}},void 0,_,s.map((function(e){return(0,d.default)(D,{value:e.dbId},e.dbId+c.default.uniqueId(),(0,d.default)("div",{},void 0,e.dbName))}))))),1===this.state.pattern?(0,d.default)("div",{style:{marginTop:"0.6%"}},void 0,(0,d.default)(y,{help:""},void 0,t("tableName",{rules:[{required:!0}],initialValue:this.state.tableName})((0,d.default)(r.default,{disabled:this.props.moduleDisabled,onBlur:this.tableNameChange,placeholder:"\u8bf7\u8f93\u5165\u5468\u671f\u8868\u4f8b\u5982\uff1atest-{YYYYMM}/\u5355\u8868\u540d",style:{marginRight:"16px",width:"270px"}})),(0,d.default)(o.default,{onClick:function(){e.showPreview()},type:"primary",ghost:!0},void 0,"\u8868\u9884\u89c8")),(0,d.default)(y,{help:""},void 0,t("cycleMask",{rules:[{required:!1}],initialValue:this.state.cycleMask})((0,d.default)(r.default,{disabled:this.props.moduleDisabled,onBlur:this.cycleMaskChange,placeholder:"\u8bf7\u8f93\u5165\u8d77\u59cb\u5468\u671f\u8868\u4f8b\u5982\uff1a2018-08",style:{width:"230px"}}))),(0,d.default)(y,{help:""},void 0,(0,d.default)(l.default,{disabled:this.state.moduleDisabled,getPopupContainer:function(e){return e.parentNode},onChange:this.excursionOnChange,value:this.state.excursion,style:{width:"100px"}},void 0,j,i.map((function(e){return(0,d.default)(D,{title:e.txt,value:e.code},e.code,e.txt)})))),(0,d.default)(y,{help:""},void 0,(0,d.default)(o.default,{onClick:this.updatePattern,icon:M,type:"primary",ghost:!0},void 0,1===this.state.pattern?"\u5207\u6362\u81f3SQL\u8bed\u53e5\u6a21\u5f0f":"\u5207\u6362\u81f3\u624b\u52a8\u8f93\u5165\u6a21\u5f0f"))):(0,d.default)(y,{help:""},void 0,(0,d.default)(I,{},void 0,(0,d.default)(F,{style:{width:600,marginRight:10},onChange:this.changeCodeSql,value:this.state.sqlSentence,rows:6}),(0,d.default)("div",{style:{marginLeft:"0.7%"}},void 0,(0,d.default)(o.default,{onClick:this.updatePattern,icon:T,type:"primary",ghost:!0},void 0,1===this.state.pattern?"\u5207\u6362\u81f3SQL\u8bed\u53e5\u6a21\u5f0f":"\u5207\u6362\u81f3\u624b\u52a8\u8f93\u5165\u6a21\u5f0f"))),t("cycleMask",{initialValue:this.state.cycleMask})((0,d.default)(r.default,{disabled:this.props.moduleDisabled,onBlur:this.cycleMaskChange,placeholder:"\u8bf7\u8f93\u5165\u8d77\u59cb\u5468\u671f\u8868\u4f8b\u5982\uff1a2018-08",style:{marginRight:"10px",width:"270px"}})),(0,d.default)(l.default,{disabled:this.state.moduleDisabled,getPopupContainer:function(e){return e.parentNode},onChange:this.excursionOnChange,value:this.state.excursion,style:{width:"130px"}},void 0,R,i.map((function(e){return(0,d.default)(D,{title:e.txt,value:e.code},e.code,e.txt)}))))))},t}(u.default.PureComponent);t.default=(0,C.connect)((function(e){return{dataBasesArray:(0,w.selectDataBasesArrayDown)(e),tableNames:(0,g.selectTableNames)(e),dicHelper:(0,h.default)(e),tabLoading:(0,g.selectTableNamesLoading)(e)}}))(x.Form.create()(N))},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/DataBasePreview.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.TableTail=t.BottomPreview=t.TopPreview=t.DataBasePreviewPage=void 0;var o=y(a("./node_modules/antd/es/table/index.js")),d=y(a("./node_modules/antd/es/input/index.js")),s=y(a("./node_modules/babel-runtime/helpers/jsx.js")),i=y(a("./node_modules/antd/es/message/index.js")),n=y(a("./node_modules/babel-runtime/helpers/extends.js")),r=y(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),l=y(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),u=y(a("./node_modules/babel-runtime/helpers/inherits.js")),p=y(a("./node_modules/antd/es/select/index.js"));a("./node_modules/antd/es/table/style/index.js"),a("./node_modules/antd/es/input/style/index.js"),a("./node_modules/antd/es/message/style/index.js"),a("./node_modules/antd/es/select/style/index.js");var c=y(a("./node_modules/react/index.js")),f=y(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),h=(y(a("./node_modules/prop-types/index.js")),a("./src/components/auth/textAuth.jsx")),m=a("./src/module/dataMgr/dataSource/util/formatData.js"),g=a("./src/components/index.js"),v=a("./node_modules/@ant-design/icons/es/index.js"),x=a("./node_modules/@ant-design/compatible/es/index.js");a("./node_modules/@ant-design/compatible/assets/index.css");var C=a("./src/redux/reducers/dataSource.js"),b=a("./src/redux/selectors/dataSource.js"),w=a("./node_modules/react-redux/es/index.js"),S=a("./src/utils/authPermit.js");function y(e){return e&&e.__esModule?e:{default:e}}var D=x.Form.Item,F=p.default.Option,P=t.DataBasePreviewPage=f.default.div.withConfig({displayName:"DataBasePreview__DataBasePreviewPage",componentId:"sc-78eluc-0"})([".icon{font-size:16px;color:#a2b0c4;cursor:pointer;margin-left:2%;}.errDiv{height:auto;width:100%;margin-top:10px;background:#eff2f7;font-size:12px;color:#475669;letter-spacing:0;line-height:29px;border-radius:2px;text-align:left;padding:5px 0 0 20px;}"]),I=t.TopPreview=f.default.div.withConfig({displayName:"DataBasePreview__TopPreview",componentId:"sc-78eluc-1"})(["height:60px;"]),j=t.BottomPreview=f.default.div.withConfig({displayName:"DataBasePreview__BottomPreview",componentId:"sc-78eluc-2"})(["margin-top:1.1%;.ant-table-thead{th{background:#e0e6ed;}}.ant-table-thead > tr:first-child > th:first-child{border-top-left-radius:4px;}.ant-table table{border-collapse:none;}.ant-table-tbody > tr > td{padding:10px 10px;}.anticon{cursor:pointer;margin-left:10px;}.editable-cell-icon{float:right;padding-top:3px;}.ant-table-thead > tr > th,.ant-table-tbody > tr > td{padding:9px 9px;word-break:break-word;}"]),M=t.TableTail=f.default.div.withConfig({displayName:"DataBasePreview__TableTail",componentId:"sc-78eluc-3"})(["background:#e5e9f2;padding-top:0.5%;padding-left:1%;height:30px;span{font-family:MicrosoftYaHei;font-size:12px;color:#475669;letter-spacing:0;}"]),T=(0,s.default)("span",{},void 0,"\u62bd\u6837\u6761\u6570\uff1a"),R=(0,s.default)("span",{},void 0,"\u968f\u673a\u7b97\u6cd5\uff1a"),N=(0,s.default)(F,{value:"0"},void 0,"topN"),A=(0,s.default)(F,{value:"1"},void 0,"\u968f\u673a\u62bd\u6837"),B=(0,s.default)(F,{value:""},void 0,"\u8bf7\u9009\u62e9\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff08\u9ed8\u8ba4\u7b2c\u4e00\u5217\uff09"),k=(0,s.default)(D,{help:""},void 0,(0,s.default)(v.QuestionCircleOutlined,{className:"icon",title:"\u9009\u62e9\u6570\u636e\u96c6\u4e2d\u7684\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff0c\u4e0d\u9009\u62e9\u5219\u9ed8\u8ba4\u9009\u62e9\u7b2c\u4e00\u5217\u4f5c\u4e3a\u552f\u4e00\u6807\u8bc6"})),q=function(e){function t(a){(0,r.default)(this,t);var o=(0,l.default)(this,e.call(this,a));o.formatInt=function(e){try{return parseInt(e)}catch(e){return 0}},o.componentDidMount=function(){if("add"!==o.props.viewType&&"db"===o.props.dataSourceInfo.dataType){o.modelData.identifyField=o.props.dataSourceInfo.identifyField,o.modelData.extractRows=o.props.dataSourceInfo.extractRows?o.props.dataSourceInfo.extractRows:"",o.modelData.extractType=o.props.dataSourceInfo.extractType,o.setState({identifyField:o.props.dataSourceInfo.identifyField,extractRows:o.props.dataSourceInfo.extractRows?o.props.dataSourceInfo.extractRows:"",extractType:o.props.dataSourceInfo.extractType});var e=(0,n.default)({},o.props.searchCond);o.props.searchCond.tableName&&(e.tableName=(0,m.getCycleTable)(o.props.searchCond.tableName,o.props.searchCond.cycleMask)),o.props.searchCond.sqlSentence&&(e.sqlSentence=(0,m.getCycleTable)(o.props.searchCond.sqlSentence,o.props.searchCond.cycleMask));var t=_.defaultTo(_.get(e,"cycleMask"),"");e.cycleMask=t.split("@").length>1?t.split("@")[0]:t,o.props.dispatch(C.dataSourceActions.getDbPreviewDataRequest(e))}},o.getDbPreviewData=function(){if(o.props.dispatch(C.dataSourceActions.resetDbPreviewData()),1===o.props.pattern)if(""===o.props.searchCond.tableName&&""===o.props.searchCond.cycleMask)i.default.warning(""===o.props.searchCond.dbId?"\u8bf7\u9009\u62e9\u6570\u636e\u5e93!":"\u8bf7\u9009\u62e9\u8868\u540d\u6216\u8005\u5468\u671f\u8868\uff01");else if(o.props.searchCond.cycleMask&&!(0,m.validatCycleTable)(o.props.searchCond.tableName,o.props.searchCond.cycleMask))i.default.warning("\u6570\u636e\u8868\u540d\u548c\u5468\u671f\u503c\u672a\u5bf9\u5e94");else{var e=(0,n.default)({},o.props.searchCond);e.tableName=(0,m.getCycleTable)(o.props.searchCond.tableName,o.props.searchCond.cycleMask);var t=_.defaultTo(_.get(e,"cycleMask"),"");e.cycleMask=t.split("@").length>1?t.split("@")[0]:t,o.props.dispatch(C.dataSourceActions.getDbPreviewDataRequest(e))}else if(""===o.props.searchCond.sqlSentence||null===o.props.searchCond.sqlSentence)i.default.warning("\u8bf7\u586b\u5199sql\u8bed\u53e5!");else{var a=(0,n.default)({},o.props.searchCond);a.sqlSentence=(0,m.getCycleTable)(o.props.searchCond.sqlSentence,o.props.searchCond.cycleMask);var d=_.defaultTo(_.get(a,"cycleMask"),"");a.cycleMask=d.split("@").length>1?d.split("@")[0]:d,o.props.dispatch(C.dataSourceActions.getDbPreviewDataRequest(a))}},o.getOption=function(e,t){for(var a in e)return 0===t&&""===o.state.identifyField&&(o.modelData.identifyField=a,o.setState({identifyField:a})),(0,s.default)(F,{value:a},a+_.uniqueId(),a)},o.getColumns=function(){var e=o.props.dbPreviewData&&0!==o.props.dbPreviewData.size?o.props.dbPreviewData.toJS():{headers:[]};o.modelData.dbPreviewData=e;var t=[];if(e.headers.length>0){for(var a=0;a<e.headers.length;a++){var d={};for(var s in e.headers[a])d.title=""===e.headers[a][s]?""+s:""+e.headers[a][s],d.dataIndex=""+s,d.width="150px";t.push(d)}return o.setState({indexNum:e.headers.length}),t}},o.identifyFieldChange=function(e){o.modelData.identifyField=e,o.setState({identifyField:e})},o.validateFun=function(){var e=!1;return o.props.form.validateFieldsAndScroll((function(t){null===t&&(e=!0)})),!o.userIsAdmin&&-1!==o.maxRow&&""!==o.modelData.extractRows&&parseInt(o.modelData.extractRows)>o.maxRow?{validate:!1,errorMsg:o.maxRow>9999?(0,h.hasText)("root.datasource.adminPhoneMsg")?"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(o.maxRow/1e4)+"\u4e07\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458,"+(0,h.hasText)("root.datasource.adminPhoneMsg"):"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(o.maxRow/1e4)+"\u4e07\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458":(0,h.hasText)("root.datasource.adminPhoneMsg")?"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+o.maxRow+"\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458,"+(0,h.hasText)("root.datasource.adminPhoneMsg"):"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+o.maxRow+"\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458"}:e?{validate:!0,moduleData:o.modelData}:{validate:!1,errorMsg:"\u8bf7\u586b\u5199\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5"}},o.inputNumberChange=function(e){var t=e.target.value;if(o.userIsAdmin||o.row+""==="-1"){/^[0-9]+.?[0-9]*$/.test(t)?(o.modelData.extractRows=t,o.setState({extractRows:t})):(o.modelData.extractRows="",o.setState({extractRows:""}))}else{/^[0-9]+.?[0-9]*$/.test(t)?(o.modelData.extractRows=t,o.setState({extractRows:t})):(o.modelData.extractRows="",o.setState({extractRows:""}))}},o.extractTypeChange=function(e){o.modelData.extractType=e,o.setState({extractType:e})},o.state={identifyField:"",indexNum:0,extractRows:"",extractType:"0"},o.row=o.formatInt((0,h.hasText)("root.datasource.extractRow")),o.maxRow=o.formatInt((0,h.hasText)("root.datasource.maxExtractRow"));var d=o.props.setValidateFunc;_.isFunction(d)&&d("dataBasePreview",o.validateFun);var u=o.props.setPreviewFunc;return _.isFunction(u)&&u("db",o.getDbPreviewData),o.modelData={identifyField:"",dbPreviewData:[],extractRows:"",extractType:"0"},o.userIsAdmin=(0,S.isUserAdmin)(),o}return(0,u.default)(t,e),t.prototype.render=function(){var e=this,t=this.props.form.getFieldDecorator,a=0!==this.props.dbPreviewData.size?this.props.dbPreviewData.toJS():{headers:[]};return(0,s.default)(P,{},void 0,(0,s.default)(x.Form,{layout:"inline"},void 0,(0,s.default)(I,{},void 0,(0,s.default)(D,{help:""},void 0,T,(0,s.default)(d.default,{style:{top:1,width:150},placeholder:"\u5168\u90e8",value:""===this.state.extractRows?"":parseInt(this.state.extractRows),onChange:this.inputNumberChange})),(0,s.default)(D,{help:""},void 0,R,(0,s.default)(p.default,{disabled:this.state.moduleDisabled,getPopupContainer:function(e){return e.parentNode},onChange:this.extractTypeChange,style:{width:"270px"},value:this.state.extractType},void 0,N,A)),(0,s.default)(D,{help:""},void 0,t("identifyField",{initialValue:this.state.identifyField})((0,s.default)(p.default,{showSearch:!0,getPopupContainer:function(e){return e.parentNode},disabled:this.state.moduleDisabled,onChange:this.identifyFieldChange,style:{width:"250px"}},void 0,B,void 0!==a.headers?a.headers.map((function(t,a){return e.getOption(t,a)})):""))),k),(0,s.default)("div",{style:{fontSize:12,color:"red",marginTop:"-6px"}},void 0,this.maxRow+""==="-1"?"":"\u5efa\u8bae\u6570\u636e\u6761\u6570\u63a7\u5236\u5728"+Math.floor(this.row/1e4)+" \u4e07\u4ee5\u5185\uff0c\u6570\u636e\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(this.maxRow/1e4)+"\u4e07\u6761")),this.props.loading&&(0,s.default)(g.LoadingIndicator,{style:{marginTop:50},position:"relative"}),void 0!==a.data&&a.data.length>0?(0,s.default)(j,{},void 0,(0,s.default)(o.default,{dataSource:a.data,rowKey:_.uniqueId(),scroll:{x:150*this.state.indexNum,y:240},bordered:!0,pagination:!1,columns:this.getColumns()}),(0,s.default)(M,{},void 0,(0,s.default)("span",{},void 0,"\u5171 ",a.headers.length," \u6761\u6307\u6807"))):!this.props.loading&&a.headers.length>0?(0,s.default)("div",{className:"errDiv"},void 0,this.props.dbPreviewError):"")},t}(c.default.PureComponent);t.default=(0,w.connect)((function(e){return{dbPreviewError:(0,b.selectDbPreviewError)(e),dbPreviewData:(0,b.selectDbPreviewDataList)(e),loading:(0,b.selectDbPreviewDataListLoading)(e)}}))(x.Form.create()(q))},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FileInfo.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.DownConfigDom=t.UpConfigDom=t.FileInfoPage=void 0;var o=x(a("./node_modules/antd/es/upload/index.js")),d=x(a("./node_modules/babel-runtime/helpers/extends.js")),s=x(a("./node_modules/antd/es/button/index.js")),i=x(a("./node_modules/babel-runtime/helpers/jsx.js")),n=x(a("./node_modules/antd/es/message/index.js")),r=x(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),l=x(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),u=x(a("./node_modules/babel-runtime/helpers/inherits.js"));a("./node_modules/antd/es/upload/style/index.js"),a("./node_modules/antd/es/button/style/index.js"),a("./node_modules/antd/es/message/style/index.js");var p=x(a("./node_modules/react/index.js")),c=x(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),f=(x(a("./node_modules/prop-types/index.js")),a("./src/utils/publicPath.js")),h=a("./src/utils/authPermit.js"),m=a("./node_modules/@ant-design/icons/es/index.js"),g=a("./src/redux/reducers/dataSource.js"),v=a("./node_modules/react-redux/es/index.js");function x(e){return e&&e.__esModule?e:{default:e}}var C=t.FileInfoPage=c.default.div.withConfig({displayName:"FileInfo__FileInfoPage",componentId:"sc-121w952-0"})(["margin-left:-3%;"]),b=t.UpConfigDom=c.default.div.withConfig({displayName:"FileInfo__UpConfigDom",componentId:"sc-121w952-1"})(["margin:3% 0 2% 3%;display:flex;width:90%;span{font-size:12px;letter-spacing:0;line-height:14px;}"]),w=t.DownConfigDom=c.default.div.withConfig({displayName:"FileInfo__DownConfigDom",componentId:"sc-121w952-2"})(["width:90%;display:inline-flex;margin:0 0 0 3%;.fileDiv{background:#e5e9f2;padding:0.3% 0 0.3% 0;margin-bottom:2.5%;width:40%;.down-name{margin-left:5px;font-size:12px;color:#475669;letter-spacing:0;line-height:14px;}}"]),S=(0,i.default)(m.DownloadOutlined,{}),y=function(e){function t(a){(0,r.default)(this,t);var o=(0,l.default)(this,e.call(this,a));o.componentDidMount=function(){if("add"!==o.props.viewType&&"file"===o.props.dataSourceInfo.dataType){var e=o.props.dataSourceInfo.dsConf.filePath?o.props.dataSourceInfo.dsConf.filePath.substring(o.props.dataSourceInfo.dsConf.filePath.lastIndexOf("@")+1,o.props.dataSourceInfo.dsConf.filePath.length):"",t=[{uid:"-1",name:e,type:"text/plain"}];o.setState({fileList:t,filePath:e}),o.modelData.filePath=o.props.dataSourceInfo.dsConf.filePath,o.getFilePreviewData()}},o.getFilePreviewData=function(){o.props.dispatch(g.dataSourceActions.resetDbPreviewData()),o.props.dispatch(g.dataSourceActions.getFilePreviewDataRequest(o.props.searchCond))},o.beforeUpload=function(e){var t=e.name,a=t.substring(t.lastIndexOf(".")+1,t.length),o=!0;return"txt"!==a&&"csv"!==a&&(o=!1,n.default.error("\u53ea\u652f\u6301txt/csv\uff0c\u683c\u5f0f\u6587\u4ef6")),o},o.downFile=function(){window.location.href=(0,f.urlFormat)("/api/datasources/actions/downloadImportFileSample?token="+encodeURI((0,h.getToken)()))},o.validateFun=function(){return""!==o.modelData.filePath?{validate:!0,moduleData:o.modelData}:{validate:!1,errorMsg:"\u8bf7\u586b\u4e0a\u4f20\u6587\u4ef6!"}},o.state={filePath:"",fileList:[]};var d=o.props.setValidateFunc;return _.isFunction(d)&&d("fileInfo",o.validateFun),o.modelData={filePath:""},o}return(0,u.default)(t,e),t.prototype.render=function(){var e=this,t=this,a=(0,h.getToken)(),r={multiple:!0,listType:"picture",name:"file",action:(0,f.urlFormat)("/api/datasources/actions/uploadDataFile"),headers:{Authorization:a},onChange:function(e){var a=e.fileList,o=e.file.name;if(a.length>1&&(a=a.slice(-1)),a=a.map((function(e){return e.response&&e.response.code,e})),t.setState({fileList:a,filePath:o}),"uploading"===e.file.status&&""===t.state.filePath&&n.default.success(e.file.name+" \u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u540e.........."),"removed"===e.file.status&&(t.setState({filePath:"",fileList:[]}),n.default.success(e.file.name+" \u5220\u9664\u6210\u529f\uff01"),t.props.dispatch(g.dataSourceActions.resetDbPreviewData()),t.props.onChange("filePath","")),"done"===e.file.status)if(void 0!==e.file.response.data[0]&&""!==e.file.response.data[0]){t.props.onChange("filePath",e.file.response.data[0]);var d=e.file.response.data[1];d="\t"===d?"\\t":d,t.props.onChange("fileSplitChar",d),t.modelData.filePath=e.file.response.data[0],t.getFilePreviewData(),n.default.success(e.file.name+" \u4e0a\u4f20\u6210\u529f\uff01")}else t.props.onChange("filePath",e.file.response.data[0]),t.props.onChange("fileSplitChar",e.file.response.data[1]),t.modelData.filePath=e.file.response.data[0],n.default.success(e.file.name+" \u4e0a\u4f20\u6210\u529f\uff01\u4f46\u662f\u672a\u5339\u914d\u5230\u4efb\u4f55\u6570\u636e!")}};return(0,i.default)(C,{},void 0,(0,i.default)(b,{},void 0,p.default.createElement(o.default,(0,d.default)({fileList:this.state.fileList,beforeUpload:this.beforeUpload},r,{__source:{fileName:"C:\\Users\\leo\\workspace\\aihub-web\\src\\module\\dataMgr\\dataSource\\dataSourceEditAdvanced\\components\\FileInfo.jsx",lineNumber:179}}),(0,i.default)(s.default,{style:{width:"100px"},type:"primary"},void 0,"\u70b9\u51fb\u4e0a\u4f20\u6587\u4ef6")),(0,i.default)(s.default,{style:{marginLeft:"16px",width:"140px"},onClick:function(){e.downFile()},icon:S},void 0,"\u4e0b\u8f7d\u6570\u636e\u6587\u4ef6\u6837\u4f8b")),(0,i.default)(w,{style:{display:""!==this.state.filePath?"none":"block"}},void 0,(0,i.default)("div",{className:"fileDiv"},void 0,(0,i.default)(m.PaperClipOutlined,{style:{marginLeft:"1%",color:"#B1BECF"}}),(0,i.default)("span",{className:"down-name"},void 0,""!==this.state.filePath?this.state.filePath:"\u53ea\u80fd\u4e0a\u4f20(\u6307\u5b9a\u7c7b\u578b)\u7c7b\u578b\u6587\u4ef6"))))},t}(p.default.PureComponent);t.default=(0,v.connect)((function(){return{}}))(y)},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FilePreview.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.TableTail=t.BottomPreview=t.TopPreview=t.PreviewPage=void 0;var o=I(a("./node_modules/antd/es/table/index.js")),d=I(a("./node_modules/antd/es/switch/index.js")),s=I(a("./node_modules/antd/es/tooltip/index.js")),i=I(a("./node_modules/antd/es/input/index.js")),n=I(a("./node_modules/antd/es/col/index.js")),r=I(a("./node_modules/antd/es/row/index.js")),l=I(a("./node_modules/babel-runtime/helpers/extends.js")),u=I(a("./node_modules/babel-runtime/helpers/jsx.js")),p=I(a("./node_modules/antd/es/message/index.js")),c=I(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),f=I(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),h=I(a("./node_modules/babel-runtime/helpers/inherits.js")),m=I(a("./node_modules/antd/es/select/index.js"));a("./node_modules/antd/es/table/style/index.js"),a("./node_modules/antd/es/switch/style/index.js"),a("./node_modules/antd/es/tooltip/style/index.js"),a("./node_modules/antd/es/input/style/index.js"),a("./node_modules/antd/es/col/style/index.js"),a("./node_modules/antd/es/row/style/index.js"),a("./node_modules/antd/es/message/style/index.js"),a("./node_modules/antd/es/select/style/index.js");var g=I(a("./node_modules/react/index.js")),v=I(a("./node_modules/lodash/lodash.js")),x=I(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),C=a("./src/components/index.js"),b=(I(a("./node_modules/prop-types/index.js")),a("./node_modules/@ant-design/icons/es/index.js")),w=a("./node_modules/@ant-design/compatible/es/index.js");a("./node_modules/@ant-design/compatible/assets/index.css");var S=a("./src/redux/reducers/dataSource.js"),y=a("./src/redux/selectors/dataSource.js"),D=a("./src/components/auth/textAuth.jsx"),F=a("./node_modules/react-redux/es/index.js"),P=a("./src/utils/authPermit.js");function I(e){return e&&e.__esModule?e:{default:e}}var _=m.default.Option,j=w.Form.Item,M=t.PreviewPage=x.default.div.withConfig({displayName:"FilePreview__PreviewPage",componentId:"pqc10v-0"})([".ant-col-7{display:block;-webkit-box-sizing:border-box;box-sizing:border-box;width:26%;}.errDiv{height:auto;width:100%;margin-top:20px;background:#eff2f7;font-size:12px;color:#475669;letter-spacing:0;line-height:29px;border-radius:2px;text-align:left;padding:5px 0 0 20px;}.icon{font-size:16px;color:#a2b0c4;cursor:pointer;margin-left:10px;margin-top:2px;}"]),T=t.TopPreview=x.default.div.withConfig({displayName:"FilePreview__TopPreview",componentId:"pqc10v-1"})(["margin-bottom:5px;height:60px;"]),R=t.BottomPreview=x.default.div.withConfig({displayName:"FilePreview__BottomPreview",componentId:"pqc10v-2"})(["margin-top:1.1%;.ant-table-thead{th{background:#e0e6ed;}}.ant-table-thead > tr:first-child > th:first-child{border-top-left-radius:4px;}.ant-table table{border-collapse:none;}.ant-table-tbody > tr > td{padding:10px 10px;}.anticon{cursor:pointer;margin-left:10px;}.editable-cell-icon{float:right;padding-top:3px;}.ant-table-thead > tr > th,.ant-table-tbody > tr > td{padding:9px 9px;word-break:break-word;}"]),N=t.TableTail=x.default.div.withConfig({displayName:"FilePreview__TableTail",componentId:"pqc10v-3"})(["background:#e5e9f2;padding-left:1%;line-height:46px;span{font-family:MicrosoftYaHei;font-size:12px;color:#475669;letter-spacing:0;}"]),A=(0,u.default)("span",{},void 0,"\u62bd\u6837\u6761\u6570\uff1a"),B=(0,u.default)("span",{},void 0,"\u968f\u673a\u7b97\u6cd5\uff1a"),k=(0,u.default)(_,{value:"0"},void 0,"topN"),q=(0,u.default)(_,{value:"1"},void 0,"\u968f\u673a\u62bd\u6837"),V=(0,u.default)(j,{help:""},void 0,(0,u.default)(b.QuestionCircleOutlined,{className:"icon",title:"\u9009\u62e9\u6570\u636e\u96c6\u4e2d\u7684\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff0c\u4e0d\u9009\u62e9\u5219\u9ed8\u8ba4\u9009\u62e9\u7b2c\u4e00\u5217\u4f5c\u4e3a\u552f\u4e00\u6807\u8bc6"})),E=(0,u.default)(b.QuestionCircleOutlined,{className:"icon",title:"\u586b\u5199\u6570\u636e\u6587\u4ef6\u5206\u5272\u7b26\u53f7"}),O=(0,u.default)("span",{className:"titleSpan"},void 0,"\u5c06\u9996\u884c\u8bbe\u4e3a\u6807\u9898"),H=function(e){function t(a){(0,c.default)(this,t);var o=(0,f.default)(this,e.call(this,a));o.formatInt=function(e){try{return parseInt(e)}catch(e){return 0}},o.componentDidMount=function(){"add"!==o.props.viewType&&"file"===o.props.dataSourceInfo.dataType&&(o.modelData.identifyField=o.props.dataSourceInfo.identifyField,o.modelData.fileSplitChar=o.props.dataSourceInfo.dsConf.fileSplitChar,o.modelData.fileHeaderFlag=o.props.dataSourceInfo.dsConf.fileHeaderFlag,o.modelData.extractRows=o.props.dataSourceInfo.extractRows?o.props.dataSourceInfo.extractRows:"",o.modelData.extractType=o.props.dataSourceInfo.extractType,o.setState({identifyField:o.props.dataSourceInfo.identifyField,fileSplitChar:o.props.dataSourceInfo.dsConf.fileSplitChar,fileHeaderFlag:o.props.dataSourceInfo.dsConf.fileHeaderFlag,extractRows:o.props.dataSourceInfo.extractRows?o.props.dataSourceInfo.extractRows:"",extractType:o.props.dataSourceInfo.extractType}),o.props.dispatch(S.dataSourceActions.getFilePreviewDataRequest(o.props.searchCond)))},o.getFilePreviewData=function(){o.props.dispatch(S.dataSourceActions.resetDbPreviewData()),null===o.props.searchCond.filePath||""===o.props.searchCond.filePath||void 0===o.props.searchCond.filePath?p.default.warning("\u8bf7\u4e0a\u4f20\u6587\u4ef6!"):null===o.state.fileSplitChar||""===o.state.fileSplitChar||void 0===o.state.fileSplitChar?p.default.warning("\u8bf7\u586b\u5199\u5206\u9694\u7b26!"):o.props.dispatch(S.dataSourceActions.getFilePreviewDataRequest(o.props.searchCond))},o.getIndexOption=function(e,t){for(var a in e)return 0===t&&"\u8bf7\u9009\u62e9\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff08\u9ed8\u8ba4\u7b2c\u4e00\u5217\uff09"===o.state.identifyField&&(o.modelData.identifyField=e[a],o.setState({identifyField:e[a]})),(0,u.default)(_,{value:e[a]},e[a]+v.default.uniqueId(),e[a])},o.getColumns=function(){var e=0!==o.props.dbPreviewData.size?o.props.dbPreviewData.toJS():[];o.modelData.dbPreviewData=e;var t=[];if(e.headers.length>0||e.headersByIndex.length>0){for(var a=1===o.state.fileHeaderFlag?e.headers:e.headersByIndex,d=0;d<a.length;d++){var s={};for(var i in a[d])s.title=""===a[d][i]?""+i:""+a[d][i],s.dataIndex=""+i,s.width="150px",s.key=v.default.uniqueId();t.push(s)}return o.setState({indexNum:e.headers.length}),t}},o.onSwitchChange=function(e){o.modelData.fileHeaderFlag=e?1:0,o.props.onChange("fileHeaderFlag",o.modelData.fileHeaderFlag),o.setState({fileHeaderFlag:o.modelData.fileHeaderFlag})},o.fileSplitCharBlur=function(e){o.modelData.fileSplitChar=e.target.value,o.props.onChange("fileSplitChar",e.target.value),o.getFilePreviewData()},o.identifyFieldChange=function(e){o.modelData.identifyField=e,o.setState({identifyField:e})},o.validateFun=function(){var e=!1;return o.props.form.validateFieldsAndScroll((function(t){null===t&&(e=!0)})),o.modelData.fileSplitChar.length>3?{validate:!1,errorMsg:"\u5b57\u6bb5\u5206\u9694\u7b26\u4e0d\u80fd\u8d85\u8fc7\u4e09\u4e2a\u5b57\u7b26!"}:""===o.modelData.identifyField?{validate:!1,errorMsg:"\u8bf7\u9009\u62e9\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5"}:!o.userIsAdmin&&o.maxRow+""!=="-1"&&""!==o.modelData.extractRows&&parseInt(o.modelData.extractRows)>o.maxRow?{validate:!1,errorMsg:o.maxRow>9999?(0,D.hasText)("root.datasource.adminPhoneMsg")?"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(o.maxRow/1e4)+"\u4e07\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458,"+(0,D.hasText)("root.datasource.adminPhoneMsg"):"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(o.maxRow/1e4)+"\u4e07\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458":(0,D.hasText)("root.datasource.adminPhoneMsg")?"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+o.maxRow+"\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458,"+(0,D.hasText)("root.datasource.adminPhoneMsg"):"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+o.maxRow+"\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458"}:e?{validate:!0,moduleData:o.modelData}:{validate:!1,errorMsg:"\u8bf7\u586b\u5206\u9694\u7b26!"}},o.inputNumberChange=function(e){var t=e.target.value;if(o.userIsAdmin||o.row+""==="-1"){/^[0-9]+.?[0-9]*$/.test(t)?(o.modelData.extractRows=t,o.setState({extractRows:t})):(o.modelData.extractRows="",o.setState({extractRows:""}))}else{/^[0-9]+.?[0-9]*$/.test(t)?(o.modelData.extractRows=t,o.setState({extractRows:t})):(o.modelData.extractRows="",o.setState({extractRows:""}))}},o.extractTypeChange=function(e){o.modelData.extractType=e,o.setState({extractType:e})},o.state={_this:o,fileSplitChar:"",fileHeaderFlag:"add"!==o.props.viewType?v.default.get(o.props,"dataSourceInfo.dsConf.fileHeaderFlag"):1,identifyField:"\u8bf7\u9009\u62e9\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff08\u9ed8\u8ba4\u7b2c\u4e00\u5217\uff09",indexNum:0,extractRows:"",extractType:"0"},o.row=o.formatInt((0,D.hasText)("root.datasource.extractRow")),o.maxRow=o.formatInt((0,D.hasText)("root.datasource.maxExtractRow")),o.selectIdentifyField="";var d=o.props.setValidateFunc;v.default.isFunction(d)&&d("filePreview",o.validateFun);var s=o.props.setPreviewFunc;return v.default.isFunction(s)&&s("file",o.getFilePreviewData),o.modelData={fileSplitChar:"",fileHeaderFlag:1,identifyField:"",dbPreviewData:"",extractRows:"",extractType:"0"},o.userIsAdmin=(0,P.isUserAdmin)(),o}return(0,h.default)(t,e),t.getDerivedStateFromProps=function(e,t){return void 0!==e.fileSplitChar&&null!==e.fileSplitChar&&""!==e.fileSplitChar&&e.fileSplitChar!==t.fileSplitChar?(e.form.setFieldsValue({fileSplitChar:e.fileSplitChar}),t._this.modelData.fileSplitChar=e.fileSplitChar,{fileSplitChar:e.fileSplitChar}):""===e.filePath?(e.form.setFieldsValue({fileSplitChar:""}),t._this.modelData.fileSplitChar="",t._this.modelData.identifyField="",e.onChange("filePath","1"),{identifyField:"\u8bf7\u9009\u62e9\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff08\u9ed8\u8ba4\u7b2c\u4e00\u5217\uff09",fileSplitChar:""}):null},t.prototype.setHeaders=function(){for(var e=this.props.dbPreviewData.toJS(),t=e.headers,a=new Object,o=0;o<t.length;o++)for(var d in t[o])a[d]=t[o][d];return e.data&&e.data.unshift(a),e},t.prototype.render=function(){var e=this,t=this.props.form.getFieldDecorator,a=0!==this.props.dbPreviewData.size?1===this.state.fileHeaderFlag?(0,l.default)({},this.props.dbPreviewData.toJS()):this.setHeaders():{};return(0,u.default)(M,{},void 0,(0,u.default)(w.Form,{style:{height:105},layout:"inline"},void 0,(0,u.default)(T,{},void 0,(0,u.default)(r.default,{},void 0,(0,u.default)(n.default,{span:7},void 0,(0,u.default)(j,{help:""},void 0,A,(0,u.default)(i.default,{style:{top:1,width:150},placeholder:"\u5168\u90e8",value:""===this.state.extractRows?"":parseInt(this.state.extractRows),onChange:this.inputNumberChange}))),(0,u.default)(j,{help:""},void 0,B,(0,u.default)(m.default,{disabled:this.state.moduleDisabled,onChange:this.extractTypeChange,getPopupContainer:function(e){return e.parentNode},value:this.state.extractType,style:{width:"260px"}},void 0,k,q)),(0,u.default)(j,{help:""},void 0,t("identifyField",{initialValue:this.state.identifyField})((0,u.default)(m.default,{showSearch:!0,value:this.state.identifyField,getPopupContainer:function(e){return e.parentNode},disabled:this.state.moduleDisabled,onChange:this.identifyFieldChange,style:{width:"250px"}},void 0,void 0!==a.headers&&void 0!==a.headersByIndex?1===this.state.fileHeaderFlag?a.headers.map((function(t,a){return e.getIndexOption(t,a)})):a.headersByIndex.map((function(t,a){return e.getIndexOption(t,a)})):""))),V)),(0,u.default)("div",{style:{fontSize:12,color:"red",marginTop:"-5px"}},void 0,this.maxRow+""==="-1"?"":"\u5efa\u8bae\u6570\u636e\u6761\u6570\u63a7\u5236\u5728"+Math.floor(this.row/1e4)+" \u4e07\u4ee5\u5185\uff0c\u6570\u636e\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(this.maxRow/1e4)+"\u4e07\u6761"),(0,u.default)(r.default,{},void 0,(0,u.default)(n.default,{span:6},void 0,(0,u.default)(j,{help:""},void 0,(0,u.default)("span",{style:{marginRight:-3}},void 0,"\u5206 \u9694 \u7b26 \uff1a"),t("fileSplitChar",{rules:[{required:!0}],initialValue:this.state.fileSplitChar})((0,u.default)(i.default,{onBlur:this.fileSplitCharBlur,style:{width:"80px",margin:"-2px 0px 0 5px"},placeholder:"\u586b\u5199\u5206\u9694\u7b26"})),(0,u.default)(s.default,{title:'\u5b57\u6bb5\u5206\u9694\u7b26\u9ed8\u8ba4\u53ef\u8bc6\u522b[ "Tab\u952e"\u3001"\u9017\u53f7" "\u5206\u53f7" "@"\u3001"|" ] ,\u4e5f\u53ef\u81ea\u5b9a\u4e49\u8f93\u5165'},void 0,E))),(0,u.default)(j,{help:""},void 0,O,(0,u.default)(d.default,{checkedChildren:"\u662f",unCheckedChildren:"\u5426",defaultChecked:1===this.state.fileHeaderFlag,style:{margin:"-2px 20px 0 10px"},onChange:this.onSwitchChange})))),this.props.loading&&(0,u.default)(C.LoadingIndicator,{style:{marginTop:50},position:"relative"}),void 0!==a.data&&a.data.length>0?(0,u.default)(R,{},void 0,(0,u.default)(o.default,{dataSource:a.data,rowKey:v.default.uniqueId(),scroll:{x:150*this.state.indexNum,y:240},bordered:!0,pagination:!1,columns:this.getColumns()}),(0,u.default)(N,{},void 0,(0,u.default)("span",{},void 0,"\u5171 ",a.headers.length," \u6761\u6307\u6807"))):this.props.loading?"":(0,u.default)("div",{className:"errDiv"},void 0,this.props.filePreviewError))},t}(g.default.PureComponent);t.default=(0,F.connect)((function(e){return{filePreviewError:(0,y.selectFilePreviewError)(e),dbPreviewData:(0,y.selectDbPreviewDataList)(w.Form.create()(e)),loading:(0,y.selectDbPreviewDataListLoading)(e)}}))(w.Form.create()(H))},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FtpInfo.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.DownConfigDom=t.UpConfigDom=t.FtpInfoPage=void 0;var o=v(a("./node_modules/antd/es/auto-complete/index.js")),d=v(a("./node_modules/antd/es/input/index.js")),s=v(a("./node_modules/babel-runtime/helpers/jsx.js")),i=v(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),n=v(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),r=v(a("./node_modules/babel-runtime/helpers/inherits.js")),l=v(a("./node_modules/antd/es/select/index.js"));a("./node_modules/antd/es/auto-complete/style/index.js"),a("./node_modules/antd/es/input/style/index.js"),a("./node_modules/antd/es/select/style/index.js");var u=v(a("./node_modules/react/index.js")),p=v(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),c=(v(a("./node_modules/prop-types/index.js")),a("./src/redux/reducers/sysManager/ftpBasesManager.js")),f=a("./src/redux/selectors/sysManager/ftpBasesManager.js"),h=a("./src/redux/reducers/dataSource.js"),m=a("./node_modules/@ant-design/compatible/es/index.js");a("./node_modules/@ant-design/compatible/assets/index.css");var g=a("./node_modules/react-redux/es/index.js");function v(e){return e&&e.__esModule?e:{default:e}}var x=m.Form.Item,C=l.default.Option,b=t.FtpInfoPage=p.default.div.withConfig({displayName:"FtpInfo__FtpInfoPage",componentId:"p4g9im-0"})(["margin-left:-3%;"]),w=(t.UpConfigDom=p.default.div.withConfig({displayName:"FtpInfo__UpConfigDom",componentId:"p4g9im-1"})(["margin:1.8% 0 2.2% 3%;display:flex;width:100%;span{font-size:12px;letter-spacing:0;line-height:14px;}.ant-upload-list{display:none;font-family:'Microsoft Yahei','STXihei','sans-serif';font-size:12px;line-height:1.5;color:rgba(0,0,0,0.65);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;list-style:none;zoom:1;width:100%;}"]),t.DownConfigDom=p.default.div.withConfig({displayName:"FtpInfo__DownConfigDom",componentId:"p4g9im-2"})(["width:100%;display:inline-flex;margin:0 0 0 3%;.fileDiv{background:#e5e9f2;padding:0.3% 0 0.3% 0;width:40%;.down-name{margin-left:5px;font-size:12px;color:#475669;letter-spacing:0;line-height:14px;}}"]),(0,s.default)(C,{value:""},void 0,"\u8bf7\u9009\u62e9")),S=function(e){function t(a){(0,i.default)(this,t);var o=(0,n.default)(this,e.call(this,a));o.getFtpPreviewData=function(){o.props.dispatch(h.dataSourceActions.resetDbPreviewData()),o.props.dispatch(h.dataSourceActions.getFtpPreviewDataRequest(o.props.searchCond))},o.componentDidMount=function(){o.props.dispatch(c.ftpBasesActions.getFtpArrayRequest()),"add"!==o.props.viewType&&"ftp"===o.props.dataSourceInfo.dataType&&(o.modelData.ftpId=o.props.dataSourceInfo.dsConf.ftpId,o.modelData.ftpFileName=o.props.dataSourceInfo.dsConf.ftpFileName,o.modelData.filePath=o.props.dataSourceInfo.dsConf.filePath,o.setState({ftpId:o.props.dataSourceInfo.dsConf.ftpId,ftpFileName:o.props.dataSourceInfo.dsConf.ftpFileName,filePath:o.props.dataSourceInfo.dsConf.filePath}),o.modelData.ftpId&&o.modelData.filePath&&o.props.dispatch(c.ftpBasesActions.getFtpFileRequest({ftpId:o.modelData.ftpId,filePath:o.modelData.filePath})))},o.ftpIdChange=function(e){var t=o.props.datasFtps.toJS();o.modelData.ftpId=e,o.props.onChange("ftpId",e);for(var a=0;a<t.length;a++)if(t[a].ftpId===e){o.props.onChange("filePath",t[a].ftpFilepath),o.modelData.filePath=t[a].ftpFilepath,o.props.form.setFieldsValue({filePath:t[a].ftpFilepath,ftpId:e});break}o.modelData.ftpId&&o.modelData.filePath&&(o.props.dispatch(c.ftpBasesActions.resetFtpFile()),o.props.dispatch(c.ftpBasesActions.getFtpFileRequest({ftpId:o.modelData.ftpId,ftpPath:o.modelData.filePath})),o.props.onChange("ftpFileName",""),o.props.form.setFieldsValue({ftpFileName:""}))},o.filePathChange=function(e){o.modelData.filePath=e.target.value,o.props.onChange("filePath",e.target.value),o.props.form.setFieldsValue({filePath:e.target.value}),o.modelData.ftpId&&o.modelData.filePath&&(o.props.dispatch(c.ftpBasesActions.resetFtpFile()),o.props.dispatch(c.ftpBasesActions.getFtpFileRequest({ftpId:o.modelData.ftpId,ftpPath:o.modelData.filePath})),o.props.onChange("ftpFileName",""),o.props.form.setFieldsValue({ftpFileName:""}))},o.ftpFileNameChange=function(e){o.modelData.ftpFileName=e,null===e||""===e||void 0===e?(o.props.onChange("ftpFileName",""),o.props.form.setFieldsValue({ftpFileName:""})):(o.props.onChange("ftpFileName",e),o.props.form.setFieldsValue({ftpFileName:e}),o.getFtpPreviewData())},o.validateFun=function(){var e=!1;return o.props.form.validateFieldsAndScroll((function(t){null===t&&(e=!0)})),e?{validate:!0,moduleData:o.modelData}:{validate:!1,errorMsg:"\u8bf7\u586b\u5199FTP\u6587\u4ef6\u4fe1\u606f"}},o.setFtpFiles=function(e){for(var t=[],a=0;a<e.length;a++)t.push(e[a].fileName);return t},o.state={ftpId:"",filePath:"",ftpFileName:""},o.props.dispatch(c.ftpBasesActions.resetFtpFile());var d=o.props.setValidateFunc;return _.isFunction(d)&&d("ftpInfo",o.validateFun),o.modelData={ftpId:"",ftpFileName:"",filePath:""},o}return(0,r.default)(t,e),t.prototype.render=function(){var e=this,t=this.props.form.getFieldDecorator,a=this.props.datasFtps.toJS(),i=this.props.ftpFiles.size>0?this.setFtpFiles(this.props.ftpFiles.toJS()):[];return(0,s.default)(b,{},void 0,(0,s.default)(m.Form,{style:{marginLeft:"3%",marginBottom:"2%"},layout:"inline"},void 0,(0,s.default)(x,{style:{display:"grid"},help:""},void 0,t("ftpId",{rules:[{required:!0}],initialValue:this.state.ftpId})((0,s.default)(l.default,{disabled:this.state.moduleDisabled,onChange:this.ftpIdChange,getPopupContainer:function(e){return e.parentNode},style:{marginRight:"10px",width:"270px"}},void 0,w,a.map((function(e,t){return(0,s.default)(C,{value:e.ftpId},t,e.ftpName)}))))),(0,s.default)("div",{style:{marginTop:"0.6%"}},void 0,(0,s.default)(x,{help:""},void 0,t("filePath",{rules:[{required:!0}],initialValue:this.state.filePath})((0,s.default)(d.default,{disabled:this.props.moduleDisabled,onBlur:this.filePathChange,placeholder:"FTP\u6587\u4ef6\u8def\u5f84",style:{marginRight:"10px",width:"270px"}}))),(0,s.default)(x,{help:""},void 0,"\u6587\u4ef6\u540d",t("ftpFileName",{initialValue:this.state.ftpFileName})((0,s.default)(o.default,{getPopupContainer:function(e){return e.parentNode},disabled:this.state.moduleDisabled,dataSource:i,onBlur:function(t){return e.ftpFileNameChange(t.target.value)},style:{marginLeft:"10px",marginRight:"10px",width:"270px"},filterOption:function(e,t){return-1!==t.props.children.toUpperCase().indexOf(e.toUpperCase())},placeholder:"\u8bf7\u9009\u62e9"}))))))},t}(u.default.PureComponent);t.default=(0,g.connect)((function(e){return{ftpFiles:(0,f.selectFtpFiles)(e),datasFtps:(0,f.selectFtpBasesArray)(e)}}))(m.Form.create()(S))},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FtpPreview.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.TableTail=t.BottomPreview=t.TopPreview=t.PreviewPage=void 0;var o=F(a("./node_modules/antd/es/table/index.js")),d=F(a("./node_modules/antd/es/switch/index.js")),s=F(a("./node_modules/antd/es/input/index.js")),i=F(a("./node_modules/antd/es/col/index.js")),n=F(a("./node_modules/antd/es/row/index.js")),r=F(a("./node_modules/babel-runtime/helpers/extends.js")),l=F(a("./node_modules/antd/es/message/index.js")),u=F(a("./node_modules/babel-runtime/helpers/jsx.js")),p=F(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),c=F(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),f=F(a("./node_modules/babel-runtime/helpers/inherits.js")),h=F(a("./node_modules/antd/es/select/index.js"));a("./node_modules/antd/es/table/style/index.js"),a("./node_modules/antd/es/switch/style/index.js"),a("./node_modules/antd/es/input/style/index.js"),a("./node_modules/antd/es/col/style/index.js"),a("./node_modules/antd/es/row/style/index.js"),a("./node_modules/antd/es/message/style/index.js"),a("./node_modules/antd/es/select/style/index.js");var m=F(a("./node_modules/react/index.js")),g=F(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),v=(F(a("./node_modules/prop-types/index.js")),a("./src/components/index.js")),x=a("./node_modules/@ant-design/icons/es/index.js"),C=a("./node_modules/@ant-design/compatible/es/index.js");a("./node_modules/@ant-design/compatible/assets/index.css");var b=a("./src/redux/reducers/dataSource.js"),w=a("./src/redux/selectors/dataSource.js"),S=a("./node_modules/react-redux/es/index.js"),y=a("./src/utils/authPermit.js"),D=a("./src/components/auth/textAuth.jsx");function F(e){return e&&e.__esModule?e:{default:e}}var P=h.default.Option,I=C.Form.Item,j=t.PreviewPage=g.default.div.withConfig({displayName:"FtpPreview__PreviewPage",componentId:"sc-17s2a73-0"})([".errDiv{height:auto;width:100%;margin-top:20px;background:#eff2f7;font-size:12px;color:#475669;letter-spacing:0;line-height:29px;border-radius:2px;text-align:left;padding:5px 0 0 20px;}.icon{font-size:16px;color:#a2b0c4;cursor:pointer;margin-left:10px;margin-top:2px;}"]),M=t.TopPreview=g.default.div.withConfig({displayName:"FtpPreview__TopPreview",componentId:"sc-17s2a73-1"})(["margin-bottom:5px;height:60px;"]),T=t.BottomPreview=g.default.div.withConfig({displayName:"FtpPreview__BottomPreview",componentId:"sc-17s2a73-2"})(["margin-top:1.1%;.ant-table-thead{th{background:#e0e6ed;}}.ant-table-thead > tr:first-child > th:first-child{border-top-left-radius:4px;}.ant-table table{border-collapse:none;}.ant-table-tbody > tr > td{padding:10px 10px;}.anticon{cursor:pointer;margin-left:10px;}.editable-cell-icon{float:right;padding-top:3px;}.ant-table-thead > tr > th,.ant-table-tbody > tr > td{padding:9px 9px;word-break:break-word;}"]),R=t.TableTail=g.default.div.withConfig({displayName:"FtpPreview__TableTail",componentId:"sc-17s2a73-3"})(["background:#e5e9f2;padding-left:1%;line-height:46px;span{font-family:MicrosoftYaHei;font-size:12px;color:#475669;letter-spacing:0;}"]),N=(0,u.default)("span",{},void 0,"\u62bd\u6837\u6761\u6570\uff1a"),A=(0,u.default)("span",{},void 0,"\u968f\u673a\u7b97\u6cd5\uff1a"),B=(0,u.default)(P,{value:"0"},void 0,"topN"),k=(0,u.default)(P,{value:"1"},void 0,"\u968f\u673a\u62bd\u6837"),q=(0,u.default)(I,{help:""},void 0,(0,u.default)(x.QuestionCircleOutlined,{className:"icon",title:"\u9009\u62e9\u6570\u636e\u96c6\u4e2d\u7684\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff0c\u4e0d\u9009\u62e9\u5219\u9ed8\u8ba4\u9009\u62e9\u7b2c\u4e00\u5217\u4f5c\u4e3a\u552f\u4e00\u6807\u8bc6"})),V=(0,u.default)(x.QuestionCircleOutlined,{className:"icon",title:"\u586b\u5199\u6570\u636e\u6587\u4ef6\u5206\u5272\u7b26\u53f7"}),E=(0,u.default)("span",{className:"titleSpan"},void 0,"\u5c06\u9996\u884c\u8bbe\u4e3a\u6807\u9898"),O=function(e){function t(a){(0,p.default)(this,t);var o=(0,c.default)(this,e.call(this,a));o.formatInt=function(e){try{return parseInt(e)}catch(e){return 0}},o.componentDidMount=function(){"add"!==o.props.viewType&&"ftp"===o.props.dataSourceInfo.dataType&&(o.modelData.fileSplitChar=o.props.dataSourceInfo.dsConf.fileSplitChar,o.modelData.fileHeaderFlag=o.props.dataSourceInfo.dsConf.fileHeaderFlag,o.modelData.identifyField=o.props.dataSourceInfo.identifyField,o.modelData.extractRows=o.props.dataSourceInfo.extractRows?o.props.dataSourceInfo.extractRows:"",o.modelData.extractType=o.props.dataSourceInfo.extractType,o.setState({fileSplitChar:o.props.dataSourceInfo.dsConf.fileSplitChar,fileHeaderFlag:o.props.dataSourceInfo.dsConf.fileHeaderFlag,identifyField:o.props.dataSourceInfo.identifyField,extractRows:o.props.dataSourceInfo.extractRows?o.props.dataSourceInfo.extractRows:"",extractType:o.props.dataSourceInfo.extractType}),o.props.dispatch(b.dataSourceActions.getFtpPreviewDataRequest(o.props.searchCond)))},o.getFtpPreviewData=function(){o.props.dispatch(b.dataSourceActions.resetDbPreviewData()),o.props.dispatch(b.dataSourceActions.getFtpPreviewDataRequest(o.props.searchCond))},o.getIndexOption=function(e,t){for(var a in e)return 0===t&&"\u8bf7\u9009\u62e9\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff08\u9ed8\u8ba4\u7b2c\u4e00\u5217\uff09"===o.state.identifyField&&(o.modelData.identifyField=e[a],o.setState({identifyField:e[a]})),(0,u.default)(P,{value:e[a]},e[a]+_.uniqueId(),e[a])},o.getColumns=function(){var e=0!==o.props.dbPreviewData.size?o.props.dbPreviewData.toJS():[];o.modelData.dbPreviewData=e;var t=[];if(e.headers.length>0||e.headersByIndex.length>0){for(var a=1===o.state.fileHeaderFlag?e.headers:e.headersByIndex,d=0;d<a.length;d++){var s={};for(var i in a[d])s.title=""===a[d][i]?""+i:""+a[d][i],s.dataIndex=""+i,s.width="150px";t.push(s)}return o.setState({indexNum:e.headers.length}),t}},o.onSwitchChange=function(e){o.modelData.fileHeaderFlag=e?1:0,o.props.onChange("fileHeaderFlag",o.modelData.fileHeaderFlag),o.setState({fileHeaderFlag:o.modelData.fileHeaderFlag})},o.fileSplitCharChange=function(e){null===o.props.searchCond.ftpFileName||""===o.props.searchCond.ftpFileName||void 0===o.props.searchCond.ftpFileName?l.default.warning("\u8bf7\u586b\u6587\u4ef6\u540d!"):null===e.target.value||""===e.target.value||void 0===e.target.value?l.default.warning("\u8bf7\u586b\u5199\u5206\u9694\u7b26!"):(o.modelData.fileSplitChar=e.target.value,o.setState({fileSplitChar:e.target.value}),o.props.form.setFieldsValue({fileSplitChar:e.target.value}),o.props.onChange("fileSplitChar",e.target.value),o.getFtpPreviewData())},o.identifyFieldChange=function(e){o.modelData.identifyField=e,o.setState({identifyField:e})},o.validateFun=function(){var e=!1;return o.props.form.validateFieldsAndScroll((function(t){null===t&&(e=!0)})),!o.userIsAdmin&&o.maxRow+""!=="-1"&&""!==o.modelData.extractRows&&parseInt(o.modelData.extractRows)>o.maxRow?{validate:!1,errorMsg:o.maxRow>9999?(0,D.hasText)("root.datasource.adminPhoneMsg")?"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(o.maxRow/1e4)+"\u4e07\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458,"+(0,D.hasText)("root.datasource.adminPhoneMsg"):"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(o.maxRow/1e4)+"\u4e07\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458":(0,D.hasText)("root.datasource.adminPhoneMsg")?"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+o.maxRow+"\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458,"+(0,D.hasText)("root.datasource.adminPhoneMsg"):"\u62bd\u6837\u6761\u6570\u6700\u5927\u9650\u5236"+o.maxRow+"\u6761,\u5982\u6709\u7279\u6b8a\u60c5\u51b5\u53ef\u4ee5\u8054\u7cfb\u7ba1\u7406\u5458"}:o.modelData.fileSplitChar.length>1?{validate:!1,errorMsg:"\u53ea\u80fd\u586b\u5199\u4e00\u4e2a\u5206\u9694\u7b26!"}:(o.modelData.fileSplitChar||(o.modelData.fileSplitChar=o.state.fileSplitChar),e?(""===o.modelData.extractRows&&(o.userIsAdmin||o.row+""==="-1"||(o.modelData.extractRows=o.row)),{validate:!0,moduleData:o.modelData}):{validate:!1,errorMsg:"\u8bf7\u586b\u5206\u9694\u7b26!"})},o.inputNumberChange=function(e){var t=e.target.value;if(o.userIsAdmin||o.row+""==="-1"){/^[0-9]+.?[0-9]*$/.test(t)?(o.modelData.extractRows=t,o.setState({extractRows:t})):(o.modelData.extractRows="",o.setState({extractRows:""}))}else{/^[0-9]+.?[0-9]*$/.test(t)?(o.modelData.extractRows=t,o.setState({extractRows:t})):(o.modelData.extractRows="",o.setState({extractRows:""}))}},o.extractTypeChange=function(e){o.modelData.extractType=e,o.setState({extractType:e})},o.state={_this:o,fileSplitChar:"",fileHeaderFlag:"add"!==o.props.viewType?o.props.dataSourceInfo.dsConf.fileHeaderFlag:1,identifyField:"\u8bf7\u9009\u62e9\u552f\u4e00\u6807\u8bc6\u5b57\u6bb5\uff08\u9ed8\u8ba4\u7b2c\u4e00\u5217\uff09",indexNum:0,extractRows:"",extractType:"0"};var d=o.props.setValidateFunc;_.isFunction(d)&&d("ftpPreview",o.validateFun);var s=o.props.setPreviewFunc;return _.isFunction(s)&&s("ftp",o.getFtpPreviewData),o.modelData={fileSplitChar:"",fileHeaderFlag:1,identifyField:"",dbPreviewData:"",extractRows:"",extractType:"0"},o.row=o.formatInt((0,D.hasText)("root.datasource.extractRow")),o.maxRow=o.formatInt((0,D.hasText)("root.datasource.maxExtractRow")),o.userIsAdmin=(0,y.isUserAdmin)(),o}return(0,f.default)(t,e),t.getDerivedStateFromProps=function(e,t){if(0!==e.dbPreviewData.size){var a=e.dbPreviewData.toJS();return t.fileSplitChar!==a.splitChar?{fileSplitChar:a.splitChar?a.splitChar:""}:{fileSplitChar:a.splitChar}}return null},t.prototype.setHeaders=function(){for(var e=this.props.dbPreviewData.toJS(),t=e.headers,a=new Object,o=0;o<t.length;o++)for(var d in t[o])a[d]=t[o][d];return e.data&&e.data.unshift(a),e},t.prototype.render=function(){var e=this,t=this.props.form.getFieldDecorator,a=this.props.dbPreviewData&&0!==this.props.dbPreviewData.size?1===this.state.fileHeaderFlag?(0,r.default)({},this.props.dbPreviewData.toJS()):this.setHeaders():[];return(0,u.default)(j,{},void 0,(0,u.default)(C.Form,{style:{height:105},layout:"inline"},void 0,(0,u.default)(M,{},void 0,(0,u.default)(n.default,{},void 0,(0,u.default)(i.default,{span:6},void 0,(0,u.default)(I,{help:""},void 0,N,(0,u.default)(s.default,{style:{top:1,width:140},placeholder:"\u5168\u90e8",value:""===this.state.extractRows?"":parseInt(this.state.extractRows),onChange:this.inputNumberChange}))),(0,u.default)(I,{help:""},void 0,A,(0,u.default)(h.default,{value:this.state.extractType,disabled:this.state.moduleDisabled,onChange:this.extractTypeChange,getPopupContainer:function(e){return e.parentNode},style:{width:"250px"}},void 0,B,k)),(0,u.default)(I,{help:""},void 0,t("identifyField",{rules:[{required:!0}],initialValue:this.state.identifyField})((0,u.default)(h.default,{showSearch:!0,disabled:this.state.moduleDisabled,onChange:this.identifyFieldChange,getPopupContainer:function(e){return e.parentNode},style:{width:"250px"}},void 0,void 0!==a.headers&&void 0!==a.headersByIndex?1===this.state.fileHeaderFlag?a.headers.map((function(t,a){return e.getIndexOption(t,a)})):a.headersByIndex.map((function(t,a){return e.getIndexOption(t,a)})):""))),q)),(0,u.default)("div",{style:{fontSize:12,color:"red",marginTop:"-5px"}},void 0,this.maxRow+""==="-1"?"":"\u5efa\u8bae\u6570\u636e\u6761\u6570\u63a7\u5236\u5728"+Math.floor(this.row/1e4)+" \u4e07\u4ee5\u5185\uff0c\u6570\u636e\u6761\u6570\u6700\u5927\u9650\u5236"+Math.floor(this.maxRow/1e4)+"\u4e07\u6761"),(0,u.default)(n.default,{},void 0,(0,u.default)(i.default,{span:6},void 0,(0,u.default)(I,{help:""},void 0,(0,u.default)("span",{style:{marginRight:-3}},void 0,"\u5206 \u9694 \u7b26 \uff1a"),t("fileSplitChar",{rules:[{required:!0}],initialValue:this.state.fileSplitChar})((0,u.default)(s.default,{onBlur:this.fileSplitCharChange,style:{width:"80px",margin:"-2px 0px 0 5px"},placeholder:"\u586b\u5199\u5206\u9694\u7b26"})),V)),(0,u.default)(I,{help:""},void 0,E,(0,u.default)(d.default,{checkedChildren:"\u662f",unCheckedChildren:"\u5426",defaultChecked:1===this.state.fileHeaderFlag,style:{margin:"-2px 20px 0 10px"},onChange:this.onSwitchChange})))),this.props.loading&&(0,u.default)(v.LoadingIndicator,{style:{marginTop:50},position:"relative"}),void 0!==a.data&&a.data.length>0?(0,u.default)(T,{},void 0,(0,u.default)(o.default,{scroll:{x:150*this.state.indexNum,y:240},dataSource:a.data,rowKey:_.uniqueId(),bordered:!0,pagination:!1,columns:this.getColumns()}),(0,u.default)(R,{},void 0,(0,u.default)("span",{},void 0,"\u5171 ",a.headers.length," \u6761\u6307\u6807"))):!this.props.loading&&a.headers.length>0?(0,u.default)("div",{className:"errDiv"},void 0,this.props.ftpPreviewError):"")},t}(m.default.PureComponent);t.default=(0,S.connect)((function(e){return{ftpPreviewError:(0,w.selectFtpPreviewError)(e),dbPreviewData:(0,w.selectDbPreviewDataList)(e),loading:(0,w.selectDbPreviewDataListLoading)(e)}}))(C.Form.create()(O))},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/ModalArryTable.jsx":function(e,t,a){"use strict";t.__esModule=!0;var o=f(a("./node_modules/antd/es/table/index.js")),d=f(a("./node_modules/antd/es/modal/index.js")),s=f(a("./node_modules/babel-runtime/helpers/jsx.js")),i=f(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),n=f(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),r=f(a("./node_modules/babel-runtime/helpers/inherits.js")),l=f(a("./node_modules/antd/es/input/index.js"));a("./node_modules/antd/es/table/style/index.js"),a("./node_modules/antd/es/modal/style/index.js"),a("./node_modules/antd/es/input/style/index.js");var u=f(a("./node_modules/react/index.js")),p=(f(a("./node_modules/prop-types/index.js")),f(a("./node_modules/styled-components/dist/styled-components.browser.esm.js"))),c=a("./src/components/index.js");function f(e){return e&&e.__esModule?e:{default:e}}var h=l.default.Search,m=p.default.div.withConfig({displayName:"ModalArryTable__SearchBarWrapper",componentId:"sc-4fr8ch-0"})(["display:flex;float:right;.sort-cond{margin-left:16px;}.ant-input-search{width:200px !important;margin-left:16px !important;}"]),g=function(e){function t(a){(0,i.default)(this,t);var o=(0,n.default)(this,e.call(this,a));return o.getData=function(e,t){for(var a=[],d=0;d<e.length;d++){var s={key:d.toString(),name:e[d].name?e[d].name:e[d]};a.push(s)}var i=t||o.state.currentPage;o.getDatasByCurrentPage(a,i)},o.getDatasByCurrentPage=function(e,t){var a=10*(t-1);a>=e.length&&o.setState({dataSource:[],newDataSource:[]});var d=10*t;d>=e.length&&(d=e.length);for(var s=[],i=a;i<d;i++)s.push(e[i]);o.setState({dataSource:s,newDataSource:e})},o.handleCancel=function(){o.props.onCancelType&&o.setState({visible:!1}),o.props.callVisible()},o.fuzzyQuery=function(e,t){for(var a=[],d=0;d<e.length;d++){e[d].toUpperCase().split(t.toUpperCase()).length>1&&a.push(e[d])}o.getData(a,1)},o.onChangePage=function(e,t){o.setState({currentPage:e}),o.getData(o.state.newDataSource,e)},o.handleFocus=function(e){e.target.select()},o.doSearch=function(e){o.fuzzyQuery(o.props.data,e)},o.handleKeyPress=function(e){13===e.keyCode&&o.doSearch(e.target.value)},o.state={_this:o,visible:a.modalVisible,title:a.modalTitle,comp:a.comp,height:void 0!==a.height?a.height:"auto",width:void 0!==a.width?a.width:"auto",closable:void 0===a.closable||a.closable,dataSource:[],newDataSource:[],columns:[{title:"\u6570\u636e\u5e93\u8868\u540d\u79f0",dataIndex:"name",key:"name"},{title:"\u64cd\u4f5c",dataIndex:"id",width:70,render:function(e,t){return(0,s.default)("span",{style:{color:"#147BD1",cursor:"pointer"},onClick:function(){return o.props.selectTableName(t)}},void 0,"\u9009\u4e2d")}}],currentPage:1},o}return(0,r.default)(t,e),t.getDerivedStateFromProps=function(e,t){return{visible:e.modalVisible,title:void 0===e.modalTitle?e.renderTitle:e.modalTitle}},t.prototype.componentDidUpdate=function(e){_.isEqual(e.data,this.props.data)||(this.props.data.length>0&&0===this.state.dataSource.length||0===this.props.data.length&&this.state.dataSource.length>0)&&this.getData(this.props.data)},t.prototype.render=function(){var e=this;return(0,s.default)(d.default,{keyboard:!1,style:{padding:"0px",height:void 0!==this.state.height?this.state.height:""},title:void 0!==this.state.title?this.state.title:"",onCancel:this.handleCancel,visible:this.state.visible,width:this.state.width,destroyOnClose:!0,footer:null,closable:this.state.closable,maskClosable:"view"===this.props.viewType},void 0,(0,s.default)(m,{className:"search-bar"},void 0,(0,s.default)(h,{placeholder:"\u8bf7\u8f93\u5165\u67e5\u8be2\u6761\u4ef6",onFocus:this.handleFocus,onKeyUp:this.handleKeyPress,onSearch:function(t){return e.doSearch(t)}})),this.props.loading&&(0,s.default)(c.LoadingIndicator,{style:{marginTop:70},position:"relative"}),!this.props.loading&&(0,s.default)("div",{style:{marginTop:40}},void 0,(0,s.default)(o.default,{size:"middle",dataSource:this.state.dataSource,pagination:!1,columns:this.state.columns}),(0,s.default)(c.TabPagination,{currentPage:this.state.currentPage,pageSize:10,total:this.state.newDataSource.length,onChange:this.onChangePage})))},t}(u.default.PureComponent);t.default=g},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/index.js":function(e,t,a){"use strict";t.__esModule=!0;var o=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/DataBaseInfo.jsx");Object.defineProperty(t,"DataBaseInfo",{enumerable:!0,get:function(){return l(o).default}});var d=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/DataBasePreview.jsx");Object.defineProperty(t,"DataBasePreview",{enumerable:!0,get:function(){return l(d).default}});var s=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FileInfo.jsx");Object.defineProperty(t,"FileInfo",{enumerable:!0,get:function(){return l(s).default}});var i=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FilePreview.jsx");Object.defineProperty(t,"FilePreview",{enumerable:!0,get:function(){return l(i).default}});var n=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FtpInfo.jsx");Object.defineProperty(t,"FtpInfo",{enumerable:!0,get:function(){return l(n).default}});var r=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/FtpPreview.jsx");function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"FtpPreview",{enumerable:!0,get:function(){return l(r).default}})},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced sync recursive ^\\.\\/.*$":function(e,t,a){var o={"./DataBaseConfig":"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/DataBaseConfig.jsx","./DataBaseConfig.jsx":"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/DataBaseConfig.jsx","./FileConfig":"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/FileConfig.jsx","./FileConfig.jsx":"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/FileConfig.jsx","./FtpConfig":"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/FtpConfig.jsx","./FtpConfig.jsx":"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/FtpConfig.jsx"};function d(e){var t=s(e);return a(t)}function s(e){if(!a.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}d.keys=function(){return Object.keys(o)},d.resolve=s,e.exports=d,d.id="./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced sync recursive ^\\.\\/.*$"},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/DataBaseConfig.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.DataSourceConfigPage=void 0;var o=c(a("./node_modules/babel-runtime/helpers/jsx.js")),d=c(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),s=c(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),i=c(a("./node_modules/babel-runtime/helpers/inherits.js")),n=c(a("./node_modules/react/index.js")),r=c(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),l=a("./node_modules/react-redux/es/index.js"),u=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/index.js"),p=(c(a("./node_modules/prop-types/index.js")),a("./src/components/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}var f=t.DataSourceConfigPage=r.default.div.withConfig({displayName:"DataBaseConfig__DataSourceConfigPage",componentId:"rcscev-0"})(["margin-bottom:10px;"]),h={width:"100%",marginLeft:"-42px"},m=function(e){function t(a){(0,d.default)(this,t);var o=(0,s.default)(this,e.call(this,a));o.getModulesData=function(e,t){"dacp"===t||"db"===t?o.props.onChange("dacp",t):o.setState({searchCond:e})},o.setValiDataBaseFunc=function(e,t){o.valiDataBaseFuncs[e]=t},o.setPattern=function(e){o.setState({pattern:e})},o.validateFun=function(){var e={validate:!0,moduleData:{resultArrays:{},errorMsg:{}}},t=o.valiDataBaseFuncs;return Object.keys(t).map((function(a){var o=t[a];if(_.isFunction(o)){var d=o.call();d.validate?(e.moduleData.resultArrays[a]=d.moduleData,"dataBasePreview"===a&&(e.moduleData.extractRows=d.moduleData.extractRows)):(e.validate=d.validate,e.moduleData.errorMsg[a]=d.errorMsg)}})),e},o.state={pattern:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf&&a.dataSourceInfo.dsConf.sqlSentence?2:1,searchCond:{type:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.type:"",dbId:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.dbId:"",tableName:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.tableName:"",cycleMask:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.cycleMask:"",sqlSentence:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.sqlSentence:"",metaTplPath:""}},o.valiDataBaseFuncs={};var i=o.props.setValidateFunc;return _.isFunction(i)&&i("dataBaseConfig",o.validateFun),o}return(0,i.default)(t,e),t.prototype.render=function(){return(0,o.default)(f,{},void 0,(0,o.default)(u.DataBaseInfo,{pattern:this.state.pattern,disabled:this.props.disabled,viewType:this.props.viewType,setValidateFunc:this.setValiDataBaseFunc,dataSourceInfo:this.props.dataSourceInfo,onChange:this.getModulesData,setPattern:this.setPattern}),(0,o.default)(p.ModelConfigPanel,{title:"\u5176\u4ed6\u53c2\u6570",style:h},void 0,(0,o.default)(u.DataBasePreview,{pattern:this.state.pattern,searchCond:this.state.searchCond,disabled:this.props.disabled,viewType:this.props.viewType,setPreviewFunc:this.props.setPreviewFunc,setValidateFunc:this.setValiDataBaseFunc,dataSourceInfo:this.props.dataSourceInfo,onChange:this.getModulesData})))},t}(n.default.PureComponent);t.default=(0,l.connect)((function(){return{}}))(m),e.exports=m},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/FileConfig.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.DataSourceConfigPage=void 0;var o=c(a("./node_modules/babel-runtime/helpers/jsx.js")),d=c(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),s=c(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),i=c(a("./node_modules/babel-runtime/helpers/inherits.js")),n=c(a("./node_modules/react/index.js")),r=c(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),l=a("./node_modules/react-redux/es/index.js"),u=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/index.js"),p=(c(a("./node_modules/prop-types/index.js")),a("./src/components/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}var f=t.DataSourceConfigPage=r.default.div.withConfig({displayName:"FileConfig__DataSourceConfigPage",componentId:"jtujpd-0"})(["margin-bottom:10px;"]),h={width:"100%",marginLeft:"-42px"},m=function(e){function t(a){(0,d.default)(this,t);var o=(0,s.default)(this,e.call(this,a));o.getModulesData=function(e,t){"fileSplitChar"===e&&o.setState({fileSplitChar:t}),"filePath"===e&&o.setState({filePath:t,fileSplitChar:""}),o.searchCond[e]=_.trim(t)},o.setValiFileConfigFunc=function(e,t){o.valiFileConfigFuncs[e]=t},o.validateFun=function(){var e={validate:!0,moduleData:{resultArrays:{},errorMsg:{}}},t=o.valiFileConfigFuncs;return Object.keys(t).map((function(a){var o=t[a];if(_.isFunction(o)){var d=o.call();d.validate?(e.moduleData.resultArrays[a]=d.moduleData,"filePreview"===a&&(e.moduleData.extractRows=d.moduleData.extractRows)):(e.validate=d.validate,e.moduleData.errorMsg[a]=d.errorMsg)}})),e},o.state={fileSplitChar:"",filePath:"1"},o.searchCond={type:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.type:"",filePath:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.filePath:"",fileSplitChar:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.fileSplitChar:"",fileheaderFlag:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.fileHeaderFlag:1,metaTplPath:""},o.valiFileConfigFuncs={};var i=o.props.setValidateFunc;return _.isFunction(i)&&i("fileConfig",o.validateFun),o}return(0,i.default)(t,e),t.prototype.render=function(){return(0,o.default)(f,{},void 0,(0,o.default)(u.FileInfo,{disabled:this.props.disabled,viewType:this.props.viewType,setValidateFunc:this.setValiFileConfigFunc,dataSourceInfo:this.props.dataSourceInfo,onChange:this.getModulesData,fileSplitChar:this.state.fileSplitChar,searchCond:this.searchCond}),(0,o.default)(p.ModelConfigPanel,{title:"\u5176\u4ed6\u53c2\u6570",style:h},void 0,(0,o.default)(u.FilePreview,{filePath:this.state.filePath,fileSplitChar:this.state.fileSplitChar,searchCond:this.searchCond,disabled:this.props.disabled,viewType:this.props.viewType,setPreviewFunc:this.props.setPreviewFunc,setValidateFunc:this.setValiFileConfigFunc,dataSourceInfo:this.props.dataSourceInfo,onChange:this.getModulesData})))},t}(n.default.PureComponent);t.default=(0,l.connect)((function(){return{}}))(m),e.exports=m},"./src/module/dataMgr/dataSource/dataSourceEditAdvanced/sourceAdvanced/FtpConfig.jsx":function(e,t,a){"use strict";t.__esModule=!0,t.DataSourceConfigPage=void 0;var o=c(a("./node_modules/babel-runtime/helpers/jsx.js")),d=c(a("./node_modules/babel-runtime/helpers/classCallCheck.js")),s=c(a("./node_modules/babel-runtime/helpers/possibleConstructorReturn.js")),i=c(a("./node_modules/babel-runtime/helpers/inherits.js")),n=c(a("./node_modules/react/index.js")),r=c(a("./node_modules/styled-components/dist/styled-components.browser.esm.js")),l=a("./node_modules/react-redux/es/index.js"),u=a("./src/module/dataMgr/dataSource/dataSourceEditAdvanced/components/index.js"),p=(c(a("./node_modules/prop-types/index.js")),a("./src/components/index.js"));function c(e){return e&&e.__esModule?e:{default:e}}var f=t.DataSourceConfigPage=r.default.div.withConfig({displayName:"FtpConfig__DataSourceConfigPage",componentId:"tqr0z3-0"})(["margin-bottom:10px;"]),h={width:"100%",marginLeft:"-42px"},m=function(e){function t(a){(0,d.default)(this,t);var o=(0,s.default)(this,e.call(this,a));o.setValiFtpConfigFunc=function(e,t){o.valiFtpConfigFuncs[e]=t},o.validateFun=function(){var e={validate:!0,moduleData:{resultArrays:{},errorMsg:{}}},t=o.valiFtpConfigFuncs;return Object.keys(t).map((function(a){var o=t[a];if(_.isFunction(o)){var d=o.call();d.validate?(e.moduleData.resultArrays[a]=d.moduleData,"ftpPreview"===a&&(e.moduleData.extractRows=d.moduleData.extractRows)):(e.validate=d.validate,e.moduleData.errorMsg[a]=d.errorMsg)}})),e},o.getModulesData=function(e,t){o.searchCond[e]=_.trim(t)},o.state={},o.searchCond={type:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.type:"",ftpId:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.ftpId:"",filePath:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.filePath:"",fileSplitChar:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.fileSplitChar:"",fileheaderFlag:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.fileHeaderFlag:1,ftpFileName:void 0!==a.dataSourceInfo&&a.dataSourceInfo.dsConf?a.dataSourceInfo.dsConf.ftpFileName:"",metaTplPath:""},o.valiFtpConfigFuncs={};var i=o.props.setValidateFunc;return _.isFunction(i)&&i("ftpConfig",o.validateFun),o}return(0,i.default)(t,e),t.prototype.render=function(){return(0,o.default)(f,{},void 0,(0,o.default)(u.FtpInfo,{fileSplitChar:this.state.fileSplitChar,disabled:this.props.disabled,viewType:this.props.viewType,setValidateFunc:this.setValiFtpConfigFunc,dataSourceInfo:this.props.dataSourceInfo,onChange:this.getModulesData,searchCond:this.searchCond}),(0,o.default)(p.ModelConfigPanel,{title:"\u5176\u4ed6\u53c2\u6570",style:h},void 0,(0,o.default)(u.FtpPreview,{searchCond:this.searchCond,disabled:this.props.disabled,viewType:this.props.viewType,setValidateFunc:this.setValiFtpConfigFunc,setPreviewFunc:this.props.setPreviewFunc,dataSourceInfo:this.props.dataSourceInfo,onChange:this.getModulesData})))},t}(n.default.PureComponent);t.default=(0,l.connect)((function(){return{}}))(m),e.exports=m},"./src/redux/selectors/dataBases.js":function(e,t,a){"use strict";t.__esModule=!0,t.selectDataBasesArrayDown=t.selectDataBasesArry=void 0;var o=a("./node_modules/reselect/lib/index.js"),d=function(e){return e.get("dataBases")},s=(0,o.createSelector)(d,(function(e){return e.get("dataBasesArray")})),i=(0,o.createSelector)(d,(function(e){return e.get("dataBasesArrayDown")}));t.selectDataBasesArry=s,t.selectDataBasesArrayDown=i}}]);
|