zhangzengfei
2022-08-04 2e4133d2bbb0f4626cf336f3e456783b9fb7867e
优化部分样式
8个文件已修改
1498 ■■■■■ 已修改文件
src/scripts/httpRequest.ts 142 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/equipmentList/components/AddBox.vue 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/equipmentList/components/FormList.vue 260 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hashrate/CameraManage/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personalCenter/components/AddBox.vue 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productDetail/components/PayCard.vue 288 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/search/components/CardItem.vue 452 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
tsconfig.json 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/scripts/httpRequest.ts
@@ -1,66 +1,57 @@
/* eslint-disable */
import axios from 'axios'
import qs from 'qs'
import { Notification } from 'element-ui'
 import router from '@/router'
import axios from "axios"
import qs from "qs"
import { Notification } from "element-ui"
import router from "@/router"
const Axios = axios.create({
  responseType: 'json',
  responseType: "json",
  withCredentials: true // 是否允许带cookie这些
})
/* //POST传参序列化(添加请求拦截器) */
Axios.interceptors.request.use(
  config => {
    console.log(9898);
    console.log(config);
    if (
      config.method === "post" &&
      sessionStorage.getItem('clusterId') ||
      sessionStorage.getItem('devId')
    ) {
      if( !config.data ) {
  (config) => {
    console.log(9898)
    console.log(config)
    if ((config.method === "post" && sessionStorage.getItem("clusterId")) || sessionStorage.getItem("devId")) {
      if (!config.data) {
        config.data = {}
      }
      if(typeof config.data == 'object' ) {
       config.data.clusterId = sessionStorage.getItem('clusterId')
       config.data.devId = sessionStorage.getItem('devId')
      if (typeof config.data == "object") {
        config.data.clusterId = sessionStorage.getItem("clusterId")
        config.data.devId = sessionStorage.getItem("devId")
      }
      if(config.url === '/saas/api-s/camera/rule/getLinkRulesByCameraIds') {
         config.data.devId = sessionStorage.getItem('cameraDevId')
      if (config.url === "/saas/api-s/camera/rule/getLinkRulesByCameraIds") {
        config.data.devId = sessionStorage.getItem("cameraDevId")
      }
      //后门
      if(config.url === '/saas/api-d/device/userClusterInfo') {
         config.data.clusterId = ''
      if (config.url === "/saas/api-d/device/userClusterInfo") {
        config.data.clusterId = ""
      }
       if(config.url === '/saas/api-s/es/saveEsConfig') {
      if (config.url === "/saas/api-s/es/saveEsConfig") {
        delete config.data.clusterId
        delete config.data.devId
      }
    }
    // 若是有做鉴权token , 就给头部带上token
    let token =
      sessionStorage.getItem('loginedInfo') &&
      JSON.parse(sessionStorage.getItem('loginedInfo')).access_token
    let token = sessionStorage.getItem("loginedInfo") && JSON.parse(sessionStorage.getItem("loginedInfo")).access_token
    if (token != undefined) {
      config.headers.Authorization = token
    }
    return config
  },
  error => {
    console.log('请求错误');
    console.log(error);
  (error) => {
    console.log("请求错误")
    console.log(error)
    /*  Message({
      showClose: true,
      message: "提交出错,请联系管理员!",
@@ -72,13 +63,13 @@
/* //返回状态判断(添加响应拦截器) */
Axios.interceptors.response.use(
  res => {
  (res) => {
    /* //对响应数据做些事 */
    if (res.data && res.statusText !== 'OK' && res.status !== 200) {
    if (res.data && res.statusText !== "OK" && res.status !== 200) {
      Notification({
        title: '',
        title: "",
        message: res.data.message,
        type: 'error'
        type: "error"
      })
      return Promise.reject(res.data)
    }
@@ -97,30 +88,28 @@
    //   window.sessionStorage.setItem('policeCameravideoIsLoginTimeout', JSON.stringify(true))
    // }
          var disposition = res.headers["content-disposition"];
          if(disposition) {
             var fileName = disposition.substring(disposition.indexOf("=") + 1);
             console.log(res);
             return {
               fileName:fileName,
               body:res
             }
          }
    var disposition = res.headers["content-disposition"]
    if (disposition) {
      var fileName = disposition.substring(disposition.indexOf("=") + 1)
      console.log(res)
      return {
        fileName: fileName,
        body: res
      }
    }
    return res.data ? res.data : {}
    /* //return res.data ? res.data : {}; */
  },
  error => {
    console.log('响应错误');
    console.log(error);
  (error) => {
    console.log("响应错误")
    console.log(error)
    let errJson: any = {
      success: false
    }
    if(error && error.response&&error.response.status == 404) {
    if (error && error.response && error.response.status == 404) {
      return
    }
    // 下面是接口回调的satus ,因为我做了一些错误页面,所以都会指向对应的报错页面
@@ -128,14 +117,14 @@
      switch (error.response.status) {
        case 400:
          errJson.status = error.response.status
          errJson.message = '请求错误(400)'
          errJson.message = "请求错误(400)"
          break
        case 401:
          errJson.status = error.response.status
          errJson.message = '未授权,请重新登录(401)'
          errJson.message = "未授权,请重新登录(401)"
          router.push({
             path: '/login'
           })
            path: "/login"
          })
          // if (!AuthData.isLoginout) {
          //   Notification({
          //     title:"",
@@ -153,51 +142,50 @@
          break
        case 403:
          errJson.status = error.response.status
          errJson.message = '拒绝访问(403)'
          errJson.message = "拒绝访问(403)"
          break
        case 404:
          errJson.status = error.response.status
          errJson.message = '找不到请求路径(404)'
          errJson.message = "找不到请求路径(404)"
          break
        case 408:
          errJson.status = error.response.status
          errJson.message = '请求超时(408)'
          errJson.message = "请求超时(408)"
          break
        case 500:
          errJson = error.response.data
          break
        default:
          errJson.status = error.response.status
          errJson.message = `连接出错(${error.response.status})!`
      }
    } else {
      errJson.message = '连接服务器失败!'
      errJson.message = "连接服务器失败!"
      // router.push({
      //   path: '/login'
      // });
    }
    if(error.response&&error.response.data&&!error.response.data.success ) {
      errJson.message =error.response.data.msg
    if (error.response && error.response.data && !error.response.data.success) {
      errJson.message = error.response.data.msg
    }
    if(error.response.status == 401) {
    if (error.response.status == 401) {
      return
    }
     Notification({
        title: '错误',
        showClose: true,
        message:errJson.message,
        type: 'error'
      })
    Notification({
      title: "错误",
      showClose: true,
      message: errJson.message,
      type: "error"
    })
    // 返回 response 里的错误信息
    return Promise.reject(errJson)
  }
)
Axios.defaults.timeout = 60 * 1000
Axios.defaults.timeout = 60 * 1000 * 2
export default Axios
src/views/equipmentManagement/equipmentList/components/AddBox.vue
@@ -5,10 +5,7 @@
    <div class="close iconfont" @click="close()">&#xe60f;</div>
    <div class="search">
      <el-input
        v-model="searchContent"
        placeholder="请输入集群IP/集群名称/设备IP/设备名称"
      ></el-input>
      <el-input v-model="searchContent" placeholder="请输入集群IP/集群名称/设备IP/设备名称"></el-input>
      <div class="button" @click="searchCluster">搜索集群</div>
      <div class="button" @click="searchDevice">搜索设备</div>
    </div>
@@ -16,11 +13,7 @@
    <div class="clusterList">
      <div class="tableList" v-if="listType == 'cluster'">
        <div class="header">
          <div
            class="label"
            v-for="(item, index) in clusterHeader"
            :key="index"
          >
          <div class="label" v-for="(item, index) in clusterHeader" :key="index">
            {{ item }}
          </div>
        </div>
@@ -39,54 +32,21 @@
                  <!-- 添加 -->
                  <span v-if="!item.canAdd">-</span>
                  <template v-else>
                    <span
                      class="iconfont option"
                      @click="showBox('cluster', item.clusterId)"
                      >&#xe63f;</span
                    >
                    <span class="iconfont option" @click="showBox('cluster', item.clusterId)">&#xe63f;</span>
                    <!-- 集群详情  -->
                    <span
                      class="iconfont option"
                      @click="showChildrenLIst(index, item.clusterId)"
                      >&#xe63e;</span
                    >
                    <span class="iconfont option" @click="showChildrenLIst(index, item.clusterId)">&#xe63e;</span>
                  </template>
                </div>
              </div>
              <div
                class="overList"
                :class="{ isShow: showClusterChild == index }"
              >
                <el-table
                  :data="overList"
                  :fit="true"
                  header-row-class-name="overList-head"
                >
                  <el-table-column
                    label="序号"
                    type="index"
                    width="146"
                    class-name="index "
                  >
                  </el-table-column>
                  <el-table-column
                    prop="dev_id"
                    label="设备ID"
                    width="146"
                  ></el-table-column>
              <div class="overList" :class="{ isShow: showClusterChild == index }">
                <el-table :data="overList" :fit="true" header-row-class-name="overList-head">
                  <el-table-column label="序号" type="index" width="146" class-name="index "> </el-table-column>
                  <el-table-column prop="dev_id" label="设备ID"></el-table-column>
                  <el-table-column
                    prop="dev_ip"
                    label="设备IP"
                    width="146"
                  ></el-table-column>
                  <el-table-column prop="dev_ip" label="设备IP" width="146"></el-table-column>
                  <el-table-column
                    prop="dev_name"
                    label="设备名称"
                    width="240"
                  ></el-table-column>
                  <el-table-column prop="dev_name" label="设备名称" width="240"></el-table-column>
                </el-table>
                <div class="iconfont" @click="showClusterChild = null">
@@ -99,38 +59,12 @@
        </div>
      </div>
      <el-table
        :data="equipmentList"
        :fit="true"
        v-if="listType == 'equipment'"
      >
        <el-table-column
          label="序号"
          type="index"
          width="72"
          class-name="index"
        >
        </el-table-column>
        <el-table-column
          prop="devId"
          label="设备ID"
          width="107"
        ></el-table-column>
        <el-table-column
          prop="devName"
          label="设备名称"
          width="107"
        ></el-table-column>
        <el-table-column
          prop="devIp"
          label="设备IP"
          width="107"
        ></el-table-column>
        <el-table-column
          prop="clusterName"
          label="所属集群"
          width="107"
        ></el-table-column>
      <el-table :data="equipmentList" :fit="true" v-if="listType == 'equipment'">
        <el-table-column label="序号" type="index" width="72" class-name="index"> </el-table-column>
        <el-table-column prop="devId" label="设备ID"></el-table-column>
        <el-table-column prop="devName" label="设备名称" width="107"></el-table-column>
        <el-table-column prop="devIp" label="设备IP" width="107"></el-table-column>
        <el-table-column prop="clusterName" label="所属集群" width="107"></el-table-column>
        <el-table-column label="状态" width="107">
          <template slot-scope="scope">
            <div v-if="!scope.row.canAdd" class="status green">已添加</div>
@@ -143,10 +77,7 @@
            <div class="options" v-if="scope">
              <!-- 添加 -->
              <span v-if="!scope.row.canAdd">-</span>
              <span
                v-else
                class="iconfont option"
                @click="showBox('dev', scope.row.devId, scope.row.clusterId)"
              <span v-else class="iconfont option" @click="showBox('dev', scope.row.devId, scope.row.clusterId)"
                >&#xe63f;</span
              >
            </div>
@@ -159,8 +90,7 @@
      <div class="title">申请添加设备</div>
      <div class="des">
        <span class="iconfont">&#xe601;</span>
        如设备已加入集群,添加管理后集群下所有设备将在设备管理
        页面显示,并支持信息查看及管理。
        如设备已加入集群,添加管理后集群下所有设备将在设备管理 页面显示,并支持信息查看及管理。
      </div>
      <div class="ask">密钥信息请询问设备管理人员</div>
      <el-input v-model="auth_password"></el-input>
@@ -173,13 +103,7 @@
</template>
<script>
import {
  findDeviceListAll,
  findClustersBySearch,
  getDevicesByCluster,
  addCluster,
  addDeviceToUser,
} from "@/api/device";
import { findDeviceListAll, findClustersBySearch, getDevicesByCluster, addCluster, addDeviceToUser } from "@/api/device"
export default {
  data() {
@@ -193,41 +117,41 @@
      equipmentList: [],
      overList: [],
      auth_password: "", //授权秘钥
      addObj: {},
    };
      addObj: {}
    }
  },
  methods: {
    close() {
      this.$emit("close");
      this.$emit("close")
    },
    async showChildrenLIst(index, id) {
      if (this.showClusterChild === index) {
        this.showClusterChild = null;
        return;
        this.showClusterChild = null
        return
      } else if (!index) {
        this.showClusterChild = index;
        this.showClusterChild = index
      }
      this.showClusterChild = null;
      this.showClusterChild = null
      setTimeout(() => {
        this.showClusterChild = index;
      }, 400);
        this.showClusterChild = index
      }, 400)
      const res = await getDevicesByCluster({
        clusterId: id,
      });
        clusterId: id
      })
      if (res && res.success) {
        this.overList = res.data.list;
        this.overList = res.data.list
      }
    },
    async getCluster() {
      const res = await findClustersBySearch({
        InputText: this.searchContent,
        Page: 1,
        Size: 10000,
      });
        Size: 10000
      })
      if (res && res.success) {
        this.clusterList = res.data.list;
        this.clusterList = res.data.list
      }
    },
@@ -235,57 +159,57 @@
      const res = await findDeviceListAll({
        InputText: this.searchContent,
        Page: 1,
        Size: 10000,
      });
        Size: 10000
      })
      if (res && res.success) {
        this.equipmentList = res.data.list;
        this.equipmentList = res.data.list
      }
    },
    searchCluster() {
      this.getCluster();
      this.listType = "cluster";
      this.getCluster()
      this.listType = "cluster"
    },
    searchDevice() {
      this.getDevice();
      this.listType = "equipment";
      this.getDevice()
      this.listType = "equipment"
    },
    async submit() {
      let res = {};
      let res = {}
      if (this.addObj.type == "cluster") {
        res = await addCluster({
          authPwd: this.auth_password,
          clusterId: this.addObj.id,
        });
          clusterId: this.addObj.id
        })
      } else {
        res = await addDeviceToUser({
          authPwd: this.auth_password,
          deviceId: this.addObj.id,
          clusterId: this.addObj.cid,
        });
          clusterId: this.addObj.cid
        })
      }
      if (res && res.success) {
        this.$notify({
          type: "success",
          message: "添加成功",
        });
        this.close();
          message: "添加成功"
        })
        this.close()
      }
    },
    showBox(type, id, cid) {
      this.auth_password = "";
      this.showPasswordBox = true;
      this.auth_password = ""
      this.showPasswordBox = true
      this.addObj = {
        type,
        id,
        cid,
      };
    },
  },
};
        cid
      }
    }
  }
}
</script>
<style lang="scss" scoped>
@@ -593,4 +517,4 @@
    }
  }
}
</style>
</style>
src/views/equipmentManagement/equipmentList/components/FormList.vue
@@ -23,12 +23,7 @@
        <div class="cluster">
          所属集群
          <el-select v-model="cluster" placeholder="请选择">
            <el-option
              v-for="item in clusterArr"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            <el-option v-for="item in clusterArr" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </div>
