king
2023-11-11 8ddb24b297a5a77fbb3469db29b39612238d35e8
2023-11-11
17个文件已修改
242 ■■■■ 已修改文件
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/datasource/verifycard/customscript/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/searchcomponent/searchform/index.jsx 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/callbackcustomscript/index.jsx 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/fullScripts/index.jsx 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/fullScripts/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/option.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils-custom.js 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx
@@ -6,7 +6,7 @@
import Api from '@/api'
import { checkSQL } from '@/utils/utils-custom.js'
import CodeMirror from '@/templates/zshare/codemirror'
import './index.scss'
// import './index.scss'
class CustomForm extends Component {
  static propTpyes = {
@@ -316,7 +316,7 @@
              </Select>
            </Form.Item>
          </Col> : null}
          <Col span={5} style={{paddingTop: '3px', whiteSpace: 'nowrap'}}>
          <Col span={5} className="add" style={{paddingTop: '3px', whiteSpace: 'nowrap'}}>
            <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 15}}>
              {type === 'fullscreen' && !editItem ? '添加' : '保存'}
            </Button>
@@ -324,10 +324,10 @@
              取消
            </Button>
          </Col>
          <Col span={3} style={{paddingTop: '12px', fontSize: '12px', whiteSpace: 'nowrap'}}>
          {!type ? <Col span={3} style={{paddingTop: '12px', fontSize: '12px', whiteSpace: 'nowrap'}}>
            强制保存:
            <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/>
          </Col>
          </Col> : null}
          <Col span={24} className="sql">
            <Form.Item label="sql">
              {getFieldDecorator('sql', {
src/menu/components/table/edit-table/columns/tableIn/index.jsx
@@ -616,7 +616,7 @@
            </span>
          } key="scripts">
            <FullScripts
              verify={verify}
              scripts={verify.scripts}
              getScriptsFullForm={() => this.scriptsFullForm}
              getScriptsForm={() => this.scriptsForm}
              handleStatus={this.handleStatus}
src/menu/datasource/verifycard/customscript/index.jsx
@@ -45,9 +45,16 @@
  getSearchField = (searches) => {
    let _usefulFields = []
    searches.forEach(item => {
      if (['dateweek', 'datemonth'].includes(item.type)) {
      if (item.type === 'dateweek') {
        _usefulFields.push(item.key)
        _usefulFields.push(item.key + '1')
      } else if (item.type === 'datemonth') {
        if (item.match === '=') {
          _usefulFields.push(item.key)
        } else {
          _usefulFields.push(item.key)
          _usefulFields.push(item.key + '1')
        }
      } else if (item.type === 'daterange') {
        let _skey = item.key
        let _ekey = item.key + '1'
src/templates/sharecomponent/actioncomponent/verifyexcelin/columnform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Select, Button, Input, InputNumber, Radio } from 'antd'
import './index.scss'
// import './index.scss'
class ExcelInColumn extends Component {
  static propTpyes = {
src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx
@@ -7,7 +7,7 @@
import Api from '@/api'
import { checkSQL } from '@/utils/utils-custom.js'
import CodeMirror from '@/templates/zshare/codemirror'
import './index.scss'
// import './index.scss'
class CustomForm extends Component {
  static propTpyes = {
@@ -341,10 +341,10 @@
              取消
            </Button>
          </Col>
          <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}>
          {!type ? <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}>
            强制保存:
            <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/>
          </Col>
          </Col> : null}
          <Col span={24} className="sql">
            <Form.Item label="sql">
              {getFieldDecorator('sql', {
src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx
@@ -925,7 +925,7 @@
            </span>
          } key="scripts" id="mk-exin-script">
            <FullScripts
              verify={verify}
              scripts={verify.scripts}
              getScriptsFullForm={() => this.scriptsFullForm}
              getScriptsForm={() => this.scriptsForm}
              handleStatus={this.handleStatus}
src/templates/sharecomponent/actioncomponent/verifyexcelin/uniqueform/index.jsx
@@ -1,8 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Select, Button } from 'antd'
import './index.scss'
// import './index.scss'
class UniqueForm extends Component {
  static propTpyes = {
src/templates/sharecomponent/actioncomponent/verifyexcelout/columnform/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Button, Input, InputNumber, Radio } from 'antd'
import './index.scss'
// import './index.scss'
class ExcelOutColumn extends Component {
  static propTpyes = {
src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx
@@ -9,7 +9,7 @@
import Utils from '@/utils/utils.js'
import { checkSQL } from '@/utils/utils-custom.js'
import CodeMirror from '@/templates/zshare/codemirror'
import './index.scss'
// import './index.scss'
class CustomForm extends Component {
  static propTpyes = {
@@ -96,9 +96,16 @@
        _usefulFields.push(item.field)
        _usefulFields.push(item.datefield)
        _usefulFields.push(item.datefield + '1')
      } else if (['dateweek', 'datemonth'].includes(item.type)) {
      } else if (item.type === 'dateweek') {
        _usefulFields.push(item.field)
        _usefulFields.push(item.field + '1')
      } else if (item.type === 'datemonth') {
        if (item.match === '=') {
          _usefulFields.push(item.field)
        } else {
          _usefulFields.push(item.field)
          _usefulFields.push(item.field + '1')
        }
      } else if (item.type === 'daterange') {
        let _skey = item.field
        let _ekey = item.field + '1'
src/templates/sharecomponent/searchcomponent/searchform/index.jsx
@@ -252,6 +252,7 @@
      reTypes.initval = 'text'
    }
    reTooltip.match = ''
    if (type === 'text') {
      reOptions.match = matchReg.class1
    } else if (type === 'multiselect') {
@@ -263,7 +264,8 @@
    } else if (type === 'date') {
      reOptions.match = matchReg.class4
    } else if (type === 'datemonth') {
      reOptions.match = matchReg.class5
      reTooltip.match = '匹配模式为 between 时,搜索条件为大于月初小于月末,匹配模式为 = 时,搜索条件为等于当前月(YYYY-MM)。'
      reOptions.match = matchReg.class6
    } else if (type === 'dateweek' || type === 'daterange' || type === 'range') {
      reOptions.match = matchReg.class5
    } else if (type === 'checkcard') {
src/templates/zshare/verifycard/callbackcustomscript/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Form, Row, Col, Button, Modal, Tooltip, Radio, Select, Switch } from 'antd'
import { Form, Row, Col, Button, Modal, Tooltip, Radio, Select, Switch, notification } from 'antd'
import { QuestionCircleOutlined } from '@ant-design/icons'
import Api from '@/api'
@@ -29,18 +29,39 @@
      editItem: record
    })
    this.props.form.setFieldsValue({
      sql: record.sql,
      position: record.position || 'back'
    })
    if (this.props.type) {
      this.props.form.setFieldsValue({
        sql: record.sql
      })
    } else {
      this.props.form.setFieldsValue({
        sql: record.sql,
        position: record.position || 'back'
      })
    }
  }
  handleConfirm = () => {
    const { type } = this.props
    const { editItem, skip } = this.state
    // 表单提交时检查输入值是否正确
    this.props.form.validateFieldsAndScroll((err, values) => {
      if (type === 'fullscreen' && err) {
        notification.warning({
          top: 92,
          message: '请输入sql!',
          duration: 5
        })
        return
      }
      if (!err) {
        values.uuid = editItem ? editItem.uuid : ''
        values.position = values.position || (editItem ? editItem.position : 'front')
        if (type === 'fullscreen' && editItem) {
          values.status = editItem.status || 'true'
        }
        let pass = checkSQL(values.sql, 'customscript')
@@ -166,9 +187,9 @@
  }
  render() {
    const { usefulfields, systemScripts, btn } = this.props
    const { usefulfields, systemScripts, btn, type } = this.props
    const { getFieldDecorator } = this.props.form
    const { skip } = this.state
    const { editItem, skip } = this.state
    const formItemLayout = {
      labelCol: {
        xs: { span: 24 },
@@ -185,25 +206,25 @@
    return (
      <Form {...formItemLayout} className="verify-form verify-custom-callback-scripts" id="verify-custom-callback-scripts">
        <Row gutter={24}>
          <Col span={8}>
          {!type ? <Col span={8}>
            <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}>
              {btn.cbTable}
            </Form.Item>
          </Col>
          <Col span={10}>
          </Col> : null}
          {!type ? <Col span={10}>
            <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}>
              ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT、CNT、-2NT), retmsg
            </Form.Item>
          </Col>
          <Col span={24} className="sqlfield">
          </Col> : null}
          {!type ? <Col span={24} className="sqlfield">
            <Form.Item label={'可用字段'}>
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address, mk_deleted</span></Tooltip>,&nbsp;
              <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并在单号生成或创建凭证时使用。'}><span style={{color: '#13c2c2'}}>BillCode, BVoucher, FIBVoucherDate, FiYear, ModularDetailCode</span></Tooltip>
              {usefulfields ? <span>, {usefulfields}</span> : ''}
            </Form.Item>
          </Col>
          <Col span={8} style={{whiteSpace: 'nowrap'}}>
          </Col> : null}
          {!type ? <Col span={8} style={{whiteSpace: 'nowrap'}}>
            <Form.Item style={{marginBottom: 0}} label={
              <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}>
                <QuestionCircleOutlined className="mk-form-tip" />
@@ -219,8 +240,8 @@
                </Radio.Group>
              )}
            </Form.Item>
          </Col>
          <Col span={8}>
          </Col> : null}
          {!type ? <Col span={8}>
            <Form.Item label={'快捷添加'} style={{marginBottom: 0}}>
              <Select
                allowClear
@@ -235,19 +256,19 @@
                )}
              </Select>
            </Form.Item>
          </Col>
          </Col> : null}
          <Col span={5} className="add" style={{whiteSpace: 'nowrap'}}>
            <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}>
              保存
              {type === 'fullscreen' && !editItem ? '添加' : '保存'}
            </Button>
            <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}>
              取消
            </Button>
          </Col>
          <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}>
          {!type ? <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}>
            强制保存:
            <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/>
          </Col>
          </Col> : null}
          <Col span={24} className="sql">
            <Form.Item label="sql">
              {getFieldDecorator('sql', {
src/templates/zshare/verifycard/fullScripts/index.jsx
@@ -10,7 +10,7 @@
class fullScripts extends Component {
  static propTpyes = {
    verify: PropTypes.object,
    scripts: PropTypes.array,
    getScriptsForm: PropTypes.func
  }
@@ -41,9 +41,11 @@
  }
  render() {
    const { verify, children } = this.props
    const { scripts, children } = this.props
    const { visible, scriptId } = this.state
    if (scripts.length === 0) return null
    return (
      <>
        <BorderOutlined className="full-scripts" onClick={this.trigger}/>
@@ -57,7 +59,7 @@
        >
          <img className="unfull-scripts" src={MinView} onClick={() => this.setState({visible: false, scriptId: ''})} alt=""/>
          <div className="script-table-wrap">
            {verify.scripts.map(item => {
            {scripts.map(item => {
              let title = item.sql.match(/^\s*\/\*.+\*\//)
              title = title && title[0] ? title[0] : ''
              let _text = title ? item.sql.replace(title, '') : item.sql
src/templates/zshare/verifycard/fullScripts/index.scss
@@ -116,6 +116,7 @@
          position: absolute;
          top: 10px;
          z-index: 1;
          padding-top: 0px!important;
          .ant-btn {
            height: 28px;
          }
src/templates/zshare/verifycard/index.jsx
@@ -1660,7 +1660,7 @@
            </span>
          } key="scripts" id="mk-normal-script">
            <FullScripts
              verify={verify}
              scripts={verify.scripts}
              getScriptsFullForm={() => this.scriptsFullForm}
              getScriptsForm={() => this.scriptsForm}
              handleStatus={this.handleStatus}
@@ -1698,6 +1698,24 @@
              {verify.cbScripts.length ? <span className="count-tip">{verify.cbScripts.length}</span> : null}
            </span>
          } key="cbScripts" id="mk-callback-script">
            <FullScripts
              scripts={verify.cbScripts}
              getScriptsFullForm={() => this.cbscriptsFullForm}
              getScriptsForm={() => this.cbscriptsForm}
              handleStatus={(item) => this.handleStatus(item, 'cbscripts')}
              handleDelete={(item) => this.handleDelete(item, 'cbscripts')}
            >
              <CallBackCustomScript
                type="fullscreen"
                btn={this.props.card}
                initsql={this.state.initsql}
                customScripts={verify.cbScripts}
                usefulfields={this.state.usefulfields}
                systemScripts={this.state.systemScripts}
                scriptsChange={this.cbScriptsChange}
                wrappedComponentRef={(inst) => this.cbscriptsFullForm = inst}
              />
            </FullScripts>
            <CallBackCustomScript
              btn={this.props.card}
              initsql={this.state.initsql}
src/utils/option.js
@@ -242,6 +242,13 @@
  class5: [{
    value: 'between',
    text: 'between'
  }],
  class6: [{
    value: 'between',
    text: 'between'
  }, {
    value: '=',
    text: '='
  }]
}
src/utils/utils-custom.js
@@ -984,7 +984,11 @@
      if (item.type === 'date') {
        value = '1949-10-01 00:00:00.000'
      } else if (item.type === 'datemonth') {
        value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000'
        if (item.match === '=') {
          value = '1949-10'
        } else {
          value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000'
        }
      } else if (item.type === 'dateweek') {
        value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000'
      } else if (item.type === 'daterange') {
@@ -1036,9 +1040,16 @@
      searchText.push(`('${item.value}' ${item.match} '%'+${item.key}+'%')`)
    } else if (item.type === 'date') {
      searchText.push('(' + item.key + ' ' + item.match + ' \'' + item.value + '\')')
    } else if (item.type === 'datemonth' || item.type === 'dateweek' || item.type === 'range') {
    } else if (item.type === 'dateweek' || item.type === 'range') {
      let val = item.value.split(',')
      searchText.push('(' + item.key + ' >= \'' + val[0] + '\' AND ' + item.key + ' < \'' + val[1] + '\')')
    } else if (item.type === 'datemonth') {
      if (item.match === '=') {
        searchText.push('(' + item.key + ' = \'' + item.value + '\')')
      } else {
        let val = item.value.split(',')
        searchText.push('(' + item.key + ' >= \'' + val[0] + '\' AND ' + item.key + ' < \'' + val[1] + '\')')
      }
    } else if (item.type === 'daterange') {
      let val = item.value.split(',')
@@ -1081,7 +1092,8 @@
          value: `'${item.value}'`
        })
      }
    } else if (['dateweek', 'datemonth', 'range'].includes(item.type)) {
    } else if (['dateweek', 'range'].includes(item.type)) {
      let val = item.value.split(',')
      options.push({
        reg: new RegExp('@' + item.key + '@', 'ig'),
@@ -1090,6 +1102,22 @@
        reg: new RegExp('@' + item.key + '1@', 'ig'),
        value: `'${val[1]}'`
      })
    } else if (item.type === 'datemonth') {
      if (item.match === '=') {
        options.push({
          reg: new RegExp('@' + item.key + '@', 'ig'),
          value: `'${item.value}'`
        })
      } else {
        let val = item.value.split(',')
        options.push({
          reg: new RegExp('@' + item.key + '@', 'ig'),
          value: `'${val[0]}'`
        }, {
          reg: new RegExp('@' + item.key + '1@', 'ig'),
          value: `'${val[1]}'`
        })
      }
    } else if (item.type === 'daterange') {
      let val = item.value.split(',')
      let _skey = item.key
src/utils/utils.js
@@ -469,17 +469,21 @@
          newsearches[item.key] = _val
        }
      } else if (item.type === 'datemonth') {
        // 月-过滤条件,从月开始至结束
        let _startval = ''
        let _endval = ''
        if (item.value) {
          _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000'
          _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
        if (item.match === '=') {
          newsearches[item.key] = item.value
        } else {
          // 月-过滤条件,从月开始至结束
          let _startval = ''
          let _endval = ''
          if (item.value) {
            _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000'
            _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
          }
          newsearches[item.key] = _startval
          newsearches[item.key + '1'] = _endval
        }
        newsearches[item.key] = _startval
        newsearches[item.key + '1'] = _endval
      } else if (item.type === 'dateweek') {
        let _startval = ''
        let _endval = ''
@@ -583,10 +587,14 @@
        searchText.push('(' + item.key + ' ' + _match + ' \'' + _val + timetail + '\')')
      } else if (item.type === 'datemonth') { // 月-过滤条件,从月开始至结束,结束时间为月末加一天的0点,方式为<
        let _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000'
        let _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
        searchText.push('(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')')
        if (item.match === '=') {
          searchText.push('(' + item.key + ' = \'' + item.value + '\')')
        } else {
          let _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000'
          let _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
          searchText.push('(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')')
        }
      } else if (item.type === 'dateweek') { // 周-过滤条件
        let _startval = moment(item.value, 'YYYY-MM-DD' ).startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000'
        let _endval = moment(item.value, 'YYYY-MM-DD').endOf('week').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000'
@@ -679,17 +687,21 @@
        options.push(item)
      } else if (item.type === 'datemonth') {
        let _startval = item.value ? moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000'
        let _endval = item.value ? moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000'
        let copy = JSON.parse(JSON.stringify(item))
        copy.key = copy.key + '1'
        copy.value = _endval
        item.value = _startval
        options.push(item)
        options.push(copy)
        if (item.match === '=') {
          options.push(item)
        } else {
          let _startval = item.value ? moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000'
          let _endval = item.value ? moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000'
          let copy = JSON.parse(JSON.stringify(item))
          copy.key = copy.key + '1'
          copy.value = _endval
          item.value = _startval
          options.push(item)
          options.push(copy)
        }
      } else if (item.type === 'dateweek') {
        let _startval = item.value ? moment(item.value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000'
        let _endval = item.value ? moment(item.value, 'YYYY-MM-DD').endOf('week').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000'