fix:调整劳务管理模块中人员录入的vueCropper以及添加管理人员和临时人员的海康设备判断以及
This commit is contained in:
parent
cea8ecc1e6
commit
33dc504ffb
@ -1046,6 +1046,7 @@
|
|||||||
:autoCropHeight="cropperOption.autoCropHeight"
|
:autoCropHeight="cropperOption.autoCropHeight"
|
||||||
:outputSize="1"
|
:outputSize="1"
|
||||||
:maxImgSize="300"
|
:maxImgSize="300"
|
||||||
|
:centerBox="true"
|
||||||
mode="contain"
|
mode="contain"
|
||||||
:autoCrop="true"
|
:autoCrop="true"
|
||||||
></vueCropper>
|
></vueCropper>
|
||||||
|
|||||||
@ -964,6 +964,7 @@
|
|||||||
:autoCropHeight="cropperOption.autoCropHeight"
|
:autoCropHeight="cropperOption.autoCropHeight"
|
||||||
:outputSize="1"
|
:outputSize="1"
|
||||||
:maxImgSize="300"
|
:maxImgSize="300"
|
||||||
|
:centerBox="true"
|
||||||
mode="contain"
|
mode="contain"
|
||||||
:autoCrop="true"
|
:autoCrop="true"
|
||||||
></vueCropper>
|
></vueCropper>
|
||||||
|
|||||||
@ -507,6 +507,7 @@
|
|||||||
:autoCropHeight="cropperOption.autoCropHeight"
|
:autoCropHeight="cropperOption.autoCropHeight"
|
||||||
:outputSize="1"
|
:outputSize="1"
|
||||||
:maxImgSize="300"
|
:maxImgSize="300"
|
||||||
|
:centerBox="true"
|
||||||
mode="contain"
|
mode="contain"
|
||||||
:autoCrop="true"
|
:autoCrop="true"
|
||||||
></vueCropper>
|
></vueCropper>
|
||||||
|
|||||||
@ -2318,6 +2318,7 @@
|
|||||||
:autoCropHeight="cropperOption.autoCropHeight"
|
:autoCropHeight="cropperOption.autoCropHeight"
|
||||||
:outputSize="1"
|
:outputSize="1"
|
||||||
:maxImgSize="300"
|
:maxImgSize="300"
|
||||||
|
:centerBox="true"
|
||||||
mode="contain"
|
mode="contain"
|
||||||
:autoCrop="true"
|
:autoCrop="true"
|
||||||
></vueCropper>
|
></vueCropper>
|
||||||
|
|||||||
@ -2009,8 +2009,11 @@
|
|||||||
:outputType="cropperOption.outputType"
|
:outputType="cropperOption.outputType"
|
||||||
:autoCropWidth="cropperOption.autoCropWidth"
|
:autoCropWidth="cropperOption.autoCropWidth"
|
||||||
:autoCropHeight="cropperOption.autoCropHeight"
|
:autoCropHeight="cropperOption.autoCropHeight"
|
||||||
|
:outputSize="1"
|
||||||
|
:maxImgSize="300"
|
||||||
|
:centerBox="true"
|
||||||
|
mode="contain"
|
||||||
:autoCrop="true"
|
:autoCrop="true"
|
||||||
:fixedBox="true"
|
|
||||||
></vueCropper>
|
></vueCropper>
|
||||||
<!-- </vue-scroll> -->
|
<!-- </vue-scroll> -->
|
||||||
</div>
|
</div>
|
||||||
@ -2190,6 +2193,7 @@ import {
|
|||||||
importImgDataApi,
|
importImgDataApi,
|
||||||
xmglXzHikvisionSyncGetNewestList,
|
xmglXzHikvisionSyncGetNewestList,
|
||||||
xmglXzHikvisionSyncRetryAPI,
|
xmglXzHikvisionSyncRetryAPI,
|
||||||
|
checkfaceHikvisionApi,
|
||||||
} from "@/assets/js/api/laborPerson";
|
} from "@/assets/js/api/laborPerson";
|
||||||
import { selectUserDevAuthorityByUserIdApi } from "@/assets/js/api/configManage";
|
import { selectUserDevAuthorityByUserIdApi } from "@/assets/js/api/configManage";
|
||||||
import { getProjectConfigListApi } from "@/assets/js/api/project.js";
|
import { getProjectConfigListApi } from "@/assets/js/api/project.js";
|
||||||
@ -2358,7 +2362,7 @@ export default {
|
|||||||
enterpriseTypeId: "",
|
enterpriseTypeId: "",
|
||||||
enterpriseTypeList: [],
|
enterpriseTypeList: [],
|
||||||
cropperOption: {
|
cropperOption: {
|
||||||
outputType: "png",
|
outputType: "jpeg",
|
||||||
img: "",
|
img: "",
|
||||||
autoCropWidth: 300, // 默认生成截图框宽度
|
autoCropWidth: 300, // 默认生成截图框宽度
|
||||||
autoCropHeight: 360, // 默认生成截图框高度
|
autoCropHeight: 360, // 默认生成截图框高度
|
||||||
@ -2501,14 +2505,32 @@ export default {
|
|||||||
handleUpload(fileData, type) {
|
handleUpload(fileData, type) {
|
||||||
const file = fileData.file;
|
const file = fileData.file;
|
||||||
// 压缩图片
|
// 压缩图片
|
||||||
lrz(file, { quality: 1 }).then((result) => {
|
// lrz(file, { quality: 1 }).then((result) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("files", result.file);
|
// formData.append("files", result.file);
|
||||||
|
// formData.append("files", result.file, image.jpg);
|
||||||
|
formData.append("files", file, "image.jpg");
|
||||||
|
|
||||||
// 图片上传
|
// 图片上传
|
||||||
apiUploadImage(formData).then((res) => {
|
apiUploadImage(formData).then((res) => {
|
||||||
if (res.code == 200 || res.status == "SUCCESS") {
|
if (res.code == 200 || res.status == "SUCCESS") {
|
||||||
|
|
||||||
const imgInfo = res.data[0];
|
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) {
|
switch (type) {
|
||||||
case "idCardAvatar": // 身份证头像
|
case "idCardAvatar": // 身份证头像
|
||||||
this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
this.personForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
||||||
@ -2517,9 +2539,31 @@ export default {
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
case "livesFace": // 现场采集人脸
|
case "livesFace": // 现场采集人脸
|
||||||
|
if(this.isIscDevice){
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '图片检测中',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.5)'
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = {fileUrl: imgInfo.imageUrl}
|
||||||
|
checkfaceHikvisionApi(data).then((res) => {
|
||||||
|
if(res.code == 200 && res.result.checkType == "1"){
|
||||||
this.cropperOption.img =
|
this.cropperOption.img =
|
||||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||||
this.cropperDialog = true;
|
this.cropperDialog = true;
|
||||||
|
}else{
|
||||||
|
this.$message.error(res.result.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close();
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.cropperOption.img =
|
||||||
|
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||||
|
this.cropperDialog = true;
|
||||||
|
}
|
||||||
// let imgStatus = result.file.size / 1024 < 500
|
// let imgStatus = result.file.size / 1024 < 500
|
||||||
// if (!imgStatus) {
|
// if (!imgStatus) {
|
||||||
// this.cropperOption.img =
|
// this.cropperOption.img =
|
||||||
@ -2536,7 +2580,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
changePeople(val) {},
|
changePeople(val) {},
|
||||||
issuePersonFn() {
|
issuePersonFn() {
|
||||||
@ -3529,6 +3573,12 @@ export default {
|
|||||||
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
let imgSize = Number(file.size / 1024);
|
||||||
|
console.log(11111111, imgSize);
|
||||||
|
if (imgSize <= 10 || imgSize >= 200) {
|
||||||
|
this.$message.error("文件大小不能超过200kb小于10kb,请重新上传!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let fileType = file.type.split("/")[0];
|
let fileType = file.type.split("/")[0];
|
||||||
if (fileType == "image") {
|
if (fileType == "image") {
|
||||||
@ -3641,12 +3691,33 @@ export default {
|
|||||||
checkFace(url) {
|
checkFace(url) {
|
||||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||||
if (res.result.checkType == 1) {
|
if (res.result.checkType == 1) {
|
||||||
|
if(this.isIscDevice){
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '裁剪图片检测中',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.5)'
|
||||||
|
});
|
||||||
|
let data = {fileUrl: url}
|
||||||
|
checkfaceHikvisionApi(data).then((res) => {
|
||||||
|
if(res.code == 200 && res.result.checkType == "1"){
|
||||||
this.personForm.fieldAcquisitionUrl = url;
|
this.personForm.fieldAcquisitionUrl = url;
|
||||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||||
this.cropperDialog = false;
|
this.cropperDialog = false;
|
||||||
}else{
|
}else{
|
||||||
this.$message.error(res.result.message);
|
this.$message.error(res.result.message);
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close();
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.personForm.fieldAcquisitionUrl = url;
|
||||||
|
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||||
|
this.cropperDialog = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.result.message);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//保存截图
|
//保存截图
|
||||||
@ -3669,6 +3740,12 @@ export default {
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("aaaaa", res);
|
console.log("aaaaa", res);
|
||||||
|
let imgSize = Number(res.data.data[0].fileInfo.size / 1024);
|
||||||
|
console.log('经过vueCropper裁剪后', imgSize);
|
||||||
|
if (imgSize <= 10 || imgSize >= 200) {
|
||||||
|
this.$message.error("图片裁剪后大小不能超过200kb小于10kb,请重新裁剪或重新上传图片!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (res.data.status == "SUCCESS") {
|
if (res.data.status == "SUCCESS") {
|
||||||
if (this.isSzProject == 1) {
|
if (this.isSzProject == 1) {
|
||||||
this.checkImgLibrary(res.data.data[0].imageUrl);
|
this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||||
|
|||||||
@ -2261,6 +2261,7 @@
|
|||||||
:autoCropHeight="cropperOption.autoCropHeight"
|
:autoCropHeight="cropperOption.autoCropHeight"
|
||||||
:outputSize="1"
|
:outputSize="1"
|
||||||
:maxImgSize="300"
|
:maxImgSize="300"
|
||||||
|
:centerBox="true"
|
||||||
mode="contain"
|
mode="contain"
|
||||||
:autoCrop="true"
|
:autoCrop="true"
|
||||||
></vueCropper>
|
></vueCropper>
|
||||||
@ -2651,7 +2652,6 @@ export default {
|
|||||||
attendRulesList: [],
|
attendRulesList: [],
|
||||||
enterpriseTypeId: "",
|
enterpriseTypeId: "",
|
||||||
cropperOption: {
|
cropperOption: {
|
||||||
// outputType: "png",
|
|
||||||
outputType: "jpeg",
|
outputType: "jpeg",
|
||||||
img: "",
|
img: "",
|
||||||
autoCropWidth: 300, // 默认生成截图框宽度
|
autoCropWidth: 300, // 默认生成截图框宽度
|
||||||
@ -2786,11 +2786,10 @@ export default {
|
|||||||
// 图片上传
|
// 图片上传
|
||||||
apiUploadImage(formData).then((res) => {
|
apiUploadImage(formData).then((res) => {
|
||||||
if (res.code == 200 || res.status == "SUCCESS") {
|
if (res.code == 200 || res.status == "SUCCESS") {
|
||||||
console.log("0000000000000000000000000000")
|
console.log("图片上传后",res)
|
||||||
console.log(res)
|
|
||||||
console.log("0000000000000000000000000000")
|
|
||||||
|
|
||||||
const imgInfo = res.data[0];
|
const imgInfo = res.data[0];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
imgInfo.fileInfo.contentType != "image/jpeg" &&
|
||||||
imgInfo.fileInfo.contentType != "image/jpg"
|
imgInfo.fileInfo.contentType != "image/jpg"
|
||||||
@ -4148,9 +4147,7 @@ export default {
|
|||||||
this.$message.error(this.$t("message.companyDiagram.uploadMsg")); //只能上传图片
|
this.$message.error(this.$t("message.companyDiagram.uploadMsg")); //只能上传图片
|
||||||
return false;
|
return false;
|
||||||
} else if (type == 7) {
|
} else if (type == 7) {
|
||||||
console.log('11111111111111111111')
|
console.log("判断大小以及格式之前的图片",file);
|
||||||
console.log(file);
|
|
||||||
console.log('11111111111111111111')
|
|
||||||
if (
|
if (
|
||||||
file.type != "image/jpeg" &&
|
file.type != "image/jpeg" &&
|
||||||
file.type != "image/jpg"
|
file.type != "image/jpg"
|
||||||
@ -4407,10 +4404,6 @@ export default {
|
|||||||
loading.close();
|
loading.close();
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
// this.$message({
|
|
||||||
// message: "非海康设备,请检查后重试!",
|
|
||||||
// type: "error",
|
|
||||||
// });
|
|
||||||
this.personForm.fieldAcquisitionUrl = url;
|
this.personForm.fieldAcquisitionUrl = url;
|
||||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||||
this.cropperDialog = false;
|
this.cropperDialog = false;
|
||||||
|
|||||||
@ -587,9 +587,9 @@
|
|||||||
size="medium"
|
size="medium"
|
||||||
style="padding: 9px 20px"
|
style="padding: 9px 20px"
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="titleType != 'detail'"
|
|
||||||
>{{ $t("message.laborMange.clickOnTheUpload") }}</el-button
|
>{{ $t("message.laborMange.clickOnTheUpload") }}</el-button
|
||||||
>
|
>
|
||||||
|
<!-- v-if="titleType != 'detail'" -->
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<el-upload
|
<el-upload
|
||||||
action="uploadUrl"
|
action="uploadUrl"
|
||||||
@ -607,9 +607,9 @@
|
|||||||
size="medium"
|
size="medium"
|
||||||
style="padding: 9px 20px"
|
style="padding: 9px 20px"
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="titleType != 'detail'"
|
|
||||||
>{{ $t("message.laborMange.clickOnTheUpload") }}</el-button
|
>{{ $t("message.laborMange.clickOnTheUpload") }}</el-button
|
||||||
>
|
>
|
||||||
|
<!-- v-if="titleType != 'detail'" -->
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -679,8 +679,11 @@
|
|||||||
:outputType="cropperOption.outputType"
|
:outputType="cropperOption.outputType"
|
||||||
:autoCropWidth="cropperOption.autoCropWidth"
|
:autoCropWidth="cropperOption.autoCropWidth"
|
||||||
:autoCropHeight="cropperOption.autoCropHeight"
|
:autoCropHeight="cropperOption.autoCropHeight"
|
||||||
|
:outputSize="1"
|
||||||
|
:maxImgSize="300"
|
||||||
|
:centerBox="true"
|
||||||
|
mode="contain"
|
||||||
:autoCrop="true"
|
:autoCrop="true"
|
||||||
:fixedBox="true"
|
|
||||||
></vueCropper>
|
></vueCropper>
|
||||||
<!-- </vue-scroll> -->
|
<!-- </vue-scroll> -->
|
||||||
</div>
|
</div>
|
||||||
@ -710,6 +713,9 @@ import {
|
|||||||
editWorkerInfo,
|
editWorkerInfo,
|
||||||
deleteWorkerInfo,
|
deleteWorkerInfo,
|
||||||
getWorkerInfoList,
|
getWorkerInfoList,
|
||||||
|
checkfaceHikvisionApi,
|
||||||
|
getProjectUfaceConfigInfo,
|
||||||
|
checkFaceApi,
|
||||||
} from "@/assets/js/api/laborPerson";
|
} from "@/assets/js/api/laborPerson";
|
||||||
import {
|
import {
|
||||||
IdentityCodeValid
|
IdentityCodeValid
|
||||||
@ -725,11 +731,12 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isIscDevice: false, //是否是海康门禁isc设备
|
||||||
//显示的文件列表
|
//显示的文件列表
|
||||||
fieldAcquisitionUrlFile: [],
|
fieldAcquisitionUrlFile: [],
|
||||||
idCardBigPhotoUrlFile: [],
|
idCardBigPhotoUrlFile: [],
|
||||||
cropperOption: {
|
cropperOption: {
|
||||||
outputType: "png",
|
outputType: "jpeg",
|
||||||
img: "",
|
img: "",
|
||||||
autoCropWidth: 300, // 默认生成截图框宽度
|
autoCropWidth: 300, // 默认生成截图框宽度
|
||||||
autoCropHeight: 360, // 默认生成截图框高度
|
autoCropHeight: 360, // 默认生成截图框高度
|
||||||
@ -809,6 +816,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.projectSn = this.$store.state.projectSn;
|
this.projectSn = this.$store.state.projectSn;
|
||||||
this.getInfoList();
|
this.getInfoList();
|
||||||
|
this.getConfig();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 人员照片库比对
|
// 人员照片库比对
|
||||||
@ -842,6 +850,16 @@ export default {
|
|||||||
checkFace(url) {
|
checkFace(url) {
|
||||||
checkFaceApi({ fileUrl: url }).then((res) => {
|
checkFaceApi({ fileUrl: url }).then((res) => {
|
||||||
if (res.result.checkType == 1) {
|
if (res.result.checkType == 1) {
|
||||||
|
if(this.isIscDevice){
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '裁剪图片检测中',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.5)'
|
||||||
|
});
|
||||||
|
let data = {fileUrl: url}
|
||||||
|
checkfaceHikvisionApi(data).then((res) => {
|
||||||
|
if(res.code == 200 && res.result.checkType == "1"){
|
||||||
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||||
this.personForm.fieldAcquisitionUrl = url;
|
this.personForm.fieldAcquisitionUrl = url;
|
||||||
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||||
@ -854,6 +872,23 @@ export default {
|
|||||||
}else{
|
}else{
|
||||||
this.$message.error(res.result.message);
|
this.$message.error(res.result.message);
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close();
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
if (this.temporaryDialog1 || this.temporaryDialog2) {
|
||||||
|
this.personForm.fieldAcquisitionUrl = url;
|
||||||
|
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||||
|
this.cropperDialog = false;
|
||||||
|
} else {
|
||||||
|
this.addForm.fieldAcquisitionUrl = url;
|
||||||
|
this.fieldAcquisitionFile = [{ name: "", url: url }];
|
||||||
|
this.cropperDialog = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.result.message);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//保存截图
|
//保存截图
|
||||||
@ -876,6 +911,12 @@ export default {
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("aaaaa", res);
|
console.log("aaaaa", res);
|
||||||
|
let imgSize = Number(res.data.data[0].fileInfo.size / 1024);
|
||||||
|
console.log('经过vueCropper裁剪后', imgSize);
|
||||||
|
if (imgSize <= 10 || imgSize >= 200) {
|
||||||
|
this.$message.error("图片裁剪后大小不能超过200kb小于10kb,请重新裁剪或重新上传图片!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (res.data.status == "SUCCESS") {
|
if (res.data.status == "SUCCESS") {
|
||||||
if (this.isSzProject == 1) {
|
if (this.isSzProject == 1) {
|
||||||
this.checkImgLibrary(res.data.data[0].imageUrl);
|
this.checkImgLibrary(res.data.data[0].imageUrl);
|
||||||
@ -890,14 +931,33 @@ export default {
|
|||||||
console.log(fileData, 111222);
|
console.log(fileData, 111222);
|
||||||
const file = fileData.file;
|
const file = fileData.file;
|
||||||
// 压缩图片
|
// 压缩图片
|
||||||
lrz(file, { quality: 1 }).then((result) => {
|
// lrz(file, { quality: 1 }).then((result) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("files", result.file);
|
// formData.append("files", result.file);
|
||||||
|
// formData.append("files", result.file, image.jpg);
|
||||||
|
formData.append("files", file, "image.jpg");
|
||||||
|
|
||||||
// 图片上传
|
// 图片上传
|
||||||
apiUploadImage(formData).then((res) => {
|
apiUploadImage(formData).then((res) => {
|
||||||
if (res.code == 200 || res.status == "SUCCESS") {
|
if (res.code == 200 || res.status == "SUCCESS") {
|
||||||
|
|
||||||
const imgInfo = res.data[0];
|
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) {
|
switch (type) {
|
||||||
case "idCardAvatar": // 身份证头像
|
case "idCardAvatar": // 身份证头像
|
||||||
this.addForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
this.addForm.idCardBigPhotoUrl = imgInfo.imageUrl;
|
||||||
@ -906,9 +966,31 @@ export default {
|
|||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
case "livesFace": // 现场采集人脸
|
case "livesFace": // 现场采集人脸
|
||||||
|
if(this.isIscDevice){
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: '图片检测中',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.5)'
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = {fileUrl: imgInfo.imageUrl}
|
||||||
|
checkfaceHikvisionApi(data).then((res) => {
|
||||||
|
if(res.code == 200 && res.result.checkType == "1"){
|
||||||
this.cropperOption.img =
|
this.cropperOption.img =
|
||||||
this.$store.state.FILEURL + imgInfo.imageUrl;
|
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||||
this.cropperDialog = true;
|
this.cropperDialog = true;
|
||||||
|
}else{
|
||||||
|
this.$message.error(res.result.message)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
loading.close();
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.cropperOption.img =
|
||||||
|
this.$store.state.FILEURL + imgInfo.imageUrl;
|
||||||
|
this.cropperDialog = true;
|
||||||
|
}
|
||||||
// let imgStatus = result.file.size / 1024 < 500
|
// let imgStatus = result.file.size / 1024 < 500
|
||||||
// if (!imgStatus) {
|
// if (!imgStatus) {
|
||||||
// this.cropperOption.img =
|
// this.cropperOption.img =
|
||||||
@ -925,7 +1007,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
// });
|
||||||
},
|
},
|
||||||
// 文件上传 之前
|
// 文件上传 之前
|
||||||
handleBeforeUpload(file, type) {
|
handleBeforeUpload(file, type) {
|
||||||
@ -946,6 +1028,12 @@ export default {
|
|||||||
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
this.$message.error(this.$t("message.laborMange.hint8")); //"请上传jpg、jpeg格式图片"
|
||||||
return false;
|
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;
|
return true;
|
||||||
},
|
},
|
||||||
@ -1063,6 +1151,18 @@ export default {
|
|||||||
"&codeState=" +
|
"&codeState=" +
|
||||||
this.codeState;
|
this.codeState;
|
||||||
},
|
},
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
//获取列表信息
|
//获取列表信息
|
||||||
getInfoList() {
|
getInfoList() {
|
||||||
let data = {
|
let data = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user