| | |
| | | return new Promise((resolve, reject) => { |
| | | CacheUtils.getWebSqlVersion().then(msg => { |
| | | appVersion.oldVersion = msg.version || '' |
| | | let modifydate = msg.createDate || curTime |
| | | if (modifydate.indexOf('Invalid date') > -1) { |
| | | modifydate = curTime |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_get_app_version', |
| | | modifydate: msg.createDate || curTime, |
| | | modifydate |
| | | } |
| | | |
| | | this.getSystemConfig(param).then(res => { |
| | |
| | | return new Promise((resolve, reject) => { |
| | | CacheUtils.getIndexDBVersion().then(msg => { |
| | | appVersion.oldVersion = msg.version || '' |
| | | let modifydate = msg.createDate || curTime |
| | | if (modifydate.indexOf('Invalid date') > -1) { |
| | | modifydate = curTime |
| | | } |
| | | let param = { |
| | | func: 's_get_app_version', |
| | | modifydate: msg.createDate || curTime, |
| | | modifydate |
| | | } |
| | | |
| | | this.getSystemConfig(param).then(res => { |
| | |
| | | |
| | | handleSubConfig = (item) => { |
| | | const { cards } = this.props |
| | | const { appType } = this.state |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if ((sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') === 'true')) return |
| | |
| | | if (btn.OpenType === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | tables: [], |
| | | groups: [], |
| | | fields: [] |
| | |
| | | } |
| | | |
| | | setSubConfig = (item) => { |
| | | const { card } = this.state |
| | | const { card, appType } = this.state |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if (btn.OpenType === 'pop' || btn.execMode === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | tables: [], |
| | | groups: [], |
| | | fields: [] |
| | |
| | | } |
| | | |
| | | setSubConfig = (item) => { |
| | | const { card } = this.state |
| | | const { card, appType } = this.state |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if (btn.OpenType === 'pop' || btn.execMode === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | | tables: [], |
| | | groups: [], |
| | | fields: [] |
| | |
| | | dict: CommonDict, // 字典 |
| | | config: null, // 页面配置,包括模板类型、模态框设置、添加表名、表单列表 |
| | | visible: false, // 表单编辑模态框,显示控制 |
| | | tableVisible: false, // 数据表字段列表模态框,显示控制 |
| | | tableColumns: [], // 表格字段名列表 |
| | | fields: null, // 表单,可选字段(去重后) |
| | | formlist: null, // 表单编辑模态框,可编辑字段 |
| | | card: null, // 编辑元素 |
| | | closeloading: false, // 菜单保存中 |
| | | settingVisible: false, // 全局配置模态框 |
| | | closeVisible: false, // 关闭模态框 |
| | | tables: [], // 可用表名 |
| | | selectedTables: [], // 已选表名 |
| | | originConfig: null, // 原始菜单 |
| | | sources: null, // 表单类型 |
| | | sqlVerifing: false, // sql验证 |
| | | openEdition: '', // 编辑版本标记,防止多人操作 |
| | | showField: false, // 显示表单字段值 |
| | | standardform: null |
| | | } |
| | |
| | | submitConfig = () => { |
| | | const { config } = this.state |
| | | |
| | | this.setState({originConfig: fromJS(config).toJS(), closeVisible: false}) |
| | | this.setState({originConfig: fromJS(config).toJS()}) |
| | | this.props.handleSave(config) |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | const { config, originConfig } = this.state |
| | | |
| | | if (!is(fromJS(config), fromJS(originConfig))) { |
| | | this.setState({ |
| | | closeVisible: true |
| | | let _this = this |
| | | confirm({ |
| | | content: '配置信息未保存,确定返回吗?', |
| | | onOk() { |
| | | _this.props.handleBack() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | this.props.handleBack() |
| | |
| | | inputSubmit={this.settingSave} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | | </Modal> |
| | | <Modal |
| | | bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}} |
| | | closable={false} |
| | | maskClosable={false} |
| | | visible={this.state.closeVisible} |
| | | onCancel={() => { this.setState({closeVisible: false}) }} |
| | | footer={[ |
| | | <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, |
| | | <Button key="confirm" className="mk-btn mk-yellow" onClick={this.props.handleBack}>{this.state.dict['model.notsave']}</Button>, |
| | | <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | {this.state.dict['header.menu.config.placeholder']} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | |
| | | dict: CommonDict, // 字典 |
| | | config: null, // 页面配置,包括模板类型、模态框设置、添加表名、表单列表 |
| | | visible: false, // 表单编辑模态框,显示控制 |
| | | tableVisible: false, // 数据表字段列表模态框,显示控制 |
| | | tableColumns: [], // 表格字段名列表 |
| | | fields: null, // 表单,可选字段(去重后) |
| | | formlist: null, // 表单编辑模态框,可编辑字段 |
| | | card: null, // 编辑元素 |
| | | closeloading: false, // 菜单保存中 |
| | | settingVisible: false, // 全局配置模态框 |
| | | closeVisible: false, // 关闭模态框 |
| | | tables: [], // 可用表名 |
| | | selectedTables: [], // 已选表名 |
| | | originConfig: null, // 原始菜单 |
| | | sources: null, // 表单类型 |
| | | sqlVerifing: false, // sql验证 |
| | | openEdition: '', // 编辑版本标记,防止多人操作 |
| | | showField: false, // 显示表单字段值 |
| | | standardform: null |
| | | } |
| | |
| | | submitConfig = () => { |
| | | const { config } = this.state |
| | | |
| | | this.setState({originConfig: fromJS(config).toJS(), closeVisible: false}) |
| | | this.setState({originConfig: fromJS(config).toJS()}) |
| | | this.props.handleSave(config) |
| | | notification.success({ |
| | | top: 92, |
| | |
| | | const { config, originConfig } = this.state |
| | | |
| | | if (!is(fromJS(config), fromJS(originConfig))) { |
| | | this.setState({ |
| | | closeVisible: true |
| | | let _this = this |
| | | confirm({ |
| | | content: '配置信息未保存,确定返回吗?', |
| | | onOk() { |
| | | _this.props.handleBack() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | this.props.handleBack() |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { btn } = this.props |
| | | const { config, dict } = this.state |
| | | |
| | | return ( |
| | |
| | | <div className="mob-shell-inner"> |
| | | <div className="am-navbar"> |
| | | <Icon type="close" /> |
| | | <div className="am-navbar-title">{btn.label}</div> |
| | | <div className="am-navbar-title">{config.setting.title}</div> |
| | | </div> |
| | | <DragElement |
| | | list={config.fields} |
| | |
| | | inputSubmit={this.settingSave} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | | /> |
| | | </Modal> |
| | | <Modal |
| | | bodyStyle={{textAlign: 'center', color: '#000000', fontSize: '16px'}} |
| | | closable={false} |
| | | maskClosable={false} |
| | | visible={this.state.closeVisible} |
| | | onCancel={() => { this.setState({closeVisible: false}) }} |
| | | footer={[ |
| | | <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, |
| | | <Button key="confirm" className="mk-btn mk-yellow" onClick={this.props.handleBack}>{this.state.dict['model.notsave']}</Button>, |
| | | <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | {this.state.dict['header.menu.config.placeholder']} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | |
| | | position: absolute; |
| | | line-height: 45px; |
| | | font-size: 18px; |
| | | left: 10px; |
| | | right: 10px; |
| | | } |
| | | .am-navbar-title { |
| | | font-size: 16px; |
| | |
| | | |
| | | .modal-fields-row { |
| | | min-height: calc(100% - 95px); |
| | | padding: 0 10px 35px; |
| | | } |
| | | |
| | | .modal-form { |
| | |
| | | visible={visible} |
| | | placement={btnconfig.setting.placement || 'right'} |
| | | bodyStyle={{ paddingBottom: 80 }} |
| | | destroyOnClose |
| | | > |
| | | <MutilForm |
| | | BID={BID} |
| | |
| | | |
| | | render() { |
| | | const { btn, show, style } = this.props |
| | | const { loadingNumber, loading, visible, disabled } = this.state |
| | | const { loadingNumber, loading, disabled } = this.state |
| | | |
| | | if (show === 'actionList') { |
| | | return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}> |
| | |
| | | className={'mk-btn mk-' + btn.class} |
| | | onClick={() => {this.actionTrigger()}} |
| | | >{(loadingNumber ? `(${loadingNumber})` : '') + btn.label}</Button> |
| | | {visible ? this.getModels() : null} |
| | | {this.getModels()} |
| | | </div> |
| | | } else if (show && show.indexOf('plus') > -1) { |
| | | return <div className="mk-btn-wrap"> |
| | |
| | | style={{fontSize: show.substring(4) + 'px'}} |
| | | onClick={() => {this.actionTrigger()}} |
| | | ></Button> |
| | | {visible ? this.getModels() : null} |
| | | {this.getModels()} |
| | | </div> |
| | | } else { // icon、text、 all 卡片 |
| | | return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}> |
| | |
| | | icon={show === 'text' ? '' : (btn.icon || '')} |
| | | onClick={() => {this.actionTrigger()}} |
| | | >{show === 'icon' && btn.icon ? '' : btn.label}</Button> |
| | | {visible ? this.getModels() : null} |
| | | {this.getModels()} |
| | | </div> |
| | | } |
| | | } |
| | |
| | | text: '禁用' |
| | | }, { |
| | | value: 'simple', |
| | | text: '单次扫码' |
| | | text: '单次' |
| | | }, { |
| | | value: 'multi', |
| | | text: '连续扫码' |
| | | text: '连续' |
| | | }], |
| | | forbid: appType !== 'mob' |
| | | }, |
| | |
| | | <div> |
| | | <Button type="link" onClick={() => this.deleteSubApp(record)} style={{color: '#ff4d4f'}}>删除</Button> |
| | | <Button type="link" onClick={() => this.jumpApp(record)}>编辑应用</Button> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${base_url}${record.typename}/index.html#/index/${this.state.selectApp.kei_no}/${record.lang}` }}></Paragraph> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${base_url}${record.typename === 'pad' ? 'mob' : record.typename}/index.html#/index/${this.state.selectApp.kei_no}/${record.lang}` }}></Paragraph> |
| | | </div> |
| | | ) |
| | | }, |
| | |
| | | }) |
| | | |
| | | this.setState({ |
| | | config: {...config, components: []} |
| | | config: {...config, components}, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | config: {...config, components: components} |
| | | comloading: false |
| | | }) |
| | | }) |
| | | } |
| | |
| | | |
| | | if (res.status) { |
| | | config.open_edition = res.open_edition || '' |
| | | |
| | | |
| | | this.setState({ |
| | | config, |
| | | oriConfig: fromJS(config).toJS(), |
| | | }) |
| | | |
| | |
| | | copyButtons: [], |
| | | thawButtons: [], |
| | | menuloading: false, |
| | | config: {...config, components: []} |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | config: {...this.state.config, components: this.state.oriConfig.components} |
| | | comloading: false |
| | | }) |
| | | }) |
| | | notification.success({ |
| | |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className={'menu-body ' + (menuloading ? 'saving' : '')}> |
| | | <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | {config && !comloading ? <MobShell menu={config} handleList={this.updateConfig} /> : null} |
| | | </div> |
| | | {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <MobShell menu={config} handleList={this.updateConfig} /> |
| | | </div> : null} |
| | | </div> |
| | | </DndProvider> |
| | | <StyleController /> |
| | |
| | | customComponents: [], |
| | | settingshow: sessionStorage.getItem('settingshow') !== 'false', |
| | | controlshow: sessionStorage.getItem('controlshow') !== 'false', |
| | | comloading: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | }) |
| | | |
| | | this.setState({ |
| | | config: {...config, components: []} |
| | | config: {...config, components}, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | config: {...config, components: components} |
| | | comloading: false |
| | | }) |
| | | }) |
| | | } |
| | |
| | | config.open_edition = res.open_edition || '' |
| | | |
| | | this.setState({ |
| | | config, |
| | | oriConfig: fromJS(config).toJS(), |
| | | }) |
| | | |
| | |
| | | copyButtons: [], |
| | | thawButtons: [], |
| | | menuloading: false, |
| | | config: {...config, components: []} |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | config: {...this.state.config, components: this.state.oriConfig.components} |
| | | comloading: false |
| | | }) |
| | | }) |
| | | notification.success({ |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { localedict, loading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents } = this.state |
| | | const { localedict, loading, comloading, activeKey, settingshow, controlshow, dict, MenuId, config, menuloading, customComponents } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={localedict}> |
| | |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className={'menu-body ' + (menuloading ? 'saving' : '')}> |
| | | {config && config.components ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} |
| | | {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} |
| | | </div> |
| | | </DndProvider> |
| | | <StyleController /> |