ZZJ
2021-12-13 d91c8da48ca76f43999220971bc540227790c1e4
src/pages/library/components/carList.vue
@@ -730,19 +730,15 @@
  },
  methods: {
    handleRemoveCarPic(file, fileList) {
      console.log("删除文件", file, fileList);
      var index = fileList.findIndex((item) => {
        if (item.uid == file.uid) {
          return true;
        }
      });
      console.log("删除的索引", index);
      this.form.carUrls.splice(index, 1);
      console.log("删除后的fileList:", this.fileList);
    },
    handleRemoveFacePic(file, fileList) {
      this.form.faceUrl.splice(0, 1);
      console.log("删除后的faceUrl:", this.fileList);
    },
    beforeUoload() {},
    handlePictureCardPreview(file) {
@@ -751,19 +747,15 @@
    },
    async uploadCar(param) {
      const fd = new FormData();
      console.log("文件参数:", param);
      fd.append("file", param.file);
      fd.append("picType", "0");
      console.log("参数:", fd);
      let res = await request({
        method: "post",
        url: `/data/api-v/dbperson/fileupload`,
        data: fd,
      });
      console.log("图片上传结果:", res.success);
      if (res.success) {
        this.form.carUrls.push({ url: "/httpImage/" + res.data.picUrl });
        console.log("carUrl:", this.form.carUrls);
      }
    },
    async uploadPerson(param) {
@@ -778,7 +770,6 @@
      if (res.success) {
        this.form.faceUrl.push({ url: "/httpImage/" + res.data.picUrl });
        this.form.faceFeature = res.data.faceFeature;
        console.log("faceUrl:", this.form.faceUrl);
      }
    },
    addCar() {
@@ -844,6 +835,7 @@
      }
    },
    deleteThis(id) {
      let token =
        sessionStorage.getItem("loginedInfo") &&
        JSON.parse(sessionStorage.getItem("loginedInfo")).access_token;
@@ -864,7 +856,6 @@
              return res.json();
            })
            .then((data) => {
              // console.log(data.data);
              if (data.success) {
                this.$notify({
                  type: "success",
@@ -874,26 +865,20 @@
              this.getCarList();
            })
            .catch((err) => {
              console.log(err);
            });
        })
        .catch((_) => {});
    },
    sayHello() {
      console.log("hello");
    },
    getUploadResult(result) {
      console.log(result, "上传的返回");
      this.uploadResult = result.data;
      this.dialogVisible = true;
      this.getCarList();
    },
    async getCarList() {
      // console.log("执行了刷新函数", this.BaseManageData.syncTables[0]);
      if (this.baseObject.id && this.baseObject.id !== undefined) {
        // console.log("底库id", this.baseObject.id);
        this.BaseManageData.tableId = this.baseObject.id;
        // this.BaseManageData.queryPersonList();
        this.setLoadSearch(this.BaseManageData.queryPersonList());
      }
    },
