king
2022-10-18 a8507cc8c42d17d4fb854594dbf1e084d61912ac
src/views/mobdesign/index.jsx
@@ -10,8 +10,6 @@
import Api from '@/api'
import Utils, { setGLOBFuncs } from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/mob.js'
import enUS from '@/locales/en-US/mob.js'
import antdZhCN from 'antd/es/locale/zh_CN'
import MKEmitter from '@/utils/events.js'
import MenuUtils from '@/utils/utils-custom.js'
@@ -62,7 +60,6 @@
class MobDesign extends Component {
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    loading: true,
    MenuId: '',
    MenuName: '',
@@ -98,9 +95,6 @@
        sessionStorage.setItem('userbind', param.userbind || '')
        sessionStorage.setItem('instantMessage', param.instantMessage || '')
        this.setState({
          dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
        })
        this.getAppMessage(param.MenuID)
      } else if (param.type === 'view') {
        window.GLOB.winWidth = 420
@@ -665,7 +659,7 @@
        headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false,
        wrap: {name: 'logo', width: 24, datatype: 'static', cardType: '', blacklist: []},
        name: 'logo', floor: 1, switchable: true,
        setting:{interType: 'system'}, tabId: '', style:{paddingTop: '8vh', paddingBottom: '10vh'}, dataName: Utils.getuuid(), format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
        setting:{interType: 'system'}, tabId: '', style:{paddingTop: '8vh', paddingBottom: '10vh'}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
      })
      config.components.push({
@@ -674,7 +668,6 @@
        floor: 1,
        tabId: '',
        parentId: '',
        dataName: '',
        width: 24,
        name: '用户绑定',
        subtype: 'bindlogin',
@@ -697,7 +690,7 @@
        headerStyle: {}, parentId: '', width: 24, scripts: [], pageable: false,
        wrap: {name: 'Power', width: 24, datatype: 'static', cardType: '', blacklist: []},
        name: 'Power', floor: 1, switchable: true,
        setting:{interType: 'system'}, tabId: '', style:{}, dataName: Utils.getuuid(), format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
        setting:{interType: 'system'}, tabId: '', style:{}, format: 'object', subtype: 'propcard', type: 'card', uuid: Utils.getuuid(), columns: []
      })
    }
    
@@ -811,7 +804,16 @@
          }
        }
      } else {
        config.components = MenuUtils.resetConfig(config.components, {}, urlParam.clearMenu)
        let uuids = {} // 重置公共数据源
        if (config.interfaces && config.interfaces.length > 0) {
          config.interfaces = config.interfaces.map(inter => {
            uuids[inter.uuid] = this.getuuid()
            inter.uuid = uuids[inter.uuid]
            return inter
          })
        }
        config.components = MenuUtils.resetConfig(config.components, uuids, urlParam.clearMenu)
        config.enabled = false
        message.success('复制成功,保存后生效。')
      }
@@ -1966,7 +1968,7 @@
  render () {
    const { viewType, comloading, loading, settingshow, controlshow, activeKey, dict, MenuId, config, menuloading, customComponents, adapters, eyeopen } = this.state
    const { viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, customComponents, adapters, eyeopen } = this.state
    return (
      <ConfigProvider locale={antdZhCN}>
@@ -1985,7 +1987,6 @@
                  <Panel header="基本信息" forceRender className="basedata" key="basedata">
                    {/* 菜单信息 */}
                    {config ? <MenuForm
                      dict={dict}
                      config={config}
                      MenuId={MenuId}
                      adapters={adapters}
@@ -1997,7 +1998,7 @@
                    {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null}
                  </Panel>
                  {/* 组件添加 */}
                  <Panel header={dict['mob.component']} className="component" key="component">
                  <Panel header="组件" className="component" key="component">
                    <SourceWrap />
                  </Panel>
                  <Panel header="元素" key="element">
@@ -2018,8 +2019,8 @@
                {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null}
              </div>
              <div className="wrap">
                <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>{dict['mob.save']}</Button>
                <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config && config.enabled} onChange={this.onEnabledChange} />
                <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/>
                <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button>
                <CreateView resetmenu={this.getAppMenus} />