element组件row-class-name属性

Table 组件的 row-class-name 属性来为 Table 中的某一行添加 class,表明该行处于某种状态。

 例:距离有效期30天显示黄色,超过有效期显示红色(table中的表格)

二、使用步骤

1.表明属性

代码如下(示例):

 <el-table
        :data="tableData"
        height="calc(100vh - 300px)"
        :border="true"
        :fit="true"
        :key="tabindex"
        :row-class-name="tableRowClassName"
      >

 2.methods方法

    // 下次复审日期到期前30日,黄色提示,超期红色预警。
    tableRowClassName(row) {
      let yy = new Date().getFullYear();// 获取当前年
      let mm = new Date().getMonth() + 1;
      let dd = new Date().getDate();
      let date = yy + "-" + (mm < 10 ? "0" + mm : mm) + "-" + dd;
      console.log(
        this.difference(date, row.row.XCFSRQ),
        "下次复审日期-当前日期"
      );
      if (
        this.difference(date, row.row.XCFSRQ) < 30 &&
        this.difference(date, row.row.XCFSRQ) > 0
      ) {
        return "warning-row";
      } else if (this.difference(date, row.row.XCFSRQ) < 0) {
        return "success-row";
      } else {
        return "suc-row";
      }
    }

3.样式绑定

 .el-table .warning-row {
  background: yellow !important;
}

 .el-table .success-row {
  background: red !important;
}
 .el-table .suc-row {
  background: white !important;
}

 4.时间差计算

    // 时间差计算
    difference: function (beginTime, endTime) {
      let dateBegin = new Date(beginTime);
      let dateEnd = new Date(endTime);
      let dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
      return Math.floor(dateDiff / (24 * 3600 * 1000));
    },

总结

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MSR Identity Toolbox: A Matlab Toolbox for Speaker Recognition Research Version 1.0 Seyed Omid Sadjadi, Malcolm Slaney, and Larry Heck Microsoft Research, Conversational Systems Research Center (CSRC) [email protected], {mslaney,larry.heck}@microsoft.com This report serves as a user manual for the tools available in the Microsoft Research (MSR) Identity Toolbox. This toolbox contains a collection of Matlab tools and routines that can be used for research and development in speaker recognition. It provides researchers with a test bed for developing new front-end and back-end techniques, allowing replicable evaluation of new advancements. It will also help newcomers in the field by lowering the “barrier to entry”, enabling them to quickly build baseline systems for their experiments. Although the focus of this toolbox is on speaker recognition, it can also be used for other speech related applications such as language, dialect and accent identification. In recent years, the design of robust and effective speaker recognition algorithms has attracted significant research effort from academic and commercial institutions. Speaker recognition has evolved substantially over the past 40 years; from discrete vector quantization (VQ) based systems to adapted Gaussian mixture model (GMM) solutions, and more recently to factor analysis based Eigenvoice (i-vector) frameworks. The Identity Toolbox provides tools that implement both the conventional GMM-UBM and state-of-the-art i-vector based speaker recognition strategies. A speaker recognition system includes two primary components: a front-end and a back-end. The front-end transforms acoustic waveforms into more compact and less redundant representations called acoustic features. Cepstral features are most often used for speaker recognition. It is practical to only retain the high signal-to-noise ratio (SNR) regions of the waveform, therefore there is also a need for a speech activity detector (SAD) in the fr

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值