zhangzengfei
2022-08-04 a6119509e09abadc65f020f594ae446883567bd5
src/Pool/BaseManageData.ts
@@ -7,63 +7,58 @@
  getTagList,
  copy,
  move
} from "@/api/baseLibrary";
} from "@/api/baseLibrary"
export default class BaseManageData {
  public syncTables: Array<object> = [];
  public localTables: Array<object> = [];
  public personList: Array<object>;
  public personId: string = "";
  public blackList: Array<object> = [];
  public selectBlacks: Array<object> = [];
  public whiteList: Array<object> = [];
  public selectWhites: Array<object> = [];
  public page: number;
  public size: number;
  public contentValue: string = "";
  public tableId: number;
  public orderName: string = "createTime";
  public orderType: string = "desc";
  public faceUrl: string = "";
  public threshold: number = 60;
  public total: number;
  public picUrl: string = "";
  public syncTables: Array<object> = []
  public localTables: Array<object> = []
  public personList: Array<object>
  public personId: string = ""
  public blackList: Array<object> = []
  public selectBlacks: Array<object> = []
  public whiteList: Array<object> = []
  public selectWhites: Array<object> = []
  public page: number
  public size: number
  public contentValue: string = ""
  public tableId: number
  public orderName: string = "createTime"
  public orderType: string = "desc"
  public faceUrl: string = ""
  public threshold: number = 60
  public total: number
  public picUrl: string = ""
  constructor() {
    this.personList = [];
    this.page = 1;
    this.size = 10;
    this.total = 0;
    this.personList = []
    this.page = 1
    this.size = 10
    this.total = 0
  }
  cleanData() {
    this.personList = [];
    this.page = 1;
    this.size = 10;
    this.total = 0;
    this.personList = []
    this.page = 1
    this.size = 10
    this.total = 0
  }
  async querySyncTables() {
    const rsp: any = await getSyncTables({
    });
    const rsp: any = await getSyncTables({})
    if (rsp && rsp.success) {
      this.syncTables.splice(0, this.syncTables.length)
      rsp.data.datalist.forEach(element => {
        this.syncTables.push((element as any))
      });
      rsp.data.datalist.forEach((element) => {
        this.syncTables.push(element as any)
      })
    }
  }
  async queryLocalTables() {
    const rsp: any = await getLocalTables({
    });
    const rsp: any = await getLocalTables({})
    if (rsp && rsp.success) {
      this.localTables.splice(0, this.localTables.length)
      rsp.data.datalist.forEach(element => {
        this.localTables.push((element as any))
      });
      rsp.data.datalist.forEach((element) => {
        this.localTables.push(element as any)
      })
    }
  }
@@ -75,37 +70,34 @@
      contentValue: this.contentValue,
      orderType: this.orderType,
      orderName: this.orderName
    });
    })
    if (rsp && rsp.success) {
      this.personList.splice(0, this.personList.length)
      rsp.data.datalist.forEach(element => {
      rsp.data.datalist.forEach((element) => {
        let carUrls = element.carPicUrls.split(";")
        element.carUrls = []
        carUrls.forEach(picUrl => {
        carUrls.forEach((picUrl) => {
          element.carUrls.push({ url: "/httpImage/" + picUrl })
        });
        })
        element.faceUrl = []
        element.faceUrl.push({ url: "/httpImage/" + element.personPicUrl })
        this.personList.push((element as any))
      });
        this.personList.push(element as any)
      })
      this.total = rsp.data.total
    }
  }
  async queryPersonListByPhoto() {
    const rsp: any = await getPersonListByPhoto({
    });
    const rsp: any = await getPersonListByPhoto({})
    if (rsp && rsp.success) {
      this.personList.splice(0, this.personList.length)
      rsp.data.datalist.forEach(element => {
        this.personList.push((element as any))
      });
      rsp.data.datalist.forEach((element) => {
        this.personList.push(element as any)
      })
    }
  }
  async searchPhotoFromBase() {
    var bases = new Array()
    console.log("tableId", this.tableId)
    bases.push(this.tableId)
    const rsp: any = await searchFromBase({
      databases: bases,
@@ -114,41 +106,43 @@
      threshold: this.threshold,
      picUrl: this.picUrl
    })
    console.log("底库以图搜图返回:", rsp)
    this.personList = [];
    this.personList = []
    if (rsp && rsp.success) {
      rsp.data.totalList.forEach(element => {
        this.personList.push((element as any))
      });
      console.log("列表:", this.personList)
      rsp.data.totalList.forEach((element) => {
        this.personList.push(element as any)
      })
      this.total = rsp.data.total
    }
  }
  async queryTagList() {
    const rsp: any = await getTagList({});
    const rsp: any = await getTagList({})
    // console.log("tag返回值: ",rsp)
    if (rsp && rsp.success) {
      // 放置黑白名单 0为白名单
      this.blackList.length = 0
      this.whiteList.length = 0
      rsp.data.forEach(i => {
        if (i.status === 0 && i.bwType === "0") { //白名单
          if (i.analyServerId === "") { //同步库
            i.title = i.title + '(同步库)'
      rsp.data.forEach((i) => {
        if (i.status === 0 && i.bwType === "0") {
          //白名单
          if (i.analyServerId === "") {
            //同步库
            i.title = i.title + "(同步库)"
            this.whiteList.push(i)
          } else {
            this.whiteList.push(i)
          }
        }
        if (i.status === 0 && i.bwType === "1") { //黑名单
          if (i.analyServerId === "") { //同步库
            i.title = i.title + '(同步库)'
        if (i.status === 0 && i.bwType === "1") {
          //黑名单
          if (i.analyServerId === "") {
            //同步库
            i.title = i.title + "(同步库)"
            this.blackList.push(i)
          } else {
            this.blackList.push(i)
          }
        }
      });
      })
    }
  }
  async copyTo() {
@@ -167,7 +161,5 @@
    const rsp: any = await move(param)
    return rsp
  }
  mounted() {
  }
}
  mounted() {}
}