king
2020-11-03 37a134bd23ec4b227a0e010b08a1a89c2bbaaa0d
2020-11-03
45个文件已修改
2个文件已添加
1568 ■■■■ 已修改文件
src/menu/components/search/main-search/dragsearch/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/index.jsx 72 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/tabs/tabcomponents/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/settingform/index.jsx 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/menushell/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/mobshell/card.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/mob/mobshell/index.jsx 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/calendar/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/commontable/index.jsx 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-pie/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/search/main-search/index.jsx 792 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/search/main-search/index.scss 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/tabtransfer/index.jsx 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/tabs/antv-tabs/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/iframe/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/scriptmanage/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtable/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/subtabtable/index.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/verupmanage/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/verupmanage/subtabtable/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/excelInbutton/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/exceloutbutton/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/cardcomponent/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/chartcomponent/index.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/normalTable/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/calendarconfig/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/dragelement/card.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/formtabconfig/dragelement/index.jsx 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/card.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/dragelement/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/modalconfig/index.jsx 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/dragaction/card.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/dragaction/index.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/dragcolumn/card.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/columncomponent/dragcolumn/index.jsx 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/tabscomponent/tabdragelement/card.jsx 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/tabscomponent/tabdragelement/index.jsx 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/treepageconfig/index.jsx 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/editcomponent/index.jsx 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/dragsearch/index.jsx
@@ -67,7 +67,6 @@
    }
    const { index: overIndex } = findCard(id)
    const _cards = update(cards, { $splice: [[overIndex + 1, 0, copycard]] })
    handleList(_cards, copycard)
