• nbcio-boot登录后首页的跟踪出现total问题修正


           nbcio-boot登录后出现的首页,页面跟踪的时候,出现堆total的出错,虽然不影响系统使用,但影响美观度,所以还是修正一下吧。

          1、主要问题是下面的代码有问题

          因为页面创建的时候,total数据获取不到,所以报错。

    1. "24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
    2. <chart-card :loading="loading" title="任务总数" :total="tasktotal.dataSource[0].total">
    3. <a-tooltip title="指标说明" slot="action">
    4. <a-icon type="info-circle-o" />
    5. a-tooltip>
    6. <template slot="footer">任务总数<span>span>template>
    7. chart-card>
    8. <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
    9. <chart-card :loading="loading" title="流程总数" :total="flowtotal.dataSource[0].total">
    10. <a-tooltip title="指标说明" slot="action">
    11. <a-icon type="info-circle-o" />
    12. a-tooltip>
    13. <div>
    14. <mini-area />
    15. div>
    16. <template slot="footer">流程总数<span> {{ }}span>template>
    17. chart-card>
    18. a-col>
    19. <a-col :sm="24" :md="12" :xl="6" :style="{

    2、主要修改如下:

    采用一个变量

    1. a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
    2. <chart-card :loading="loading" title="任务总数" :total="tasksum">
    3. <a-tooltip title="指标说明" slot="action">
    4. <a-icon type="info-circle-o" />
    5. a-tooltip>
    6. <template slot="footer">任务总数<span>span>template>
    7. chart-card>
    8. <a-col :sm="24" :md="12" :xl="6" :style="{ marginBottom: '24px' }">
    9. <chart-card :loading="loading" title="流程总数" :total="flowsum">
    10. <a-tooltip title="指标说明" slot="action">
    11. <a-icon type="info-circle-o" />
    12. a-tooltip>
    13. <div>
    14. <mini-area />
    15. div>
    16. <template slot="footer">流程总数<span> {{ }}span>template>
    17. chart-card>
    18. a-col>

    1. computed: { //为了消除页面报错
    2. tasksum() {
    3. if(this.tasktotal.dataSource.length>0){
    4. return String(this.tasktotal.dataSource[0].total);
    5. }
    6. },
    7. flowsum() {
    8. if(this.flowtotal.dataSource.length>0){
    9. return String(this.flowtotal.dataSource[0].total);
    10. }
    11. },
    12. },
    13. created() {
    14. setTimeout(() => {
    15. this.loading = !this.loading
    16. }, 100)
    17. console.log("created tasktotal=",this.tasktotal);
    18. this.loadData(this.tasktotal);
    19. this.loadData(this.flowtotal);
    20. this.loadData(this.taskmonth);
    21. this.loadData(this.flowmonth);
    22. this.initLogInfo();
    23. },

    3、效果图

  • 相关阅读:
    SpringBoot解决跨域问题的六种方式
    【并发编程】ThreadLocal详解
    kubernetes-v1.23.3 部署 MySQL-5.7.31
    Vue+SpringBoot打造考研专业课程管理系统
    Base64与MD5(数据加密)与ValidateCode(验证码)
    Java自定义类加载器的详解与步骤
    Excel VSTO开发9 -使用Form窗口
    《数据库原理》期末考试题
    一文了解Validator库
    Linux-文件管理命令
  • 原文地址:https://blog.csdn.net/qq_40032778/article/details/133121900