king
2021-09-01 31ec63f0419895876cbaba99637a884a32d33d0d
src/tabviews/zshare/cardcomponent/index.jsx
@@ -22,7 +22,6 @@
    type: PropTypes.any,              // 卡片类型,添加按钮为 insert
    BID: PropTypes.any,               // 主表ID
    BData: PropTypes.any,             // 主表数据
    MenuName: PropTypes.any,          // 菜单名称
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    MenuID: PropTypes.string,         // 菜单ID
    setting: PropTypes.object,        // 页面设定
@@ -31,7 +30,6 @@
    data: PropTypes.object,           // 卡片数据
    selectKey: PropTypes.string,      // 选择卡片的序号
    colMap: PropTypes.any,            // 显示列信息,用于设置标记
    refreshdata: PropTypes.func,      // 按钮操作后数据刷新
    switchCard: PropTypes.func        // 卡片切换
  }
@@ -130,41 +128,38 @@
   * @description 获取按钮元素
   */
  getActionList = (actions, show) => {
    const { BID, BData, Tab, setting, columns, ContainerId, data, MenuID, MenuName } = this.props
    const { BData, Tab, setting, columns, ContainerId, data, MenuID } = this.props
    
    return actions.map(item => {
      if (['exec', 'prompt', 'pop'].includes(item.OpenType)) {
        return (
          <NormalButton
            key={item.uuid}
            BID={BID}
            BID={data.$$BID}
            Tab={Tab}
            btn={item}
            show={show}
            BData={BData}
            setting={setting}
            columns={columns}
            MenuName={MenuName}
            selectedData={[data]}
            ContainerId={ContainerId}
            updateStatus={this.props.refreshdata}
          />
        )
      } else if (item.OpenType === 'popview') {
        return (
          <PopupButton
            key={item.uuid}
            BID={BID}
            BID={data.$$BID}
            Tab={Tab}
            btn={item}
            show={show}
            BData={BData}
            setting={setting}
            selectedData={[data]}
            updateStatus={this.props.refreshdata}
          />
        )
      } else if (item.OpenType === 'tab' || item.OpenType === 'blank') {
      } else if (item.OpenType === 'tab') {
        return (
          <TabButton
            key={item.uuid}
@@ -173,7 +168,6 @@
            MenuID={MenuID}
            setting={setting}
            selectedData={[data]}
            updateStatus={this.props.refreshdata}
          />
        )
      } else if (item.OpenType === 'innerpage' || item.OpenType === 'outerpage') {
@@ -184,27 +178,25 @@
            show={show}
            setting={setting}
            selectedData={[data]}
            updateStatus={this.props.refreshdata}
          />
        )
      } else if (item.OpenType === 'funcbutton') {
        if (item.funcType === 'changeuser') {
        if (item.funcType === 'changeuser' || item.funcType === 'closetab') {
          return (
            <ChangeUserButton
              key={item.uuid}
              BID={BID}
              BID={data.$$BID}
              btn={item}
              show={show}
              setting={setting}
              selectedData={[data]}
              updateStatus={this.props.refreshdata}
            />
          )
        } else if (item.funcType === 'print') {
          return (
            <PrintButton
              key={item.uuid}
              BID={BID}
              BID={data.$$BID}
              Tab={Tab}
              btn={item}
              show={show}
@@ -212,7 +204,6 @@
              setting={setting}
              selectedData={[data]}
              ContainerId={ContainerId}
              updateStatus={this.props.refreshdata}
            />
          )
        }
@@ -253,7 +244,7 @@
          if (isNaN(originVal) || isNaN(contrastVal)) {
            originVal = ''
          }
        } catch {
        } catch (e) {
          originVal = ''
        }
      }
@@ -340,7 +331,7 @@
          if (isNaN(content)) {
            content = ''
          }
        } catch {
        } catch (e) {
          content = ''
        }
      }
@@ -498,11 +489,9 @@
              show={'plus' + plusSize}
              BData={this.props.BData}
              setting={this.props.setting}
              MenuName={this.props.MenuName}
              columns={this.props.columns}
              selectedData={[]}
              ContainerId={this.props.ContainerId}
              updateStatus={this.props.refreshdata}
            />
          </div>
        </Card> : null}
@@ -517,7 +506,6 @@
    BData: PropTypes.any,             // 主表数据
    Tab: PropTypes.any,               // 如果当前元素为标签时,tab为标签信息
    MenuID: PropTypes.string,         // 菜单ID
    MenuName: PropTypes.any,          // 菜单名称
    config: PropTypes.object,         // 页面配置信息
    columns: PropTypes.array,         // 显示列
    ContainerId: PropTypes.any,       // tab页面ID,用于弹窗控制
@@ -525,8 +513,6 @@
    tableId: PropTypes.string,
    loading: PropTypes.bool,
    data: PropTypes.array,
    refreshdata: PropTypes.func,
    getexceloutparam: PropTypes.func,
    handleTableId: PropTypes.func
  }
@@ -752,17 +738,8 @@
    this.props.handleTableId(this.props.tableId, _id, data)
  }
  /**
   * @description 操作完成后,数据刷新
   */
  updateStatus = (type, positon, btn) => {
    if (type === 'refresh') {
      this.props.refreshdata(positon, btn)
    }
  }
  render() {
    const { plot, data, loading, BID, BData, Tab, MenuID, config, columns, ContainerId, MenuName } = this.props
    const { plot, data, loading, BID, BData, Tab, MenuID, config, columns, ContainerId } = this.props
    const { card, colMap, selectKey, actionList } = this.state
    
    return (
@@ -783,11 +760,9 @@
                    key={action.uuid}
                    BID={BID}
                    Tab={Tab}
                    btn={action}
                    show="icon"
                    MenuName={MenuName}
                    btn={action}
                    setting={config.setting}
                    updateStatus={this.updateStatus}
                  />
                )
              } else {
@@ -796,12 +771,9 @@
                    key={action.uuid}
                    BID={BID}
                    Tab={Tab}
                    btn={action}
                    show="icon"
                    MenuName={MenuName}
                    btn={action}
                    setting={config.setting}
                    getexceloutparam={this.props.getexceloutparam}
                    updateStatus={this.updateStatus}
                  />
                )
              }
@@ -821,12 +793,10 @@
              MenuID={MenuID}
              colMap={colMap}
              columns={columns}
              MenuName={MenuName}
              selectKey={selectKey}
              setting={config.setting}
              ContainerId={ContainerId}
              switchCard={this.switchCard}
              refreshdata={this.updateStatus}
            />
          ))
        }
@@ -840,11 +810,9 @@
            data={{key: 'insert'}}
            BData={BData}
            MenuID={MenuID}
            MenuName={MenuName}
            setting={config.setting}
            ContainerId={ContainerId}
            switchCard={() => {}}
            refreshdata={this.updateStatus}
          /> : null
        }
        {(loading || !card.insertAction) && (!data || data.length === 0) ? <Empty description={false}/> : null}