king
2023-07-10 bd6521dcc02d1b224016c4df9e36388668989d0c
2023-07-10
12个文件已修改
278 ■■■■■ 已修改文件
src/menu/components/form/formaction/formconfig.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/calendar/board/index.jsx 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/calendar/board/index.scss 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/calendar/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/simple-form/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/step-form/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/form/tab-form/index.jsx 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/popview/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/popupbutton/index.scss 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/form/formaction/formconfig.jsx
@@ -6,6 +6,7 @@
export function getActionForm (card, functip, tableName, usefulFields, modules, anchors) {
  const appType = sessionStorage.getItem('appType')
  let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview
  let _type = '提交'
  if (card.type === 'prev') {
    _type = '上一步'
@@ -40,6 +41,18 @@
    } else {
      menulist = []
    }
  }
  let refresh = []
  if (!appType && viewType === 'popview') { // 弹窗标签
    refresh.push({
      value: 'closepoptab', // 关闭弹窗标签
      text: '关闭弹窗'
    })
    refresh.push({
      value: 'popclose',  // 执行弹窗关闭时的刷新
      text: '刷新源组件'
    })
  }
  return [
@@ -310,7 +323,7 @@
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
      }]
      }, ...refresh]
    },
    {
      type: (appType === 'pc' || appType === 'mob') ? 'select' : 'cascader',
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -388,6 +388,8 @@
        shows.push('placement')
      } else if (this.record.display === 'drawer') {
        shows.push('placement')
      } else if (this.record.display === 'modal') {
        shows.push('popshow')
      }
      if (this.record.popClose === 'grid') {
        shows.push('resetPageIndex')
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -961,6 +961,21 @@
    },
    {
      type: 'radio',
      key: 'popshow',
      label: '弹窗展示',
      initVal: card.popshow || 'default',
      tooltip: '小窗口展示将隐藏标题及底部按钮。',
      required: false,
      options: [{
        value: 'default',
        text: '默认'
      }, {
        value: 'miniview',
        text: '小窗口'
      }]
    },
    {
      type: 'radio',
      key: 'maskStyle',
      label: '蒙层样式',
      initVal: card.maskStyle || 'default',
@@ -1939,6 +1954,21 @@
      }]
    },
    {
      type: 'radio',
      key: 'popshow',
      label: '弹窗展示',
      initVal: card.popshow || 'default',
      tooltip: '小窗口展示将隐藏标题及底部按钮。',
      required: false,
      options: [{
        value: 'default',
        text: '默认'
      }, {
        value: 'miniview',
        text: '小窗口'
      }]
    },
    {
      type: 'text',
      key: 'preFunc',
      label: '前置函数',
src/tabviews/custom/components/calendar/board/index.jsx
@@ -1,10 +1,11 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Select, Radio, Row, Col } from 'antd'
import { Select, Radio, Row, Col, Popover, Badge } from 'antd'
import moment from 'moment'
import 'moment/locale/zh-cn'
import MKEmitter from '@/utils/events.js'
import './index.scss'
const { Option } = Select
@@ -429,6 +430,8 @@
    let monthlist = datelist.filter(item => item.month === selectMonth)[0].children.filter(cell => !cell.children[0].$disable || !cell.children[6].$disable)
    this.setState({ selectYear: value, datelist, monthlist })
    this.props.yearChange(value)
  }
  monthChange = (value) => {
@@ -445,12 +448,86 @@
    })
  }
  triggerDay = (d) => {
    const { config } = this.props
    if (!config.setting.linkbtn) return
    let id = d.time + ''
    id = id.substr(0, 4) + '-' + id.substr(4, 2) + '-' + id.substr(6)
    MKEmitter.emit('triggerBtnId', config.setting.linkbtn, [{$$uuid: id}])
  }
  openView = (data, e) => {
    const { config } = this.props
    if (!config.wrap.click) return
    e && e.stopPropagation()
    if (config.wrap.click === 'menus') {
      let menu = null
      if (config.wrap.menus && config.wrap.menus.length > 0) {
        let s = data[config.wrap.menuType] + ''
        config.wrap.menus.forEach(m => {
          if (s !== m.sign) return
          menu = m
        })
      }
      if (!menu) return
      let newtab = {
        MenuID: menu.MenuID,
        MenuName: menu.MenuName,
        MenuNo: menu.MenuNo || '',
        type: menu.tabType,
        param: {$BID: data.$$uuid || ''}
      }
      Object.keys(data).forEach(key => {
        if (/^\$/.test(key)) return
        newtab.param[key] = data[key]
      })
      MKEmitter.emit('modifyTabs', newtab, true)
    } else if (config.wrap.click === 'menu') {
      let menuId = config.wrap.MenuID || config.wrap.menu.slice(-1)[0]
      let menu = window.GLOB.mkThdMenus.filter(m => m.MenuID === menuId)[0]
      if (!menu && config.wrap.MenuName && config.wrap.tabType) {
        menu = {
          MenuID: menuId,
          MenuName: config.wrap.MenuName,
          MenuNo: config.wrap.MenuNo || '',
          type: config.wrap.tabType
        }
      }
      if (!menu) return
      let newtab = {
        ...menu,
        param: {$BID: data.$$uuid || ''}
      }
      Object.keys(data).forEach(key => {
        if (/^\$/.test(key)) return
        newtab.param[key] = data[key]
      })
      MKEmitter.emit('modifyTabs', newtab, true)
    }
  }
  render() {
    const { config } = this.props
    const { level, selectYear, selectMonth, yearlist, levels, datelist, monthlist } = this.state
    const _levelName = {day: '日', month: '月', year: '年'}
    return (
      <div className="mk-calendar">
      <div className={'mk-calendar' + (config.setting.linkbtn ? ' open-pop' : '') + (config.wrap.click ? ' open-menu' : '')}>
        <div className="mk-calendar-control">
          <Select value={selectYear} onChange={this.yearChange}>
            {yearlist.map(item => (<Option key={item} value={item}>{item}年</Option>))}
@@ -491,8 +568,23 @@
                      <tr key={m}>
                        {cell.children.map((d, i) => (
                          <td key={i}>
                            <div style={d.style} className={'day-wrap' + (d.$disable ? ' disabled' : '')}>
                              {d.label}
                            <div style={d.style} className={'day-wrap' + (d.$disable ? ' disabled' : '')} onClick={() => !d.$disable && this.triggerDay(d)}>
                              {d.subData.length > 0 ? <Popover mouseEnterDelay={0.3} overlayClassName={'calendar-day-pop' + (config.wrap.click ? ' open-menu' : '')} content={
                                <div onClick={(e) => e.stopPropagation()}>
                                  {d.subData.map((data, index) => (
                                    <div key={index} className="message" onClick={() => this.openView(data)}>
                                      <Badge color={data.$color} text={
                                        <span>
                                          {data.$message}
                                          <span style={{color: 'rgba(0,0,0,.45)'}}>({data.$startTime + ' ~ ' + data.$endTime})</span>
                                        </span>}
                                      />
                                    </div>
                                  ))}
                                </div>
                              } trigger="hover">
                                {d.label}
                              </Popover> : d.label}
                            </div>
                          </td>
                        ))}
@@ -515,7 +607,7 @@
                  <tr key={m}>
                    {cell.children.map((d, i) => (
                      <td key={i}>
                        <div className={'month-wrap' + (d.$disable ? ' disabled' : '')}>
                        <div className={'month-wrap' + (d.$disable ? ' disabled' : '')} onClick={() => !d.$disable && this.triggerDay(d)}>
                          <div className="header">
                            <div className="message">
                              {d.label}
@@ -526,7 +618,13 @@
                              <span className="right">{d.jr}</span>
                            </div>
                          </div>
                          <ul className="content"></ul>
                          <ul className="content">
                            {d.subData.map((data, index) => (
                              <li key={index} className="message" onClick={(e) => this.openView(data, e)}>
                                <Badge color={data.$color} text={data.$message} />
                              </li>
                            ))}
                          </ul>
                        </div>
                      </td>
                    ))}
@@ -542,7 +640,13 @@
                  <div className="header">
                    {item.label}
                  </div>
                  <ul className="content"></ul>
                  <ul className="content">
                    {item.subData.map((data, index) => (
                      <li key={index} className="message" onClick={() => this.openView(data)}>
                        <Badge color={data.$color} text={`${data.$message} (${data.$startTime} ~ ${data.$endTime})`}/>
                      </li>
                    ))}
                  </ul>
                </div>
              </Col>
            ))}
