king
2022-10-17 e8edfdadb561cd83bf6e1c3e00d55b8cc2aee6d5
src/templates/modalconfig/index.jsx
@@ -9,8 +9,6 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import { getModalForm } from '@/templates/zshare/formconfig'
import SourceElement from './dragelement/source'
@@ -24,7 +22,6 @@
const { Panel } = Collapse
const { confirm } = Modal
const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
const Versions = asyncComponent(() => import('@/menu/versions'))
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
@@ -51,7 +48,6 @@
  state = {
    menu: null,            // 上级菜单,三级菜单或标签
    dict: CommonDict,      // 字典
    config: null,          // 页面配置,包括模板类型、模态框设置、添加表名、表单列表
    visible: false,        // 表单编辑模态框,显示控制
    modalformlist: null,   // 基本信息表单字段
@@ -112,7 +108,7 @@
        {
          type: 'text',
          key: 'supMenu',
          label: this.state.dict['model.super'] + this.state.dict['model.menu'],
          label: '上级菜单',
          initVal: _menu.MenuName,
          required: true,
          readonly: true
@@ -751,7 +747,7 @@
  render () {
    const { editAction } = this.props
    const { config, dict, openEdition } = this.state
    const { config, openEdition } = this.state
    if (!config) return null
    
@@ -760,11 +756,8 @@
        <DndProvider backend={HTML5Backend}>
          <div className="tools">
            <Collapse accordion defaultActiveKey="1" bordered={false}>
              <Panel forceRender={true} header={dict['header.menu.basedata']} key="0" id="modal-basedata">
                <MenuForm
                  dict={dict}
                  formlist={this.state.modalformlist}
                />
              <Panel forceRender={true} header="基本信息" key="0" id="modal-basedata">
                <MenuForm formlist={this.state.modalformlist}/>
                {/* 表名添加 */}
                <TableComponent
                  config={config}
@@ -772,7 +765,7 @@
                  updatetable={this.updateconfig}
                />
              </Panel>
              <Panel header={dict['header.menu.form']} key="1">
              <Panel header="表单" key="1">
                <div className="search-element">
                  {SearchItems.map((item, index) => {
                    return (<SourceElement key={index} content={item}/>)
@@ -788,9 +781,9 @@
                <Button type="danger" onClick={this.clearConfig}>清空</Button>
                <Versions MenuId={editAction.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/>
                <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/>
                <EditComponent dict={dict} options={['form']} config={this.state.config} plusFields={this.plusFields}/>
                <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['model.save']}</Button>
                <Button onClick={this.cancelConfig}>{dict['model.back']}</Button>
                <EditComponent options={['form']} config={this.state.config} plusFields={this.plusFields}/>
                <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>保存</Button>
                <Button onClick={this.cancelConfig}>返回</Button>
              </div>
            } style={{ width: '100%' }}>
              <SettingOutlined onClick={this.changeSetting} />
@@ -801,7 +794,7 @@
                  <Button className="mk-cols-change" onClick={() => this.changecols(2)}>2列</Button>
                  <Button className="mk-cols-change" onClick={() => this.changecols(3)}>3列</Button>
                  <Button className="mk-cols-change" onClick={() => this.changecols(4)}>4列</Button>
                  <Switch checkedChildren={dict['model.switch.open']} unCheckedChildren={dict['model.switch.close']} defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
                  <Switch checkedChildren="开" unCheckedChildren="关" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />
                </div>
                <div className="ant-modal-body">
                  <div className="modal-form">
@@ -809,7 +802,6 @@
                      list={config.fields}
                      setting={config.setting}
                      showField={this.state.showField}
                      placeholder={dict['header.form.modal.placeholder']}
                      handleList={this.handleList}
                      handleForm={this.handleForm}
                      closeForm={this.closeForm}
@@ -819,10 +811,10 @@
                <div className="ant-modal-footer">
                  <div>
                    <button type="button" className="ant-btn">
                      <span>{dict['model.cancel']}</span>
                      <span>取消</span>
                    </button>
                    <button type="button" className="ant-btn ant-btn-primary">
                      <span>{dict['model.confirm']}</span>
                      <span>确定</span>
                    </button>
                  </div>
                  <div className="action-mask"></div>
@@ -832,7 +824,7 @@
          </div>
        </DndProvider>
        <Modal
          title={dict['model.edit']}
          title="编辑"
          visible={this.state.visible}
          width={950}
          maskClosable={false}
@@ -842,7 +834,6 @@
          destroyOnClose
        >
          <ModalForm
            dict={dict}
            card={this.state.card}
            formlist={this.state.formlist}
            inputSubmit={this.handleSubmit}
@@ -851,7 +842,7 @@
          />
        </Modal>
        <Modal
          title={dict['model.edit']}
          title="编辑"
          visible={this.state.settingVisible}
          width={900}
          maskClosable={false}
@@ -873,13 +864,13 @@
          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}>{dict['model.save']}</Button>,
            <Button key="confirm" className="mk-btn mk-yellow" onClick={this.handleViewBack}>{dict['model.notsave']}</Button>,
            <Button key="cancel" onClick={() => { this.setState({closeVisible: false}) }}>{dict['model.cancel']}</Button>
            <Button key="save" className="mk-btn mk-green" loading={this.state.closeloading} 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
        >
          {dict['header.menu.config.placeholder']}
          配置已修改,是否保存配置信息?
        </Modal>
        <StyleController />
      </div>