src/menu/components/search/main-search/index.jsx
@@ -130,15 +130,16 @@
  /**
   * @description 搜索条件顺序调整,或拖拽添加
   */
  handleList = (list, card) => {
    const { config } = this.props
  handleList = (list, newcell) => {
    const { card } = this.state
    let _card = {...card, search: list}
    if (card) {
      this.setState({searchlist: list})
      this.handleSearch(card)
    if (newcell) {
      this.setState({card: _card})
      this.handleSearch(newcell)
    } else {
      this.setState({searchlist: list}, ()=> {
        this.props.updatesearch({...config, search: list})
      this.setState({card: _card}, ()=> {
        this.props.updateConfig(_card)
      })
    }
  }
@@ -170,21 +171,19 @@
   * @description 取消保存,如果元素为新添元素,则从序列中删除
   */
  editModalCancel = () => {
    const { card } = this.state
    const { card, editcard } = this.state
    if (card.focus) {
      let searchlist = fromJS(this.state.searchlist).toJS()
      searchlist = searchlist.filter(item => item.uuid !== card.uuid)
    if (editcard.focus) {
      card.search = card.search.filter(item => item.uuid !== editcard.uuid)
      this.setState({
        card: null,
        searchlist: searchlist,
        card: card,
        editcard: null,
        visible: false
      })
    } else {
      this.setState({
        card: null,
        editcard: null,
        visible: false
      })
    }
@@ -192,22 +191,17 @@
  /**
   * @description 搜索修改后提交保存
   * 1、去除系统默认搜索条件
   * 2、字段及提示文字重复校验
   * 3、更新下拉菜单可选集合
   * 4、下拉菜单数据源语法验证
   * 1、字段及提示文字重复校验
   * 2、下拉菜单数据源语法验证
   */
  handleSubmit = () => {
    const { config } = this.props
    let _searchlist = fromJS(this.state.searchlist).toJS()
    let card = fromJS(this.state.card).toJS()
    this.searchFormRef.handleConfirm().then(res => {
      let fieldrepet = false // 字段重复
      let labelrepet = false // 提示文字重复
      _searchlist = _searchlist.filter(item => !item.origin || item.uuid === res.uuid) // 去除系统项
      _searchlist = _searchlist.map(item => { // 数据更新及重复检测
      card.search = card.search.map(item => { // 数据更新及重复检测
        if (item.uuid !== res.uuid && res.field && item.field) {
          let itemFields = []
          if (item.type === 'text') {
@@ -259,7 +253,7 @@
        return
      }
      if ((res.type === 'select' || res.type === 'multiselect' || res.type === 'link') && res.resourceType === '1' && /\s/.test(res.dataSource)) {
      if (['select', 'multiselect', 'link'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) {
        this.setState({
          sqlVerifing: true
        })
@@ -282,11 +276,11 @@
        Api.getLocalConfig(param).then(result => {
          if (result.status) {
            this.setState({
              card: card,
              sqlVerifing: false,
              searchlist: _searchlist,
              visible: false
            }, ()=> {
              this.props.updatesearch({...config, search: _searchlist})
              this.props.updateConfig(card)
            })
          } else {
            this.setState({sqlVerifing: false})
@@ -298,10 +292,10 @@
        })
      } else {
        this.setState({
          searchlist: _searchlist,
          card: card,
          visible: false
        }, ()=> { 
          this.props.updatesearch({...config, search: _searchlist})
          this.props.updateConfig(card)
        })
      }
    })
@@ -310,22 +304,20 @@
  /**
   * @description 搜索条件删除
   */
  deleteElement = (card) => {
    const { config } = this.props
  deleteElement = (cell) => {
    const { dict } = this.state
    let _this = this
    confirm({
      content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} ?`,
      content: dict['model.confirm'] + dict['model.delete'] + ` - ${cell.label} ?`,
      onOk() {
        let _searchlist = fromJS(_this.state.searchlist).toJS()
        _searchlist = _searchlist.filter(item => item.uuid !== card.uuid)
        let _card = fromJS(_this.state.card).toJS()
        _card.search = _card.search.filter(item => item.uuid !== cell.uuid)
        _this.setState({
          searchlist: _searchlist
          card: _card
        }, () => {
          _this.props.updatesearch({...config, search: _searchlist})
          _this.props.updateConfig(_card)
        })
      },
      onCancel() {}
@@ -346,7 +338,9 @@
    }
    card.search.push(item)
    this.setState({card})
    this.setState({card}, () => {
      this.handleSearch(item)
    })
  }
  render() {
@@ -384,7 +378,7 @@
        >
          <SearchForm
            dict={dict}
            card={this.state.card}
            card={this.state.editcard}
            formlist={this.state.formlist}
            inputSubmit={this.handleSubmit}
            wrappedComponentRef={(inst) => this.searchFormRef = inst}
src/menu/components/tabs/tabcomponents/index.jsx
@@ -88,6 +88,7 @@
        line: '折线图',
        tabs: '标签组',
        pie: '饼图',
        search: '搜索',
        card: '卡片'
      }
      let i = 1
@@ -113,10 +114,11 @@
        isNew: true                                   // 新添加标志,用于初始化
      }
      
      let targetId = '0'
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
src/menu/datasource/verifycard/settingform/index.jsx
@@ -20,7 +20,8 @@
  state = {
    interType: this.props.setting.interType || 'system',
    modules: []
    modules: [],
    useMSearch: this.props.setting.useMSearch || 'false'
  }
  UNSAFE_componentWillMount () {
@@ -173,7 +174,7 @@
  render() {
    const { setting, menu, columns, config } = this.props
    const { getFieldDecorator } = this.props.form
    const { interType, modules } = this.state
    const { interType, modules, useMSearch } = this.state
    const formItemLayout = {
      labelCol: {
@@ -415,21 +416,38 @@
            </Col> : null}
            <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'使用主搜索条件(存在时),主搜索条件与组件的搜索条件会一同用作数据过滤(组件的搜索条件优先)。'}>
                <Tooltip placement="topLeft" title={'优先使用同级的搜索条件组件,同级搜索不存在时,依次向上选取,与当前组件的搜索条件一同用作数据过滤(当前组件的搜索条件优先)。'}>
                  <Icon type="question-circle" />
                  主搜索
                  外层搜索
                </Tooltip>
              }>
                {getFieldDecorator('useMSearch', {
                  initialValue: setting.useMSearch || 'false'
                })(
                  <Radio.Group>
                  <Radio.Group onChange={(e) => this.setState({useMSearch: e.target.value})}>
                    <Radio value="true">使用</Radio>
                    <Radio value="false">不使用</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col>
            {useMSearch === 'true' ? <Col span={8}>
              <Form.Item label={
                <Tooltip placement="topLeft" title={'外层搜索条件改变时,是否刷新当前组件数据。'}>
                  <Icon type="question-circle" />
                  同步刷新
                </Tooltip>
              }>
                {getFieldDecorator('syncRefresh', {
                  initialValue: setting.syncRefresh || 'true'
                })(
                  <Radio.Group>
                    <Radio value="true">是</Radio>
                    <Radio value="false">否</Radio>
                  </Radio.Group>
                )}
              </Form.Item>
            </Col> : null}
            <Col span={8}>
              <Form.Item label="初始化数据">
                {getFieldDecorator('onload', {
src/menu/menushell/index.jsx
@@ -104,10 +104,11 @@
        isNew: true // 新添加标志,用于初始化
      }
      
      let targetId = '0'
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
src/mob/mobshell/card.jsx
@@ -9,7 +9,7 @@
const MobLogin1 = asyncComponent(() => import('@/mob/components/login/mob-login-1'))
const MobLogin2 = asyncComponent(() => import('@/mob/components/login/mob-login-2'))
const Card = ({ id, card, moveCard, findCard, editId, editCard, delCard, hasDrop, doubleClickCard, updateConfig }) => {
const Card = ({ id, card, moveCard, findCard, editId, editCard, delCard, doubleClickCard, updateConfig }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'mob', id, originalIndex },
@@ -21,17 +21,15 @@
    accept: 'mob',
    canDrop: () => true,
    drop: (item) => {
      if (!item.hasOwnProperty('originalIndex')) {
        hasDrop(card)
      }
    },
    hover({ id: draggedId }) {
      if (!draggedId) return
      if (draggedId !== id) {
      const { id: draggedId, originalIndex } = item
      if (originalIndex === undefined) {
        item.dropTargetId = id
      } else if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
    },
    }
  })
  let style = { opacity: 1}
src/mob/mobshell/index.jsx
@@ -9,8 +9,6 @@
import './index.scss'
const Container = ({config, editId, handleList, editCard, deleteCard, doubleClickCard }) => {
  let target = null
  const [cards, setCards] = useState(config.components)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -28,10 +26,6 @@
      card,
      index: cards.indexOf(card),
    }
  }
  const hasDrop = (item) => {
    target = item
  }
  const updateConfig = (element) => {
@@ -55,21 +49,20 @@
        type: item.componentType,
        subtype: item.subtype,
      }
      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
      if (target) {
        targetId = target.uuid
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
      const { index: overIndex } = findCard(`${targetId}`)
      let targetIndex = overIndex
      targetIndex++
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      const { index: overIndex } = findCard(`${targetId}`) // cards为空时 overIndex 为 -1
      const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
      handleList({...config, components: _cards})
      target = null
    }
  })
@@ -85,7 +78,6 @@
          editCard={editCard}
          delCard={deleteCard}
          findCard={findCard}
          hasDrop={hasDrop}
          updateConfig={updateConfig}
          doubleClickCard={doubleClickCard}
        />
src/tabviews/calendar/index.jsx
@@ -324,7 +324,8 @@
      obj_name: 'data',
      arr_field: arr_field,
      custom_script: setting.customScript,
      default_sql: setting.execute || 'true'
      default_sql: setting.execute || 'true',
      menuname: this.props.MenuName || ''
    }
    
    let _dataresource = setting.dataresource
src/tabviews/commontable/index.jsx
@@ -517,6 +517,10 @@
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.MenuName || ''
    }
    let result = await Api.genericInterface(param)
    if (result.status) {
      this.setState({
@@ -555,6 +559,10 @@
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType, this.props.dataManager)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.MenuName || ''
    }
    Api.genericInterface(param).then(res => {
      if (res.status) {
@@ -858,7 +866,7 @@
  }
  render() {
    const { menuType } = this.props
    const { menuType, MenuName } = this.props
    const { BID, setting, searchlist, pageSize, actions, columns, loadingview, viewlost, pickup, config, userConfig, tabActive, chartId, search, selectedData } = this.state
    return (
@@ -893,6 +901,7 @@
                      BID={BID}
                      setting={setting}
                      actions={actions}
                      MenuName={MenuName}
                      dict={this.state.dict}
                      MenuID={this.props.MenuID}
                      selectedData={selectedData}
@@ -906,9 +915,9 @@
                    {this.props.menuType !== 'HS' ? <SettingComponent
                      config={config}
                      columns={columns}
                      MenuName={MenuName}
                      dict={this.state.dict}
                      MenuID={this.props.MenuID}
                      MenuName={this.props.MenuName}
                      permAction={this.props.permAction}
                      permRoles={this.props.permRoles}
                      userConfig={this.state.userConfig}
@@ -924,6 +933,7 @@
                      config={config}
                      setting={setting}
                      columns={columns}
                      MenuName={MenuName}
                      pageSize={pageSize}
                      dict={this.state.dict}
                      data={this.state.data}
@@ -948,6 +958,7 @@
                    BID={BID}
                    plot={item}
                    config={config}
                    MenuName={MenuName}
                    tableId="mainTable"
                    data={this.state.data}
                    MenuID={this.props.MenuID}
@@ -967,6 +978,7 @@
                    BID={BID}
                    plot={item}
                    config={config}
                    MenuName={MenuName}
                    data={this.state.data}
                    getexceloutparam={this.getexceloutparam}
                    loading={this.state.loading}
src/tabviews/custom/components/card/data-card/index.jsx
@@ -5,8 +5,6 @@
import Api from '@/api'
import UtilsDM from '@/utils/utils-datamanage.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import preImg from '@/assets/img/prev.png'
import nextImg from '@/assets/img/next.png'
import MKEmitter from '@/utils/events.js'
@@ -20,13 +18,12 @@
    BID: PropTypes.any,              // 父级Id
    data: PropTypes.array,           // 统一查询数据
    config: PropTypes.object,        // 组件配置信息
    mainSearch: PropTypes.any,       // 全局搜索条件
    mainSearch: PropTypes.any,       // 外层搜索条件
    menuType: PropTypes.any,         // 菜单类型
    dataManager: PropTypes.any,      // 数据权限
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 字典
    config: null,              // 图表配置信息
    pageIndex: 1,
    activeKey: '',             // 选中卡
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -6,8 +6,6 @@
import asyncComponent from '@/utils/asyncComponent'
import Api from '@/api'
import UtilsDM from '@/utils/utils-datamanage.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import MKEmitter from '@/utils/events.js'
import './index.scss'
@@ -18,13 +16,12 @@
    BID: PropTypes.any,              // 父级Id
    data: PropTypes.array,           // 统一查询数据
    config: PropTypes.object,        // 组件配置信息
    mainSearch: PropTypes.any,       // 全局搜索条件
    mainSearch: PropTypes.any,       // 外层搜索条件
    menuType: PropTypes.any,         // 菜单类型
    dataManager: PropTypes.any,      // 数据权限
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 字典
    config: null,              // 图表配置信息
    loading: true,             // 数据加载状态
    activeKey: '',             // 选中数据
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -10,8 +10,6 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import './index.scss'
const ExcelOutButton = asyncComponent(() => import('@/tabviews/zshare/actionList/exceloutbutton'))
@@ -22,13 +20,12 @@
    BID: PropTypes.any,              // 父级Id
    data: PropTypes.array,           // 统一查询数据
    config: PropTypes.object,        // 组件配置信息
    mainSearch: PropTypes.any,       // 全局搜索条件
    mainSearch: PropTypes.any,       // 外层搜索条件
    menuType: PropTypes.any,         // 菜单类型
    dataManager: PropTypes.any,      // 数据权限
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 字典
    config: null,              // 图表配置信息
    empty: true,               // 图表数据为空
    loading: false,            // 数据加载状态
src/tabviews/custom/components/chart/antv-pie/index.jsx
@@ -9,8 +9,6 @@
import Api from '@/api'
import Utils from '@/utils/utils.js'
import UtilsDM from '@/utils/utils-datamanage.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import './index.scss'
class LineChart extends Component {
@@ -18,13 +16,12 @@
    BID: PropTypes.any,              // 父级Id
    data: PropTypes.array,           // 统一查询数据
    config: PropTypes.object,        // 组件配置信息
    mainSearch: PropTypes.any,       // 全局搜索条件
    mainSearch: PropTypes.any,       // 外层搜索条件
    menuType: PropTypes.any,         // 菜单类型
    dataManager: PropTypes.any,      // 数据权限
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, // 字典
    config: null,              // 图表配置信息
    empty: true,               // 图表数据为空
    loading: false,            // 数据加载状态
src/tabviews/custom/components/search/main-search/index.jsx
New file
@@ -0,0 +1,792 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Row, Col, Input, Button, Select, DatePicker, notification } from 'antd'
import moment from 'moment'
import Api from '@/api'
import options from '@/store/options.js'
import DateGroup from '@/tabviews/zshare/dategroup'
import Utils from '@/utils/utils.js'
import zhCN from '@/locales/zh-CN/main.js'
import enUS from '@/locales/en-US/main.js'
import './index.scss'
const { MonthPicker, WeekPicker, RangePicker } = DatePicker
class MainSearch extends Component {
  static propTpyes = {
    BID: PropTypes.any,              // 父级Id
    config: PropTypes.object,        // 组件配置信息
    mainSearch: PropTypes.any,       // 外层搜索条件
    menuType: PropTypes.any,         // 菜单类型
    dataManager: PropTypes.any,      // 数据权限
    refreshdata: PropTypes.func      // 刷新数据
  }
  state = {
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    match: null,            // 搜索条件匹配规则
    style: null,            // 搜索条件类型
    label: null,            // 提示文字
    required: null,         // 是否必填
    searchlist: null,       // 搜索项
    groups: null,           // 组合搜索项
    formId: Utils.getuuid() // 搜索表单Id
  }
  UNSAFE_componentWillMount () {
    let searchlist = fromJS(this.props.config.search).toJS()
    let match = {}
    let label = {}
    let style = {}
    let required = {}
    let _list = []
    let fieldMap = new Map()
    let mainItems = []  // 云端或单点数据
    let localItems = [] // 本地数据
    let deForms = []    // 测试系统,单个请求
    searchlist.forEach(item => {
      if (fieldMap.has(item.field)) {
        item.field = item.field + '@tail@'
      }
      fieldMap.set(item.field, true)
      match[item.field] = item.match
      label[item.field] = item.label
      style[item.field] = item.type
      required[item.field] = item.required === 'true'
      if (['select', 'link', 'multiselect'].includes(item.type)) {
        if (item.setAll === 'true' && item.type !== 'multiselect') {
          item.options.unshift({
            key: Utils.getuuid(),
            Value: '',
            Text: this.state.dict['main.all']
          })
        }
        // 数据源查询语句
        if (item.resourceType === '1' && item.dataSource) {
          let _option = Utils.getSelectQueryOptions(item)
          if (this.props.dataManager) { // 数据权限
            _option.sql = _option.sql.replace(/\$@/ig, '/*')
            _option.sql = _option.sql.replace(/@\$/ig, '*/')
          } else {
            _option.sql = _option.sql.replace(/@\$|\$@/ig, '')
          }
          // 测试系统单个请求
          if (this.props.menuType !== 'HS' && options.sysType === 'local' && !window.GLOB.systemType) {
            deForms.push({
              ...item,
              arr_field: _option.field,
              data_sql: Utils.formatOptions(_option.sql)
            })
          } else { // 合并请求,区分本地及系统
            // 外联数据库替换
            if (window.GLOB.externalDatabase !== null) {
              _option.sql = _option.sql.replace(/@db@/ig, `[${window.GLOB.externalDatabase}]..`)
            }
            if (item.database === 'sso') {
              mainItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql))}' as LText`)
            } else {
              localItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql))}' as LText`)
            }
          }
        }
        item.oriOptions = fromJS(item.options).toJS()
      }
      _list.push(item)
    })
    let _groups = []
    _list = _list.map(item => {
      if (item.type === 'link') {
        let supItem = _list.filter(form => form.field === item.linkField)[0]
        if (!supItem) {
          notification.warning({
            top: 92,
            message: '未查询到搜索条件《' + item.label + '》关联字段!',
            duration: 5
          })
          item.supInitVal = ''
        } else {
          item.supInitVal = supItem.initval
          item.options = item.oriOptions.filter(option => option.ParentID === supItem.initval)
        }
      } else if (item.type === 'group' && item.Hide !== 'true') {
        _groups.push(fromJS(item).toJS())
      }
      return item
    })
    this.setState({
      match: match,
      label: label,
      style: style,
      required: required,
      searchlist: _list,
      groups: _groups
    }, () => {
      if (this.props.menuType !== 'HS' && options.sysType === 'local' && !window.GLOB.systemType) {
        this.improveSimpleSearch(deForms)
      } else {
        this.improveSearch(mainItems, localItems)
      }
    })
  }
  // 查询下拉菜单
  improveSearch = (mainItems, localItems) => {
    const { menuType, BID } = this.props
    let deffers = []
    if (menuType !== 'HS' && window.GLOB.systemType !== 'production') {
      localItems = [...localItems, ...mainItems]
      mainItems = []
    }
    // 本地请求
    let param = {
      func: 'sPC_Get_SelectedList',
      LText: localItems.join(' union all '),
      obj_name: '',
      arr_field: '',
      table_type: 'Y'
    }
    if (BID) {
      param.BID = BID
    }
    if (param.LText) {
      param.LText = Utils.formatOptions(param.LText)
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      if (menuType === 'HS') { // 云端数据验证
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
      }
      deffers.push(
        new Promise(resolve => {
          Api.getSystemCacheConfig(param).then(res => {
            if (!res.status) {
              notification.warning({
                top: 92,
                message: res.message,
                duration: 5
              })
            }
            resolve(res)
          })
        })
      )
    }
    // 系统请求
    let mainparam = {
      func: 'sPC_Get_SelectedList',
      LText: mainItems.join(' union all '),
      obj_name: '',
      arr_field: '',
      table_type: 'Y'
    }
    if (BID) {
      mainparam.BID = BID
    }
    if (mainparam.LText) {
      mainparam.LText = Utils.formatOptions(mainparam.LText)
      mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp)
      if (menuType === 'HS') { // 云端数据验证
        mainparam.open_key = Utils.encryptOpenKey(mainparam.secretkey, mainparam.timestamp)
        if (options.cloudServiceApi) {
          mainparam.rduri = options.cloudServiceApi
          mainparam.userid = sessionStorage.getItem('CloudUserID') || ''
          mainparam.LoginUID = sessionStorage.getItem('CloudLoginUID') || ''
        }
      } else if (window.GLOB.mainSystemApi) {
        mainparam.rduri = window.GLOB.mainSystemApi
      }
      deffers.push(
        new Promise(resolve => {
          Api.getSystemCacheConfig(mainparam).then(res => {
            if (!res.status) {
              notification.warning({
                top: 92,
                message: res.message,
                duration: 5
              })
            }
            resolve(res)
          })
        })
      )
    }
    Promise.all(deffers).then(response => {
      let result = {...response[0], ...(response[1] || {})}
      delete result.ErrCode
      delete result.ErrMesg
      delete result.message
      delete result.status
      let _searchlist = this.state.searchlist.map(item => {
        if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
          let options = result[item.field].map(cell => {
            let _item = {
              key: Utils.getuuid(),
              Value: cell[item.valueField],
              Text: cell[item.valueText]
            }
            if (item.type === 'link') {
              _item.ParentID = cell[item.linkField]
            }
            return _item
          })
          item.oriOptions = [...item.oriOptions, ...options]
        }
        return item
      })
      this.setState({
        searchlist: _searchlist.map(item => {
          if (item.type === 'link') {
            if (item.supInitVal) {
              item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal)
            } else {
              item.options = item.oriOptions
            }
          } else if (item.type === 'select' || item.type === 'multiselect') {
            item.options = item.oriOptions
          }
          return item
        })
      })
    })
  }
  // 测试系统单个请求下拉选项
  improveSimpleSearch = (deForms) => {
    if (deForms.length === 0) return
    let deffers = deForms.map(item => {
      let param = {
        func: 'sPC_Get_SelectedList',
        LText: item.data_sql,
        obj_name: item.field,
        arr_field: item.arr_field
      }
      if (this.props.BID) {
        param.BID = this.props.BID
      }
      param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
      param.secretkey = Utils.encrypt(param.LText, param.timestamp)
      return (
        new Promise(resolve => {
          Api.getSystemCacheConfig(param).then(res => {
            if (!res.status) {
              notification.warning({
                top: 92,
                message: res.message,
                duration: 5
              })
            }
            resolve(res)
          })
        })
      )
    })
    Promise.all(deffers).then(response => {
      let result = {}
      response.forEach(res => {
        result = {...result, ...res}
      })
      delete result.ErrCode
      delete result.ErrMesg
      delete result.message
      delete result.status
      let _searchlist = this.state.searchlist.map(item => {
        if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
          let options = result[item.field].map(cell => {
            let _item = {
              key: Utils.getuuid(),
              Value: cell[item.valueField],
              Text: cell[item.valueText]
            }
            if (item.type === 'link') {
              _item.ParentID = cell[item.linkField]
            }
            return _item
          })
          item.oriOptions = [...item.oriOptions, ...options]
        }
        return item
      })
      this.setState({
        searchlist: _searchlist.map(item => {
          if (item.type === 'link') {
            if (item.supInitVal) {
              item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal)
            } else {
              item.options = item.oriOptions
            }
          } else if (item.type === 'select' || item.type === 'multiselect') {
            item.options = item.oriOptions
          }
          return item
        })
      })
    })
  }
  resetform = (formlist, supfields, index, fieldsvalue) => {
    index++
    let subfields = []
    supfields.forEach(supfield => {
      formlist = formlist.map(item => {
        if (item.type === 'link' && item.linkField === supfield.field) {
          item.options = item.oriOptions.filter(option => option.ParentID === supfield.initval)
          item.initval = item.options[0] ? item.options[0].Value : ''
          if (this.props.form.getFieldValue(item.field) !== undefined) {
            fieldsvalue[item.field] = item.initval
          }
          subfields.push(item)
        }
        return item
      })
    })
    if (subfields.length === 0 || index > 6) {
      return formlist
    } else {
      return this.resetform(formlist, subfields, index, fieldsvalue)
    }
  }
  selectChange = (_field, value) => {
    let formlist = fromJS(this.state.searchlist).toJS()
    let subfields = []
    let fieldsvalue = {}
    formlist = formlist.map(item => {
      if (item.type === 'link' && item.linkField === _field.field) {
        item.options = item.oriOptions.filter(option => option.ParentID === value)
        item.initval = item.options[0] ? item.options[0].Value : ''
        if (this.props.form.getFieldValue(item.field) !== undefined) {
          fieldsvalue[item.field] = item.initval
        }
        subfields.push(item)
      }
      return item
    })
    if (subfields.length === 0) {
      this.searchChange()
      return
    }
    formlist = this.resetform(formlist, subfields, 0, fieldsvalue)
    if (Object.keys(fieldsvalue).length > 0) {
      this.props.form.setFieldsValue(fieldsvalue)
    }
    this.setState({
      searchlist: formlist
    }, () => {
      this.searchChange()
    })
  }
  getFields() {
    const { getFieldDecorator } = this.props.form
    const fields = []
    this.state.searchlist.forEach((item, index) => {
      if (item.Hide === 'true') return
      if (item.type === 'text') { // 文本搜索
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.state.dict['form.required.input'] + item.label + '!'
                  }
                ]
              })(<Input placeholder="" autoComplete="off" />)}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'select') { // 下拉搜索
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.state.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <Select
                  showSearch
                  onChange={(value) => {this.selectChange(item, value)}}
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  getPopupContainer={() => document.getElementById(this.state.formId)}
                >
                  {item.options.map((option, i) =>
                    <Select.Option id={`${i}`} title={option.Text} key={`${i}`} value={option.Value}>{option.Text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'multiselect') { // 下拉多选
        let _initval = item.initval ? item.initval.split(',').filter(Boolean) : []
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: _initval,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.state.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <Select
                  showSearch
                  mode="multiple"
                  onChange={this.searchChange}
                  filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  getPopupContainer={() => document.getElementById(this.state.formId)}
                >
                  {item.options.map((option, i) =>
                    <Select.Option id={`${i}`} title={option.Text} key={`${i}`} value={option.Value}>{option.Text}</Select.Option>
                  )}
                </Select>
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'date') { // 时间搜索
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval ? moment().subtract(item.initval, 'days') : null,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.state.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <DatePicker onChange={this.searchChange} getCalendarContainer={() => document.getElementById(this.state.formId)} />
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'datemonth') {
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval ? moment().subtract(item.initval, 'month') : null,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.state.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <MonthPicker onChange={this.searchChange} getCalendarContainer={() => document.getElementById(this.state.formId)} />
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'dateweek') {
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field, {
                initialValue: item.initval ? moment().subtract(item.initval * 7, 'days') : null,
                rules: [
                  {
                    required: item.required === 'true',
                    message: this.state.dict['form.required.select'] + item.label + '!'
                  }
                ]
              })(
                <WeekPicker onChange={this.searchChange} getCalendarContainer={() => document.getElementById(this.state.formId)} />
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'daterange') {
        let _defaultValue = [null, null]
        if (item.initval) {
          try {
            let _initval = JSON.parse(item.initval)
            _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')]
          } catch {
            _defaultValue = [null, null]
          }
        }
        fields.push(
          <Col className="daterange" span={item.ratio || 6} key={index}>
            <Form.Item label={item.label}>
              {getFieldDecorator(item.field,
                {
                  initialValue: _defaultValue,
                  rules: [
                    {
                      required: item.required === 'true',
                      message: this.state.dict['form.required.select'] + item.label + '!'
                    }
                  ]
                })(
                <RangePicker
                  placeholder={['开始日期', '结束日期']}
                  renderExtraFooter={() => 'extra footer'}
                  onChange={this.searchChange}
                  getCalendarContainer={() => document.getElementById(this.state.formId)}
                />
              )}
            </Form.Item>
          </Col>
        )
      } else if (item.type === 'group') {
        fields.push(
          <Col span={item.ratio || 6} key={index}>
            <Form.Item label={item.label} className={item.required === 'true' ? 'group-required' : ''}>
              <DateGroup ref={item.uuid} position={index} card={item} onGroupChange={this.searchChange} />
            </Form.Item>
          </Col>
        )
      }
    })
    fields.push(
      <Col span={6} style={{ whiteSpace: 'nowrap' }} key="actions">
        <Form.Item label={' '} colon={false} style={{ minHeight: '40px' }}>
          <Button type="primary" htmlType="submit">
            {this.state.dict['main.search']}
          </Button>
          <Button style={{ marginLeft: 8 }} onClick={this.handleReset}>
            {this.state.dict['main.reset']}
          </Button>
        </Form.Item>
      </Col>
    )
    return fields
  }
  addHideFieldValue = (values) => {
    const { searchlist } = this.state
    let hideValue = {}
    searchlist.forEach(item => {
      if (item.Hide === 'true') {
        let value = ''
        if (item.type === 'multiselect') { // 下拉多选
          value = item.initval ? item.initval.split(',').filter(Boolean) : []
        } else if (item.type === 'date') { // 时间搜索
          value = item.initval ? moment().subtract(item.initval, 'days') : ''
        } else if (item.type === 'datemonth') {
          value = item.initval ? moment().subtract(item.initval, 'month') : ''
        } else if (item.type === 'dateweek') {
          value = item.initval ? moment().subtract(item.initval * 7, 'days') : ''
        } else if (item.type === 'daterange') {
          if (item.initval) {
            try {
              let _initval = JSON.parse(item.initval)
              value = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')]
            } catch {
              value = ''
            }
          }
        } else if (item.type !== 'group') {
          value = item.initval
        }
        hideValue[item.field] = value
      }
    })
    return {...hideValue, ...values}
  }
  handleSearch = (e) => {
    // 回车或点击搜索
    e.preventDefault()
    this.props.form.validateFields((err, values) => {
      if (!err) {
        values = this.addHideFieldValue(values)
        let searches = this.getFieldsValues(values)
        this.props.refreshdata(searches)
      }
    })
  }
  searchChange = () => {
    this.setState({}, () => {
      this.props.form.validateFields((err, values) => {
        if (!err) {
          values = this.addHideFieldValue(values)
          let searches = this.getFieldsValues(values)
          this.props.refreshdata(searches)
        }
      })
    })
  }
  /**
   * @description 搜索条件重置
   */
  handleReset = () => {
    const { groups } = this.state
    if (groups.length > 0) {
      groups.forEach(item => {
        this.refs[item.uuid].reset()
      })
    }
    let searchlist = this.state.searchlist.map(item => {
      item.initval = item.oriInitval
      return item
    })
    this.setState({searchlist}, () => {
      this.props.form.resetFields()
      this.props.form.validateFields((err, values) => {
        if (!err) {
          // 异步获取更新后的时间组
          this.setState({}, () => {
            values = this.addHideFieldValue(values)
            let searches = this.getFieldsValues(values)
            this.props.refreshdata(searches)
          })
        }
      })
    })
  }
  getFieldsValues = (values) => {
    const { groups } = this.state
    // 获取搜索条件值
    let search = []
    Object.keys(values).forEach(key => {
      let _value = ''
      if (this.state.style[key] === 'daterange') {
        if (values[key].length > 0 && values[key][0] && values[key][1]) {
          _value = [moment(values[key][0]).format('YYYY-MM-DD'), moment(values[key][1]).format('YYYY-MM-DD')]
        }
      } else if (this.state.style[key] === 'dateweek') {
        if (values[key]) {
          _value = [moment(values[key]).startOf('week').format('YYYY-MM-DD'), moment(values[key]).endOf('week').format('YYYY-MM-DD')]
        }
      } else if (this.state.style[key] === 'date') {
        if (values[key]) {
          _value = moment(values[key]).format('YYYY-MM-DD')
        }
      } else if (this.state.style[key] === 'datemonth') {
        if (values[key]) {
          _value = moment(values[key]).format('YYYY-MM')
        }
      } else if (this.state.style[key] === 'multiselect') {
        _value = values[key] || []
      } else {
        _value = (values[key] || values[key] === 0) ? values[key] : ''
        _value = _value.replace(/(^\s*|\s*$)/ig, '')
      }
      search.push({
        type: this.state.style[key],
        key: key.replace(/@tail@$/, ''),
        value: _value,
        label: this.state.label[key],
        match: this.state.match[key],
        required: this.state.required[key]
      })
    })
    if (groups.length > 0) {
      groups.forEach(item => {
        let items = this.refs[item.uuid].getSearchItems()
        search.push(...items)
      })
    }
    return search
  }
  render() {
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 8 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
    return (
      <Form {...formItemLayout} className="custom-main-search" id={this.state.formId} onSubmit={this.handleSearch}>
        <Row gutter={24}>{this.getFields()}</Row>
      </Form>
    )
  }
}
export default Form.create()(MainSearch)
src/tabviews/custom/components/search/main-search/index.scss
New file
@@ -0,0 +1,38 @@
.custom-main-search {
  .ant-form-item {
    display: flex;
    margin-bottom: 0px;
    min-height: 60px;
    .ant-form-explain {
      white-space: nowrap;
    }
  }
  .ant-form-item-control-wrapper {
    flex: 1;
    width: calc(100% - 100px);
  }
  .ant-form-item-label {
    text-overflow: ellipsis;
  }
  .daterange .ant-calendar-picker-input {
    padding: 4px 20px 4px 5px;
    font-size: 13px;
  }
  .ant-select-dropdown {
    z-index: 10 !important;
  }
  .ant-calendar-picker-container {
    z-index: 10 !important;
  }
  .group-required {
    label::before {
      display: inline-block;
      margin-right: 4px;
      color: #f5222d;
      font-size: 14px;
      font-family: SimSun, sans-serif;
      line-height: 1;
      content: '*';
    }
  }
}
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -1,17 +1,20 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
// import { fromJS } from 'immutable'
import { connect } from 'react-redux'
import { is, fromJS } from 'immutable'
import { Row, Col, Empty } from 'antd'
import asyncSpinComponent from '@/utils/asyncSpinComponent'
import Utils from '@/utils/utils.js'
import './index.scss'
// 通用组件
const AntvBarAndLine = asyncSpinComponent(() => import('@/tabviews/custom/components/chart/antv-bar-line'))
const MainSearch = asyncSpinComponent(() => import('@/tabviews/custom/components/search/main-search'))
const AntvPie = asyncSpinComponent(() => import('@/tabviews/custom/components/chart/antv-pie'))
const AntvTabs = asyncSpinComponent(() => import('@/tabviews/custom/components/tabs/antv-tabs'))
class MainSearch extends Component {
class TabTransfer extends Component {
  static propTpyes = {
    BID: PropTypes.any,              // 父级Id
    config: PropTypes.object,        // 组件配置信息
@@ -20,14 +23,57 @@
    dataManager: PropTypes.any,      // 数据权限
  }
  state = {}
  state = {
    mainSearch: [],
    self: false
  }
  UNSAFE_componentWillMount () {
    const { config, mainSearch } = this.props
    // 获取主搜索条件
    let _mainSearch = []
    let self = false
    config.components.forEach(component => {
      if (component.type === 'search') {
        self = true
        component.search = component.search.map(item => {
          item.oriInitval = item.initval
          if (!item.blacklist || item.blacklist.length === 0) return item
          let _black = item.blacklist.filter(v => {
            return this.props.permRoles.indexOf(v) !== -1
          })
          if (_black.length > 0) {
            item.Hide = 'true'
          }
          return item
        })
        _mainSearch = Utils.initMainSearch(component.search)
      }
    })
    this.setState({mainSearch: self ? _mainSearch : fromJS(mainSearch).toJS(), self})
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    const { self } = this.state
    if (!self && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) {
      this.setState({mainSearch: fromJS(nextProps.mainSearch).toJS()})
    }
  }
  resetSearch = (search) => {
    this.setState({mainSearch: search})
  }
  getComponents = () => {
    const { menuType, dataManager, BID, mainSearch, config } = this.props
    const { menuType, dataManager, BID, config } = this.props
    const { mainSearch } = this.state
    if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />)
@@ -42,6 +88,12 @@
        return (
          <Col span={item.width} key={item.uuid}>
            <AntvPie config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} />
          </Col>
        )
      } else if (item.type === 'search') {
        return (
          <Col span={item.width} key={item.uuid}>
            <MainSearch config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} refreshdata={this.resetSearch} />
          </Col>
        )
      } else if (item.type === 'tabs') {
@@ -63,4 +115,17 @@
  }
}
export default MainSearch
const mapStateToProps = (state) => {
  return {
    menuType: state.editLevel,
    permAction: state.permAction,
    permRoles: state.permRoles,
    dataManager: state.dataManager
  }
}
const mapDispatchToProps = () => {
  return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(TabTransfer)
src/tabviews/custom/components/tabs/antv-tabs/index.jsx
@@ -5,8 +5,6 @@
import asyncComponent from '@/utils/asyncComponent'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import './index.scss'
const TabTransfer = asyncComponent(() => import('../../share/tabtransfer'))
@@ -17,13 +15,12 @@
  static propTpyes = {
    BID: PropTypes.any,              // 父级Id
    config: PropTypes.object,        // 组件配置信息
    mainSearch: PropTypes.any,       // 全局搜索条件
    mainSearch: PropTypes.any,       // 外层搜索条件
    menuType: PropTypes.any,         // 菜单类型
    dataManager: PropTypes.any,      // 数据权限
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    tabs: null
  }
@@ -50,7 +47,7 @@
  }
  render() {
    const { BID, mainSearch, menuType, dataManager } = this.props
    const { BID, mainSearch } = this.props
    const { tabs } = this.state
    return (
@@ -58,7 +55,7 @@
        <Tabs defaultActiveKey="1" tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}>
          {tabs.subtabs.map(tab => (
            <TabPane tab={<span>{tab.icon ? <Icon type={tab.icon} /> : null}{tab.label}</span>} key={tab.uuid}>
              <TabTransfer config={tab} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager}/>
              <TabTransfer config={tab} BID={BID} mainSearch={mainSearch}/>
            </TabPane>
          ))}
        </Tabs>