@@ -41,12 +36,8 @@
    </div>
    <div class="btns">
      <div class="button add" @click="isShowAdd = true">
        <span>+</span>添加设备
      </div>
      <div class="button export" @click="exportFile">
        <span class="iconfont">&#xe614;</span>导出
      </div>
      <div class="button add" @click="isShowAdd = true"><span>+</span>添加设备</div>
      <div class="button export" @click="exportFile"><span class="iconfont">&#xe614;</span>导出</div>
    </div>
    <div class="table-area">
@@ -60,27 +51,11 @@
        :stripe="true"
      >
        <el-table-column label="序号" width="80" class-name="index">
          <template slot-scope="scope">{{
            scope.$index + 1 + (page - 1) * size
          }}</template>
          <template slot-scope="scope">{{ scope.$index + 1 + (page - 1) * size }}</template>
        </el-table-column>
        <el-table-column
          prop="devId"
          label="设备ID"
          min-width="140"
          show-overflow-tooltip
        ></el-table-column>
        <el-table-column
          prop="devName"
          label="设备名称"
          min-width="140"
          show-overflow-tooltip
        ></el-table-column>
        <el-table-column
          prop="devIp"
          label="IP地址"
          min-width="150"
        ></el-table-column>
        <el-table-column prop="devId" label="设备ID" min-width="185" show-overflow-tooltip></el-table-column>
        <el-table-column prop="devName" label="设备名称" min-width="140" show-overflow-tooltip></el-table-column>
        <el-table-column prop="devIp" label="IP地址" min-width="150"></el-table-column>
        <el-table-column label="安装时间" min-width="159">
          <template slot-scope="scope">
            <div v-if="scope.row.installTime.length > 1">
@@ -114,11 +89,7 @@
        <el-table-column label="操作" min-width="180">
          <template slot-scope="scope">
            <!-- 加入 -->
            <el-tooltip
              content="加入集群"
              placement="top"
              v-if="!scope.row.clusterId"
            >
            <el-tooltip content="加入集群" placement="top" v-if="!scope.row.clusterId">
              <span
                class="iconfont option"
                @click="joinCluster(scope.row)"
@@ -155,10 +126,7 @@
            </el-tooltip>
            <!-- 解绑 -->
            <el-tooltip content="解除绑定" placement="top">
              <span
                class="iconfont option"
                @click="Untying(scope.row)"
                :class="{ disable: scope.row.isOnline != 1 }"
              <span class="iconfont option" @click="Untying(scope.row)" :class="{ disable: scope.row.isOnline != 1 }"
                >&#xe617;</span
              >
            </el-tooltip>
@@ -180,54 +148,37 @@
    </div>
    <!-- 解绑弹窗 -->
    <UnbindBox
      @close="closeUnbindBox"
      v-if="isShowUnbind"
      :id="unbindId"
      @reflash="reflash"
    ></UnbindBox>
    <UnbindBox @close="closeUnbindBox" v-if="isShowUnbind" :id="unbindId" @reflash="reflash"></UnbindBox>
    <!-- 添加设备弹窗 -->
    <AddBox @close="closeAddBox" v-if="isShowAdd"></AddBox>
    <!-- 退出集群弹窗 -->
    <QuitClusterBox
      :equipment="activeEquipment"
      v-if="showQuit"
      @close="showQuit = false"
    ></QuitClusterBox>
    <QuitClusterBox :equipment="activeEquipment" v-if="showQuit" @close="showQuit = false"></QuitClusterBox>
    <!-- 加入集群弹窗 -->
    <JoinClusterBox
      :equipment="activeEquipment"
      v-if="showJoin"
      @close="showJoin = false"
    ></JoinClusterBox>
    <JoinClusterBox :equipment="activeEquipment" v-if="showJoin" @close="showJoin = false"></JoinClusterBox>
  </div>