src/tabviews/custom/components/calendar/board/index.scss
@@ -111,15 +111,28 @@
                }
                .content {
                  padding: 0 10px 10px;
                  height: 70px;
                  height: 55px;
                  overflow-y: auto;
                  position: absolute;
                  left: 0;
                  right: 0;
                  .message {
                    width: 100%;
                    white-space: nowrap;
                    overflow: hidden;
                    .ant-badge {
                      width: 100%;
                    }
                    .ant-badge-status-text {
                      color: inherit;
                      font-size: 13px;
                      width: calc(100% - 15px);
                      overflow: hidden;
                      word-break: break-word;
                      white-space: nowrap;
                      text-overflow: ellipsis;
                      height: 21px;
                      display: inline-block;
                      vertical-align: top;
                    }
                  } 
                }
@@ -163,7 +176,6 @@
      .year-wrap {
        width: calc(100% - 2px);
        box-shadow: 0px 0px 3px var(--mk-sys-color2);
        cursor: pointer;
        transition: background 0.1s;
        .header {
          text-align: center;
@@ -182,7 +194,20 @@
            width: 100%;
            overflow: hidden;
            margin-bottom: 5px;
            text-overflow: ellipsis;
            .ant-badge {
              width: 100%;
            }
            .ant-badge-status-text {
              font-size: 13px;
              width: calc(100% - 15px);
              overflow: hidden;
              word-break: break-word;
              white-space: nowrap;
              text-overflow: ellipsis;
              height: 21px;
              display: inline-block;
              vertical-align: top;
            }
          } 
        }
        .content::-webkit-scrollbar {
@@ -206,6 +231,28 @@
    }
  }
}
.mk-calendar:not(.open-pop) {
  .day-wrap {
    cursor: default!important;
  }
  .month-wrap {
    cursor: default!important;
  }
}
.mk-calendar.open-menu {
  .month-wrap, .year-wrap {
    .content {
      .message {
        cursor: pointer;
      }
    }
  }
}
.calendar-day-pop.open-menu {
  .message {
    cursor: pointer;
  }
}
.calendar-day-pop {
  .message {
    .ant-badge-status-text {
src/tabviews/custom/components/calendar/index.jsx
@@ -59,6 +59,12 @@
      _config.wrap.colorField = ''
    }
    if (_config.action[0] && _config.action[0].config && _config.action[0].config.enabled) {
      _config.setting.linkbtn = _config.action[0].uuid
    } else {
      _config.action = []
    }
    this.setState({
      BID: BData ? (BData.$BID || '') : '',
      BData: BData,
@@ -301,6 +307,18 @@
    })
  }
  yearChange = (value) => {
    const { config } = this.state
    if (!config.setting.$re_year) return
    this.setState({
      year: value
    }, () => {
      this.loadData()
    })
  }
  render() {
    const { config, loading, data, BID, BData } = this.state
@@ -319,7 +337,7 @@
        {config.action[0] ? 
          <PopupButton disabled={false} BID={BID} btn={config.action[0]} BData={BData} setting={config.setting} selectedData={[]}/> : null
        }
        <CalendarBoard config={config} data={data}/>
        <CalendarBoard config={config} data={data} yearChange={this.yearChange}/>
      </div>
    )
  }
