king
2023-03-11 34e7681fd12b1c4e4994d3bea1a553870e10bc50
src/views/mobdesign/index.jsx
@@ -34,6 +34,7 @@
const TableNodes = asyncComponent(() => import('@/menu/tablenodes'))
const BgController = asyncComponent(() => import('@/pc/bgcontroller'))
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
const NormalCss = asyncComponent(() => import('@/menu/normalCss'))
const SysInterface = asyncComponent(() => import('@/menu/sysinterface'))
const Quotecomponent = asyncComponent(() => import('@/pc/quotecomponent'))
const PasteController = asyncComponent(() => import('@/menu/pastecontroller'))
@@ -147,7 +148,6 @@
    MKEmitter.addListener('changeEditMenu', this.changeEditMenu)
    setTimeout(() => {
      this.getAppPictures()
      this.getSmStemp()
      this.getRoleFields()
      setGLOBFuncs()
    }, 1000)
@@ -336,41 +336,6 @@
      return false
    }
    return true
  }
  getSmStemp = () => {
    if (!sessionStorage.getItem('msgTemplate')) {
      let _sql = `select ID,TemplateCode,SignName+'_'+describe as SignName from (select * from bd_msn_sms_temp where deleted=0 and status=20 ) a
        inner join (select openid from sapp where id='${window.GLOB.appkey}') b
        on a.openid=b.openid`
      _sql = Utils.formatOptions(_sql)
      let param = {
        func: 'sPC_Get_SelectedList',
        LText: _sql,
        obj_name: 'data',
        arr_field: 'ID,TemplateCode,SignName'
      }
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证
      Api.getSystemConfig(param).then(res => {
        let msgs = []
        if (!res.status) {
          notification.warning({
            top: 92,
            message: res.message,
            duration: 5
          })
        } else if (res.data) {
          msgs = res.data
        }
        sessionStorage.setItem('msgTemplate', JSON.stringify(msgs))
      })
    }
  }
  changeEditMenu = (menu) => {
@@ -841,16 +806,15 @@
          }
        }
      } else {
        let uuids = {} // 重置公共数据源
        let commonId = Utils.getuuid()
        if (config.interfaces && config.interfaces.length > 0) {
          config.interfaces = config.interfaces.map(inter => {
            uuids[inter.uuid] = this.getuuid()
            inter.uuid = uuids[inter.uuid]
            inter.uuid = md5(commonId + inter.uuid)
            return inter
          })
        }
        config.components = MenuUtils.resetConfig(config.components, uuids, urlParam.clearMenu)
        config.components = MenuUtils.resetConfig(config.components, commonId, urlParam.clearMenu)
        if (config.version !== 2.0) {
          config.components = this.collectTB(config.components)
@@ -1060,6 +1024,17 @@
          })
          item.subcards.forEach(card => {
            card.elements && card.elements.forEach(cell => {
              if (cell.eleType !== 'button' || cell.hidden === 'true') return
              m.children.push({
                key: cell.uuid,
                title: cell.label,
              })
            })
            if (item.subtype !== 'dualdatacard') return
            card.backElements && card.backElements.forEach(cell => {
              if (cell.eleType !== 'button' || cell.hidden === 'true') return
              m.children.push({
@@ -1595,14 +1570,14 @@
                    }
                    resolve(result)
                  })
                  }, this.netError)
                } else {
                  resolve(res)
                }
              } else {
                resolve(res)
              }
            })
            }, this.netError)
          }
        }
      }).then(res => { // 页面保存
@@ -1640,8 +1615,21 @@
            duration: 5
          })
        }
      })
      }, this.netError)
    }, 300 + (+sessionStorage.getItem('mkDelay')))
  }
  netError = (error) => {
    this.setState({
      menuloading: false
    })
    if (!error) {
      notification.warning({
        top: 92,
        message: '保存失败,请检查网络是否正常。',
        duration: 5
      })
    }
  }
  getRoleFields = () => {
@@ -2026,6 +2014,7 @@
                    {config ? <TableComponent config={config} updatetable={this.updateConfig}/> : null}
                    {config ? <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> : null}
                    {config ? <Paragraph style={{padding: '10px 0px 0px 18px'}} copyable={{ text:  `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> : null}
                    {config ? <NormalCss config={config} updateConfig={this.updateConfig}/> : null}
                  </Panel>
                  {/* 组件添加 */}
                  <Panel header="组件" className="component" key="component">
@@ -2034,7 +2023,7 @@
                  <Panel header="元素" key="element">
                    <Modulecell />
                  </Panel>
                  <Panel header={'页面样式'} key="background">
                  <Panel header="页面样式" key="background">
                    {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null}
                  </Panel>
                </Collapse>