文本细节调整

This commit is contained in:
chengwenyou 2024-07-30 16:19:07 +08:00
parent 387a8e2d21
commit 746df655c0
4 changed files with 30 additions and 36 deletions

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 若依管理系统
VUE_APP_TITLE = 睿思AI平台
# 开发环境配置
ENV = 'development'

View File

@ -10,7 +10,7 @@
<button class="commitIDRecognition" @click="onMountIDrecognition">识别</button>
<div class="IDCardPositive">
<el-upload class="upload-demo" ref="IDposi" :on-preview="handleBeforeUpload"
:on-change="handleUploading" accept=".jpg,.png" list-type="picture-card" drag :limit=1
:on-change="handleUploading" accept=".jpg,.png,.jpeg" list-type="picture-card" drag :limit=1
:action="urlposi" :auto-upload="false">
<i slot="default" class="el-icon-plus"></i>
<div class="el-upload-list__item-thumbnail" slot="file" slot-scope="{file}">
@ -37,7 +37,7 @@
</div>
<div class="IDCardNegative">
<el-upload class="upload-demo" ref="IDnega" :on-preview="handleBeforeUpload"
:on-change="handleUploading" accept=".jpg,.png" list-type="picture-card" drag :limit=1
:on-change="handleUploading" accept=".jpg,.png,.jpeg" list-type="picture-card" drag :limit=1
:action="urlposi" :auto-upload="false">
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
@ -115,10 +115,19 @@ export default {
}
},
methods: {
determineSize(file) {
const isLt5M = file.size / 1024 / 1024 < 5;
console.log(isLt5M);
if (!isLt5M) {
this.$message.error('上传头像图片大小不能超过 5MB!')
this.$refs.IDposi.clearFiles();
this.$refs.IDnega.clearFiles();
return
}
},
handleUploading(file) {
this.dataList.push(file);
console.log(this.dataList.length);
this.determineSize(file)
},
handleDownload(file) {
if (!file || !file.url) {
@ -165,7 +174,16 @@ export default {
console.error('处理移除文件时出错:', error);
}
},
reset() {
this.name = '';
this.gender = '';
this.nation = '';
this.birth = '';
this.address = '';
this.id = '';
this.authority = '';
this.date = '';
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
@ -180,19 +198,10 @@ export default {
return;
}
console.log(this.dataList);
this.name = '';
this.gender = '';
this.nation = '';
this.birth = '';
this.address = '';
this.id = '';
this.authority = '';
this.date = '';
this.reset();
let formData = new FormData();
formData.append('type', 1)
console.log(formData.getAll('type'))
Object.keys(this.dataList).forEach(item => {
formData.append('files', this.dataList[item].raw)
})
@ -200,7 +209,6 @@ export default {
this.$modal.loading("数据上传中,请稍后。。。");
updateIDCardPic(formData).then(res => {
if (res.code == 200) {
this.name = res.data.data.data.name;
this.gender = res.data.data.data.gender;
this.nation = res.data.data.data.ethnicity;
@ -211,29 +219,22 @@ export default {
this.date = res.data.data.data.validTime;
if (res.data.data.code == 20000) {
this.$modal.msgSuccess("识别成功");
}
else if (res.data.data.code == 20001) {
this.$modal.msgError("身份证信息不完整,请重新上传");
}
}
else if (res.data.data.code == 20003) {
this.$modal.msgError("图片base64编码转换异常,请重新上传");
}
else if (res.data.data.code == 20005) {
this.$modal.msgError("没有识别到文字,请传入正常的身份证图片");
}
else {
}
this.$modal.closeLoading();
}
this.$emit('custom-event');
this.open = false;
}).catch(error => {
// if()
this.$modal.msgError("出错了,请重新上传图片");
this.$modal.msgError("识别失败,请重新上传");
this.$modal.closeLoading();
})
},

View File

@ -3,10 +3,10 @@
<div class="pieIDResultCount" ref="pieIDResultCount"></div>
<div class="pieTextBoxIDResultCount">
<div class='pieTextIDResultCount'>
调用正确
调用正确
</div>
<div class='pieTextIDResultCount'>
调用失败
调用失败
</div>
</div>
</div>

View File

@ -60,10 +60,6 @@ export default {
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 1,
},
// (MB)
fileSize: {
type: Number,
@ -93,8 +89,7 @@ export default {
data() {
return {
dataList: [],
dataList: [],
}
},
methods: {
@ -104,11 +99,9 @@ export default {
this.$refs.rectData.getRectIDData();
this.$refs.listWatch.getListWatchData();
}
}
}
</script>
<style scoped>
@import url('./../../assets/styles/updateIDCard.css');
</style>