king
2021-10-12 4eae7af1ce6cd0ea8ac6485e26528625e83c3c70
2021-10-12
15个文件已修改
197 ■■■■ 已修改文件
src/menu/components/tabs/paste/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/pastecontroller/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/popview/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pc/modulesource/option.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.scss 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/menuconfig/editthdmenu/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-custom.js 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/appmanage/scriptform/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/appmanage/transform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mobdesign/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pcdesign/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/printTemplate/index.jsx 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/printTemplate/print.js 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/paste/index.jsx
@@ -23,18 +23,20 @@
    this.setState({visible: true})
  }
  resetconfig = (item, Tab, copyBtns) => {
  resetconfig = (item, Tab, copyBtns, uuids = {}) => {
    item.floor = Tab.floor + 1
    item.tabId = Tab.uuid
    item.parentId = Tab.parentId
    
    if (item.type === 'tabs') {
      item.uuid = MenuUtils.getuuid()
      uuids[item.uuid] = MenuUtils.getuuid()
      item.uuid = uuids[item.uuid]
      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
      item.name = item.setting.name
      
      item.subtabs.forEach(tab => {
        tab.uuid = MenuUtils.getuuid()
        uuids[tab.uuid] = MenuUtils.getuuid()
        tab.uuid = uuids[tab.uuid]
        tab.parentId = item.uuid
        if (item.floor >= 3) {
@@ -42,12 +44,13 @@
        }
        tab.components = tab.components.map(cell => {
          cell = this.resetconfig(cell, tab, copyBtns)
          cell = this.resetconfig(cell, tab, copyBtns, uuids)
          return cell
        })
      })
    } else if (item.type === 'group') {
      item.uuid = MenuUtils.getuuid()
      uuids[item.uuid] = MenuUtils.getuuid()
      item.uuid = uuids[item.uuid]
      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
      item.name = item.setting.name
@@ -56,12 +59,12 @@
        cell.tabId = Tab.uuid
        cell.parentId = Tab.parentId
        cell = MenuUtils.resetComponentConfig(cell, copyBtns)
        cell = MenuUtils.resetComponentConfig(cell, copyBtns, uuids)
        return cell
      })
    } else {
      item = MenuUtils.resetComponentConfig(item, copyBtns)
      item = MenuUtils.resetComponentConfig(item, copyBtns, uuids)
    }
    return item
src/menu/pastecontroller/index.jsx
@@ -22,16 +22,18 @@
    this.setState({visible: true})
  }
  resetconfig = (item, copyBtns) => {
  resetconfig = (item, copyBtns, uuids = {}) => {
    let appType = sessionStorage.getItem('appType')
    
    if (item.type === 'tabs') {
      item.uuid = MenuUtils.getuuid()
      uuids[item.uuid] = MenuUtils.getuuid()
      item.uuid = uuids[item.uuid]
      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
      item.name = item.setting.name
      item.subtabs.forEach(tab => {
        tab.uuid = MenuUtils.getuuid()
        uuids[tab.uuid] = MenuUtils.getuuid()
        tab.uuid = uuids[tab.uuid]
        tab.parentId = item.uuid
        if (appType !== 'mob') {
@@ -43,12 +45,13 @@
          cell.tabId = tab.uuid
          cell.parentId = tab.parentId
          cell = this.resetconfig(cell, copyBtns)
          cell = this.resetconfig(cell, copyBtns, uuids)
          return cell
        })
      })
    } else if (item.type === 'group') {
      item.uuid = MenuUtils.getuuid()
      uuids[item.uuid] = MenuUtils.getuuid()
      item.uuid = uuids[item.uuid]
      item.setting.name = item.setting.name + MenuUtils.getdataName().toUpperCase().substr(-4)
      item.name = item.setting.name
@@ -57,11 +60,11 @@
        cell.tabId = item.tabId || ''
        cell.parentId = item.parentId || ''
        cell = MenuUtils.resetComponentConfig(cell, copyBtns)
        cell = MenuUtils.resetComponentConfig(cell, copyBtns, uuids)
        return cell
      })
    } else {
      item = MenuUtils.resetComponentConfig(item, copyBtns)
      item = MenuUtils.resetComponentConfig(item, copyBtns, uuids)
    }
    return item
