king
2023-08-07 42ddba4c235e1db44e17b525698f89450a4289a4
2023-08-07
11个文件已修改
2个文件已添加
186 ■■■■ 已修改文件
src/menu/components/search/main-search/dragsearch/card.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-X6/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetAttach/addAttach/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetAttach/index.jsx 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetAttach/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/advanceform/index.jsx 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/index.jsx 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/mkRadio/index.jsx 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/topSearch/mkRadio/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/formconfig.jsx 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/search/main-search/dragsearch/card.jsx
@@ -1,6 +1,6 @@
import React from 'react'
import { useDrag, useDrop } from 'react-dnd'
import { Select, DatePicker, Input, Popover, Form, Switch, Checkbox } from 'antd'
import { Select, Radio, DatePicker, Input, Popover, Form, Switch, Checkbox } from 'antd'
import { CopyOutlined, EditOutlined, CloseOutlined } from '@ant-design/icons'
import moment from 'moment'
@@ -113,6 +113,14 @@
    formItem = <CheckCard config={card} />
  } else if (card.type === 'switch') {
    formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} style={{marginTop: '8px'}} checked={card.initval === card.openVal}/>)
  } else if (card.type === 'radio') {
    let options = card.options
    if (options.length === 0) {
      options = [{Value: '1', Text: '选项1'}, {Value: '2', Text: '选项2'}]
    }
    formItem = (<Radio.Group value={card.initval} style={{lineHeight: '36px'}}>
      {options.map((item, i) => (<Radio key={i} value={item.Value}> {item.Text} </Radio>))}
    </Radio.Group>)
  } else if (card.type === 'check') {
    formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox>
  }
