liusheng
13 小时以前 9903954c85f651dd5cc6d4b538cfe66b17fc5baa
src/components/StatisticsCards/index.vue
@@ -17,10 +17,14 @@
        >
          <el-card
            shadow="hover"
            :body-style="item.router ? 'cursor: pointer' : 'cursor: default'"
            :body-style="isClickable(item) ? 'cursor: pointer' : 'cursor: default'"
            :class="getCardClass(item.name)"
            @click.native="handleCardClick(item)"
          >
            <div class="card-content" @click="handleCardClick(item)">
            <div
              class="card-content"
              :style="{ cursor: isClickable(item) ? 'pointer' : 'default' }"
            >
              <div class="card-label">
                <span class="label-text">{{ item.name }}</span>
              </div>
@@ -64,6 +68,11 @@
      default: 0,
    },
    showWarningCondition: {
      type: Boolean,
      default: false,
    },
    // 是否允许点击卡片(点击后由父组件决定如何筛选下面的列表)
    clickable: {
      type: Boolean,
      default: false,
    },
@@ -135,6 +144,9 @@
      return tooltips[name] || "";
    },
    isClickable(item) {
      return !!(item && item.router) || this.clickable;
    },
    handleCardClick(item) {
      if (item.router) {
        this.$router.push(item.router);