src/menu/popview/index.jsx
@@ -178,6 +178,11 @@
      MenuID: MenuId
    }
    if (sessionStorage.getItem('appType') === 'pc') {
      param.TypeCharOne = sessionStorage.getItem('kei_no')
      param.Typename = 'pc'
    }
    Api.getSystemConfig(param).then(result => {
      if (result.status) {
        let config = null
@@ -379,11 +384,18 @@
        LText: []
      }
      btnParam.LText = this.getMenuMessage()
      btnParam.LText = btnParam.LText.join(' union all ')
      btnParam.LText = Utils.formatOptions(btnParam.LText)
      btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
      if (sessionStorage.getItem('appType') === 'pc') {
        param.TypeCharOne = sessionStorage.getItem('kei_no')
        param.Typename = 'pc'
        btnParam.LText = ''
      } else {
        btnParam.LText = this.getMenuMessage()
        btnParam.LText = btnParam.LText.join(' union all ')
        btnParam.LText = Utils.formatOptions(btnParam.LText)
        btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp)
      }
      new Promise(resolve => {
        if (delButtons.length === 0) {
@@ -496,6 +508,8 @@
          error = `组件《${item.name}》未设置数据源!`
        } else if (item.setting.interType && !item.setting.primaryKey) {
          error = `组件《${item.name}》未设置主键!`
        } else if (!item.setting.supModule) {
          error = `组件《${item.name}》未设置上级组件!`
        }
      }
      if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') {
src/pc/modulesource/option.jsx
@@ -39,6 +39,7 @@
  { type: 'menu', url: Carousel, component: 'carousel', subtype: 'datacard', title: '轮播-动态数据', width: 24 },
  { type: 'menu', url: Carousel1, component: 'carousel', subtype: 'propcard', title: '轮播-静态数据', width: 24 },
  { type: 'menu', url: NormalTable, component: 'table', subtype: 'normaltable', title: '常用表', width: 24 },
  { type: 'menu', url: NormalTable, component: 'table', subtype: 'editable', title: '表格(可编辑)', width: 24 },
  { type: 'menu', url: TableCard, component: 'table', subtype: 'tablecard', title: '表格(卡片)', width: 12 },
  { type: 'menu', url: tree, component: 'tree', subtype: 'normaltree', title: '树形列表', width: 12 },
  { type: 'menu', url: line, component: 'line', subtype: 'line', title: '折线图', width: 24 },
src/tabviews/zshare/actionList/popupbutton/index.scss
@@ -1,6 +1,9 @@
.custom-popview.popview-modal {
  >.ant-modal-content >.ant-modal-body {
    padding: 0;
    .custom-page-wrap {
      min-height: 200px;
    }
  }
}
.custom-drawer-popview {
@@ -24,6 +27,9 @@
        text-align: right;
        box-shadow: 0 0 3px #cbcbcb;
      }
      .custom-page-wrap {
        min-height: calc(100vh - 110px);
      }
    }
  }
}
src/templates/menuconfig/editthdmenu/index.jsx
@@ -717,6 +717,7 @@
          config.MenuNo = param.MenuNo
          config.easyCode = ''
          config.components = MenuUtils.resetConfig(config.components)
          config.enabled = false
          param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config)))
        }
