| | |
| | | import { QuestionCircleOutlined, RedoOutlined, SettingOutlined, PlusOutlined, DeleteOutlined, EditOutlined, SnippetsOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import Utils, { FuncUtils } from '@/utils/utils.js' |
| | | import { getModalForm, getActionForm } from '@/templates/zshare/formconfig' |
| | | import { queryTableSql } from '@/utils/option.js' |
| | |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 字典 |
| | | config: null, // 页面配置 |
| | | modaltype: '', // 模态框类型,控制模态框显示 |
| | | tableColumns: [], // 表格显示列 |
| | |
| | | { |
| | | type: 'text', |
| | | key: 'menuName', |
| | | label: this.state.dict['model.menu'] + this.state.dict['model.name'], |
| | | label: '菜单名称', |
| | | initVal: menu.MenuName, |
| | | readonly: true |
| | | }, |
| | |
| | | }, () => { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['model.menu.basemsg'], |
| | | message: '请完善菜单基本信息!', |
| | | duration: 5 |
| | | }) |
| | | }) |
| | |
| | | <div className="tools"> |
| | | <Collapse accordion defaultActiveKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> |
| | | {/* 基本信息 */} |
| | | <Panel forceRender={true} header={this.state.dict['header.menu.basedata']} key="0" id="common-basedata"> |
| | | <Panel forceRender={true} header="基本信息" key="0" id="common-basedata"> |
| | | {/* 菜单信息 */} |
| | | <MenuForm |
| | | dict={this.state.dict} |
| | | formlist={this.state.menuformlist} |
| | | wrappedComponentRef={(inst) => this.menuformRef = inst} |
| | | /> |
| | | </Panel> |
| | | {/* 搜索条件添加 */} |
| | | <Panel header={this.state.dict['header.menu.form']} key="1"> |
| | | <Panel header="表单" key="1"> |
| | | <div className="search-element"> |
| | | {Source.searchItems.map((item, index) => { |
| | | return (<SourceElement key={index} content={item}/>) |
| | |
| | | </div> |
| | | </Panel> |
| | | {/* 按钮添加 */} |
| | | <Panel header={this.state.dict['header.menu.action']} key="2"> |
| | | <Panel header="按钮" key="2"> |
| | | <div className="search-element"> |
| | | {Source.actionItems.map((item, index) => { |
| | | return (<SourceElement key={index} content={item}/>) |
| | |
| | | </div> |
| | | </Panel> |
| | | {/* 添加标签 */} |
| | | <Panel header={this.state.dict['header.menu.tab']} key="4"> |
| | | <Panel header="标签页" key="4"> |
| | | <div className="search-element"> |
| | | {Source.tabItems.map((item, index) => { |
| | | return (<SourceElement key={index} content={item}/>) |
| | |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <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> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button> |
| | | <Button onClick={this.cancelConfig}>返回</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <SettingOutlined onClick={this.changeSetting} /> |
| | |
| | | <EditOutlined onClick={() => { this.handleGroup(group) }}/> |
| | | </span> |
| | | )}> |
| | | {group.isDefault ? <SnippetsOutlined title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> : null} |
| | | {group.isDefault ? <SnippetsOutlined title="粘贴" onClick={() => {this.setState({pasteVisible: true})}} /> : null} |
| | | <DragElement |
| | | type="search" |
| | | groupId={group.uuid} |
| | |
| | | destroyOnClose |
| | | > |
| | | <ModalForm |
| | | dict={this.state.dict} |
| | | card={this.state.card} |
| | | formlist={this.state.formlist} |
| | | inputSubmit={this.handleSubmit} |
| | |
| | | </Modal> |
| | | {/* 编辑按钮:复制、编辑 */} |
| | | <Modal |
| | | title={this.state.dict['model.action'] + '-' + this.state.dict['model.edit']} |
| | | title="按钮编辑" |
| | | visible={modaltype === 'actionEdit'} |
| | | width={920} |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | footer={[ |
| | | this.state.card && this.state.card.btnType !== 'cancel' ? |
| | | <CreateFunc key="create" dict={this.state.dict} ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>{this.state.dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.handleSubmit}>{this.state.dict['model.confirm']}</Button> |
| | | <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>取消</Button>, |
| | | <Button key="confirm" type="primary" onClick={this.handleSubmit}>确定</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | <ActionForm |
| | | dict={this.state.dict} |
| | | card={this.state.card} |
| | | tabs={this.state.tabviews} |
| | | formlist={this.state.formlist} |
| | |
| | | visible={this.state.profileVisible} |
| | | width={'90vw'} |
| | | maskClosable={false} |
| | | okText={this.state.dict['model.submit']} |
| | | okText="提交" |
| | | onOk={this.verifySubmit} |
| | | onCancel={() => { |
| | | if (this.verifyRef.handleCancel) { |
| | |
| | | config={this.state.config} |
| | | columns={this.state.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | dict={this.state.dict} |
| | | /> |
| | | </Modal> |
| | | {/* 设置全局配置及列表数据源 */} |
| | | <Modal |
| | | title={this.state.dict['model.edit']} |
| | | title="编辑" |
| | | visible={this.state.settingVisible} |
| | | width={700} |
| | | maskClosable={false} |
| | |
| | | }) |
| | | }} |
| | | footer={[ |
| | | <CreateFunc key="create" dict={this.state.dict} ref="tableCreatFunc" trigger={this.tableCreatFunc}/>, |
| | | <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['model.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>{this.state.dict['model.confirm']}</Button> |
| | | <CreateFunc key="create" ref="tableCreatFunc" trigger={this.tableCreatFunc}/>, |
| | | <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>取消</Button>, |
| | | <Button key="confirm" type="primary" loading={this.state.sqlVerifing} onClick={this.settingSave}>确定</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | <SettingForm |
| | | dict={this.state.dict} |
| | | menu={this.props.menu} |
| | | config={this.state.config} |
| | | inputSubmit={this.settingSave} |
| | |
| | | visible={this.state.closeVisible} |
| | | onCancel={() => { this.setState({closeVisible: false}) }} |
| | | footer={[ |
| | | <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>{this.state.dict['model.save']}</Button>, |
| | | <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>{this.state.dict['model.notsave']}</Button>, |
| | | <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{this.state.dict['model.cancel']}</Button> |
| | | <Button key="save" className="mk-btn mk-green" loading={this.state.menucloseloading} onClick={this.submitConfig}>保存</Button>, |
| | | <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>不保存</Button>, |
| | | <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>取消</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | {this.state.dict['header.menu.config.placeholder']} |
| | | 配置已修改,是否保存配置信息? |
| | | </Modal> |
| | | <Modal |
| | | title="分组管理" |
| | |
| | | > |
| | | <GroupForm |
| | | groups={config.groups} |
| | | dict={this.state.dict} |
| | | group={this.state.editgroup} |
| | | inputSubmit={this.handleGroupSave} |
| | | wrappedComponentRef={(inst) => this.groupRef = inst} |
| | |
| | | </Modal> |
| | | {/* 按钮配置信息粘贴复制 */} |
| | | <Modal |
| | | title={this.state.dict['header.form.paste']} |
| | | title="粘贴" |
| | | visible={this.state.pasteVisible} |
| | | width={600} |
| | | maskClosable={false} |
| | |
| | | destroyOnClose |
| | | > |
| | | <PasteForm |
| | | dict={this.state.dict} |
| | | wrappedComponentRef={(inst) => this.pasteFormRef = inst} |
| | | inputSubmit={this.pasteSubmit} |
| | | /> |