king
2023-11-06 2388f6ea547f53b20a4b9b64efc8aa6dc33e013b
2023-11-06
10个文件已修改
204 ■■■■ 已修改文件
src/menu/components/share/actioncomponent/actionform/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/formconfig.jsx 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/columns/tableIn/index.jsx 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/double-data-card/index.jsx 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/base-table/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/index.jsx 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/share/actioncomponent/actionform/index.jsx
@@ -874,7 +874,7 @@
            getPopupContainer={() => document.getElementById('winter')}
          >
            {item.options.map((option, index) =>
              <Select.Option key={index} title={option.text || option.label} value={(option.value || option.field)}>
              <Select.Option key={index} title={option.text || option.label} disabled={option.$disabled || false} value={(option.value || option.field)}>
                {(option.text || option.label)}
              </Select.Option>
            )}
src/menu/components/share/actioncomponent/formconfig.jsx
@@ -7,7 +7,6 @@
 * @param {*} functip        生成存储过程提示
 * @param {*} setting        组件配置
 * @param {*} usefulFields   存储过程可用的开始字段
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side) {
  let appType = sessionStorage.getItem('appType')
@@ -17,6 +16,7 @@
  let appMenus = []
  let menulist = []
  let type = ''
  let alltype = config.type + '_' + config.subtype
  if (card.eleType === 'button') {
    type = 'card'
@@ -610,10 +610,15 @@
        text: '不刷新'
      }, {
        value: 'line',
        text: '刷新行'
        text: '刷新行',
        $disabled: !['table_normaltable', 'table_editable', 'table_basetable', 'card_datacard', 'card_dualdatacard'].includes(alltype)
      }, {
        value: 'grid',
        text: '刷新当前组件'
      }, {
        value: 'line_grid',
        text: '刷新行 / 组件',
        $disabled: !['table_normaltable', 'table_editable', 'table_basetable', 'card_datacard', 'card_dualdatacard'].includes(alltype)
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
@@ -633,10 +638,15 @@
        text: '不刷新'
      }, {
        value: 'line',
        text: '刷新行'
        text: '刷新行',
        $disabled: !['table_normaltable', 'table_editable', 'table_basetable', 'card_datacard', 'card_dualdatacard'].includes(alltype)
      }, {
        value: 'grid',
        text: '刷新当前组件'
      }, {
        value: 'line_grid',
        text: '刷新行 / 组件',
        $disabled: !['table_normaltable', 'table_editable', 'table_basetable', 'card_datacard', 'card_dualdatacard'].includes(alltype)
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
@@ -712,9 +722,6 @@
      required: false,
      forbid: (type !== 'datacard' || appType !== 'mob'),
      options: [{
      //   value: 'false',
      //   text: '否'
      // }, {
        value: 'left',
        text: '左滑'
      }, {
@@ -1725,6 +1732,9 @@
        value: 'grid',
        text: '刷新当前组件'
      }, {
        value: 'line_grid',
        text: '刷新行 / 组件',
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
      }, 
@@ -1747,6 +1757,9 @@
        value: 'grid',
        text: '刷新当前组件'
      }, {
        value: 'line_grid',
        text: '刷新行 / 组件',
      }, {
        value: 'mainline',
        text: '刷新上级组件 - 行'
      },
src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx
@@ -88,6 +88,11 @@
    })
  })
  editCols.push({
    field: '$next_' + card.uuid,
    label: card.label + '(下一行)'
  })
  return [
    {
      type: 'text',
src/menu/components/table/edit-table/columns/tableIn/index.jsx
@@ -1,7 +1,7 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { fromJS } from 'immutable'
import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, Cascader, Tooltip, InputNumber, Radio, Typography } from 'antd'
import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, Select, Cascader, Tooltip, InputNumber, Radio, Typography } from 'antd'
import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined, QuestionCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
@@ -498,6 +498,7 @@
  }
  render() {
    const { config } = this.props
    const { verify, scriptsColumns, uniqueColumns, activeKey, fields, modules } = this.state
    const formItemLayout = {
      labelCol: {
@@ -552,25 +553,34 @@
                  </Form.Item>
                </Col> : null}
                <Col span={8}>
                  <Form.Item label={'成功后'}>
                    <Radio.Group style={{whiteSpace: 'nowrap'}} value={verify.execSuccess} onChange={(e) => this.onOptionChange(e.target.value, 'execSuccess')}>
                      <Radio value="never">不刷新</Radio>
                      <Radio value="grid">刷新表格</Radio>
                      <Radio value="mainline">上级(行)</Radio>
                    </Radio.Group>
                  <Form.Item label={
                    <Tooltip placement="topLeft" title="《刷新行》与《刷新行 / 组件》只在数据提交为 修改项 时有效。">
                      <QuestionCircleOutlined className="mk-form-tip" />
                      成功后
                    </Tooltip>
                  }>
                    <Select value={verify.execSuccess} onChange={(val) => this.onOptionChange(val, 'execSuccess')}>
                      <Select.Option value="never">不刷新</Select.Option>
                      <Select.Option value="line" disabled={config.wrap.commit !== 'change'}>刷新行</Select.Option>
                      <Select.Option value="grid">刷新组件</Select.Option>
                      <Select.Option value="line_grid" disabled={config.wrap.commit !== 'change'}>刷新行 / 组件</Select.Option>
                      <Select.Option value="mainline">上级(行)</Select.Option>
                    </Select>
                  </Form.Item>
                </Col>
                <Col span={8}>
                  <Form.Item label={'失败后'}>
                    <Radio.Group style={{whiteSpace: 'nowrap'}} value={verify.execError} onChange={(e) => this.onOptionChange(e.target.value, 'execError')}>
                      <Radio value="never">不刷新</Radio>
                      <Radio value="grid">刷新表格</Radio>
                      <Radio value="mainline">上级(行)</Radio>
                    </Radio.Group>
                  <Form.Item label="失败后">
                    <Select value={verify.execError} onChange={(val) => this.onOptionChange(val, 'execError')}>
                      <Select.Option value="never">不刷新</Select.Option>
                      <Select.Option value="line" disabled={config.wrap.commit !== 'change'}>刷新行</Select.Option>
                      <Select.Option value="grid">刷新组件</Select.Option>
                      <Select.Option value="line_grid" disabled={config.wrap.commit !== 'change'}>刷新行 / 组件</Select.Option>
                      <Select.Option value="mainline">上级(行)</Select.Option>
                    </Select>
                  </Form.Item>
                </Col>
                {isPop ? <Col span={8}>
                  <Form.Item label={'成功后'}>
                  <Form.Item label="成功后">
                    <Radio.Group style={{whiteSpace: 'nowrap'}} value={verify.closetab || 'false'} onChange={(e) => this.onOptionChange(e.target.value, 'closetab')}>
                      <Radio value="false">标签不关闭</Radio>
                      <Radio value="true">标签关闭</Radio>
src/tabviews/custom/components/card/data-card/index.jsx
@@ -398,9 +398,9 @@
          }, i * 10)
        })
      } else {
        if (position === 'line') {
        if (position === 'line' || position === 'line_grid') {
          if (lines && lines.length === 1) {
            this.loadLinedata(lines[0].$$uuid)
            this.loadLinedata(lines[0].$$uuid, position)
          } else {
            this.loadData(id)
          }
@@ -417,9 +417,9 @@
    } else {
      let supModule = config.setting.supModule
      if (position === 'line') {
      if (position === 'line' || position === 'line_grid') {
        if (lines && lines.length === 1) {
          this.loadLinedata(lines[0].$$uuid)
          this.loadLinedata(lines[0].$$uuid, position)
        } else {
          this.loadData(id)
        }
@@ -870,7 +870,7 @@
  /**
   * @description 获取单行数据
   */ 
  async loadLinedata (id) {
  async loadLinedata (id, position) {
    const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
    if (config.forbidLine) {
@@ -902,6 +902,11 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadData()
        return
      }
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
      let selectKeys = fromJS(this.state.selectKeys).toJS()
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -336,9 +336,9 @@
    let supModule = config.setting.supModule
    if (position === 'line') {
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1) {
        this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid)
        this.loadLinedata(lines[0].$$parentId || lines[0].$$uuid, position)
      } else {
        this.loadData(id)
      }
@@ -771,7 +771,7 @@
  /**
   * @description 获取单行数据
   */ 
  async loadLinedata (id) {
  async loadLinedata (id, position) {
    const { config, pageIndex, pageSize, search, BID, BData, orderBy } = this.state
    if (config.forbidLine) {
@@ -803,6 +803,11 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadData()
        return
      }
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
      let selectKeys = fromJS(this.state.selectKeys).toJS()
src/tabviews/custom/components/table/base-table/index.jsx
@@ -261,7 +261,7 @@
  /**
   * @description 获取单行数据
   */ 
  async loadmainLinedata (id) {
  async loadLinedata (id, position) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
@@ -289,6 +289,11 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadmaindata(true, 'false')
        return
      }
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
@@ -547,7 +552,7 @@
    if (!id) {
      this.reloadtable()
    } else {
      this.loadmainLinedata(id)
      this.loadLinedata(id)
    }
  }
@@ -578,9 +583,9 @@
    if (config.uuid !== menuId) return
    if (position === 'line') {
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1) {
        this.loadmainLinedata(lines[0].$$uuid)
        this.loadLinedata(lines[0].$$uuid, position)
      } else {
        this.reloadtable(btn, id)
      }
src/tabviews/custom/components/table/edit-table/index.jsx
@@ -388,7 +388,7 @@
  /**
   * @description 获取单行数据
   */ 
  async loadmainLinedata (id) {
  async loadLinedata (id, position) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
@@ -416,11 +416,25 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadmaindata(true, 'false')
        return
      }
      if (!result.data || !result.data[0]) {
        let data = fromJS(this.state.data).toJS()
        let selectedData = fromJS(this.state.selectedData).toJS()
        data = data.filter(item => item.$$uuid !== id)
        selectedData = selectedData.filter(item => item.$$uuid !== id)
        MKEmitter.emit('transferData' + setting.tableId, id, 'delete')
        this.setState({
          data,
          selectedData,
          loading: false
        })
        return
      }
@@ -560,7 +574,7 @@
    if (!id) {
      this.reloadtable()
    } else {
      this.loadmainLinedata(id)
      this.loadLinedata(id)
    }
  }
@@ -592,9 +606,9 @@
    if (config.uuid !== menuId) return
    if (position === 'line') {
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1) {
        this.loadmainLinedata(lines[0].$$uuid)
        this.loadLinedata(lines[0].$$uuid, position)
      } else {
        this.reloadtable(btn)
      }
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -1345,6 +1345,7 @@
  timer = null
  focusId = ''
  blurId = ''
  colId = ''
  UNSAFE_componentWillMount () {
    const { setting, fields, columns, BID, colsCtrls } = this.props
@@ -1562,8 +1563,9 @@
    }, 150)
  }
  colFocus = (lineId) => {
  colFocus = (lineId, colId) => {
    this.focusId = lineId
    this.colId = colId
  }
  checkLine = () => {
@@ -1705,9 +1707,11 @@
  }
  transferData = (data, type) => {
    const { edData } = this.state
    const { edData, tableId } = this.state
    if (type === 'line') {
    if (type === 'delete') {
    } else if (type === 'line') {
      let value = ''
      Object.keys(data).sort().forEach(key => {
        if (/^\$/.test(key)) return
@@ -1725,14 +1729,18 @@
      })
    }
    if (type !== 'line') {
      let index = edData.findIndex(item => !item.$origin && !item.$forbid)
    if (type === 'delete') {
      let _edData = this.state.edData.filter(item => item.$$uuid !== data)
      if (index > -1) {
        this.setState({visible: true, midData: data})
      } else {
        this.updateMutil(data)
      }
      this.setState({edData: _edData, reseting: true}, () => {
        this.setState({reseting: false})
        if (this.focusId) {
          setTimeout(() => {
            MKEmitter.emit('setFocus' + tableId, this.focusId, this.colId)
          }, 10)
        }
      })
    } else if (type === 'line') {
      let _edData = this.state.edData.map(item => {
        if (item.$$uuid === data.$$uuid) {
@@ -1744,7 +1752,21 @@
      this.setState({edData: _edData, reseting: true}, () => {
        this.setState({reseting: false})
        if (this.focusId) {
          setTimeout(() => {
            MKEmitter.emit('setFocus' + tableId, this.focusId, this.colId)
          }, 10)
        }
      })
    } else {
      let index = edData.findIndex(item => !item.$origin && !item.$forbid)
      if (index > -1) {
        this.setState({visible: true, midData: data})
      } else {
        this.updateMutil(data)
      }
    }
  }
@@ -2298,9 +2320,9 @@
      Api.genericInterface(param).then((res) => {
        if (res.status) {
          this.execSuccess(res)
          this.execSuccess(res, record)
        } else {
          this.execError(res)
          this.execError(res, record)
        }
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') return
@@ -2317,9 +2339,9 @@
      Api.genericInterface(param).then((res) => {
        if (res.status) {
          this.execSuccess(res)
          this.execSuccess(res, record)
        } else {
          this.execError(res)
          this.execError(res, record)
        }
      }, (error) => {
        if (error && error.ErrCode === 'LoginError') return
@@ -2329,7 +2351,7 @@
    }
  }
  execSuccess = (res) => {
  execSuccess = (res, record) => {
    const { submit } = this.props
    const { edData } = this.state
@@ -2379,13 +2401,13 @@
    }
    if (submit.execSuccess !== 'never') {
      MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execSuccess, submit)
      MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execSuccess, submit, '', record ? [record] : null)
    }
    submit.syncComponentId && MKEmitter.emit('reloadData', submit.syncComponentId)
  }
  execError = (res) => {
  execError = (res, record) => {
    const { submit } = this.props
    if (res.ErrCode === 'E') {
@@ -2414,7 +2436,7 @@
    })
    if (submit.execError !== 'never') {
      MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execError, submit)
      MKEmitter.emit('refreshByButtonResult', submit.$menuId, submit.execError, submit, '', record ? [record] : null)
    }
  }
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -539,7 +539,7 @@
  /**
   * @description 获取单行数据
   */ 
  async loadmainLinedata (id) {
  async loadLinedata (id, position) {
    const { setting, config, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    if (config.forbidLine) {
@@ -567,6 +567,11 @@
    let result = await Api.genericInterface(param)
    if (result.status) {
      if (position === 'line_grid' && (!result.data || !result.data[0])) {
        this.loadmaindata(true, 'false')
        return
      }
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
@@ -743,7 +748,7 @@
    if (!id) {
      this.reloadtable()
    } else {
      this.loadmainLinedata(id)
      this.loadLinedata(id)
    }
  }
@@ -774,9 +779,9 @@
    if (config.uuid !== menuId) return
    if (position === 'line') {
    if (position === 'line' || position === 'line_grid') {
      if (lines && lines.length === 1) {
        this.loadmainLinedata(lines[0].$$uuid)
        this.loadLinedata(lines[0].$$uuid, position)
      } else {
        this.reloadtable(btn, id)
      }