</template>
<script>
import {
  findDevList,
  findClustersBySearch,
  exportDevListExcel,
} from "@/api/device";
import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox";
import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox";
import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox";
import JoinClusterBox from "@/views/equipmentManagement/equipmentList/components/JoinClusterBox";
import { findDevList, findClustersBySearch, exportDevListExcel } from "@/api/device"
import AddBox from "@/views/equipmentManagement/equipmentList/components/AddBox"
import UnbindBox from "@/views/equipmentManagement/equipmentDetail/components/UnbindBox"
import QuitClusterBox from "@/views/equipmentManagement/equipmentList/components/QuitClusterBox"
import JoinClusterBox from "@/views/equipmentManagement/equipmentList/components/JoinClusterBox"
import bus from "@/plugin/bus";
import bus from "@/plugin/bus"
export default {
  components: {
    AddBox,
    UnbindBox,
    QuitClusterBox,
    JoinClusterBox,
    JoinClusterBox
  },
  created() {
    this.getCluster();
    this.getCluster()
  },
  data() {
    return {
@@ -244,8 +195,8 @@
      cluster: null, //选中的集群类型
      showQuit: false, //展示退出集群的弹窗
      showJoin: false, //展示加入集群的弹窗
      activeEquipment: null, //处理中的设备
    };
      activeEquipment: null //处理中的设备
    }
  },
  methods: {
    async getCluster() {
@@ -253,47 +204,47 @@
        InputText: "",
        Page: 1,
        Size: 10000,
        userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
      });
        userId: JSON.parse(sessionStorage.getItem("userInfo")).id
      })
      if (res && res.success) {
        res.data.list.forEach((item) => {
          this.clusterArr.push({
            label: item.clusterName,
            value: item.clusterId,
          });
        });
            value: item.clusterId
          })
        })
      }
    },
    // 跳到设备详情
    checkDetail(row) {
      if (row.isOnline != 1) {
        return;
        return
      }
      this.$router.push({
        path: "/equipmentDetail",
        query: {
          id: row.devId,
        },
      });
          id: row.devId
        }
      })
    },
    // 跳到算法详情
    algorithmDetail(row) {
      if (row.isOnline != 1) {
        return;
        return
      }
      this.$router.push({
        path: "/algorithmDetail",
        query: {
          id: row.devId,
        },
      });
          id: row.devId
        }
      })
    },
    // 查询列表
    searchingBtn() {
      let param = {};
      let param = {}
      if (!this.searchTime) {
        param = {
@@ -302,8 +253,8 @@
          startTime: "",
          endTime: "",
          clusterId: this.cluster,
          inputText: this.inputText,
        };
          inputText: this.inputText
        }
      } else {
        param = {
          page: this.page,
@@ -311,112 +262,109 @@
          startTime: this.searchTime[0],
          endTime: this.searchTime[1],
          clusterId: this.cluster,
          inputText: this.inputText,
        };
          inputText: this.inputText
        }
      }
      findDevList(param)
        .then((res) => {
          this.dataList = res.data.list;
          this.dataList = res.data.list
          //时间分行显示
          this.dataList.forEach((item) => {
            item.installTime = item.installTime.split(" ");
            item.firstUseTime = item.firstUseTime.split(" ");
          });
          this.total = res.data.total;
            item.installTime = item.installTime.split(" ")
            item.firstUseTime = item.firstUseTime.split(" ")
          })
          this.total = res.data.total
          if (res.data.total <= this.size) {
            this.page = 1;
            this.page = 1
          }
          bus.$emit("refleshNode", this.dataList);
          bus.$emit("refleshNode", this.dataList)
        })
        .catch((err) => {
          console.log(err);
        });
          console.log(err)
        })
    },
    //分页功能
    handleSizeChange(size) {
      this.size = size;
      this.searchingBtn();
      this.size = size
      this.searchingBtn()
    },
    //分页功能
    refrash(page) {
      this.page = page;
      this.searchingBtn();
      this.page = page
      this.searchingBtn()
    },
    //解绑按钮
    Untying(row) {
      if (row.isOnline != 1) {
        return;
        return
      }
      this.unbindId = row.devId;
      this.isShowUnbind = true;
      this.unbindId = row.devId
      this.isShowUnbind = true
    },
    //获得默认时间
    getDateInit() {
      // 要求 默认一个月
      const end = new Date();
      const start = new Date();
      const nowDate = new Date();
      nowDate.setHours(0);
      nowDate.setMinutes(0);
      nowDate.setSeconds(0);
      nowDate.setMilliseconds(0);
      start.setTime(nowDate.getTime() - 3600 * 1000 * 24 * 30);
      end.setTime(nowDate.getTime() + 3600 * 1000 * 24 - 1);
      return [
        this.$moment(start).format("YYYY-MM-DD HH:mm:ss"),
        this.$moment(end).format("YYYY-MM-DD HH:mm:ss"),
      ];
      const end = new Date()
      const start = new Date()
      const nowDate = new Date()
      nowDate.setHours(0)
      nowDate.setMinutes(0)
      nowDate.setSeconds(0)
      nowDate.setMilliseconds(0)
      start.setTime(nowDate.getTime() - 3600 * 1000 * 24 * 30)
      end.setTime(nowDate.getTime() + 3600 * 1000 * 24 - 1)
      return [this.$moment(start).format("YYYY-MM-DD HH:mm:ss"), this.$moment(end).format("YYYY-MM-DD HH:mm:ss")]
    },
    //关闭新增弹窗
    closeAddBox() {
      this.isShowAdd = false;
      this.searchingBtn();
      this.isShowAdd = false
      this.searchingBtn()
    },
    // 关闭解绑弹窗
    closeUnbindBox() {
      this.isShowUnbind = false;
      this.isShowUnbind = false
    },
    //解绑成功回调
    reflash() {
      this.isShowUnbind = false;
      this.searchingBtn();
      this.isShowUnbind = false
      this.searchingBtn()
    },
    clearSearch() {
      this.searchTime = this.getDateInit();
      this.inputText = "";
      this.cluster = "";
      this.searchingBtn();
      this.searchTime = this.getDateInit()
      this.inputText = ""
      this.cluster = ""
      this.searchingBtn()
    },
    //退出集群
    quitCluster(equipment) {
      if (equipment.isOnline != 1) {
        return;
        return
      }
      this.activeEquipment = equipment;
      this.showQuit = true;
      this.activeEquipment = equipment
      this.showQuit = true
    },
    //加入集群
    joinCluster(equipment) {
      if (equipment.isOnline != 1) {
        return;
        return
      }
      this.activeEquipment = equipment;
      this.showJoin = true;
      this.activeEquipment = equipment
      this.showJoin = true
    },
    //导出列表文件
    async exportFile() {
      let param = {};
      let param = {}
      if (!this.searchTime) {
        param = {
@@ -425,8 +373,8 @@
          startTime: "",
          endTime: "",
          clusterId: this.cluster,
          inputText: this.inputText,
        };
          inputText: this.inputText
        }
      } else {
        param = {
          page: this.page,
@@ -434,38 +382,38 @@
          startTime: this.searchTime[0],
          endTime: this.searchTime[1],
          clusterId: this.cluster,
          inputText: this.inputText,
        };
          inputText: this.inputText
        }
      }
      const result = await exportDevListExcel(param);
      const result = await exportDevListExcel(param)
      var blob = new Blob([result.body.data], {
          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
          type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
        }),
        Temp = document.createElement("a");
        Temp = document.createElement("a")
      Temp.href = window.URL.createObjectURL(blob);
      Temp.href = window.URL.createObjectURL(blob)
      console.log(result);
      console.log(result.fileName);
      console.log(result)
      console.log(result.fileName)
      Temp.download = window.decodeURI(result.fileName);
      Temp.download = window.decodeURI(result.fileName)
      Temp.setAttribute("download", result.fileName);
      Temp.setAttribute("download", result.fileName)
      document.body.appendChild(Temp);
      document.body.appendChild(Temp)
      Temp.click();
      Temp.click()
      document.body.removeChild(Temp);
      document.body.removeChild(Temp)
      window.URL.revokeObjectURL(Temp);
    },
      window.URL.revokeObjectURL(Temp)
    }
  },
  mounted() {
    this.searchingBtn();
  },
};
    this.searchingBtn()
  }
}
</script>
<style scoped lang="scss">
@@ -725,7 +673,7 @@
}
</style>
<style >
<style>
.el-date-table td.start-date span,
.el-date-table td.end-date span {
  background-color: #0065ff;
@@ -740,4 +688,4 @@
  color: #0065ff;
  border-color: #0065ff;
}
</style>
</style>
src/views/hashrate/CameraManage/index.vue
@@ -315,7 +315,7 @@
    .column-left {
      position: relative;
      margin-right: 24px;
      height: 233vh;
      height: 160vh;
      overflow: auto;
      background-color: #fff;
    }
