sd
2025-08-01 236a0b8334dfa75685c7ee69619d8e76536ba666
src/components/subComponents/CardItem.vue
@@ -72,20 +72,20 @@
            data.targetInfo == null ||
            data.targetInfo[0].targetType !== 'FaceDetect'
          "
          :src="data.picMaxUrl[0] | httpImage"
          :src="data.picMaxUrl[0] | apiImg"
          class="cursor-pointer"
          @click="detailsClick($event)"
        />
        <img
          v-else
          :src="data.targetInfo[0].picSmUrl | httpImage"
          :src="data.targetInfo[0].picSmUrl | apiImg"
          class="cursor-pointer"
          @click="detailsClick($event)"
        />
      </div>
      <div class="s-card-left-box" v-else>
        <img
          :src="data.baseInfo[0].targetPicUrl | httpImage"
          :src="data.baseInfo[0].targetPicUrl | apiImg"
          class="cursor-pointer"
        />
      </div>
@@ -330,15 +330,29 @@
        @mouseenter="cardMouseenter($event)"
        @mouseleave="cardMouseleave($event)"
      >
        <p :title="data.picDate">
        <p :title="data.detect_time">
          <span class="fontStyle color222">{{
            data.picDate | formatTime
            data.detect_time | formatTime
          }}</span>
        </p>
        <p :title="data.cameraAddr" style="margin-bottom: 8px">
          <span class="fontStyle color222">{{ data.cameraAddr }}</span>
        </p>
        <el-tooltip placement="right" popper-class="atooltip">
        <p v-for="(item, index) in data.event_levels" :key="index + 'rule'">
              <span v-if="data.is_warning === 1" style="color: red;">{{ data.task_name }}</span
              >
              <span v-else>{{ data.task_name }}</span
              >&nbsp;&nbsp;
              <span v-if="data.is_warning === 1" style="color: red;">{{
                item.dictValue
              }}</span
              >
              <span v-else>{{
                item.dictValue
              }}</span
              >&nbsp;
            </p>
        <!-- <el-tooltip placement="right" popper-class="atooltip">
          <div slot="content">
            <p v-for="(item, index) in data.alarmRules" :key="index + 'rule'">
              <span>{{ data.taskName }}</span
@@ -381,7 +395,7 @@
              <span v-if="index < data.alarmRules.length - 1">/&nbsp;</span>
            </span>
          </el-button>
        </el-tooltip>
        </el-tooltip> -->
      </div>
      <div class="right-bottom">
        <div v-if="!data.id" class="card-icon-box">
@@ -398,10 +412,23 @@
          v-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''"
          class="card-icon-box"
        >
          <el-tooltip content="详情" placement="top" popper-class="atooltip">
            <i class="iconfont iconcaidan" @click="detailsClick($event)"></i>
          <el-tooltip placement="top" :content="data.zh_desc_class" effect="light" popper-class="my-tooltip">
          <img src="@/assets/img/article-fill@1x.png" >
            <!-- <i class="iconfont iconcaidan" @click="detailsClick($event)"></i> -->
          </el-tooltip>
          <el-tooltip content="收藏" placement="top" popper-class="atooltip">
          <el-dropdown size="small"  style="margin-left: 10px;"  @command="handleCommand" >
            <img src="@/assets/img/modelTraining.png"  style="height: 15px;width: 14px">
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item  :command="{ ruleName: data.rule_names[0].fileName, cameraId: data.video_point_id+'', cameraName: data.video_name,imagePath:data.image_path,status:1 }">正确</el-dropdown-item>
              <el-dropdown-item :command="{ ruleName: data.rule_names[0].fileName, cameraId: data.video_point_id+'', cameraName: data.video_name,imagePath:data.image_path,status:2 }">错误</el-dropdown-item>
              <el-dropdown-item :command="{ ruleName: data.rule_names[0].fileName, cameraId: data.video_point_id+'', cameraName: data.video_name,imagePath:data.image_path,status:0 }">不确定</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <!-- <el-tooltip content="详情" placement="top" popper-class="atooltip">
            <i class="iconfont iconcaidan" @click="detailsClick($event)"></i>
          </el-tooltip> -->
          <!-- <el-tooltip content="收藏" placement="top" popper-class="atooltip">
            <i
              v-if="!data.isCollect"
              class="iconfont iconshoucang2"
@@ -410,26 +437,26 @@
            <span v-else @click="collect(false)" class="iconfont icon_collect"
              >&#xe625;</span
            >
          </el-tooltip>
          </el-tooltip> -->
          <!-- :class="
              data.isAlarm ? 'iconfont systemmm' : 'iconfont systemxing'
          "-->
          
          <el-tooltip
          <!-- <el-tooltip
            content="删除"
            placement="top"
            popper-class="atooltip"
          >
            <i class="iconfont iconshanchu ml40" @click="toDelete(data.id)"></i>
          </el-tooltip>
          </el-tooltip> -->
          <!-- 这里是要增加按钮的地方 -->
          <el-tooltip
          <!-- <el-tooltip
            content="误报"
            placement="top"
            popper-class="atooltip"
          >
          <i :style="{color:data.misreport? '#f00':''}" :disabled="data.misreport" class="iconfont el-icon-error ml40" @click="toFalseAlarm(data)"></i>
          </el-tooltip>
          </el-tooltip> -->
        </div>
        <div class="card-icon-box" v-else>
          <el-tooltip content="详情" placement="top" popper-class="atooltip">
@@ -765,6 +792,7 @@
<script>
import { collect } from "@/api/search";
import {insertModelTraining} from "@/api/task";
Date.prototype.Format = function (fmt) {
  var o = {
@@ -846,6 +874,14 @@
        "/httpImage/" + url + (url.indexOf("?") >= 0 ? "&" : "?") + "width=160"
      );
    },
    apiImg(url) {
      if (!url.length) {
        return "";
      }
      return (
        "/api-img" + url + (url.indexOf("?") >= 0 ? "&" : "?") + "width=160"
      );
    },
  },
  data() {
    return {
@@ -865,6 +901,22 @@
    },
  },
  methods: {
    handleCommand(command) {
      console.log(JSON.stringify(command))
      insertModelTraining(JSON.stringify(command)).then((res) => {
        if (res && res.status === 200) {
          this.$notify({
            type: "success",
            message: "添加成功",
          });
        } else {
          this.$notify({
            type: "error",
            message: "添加失败!",
          });
        }
      });
    },
    getBottom() {
      this.$nextTick(() => {
        let imgDom = this.$refs.firstImg;
@@ -968,6 +1020,14 @@
  },
};
</script>
<style>
/* 全局生效,可覆盖 tooltip */
.my-tooltip {
  max-width: 540px !important;
  color: #606266 !important;
}
</style>
<style lang="scss">
.fontStyle {
  font-family: PingFangSC-Medium;