文本细节调整

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' ENV = 'development'

View File

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

View File

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

View File

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