king
2022-02-22 de516477e7c11d667b3d77f6a37b5df8e893bd29
src/views/mobdesign/index.jsx
@@ -6,7 +6,7 @@
import moment from 'moment'
import HTML5Backend from 'react-dnd-html5-backend'
import { ConfigProvider, notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd'
import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, RedoOutlined } from '@ant-design/icons'
import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, RedoOutlined, ArrowLeftOutlined } from '@ant-design/icons'
import Api from '@/api'
import Utils, { setGLOBFuncs } from '@/utils/utils.js'
@@ -17,7 +17,6 @@
import MKEmitter from '@/utils/events.js'
import MenuUtils from '@/utils/utils-custom.js'
import asyncComponent from '@/utils/asyncComponent'
import backurl from '@/assets/img/back.jpg'
import './index.scss'
@@ -1103,13 +1102,17 @@
      let roleParam = {type: 'view', key: config.uuid, title: config.MenuName, children: []}
      roleParam.children = this.getMenuMessage()
      config.loginview = false
      config.tabview = false
      if (config.components.findIndex(item => item.type === 'login') > -1) {
        roleParam.login = true
        config.loginview = true
      } else {
        config.loginview = false
      }
      config.components.forEach(item => {
        if (item.type === 'login') {
          roleParam.login = true
          config.loginview = true
        } else if (item.type === 'navbar') {
          config.tabview = true
        }
      })
      if (adapters.includes('wxmini')) {
        config = this.getMiniStyle(config)
@@ -1403,6 +1406,7 @@
          swipes.push(item.name)
        }
        if (['voucher'].includes(item.subtype)) return
        if (['propcard', 'brafteditor', 'sandbox', 'tabbar', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return
        if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return
        if (['menubar'].includes(item.type) && item.wrap.datatype !== 'dynamic') return
@@ -1465,13 +1469,27 @@
  insert = (item) => {
    let config = fromJS(this.state.config).toJS()
    if (item.type === 'topbar' && config.components.findIndex(m => m.type === 'topbar') > -1) {
    if (item.type === 'search') {
      notification.warning({
        top: 92,
        message: '导航栏不可重复添加!',
        message: '移动端搜索组件不可粘贴!',
        duration: 5
      })
      return
    }
    if (item.type === 'topbar') {
      if (config.components.findIndex(m => m.type === 'topbar') > -1) {
        notification.warning({
          top: 92,
          message: '导航栏不可重复添加!',
          duration: 5
        })
        return
      }
      if (!config.style.paddingTop) {
        config.style.paddingTop = '50px'
      }
    }
    config.components.push(item)
@@ -1713,7 +1731,7 @@
              <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} />
                <img title="后退" className="back-view" onClick={this.backView} src={backurl} alt=""/>
                <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/>
                <CreateView resetmenu={this.getAppMenus} />
                <PasteController insert={this.insert} />
                <StyleCombControlButton menu={config} />