src/tabviews/custom/components/chart/antv-X6/index.jsx
@@ -470,7 +470,6 @@
  }
  getrolelist = () => {
    // Api.getSystemConfig({func: 's_get_rolelist', OrderCol: 'RoleID desc', PageIndex: 1, PageSize: 1000}).then(res => {
    Api.genericInterface({func: 's_get_organizations_v1'}).then(res => {
      if (!res.status) {
        notification.error({
src/tabviews/custom/components/module/voucher/resetAttach/addAttach/index.jsx
@@ -60,7 +60,7 @@
        <Col span={12}>
          <Form.Item label="文件夹">
            {getFieldDecorator('data_code', {
              initialValue: '',
              initialValue: files[0] ? files[0].data_code : '',
              rules: [
                {
                  required: true,
src/tabviews/custom/components/module/voucher/resetAttach/index.jsx
@@ -41,7 +41,6 @@
    list = list.map(item => {
      item.icon = this.getIcon(item.attachments_url)
      item.name = this.getName(item.attachments_url)
      return item
    })
@@ -75,7 +74,6 @@
          file.attachments = file.attachments.map(item => {
            item.id = item.attach_id
            item.icon = this.getIcon(item.attachments_url)
            item.name = this.getName(item.attachments_url)
            item.data_code = file.data_code
            item.data_name = file.data_name
            item.BID = file.id
@@ -154,7 +152,6 @@
        }
        item.icon = this.getIcon(res.url)
        item.name = this.getName(res.url)
        list.push(item)
@@ -165,14 +162,6 @@
  deleteFile = (id) => {
    this.setState({list: this.state.list.filter(item => item.id !== id)})
  }
  getName = (url) => {
    if (!url || !/\//.test(url)) return url
    let names = url.split('/')
    return names[names.length - 1]
  }
  getIcon = (url) => {
@@ -266,8 +255,8 @@
              return <div className="attach-item" key={item.id}>
                <img src={item.icon} alt=""/>
                <div className="attach-msg">
                  <div>{item.attachments_title}</div>
                  <div>{item.data_name ? item.data_name + ' / ' : ''}{item.name}</div>
                  {/* <div>{item.attachments_title}</div> */}
                  <div>{item.data_name ? item.data_name + ' / ' : ''}{item.attachments_title}</div>
                </div>
                <div>
                  <DeleteOutlined onClick={() => this.deleteFile(item.id)}/>
src/tabviews/custom/components/module/voucher/resetAttach/index.scss
@@ -34,6 +34,7 @@
          flex: 1;
          width: calc(100% - 95px);
          padding: 5px 0px;
          line-height: 45px;
          div {
            color: #000000;
            overflow: hidden;
src/tabviews/custom/index.jsx
@@ -438,16 +438,22 @@
          let _searchId = searchId
          tab.components.forEach(cell => {
            if (cell.type !== 'search') return
            _searchId = cell.uuid
            window.GLOB.SearchBox.set(cell.uuid, cell.$searches)
            if (cell.$s_req) {
              window.GLOB.SearchBox.set(cell.uuid + 'required', true)
            }
          })
          if (tab.components.findIndex(cell => cell.type === 'search') > -1) {
            _searchId = tab.uuid
          }
          tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, time, MenuName, _searchId, tab.uuid)
          if (_searchId === tab.uuid) {
            tab.components.forEach(cell => {
              if (cell.type !== 'search') return
              window.GLOB.SearchBox.set(_searchId, cell.$searches)
              if (cell.$s_req) {
                window.GLOB.SearchBox.set(_searchId + 'required', true)
              }
            })
          }
          return tab
        })
@@ -493,9 +499,7 @@
      }
      // 搜索条件初始化
      if (item.type === 'search' && item.search.length === 0) {
        return false
      } else if (item.search) {
      if (item.search) {
        Utils.initSearchVal(item)
        item.$searches = Utils.initMainSearch(item.search)
src/tabviews/custom/popview/index.jsx
@@ -266,16 +266,22 @@
          let _searchId = searchId
          tab.components.forEach(cell => {
            if (cell.type !== 'search') return
            _searchId = cell.uuid
            window.GLOB.SearchBox.set(cell.uuid, cell.$searches)
            if (cell.$s_req) {
              window.GLOB.SearchBox.set(cell.uuid + 'required', true)
            }
          })
          if (tab.components.findIndex(cell => cell.type === 'search') > -1) {
            _searchId = tab.uuid
          }
          tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, _searchId, tab.uuid)
          if (_searchId === tab.uuid) {
            tab.components.forEach(cell => {
              if (cell.type !== 'search') return
              window.GLOB.SearchBox.set(_searchId, cell.$searches)
              if (cell.$s_req) {
                window.GLOB.SearchBox.set(_searchId + 'required', true)
              }
            })
          }
          return tab
        })
@@ -308,9 +314,7 @@
      }
      // 搜索条件初始化
      if (item.type === 'search' && item.search.length === 0) {
        return false
      } else if (item.search) {
      if (item.search) {
        Utils.initSearchVal(item)
        item.$searches = Utils.initMainSearch(item.search)
src/tabviews/zshare/topSearch/advanceform/index.jsx
@@ -8,6 +8,9 @@
const MKCheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheckCard'))
const MKSelect = asyncComponent(() => import('../mkSelect'))
const MKCheck = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheck'))
const MKSwitch = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkSwitch'))
const MKRadio = asyncComponent(() => import('../mkRadio'))
const MKDatePicker = asyncComponent(() => import('../mkDatePicker'))
class AdvanceSearch extends Component {
@@ -48,6 +51,12 @@
        content = (<MKDatePicker config={item}/>)
      } else if (item.type === 'checkcard') {
        content = <MKCheckCard config={item}/>
      } else if (item.type === 'radio') {
        content = <MKRadio config={item} onChange={(val) => this.recordChange(val, false, item)} />
      } else if (item.type === 'check') {
        content = <MKCheck config={item}/>
      } else if (item.type === 'switch') {
        content = <MKSwitch config={item}/>
      }
      if (content) {
src/tabviews/zshare/topSearch/index.jsx
@@ -19,6 +19,7 @@
const MKCheckCard = asyncComponent(() => import('./mkCheckCard'))
const MKCheck = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheck'))
const MKSwitch = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkSwitch'))
const MKRadio = asyncComponent(() => import('./mkRadio'))
const MKSelect = asyncComponent(() => import('./mkSelect'))
const DateGroup = asyncComponent(() => import('./dategroup'))
const MKDatePicker = asyncComponent(() => import('./mkDatePicker'))
@@ -137,7 +138,7 @@
        record[item.field] = item.initval
      }
      
      if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type)) {
      if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(item.type)) {
        item.options = item.options || []
        item.options = item.options.filter(op => !op.Hide)
        if (item.setAll === 'true' && ['select', 'link'].includes(item.type)) {
@@ -415,7 +416,7 @@
  resetSearch = (result) => {
    let _searchlist = fromJS(this.state.searchlist).toJS().map(item => {
      if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
      if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(item.type) && result[item.field] && result[item.field].length > 0) {
        let options = []
        let map = new Map()
        let all = false
@@ -549,6 +550,8 @@
        content = <DateGroup position={index} config={item} onChange={(val, type) => this.dateGroupChange(val, type, item)} />
      } else if (item.type === 'checkcard') {
        content = <MKCheckCard config={item} onChange={(val) => this.cardChange(val, item)} />
      } else if (item.type === 'radio') {
        content = <MKRadio config={item} onChange={(val) => this.recordChange(val, false, item)} />
      } else if (item.type === 'check') {
        content = <MKCheck config={item} onChange={(val) => this.recordChange(val, false, item)} />
      } else if (item.type === 'switch') {
src/tabviews/zshare/topSearch/mkRadio/index.jsx
New file
@@ -0,0 +1,77 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Radio } from 'antd'
class MKRadio extends Component {
  static propTpyes = {
    config: PropTypes.object,
    onChange: PropTypes.func
  }
  state = {
    value: '',
    config: null,
    options: []
  }
  UNSAFE_componentWillMount () {
    const { config } = this.props
    let value = config.initval
    if (value) {
      let option = null
      option= config.oriOptions[0]
      if (typeof(value) === 'string' && option && typeof(option.value) === 'number') {
        value = +value
        if (isNaN(value)) {
          value = config.initval
        }
      }
    }
    this.setState({
      config: fromJS(config).toJS(),
      options: fromJS(config.options).toJS(),
      value,
    })
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.state), fromJS(nextState))
  }
  UNSAFE_componentWillReceiveProps (nextProps) {
    const { config } = this.state
    if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) {
      this.setState({
        config: fromJS(nextProps.config).toJS(),
        options: fromJS(nextProps.config.options).toJS()
      })
    }
  }
  componentWillUnmount () {
    this.setState = () => {
      return
    }
  }
  onChange = (val) => {
    this.props.onChange(val)
    this.setState({value: val})
  }
  render() {
    const { value, options } = this.state
    return (
      <Radio.Group value={value} onChange={(e) => this.onChange(e.target.value)}>
        {options.map(option => <Radio key={option.key} value={option.Value}>{option.Text}</Radio>)}
      </Radio.Group>
    )
  }
}
export default MKRadio
src/tabviews/zshare/topSearch/mkRadio/index.scss
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -99,6 +99,7 @@
const searchTypeOptions = {
  text: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'inputType', 'advanced', 'query', 'labelwidth'],
  select: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'dropdown', 'query', 'labelwidth'],
  radio: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'query', 'labelwidth'],
  multiselect: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'],
  link: ['label', 'field', 'resourceType', 'initval', 'type', 'linkField', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'dropdown', 'query', 'labelwidth'],
  date: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'precision', 'labelwidth'],
@@ -180,7 +181,7 @@
    let reRequired = {}
    let reLabel = {}
    if (['multiselect', 'select', 'link'].includes(type)) {
    if (['multiselect', 'select', 'link', 'radio'].includes(type)) {
      reRequired.linkField = true
      if (this.record.resourceType === '0') {        // 自定义资源
        shows.push('options')
@@ -319,7 +320,7 @@
              uuid: key
            }]
          }
        } else if (['multiselect', 'select', 'link'].includes(value)) {
        } else if (['multiselect', 'select', 'link', 'radio'].includes(value)) {
          if (!this.record.options[0].Text && this.record.fields.length > 0) {
            let field = this.record.fields[0].field
    
@@ -619,7 +620,7 @@
        if (!err) {
          values.uuid = this.props.card.uuid
          // 下拉菜单或联动菜单
          if (['multiselect', 'select', 'link'].includes(values.type)) {
          if (['multiselect', 'select', 'link', 'radio'].includes(values.type)) {
            if (values.resourceType === '0') {
              values.options = values.options || []
              values.dataSource = ''
src/templates/zshare/formconfig.jsx
@@ -359,6 +359,9 @@
      value: 'switch',
      text: '开关'
    }, {
      value: 'radio',
      text: '单选框'
    }, {
      value: 'check',
      text: '勾选框'
    }]
@@ -367,7 +370,7 @@
  if (card.focus) {
    if (['text', 'multiselect'].includes(card.type)) {
      card.match = 'like'
    } else if (['select', 'link', 'checkcard'].includes(card.type)) {
    } else if (['select', 'link', 'checkcard', 'radio'].includes(card.type)) {
      card.match = '='
    } else if (card.type === 'date') {
      card.match = '>='