src/tabviews/custom/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import { connect } from 'react-redux'
import { is, fromJS } from 'immutable'
import { notification, Spin, Row, Col, Button, message } from 'antd'
import moment from 'moment'
@@ -22,6 +22,7 @@
const AntvTabs = asyncSpinComponent(() => import('./components/tabs/antv-tabs'))
const DataCard = asyncSpinComponent(() => import('./components/card/data-card'))
const PropCard = asyncSpinComponent(() => import('./components/card/prop-card'))
const MainSearch = asyncSpinComponent(() => import('./components/search/main-search'))
class CustomPage extends Component {
  static propTpyes = {
@@ -365,27 +366,6 @@
    })
  }
  /**
   * @description 搜索条件改变时,重置表格数据
   * 含有初始不加载的页面,修改设置
   */
  refreshbysearch = (searches) => {
    this.setState({
      mainSearch: searches
    })
  }
  /**
   * @description 页面刷新,重新获取配置
   */
  reloadview = () => {
    this.setState({ loadingview: true, viewlost: false, lostmsg: '', data: null, loading: false, search: ''
    }, () => {
      this.loadconfig()
    })
  }
  handleviewconfig = (e) => {
    e.stopPropagation()
@@ -413,12 +393,7 @@
  }
  UNSAFE_componentWillReceiveProps(nextProps) {
    if (nextProps.refreshTab && nextProps.refreshTab.MenuID === this.props.MenuID) {
      if (nextProps.refreshTab.position === 'view') {
        this.reloadview()
      }
      this.props.refreshTabView('')
    }
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -432,6 +407,10 @@
    this.setState = () => {
      return
    }
  }
  resetSearch = (search) => {
    this.setState({mainSearch: search})
  }
  getComponents = () => {
@@ -453,10 +432,16 @@
            <AntvPie config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} />
          </Col>
        )
      } else if (item.type === 'search') {
        return (
          <Col span={item.width} key={item.uuid}>
            <MainSearch config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} refreshdata={this.resetSearch} />
          </Col>
        )
      } else if (item.type === 'tabs') {
        return (
          <Col span={item.width} key={item.uuid}>
            <AntvTabs config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} />
            <AntvTabs config={item} BID={BID} mainSearch={mainSearch} />
          </Col>
        )
      } else if (item.type === 'card') {
src/tabviews/iframe/index.jsx
@@ -9,10 +9,7 @@
  render () {
    return (
      <iframe
        title={this.props.title}
        src={this.props.url}
      />
      <iframe title={this.props.title} src={this.props.url} />
    )
  }
}
src/tabviews/scriptmanage/index.jsx
@@ -166,7 +166,8 @@
    let param = {
      func: 'sPC_Get_TableData',
      obj_name: 'data',
      arr_field: arr_field
      arr_field: arr_field,
      menuname: this.props.MenuName || ''
    }
    
    let _orderBy = orderBy || setting.order