src/tabviews/custom/components/form/simple-form/index.jsx
@@ -158,7 +158,7 @@
    if (group.uuid !== menuId) return
    if (position === 'mainline' && config.setting.supModule && BID) {
    if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) {
      MKEmitter.emit('reloadData', config.setting.supModule, BID)
    } else {
      this.loadData()
@@ -169,6 +169,10 @@
    }
    this.execSuccess(btn, id)
    if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项
      btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
    }
  }
  resetParentParam = (MenuID, id, data) => {
src/tabviews/custom/components/form/step-form/index.jsx
@@ -205,7 +205,7 @@
    if (group.uuid !== menuId) return
    if (position === 'mainline' && config.setting.supModule && BID) {
    if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) {
      MKEmitter.emit('reloadData', config.setting.supModule, BID)
    } else {
      this.loadData()
@@ -216,6 +216,10 @@
    }
    this.execSuccess(btn, id)
    if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项
      btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
    }
  }
  resetParentParam = (MenuID, id, data) => {
src/tabviews/custom/components/form/tab-form/index.jsx
@@ -175,7 +175,7 @@
    if (group.uuid !== menuId) return
    if (position === 'mainline' && config.setting.supModule && BID) {
    if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) {
      MKEmitter.emit('reloadData', config.setting.supModule, BID)
    } else {
      this.loadData()
@@ -186,6 +186,10 @@
    }
    this.execSuccess(btn, id)
    if (position === 'popclose') { // 执行启动弹窗的按钮所选择的刷新项
      btn.$tabId && MKEmitter.emit('refreshPopButton', btn.$tabId)
    }
  }
  resetParentParam = (MenuID, id, data) => {
src/tabviews/custom/popview/index.jsx
@@ -497,6 +497,7 @@
          group.subButton.OpenType = 'formSubmit'
          group.subButton.execError = 'never'
          group.subButton.logLabel = item.$menuname + '-' + group.subButton.label
          group.subButton.$tabId = Tab.uuid
          if (!group.subButton.Ot) {
            group.subButton.Ot = item.wrap.datatype === 'static' ? 'notRequired' : 'requiredSgl'
src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -186,7 +186,7 @@
    if (btn.Ot === 'requiredSgl' && setting.primaryKey) {
      _data = data[0]
      primaryId = _data[setting.primaryKey] || ''
      primaryId = _data.$$uuid || _data[setting.primaryKey] || ''
    }
    this.setState({
@@ -248,7 +248,7 @@
        ratio = ratio + 'vw'
      }
      return <Modal
        wrapClassName={'popview-modal ' + (!btn.$view ? '' : 'custom-popview')}
        wrapClassName={'popview-modal ' + (!btn.$view ? '' : 'custom-popview ') + (btn.popshow || '')}
        title={btn.label}
        width={ratio}
        maskClosable={btn.clickouter === 'close'}
src/tabviews/zshare/actionList/popupbutton/index.scss
@@ -1,5 +1,5 @@
.custom-popview.popview-modal {
  >.ant-modal-content >.ant-modal-body {
  .ant-modal-content .ant-modal-body {
    padding: 0;
    .custom-page-wrap {
      min-height: 200px;
@@ -9,6 +9,19 @@
    }
  }
}
.custom-popview.popview-modal.miniview {
  .ant-modal-header {
    display: none;
  }
  .ant-modal-footer {
    display: none;
  }
  .ant-modal-body {
    padding: 0px;
    border-radius: 4px;
    max-height: calc(100vh - 110px);
  }
}
.table-drawer-popview {
  .close-drawer {
    position: absolute;