src/views/personalCenter/components/AddBox.vue
@@ -5,10 +5,7 @@
    <div class="close iconfont" @click="close()">&#xe60f;</div>
    <div class="search">
      <el-input
        v-model="searchContent"
        placeholder="请输入集群IP/集群名称/设备IP/设备名称"
      ></el-input>
      <el-input v-model="searchContent" placeholder="请输入集群IP/集群名称/设备IP/设备名称"></el-input>
      <div class="button" @click="listType = 'cluster'">搜索集群</div>
      <div class="button" @click="listType = 'equipment'">搜索设备</div>
    </div>
@@ -16,11 +13,7 @@
    <div class="clusterList">
      <div class="tableList" v-if="listType == 'cluster'">
        <div class="header">
          <div
            class="label"
            v-for="(item, index) in clusterHeader"
            :key="index"
          >
          <div class="label" v-for="(item, index) in clusterHeader" :key="index">
            {{ item }}
          </div>
        </div>
@@ -36,49 +29,20 @@
              </div>
              <div class="rowItem options">
                <!-- 添加 -->
                <span class="iconfont option" @click="showPasswordBox = true"
                  >&#xe63f;</span
                >
                <span class="iconfont option" @click="showPasswordBox = true">&#xe63f;</span>
                <!-- 集群详情  -->
                <span class="iconfont option" @click="showChildrenLIst(index)"
                  >&#xe63e;</span
                >
                <span class="iconfont option" @click="showChildrenLIst(index)">&#xe63e;</span>
              </div>
            </div>
            <div
              class="overList"
              :class="{ isShow: showClusterChild == index }"
            >
              <el-table
                :data="overList"
                :fit="true"
                header-row-class-name="overList-head"
              >
                <el-table-column
                  label="序号"
                  type="index"
                  width="146"
                  class-name="index "
                >
                </el-table-column>
                <el-table-column
                  prop="id"
                  label="设备ID"
                  width="146"
                ></el-table-column>
            <div class="overList" :class="{ isShow: showClusterChild == index }">
              <el-table :data="overList" :fit="true" header-row-class-name="overList-head">
                <el-table-column label="序号" type="index" width="146" class-name="index "> </el-table-column>
                <el-table-column prop="id" label="设备ID"></el-table-column>
                <el-table-column
                  prop="ip"
                  label="设备IP"
                  width="146"
                ></el-table-column>
                <el-table-column prop="ip" label="设备IP" width="146"></el-table-column>
                <el-table-column
                  prop="name"
                  label="设备名称"
                  width="240"
                ></el-table-column>
                <el-table-column prop="name" label="设备名称" width="240"></el-table-column>
              </el-table>
              <div class="iconfont" @click="showClusterChild = null">
@@ -89,30 +53,12 @@
        </div>
      </div>
      <el-table
        :data="equipmentList"
        :fit="true"
        v-if="listType == 'equipment'"
      >
        <el-table-column
          label="序号"
          type="index"
          width="72"
          class-name="index"
        >
        </el-table-column>
      <el-table :data="equipmentList" :fit="true" v-if="listType == 'equipment'">
        <el-table-column label="序号" type="index" width="72" class-name="index"> </el-table-column>
        <el-table-column prop="id" label="设备ID" width="107"></el-table-column>
        <el-table-column
          prop="name"
          label="设备名称"
          width="107"
        ></el-table-column>
        <el-table-column prop="name" label="设备名称" width="107"></el-table-column>
        <el-table-column prop="ip" label="设备IP" width="107"></el-table-column>
        <el-table-column
          prop="cluster"
          label="所属集群"
          width="107"
        ></el-table-column>
        <el-table-column prop="cluster" label="所属集群" width="107"></el-table-column>
        <el-table-column label="状态" width="107">
          <template slot-scope="scope">
            <div v-if="scope.row.status == 1" class="status green">已添加</div>
@@ -124,9 +70,7 @@
          <template slot-scope="scope">
            <div class="options" v-if="scope">
              <!-- 添加 -->
              <span class="iconfont option" @click="showPasswordBox = true"
                >&#xe63f;</span
              >
              <span class="iconfont option" @click="showPasswordBox = true">&#xe63f;</span>
            </div>
          </template>
        </el-table-column>
@@ -137,8 +81,7 @@
      <div class="title">申请添加设备</div>
      <div class="des">
        <span class="iconfont">&#xe601;</span>
        如设备已加入集群,添加管理后集群下所有设备将在设备管理
        页面显示,并支持信息查看及管理。
        如设备已加入集群,添加管理后集群下所有设备将在设备管理 页面显示,并支持信息查看及管理。
      </div>
      <div class="ask">密钥信息请询问设备管理人员</div>
      <el-input v-model="auth_password"></el-input>
@@ -163,23 +106,23 @@
        {
          name: "集群1",
          ip: "192.168.7.45",
          status: "1",
          status: "1"
        },
        {
          name: "集群1",
          ip: "192.168.7.45",
          status: "1",
          status: "1"
        },
        {
          name: "集群1",
          ip: "192.168.7.45",
          status: "0",
          status: "0"
        },
        {
          name: "集群1",
          ip: "192.168.7.45",
          status: "0",
        },
          status: "0"
        }
      ],
      equipmentList: [
        {
@@ -187,64 +130,64 @@
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
        },
          status: "1"
        }
      ],
      overList: [
        {
@@ -252,51 +195,51 @@
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
          status: "1"
        },
        {
          id: "BJS23123132",
          name: "服务器20.10",
          ip: "192.168.7.45",
          cluster: "集群1",
          status: "1",
        },
          status: "1"
        }
      ],
      auth_password: "", //授权秘钥
    };
      auth_password: "" //授权秘钥
    }
  },
  methods: {
    close() {
      this.$emit("close");
      this.$emit("close")
    },
    showChildrenLIst(index) {
      if (this.showClusterChild === index) {
        this.showClusterChild = null;
        return;
        this.showClusterChild = null
        return
      } else if (!index) {
        this.showClusterChild = index;
        this.showClusterChild = index
      }
      this.showClusterChild = null;
      this.showClusterChild = null
      setTimeout(() => {
        this.showClusterChild = index;
      }, 400);
    },
  },
};
        this.showClusterChild = index
      }, 400)
    }
  }
}
</script>
<style lang="scss" scoped>
@@ -595,4 +538,4 @@
    }
  }
}
</style>
</style>
src/views/productDetail/components/PayCard.vue
@@ -84,10 +84,7 @@
        </el-button-group>
      </div> -->
      <div
        class="row"
        v-if="data.productBaseDetail && data.productBaseDetail.hasModulePrice"
      >
      <div class="row" v-if="data.productBaseDetail && data.productBaseDetail.hasModulePrice">
        <div class="label">配置模块</div>
        <div class="check-component">
          <div class="check-list">
@@ -120,19 +117,10 @@
      <div class="row" v-if="data.productType == 5">
        <div class="label">请求码</div>
        <el-input
          type="textarea"
          autosize
          placeholder="请输入请求码"
          v-model="cartItem.requestCode"
        >
        </el-input>
        <el-input type="textarea" autosize placeholder="请输入请求码" v-model="cartItem.requestCode"> </el-input>
      </div>
      <div
        class="row"
        v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice"
      >
      <div class="row" v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice">
        <div class="label">通道数量</div>
        <el-input-number
          v-model="cartItem.chCount"
@@ -146,10 +134,7 @@
        <span class="desText">最大支持16路</span>
      </div>
      <div
        class="row"
        v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice"
      >
      <div class="row" v-if="data.productBaseDetail && data.productBaseDetail.hasAuthPrice">
        <div class="label">授权数量</div>
        <el-input-number
          v-model="cartItem.authCount"
@@ -166,10 +151,10 @@
        class="row"
        v-if="
          data.productBaseDetail &&
          data.productBaseDetail.hasPriceBase &&
          data.productType != 5 &&
          !isSmartCalDot &&
          cartItem.sdks.length > 0
            data.productBaseDetail.hasPriceBase &&
            data.productType != 5 &&
            !isSmartCalDot &&
            cartItem.sdks.length > 0
        "
      >
        <div class="label">配置算法</div>
@@ -185,10 +170,7 @@
              {{ item.sdkName }}
            </div>
          </div>
          <div
            class="checked-list"
            v-if="data.productType != 3 && data.productType != 4"
          >
          <div class="checked-list" v-if="data.productType != 3 && data.productType != 4">
            <div class="label">已选</div>
            <div class="list">
              <div
@@ -204,14 +186,7 @@
        </div>
      </div>
      <div
        class="row"
        v-if="
          data.productType != 2 &&
          data.productType != 1 &&
          data.productType != 5
        "
      >
      <div class="row" v-if="data.productType != 2 && data.productType != 1 && data.productType != 5">
        <div class="label">芯片架构</div>
        <el-select
          v-model="cartItem.targetPlatform"
@@ -224,8 +199,7 @@
          "
        >
          <el-option
            v-for="item in data.productBaseDetail &&
            data.productBaseDetail.platforms"
            v-for="item in data.productBaseDetail && data.productBaseDetail.platforms"
            style="font-size: 12px"
            :key="item.id"
            :label="item.id"
