| | |
| | | {appType !== 'mob' ? <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> : null} |
| | | <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> |
| | | <CopyComponent type="line" card={card}/> |
| | | <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent} /> |
| | | <PasteComponent config={card} options={['action']} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog} /> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
| | |
| | | const SettingComponent = asyncIconComponent(() => import('@/menu/datasource')) |
| | | const ChartCompileForm = asyncIconComponent(() => import('./chartcompile')) |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent')) |
| | | const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader')) |
| | | const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent')) |
| | | const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent')) |
| | |
| | | {!ismob ? <Icon className="plus" title="添加搜索" onClick={this.addSearch} type="plus-circle" /> : null} |
| | | <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> |
| | | <CopyComponent type="pie" card={card}/> |
| | | <PasteComponent config={card} options={['search', 'form']} updateConfig={this.updateComponent} /> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors" /> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
| | | <UserComponent config={card}/> |
| | |
| | | {appType !== 'mob' ? <Icon className="plus" title="添加按钮" onClick={this.addButton} type="plus-square" /> : null} |
| | | <ChartCompileForm config={card} dict={this.state.dict} plotchange={this.updateComponent}/> |
| | | <CopyComponent type="line" card={card}/> |
| | | <PasteComponent config={card} options={['action', 'search', 'form']} updateConfig={this.updateComponent}/> |
| | | <PasteComponent config={card} options={['action']} updateConfig={this.updateComponent}/> |
| | | <Icon className="style" title="调整样式" onClick={this.changeStyle} type="font-colors"/> |
| | | <LogComponent btnlog={card.btnlog || []} handlelog={this.handleLog}/> |
| | | <ClockComponent config={card} updateConfig={this.updateComponent}/> |
| | |
| | | } |
| | | MKEmitter.emit('addButton', config.uuid, res) |
| | | } else if (type === 'search' || type === 'form') { |
| | | config.search = config.search || [] |
| | | config.search = config.search.filter(item => !item.origin) |
| | | |
| | | let keys = config.search.map(item => item.field.toLowerCase()) |
| | | let keys = config.search.map(item => item.field ? item.field.toLowerCase() : '') |
| | | |
| | | if (type === 'form') { |
| | | if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { |
| | |
| | | return |
| | | } |
| | | |
| | | config.search.push(res) |
| | | MKEmitter.emit('plusSearch', config.uuid, res, 'simple') |
| | | this.setState({visible: false}) |
| | | return |
| | | } else if (type === 'cardcell') { |
| | | config.subcards.push(res) |
| | | } else if (type === 'menucell') { |
| | |
| | | min-height: 100px; |
| | | |
| | | .model-table-search-list { |
| | | padding: 10px 0px 0px; |
| | | padding: 10px 0px 15px; |
| | | min-height: 65px; |
| | | border-bottom: 1px solid #f0f0f0; |
| | | >.anticon-question-circle { |
| | |
| | | delete _param.ErrMesg |
| | | delete _param.message |
| | | |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | setTimeout(() => { |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, 600) |
| | | } |
| | | resolve(res) |
| | | }, () => { |
| | |
| | | delete _param.ErrMesg |
| | | delete _param.message |
| | | |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | setTimeout(() => { |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, 600) |
| | | } |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | |
| | | </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <EditComponent dict={this.state.dict} options={['search']} config={this.state.config}/> |
| | | <EditComponent dict={this.state.dict} type="table" options={['search', 'form']} config={this.state.config}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> |
| | |
| | | <div> |
| | | <Versions MenuId={menu.MenuID} open_edition={openEdition} updateConfig={this.refreshConfig}/> |
| | | <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> |
| | | <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> |
| | | <EditComponent dict={this.state.dict} type="table" options={['search', 'form', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> |
| | | <Switch className="big" checkedChildren={this.state.dict['model.enable']} unCheckedChildren={this.state.dict['model.disable']} checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 监听到搜索条件复制时,触发搜索条件编辑 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { searchlist } = this.state |
| | | // /** |
| | | // * @description 监听到搜索条件复制时,触发搜索条件编辑 |
| | | // */ |
| | | // UNSAFE_componentWillReceiveProps (nextProps) { |
| | | // const { searchlist } = this.state |
| | | |
| | | if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) { |
| | | let len = nextProps.config.search.length |
| | | let item = nextProps.config.search[len - 1] |
| | | if (item && item.focus) { |
| | | this.handleSearch(item) |
| | | } |
| | | this.setState({searchlist: fromJS(nextProps.config.search).toJS()}) |
| | | } |
| | | } |
| | | // if (!is(fromJS(nextProps.config.search), fromJS(this.props.config.search)) && !is(fromJS(nextProps.config.search), fromJS(searchlist))) { |
| | | // let len = nextProps.config.search.length |
| | | // let item = nextProps.config.search[len - 1] |
| | | // if (item && item.focus) { |
| | | // this.handleSearch(item) |
| | | // } |
| | | // this.setState({searchlist: fromJS(nextProps.config.search).toJS()}) |
| | | // } |
| | | // } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('plusSearch', this.plusSearch) |
| | |
| | | <Tooltip placement="bottomLeft" overlayClassName="middle" title={dict['model.tooltip.search.guide']}> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> |
| | | <FieldsComponent config={config} type="search" /> |
| | | <FieldsComponent config={{uuid: config.uuid, search: searchlist}} type="search" /> |
| | | <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={showField} onChange={this.onFieldChange} /> |
| | | <DragElement |
| | | list={searchlist} |
| | |
| | | <div> |
| | | <Versions MenuId={config.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/> |
| | | <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> |
| | | <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> |
| | | <EditComponent dict={this.state.dict} type="table" options={['search', 'form', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button> |
| | |
| | | } |
| | | |
| | | pasteSubmit = () => { |
| | | const { options, config } = this.props |
| | | const { options, config, type } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType === 'action' && options.includes('action')) { |
| | | if (!options.includes(res.copyType)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '配置信息格式错误!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (res.copyType === 'action') { |
| | | res.uuid = Utils.getuuid() |
| | | MKEmitter.emit('pasteButton', config.uuid, res) |
| | | } else if (options.includes('search') && res.copyType === 'search') { |
| | | } else if (res.copyType === 'search' || (type === 'table' && res.copyType === 'form')) { |
| | | res.uuid = Utils.getuuid() |
| | | let keys = _config.search.map(item => item.field ? item.field.toLowerCase() : '') |
| | | |
| | | if (type === 'table') { |
| | | if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { |
| | | res.type = 'text' |
| | | } else if (res.type === 'radio') { |
| | | res.type = 'select' |
| | | } else if (res.type === 'checkbox') { |
| | | res.type = 'multiselect' |
| | | } else if (res.type === 'datetime') { |
| | | res.type = 'date' |
| | | } |
| | | } |
| | | |
| | | if (res.field && keys.includes(res.field.toLowerCase())) { |
| | | notification.warning({ |
| | |
| | | return |
| | | } |
| | | MKEmitter.emit('plusSearch', config.uuid, res, 'simple') |
| | | } else if (options.includes('columns') && res.copyType === 'columns') { |
| | | } else if (res.copyType === 'columns') { |
| | | let keys = _config.columns.map(item => item.field ? item.field.toLowerCase() : '') |
| | | let items = res.columns.filter(col => col.field && !keys.includes(col.field.toLowerCase())) |
| | | |
| | | MKEmitter.emit('plusColumns', config.uuid, items) |
| | | } else if (options.includes('form') && res.copyType === 'form') { |
| | | } else if (res.copyType === 'form') { |
| | | let keys = _config.fields.map(item => item.field ? item.field.toLowerCase() : '') |
| | | res.uuid = Utils.getuuid() |
| | | |