| | |
| | | }, |
| | | 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) { |
| | |
| | | }, |
| | | 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) { |
| | |
| | | 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() { |
| | |
| | | } |
| | | }, |
| | | deleteThis(id) { |
| | | debugger |
| | | |
| | | let token = |
| | | sessionStorage.getItem("loginedInfo") && |
| | | JSON.parse(sessionStorage.getItem("loginedInfo")).access_token; |
| | |
| | | return res.json(); |
| | | }) |
| | | .then((data) => { |
| | | // console.log(data.data); |
| | | if (data.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | |
| | | 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()); |
| | | } |
| | | }, |
| | |
| | | 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", |
| | |
| | | } |
| | | }, |
| | | async searchImgList(faceUrl, threshold) { |
| | | // console.log("搜图参数", faceUrl, threshold); |
| | | let json = { |
| | | tableId: this.baseObject.id, |
| | | page: this.current, |
| | |
| | | orderName: this.orderName, |
| | | }; |
| | | let res = await getPersonByPhoto(json); |
| | | // console.log("列表查询", json); |
| | | this.tableData = res.data.datalist; |
| | | this.total = res.data.total; |
| | | this.compare = true; |
| | |
| | | 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`, |
| | |
| | | } |
| | | }, |
| | | uploadSuccess() { |
| | | console.log("换脸成功了"); |
| | | }, |
| | | uploadError() { |
| | | console.log("换脸失败了"); |
| | | }, |
| | | deleteBatch() { |
| | | // console.log('要删除的', this.selectedRowKeys.length) |
| | | if (this.selectedRowKeys.length === 0) { |
| | | this.$notify({ |
| | | type: "warning", |
| | |
| | | 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", |
| | |
| | | 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 |
| | |
| | | } |
| | | }, |
| | | handleRowStyle({ row, rowIndex }) { |
| | | // console.log(row, rowIndex, "handleRowStyle"); |
| | | if (rowIndex === 0) { |
| | | return "background:#222222;"; |
| | | } |
| | |
| | | } |
| | | }, |
| | | tosearch(item) { |
| | | // console.log("跳转地址", item) |
| | | var curWwwPath = window.document.location.href; |
| | | var pathname = window.document.location.pathname; |
| | | var pos = curWwwPath.indexOf(pathname); |
| | |
| | | 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 + |
| | |
| | | carNos: temp, |
| | | }; |
| | | let resp = await plateBatch(param); |
| | | console.log("resp:", resp); |
| | | if (resp && resp.success) { |
| | | // 刷新car列表 |
| | | this.$notify({ |
| | |
| | | }, |
| | | async submitCar() { |
| | | this.$refs["formForCar"].validate(async (valid) => { |
| | | // console.log("通过验证", valid); |
| | | if (valid) { |
| | | let { ...json } = this.form; |
| | | |
| | |
| | | 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", |
| | |
| | | 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(() => { |
| | |
| | | watch: { |
| | | baseObject: { |
| | | handler(newVal, oldVal) { |
| | | // console.log(newVal, "监听baseObject"); |
| | | this.BaseManageData.cleanData(); |
| | | this.getCarList(); |
| | | }, |