@@ -239,11 +213,10 @@
        class="row"
        v-if="
          data.productType != 2 &&
          data.productType != 1 &&
          data.productType != 5 &&
          data.productType == 3 &&
          (cartItem.targetPlatform.includes('x86') ||
            cartItem.targetPlatform.includes('X86'))
            data.productType != 1 &&
            data.productType != 5 &&
            data.productType == 3 &&
            (cartItem.targetPlatform.includes('x86') || cartItem.targetPlatform.includes('X86'))
        "
      >
        <div class="label">显卡型号</div>
@@ -258,8 +231,7 @@
          placeholder="请选择显卡型号"
        >
          <el-option
            v-for="item in data.productBaseDetail &&
            data.productBaseDetail.vGpus"
            v-for="item in data.productBaseDetail && data.productBaseDetail.vGpus"
            style="font-size: 12px"
            :key="item.id"
            :label="item.id"
@@ -269,14 +241,7 @@
        </el-select>
      </div>
      <div
        class="row"
        v-if="
          data.productType != 2 &&
          data.productType != 1 &&
          data.productType != 5
        "
      >
      <div class="row" v-if="data.productType != 2 && data.productType != 1 && data.productType != 5">
        <div class="label">设备ID</div>
        <!-- :multiple-limit="cartItem.devCount" -->
@@ -313,37 +278,33 @@
      </div>
    </div>
    <ConfirmOrder
      v-if="showOrder"
      :orderId="orderId"
      @close="showOrder = false"
    ></ConfirmOrder>
    <ConfirmOrder v-if="showOrder" :orderId="orderId" @close="showOrder = false"></ConfirmOrder>
  </div>
</template>
<script>
import { findDevListByUser } from "@/api/device";
import { getReleaseProduct } from "@/api/product";
import { resumeOrder } from "@/api/shopcart";
import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder";
import { resumePay } from "@/api/order";
import { findDevListByUser } from "@/api/device"
import { getReleaseProduct } from "@/api/product"
import { resumeOrder } from "@/api/shopcart"
import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder"
import { resumePay } from "@/api/order"
export default {
  props: {
    dataInfo: {},
    dataInfo: {}
  },
  components: {
    ConfirmOrder,
    ConfirmOrder
  },
  created() {
    this.data = this.dataInfo.data;
    this.labels = this.dataInfo.labels;
    this.cartItem.id = this.data.id;
    this.getDevList();
    this.data = this.dataInfo.data
    this.labels = this.dataInfo.labels
    this.cartItem.id = this.data.id
    this.getDevList()
    if (this.dataInfo.data.pics.length > 0) {
      this.activeImg.url = this.dataInfo.data.pics[0].url;
      this.activeImg.url = this.dataInfo.data.pics[0].url
    }
    this.getInfo();
    this.getInfo()
  },
  data() {
    return {
@@ -365,7 +326,7 @@
        timeLength: 1,
        totalPrice: 0,
        isAdded: false,
        requestCode: "",
        requestCode: ""
      },
      timeLength: 1,
      isSmartCalDot: false,
@@ -374,155 +335,144 @@
      baseProductList: [],
      activeImg: {
        index: 0,
        url: "",
        url: ""
      },
      showOrder: false,
      orderId: "",
    };
      orderId: ""
    }
  },
  computed: {
    totalMoney() {
      let modulesPrice = 0;
      let modulesPrice = 0
      this.cartItem.moduleIds.forEach((id) => {
        this.data.modulePriceSet.forEach((module) => {
          if (module.moduleId === id) {
            modulesPrice += module.modulePrice;
            modulesPrice += module.modulePrice
          }
        });
      });
        })
      })
      let priceSingle =
        this.data.priceBase +
        this.data.authPrice * this.cartItem.authCount +
        this.data.chUnitPrice * this.cartItem.chCount +
        modulesPrice;
        modulesPrice
      console.log(this.data);
      console.log(this.data)
      return priceSingle * this.cartItem.devCount * this.cartItem.timeLength;
    },
      return priceSingle * this.cartItem.devCount * this.cartItem.timeLength
    }
  },
  methods: {
    getInfo() {
      getReleaseProduct({ productType: this.data.productType })
        .then((res) => {
          this.cartItem.id = this.data.id;
          this.cartItem.productName = this.data.productName;
          this.cartItem.authCount = 0;
          this.cartItem.chCount = 0;
          this.cartItem.devCount = 1;
          this.cartItem.timeLength = 1;
          this.cartItem.priceBase = this.data.priceBase;
          this.cartItem.authPrice = this.data.authPrice;
          this.cartItem.chUnitPrice = this.data.chUnitPrice;
          this.cartItem.targetPlatform = "";
          this.cartItem.devIdList = [];
          this.cartItem.totalPrice = 0;
          this.cartItem.isAdded = false;
          this.cartItem.modules = [];
          this.cartItem.sdks = [];
          this.cartItem.moduleIds = [];
          this.cartItem.sdkIds = [];
          this.cartItem.hasAuthPrice = false;
          this.cartItem.hasChUnitPrice = false;
          this.baseProductList = res.data.menus;
          this.cartItem.id = this.data.id
          this.cartItem.productName = this.data.productName
          this.cartItem.authCount = 0
          this.cartItem.chCount = 0
          this.cartItem.devCount = 1
          this.cartItem.timeLength = 1
          this.cartItem.priceBase = this.data.priceBase
          this.cartItem.authPrice = this.data.authPrice
          this.cartItem.chUnitPrice = this.data.chUnitPrice
          this.cartItem.targetPlatform = ""
          this.cartItem.devIdList = []
          this.cartItem.totalPrice = 0
          this.cartItem.isAdded = false
          this.cartItem.modules = []
          this.cartItem.sdks = []
          this.cartItem.moduleIds = []
          this.cartItem.sdkIds = []
          this.cartItem.hasAuthPrice = false
          this.cartItem.hasChUnitPrice = false
          this.baseProductList = res.data.menus
          let curProdObj = this.baseProductList.find(
            (item) => item.id === this.data.id
          );
          if (!curProdObj) return;
          this.cartItem.hasAuthPrice = this.data.hasAuthPrice =
            curProdObj && curProdObj.hasAuthPrice;
          let curProdObj = this.baseProductList.find((item) => item.id === this.data.id)
          if (!curProdObj) return
          this.cartItem.hasAuthPrice = this.data.hasAuthPrice = curProdObj && curProdObj.hasAuthPrice
          if (curProdObj.hasAuthPrice) {
            this.cartItem.authCount = 1;
            this.cartItem.authCount = 1
          }
          this.cartItem.hasChUnitPrice = this.data.hasChUnitPrice =
            curProdObj && curProdObj.hasChUnitPrice;
          this.cartItem.hasChUnitPrice = this.data.hasChUnitPrice = curProdObj && curProdObj.hasChUnitPrice
          if (curProdObj.hasChUnitPrice) {
            this.cartItem.chCount = 1;
            this.cartItem.chCount = 1
          }
          this.isSmartCalDot =
            this.data.productBaseDetail.name == "智能计算节点";
          this.isSmartCalDot = this.data.productBaseDetail.name == "智能计算节点"
          this.cartItem.modules =
            curProdObj.modules &&
            curProdObj.modules.map((item) => ({
              id: item.id,
              moduleName: item.moduleName,
              modulePrice: this.data.modulePriceSet.find(
                (obj) => obj.moduleId === item.id
              ).modulePrice,
              selected: this.isSmartCalDot,
            }));
              modulePrice: this.data.modulePriceSet.find((obj) => obj.moduleId === item.id).modulePrice,
              selected: this.isSmartCalDot
            }))
          this.cartItem.sdks =
            curProdObj.sdks &&
            curProdObj.sdks.map((item) => ({
              id: item.id,
              sdkName: item.sdkName,
              selected: this.data.productType == 3 ? true : false,
            }));
              selected: this.data.productType == 3 ? true : false
            }))
          this.cartItem.sdks.forEach((sdk) => {
            if (sdk.selected) {
              this.cartItem.sdkIds.push(sdk.id);
              this.cartItem.sdkIds.push(sdk.id)
            }
          });
          })
        })
        .catch((err) => {
          this.$notify({
            type: "error",
            message: err,
            duration: 2500,
            offset: 57,
          });
        });
            offset: 57
          })
        })
    },
    selectYear(year) {
      this.timeLength = year;
      this.cartItem.timeLength = year;
      this.timeLength = year
      this.cartItem.timeLength = year
    },
    selectModel(index) {
      if (this.isSmartCalDot) {
        return;
        return
      }
      this.cartItem.modules[index].selected =
        !this.cartItem.modules[index].selected;
      this.cartItem.modules[index].selected = !this.cartItem.modules[index].selected
      this.cartItem.modules.forEach((item) => {
        if (item.selected && this.cartItem.moduleIds.indexOf(item.id) < 0) {
          this.cartItem.moduleIds.push(item.id);
          this.cartItem.moduleIds.push(item.id)
        }
        if (!item.selected && this.cartItem.moduleIds.indexOf(item.id) >= 0) {
          this.cartItem.moduleIds.splice(
            this.cartItem.moduleIds.indexOf(item.id),
            1
          );
          this.cartItem.moduleIds.splice(this.cartItem.moduleIds.indexOf(item.id), 1)
        }
      });
      })
    },
    handleChangeCh() {
      if (this.cartItem.authCount < this.cartItem.chCount) {
        this.cartItem.authCount = this.cartItem.chCount;
        this.cartItem.authCount = this.cartItem.chCount
      }
    },
    selectAlgorithm(index) {
      this.cartItem.sdks[index].selected = !this.cartItem.sdks[index].selected;
      this.cartItem.sdks[index].selected = !this.cartItem.sdks[index].selected
      this.cartItem.sdks.forEach((item) => {
        if (item.selected && this.cartItem.sdkIds.indexOf(item.id) < 0) {
          this.cartItem.sdkIds.push(item.id);
          this.cartItem.sdkIds.push(item.id)
        }
        if (!item.selected && this.cartItem.sdkIds.indexOf(item.id) >= 0) {
          this.cartItem.sdkIds.splice(this.cartItem.sdkIds.indexOf(item.id), 1);
          this.cartItem.sdkIds.splice(this.cartItem.sdkIds.indexOf(item.id), 1)
        }
      });
      })
    },
    getDevList() {
      findDevListByUser()
        .then((res) => {
          this.devList = res.data.menus;
          this.devList = res.data.menus
        })
        .catch((err) => {
          console.log(err);
        });
          console.log(err)
        })
    },
    handleChangeAuth() {
      if (this.cartItem.authCount < this.cartItem.chCount) {
@@ -531,16 +481,16 @@
          type: "warning",
          message: "授权数量不能小于通道数量",
          duration: 2500,
          offset: 57,
        });
        this.byChecked = false;
          offset: 57
        })
        this.byChecked = false
      } else {
        this.byChecked = true;
        this.byChecked = true
      }
    },
    selectImg(index, url) {
      this.activeImg.index = index;
      this.activeImg.url = url;
      this.activeImg.index = index
      this.activeImg.url = url
    },
    confirmNow() {
      let products = [
@@ -557,19 +507,19 @@
          sdkIds: this.cartItem.sdkIds,
          serveYear: this.cartItem.timeLength,
          targetPlatform: this.cartItem.targetPlatform,
          vGpu: this.cartItem.vGpu,
        },
      ];
          vGpu: this.cartItem.vGpu
        }
      ]
      resumeOrder({
        // orderMoney: this.numeral(this.totalMoney).value(),
        orderMoney: 0,
        payMethod: 0,
        products,
        status: 0,
        userId: JSON.parse(sessionStorage.getItem("userInfo")).id,
        userId: JSON.parse(sessionStorage.getItem("userInfo")).id
      }).then((res) => {
        if (res.success) {
          this.orderId = res.data.orderId;
          this.orderId = res.data.orderId
          if (this.totalMoney == 0) {
            resumePay({ orderId: this.orderId, payMethod: 5 }).then((res) => {
@@ -577,26 +527,26 @@
                this.$router.push({
                  path: "/personalCenter",
                  query: {
                    id: 0,
                  },
                });
                    id: 0
                  }
                })
                this.$notify({
                  type: "success",
                  message: "成功试用",
                  duration: 2500,
                  offset: 57,
                });
                  offset: 57
                })
              }
            });
            return;
            })
            return
          } else {
            this.showOrder = true;
            this.showOrder = true
          }
        }
      });
    },
  },
};
      })
    }
  }
}
</script>
<style lang="scss" scoped>
@@ -850,4 +800,4 @@
    }
  }
}
</style>
</style>
src/views/search/components/CardItem.vue
@@ -20,15 +20,8 @@
            indicator-position="none"
            :arrow="data.baseInfo.length > 1 ? 'always' : 'never'"
          >
            <el-carousel-item
              v-for="(item, index) in data.baseInfo"
              :key="index"
            >
              <img
                :src="item.targetPicUrl | httpImage"
                class="cursor-pointer"
                @click="detailsClick($event)"
              />
            <el-carousel-item v-for="(item, index) in data.baseInfo" :key="index">
              <img :src="item.targetPicUrl | httpImage" class="cursor-pointer" @click="detailsClick($event)" />
            </el-carousel-item>
          </el-carousel>
        </div>