src/tabviews/subtable/index.jsx
@@ -435,6 +435,10 @@
    this.handleTableId()
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.Tab.label || ''
    }
    let result = await Api.genericInterface(param)
    if (result.status) {
      this.setState({
@@ -493,6 +497,10 @@
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, _BID, this.props.menuType, this.props.dataManager)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.Tab.label || ''
    }
    Api.genericInterface(param).then(res => {
      if (res.status) {
        let _data = res.data[0]
@@ -719,6 +727,7 @@
                      BData={this.props.BData}
                      MenuID={this.props.MenuID}
                      selectedData={selectedData}
                      MenuName={this.props.Tab.label}
                      logcolumns={this.state.logcolumns}
                      refreshdata={this.refreshbyaction}
                      ContainerId={this.props.ContainerId}
@@ -743,6 +752,7 @@
                      total={this.state.total}
                      MenuID={this.props.MenuID}
                      loading={this.state.loading}
                      MenuName={this.props.Tab.label}
                      refreshdata={this.refreshbytable}
                      logcolumns={this.state.logcolumns}
                      statFValue={this.state.statFValue}
@@ -767,6 +777,7 @@
                    MenuID={this.props.MenuID}
                    loading={this.state.loading}
                    tableId={this.props.Tab.uuid}
                    MenuName={this.props.Tab.label}
                    logcolumns={this.state.logcolumns}
                    refreshdata={this.refreshbyaction}
                    handleTableId={this.handleTableId}
@@ -783,6 +794,7 @@
                    BID={this.props.BID}
                    Tab={this.props.Tab}
                    data={this.state.data}
                    MenuName={this.props.Tab.label}
                    getexceloutparam={this.getexceloutparam}
                    loading={this.state.loading}
                  />
src/tabviews/subtabtable/index.jsx
@@ -349,6 +349,10 @@
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType, this.props.dataManager)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.Tab.label || ''
    }
    let result = await Api.genericInterface(param)
    if (result.status) {
      this.setState({
@@ -393,6 +397,10 @@
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getStatQueryDataParams(setting, statFields, searches, _orderBy, BID, this.props.menuType, this.props.dataManager)
    if (param.func === 'sPC_Get_TableData') {
      param.menuname = this.props.Tab.label || ''
    }
    Api.genericInterface(param).then(res => {
      if (res.status) {
        let _data = res.data[0]
@@ -592,6 +600,7 @@
                      BData={this.props.BData}
                      selectedData={selectedData}
                      MenuID={this.props.SupMenuID}
                      MenuName={this.props.Tab.label}
                      logcolumns={this.state.logcolumns}
                      refreshdata={this.refreshbyaction}
                      getexceloutparam={this.getexceloutparam}
@@ -610,6 +619,7 @@
                    total={this.state.total}
                    MenuID={this.props.MenuID}
                    loading={this.state.loading}
                    MenuName={this.props.Tab.label}
                    refreshdata={this.refreshbytable}
                    logcolumns={this.state.logcolumns}
                    statFValue={this.state.statFValue}
@@ -627,9 +637,10 @@
                    plot={item}
                    config={config}
                    BID={this.props.BID}
                    BData={this.props.BData}
                    data={this.state.data}
                    BData={this.props.BData}
                    loading={this.state.loading}
                    MenuName={this.props.Tab.label}
                    logcolumns={this.state.logcolumns}
                    refreshdata={this.refreshbyaction}
                    handleTableId={() => {}}
@@ -644,6 +655,7 @@
                    config={config}
                    data={this.state.data}
                    loading={this.state.loading}
                    MenuName={this.props.Tab.label}
                  />
                </Col>
              )
src/tabviews/verupmanage/index.jsx
@@ -224,7 +224,8 @@
    let param = {
      func: 'sPC_Get_TableData',
      obj_name: 'data',
      arr_field: arr_field
      arr_field: arr_field,
      menuname: this.props.MenuName || ''
    }
    
    let _orderBy = orderBy || setting.order
src/tabviews/verupmanage/subtabtable/index.jsx
@@ -248,7 +248,8 @@
      func: 'sPC_Get_TableData',
      obj_name: 'data',
      arr_field: arr_field,
      BID: BID
      BID: BID,
      menuname: this.props.Tab.label || ''
    }
    let _orderBy = orderBy || setting.order
src/tabviews/zshare/actionList/excelInbutton/index.jsx
@@ -18,6 +18,7 @@
  static propTpyes = {
    show: PropTypes.any,              // 显示样式
    BID: PropTypes.string,            // 主表ID
    MenuName: PropTypes.any,          // 菜单名称
    selectedData: PropTypes.any,      // 子表中选择数据
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    btn: PropTypes.object,            // 按钮
@@ -188,7 +189,7 @@
   * @description Excel 导入
   */
  getexceldata = (data, errors, sheetName) => {
    const { btn } = this.props
    const { btn, MenuName } = this.props
    if (errors) {
      if (errors === 'notexit') {
@@ -275,6 +276,8 @@
        param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
      }
      param.menuname = `${MenuName ? MenuName + '-' : ''}${btn.label}`
      Api.genericInterface(param).then((res) => {
        if (res.status) {
          this.execSuccess(res)
src/tabviews/zshare/actionList/exceloutbutton/index.jsx
@@ -18,6 +18,7 @@
  static propTpyes = {
    BID: PropTypes.string,            // 主表ID
    show: PropTypes.any,              // 显示样式
    MenuName: PropTypes.any,          // 菜单名称
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    btn: PropTypes.object,            // 按钮
    setting: PropTypes.any,           // 页面通用设置
@@ -440,7 +441,7 @@
   * @description 执行自定义脚本
   */
  execCustomScript = () => {
    const { btn } = this.props
    const { btn, MenuName } = this.props
    const { search } = this.state
    let script = btn.verify.script
@@ -464,7 +465,8 @@
    })
    let param = {
      func: 'sPC_TableData_InUpDe'
      func: 'sPC_TableData_InUpDe',
      menuname: `${MenuName ? MenuName + '-' : ''}${btn.label}`
    }
    if (this.props.BID) {
@@ -527,7 +529,7 @@
   * @description 获取默认存储过程请求参数
   */
  getExcelDefaultParam = (arr_field, orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => {
    const { setting } = this.props
    const { setting, MenuName, btn } = this.props
    let _search = Utils.joinMainSearchkey(search)
@@ -538,7 +540,8 @@
      obj_name: 'data',
      arr_field: arr_field,
      custom_script: setting.customScript,
      default_sql: setting.default || 'true'
      default_sql: setting.default || 'true',
      menuname: `${MenuName ? MenuName + '-' : ''}${btn.label}`
    }
    // 数据管理权限
src/tabviews/zshare/actionList/index.jsx
@@ -21,6 +21,7 @@
  static propTpyes = {
    BID: PropTypes.any,               // 主表ID
    BData: PropTypes.any,             // 主表数据
    MenuName: PropTypes.any,          // 菜单名称
    selectedData: PropTypes.any,      // 子表中选择数据
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    MenuID: PropTypes.string,         // 菜单ID
@@ -49,7 +50,7 @@
  }
  getButtonList = (actions) => {
    const { BID, BData, MenuID, Tab, logcolumns, setting, ContainerId, selectedData, getexceloutparam } = this.props
    const { BID, BData, MenuID, Tab, logcolumns, setting, ContainerId, selectedData, getexceloutparam, MenuName } = this.props
    return actions.map(item => {
      if (['exec', 'prompt', 'pop'].includes(item.OpenType)) {
@@ -62,6 +63,7 @@
            btn={item}
            BData={BData}
            setting={setting}
            MenuName={MenuName}
            columns={logcolumns}
            ContainerId={ContainerId}
            selectedData={selectedData}
@@ -77,6 +79,7 @@
            Tab={Tab}
            btn={item}
            setting={setting}
            MenuName={MenuName}
            selectedData={selectedData}
            updateStatus={this.updateStatus}
          />
@@ -90,6 +93,7 @@
            Tab={Tab}
            btn={item}
            setting={setting}
            MenuName={MenuName}
            getexceloutparam={getexceloutparam}
            updateStatus={this.updateStatus}
          />
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -22,6 +22,7 @@
    show: PropTypes.any,              // 按钮显示样式控制
    BID: PropTypes.string,            // 主表ID
    BData: PropTypes.any,             // 主表数据
    MenuName: PropTypes.any,          // 菜单名称
    style: PropTypes.any,             // 按钮样式
    selectedData: PropTypes.any,      // 子表中选择数据
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
@@ -190,7 +191,7 @@
   * @description 按钮提交执行
   */
  execSubmit = (data, _resolve, formdata) => {
    const { setting, columns, btn } = this.props
    const { setting, columns, btn, MenuName } = this.props
    if (btn.intertype === 'inner' || btn.intertype === 'system') {
      // 执行方式为多行拼接,且打开方式为表单时,会转为循环发送请求
      // 打开方式为模态框,使用内部函数添加(有批量添加场景,已去除)
@@ -309,6 +310,10 @@
          param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
          param.secretkey = Utils.encrypt(param.LTextOut, param.timestamp)
          param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
        }
        if (param.func === 'sPC_TableData_InUpDe') {
          param.menuname = `${MenuName ? MenuName + '-' : ''}${btn.label}`
        }
        Api.genericInterface(param).then((res) => {
@@ -437,6 +442,10 @@
            param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp)
          }
          if (param.func === 'sPC_TableData_InUpDe') {
            param.menuname = `${MenuName ? MenuName + '-' : ''}${btn.label}`
          }
          return param
        })
src/tabviews/zshare/cardcomponent/index.jsx
@@ -22,6 +22,7 @@
    type: PropTypes.any,              // 卡片类型,添加按钮为 insert
    BID: PropTypes.any,               // 主表ID
    BData: PropTypes.any,             // 主表数据
    MenuName: PropTypes.any,          // 菜单名称
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    MenuID: PropTypes.string,         // 菜单ID
    setting: PropTypes.object,        // 页面设定
@@ -129,7 +130,7 @@
   * @description 获取按钮元素
   */
  getActionList = (actions, show) => {
    const { BID, BData, Tab, setting, logcolumns, ContainerId, data, MenuID } = this.props
    const { BID, BData, Tab, setting, logcolumns, ContainerId, data, MenuID, MenuName } = this.props
    
    return actions.map(item => {
      if (['exec', 'prompt', 'pop'].includes(item.OpenType)) {
@@ -142,6 +143,7 @@
            show={show}
            BData={BData}
            setting={setting}
            MenuName={MenuName}
            columns={logcolumns}
            selectedData={[data]}
            ContainerId={ContainerId}
@@ -505,6 +507,7 @@
              show={'plus' + plusSize}
              BData={this.props.BData}
              setting={this.props.setting}
              MenuName={this.props.MenuName}
              columns={this.props.logcolumns}
              selectedData={[]}
              ContainerId={this.props.ContainerId}
@@ -523,6 +526,7 @@
    BData: PropTypes.any,             // 主表数据
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    MenuID: PropTypes.string,         // 菜单ID
    MenuName: PropTypes.any,          // 菜单名称
    config: PropTypes.object,         // 页面配置信息
    logcolumns: PropTypes.array,      // 显示列
    ContainerId: PropTypes.any,       // tab页面ID,用于弹窗控制
@@ -758,7 +762,7 @@
  }
  render() {
    const { plot, data, loading, BID, BData, Tab, MenuID, config, logcolumns, ContainerId } = this.props
    const { plot, data, loading, BID, BData, Tab, MenuID, config, logcolumns, ContainerId, MenuName } = this.props
    const { card, colMap, selectKey, actionList } = this.state
    
    return (
@@ -781,6 +785,7 @@
                    Tab={Tab}
                    btn={action}
                    show="icon"
                    MenuName={MenuName}
                    setting={config.setting}
                    updateStatus={() => {}}
                  />
@@ -793,6 +798,7 @@
                    Tab={Tab}
                    btn={action}
                    show="icon"
                    MenuName={MenuName}
                    setting={config.setting}
                    getexceloutparam={this.props.getexceloutparam}
                    updateStatus={() => {}}
@@ -814,6 +820,7 @@
              BData={BData}
              MenuID={MenuID}
              colMap={colMap}
              MenuName={MenuName}
              selectKey={selectKey}
              logcolumns={logcolumns}
              setting={config.setting}
@@ -833,6 +840,7 @@
            data={{key: 'insert'}}
            BData={BData}
            MenuID={MenuID}
            MenuName={MenuName}
            setting={config.setting}
            ContainerId={ContainerId}
            switchCard={() => {}}
src/tabviews/zshare/chartcomponent/index.jsx
@@ -18,6 +18,7 @@
  static propTpyes = {
    BID: PropTypes.any,              // 父级Id
    Tab: PropTypes.any,              // 标签信息
    MenuName: PropTypes.any,         // 菜单名称
    plot: PropTypes.object,          // 图标设置信息
    data: PropTypes.array,           // 图表传入数据
    loading: PropTypes.bool,         // 数据加载中
@@ -1075,7 +1076,7 @@
  }
  render() {
    const { plot, loading, config, BID, Tab } = this.props
    const { plot, loading, config, BID, Tab, MenuName } = this.props
    const { empty, chartFields, selectFields, actions } = this.state
    return (
@@ -1109,6 +1110,7 @@
                    Tab={Tab}
                    btn={item}
                    show="icon"
                    MenuName={MenuName}
                    setting={config.setting}
                    getexceloutparam={this.props.getexceloutparam}
                    updateStatus={() => {}}
@@ -1122,6 +1124,7 @@
                    Tab={Tab}
                    btn={item}
                    show="icon"
                    MenuName={MenuName}
                    setting={config.setting}
                    updateStatus={() => {}}
                  />
src/tabviews/zshare/normalTable/index.jsx
@@ -28,6 +28,7 @@
    tableId: PropTypes.string,       // 列表Id
    statFValue: PropTypes.any,       // 合计字段数据
    pageSize: PropTypes.any,         // 每页数据
    MenuName: PropTypes.any,         // 菜单名称
    dict: PropTypes.object,          // 字典项
    config: PropTypes.object,        // 页面配置
    MenuID: PropTypes.string,        // 菜单Id
@@ -602,6 +603,7 @@
                  selectedData={[record]}
                  BData={this.props.BData}
                  setting={this.props.setting}
                  MenuName={this.props.MenuName}
                  columns={this.props.logcolumns}
                  ContainerId={this.props.ContainerId}
                  updateStatus={this.props.refreshbyaction}
src/templates/calendarconfig/index.jsx
@@ -16,7 +16,7 @@
import SearchComponent from '@/templates/sharecomponent/searchcomponent'
import MenuForm from '@/templates/comtableconfig/menuform'
// import EditComponent from '@/templates/zshare/editcomponent'
import EditComponent from '@/templates/zshare/editcomponent'
import SourceElement from '@/templates/zshare/dragsource'
import Source from './source'
import './index.scss'
@@ -785,7 +785,7 @@
              </div>
            } bordered={false} extra={
              <div>
                {/* <EditComponent dict={this.state.dict} type="subtable" config={this.state.config} refresh={this.updateConfig}/> */}
                <EditComponent dict={this.state.dict} type="calendar" config={this.state.config} refresh={this.updateConfig}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button>
                <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button>
src/templates/formtabconfig/dragelement/card.jsx
@@ -8,7 +8,7 @@
const { MonthPicker } = DatePicker
const { TextArea } = Input
const Card = ({ id, type, cols, card, moveCard, findCard, editCard, delCard, profileCard, hasDrop, copyCard }) => {
const Card = ({ id, type, cols, card, moveCard, findCard, editCard, delCard, profileCard, copyCard }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: ItemTypes[type], id, originalIndex },
@@ -20,17 +20,15 @@
    accept: ItemTypes[type],
    canDrop: () => true,
    drop: (item) => {
      if (!item.hasOwnProperty('originalIndex')) {
        hasDrop(card)
      }
    },
    hover({ id: draggedId }) {
      if (!draggedId) return
      if (draggedId !== id) {
      const { id: draggedId, originalIndex } = item
      if (originalIndex === undefined) {
        item.dropTargetId = id
      } else if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
    },
    }
  })
  const opacity = isDragging ? 0 : 1
src/templates/formtabconfig/dragelement/index.jsx
@@ -9,7 +9,6 @@
import './index.scss'
const Container = ({list, type, groupId, setting, placeholder, handleList, handleMenu, deleteMenu, profileMenu }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -81,10 +80,6 @@
    deleteMenu({card: card, type: type})
  }
  const hasDrop = (item) => {
    target = item
  }
  const [, drop] = useDrop({
    accept: ItemTypes[type],
    drop(item) {
@@ -141,19 +136,19 @@
        newcard.verify = null
      }
      
      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
      if (target) {
        targetId = target.uuid
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
      const { index: overIndex } = findCard(`${targetId}`)
      let targetIndex = overIndex
      const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
      targetIndex++
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      handleList(type, _cards, newcard, groupId)
      target = null
    }
  })
@@ -172,7 +167,6 @@
          delCard={delCard}
          profileCard={profileCard}
          findCard={findCard}
          hasDrop={hasDrop}
        />
      ))}
      {type === 'search' && cards.map(card => (
@@ -188,7 +182,6 @@
            delCard={delCard}
            copyCard={copyCard}
            findCard={findCard}
            hasDrop={hasDrop}
          />
        </Col>
      ))}
src/templates/modalconfig/dragelement/card.jsx
@@ -25,11 +25,9 @@
      if (originalIndex === undefined) {
        item.dropTargetId = id
      } else if (draggedId) {
        if (draggedId !== id) {
          const { index: overIndex } = findCard(id)
          moveCard(draggedId, overIndex)
        }
      } else if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
    }
  })
src/templates/modalconfig/dragelement/index.jsx
@@ -99,10 +99,11 @@
      newcard.required = 'true'
      newcard.focus = true
      let targetId = '0'
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
src/templates/modalconfig/index.jsx
@@ -352,7 +352,7 @@
   * 3、设置编辑参数项-formlist
   */
  handleForm = (_card) => {
    const {menu, tabConfig, subTabConfig} = this.props
    const { menu, tabConfig, subTabConfig } = this.props
    let card = JSON.parse(JSON.stringify(_card))
    const { config } = this.state
    let _inputfields = []
@@ -797,14 +797,8 @@
          setAll: 'false',
          options: [],
          dataSource: '',
          linkField: '',
          valueField: '',
          valueText: '',
          orderBy: '',
          orderType: 'asc',
          decimal: 0,
          min: '',
          max: '',
          readonly: 'false',
          required: 'true'
        }
@@ -844,10 +838,6 @@
            setAll: 'false',
            options: [],
            dataSource: '',
            linkField: '',
            valueField: '',
            valueText: '',
            orderBy: '',
            orderType: 'asc',
            readonly: 'false',
            required: 'true'
src/templates/sharecomponent/actioncomponent/dragaction/card.jsx
@@ -3,7 +3,7 @@
import { Icon, Button, Popover } from 'antd'
import './index.scss'
const Card = ({ id, card, moveCard, findCard, editCard, delCard, copyCard, profileCard, hasDrop, doubleClickCard }) => {
const Card = ({ id, card, moveCard, findCard, editCard, delCard, copyCard, profileCard, doubleClickCard }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'action', id, originalIndex },
@@ -15,17 +15,15 @@
    accept: 'action',
    canDrop: () => true,
    drop: (item) => {
      if (!item.hasOwnProperty('originalIndex')) {
        hasDrop(card)
      }
    },
    hover({ id: draggedId }) {
      if (!draggedId) return
      if (draggedId !== id) {
      const { id: draggedId, originalIndex } = item
      if (originalIndex === undefined) {
        item.dropTargetId = id
      } else if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
    },
    }
  })
  const opacity = isDragging ? 0 : 1
src/templates/sharecomponent/actioncomponent/dragaction/index.jsx
@@ -7,8 +7,6 @@
import './index.scss'
const Container = ({list, setting, placeholder, handleList, handleMenu, deleteMenu, profileMenu, doubleClickCard }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -90,10 +88,6 @@
    handleList(_cards, copycard)
  }
  const hasDrop = (item) => {
    target = item
  }
  const [, drop] = useDrop({
    accept: 'action',
    drop(item) {
@@ -136,20 +130,19 @@
        newcard.class = 'dgreen'
      }
      
      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
      if (target) {
        targetId = target.uuid
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
      const { index: overIndex } = findCard(`${targetId}`)
      let targetIndex = overIndex
      targetIndex++
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
      handleList(_cards, newcard)
      target = null
    }
  })
@@ -165,7 +158,6 @@
          editCard={editCard}
          delCard={delCard}
          findCard={findCard}
          hasDrop={hasDrop}
          profileCard={profileCard}
          doubleClickCard={doubleClickBtn}
        />
src/templates/sharecomponent/columncomponent/dragcolumn/card.jsx
@@ -3,7 +3,7 @@
import { Icon, Popover } from 'antd'
import './index.scss'
const Card = ({ id, card, showfield, moveCard, findCard, editCard, delCard, markCard, hasDrop }) => {
const Card = ({ id, card, showfield, moveCard, findCard, editCard, delCard, markCard }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'columns', id, originalIndex },
@@ -14,9 +14,11 @@
  const [, drop] = useDrop({
    accept: 'columns',
    canDrop: () => true,
    drop: ({ id: draggedId, originalIndex }) => {
    drop: (item) => {
      const { id: draggedId, originalIndex } = item
      if (originalIndex === undefined) {
        hasDrop(card)
        item.dropTargetId = id
      } else if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
src/templates/sharecomponent/columncomponent/dragcolumn/index.jsx
@@ -8,8 +8,6 @@
import './index.scss'
const Container = ({list, setting, gridBtn, showfield, placeholder, handleList, handleMenu, handleGridBtn, deleteMenu, markMenu }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -31,7 +29,6 @@
  const editCard = id => {
    const { card } = findCard(id)
    delete card.focus // 兼容早期的合并列
    handleMenu(card)
@@ -46,10 +43,6 @@
  const markCard = id => {
    const { card } = findCard(id)
    markMenu(card)
  }
  const hasDrop = (item) => {
    target = item
  }
  const [, drop] = useDrop({
@@ -78,20 +71,19 @@
        newcard.order = 'vertical'
      }
      
      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
      if (target) {
        targetId = target.uuid
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
      const { index: overIndex } = findCard(`${targetId}`)
      let targetIndex = overIndex
      targetIndex++
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
      handleList(_cards, newcard)
      target = null
    }
  })
@@ -149,7 +141,6 @@
              delCard={delCard}
              markCard={markCard}
              findCard={findCard}
              hasDrop={hasDrop}
            />
          ))}
          {i === (columns.length - 1) && gridBtn && gridBtn.display ?
src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx
@@ -8,7 +8,7 @@
const { MonthPicker, WeekPicker, RangePicker } = DatePicker
const Card = ({ id, card, moveCard, copyCard, findCard, editCard, delCard, hasDrop }) => {
const Card = ({ id, card, moveCard, copyCard, findCard, editCard, delCard }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'search', id, originalIndex },
@@ -20,17 +20,15 @@
    accept: 'search',
    canDrop: () => true,
    drop: (item) => {
      if (!item.hasOwnProperty('originalIndex')) {
        hasDrop(card)
      }
    },
    hover({ id: draggedId }) {
      if (!draggedId) return
      if (draggedId !== id) {
      const { id: draggedId, originalIndex } = item
      if (originalIndex === undefined) {
        item.dropTargetId = id
      } else if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
    },
    }
  })
  const opacity = isDragging ? 0 : 1
src/templates/sharecomponent/searchcomponent/dragsearch/index.jsx
@@ -8,8 +8,6 @@
import './index.scss'
const Container = ({list, placeholder, handleList, handleMenu, deleteMenu }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -75,10 +73,6 @@
    handleList(_cards, copycard)
  }
  const hasDrop = (item) => {
    target = item
  }
  const [, drop] = useDrop({
    accept: 'search',
    drop(item) {
@@ -112,21 +106,20 @@
      }
      
      newcard.match = _match
      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
      if (target) {
        targetId = target.uuid
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
      const { index: overIndex } = findCard(`${targetId}`)
      let targetIndex = overIndex
      targetIndex++
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
      handleList(_cards, newcard)
      target = null
    }
  })
@@ -142,7 +135,6 @@
            editCard={editCard}
            delCard={delCard}
            findCard={findCard}
            hasDrop={hasDrop}
          />
        </Col>
      ))}
src/templates/sharecomponent/tabscomponent/tabdragelement/card.jsx
@@ -3,7 +3,7 @@
import { Icon, Popover } from 'antd'
import './index.scss'
const Card = ({ id, card, moveCard, findCard, doubleClickCard, editCard, delCard, hasDrop }) => {
const Card = ({ id, card, moveCard, findCard, doubleClickCard, editCard, delCard }) => {
  const originalIndex = findCard(id).index
  const [{ isDragging }, drag] = useDrag({
    item: { type: 'tabs', id, originalIndex },
@@ -15,13 +15,11 @@
    accept: 'tabs',
    canDrop: () => true,
    drop: (item) => {
      if (!item.hasOwnProperty('originalIndex')) {
        hasDrop(card)
      }
    },
    hover({ id: draggedId }) {
      if (!draggedId) return
      if (draggedId !== id) {
      const { id: draggedId, originalIndex } = item
      if (originalIndex === undefined) {
        item.dropTargetId = id
      } else if (draggedId && draggedId !== id) {
        const { index: overIndex } = findCard(id)
        moveCard(draggedId, overIndex)
      }
src/templates/sharecomponent/tabscomponent/tabdragelement/index.jsx
@@ -10,7 +10,6 @@
const { TabPane } = Tabs
const Container = ({list, placeholder, handleList, handleMenu, deleteMenu, doubleClickCard }) => {
  let target = null
  const [cards, setCards] = useState(list)
  const moveCard = (id, atIndex) => {
    const { card, index } = findCard(id)
@@ -33,10 +32,6 @@
    }
  }
  const hasDrop = (item) => {
    target = item
  }
  const [, drop] = useDrop({
    accept: 'tabs',
    drop(item) {
@@ -54,19 +49,19 @@
      newcard.supMenu = 'mainTable'
      newcard.focus = true
      let targetId = cards.length > 0 ? cards[cards.length - 1].uuid : 0
      if (target) {
        targetId = target.uuid
      let targetId = ''
      if (item.dropTargetId) {
        targetId = item.dropTargetId
        delete item.dropTargetId
      } else if (cards.length > 0) {
        targetId = cards[cards.length - 1].uuid
      }
      const { index: overIndex } = findCard(`${targetId}`)
      let targetIndex = overIndex
      const _cards = update(cards, { $splice: [[overIndex + 1, 0, newcard]] })
      targetIndex++
      const _cards = update(cards, { $splice: [[targetIndex, 0, newcard]] })
      handleList(_cards, newcard)
      target = null
    }
  })
@@ -98,7 +93,6 @@
              findCard={findCard}
              editCard={editCard}
              delCard={delCard}
              hasDrop={hasDrop}
              doubleClickCard={doubleClickBab}
            />
          } key={`${index}`}>
src/templates/treepageconfig/index.jsx
@@ -15,7 +15,6 @@
import asyncComponent from '@/utils/asyncComponent'
import MenuForm from '@/templates/comtableconfig/menuform'
import EditComponent from '@/templates/zshare/editcomponent'
import SourceElement from '@/templates/zshare/dragsource'
import Source from './source'
import './index.scss'
@@ -706,21 +705,6 @@
  }
  /**
   * @description 编辑功能完成更新,包括解冻按钮、粘贴、替换等
   */
  editConfig = (res) => {
    if (res.type === 'paste') {
      this.setState({
        pasteContent: res.content
      }, () => {
        this.setState({
          pasteContent: null
        })
      })
    }
  }
  /**
   * @description 更新标签配置信息
   */
  updatetabs = (config, delcards) => {
@@ -804,7 +788,6 @@
              </div>
            } bordered={false} extra={
              <div>
                <EditComponent dict={this.state.dict} type="TreePage" config={this.state.config} MenuID={this.props.menu.MenuID} refresh={this.editConfig}/>
                <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={this.state.config.enabled} onChange={this.onEnabledChange} />
                <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button>
                <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button>
src/templates/zshare/editcomponent/index.jsx
@@ -4,6 +4,7 @@
import { Menu, Dropdown, Icon, Modal, Spin, notification } from 'antd'
import Api from '@/api'
import Utils from '@/utils/utils.js'
import PasteForm from '@/templates/zshare/pasteform'
import ReplaceForm from '@/templates/zshare/replaceform'
import TransferForm from '@/templates/zshare/basetransferform'
@@ -136,14 +137,8 @@
    this.pasteFormRef.handleConfirm().then(res => {
      if (['maintable', 'subtable'].includes(type) && res.copyType === 'action') {
        if (this.props.type === 'subtable' && !['pop', 'prompt', 'exec', 'excelIn', 'excelOut', 'popview'].includes(res.OpenType)) {
          notification.warning({
            top: 92,
            message: '不支持此打开方式!',
            duration: 5
          })
          return
        }
        res.uuid = Utils.getuuid()
        this.setState({
          pasteVisible: false
        }, () => {
@@ -152,7 +147,24 @@
            content: res
          })
        })
      } else if (['maintable', 'subtable'].includes(type) && res.copyType === 'search') {
      } else if (['maintable', 'subtable', 'calendar'].includes(type) && (res.copyType === 'search' || res.copyType === 'form')) {
        res.uuid = Utils.getuuid()
        // search: text select multiselect link date dateweek datemonth daterange group
        // form: text number select multiselect link switch checkbox radio checkcard
        //       fileupload date datemonth datetime textarea hint color funcvar
        if (res.copyType === 'form') {
          if (['number', 'switch', 'textarea', 'checkcard', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) {
            res.type = 'text'
          } else if (res.type === 'radio') {
            res.type = 'select'
          } else if (res.type === 'checkbox') {
            res.type = 'multiselect'
          } else if (res.type === 'datetime') {
            res.type = 'date'
          }
        }
        this.setState({
          pasteVisible: false
        }, () => {
@@ -180,68 +192,54 @@
            content: res
          })
        })
      } else if (['form'].includes(type) && res.copyType === 'form') {
        if (res.type === 'linkMain') {
          notification.warning({
            top: 92,
            message: '不支持此表单类型!',
            duration: 10
          })
          return
        }
      } else if (['form'].includes(type) && (res.copyType === 'form' || res.copyType === 'search')) {
        let _config = fromJS(config).toJS()
        let fieldrepet = false
        let labelrepet = false
        let fields = []
        let labels = []
        res.uuid = Utils.getuuid()
        // search: text select multiselect link date dateweek datemonth daterange group
        // form: text number select multiselect link switch checkbox radio checkcard
        //       fileupload date datemonth datetime textarea hint color funcvar
        if (res.copyType === 'search') {
          if (res.type === 'dateweek' || res.type === 'daterange' || res.type === 'group') {
            res.type = 'date'
          }
        }
        if (_config.groups.length > 0) {
          _config.groups.forEach(group => {
            group.sublist.forEach(item => {
              if (item.uuid === res.uuid) {
                fieldrepet = true
              } else if (item.field === res.field) {
                fieldrepet = true
              } else if (item.label === res.label) {
                labelrepet = true
              }
              fields.push(item.field)
              labels.push(item.label)
            })
            if (group.default) {
              group.sublist.push(res)
            }
          })
        } else {
          _config.fields.forEach(item => {
            if (item.uuid === res.uuid) {
              fieldrepet = true
            } else if (item.field === res.field) {
              fieldrepet = true
            } else if (item.label === res.label) {
              labelrepet = true
            }
            fields.push(item.field)
            labels.push(item.label)
          })
          _config.fields.push(res)
        }
        if (fieldrepet) {
        if (fields.includes(res.field)) {
          notification.warning({
            top: 92,
            message: '字段已存在!',
            duration: 10
          })
          return
        } else if (labelrepet) {
        } else if (labels.includes(res.label)) {
          notification.warning({
            top: 92,
            message: '名称已存在!',
            duration: 10
          })
          return
        }
        if (_config.groups.length > 0) {
          _config.groups.forEach(group => {
            if (group.default) {
              group.sublist.push(res)
            }
          })
        } else {
          _config.fields.push(res)
        }
        
        this.setState({
@@ -280,7 +278,7 @@
    const menu = (
      <Menu onClick={this.handleMenuClick}>
        {['maintable', 'subtable'].includes(type) ? <Menu.Item key="thaw"><Icon type="unlock" />{dict['header.form.thawbutton']}</Menu.Item> : null}
        {['maintable', 'subtable', 'form'].includes(type) ? <Menu.Item key="paste"><Icon type="snippets" />{dict['header.form.paste']}</Menu.Item> : null}
        {['maintable', 'subtable', 'form', 'calendar'].includes(type) ? <Menu.Item key="paste"><Icon type="snippets" />{dict['header.form.paste']}</Menu.Item> : null}
        {/* <Menu.Item key="replace"><Icon type="retweet" />替换</Menu.Item> */}
      </Menu>
    )