src/utils/utils-custom.js
@@ -332,17 +332,19 @@
   * @description 重置菜单配置,页面整体复制
   * @return {String}  components 配置信息
   */
  static resetConfig = (components) => {
  static resetConfig = (components, uuids = {}) => {
    return components.map(item => {
      if (item.type === 'navbar') {
        return item
      }
      item.uuid = this.getuuid()
      uuids[item.uuid] = this.getuuid()
      item.uuid = uuids[item.uuid]
      if (item.type === 'tabs') {
        item.subtabs.forEach(tab => {
          tab.uuid = this.getuuid()
          uuids[tab.uuid] = this.getuuid()
          tab.uuid = uuids[tab.uuid]
          tab.parentId = item.uuid
  
          tab.components = tab.components.map(cell => {
@@ -350,14 +352,14 @@
            cell.parentId = item.uuid
            return cell
          })
          tab.components = this.resetConfig(tab.components)
          tab.components = this.resetConfig(tab.components, uuids)
        })
      } else if (item.type === 'group') {
        item.components = item.components.map(cell => {
          cell.parentId = item.uuid
          return cell
        })
        item.components = this.resetConfig(item.components)
        item.components = this.resetConfig(item.components, uuids)
      } else if (item.type === 'menubar') {
        item.subMenus = item.subMenus.map(cell => {
          cell.uuid = this.getuuid()
@@ -487,6 +489,19 @@
        })
      }
      if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') {
        let em = false
        item.setting.supModule = item.setting.supModule.map(c => {
          if (!uuids[c]) {
            em = true
          }
          return uuids[c] || ''
        })
        if (em) {
          item.setting.supModule = ''
        }
      }
      if (item.wrap && item.wrap.doubleClick) {
        item.wrap.doubleClick = oriUids[item.wrap.doubleClick] || ''
      }
@@ -513,12 +528,17 @@
  * @description 重置组件配置
  * @return {String}  item 组件信息
  */
  static resetComponentConfig = (item, copyBtns) => {
  static resetComponentConfig = (item, copyBtns, uuids = {}) => {
    if (item.type === 'navbar') {
      return item
    }
    item.uuid = this.getuuid()
    let _uuid = this.getuuid()
    uuids[item.uuid] = _uuid
    item.uuid = _uuid
    if (item.dataName) {
      item.dataName = this.getdataName()
    }
@@ -725,8 +745,17 @@
      })
    }
    if (item.setting && item.setting.supModule) {
      item.setting.supModule = ''
    if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') {
      let em = false
      item.setting.supModule = item.setting.supModule.map(c => {
        if (!uuids[c]) {
          em = true
        }
        return uuids[c] || ''
      })
      if (em) {
        item.setting.supModule = ''
      }
    }
    if (item.wrap && item.wrap.doubleClick) {
src/utils/utils.js
@@ -1147,7 +1147,7 @@
  // 控制台打印数据
  let conLtext = []
  let _Ltext = data.map((item, lindex) => {
  let _Ltext = data.map(item => {
    let vals = []
    let convals = []
    columns.forEach(col => {
src/views/appmanage/scriptform/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Input, Select, notification } from 'antd'
import { Form, Row, Col, Input, Select, notification, Tooltip, Icon } from 'antd'
import moment from 'moment'
import Api from '@/api'
@@ -159,7 +159,11 @@
      <Form {...formItemLayout} className="app-script-form">
        <Row gutter={24}>
          <Col span={12}>
            <Form.Item label="类型">
            <Form.Item label={
              <Tooltip placement="topLeft" title="1、初次升级或应用基本信息修改时,请首先添加应用(基本信息);2、子应用整体升级时,请添加子应用(升级内容包括页面及权限树);3、单个页面升级时,请添加页面;4、涉及权限更新时,请添加权限树">
                <Icon style={{color: '#c49f47', marginRight: '5px'}} type="question-circle" />类型
              </Tooltip>
            }>
              {getFieldDecorator('VType', {
                initialValue: 'subapp',
                rules: [{
src/views/appmanage/transform/index.jsx
@@ -63,7 +63,7 @@
                  max: 20,
                  message: '传输号不可超过20个字符!'
                }]
              })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)}
              })(<Input placeholder="" autoFocus autoComplete="off" onPressEnter={this.handleSubmit} />)}
            </Form.Item>
          </Col> : null}
          <Col span={24}>
src/views/menudesign/index.jsx
@@ -723,6 +723,7 @@
                      _conf.uuid = item.uuid
                      _conf.MenuID = item.uuid
                      _conf.Template = 'CustomPage'
                      _conf.enabled = false
                    } else {
                      resolve({
                        status: true
@@ -863,6 +864,8 @@
            error = `组件《${item.name}》未设置数据源!`
          } else if (!item.setting.primaryKey) {
            error = `组件《${item.name}》未设置主键!`
          } else if (!item.setting.supModule) {
            error = `组件《${item.name}》未设置上级组件!`
          }
        }
        if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') {
src/views/mobdesign/index.jsx
@@ -580,6 +580,7 @@
        }
      } else {
        config.components = MenuUtils.resetConfig(config.components)
        config.enabled = false
        message.success('复制成功,保存后生效。')
      }
      
@@ -1142,6 +1143,8 @@
            error = `组件《${item.name}》未设置数据源!`
          } else if (!item.setting.primaryKey) {
            error = `组件《${item.name}》未设置主键!`
          } else if (!item.setting.supModule) {
            error = `组件《${item.name}》未设置上级组件!`
          }
        }
        if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') {
src/views/pcdesign/index.jsx
@@ -652,6 +652,7 @@
        }
      } else {
        config.components = MenuUtils.resetConfig(config.components)
        config.enabled = false
        message.success('复制成功,保存后生效。')
      }
      
