king
2023-08-27 da64ab0923bf8817fc8599a6e37b953ce38f64c8
src/views/basedesign/index.jsx
@@ -14,13 +14,11 @@
const Header = asyncComponent(() => import('@/menu/header'))
const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig'))
const TreePageConfig = asyncLoadComponent(() => import('@/templates/treepageconfig'))
const CalendarPageConfig = asyncLoadComponent(() => import('@/templates/calendarconfig'))
const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig'))
const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig'))
const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig'))
const UpdateFormTab = asyncLoadComponent(() => import('./updateFormTab'))
document.body.className = ''
sessionStorage.setItem('isEditState', 'true')
class BaseDesign extends Component {
  state = {
@@ -41,6 +39,20 @@
  }
  UNSAFE_componentWillMount() {
    if (sessionStorage.getItem('devError') === 'true') {
      sessionStorage.clear()
      window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login')
      window.location.reload()
      return
    }
    if (!sessionStorage.getItem('UserID')) {
      this.props.history.replace('/login')
      return
    }
    window.GLOB.developing = true
    try {
      let param = JSON.parse(window.decodeURIComponent(window.atob(this.props.match.params.param)))
@@ -80,7 +92,7 @@
      loading: true
    })
    Api.getSystemConfig(param).then(res => {
    Api.getCloudConfig(param).then(res => {
      if (res.status) {
        editMenu.open_edition = res.open_edition || ''
        editMenu.LongParam = ''
@@ -100,7 +112,7 @@
            MenuID: editMenu.PageParam.copyMenuId
          }
      
          Api.getSystemConfig(_param).then(res => {
          Api.getCloudConfig(_param).then(res => {
            if (res.status) {
              if (res.LongParam) {
                let _LongParam = ''
@@ -173,64 +185,57 @@
  }
  render () {
    const { loading } = this.state
    const { loading, editMenu, subConfig, btnTab } = this.state
    return (
      <div className="mk-base-design-wrap">
        <ConfigProvider locale={_locale}>
          <Header/>
          {this.state.tabview === 'TreePage' ?
            <TreePageConfig
              menu={this.state.editMenu}
              reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'CalendarPage' ?
            <CalendarPageConfig
              menu={this.state.editMenu}
              reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'CommonTable' ?
            <ComTableConfig
              menu={this.state.editMenu}
              menu={editMenu}
              reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'Modal' ?
            <ModalConfig
              menu={this.state.editMenu}
              editTab={this.state.editTab}
              tabConfig={this.state.tabConfig}
              editSubTab={this.state.editSubTab}
              subTabConfig={this.state.subTabConfig}
              btnTab={this.state.btnTab}
              btnTabConfig={this.state.btnTabConfig}
              editAction={this.state.editAction}
              subConfig={this.state.subConfig}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'SubTable' ?
            <SubTable
              menu={this.state.editMenu}
              menu={editMenu}
              editTab={this.state.editTab}
              editSubTab={this.state.editSubTab}
              tabConfig={this.state.tabConfig}
              btnTab={this.state.btnTab}
              btnTab={btnTab}
              btnTabConfig={this.state.btnTabConfig}
              config={this.state.subConfig}
              config={subConfig}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'Modal' ?
            <ModalConfig
              menu={editMenu}
              editTab={this.state.editTab}
              tabConfig={this.state.tabConfig}
              editSubTab={this.state.editSubTab}
              subTabConfig={this.state.subTabConfig}
              btnTab={btnTab}
              btnTabConfig={this.state.btnTabConfig}
              editAction={this.state.editAction}
              subConfig={subConfig}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'TreePage' ?
            <TreePageConfig
              menu={editMenu}
              reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}}
              handleView={this.handleView}
            /> : null
          }
          {this.state.tabview === 'FormTab' ?
            <FormTabConfig
              menu={this.state.editMenu}
              btnTab={this.state.btnTab}
              config={this.state.subConfig}
            <UpdateFormTab
              menu={editMenu}
              btnTab={btnTab}
              config={subConfig}
              handleView={this.handleView}
            /> : null
          }