king
2025-05-21 b3e3c463d176a1ec9ab16adea08bcbe6536ec52a
src/tabviews/zshare/actionList/funcMegvii/index.jsx
@@ -108,58 +108,55 @@
  /**
   * @description 触发按钮操作
   */
  actionTrigger = (triggerId, record, type) => {
    const { BID, btn, selectedData, setting } = this.props
  actionTrigger = (triggerId, record, type, lid) => {
    const { BID, btn, selectedData, setting, LID } = this.props
    const { loading, disabled } = this.state
    if (loading || disabled) return
    if (triggerId && btn.uuid !== triggerId) return
    if (type === 'linkbtn' && !btn.$toolbtn && LID !== lid) return
    let data = record || selectedData || []
    // let data = fromJS(mockdata.data).toJS()
    if (setting.supModule && !BID) {
      notification.warning({
        top: 92,
        message: '需要上级主键值!',
        message: setting.supModTip || '需要上级主键值!',
        duration: 5
      })
      return
    } else if (type === 'linkbtn' && !btn.$toolbtn && !is(fromJS(selectedData || []), fromJS(record))) {
      return
    }
    let data = record || selectedData || []
    // let data = fromJS(mockdata.data).toJS()
    if (data.length === 0) {
    } else if (data.length === 0) {
      // 需要选择行时,校验数据
      notification.warning({
        top: 92,
        message: '请选择行!',
        duration: 5
      })
      return
    } else {
      this.setState({
        loading: true,
        lines: data
      })
      this.getIpList()
    }
    this.setState({
      loading: true,
      lines: data
    })
    this.getIpList()
  }
  getIpList = () => {
    let _scriptSql = `select ID,data_code,data_name,Remark,face_ip,face_uname,face_pwd from bd_data where typecharone='face_device'  and deleted=0`
    _scriptSql = Utils.formatOptions(_scriptSql)
    let _sParam = {
      func: 'sPC_Get_SelectedList',
      LText: _scriptSql,
      obj_name: 'data',
      arr_field: 'ID,data_code,data_name,Remark,face_ip,face_uname,face_pwd'
    }
    if (window.GLOB.execType === 'x') {
      _sParam.exec_type = 'x'
    }
    
    _sParam.LText = Utils.formatOptions(_scriptSql, _sParam.exec_type)
    _sParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp)
    _sParam.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : _sParam.LText, _sParam.timestamp)
    
    NApi.getSystemCacheConfig(_sParam).then(res => {
      if (res.status) {
@@ -512,43 +509,26 @@
    if (hidden) return null
    let label = ''
    let icon = ''
    let type = 'link'
    let className = ''
    if (btn.show === 'button') {
      label = btn.label
      icon = btn.icon || ''
    } else if (btn.show === 'link') {
      label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span>
      icon = ''
    if (btn.show === 'link') {
      label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon} /> : ''}</span>
    } else if (btn.show === 'icon') {
      icon = btn.icon || ''
    } else if (!btn.$toolbtn) {
      icon = btn.icon || ''
      label = btn.label
      className = 'mk-btn mk-' + btn.class
      label = !loading ? <MkIcon type={btn.icon} /> : null
    } else if (btn.$toolbtn) {
      label = <span>{!loading && btn.icon ? <MkIcon style={{marginRight: '8px'}} type={btn.icon} /> : ''}{loadingNumber && !loadingTotal ? `(${loadingNumber})` : ''}{btn.label}</span>
    } else {
      type = ''
      icon = btn.icon || ''
      label = btn.label
      className = 'mk-btn mk-' + btn.class
    }
    if (loadingNumber && !loadingTotal && btn.$toolbtn && (!btn.show || btn.show === 'button')) {
      label = (loadingNumber && !loadingTotal ? `(${loadingNumber})` : '') + btn.label
      label = <span>{!loading && btn.icon ? <MkIcon style={{marginRight: '8px'}} type={btn.icon} /> : ''}{btn.label}</span>
    }
    return (
      <>
        <Button
          type={type}
          type="link"
          title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')}
          loading={loading}
          disabled={disabled}
          style={btn.style}
          icon={icon}
          className={className}
          className={btn.hover || ''}
          onClick={(e) => {e.stopPropagation(); this.actionTrigger()}}
        >{label}</Button>
        {this.getModels()}