@@ -36,15 +29,10 @@
          class="s-card-left-isCompare-div compareScore111"
          :style="{
            bottom: '0',
            background: getUrl(
              data.baseInfo[initialIndex] && data.baseInfo[initialIndex].bwType
            ),
            background: getUrl(data.baseInfo[initialIndex] && data.baseInfo[initialIndex].bwType)
          }"
        >
          <b>{{
            data.baseInfo[initialIndex] &&
            data.baseInfo[initialIndex].compareScore | percentage
          }}</b>
          <b>{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].compareScore | percentage }}</b>
        </div>
      </div>
    </div>
@@ -60,23 +48,13 @@
          :autoplay="false"
          @change="changeCarousel"
        >
          <el-carousel-item
            v-for="(item, index) in data.picMaxUrl"
            :key="index + 'img'"
          >
            <img
              :src="item | httpImage"
              class="cursor-pointer"
              @click="detailsClick($event)"
            />
          <el-carousel-item v-for="(item, index) in data.picMaxUrl" :key="index + 'img'">
            <img :src="item | httpImage" class="cursor-pointer" @click="detailsClick($event)" />
          </el-carousel-item>
        </el-carousel>
        <!-- 暂时认为只有人脸抓拍的报警, 首页显示小图, 其他时间均显示大图 -->
        <img
          v-else-if="
            data.targetInfo == null ||
            data.targetInfo[0].targetType !== 'FaceDetect'
          "
          v-else-if="data.targetInfo == null || data.targetInfo[0].targetType !== 'FaceDetect'"
          :src="data.picMaxUrl[0] | httpImage"
          class="cursor-pointer"
          @click="detailsClick($event)"
@@ -89,10 +67,7 @@
        />
      </div>
      <div class="s-card-left-box" v-else>
        <img
          :src="data.baseInfo[0].targetPicUrl | httpImage"
          class="cursor-pointer"
        />
        <img :src="data.baseInfo[0].targetPicUrl | httpImage" class="cursor-pointer" />
      </div>
    </div>
@@ -106,9 +81,7 @@
        @mouseleave="cardMouseleave($event)"
      >
        <p>
          <span class="fontStyle color222">{{
            data.picDate | formatTime
          }}</span>
          <span class="fontStyle color222">{{ data.picDate | formatTime }}</span>
        </p>
        <p style="margin-bottom: 8px">
          <span class="fontStyle color222">{{ data.cameraAddr }}</span>
@@ -117,9 +90,7 @@
          <div slot="content">
            <p v-for="(item, index) in data.alarmRules" :key="index + 'rule'">
              <span>{{ data.taskName }}</span
              >&nbsp;
              <span v-if="item.alarmLevel !== '撤防'"
                >&nbsp;{{ item.alarmLevel }}</span
              >&nbsp; <span v-if="item.alarmLevel !== '撤防'">&nbsp;{{ item.alarmLevel }}</span
              >&nbsp;
              <span v-if="item.linkInfo == '联动任务'">&nbsp;联动任务</span>
            </p>
@@ -143,14 +114,9 @@
            >
              <span class="fontStyle color666">{{ data.taskName }}</span
              >&nbsp;
              <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'"
                >&nbsp;{{ item.alarmLevel }}</span
              <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'">&nbsp;{{ item.alarmLevel }}</span
              >&nbsp;
              <span
                class="fontStyle color666"
                v-if="item.linkInfo == '联动任务'"
                >&nbsp;联动任务</span
              >
              <span class="fontStyle color666" v-if="item.linkInfo == '联动任务'">&nbsp;联动任务</span>
              <span v-if="index < data.alarmRules.length - 1">/&nbsp;</span>
            </span>
          </el-button>
@@ -158,49 +124,18 @@
        <el-tooltip placement="right" popper-class="atooltip">
          <div slot="content">
            <p>
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].tableName
                "
                >{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].tableName
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName">{{
                data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName
              }}</span
              >&nbsp;
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].targetName
                "
                >/&nbsp;{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].targetName
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName"
                >/&nbsp;{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName }}</span
              >&nbsp;
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].labels
                "
                >/&nbsp;{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].labels | idCard
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels"
                >/&nbsp;{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels | idCard }}</span
              >&nbsp;
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].monitorLevel
                "
                >/&nbsp;{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].monitorLevel
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel"
                >/&nbsp;{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel }}</span
              >
            </p>
          </div>
@@ -219,55 +154,23 @@
          >
            <span
              :style="
                data.baseInfo[initialIndex] &&
                data.baseInfo[initialIndex].bwType === '1'
                data.baseInfo[initialIndex] && data.baseInfo[initialIndex].bwType === '1'
                  ? 'color: red;font-size:12px;line-height:20px'
                  : 'font-size:12px;line-height:20px'
              "
            >
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].tableName
                "
                >{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].tableName
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName">{{
                data.baseInfo[initialIndex] && data.baseInfo[initialIndex].tableName
              }}</span
              >&nbsp;
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].targetName
                "
                >/&nbsp;{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].targetName
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName"
                >/&nbsp;{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].targetName }}</span
              >&nbsp;
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].labels
                "
                >/&nbsp;{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].labels | idCard
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels"
                >/&nbsp;{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].labels | idCard }}</span
              >&nbsp;
              <span
                class="fontStyle"
                v-if="
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].monitorLevel
                "
                >/&nbsp;{{
                  data.baseInfo[initialIndex] &&
                  data.baseInfo[initialIndex].monitorLevel
                }}</span
              <span class="fontStyle" v-if="data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel"
                >/&nbsp;{{ data.baseInfo[initialIndex] && data.baseInfo[initialIndex].monitorLevel }}</span
              >
            </span>
          </el-button>
