king
2022-01-21 46f79b491173d284a4900d19e7aecf7509481438
src/menu/components/share/searchcomponent/dragsearch/card.jsx
@@ -1,6 +1,7 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Icon, Select, DatePicker, Input, Popover, Form } from 'antd'
import { Select, DatePicker, Input, Popover, Form } from 'antd'
import { EditOutlined, CopyOutlined, CloseOutlined } from '@ant-design/icons'
import moment from 'moment'
import DateGroup from '@/menu/components/search/main-search/dategroup'
@@ -35,15 +36,11 @@
  let _defaultValue = '' // 下拉搜索、时间范围类型,初始值需要预处理
  if (card.type === 'multiselect' || card.type === 'select' || card.type === 'link') {
    if (card.initval) {
      let _option = card.options.filter(option => option.Value === card.initval)[0]
      if (_option) {
        _defaultValue = _option.Text || ''
      } else {
        _defaultValue = ''
      }
    } else if (card.setAll === 'true') {
      _defaultValue = '全部'
    let _option = card.options.filter(option => option.Value === card.initval)[0]
    if (_option) {
      _defaultValue = _option.Text || ''
    } else {
      _defaultValue = ''
    }
  } else if (card.type === 'daterange') {
    _defaultValue = [null, null]
@@ -64,9 +61,9 @@
  return (
    <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
      <div className="mk-popover-control">
        <Icon className="edit" title="编辑" type="edit" onClick={() => editCard(id)} />
        <Icon className="copy" title="复制" type="copy" onClick={() => copyCard(id)} />
        <Icon className="close" title="删除" type="close" onClick={() => delCard(id)} />
        <EditOutlined className="edit" title="编辑" onClick={() => editCard(id)} />
        <CopyOutlined className="copy" title="复制" onClick={() => copyCard(id)} />
        <CloseOutlined className="close" title="删除" onClick={() => delCard(id)} />
      </div>
    } trigger="hover">
      <div className={'page-card ' + (card.labelShow || '')} style={{ opacity: opacity}}>