@@ -923,18 +908,14 @@
      this.form.carColor += "";
      this.form.carType += "";
      this.form.carBrand += "";
      console.log("this.form", this.form);
      this.addDrawer = true;
    },
    async submit() {
      this.$refs["formForEdit"].validate(async (valid) => {
        // console.log("通过验证", valid);
        if (valid) {
          let { ...json } = this.form;
          delete json["compareScore"];
          // console.log("修改的参数:", json);
          let res = await updateBasePerson(json);
          // console.log("保存了", res);
          if (res.success) {
            this.$notify({
              type: "success",
@@ -999,7 +980,6 @@
      }
    },
    async searchImgList(faceUrl, threshold) {
      // console.log("搜图参数", faceUrl, threshold);
      let json = {
        tableId: this.baseObject.id,
        page: this.current,
@@ -1010,7 +990,6 @@
        orderName: this.orderName,
      };
      let res = await getPersonByPhoto(json);
      // console.log("列表查询", json);
      this.tableData = res.data.datalist;
      this.total = res.data.total;
      this.compare = true;
@@ -1020,7 +999,6 @@
      const fd = new FormData();
      fd.append("file", param.file);
      fd.append("id", this.form.id);
      // console.log("换脸了吗", fd);
      let res = await axios({
        method: "post",
        url: `/data/api-v/dbperson/updateFace`,
@@ -1037,13 +1015,10 @@
      }
    },
    uploadSuccess() {
      console.log("换脸成功了");
    },
    uploadError() {
      console.log("换脸失败了");
    },
    deleteBatch() {
      // console.log('要删除的', this.selectedRowKeys.length)
      if (this.selectedRowKeys.length === 0) {
        this.$notify({
          type: "warning",
@@ -1059,9 +1034,7 @@
          this.selectedRowKeys.map((item, index) => {
            ids.push(item.id);
          });
          // console.log('批量删除数组', ids)
          let res = await deleteBasePersons(ids);
          // console.log(res, '批量删除结果')
          if (res.success) {
            this.$notify({
              type: "success",
@@ -1081,7 +1054,6 @@
      await this.BaseManageData.querySyncTables();
      await this.BaseManageData.queryLocalTables();
      if (this.baseObject.id && this.baseObject.id !== undefined) {
        // console.log("one;", this.baseObject.id);
      } else if (
        this.BaseManageData.syncTables[0].id &&
        this.BaseManageData.syncTables[0].id !== undefined
@@ -1094,7 +1066,6 @@
      }
    },
    handleRowStyle({ row, rowIndex }) {
      // console.log(row, rowIndex, "handleRowStyle");
      if (rowIndex === 0) {
        return "background:#222222;";
      }
@@ -1126,7 +1097,6 @@
      }
    },
    tosearch(item) {
      // console.log("跳转地址", item)
      var curWwwPath = window.document.location.href;
      var pathname = window.document.location.pathname;
      var pos = curWwwPath.indexOf(pathname);
@@ -1134,7 +1104,6 @@
      var href = localhostPath + "/Layout/Searching";
      let captureId = item.id == "" ? item.personId : item.id;
      var url = item.personPicUrl ? item.personPicUrl : item.personPicUrl;
      // console.log("跳转地址",href,"url",url)
      var compType = 0;
      window.open(
        href +
@@ -1175,7 +1144,6 @@
        carNos: temp,
      };
      let resp = await plateBatch(param);
      console.log("resp:", resp);
      if (resp && resp.success) {
        // 刷新car列表
        this.$notify({
@@ -1193,7 +1161,6 @@
    },
    async submitCar() {
      this.$refs["formForCar"].validate(async (valid) => {
        // console.log("通过验证", valid);
        if (valid) {
          let { ...json } = this.form;
@@ -1209,16 +1176,13 @@
          json.carBrand = parseInt(json.carBrand);
          json.personPicUrl = json.faceUrl[0].url.substring(11);
          json.tableId = this.baseObject.id;
          console.log("表单的json化:", json);
          delete json["compareScore"];
          // console.log("修改的参数:", json);
          let res;
          if (json.id == "") {
            res = await addBaseCar(json);
          } else {
            res = await updateBaseCar(json);
          }
          console.log("保存了", res);
          if (res.success) {
            this.$notify({
              type: "success",
@@ -1352,7 +1316,6 @@
    window.onresize = () => {
      let width = document.body.clientWidth;
      let height = document.body.clientHeight;
      // console.log(width, height, "窗口变化对比", this.oldWidth, this.oldHeight);
      if (width !== this.oldWidth && width < 1750) {
      }
      this.$nextTick(() => {
@@ -1369,7 +1332,6 @@
  watch: {
    baseObject: {
      handler(newVal, oldVal) {
        // console.log(newVal, "监听baseObject");
        this.BaseManageData.cleanData();
        this.getCarList();
      },
@@ -1420,8 +1382,8 @@
}
.mask1 {
  position: absolute;
  width: 150px;
  height: 150px;
  width: 100px;
  height: 100px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(1px) brightness(100%);
  text-align: center;
@@ -1539,61 +1501,59 @@
  padding-left: 8px !important;
  padding-right: 0px !important;
}
.addToBase1 {
  width: 98%;
  height: 350px;
  position: relative;
  .topLabel {
    margin-top: 20px;
    height: 40px;
    border-bottom: 1px solid #eee;
    font-family: PingFangSC-Medium;
    font-size: 20px;
    font-weight: 600;
    line-height: 1rem;
    color: #222222;
    text-align: left;
    margin-left: 15px;
  }
  .items {
    width: 100%;
    height: auto;
    max-height: 35%;
    overflow-y: auto;
    margin: 20px 0px;
    .lable {
      width: 15%;
      margin-top: 10px;
      float: left;
      //font-family: PingFangSC-Medium;
      font-size: 14px;
      font-weight: 600;
    }
    .baseList {
      width: 85%;
      height: 100%;
      float: left;
      .base {
        width: calc(33% - 10px);
        padding: 0px 5px;
        line-height: 30px;
        float: left;
        text-align: left;
        font-size: 12px !important;
        .el-checkbox {
          width: 100%;
          display: block;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          .el-checkbox__label {
            display: inline !important;
          }
        }
      }
    }
  }
}
// .addToBase1 {
//   height: 350px;
//   position: relative;
//   .topLabel {
//     margin-top: 20px;
//     height: 40px;
//     border-bottom: 1px solid #eee;
//     font-family: PingFangSC-Medium;
//     font-size: 20px;
//     font-weight: 600;
//     line-height: 1rem;
//     color: #222222;
//     text-align: left;
//     margin-left: 15px;
//   }
//   .items {
//     width: 100%;
//     height: auto;
//     overflow-y: auto;
//       margin-bottom: 20px;
//     .lable {
//       // width: 15%;
//       margin-top: 10px;
//       // float: left;
//       //font-family: PingFangSC-Medium;
//       font-size: 14px;
//       font-weight: 600;
//     }
//     .baseList {
//       // width: 85%;
//       height: 100%;
//       // float: left;
//       .base {
//         width: calc(33% - 10px);
//         padding: 0px 5px;
//         line-height: 30px;
//         float: left;
//         text-align: left;
//         font-size: 12px !important;
//         .el-checkbox {
//           width: 100%;
//           display: block;
//           overflow: hidden;
//           text-overflow: ellipsis;
//           white-space: nowrap;
//           .el-checkbox__label {
//             display: inline !important;
//           }
//         }
//       }
//     }
//   }
// }
.copy,
.move {
  .el-dialog__body {
@@ -1602,9 +1562,9 @@
}
.avatar-uploader {
  max-width: 150px;
  min-width: 150px;
  min-height: 152px;
   max-width: 100px;
  min-width: 100px;
  min-height: 100px;
  border: 1px solid #eee;
}