@@ -320,31 +223,17 @@
        <p :style="data.baseInfo[0].bwType == '0' ? '' : 'color:red'">
          <span>{{ data.baseInfo[0] && data.baseInfo[0].targetName }}</span
          >&nbsp;&nbsp;
          <span v-if="data.baseInfo[0].labels"
            >/&nbsp;{{ data.baseInfo[0].labels | idCard }}</span
          >
          <span v-if="data.baseInfo[0].labels">/&nbsp;{{ data.baseInfo[0].labels | idCard }}</span>
        </p>
      </div>
      <div class="card-icon-box">
        <el-tooltip
          content="查找此人"
          placement="top"
          popper-class="atooltip"
          style="margin-left: 10px"
        >
          <i
            class="iconfont iconsousuoren"
            @click="tosearch(data)"
            title="查找此人"
          ></i>
        <el-tooltip content="查找此人" placement="top" popper-class="atooltip" style="margin-left: 10px">
          <i class="iconfont iconsousuoren" @click="tosearch(data)" title="查找此人"></i>
        </el-tooltip>
      </div>
    </div>
    <!-- 没有底库 16:9图片 最正常的yolo抓拍 无人值守  正常yolo抓拍没有小图-->
    <div
      v-else-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''"
      class="s-card-right-signal"
    >
    <div v-else-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''" class="s-card-right-signal">
      <div
        class="signal-img-dev"
        :style="overflowState ? 'overflow: hidden' : 'overflow: auto'"
@@ -352,9 +241,7 @@
        @mouseleave="cardMouseleave($event)"
      >
        <p :title="data.picDate">
          <span class="fontStyle color222">{{
            data.picDate | formatTime
          }}</span>
          <span class="fontStyle color222">{{ data.picDate | formatTime }}</span>
        </p>
        <p :title="data.cameraAddr" style="margin-bottom: 8px">
          <span class="fontStyle color222">{{ data.cameraAddr }}</span>
@@ -363,10 +250,7 @@
          <div slot="content">
            <p v-for="(item, index) in data.alarmRules" :key="index + 'rule'">
              <span>{{ data.taskName }}</span
              >&nbsp;&nbsp;
              <span v-if="item.alarmLevel !== '撤防'">{{
                item.alarmLevel
              }}</span
              >&nbsp;&nbsp; <span v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span
              >&nbsp;
              <span v-if="item.linkInfo == '联动任务'">&nbsp;联动任务</span>
            </p>
@@ -389,16 +273,9 @@
            >
              <span class="fontStyle color666">{{ data.taskName }}</span
              >&nbsp;&nbsp;
              <span
                class="fontStyle color666"
                v-if="item.alarmLevel !== '撤防'"
                >{{ item.alarmLevel }}</span
              <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span
              >&nbsp;
              <span
                class="fontStyle color666"
                v-if="item.linkInfo == '联动任务'"
                >&nbsp;联动任务</span
              >
              <span class="fontStyle color666" v-if="item.linkInfo == '联动任务'">&nbsp;联动任务</span>
              <span v-if="index < data.alarmRules.length - 1">/&nbsp;</span>
            </span>
          </el-button>
@@ -407,18 +284,11 @@
      <div class="right-bottom">
        <div v-if="!data.id" class="card-icon-box">
          <!-- <i class="iconfont systemxing ml50" title="收藏" ></i> -->
          <el-tooltip
            content="查找此人"
            placement="top"
            popper-class="atooltip"
          >
          <el-tooltip content="查找此人" placement="top" popper-class="atooltip">
            <i class="iconfont iconsousuoren ml50" @click="tosearch(data)"></i>
          </el-tooltip>
        </div>
        <div
          v-if="data.targetInfo == null || data.targetInfo[0].picSmUrl == ''"
          class="card-icon-box"
        >
        <div 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>
@@ -433,18 +303,10 @@
          <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"
          >
          <el-tooltip content="查找此人" placement="top" popper-class="atooltip">
            <i class="iconfont iconsousuoren" @click="tosearch(data)"></i>
          </el-tooltip>
          <el-tooltip
            content="加入底库"
            placement="top"
            popper-class="atooltip"
          >
          <el-tooltip content="加入底库" placement="top" popper-class="atooltip">
            <i class="iconfont icontianjiaren" @click="toAdd(data)"></i>
          </el-tooltip>
          <!-- <el-tooltip content="收藏" placement="top" popper-class="atooltip">
@@ -455,10 +317,7 @@
    </div>
    <!-- 没有底库,非比对,普通模式 一定有targetInfo,并且targetInfo个数为1-->
    <div
      v-else-if="data.targetInfo !== null && data.targetInfo[0].picSmUrl !== ''"
      class="s-card-right-signal"
    >
    <div v-else-if="data.targetInfo !== null && data.targetInfo[0].picSmUrl !== ''" class="s-card-right-signal">
      <div
        class="signal-img-dev"
        :style="overflowState ? 'overflow: hidden' : 'overflow: auto'"
