File was renamed from src/menu/datasourcecomponent/verifycard/index.jsx |
| | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | tableFields: PropTypes.any, // 数据源信息 |
| | | permFuncField: PropTypes.any, // 数据源信息 |
| | | config: PropTypes.object, // 数据源信息 |
| | | menuId: PropTypes.string, // 菜单Id |
| | | searches: PropTypes.array, // 搜索条件 |
| | | menu: PropTypes.object, // 菜单配置信息 |
| | | config: PropTypes.object, // 组件配置信息 |
| | | } |
| | | |
| | | state = { |
| | |
| | | _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) |
| | | |
| | | _sParam.open_key = Utils.encrypt(_sParam.secretkey, _sParam.timestamp, true) // 云端数据验证 |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | |
| | | res.data.forEach(item => { |
| | | let _item = { |
| | | name: item.funcname, |
| | | value: Utils.formatOptions(item.longparam, true) |
| | | value: Utils.UnformatOptions(item.longparam) |
| | | } |
| | | |
| | | _scripts.push(_item) |
| | |
| | | } |
| | | |
| | | sqlverify = (resolve, reject, change = false, testScripts) => { |
| | | const { searches } = this.props |
| | | const { config } = this.props |
| | | const { columns, setting, scripts } = this.state |
| | | |
| | | let _scripts = scripts.filter(item => item.status !== 'false') |
| | |
| | | if ((setting.interType === 'inner' && !setting.innerFunc && setting.execute !== 'false') || _scripts.length > 0) { |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: SettingUtils.getDebugSql(setting, _scripts, columns, searches) |
| | | LText: SettingUtils.getDebugSql(setting, _scripts, columns, config.search) |
| | | } |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { menu, config } = this.props |
| | | const { columns, setting, scripts, colColumns, scriptsColumns, activeKey, loading } = this.state |
| | | |
| | | return ( |
| | |
| | | <Tabs activeKey={activeKey} className="verify-card-box" onChange={this.changeTab}> |
| | | <TabPane tab="数据源" key="setting"> |
| | | <SettingForm |
| | | menuId={this.props.menuId} |
| | | menu={menu} |
| | | dict={this.props.dict} |
| | | config={this.props.config} |
| | | permFuncField={this.props.permFuncField} |
| | | config={config} |
| | | columns={columns} |
| | | setting={setting} |
| | | scripts={scripts} |
| | |
| | | wrappedComponentRef={(inst) => this.contrastForm = inst} |
| | | /> |
| | | <FieldsComponent |
| | | config={{...this.props.config, columns}} |
| | | config={{...config, columns}} |
| | | type="fields" |
| | | tableFields={this.props.tableFields} |
| | | tableFields={menu.tableFields} |
| | | updatefield={this.updatefields} |
| | | /> |
| | | <Table |
| | |
| | | <TabPane tab="自定义脚本" key="scripts"> |
| | | <CustomScriptsForm |
| | | setting={setting} |
| | | searches={this.props.searches} |
| | | searches={config.search} |
| | | initsql={this.state.initsql} |
| | | dict={this.props.dict} |
| | | customScripts={scripts} |