fix:在人员管理模块人员录入中添加是否为海康设备的判断以及人脸评分检测
This commit is contained in:
parent
3f50794732
commit
f7f2365989
@ -266,4 +266,9 @@ export const getHikvisionPageApi = data => get('xmgl/xzHikvisionCompareData/page
|
||||
// 校验同步(批量)
|
||||
export const getHikvisionSyncApi = data => post('xmgl/xzHikvisionCompareData/sync', data);
|
||||
// 人员|车辆校验
|
||||
export const getHikvisionManualCompareApi = data => post('xmgl/xzHikvisionCompareData/manualCompareData', data);
|
||||
export const getHikvisionManualCompareApi = data => post('xmgl/xzHikvisionCompareData/manualCompareData', data);
|
||||
|
||||
|
||||
//海康人脸评分接口
|
||||
// export const checkfaceHikvisionApi = (data,token) => post('xmgl/recognition/checkfaceHikvision', data, { headers: {Authorization: token}});
|
||||
export const checkfaceHikvisionApi = data => post('xmgl/recognition/checkfaceHikvision', data);
|
||||
@ -804,12 +804,13 @@
|
||||
action="uploadUrl"
|
||||
:on-remove="(file) => handleRemove(file, 4)"
|
||||
:on-preview="(file) => handlePreview(file, 4)"
|
||||
:beforeUpload="(file) => handleBeforeUpload(file, 4)"
|
||||
:beforeUpload="(file) => handleBeforeUpload(file, 7)"
|
||||
list-type="picture"
|
||||
:show-file-list="false"
|
||||
:file-list="fieldAcquisitionUrlFile"
|
||||
:file-list="fieldAcquisitionFile"
|
||||
:http-request="(val) => handleUpload(val, 'livesFace')"
|
||||
>
|
||||
<!-- :file-list="fieldAcquisitionUrlFile" -->
|
||||
<el-button
|
||||
size="medium"
|
||||
style="padding: 9px 20px"
|
||||
@ -1034,6 +1035,8 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:autoCrop="true"
|
||||
:fixedBox="true"
|
||||
:outputSize="0.7"
|
||||
:maxImgSize="300"
|
||||
></vueCropper>
|
||||
<!-- </vue-scroll> -->
|
||||
</div>
|
||||
@ -1088,6 +1091,7 @@ import {
|
||||
sendBatchWokerApi,
|
||||
importImgDataApi,
|
||||
getDepartmentInfoList,
|
||||
checkfaceHikvisionApi,
|
||||
} from "@/assets/js/api/laborPerson";
|
||||
import {
|
||||
selectUserDevAuthorityByUserIdApi,
|
||||
@ -1110,6 +1114,7 @@ export default {
|
||||
props: ["adminDialogVisible"],
|
||||
data() {
|
||||
return {
|
||||
isIscDevice: false, // 判断是否为海康设备
|
||||
visible: false,
|
||||
defaultImg: require("../../../../../../assets/images/profile_photo.png"),
|
||||
idCardBigPhotoUrlFile: [],
|
||||
@ -1295,7 +1300,8 @@ export default {
|
||||
attendRulesList: [],
|
||||
enterpriseTypeId: "",
|
||||
cropperOption: {
|
||||
outputType: "png",
|
||||
// outputType: "png",
|
||||
outputType: "jpeg",
|
||||
img: "",
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
autoCropHeight: 360, // 默认生成截图框高度
|
||||
@ -1706,12 +1712,28 @@ export default {
|
||||
// 压缩图片
|
||||
lrz(file, { quality: 1 }).then((result) => {
|
||||
const formData = new FormData();
|
||||
formData.append("files", result.file);
|
||||
// formData.append("files", result.file);
|
||||
formData.append("files", result.file, "image.jpg");
|
||||
// 图片上传
|
||||
apiUploadImage(formData).then((res) => {
|
||||
if (res.code == 200 || res.status == "SUCCESS") {
|
||||
const imgInfo = res.data[0];
|
||||
|
||||
if (
|
||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||
imgInfo.fileInfo.contentType != "image/jpg"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("请上传jpg格式图片")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(imgInfo.fileInfo.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case "idCardAvatar": // 身份证头像
|
||||
this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
||||
@ -1720,9 +1742,19 @@ export default {
|
||||
];
|
||||
break;
|
||||
case "livesFace": // 现场采集人脸
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
let data = {fileUrl: imgInfo.imageUrl}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
console.log("333333333333333333333")
|
||||
console.log(res)
|
||||
console.log("333333333333333333333")
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}else{
|
||||
this.$message.error(res.result.message)
|
||||
}
|
||||
})
|
||||
// let imgStatus = result.file.size / 1024 < 500
|
||||
// if (!imgStatus) {
|
||||
// this.cropperOption.img =
|
||||
@ -1989,6 +2021,7 @@ export default {
|
||||
if (result.success) {
|
||||
if (result.result) {
|
||||
this.isUploadToHouse = result.result.housing ? true : false;
|
||||
this.isIscDevice = result.result.supplierType == 9 ? true : false;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -2631,6 +2664,12 @@ export default {
|
||||
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(file.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
@ -2866,14 +2905,29 @@ export default {
|
||||
checkFace(url) {
|
||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||
if (res.result.checkType == 1) {
|
||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
if(this.isIscDevice){
|
||||
let data = {fileUrl: url}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
}
|
||||
}else{
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
})
|
||||
|
||||
}else{
|
||||
this.$message({
|
||||
message: "非海康设备,请检查后重试!",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.result.message);
|
||||
@ -2891,7 +2945,8 @@ export default {
|
||||
return;
|
||||
}
|
||||
var param = new FormData();
|
||||
param.append("files", data, "image.png");
|
||||
// param.append("files", data, "image.png");
|
||||
param.append("files", data, "image.jpg");
|
||||
_this.$http
|
||||
.post("/upload/image", param, {
|
||||
headers: {
|
||||
|
||||
@ -953,6 +953,8 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:autoCrop="true"
|
||||
:fixedBox="true"
|
||||
:outputSize="0.7"
|
||||
:maxImgSize="300"
|
||||
></vueCropper>
|
||||
<!-- </vue-scroll> -->
|
||||
</div>
|
||||
@ -1007,6 +1009,7 @@ import {
|
||||
sendBatchWokerApi,
|
||||
importImgDataApi,
|
||||
getDepartmentInfoList,
|
||||
checkfaceHikvisionApi,
|
||||
} from "@/assets/js/api/laborPerson";
|
||||
import {
|
||||
selectUserDevAuthorityByUserIdApi,
|
||||
@ -1029,6 +1032,7 @@ export default {
|
||||
props: ["laborDialogVisible"],
|
||||
data() {
|
||||
return {
|
||||
isIscDevice: false, // 判断是否为海康设备
|
||||
visible: false,
|
||||
defaultImg: require("../../../../../../assets/images/profile_photo.png"),
|
||||
idCardBigPhotoUrlFile: [],
|
||||
@ -1215,7 +1219,8 @@ export default {
|
||||
attendRulesList: [],
|
||||
enterpriseTypeId: "",
|
||||
cropperOption: {
|
||||
outputType: "png",
|
||||
// outputType: "png",
|
||||
outputType: "jpeg",
|
||||
img: "",
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
autoCropHeight: 360, // 默认生成截图框高度
|
||||
@ -1574,12 +1579,28 @@ export default {
|
||||
// 压缩图片
|
||||
lrz(file, { quality: 1 }).then((result) => {
|
||||
const formData = new FormData();
|
||||
formData.append("files", result.file);
|
||||
// formData.append("files", result.file);
|
||||
formData.append("files", result.file, "image.jpg");
|
||||
// 图片上传
|
||||
apiUploadImage(formData).then((res) => {
|
||||
if (res.code == 200 || res.status == "SUCCESS") {
|
||||
const imgInfo = res.data[0];
|
||||
|
||||
if (
|
||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||
imgInfo.fileInfo.contentType != "image/jpg"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("请上传jpg格式图片")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(imgInfo.fileInfo.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case "idCardAvatar": // 身份证头像
|
||||
this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
||||
@ -1588,9 +1609,19 @@ export default {
|
||||
];
|
||||
break;
|
||||
case "livesFace": // 现场采集人脸
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
let data = {fileUrl: imgInfo.imageUrl}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
console.log("333333333333333333333")
|
||||
console.log(res)
|
||||
console.log("333333333333333333333")
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}else{
|
||||
this.$message.error(res.result.message)
|
||||
}
|
||||
})
|
||||
// let imgStatus = result.file.size / 1024 < 500
|
||||
// if (!imgStatus) {
|
||||
// this.cropperOption.img =
|
||||
@ -1857,6 +1888,7 @@ export default {
|
||||
if (result.success) {
|
||||
if (result.result) {
|
||||
this.isUploadToHouse = result.result.housing ? true : false;
|
||||
this.isIscDevice = result.result.supplierType == 9 ? true : false;
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -2450,6 +2482,12 @@ export default {
|
||||
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(file.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
@ -2673,13 +2711,27 @@ export default {
|
||||
checkFace(url) {
|
||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||
if (res.result.checkType == 1) {
|
||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
if(this.isIscDevice){
|
||||
let data = {fileUrl: url}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
} else {
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
}
|
||||
}else{
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$message({
|
||||
message: "非海康设备,请检查后重试!",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.result.message);
|
||||
@ -2697,7 +2749,8 @@ export default {
|
||||
return;
|
||||
}
|
||||
var param = new FormData();
|
||||
param.append("files", data, "image.png");
|
||||
// param.append("files", data, "image.png");
|
||||
param.append("files", data, "image.jpg");
|
||||
_this.$http
|
||||
.post("/upload/image", param, {
|
||||
headers: {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -55,10 +55,11 @@
|
||||
class="upload-demo"
|
||||
:action="uploadUrl"
|
||||
:on-success="(res, file) => handleSuccess(res, 1, file)"
|
||||
:beforeUpload="(file) => handleBeforeUpload(file, 1)"
|
||||
:beforeUpload="(file) => handleBeforeUpload(file, 7)"
|
||||
:show-file-list="false"
|
||||
name="files"
|
||||
accept=".jpg, .jpeg"
|
||||
:http-request="(val) => handleUpload(val, 'livesFace')"
|
||||
>
|
||||
<el-button size="small" type="primary">{{
|
||||
$t("message.laborMange.updateOnsitePhotos")
|
||||
@ -2306,6 +2307,8 @@
|
||||
:autoCropHeight="cropperOption.autoCropHeight"
|
||||
:autoCrop="true"
|
||||
:fixedBox="true"
|
||||
:outputSize="0.7"
|
||||
:maxImgSize="300"
|
||||
></vueCropper>
|
||||
<!-- </vue-scroll> -->
|
||||
</div>
|
||||
@ -2400,11 +2403,15 @@ import {
|
||||
checkImgLibraryApi,
|
||||
safeReduceDetailList,
|
||||
resetScoreApi,
|
||||
checkfaceHikvisionApi,
|
||||
getProjectUfaceConfigInfo,
|
||||
} from "@/assets/js/api/laborPerson.js";
|
||||
import { getProjectConfigListApi } from "@/assets/js/api/project.js";
|
||||
import { selectUserDevAuthorityByUserIdApi } from "@/assets/js/api/configManage";
|
||||
import QRCode from "qrcodejs2";
|
||||
import { VueCropper } from "vue-cropper";
|
||||
import { apiUploadImage } from "@/assets/js/api/common";
|
||||
import lrz from "lrz";
|
||||
export default {
|
||||
components: {
|
||||
VueCropper,
|
||||
@ -2461,7 +2468,8 @@ export default {
|
||||
autoCropHeight: 360, // 默认生成截图框高度
|
||||
},
|
||||
cropperOption: {
|
||||
outputType: "png",
|
||||
// outputType: "png",
|
||||
outputType: "jpeg",
|
||||
img: "",
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
autoCropHeight: 360, // 默认生成截图框高度
|
||||
@ -2486,6 +2494,7 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
isIscDevice: false, //是否是海康门禁isc设备
|
||||
};
|
||||
},
|
||||
|
||||
@ -2500,6 +2509,7 @@ export default {
|
||||
this.getSafeScoreDetail();
|
||||
this.getAttendRuleList();
|
||||
this.getProjectConfig();
|
||||
this.getConfig();//判断是否为海康设备
|
||||
},
|
||||
mounted() {
|
||||
new QRCode("workerQRcode", {
|
||||
@ -3095,35 +3105,122 @@ export default {
|
||||
// 上传前
|
||||
handleBeforeUpload(file, type) {
|
||||
console.log("上传前----", file);
|
||||
if (type == 1) {
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>第一版<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
// if (type == 1) {
|
||||
// if (
|
||||
// file.type != "image/jpeg" &&
|
||||
// file.type != "image/jpg" &&
|
||||
// file.type != "image/png"
|
||||
// // file.type != "image/png"
|
||||
// ) {
|
||||
// this.$message.error(this.$t("message.laborMange.hint8"));
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// >>>>>>>>>>>>>>>>>>>>>>>第一版<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||
if (
|
||||
file.type != "image/jpeg" &&
|
||||
file.type != "image/png" &&
|
||||
file.type != "image/jpg" &&
|
||||
file.type != "image/bmp"
|
||||
) {
|
||||
this.$message.error(this.$t("message.companyDiagram.uploadMsg")); //只能上传图片
|
||||
return false;
|
||||
} else if (type == 7) {
|
||||
console.log('11111111111111111111')
|
||||
console.log(file);
|
||||
console.log('11111111111111111111')
|
||||
if (
|
||||
file.type != "image/jpeg" &&
|
||||
file.type != "image/jpg" &&
|
||||
file.type != "image/png"
|
||||
file.type != "image/jpg"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("message.laborMange.hint8"));
|
||||
this.$message.error(this.$t("请上传jpg格式图片")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(file.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
handleUpload(fileData, type) {
|
||||
const file = fileData.file;
|
||||
// 压缩图片
|
||||
lrz(file, { quality: 1 }).then((result) => {
|
||||
const formData = new FormData();
|
||||
// formData.append("files", result.file);
|
||||
formData.append("files", result.file, "image.jpg");
|
||||
// 图片上传
|
||||
apiUploadImage(formData).then((res) => {
|
||||
if (res.code == 200 || res.status == "SUCCESS") {
|
||||
console.log("000000000000000000000000000")
|
||||
console.log(res)
|
||||
console.log("000000000000000000000000000")
|
||||
|
||||
const imgInfo = res.data[0];
|
||||
if (
|
||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||
imgInfo.fileInfo.contentType != "image/jpg"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("请上传jpg格式图片")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(imgInfo.fileInfo.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
// case "idCardAvatar": // 身份证头像
|
||||
// this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
||||
// this.idCardUpPhotoFile = [
|
||||
// { name: imgInfo.filename, url: imgInfo.imageUrl },
|
||||
// ];
|
||||
// break;
|
||||
case "livesFace": // 现场采集人脸
|
||||
let data = {fileUrl: imgInfo.imageUrl}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
console.log("333333333333333333333")
|
||||
console.log(res)
|
||||
console.log("333333333333333333333")
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}else{
|
||||
this.$message.error(res.result.message)
|
||||
}
|
||||
})
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
//上传成功
|
||||
handleSuccess(file, type, file2) {
|
||||
// type==1 现场采集照 2 身份证反面 3 身份证正面 4 合同 5 资格证书 6 身份证头像
|
||||
if (type == 1) {
|
||||
let imgStatus = file2.size / 1024 < 500;
|
||||
if (imgStatus) {
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + file.data[0].imageUrl;
|
||||
this.cropperDialog = true;
|
||||
} else if (this.isSzProject == 1) {
|
||||
console.log("6665");
|
||||
this.checkImgLibrary(file.data[0].imageUrl);
|
||||
} else {
|
||||
this.checkFace(file.data[0].imageUrl);
|
||||
}
|
||||
// this.cropperOption.img = this.$store.state.FILEURL + file.data[0].imageUrl;
|
||||
// this.cropperDialog = true;
|
||||
// let imgStatus = file2.size / 1024 < 500;
|
||||
// if (imgStatus) {
|
||||
// this.cropperOption.img =
|
||||
// this.$store.state.FILEURL + file.data[0].imageUrl;
|
||||
// this.cropperDialog = true;
|
||||
// } else if (this.isSzProject == 1) {
|
||||
// console.log("6665");
|
||||
// this.checkImgLibrary(file.data[0].imageUrl);
|
||||
// } else {
|
||||
// this.checkFace(file.data[0].imageUrl);
|
||||
// }
|
||||
// // this.cropperOption.img = this.$store.state.FILEURL + file.data[0].imageUrl;
|
||||
// // this.cropperDialog = true;
|
||||
} else if (type == 2) {
|
||||
this.workerInfo.idCardUpPhotoUrl = file.data[0].imageUrl;
|
||||
this.discernId(file.data[0].imageUrl, 2);
|
||||
@ -3195,6 +3292,19 @@ export default {
|
||||
}
|
||||
);
|
||||
},
|
||||
//判断是不是海康的设备
|
||||
getConfig() {
|
||||
getProjectUfaceConfigInfo({
|
||||
projectSn: this.$store.state.projectSn,
|
||||
}).then((result) => {
|
||||
if (result.success) {
|
||||
if (result.result) {
|
||||
// this.isUploadToHouse = result.result.housing ? true : false;
|
||||
this.isIscDevice = result.result.supplierType == 9 ? true : false;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//人脸监测、
|
||||
checkFace(url) {
|
||||
console.log("url", url);
|
||||
@ -3210,6 +3320,37 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
//人脸监测、第二版
|
||||
checkFace2(url) {
|
||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||
if (res.result.checkType == 1) {
|
||||
if(this.isIscDevice){
|
||||
let data = {fileUrl: url}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
console.log("7777777777777777777777")
|
||||
console.log(res)
|
||||
console.log("7777777777777777777777")
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
// this.personForm.fieldAcquisitionUrl = url;
|
||||
// this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
// this.cropperDialog = false;
|
||||
this.workerInfo.fieldAcquisitionUrl = url;
|
||||
this.cropperDialog = false;
|
||||
}else{
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$message({
|
||||
message: "非海康设备,请检查后重试!",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 保存编辑截图
|
||||
saveMapUrlEditFn() {
|
||||
this.$refs.cropperEdit.startCrop();
|
||||
@ -3260,7 +3401,8 @@ export default {
|
||||
return;
|
||||
}
|
||||
var param = new FormData();
|
||||
param.append("files", data, "image.png");
|
||||
// param.append("files", data, "image.png");
|
||||
param.append("files", data, "image.jpg");
|
||||
_this.$http
|
||||
.post("/upload/image", param, {
|
||||
headers: {
|
||||
@ -3278,7 +3420,12 @@ export default {
|
||||
// }
|
||||
// }
|
||||
if (res.data.status == "SUCCESS") {
|
||||
this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||
// this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||
if (this.isSzProject == 1) {
|
||||
this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||
} else {
|
||||
this.checkFace2(res.data.data[0].imageUrl);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -2416,6 +2416,7 @@ import {
|
||||
importImgDataApi,
|
||||
xmglXzHikvisionSyncGetNewestList,
|
||||
xmglXzHikvisionSyncRetryAPI,
|
||||
checkfaceHikvisionApi,
|
||||
} from "@/assets/js/api/laborPerson";
|
||||
import {
|
||||
selectUserDevAuthorityByUserIdApi,
|
||||
@ -2624,7 +2625,8 @@ export default {
|
||||
attendRulesList: [],
|
||||
enterpriseTypeId: "",
|
||||
cropperOption: {
|
||||
outputType: "png",
|
||||
// outputType: "png",
|
||||
outputType: "jpeg",
|
||||
img: "",
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
autoCropHeight: 360, // 默认生成截图框高度
|
||||
@ -2751,11 +2753,31 @@ export default {
|
||||
// 压缩图片
|
||||
lrz(file, { quality: 1 }).then((result) => {
|
||||
const formData = new FormData();
|
||||
formData.append("files", result.file);
|
||||
// formData.append("files", result.file);
|
||||
formData.append("files", result.file, "image.jpg");
|
||||
// 图片上传
|
||||
apiUploadImage(formData).then((res) => {
|
||||
if (res.code == 200 || res.status == "SUCCESS") {
|
||||
console.log("0000000000000000000000000000")
|
||||
console.log(res)
|
||||
console.log("0000000000000000000000000000")
|
||||
|
||||
const imgInfo = res.data[0];
|
||||
if (
|
||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||
imgInfo.fileInfo.contentType != "image/jpg"
|
||||
// file.type != "image/png"
|
||||
) {
|
||||
this.$message.error(this.$t("请上传jpg格式图片")); //"请上传jpg、jpeg格式图片"
|
||||
return false;
|
||||
}
|
||||
let imgSize = Number(imgInfo.fileInfo.size / 1024);
|
||||
console.log(11111111, imgSize);
|
||||
if (imgSize <= 10 || imgSize >= 200) {
|
||||
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
switch (type) {
|
||||
case "idCardAvatar": // 身份证头像
|
||||
@ -2765,9 +2787,22 @@ export default {
|
||||
];
|
||||
break;
|
||||
case "livesFace": // 现场采集人脸
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
let data = {fileUrl: imgInfo.imageUrl}
|
||||
// let token = this.$store.state.userInfo.token
|
||||
// checkfaceHikvisionApi(data,token).then((res) => {
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
console.log("333333333333333333333")
|
||||
console.log(res)
|
||||
console.log("333333333333333333333")
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.cropperOption.img =
|
||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||
this.cropperDialog = true;
|
||||
}else{
|
||||
this.$message.error(res.result.message)
|
||||
}
|
||||
})
|
||||
|
||||
// let imgStatus = result.file.size / 1024 < 500
|
||||
// if (!imgStatus) {
|
||||
// this.cropperOption.img =
|
||||
@ -4028,7 +4063,9 @@ export default {
|
||||
this.$message.error(this.$t("message.companyDiagram.uploadMsg")); //只能上传图片
|
||||
return false;
|
||||
} else if (type == 7) {
|
||||
console.log('11111111111111111111')
|
||||
console.log(file);
|
||||
console.log('11111111111111111111')
|
||||
if (
|
||||
file.type != "image/jpeg" &&
|
||||
file.type != "image/jpg"
|
||||
@ -4262,9 +4299,26 @@ export default {
|
||||
checkFace(url) {
|
||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||
if (res.result.checkType == 1) {
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
if(this.isIscDevice){
|
||||
let data = {fileUrl: url}
|
||||
checkfaceHikvisionApi(data).then((res) => {
|
||||
console.log("7777777777777777777777")
|
||||
console.log(res)
|
||||
console.log("7777777777777777777777")
|
||||
if(res.code == 200 && res.result.checkType == "1"){
|
||||
this.personForm.fieldAcquisitionUrl = url;
|
||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||
this.cropperDialog = false;
|
||||
}else{
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$message({
|
||||
message: "非海康设备,请检查后重试!",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.result.message);
|
||||
}
|
||||
@ -4281,7 +4335,8 @@ export default {
|
||||
return;
|
||||
}
|
||||
var param = new FormData();
|
||||
param.append("files", data, "image.png");
|
||||
// param.append("files", data, "image.png");
|
||||
param.append("files", data, "image.jpg");
|
||||
_this.$http
|
||||
.post("/upload/image", param, {
|
||||
headers: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user