@@ -479,29 +338,18 @@
          <span v-else>{{ data.baseInfo[0].compareScore | percentage }}</span>
        </p>
        <p :title="data.picDate">
          <span class="fontStyle color222">{{
            data.picDate | formatTime
          }}</span>
          <span class="fontStyle color222">{{ data.picDate | 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"
          v-if="!VideoPhotoData.uploadType"
        >
        <el-tooltip placement="right" popper-class="atooltip" v-if="!VideoPhotoData.uploadType">
          <div slot="content">
            <p v-for="(item, index) in data.alarmRules" :key="index + 'rule2'">
              <span class="fontStyle">{{ data.taskName }}</span
              >&nbsp;&nbsp;
              <span class="fontStyle" v-if="item.alarmLevel !== '撤防'">{{
                item.alarmLevel
              }}</span
              >&nbsp;&nbsp; <span class="fontStyle" v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span
              >&nbsp;
              <span v-if="item.linkInfo == '联动任务'" class="fontStyle"
                >&nbsp;联动任务</span
              >
              <span v-if="item.linkInfo == '联动任务'" class="fontStyle">&nbsp;联动任务</span>
              <span v-if="index < data.alarmRules.length - 1">/&nbsp;</span>
            </p>
          </div>
@@ -517,22 +365,12 @@
              text-align: left;
            "
          >
            <span
              v-for="(item, index) in data.alarmRules"
              :key="index + 'rule3'"
            >
            <span v-for="(item, index) in data.alarmRules" :key="index + 'rule3'">
              <span class="fontStyle color666">{{ data.taskName }}</span
              >&nbsp;&nbsp;
              <span
                class="fontStyle color666"
                v-if="item.alarmLevel !== '撤防'"
                >{{ item.alarmLevel }}</span
              <span class="fontStyle color666" v-if="item.alarmLevel !== '撤防'">{{ item.alarmLevel }}</span
              >&nbsp;
              <span
                v-if="item.linkInfo == '联动任务'"
                class="fontStyle color666"
                >&nbsp;联动任务</span
              >
              <span v-if="item.linkInfo == '联动任务'" class="fontStyle color666">&nbsp;联动任务</span>
              <span v-if="index < data.alarmRules.length - 1">/&nbsp;</span>
            </span>
          </el-button>
@@ -548,16 +386,10 @@
          <div slot="content">
            <p v-for="(item, index) in data.baseInfo" :key="index + 'base1'">
              <span class="fontStyle">{{ item.tableName }}</span
              >&nbsp; <span class="fontStyle" v-if="item.targetName.length">/&nbsp;{{ item.targetName }}</span
              >&nbsp; <span class="fontStyle" v-if="item.labels.length">/&nbsp;{{ item.labels | idCard }}</span
              >&nbsp;
              <span class="fontStyle" v-if="item.targetName.length"
                >/&nbsp;{{ item.targetName }}</span
              >&nbsp;
              <span class="fontStyle" v-if="item.labels.length"
                >/&nbsp;{{ item.labels | idCard }}</span
              >&nbsp;
              <span class="fontStyle" v-if="item.labels.length"
                >/&nbsp;{{ item.labels | sex }}</span
              >
              <span class="fontStyle" v-if="item.labels.length">/&nbsp;{{ item.labels | sex }}</span>
            </p>
          </div>
          <el-button
@@ -576,36 +408,21 @@
              v-for="(item, index) in data.baseInfo"
              :key="index + 'base'"
              :style="
                item.bwType == '1'
                  ? 'color:red;font-size:12px;line-height:20px'
                  : 'font-size:12px;line-height:20px'
                item.bwType == '1' ? 'color:red;font-size:12px;line-height:20px' : 'font-size:12px;line-height:20px'
              "
            >
              <span class="fontStyle">{{ item.tableName }}</span
              >&nbsp; <span class="fontStyle" v-if="item.targetName.length">/&nbsp;{{ item.targetName }}</span
              >&nbsp; <span class="fontStyle" v-if="item.labels.length">/&nbsp;{{ item.labels | idCard }}</span
              >&nbsp;
              <span class="fontStyle" v-if="item.targetName.length"
                >/&nbsp;{{ item.targetName }}</span
              >&nbsp;
              <span class="fontStyle" v-if="item.labels.length"
                >/&nbsp;{{ item.labels | idCard }}</span
              >&nbsp;
              <span class="fontStyle" v-if="item.labels.length"
                >/&nbsp;{{ item.labels | sex }}</span
              >
              <span class="fontStyle" v-if="item.labels.length">/&nbsp;{{ item.labels | sex }}</span>
            </span>
          </el-button>
        </el-tooltip>
        <el-tooltip
          placement="right"
          popper-class="atooltip"
          v-if="data.baseInfo == null"
          style="margin-top: 5px"
        >
        <el-tooltip placement="right" popper-class="atooltip" v-if="data.baseInfo == null" style="margin-top: 5px">
          <div slot="content">
            <span :style="'color:red;font-size:14px;line-height:20px'">{{
              data.showLabels
            }}</span>
            <span :style="'color:red;font-size:14px;line-height:20px'">{{ data.showLabels }}</span>
          </div>
          <el-button
            style="
@@ -619,9 +436,7 @@
              text-align: left;
            "
          >
            <span :style="'color:red;font-size:14px;line-height:20px'">{{
              data.showLabels
            }}</span>
            <span :style="'color:red;font-size:14px;line-height:20px'">{{ data.showLabels }}</span>
          </el-button>
        </el-tooltip>
      </div>
@@ -629,11 +444,7 @@
        <div v-if="!data.id" class="card-icon-box">
          <!-- 底库人员 -->
          <!-- <i class="iconfont systemxing ml50" title="收藏" ></i> -->
          <el-tooltip
            content="查找此人"
            placement="top"
            popper-class="atooltip"
          >
          <el-tooltip content="查找此人" placement="top" popper-class="atooltip">
            <i class="iconfont iconsousuoren ml50" @click="tosearch(data)"></i>
          </el-tooltip>
        </div>
@@ -687,23 +498,16 @@
        >
          <div>
            <p :title="data.picDate">
              <span class="fontStyle color222">{{
                data.picDate | formatTime
              }}</span>
              <span class="fontStyle color222">{{ data.picDate | formatTime }}</span>
            </p>
            <p :title="data.cameraAddr" style="margin-bottom: 8px">
              <span class="fontStyle color222">{{ data.cameraAddr }}</span>
            </p>
            <p v-for="(item, index) in data.alarmRules" :key="index + 'rule'">
              <span class="fontStyle color666">{{ data.taskName }}</span
              >&nbsp;/&nbsp; <span class="fontStyle color666">{{ item.alarmLevel }}</span
              >&nbsp;/&nbsp;
              <span class="fontStyle color666">{{ item.alarmLevel }}</span
              >&nbsp;/&nbsp;
              <span
                v-if="item.linkInfo == '联动任务'"
                class="fontStyle color666"
                >联动任务</span
              >
              <span v-if="item.linkInfo == '联动任务'" class="fontStyle color666">联动任务</span>
              <span v-if="index < data.alarmRules.length - 1">/&nbsp;</span>
            </p>
          </div>
@@ -714,7 +518,7 @@
</template>
<script>
Date.prototype.Format = function (fmt) {
Date.prototype.Format = function(fmt) {
  var o = {
    "M+": this.getMonth() + 1, //月份
    "d+": this.getDate(), //日
@@ -722,78 +526,69 @@
    "m+": this.getMinutes(), //分
    "s+": this.getSeconds(), //秒
    "q+": Math.floor((this.getMonth() + 3) / 3), //季度
    S: this.getMilliseconds(), //毫秒
  };
  if (/(y+)/.test(fmt))
    fmt = fmt.replace(
      RegExp.$1,
      (this.getFullYear() + "").substr(4 - RegExp.$1.length)
    );
    S: this.getMilliseconds() //毫秒
  }
  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
  for (var k in o)
    if (new RegExp("(" + k + ")").test(fmt))
      fmt = fmt.replace(
        RegExp.$1,
        RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length)
      );
  return fmt;
};
      fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length))
  return fmt
}
export default {
  mounted() {
    //window.addEventListener("resize", this.watchWindow);
    window.addEventListener("resize", this.getBottom);
    window.addEventListener("resize", this.getBottom)
  },
  props: {
    data: {
      type: Object,
      default: null,
      default: null
    },
    showType: {
      type: String,
      default: "search",
      default: "search"
    },
    fromCluster: {
      type: Boolean,
      default: false,
      default: false
    },
    searchT: {},
    searchT: {}
  },
  computed: {
    isId() {
      return this.data.id;
    },
      return this.data.id
    }
  },
  filters: {
    formatTime(t) {
      return new Date(t).Format("yyyy-MM-dd HH:mm:ss");
      return new Date(t).Format("yyyy-MM-dd HH:mm:ss")
    },
    percentage(score) {
      return score.toFixed(2) + "%";
      return score.toFixed(2) + "%"
    },
    idCard(v) {
      try {
        let obj = JSON.parse(v);
        return obj.idCard;
        let obj = JSON.parse(v)
        return obj.idCard
      } catch (error) {
        return v.split("/")[1];
        return v.split("/")[1]
      }
    },
    sex(v) {
      try {
        let obj = JSON.parse(v);
        return obj.sex;
        let obj = JSON.parse(v)
        return obj.sex
      } catch (error) {
        return v.split("/")[0];
        return v.split("/")[0]
      }
    },
    httpImage(url) {
      if (!url.length) {
        return "";
        return ""
      }
      return (
        "/httpImage/" + url + (url.indexOf("?") >= 0 ? "&" : "?") + "width=160"
      );
    },
      return "/httpImage/" + url + (url.indexOf("?") >= 0 ? "&" : "?") + "width=160"
    }
  },
  data() {
    return {
@@ -801,64 +596,62 @@
      initialIndex: 0,
      carouselIndex: 0,
      dialogVisible: false,
      overflowState: true,
    };
      overflowState: true
    }
  },
  watch: {
    data: {
      handler() {
        this.$forceUpdate();
        this.$forceUpdate()
      },
      deep: true,
    },
      deep: true
    }
  },
  methods: {
    getBottom() {
      this.$nextTick(() => {
        let imgDom = this.$refs.firstImg;
        let imgDom = this.$refs.firstImg
        if (imgDom) {
          let num = (imgDom.offsetHeight - imgDom.offsetWidth) / 2;
          return `${num}px`;
          let num = (imgDom.offsetHeight - imgDom.offsetWidth) / 2
          return `${num}px`
        }
        return `4px`;
      });
        return `4px`
      })
    },
    getUrl(bwtype) {
      if (bwtype == 1) {
        return `url(${require("@/assets/img/red.png")})`;
        return `url(${require("@/assets/img/red.png")})`
      } else {
        return `url(${require("@/assets/img/green.png")})`;
        return `url(${require("@/assets/img/green.png")})`
      }
    },
    changeInitialIndex(index) {
      this.initialIndex = index;
      this.initialIndex = index
    },
    cardMouseenter() {
      this.overflowState = false;
      this.overflowState = false
    },
    cardMouseleave() {
      this.overflowState = true;
      this.overflowState = true
    },
    changeCarousel(index) {
      this.carouselIndex = index;
      this.carouselIndex = index
    },
    detailsClick(ev) {
      this.$emit("detailsClick", ev);
      this.$emit("detailsClick", ev)
    },
    toAdd(item) {
      this.$emit("addToBase", item);
      this.$emit("addToBase", item)
    },
    tosearch(item) {
      this.searchT;
      let captureId = item.id == "" ? item.baseInfo[0].targetId : item.id;
      let imgUrl = item.targetInfo
        ? item.targetInfo[0].picSmUrl
        : item.baseInfo[0].targetPicUrl;
      let compType = 1; //  数据来自于es
      this.searchT
      let captureId = item.id == "" ? item.baseInfo[0].targetId : item.id
      let imgUrl = item.targetInfo ? item.targetInfo[0].picSmUrl : item.baseInfo[0].targetPicUrl
      let compType = 1 //  数据来自于es
      if (!item.id || item.id == "") {
        compType = 0; // 数据来自于底库
        compType = 0 // 数据来自于底库
      }
      let message;
      let message
      if (this.fromCluster) {
        message =
          "toCluster?showType=findByPic&targetId=" +
@@ -872,7 +665,7 @@
          "&start=" +
          this.searchT[0] +
          "&end=" +
          this.searchT[1];
          this.searchT[1]
      } else {
        message =
          "toSearch?showType=findByPic&targetId=" +
@@ -886,19 +679,22 @@
          "&start=" +
          this.searchT[0] +
          "&end=" +
          this.searchT[1];
          this.searchT[1]
      }
      window.parent.postMessage(
        {
          msg: message,
          msg: message
        },
        "*"
      );
    },
  },
};
      )
    }
  }
}
</script>
<style lang="scss">
.cursor-pointer {
  cursor: pointer;
}
.fontStyle {
  font-family: PingFangSC-Medium;
}
tsconfig.json
@@ -12,18 +12,13 @@
    "allowJs": true,
    "sourceMap": true,
    "baseUrl": ".",
    "skipLibCheck": true,
    "types": ["webpack-env"],
    "paths": {
      "@/*": ["src/*"]
    },
    "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
, "src/router/index.js"  ],
  "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx", "src/router/index.js"],
  "exclude": ["node_modules"]
}