@@ -1243,7 +1244,9 @@
                Api.getSystemConfig({
                  func: 'sPC_Get_LongParam',
                  MenuID: item.$originUuid
                  MenuID: item.$originUuid,
                  TypeCharOne: sessionStorage.getItem('kei_no'),
                  typename: 'pc',
                }).then(result => {
                  if (result.status) {
                    let _conf = ''
@@ -1260,6 +1263,7 @@
                      _conf.uuid = item.uuid
                      _conf.MenuID = item.uuid
                      _conf.Template = 'webPage'
                      _conf.enabled = false
                    } else {
                      resolve({
                        status: true
@@ -1275,7 +1279,9 @@
                      Template: 'webPage',
                      MenuName: item.label,
                      PageParam: JSON.stringify({Template: 'webPage'}),
                      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_conf)))
                      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(_conf))),
                      TypeCharOne: sessionStorage.getItem('kei_no'),
                      Typename: 'pc',
                    }
            
                    Api.getSystemConfig(_param).then(response => {
@@ -1401,6 +1407,8 @@
            error = `组件《${item.name}》未设置数据源!`
          } else if (!item.setting.primaryKey) {
            error = `组件《${item.name}》未设置主键!`
          } else if (!item.setting.supModule) {
            error = `组件《${item.name}》未设置上级组件!`
          }
        }
        if (item.type === 'bar' || item.type === 'line' || item.type === 'pie') {
src/views/printTemplate/index.jsx
@@ -2,7 +2,7 @@
import { DndProvider } from 'react-dnd'
import { is, fromJS } from 'immutable'
import HTML5Backend from 'react-dnd-html5-backend'
import { Card, notification, Row, Button, Modal, Input, Icon } from 'antd'
import { Card, notification, Row, Button, Modal, Input, Icon, Switch } from 'antd'
import DragElement from './dragelement'
import MutilForm from './mutilform'
import SourceElement from './dragelement/source'
@@ -44,7 +44,8 @@
    upPlus: 1,
    upMinus: 1,
    leftPlus: 1,
    leftMinus: 1
    leftMinus: 1,
    debug: false
  }
  getclickpoint = (e) => {
@@ -335,19 +336,19 @@
  }
  resetbox = () => {
    const { config } = this.state
    const { config, debug } = this.state
    let ratio = (config.height || 1) / (config.width || 1)
    document.getElementById('darea').style.height = parseInt(document.getElementById('darea').style.width) * ratio + 'px'
    printCtrl.sketch(config, null)
    printCtrl.sketch(config, null, debug)
  }
  resetview () {
    const { config, editItemId } = this.state
    const { config, editItemId, debug } = this.state
    printCtrl.sketch(config, editItemId)
    printCtrl.sketch(config, editItemId, debug)
  }
  /**
@@ -769,7 +770,7 @@
    }
    new Promise(resolve => {
      printCtrl.sketch(config, null).then(res => {
      printCtrl.sketch(config, null, false).then(res => {
        let param = {
          Base64Img: res
        }
@@ -881,6 +882,14 @@
    })
  }
  changeDebug = (val) => {
    this.setState({
      debug: val
    }, () => {
      this.resetview()
    })
  }
  render () {
    return (
      <div className="print-template">
@@ -897,6 +906,9 @@
              <Input addonBefore={<Icon title="距上" type="arrow-up" />} addonAfter={<Icon onClick={() => this.updatePosition('upMinus')} type="minus" />} onChange={(e) => this.change(e, 'upMinus')} value={this.state.upMinus} />
              <Input addonBefore={<Icon title="距左" type="arrow-left" />} addonAfter={<Icon onClick={() => this.updatePosition('leftPlus')} type="plus" />} onChange={(e) => this.change(e, 'leftPlus')} value={this.state.leftPlus} />
              <Input addonBefore={<Icon title="距左" type="arrow-left" />} addonAfter={<Icon onClick={() => this.updatePosition('leftMinus')} type="minus" />} onChange={(e) => this.change(e, 'leftMinus')} value={this.state.leftMinus} />
              <div style={{marginTop: '10px'}}>
                <span>调试模式:</span><Switch onChange={this.changeDebug} />
              </div>
            </Card>
          </aside>
          <div className="switchbox" onClick={this.switchbox}></div>
src/views/printTemplate/print.js
@@ -4,7 +4,7 @@
   * @param  {Object}    configs      配置信息
   * @param  {Boolean}   selectId     编辑元素
   */
  static sketch (configs, selectId) {
  static sketch (configs, selectId, debug = false) {
    if (!configs.height || !configs.width) return
    if (configs.height / configs.width > 10 || configs.width / configs.height > 10) return
@@ -43,7 +43,7 @@
      })
      return new Promise(resolve => {
        this.sketchothers(context, elements, selectId, ratio, resolve)
        this.sketchothers(context, elements, selectId, debug, ratio, resolve)
      })
    } else {
      return new Promise(resolve => {
@@ -57,7 +57,7 @@
   * @param  {Object}    context    画布对象
   * @param  {Object}    elements   图片文字信息
   */
  static sketchothers (context, elements, selectId, ratio, resolve) {
  static sketchothers (context, elements, selectId, debug, ratio, resolve) {
    let element = elements.splice(0, 1)[0] // 逐个绘制图片文字
    let textLineSpace = 5 // 绘制时行间距,防止文字重叠
    context.save()
@@ -70,7 +70,7 @@
      context.translate(-_cx, -_cy) // 恢复原点
    }
    if (selectId === element.uuid) { // 选中元素,设置外部阴影
    if (debug || selectId === element.uuid) { // 选中元素,设置外部阴影
      context.shadowBlur = 5
      context.shadowColor = '#1890ff'
      context.fillStyle = 'white'
@@ -104,7 +104,7 @@
      context.fillRect(element.left, element.top, element.width, element.height)
    }
    if (selectId === element.uuid && element.width > 3 * ratio && element.height > 3 * ratio) { // 选中元素,设置外部阴影
    if ((debug || selectId === element.uuid) && element.width > 3 * ratio && element.height > 3 * ratio) { // 选中元素,设置外部阴影
      context.strokeStyle = '#1890ff'
      context.beginPath()
      context.moveTo(element.left + element.width - 7, element.top + element.height - 2)
@@ -117,7 +117,7 @@
    if (!element.width || !element.height) {
      context.restore() // 重置画布
      if (elements.length > 0) {
        this.sketchothers(context, elements, selectId, ratio, resolve)
        this.sketchothers(context, elements, selectId, debug, ratio, resolve)
      } else {
        this.cachesketch(context, resolve)
      }
@@ -258,7 +258,7 @@
      context.restore() // 重置画布
      if (elements.length > 0) {
        this.sketchothers(context, elements, selectId, ratio, resolve)
        this.sketchothers(context, elements, selectId, debug, ratio, resolve)
      } else {
        this.cachesketch(context, resolve)
      }
@@ -301,7 +301,7 @@
        context.restore() // 重置画布
        if (elements.length > 0) {
          this.sketchothers(context, elements, selectId, ratio, resolve)
          this.sketchothers(context, elements, selectId, debug, ratio, resolve)
        } else {
          this.cachesketch(context, resolve)
        }
@@ -314,7 +314,7 @@
  
          context.restore() // 重置画布
          if (elements.length > 0) {
            this.sketchothers(context, elements, selectId, ratio, resolve)
            this.sketchothers(context, elements, selectId, debug, ratio, resolve)
          } else {
            this.cachesketch(context, resolve)
          }
@@ -343,7 +343,7 @@
        context.restore() // 重置画布
        if (elements.length > 0) {
          this.sketchothers(context, elements, selectId, ratio, resolve)
          this.sketchothers(context, elements, selectId, debug, ratio, resolve)
        } else {
          this.cachesketch(context, resolve)
        }
@@ -353,7 +353,7 @@
  
          context.restore() // 重置画布
          if (elements.length > 0) {
            this.sketchothers(context, elements, selectId, ratio, resolve)
            this.sketchothers(context, elements, selectId, debug, ratio, resolve)
          } else {
            this.cachesketch(context, resolve)
          }
@@ -385,7 +385,7 @@
        
        context.restore() // 重置画布
        if (elements.length > 0) {
          this.sketchothers(context, elements, selectId, ratio, resolve)
          this.sketchothers(context, elements, selectId, debug, ratio, resolve)
        } else {
          this.cachesketch(context, resolve)
        }
@@ -395,7 +395,7 @@
  
          context.restore() // 重置画布
          if (elements.length > 0) {
            this.sketchothers(context, elements, selectId, ratio, resolve)
            this.sketchothers(context, elements, selectId, debug, ratio, resolve)
          } else {
            this.cachesketch(context, resolve)
          }
@@ -404,7 +404,7 @@
      image.onerror = () => {
        context.restore() // 重置画布
        if (elements.length > 0) {
          this.sketchothers(context, elements, selectId, ratio, resolve)
          this.sketchothers(context, elements, selectId, debug, ratio, resolve)
        } else {
          this.cachesketch(context, resolve)
        }