king
2021-01-28 86b366cac525ad676da3cfd65f67a551b9260aeb
src/views/menudesign/index.jsx
@@ -34,7 +34,7 @@
const PasteController = asyncComponent(() => import('@/menu/pastecontroller'))
const PaddingController = asyncComponent(() => import('@/menu/padcontroller'))
const StyleController = asyncComponent(() => import('@/menu/stylecontroller'))
// const PictureController = asyncComponent(() => import('@/menu/picturecontroller'))
const PictureController = asyncComponent(() => import('@/menu/picturecontroller'))
const StyleCombController = asyncComponent(() => import('@/menu/stylecombcontroller'))
const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton'))
const ModalController = asyncComponent(() => import('@/menu/modalconfig/controller'))
@@ -101,8 +101,10 @@
    MKEmitter.addListener('changePopview', this.initPopview)
    MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
    MKEmitter.addListener('updateCustomComponent', this.updateCustomComponent)
    this.updateCustomComponent()
    // this.getAppPictures()
    setTimeout(() => {
      this.updateCustomComponent()
      this.getAppPictures()
    }, 1000)
  }
  /**
@@ -120,18 +122,31 @@
    MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent)
  }
  // getAppPictures = () => {
  //   Api.getSystemConfig({
  //     func: 's_url_db_adduptdel',
  //     id: '',
  //     PageIndex: 0, // 0 代表全部
  //     PageSize: 0,  // 0 代表全部
  //     typecharone: 'image',
  //     type: 'search'
  //   }).then(res => {
  getAppPictures = () => {
    Api.getSystemConfig({
      func: 's_url_db_adduptdel',
      PageIndex: 0,  // 0 代表全部
      PageSize: 0,   // 0 代表全部
      typecharone: 'image',
      type: 'search'
    }).then(res => {
      if (res.status) {
        sessionStorage.setItem('app_pictures', JSON.stringify(res.data || []))
      }
  //   })
  // }
      Api.getSystemConfig({
        func: 's_url_db_adduptdel',
        PageIndex: 0,  // 0 代表全部
        PageSize: 0,   // 0 代表全部
        typecharone: 'video',
        type: 'search'
      }).then(res => {
        if (res.status) {
          sessionStorage.setItem('app_videos', JSON.stringify(res.data || []))
        }
      })
    })
  }
  updateCustomComponent = () => {
    Api.getSystemConfig({
@@ -166,6 +181,7 @@
        })
      }
      this.setState({customComponents: coms})
      this.getRoleFields()
    })
  }
@@ -330,7 +346,6 @@
        })
        this.props.modifyCustomMenu(config)
        this.getRoleFields()
      } else {
        notification.warning({
          top: 92,
@@ -794,7 +809,7 @@
  onEnabledChange = () => {
    const { config } = this.state
    if (!config.enabled && this.verifyConfig(true)) {
    if (!config || (!config.enabled && this.verifyConfig(true))) {
      return
    }
@@ -928,10 +943,10 @@
                  <div> {config && config.MenuName} </div>
                } bordered={false} extra={
                  <div>
                    {/* <PictureController/> */}
                    <PictureController/>
                    <StyleCombControlButton menu={config} />
                    <PasteController type="menu" Tab={null} insert={this.insert} />
                    {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null}
                    <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} />
                    <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button>
                    <Button type="default" onClick={this.closeView}>{dict['mob.return']}</Button>
                  </div>