bug解决

This commit is contained in:
jjLv 2024-08-28 11:37:41 +08:00
parent 83a5f42faf
commit c696fd7b06
2 changed files with 48 additions and 9 deletions

View File

@ -132,7 +132,7 @@
/> />
<!-- 杆塔弹窗 --> <!-- 杆塔弹窗 -->
<el-dialog :title="title" :visible.sync="showGt" width="1000px" height="1000px" append-to-body> <el-dialog :title="title" :visible.sync="showGt" width="1000px" height="1000px" append-to-body @close="cancelGt">
<el-form :model="queryGt" ref="queryFormGt" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryGt" ref="queryFormGt" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item prop="gtCode"> <el-form-item prop="gtCode">
<el-input <el-input
@ -516,15 +516,29 @@
if (value === '' || value === null) { if (value === '' || value === null) {
return callback(new Error('请必须输入-180 ~ 180内的数据且小数点后最多保留六位')); return callback(new Error('请必须输入-180 ~ 180内的数据且小数点后最多保留六位'));
} }
if(/[\u4e00-\u9fff]/.test(value)){ const regex = /^[+-]?(0|[1-9]\d*)(\.\d+)?$/;
if(!regex.test(value)){
return callback(new Error('请勿输入非数字')); return callback(new Error('请勿输入非数字'));
} }
const longitude = parseFloat(value); const longitude = parseFloat(value);
if (longitude <-180 || longitude > 180 ||longitude.toString().split(".")[1].length>6) { if(longitude.toString().includes('.')==true){
if (longitude <-180 || longitude > 180 ||longitude.toString().split(".")[1].length>6) {
callback(new Error('请必须输入-180 ~ 180内的数据且小数点后最多保留六位')); callback(new Error('请必须输入-180 ~ 180内的数据且小数点后最多保留六位'));
} else { } else {
callback(); callback();
} }
}else{
if (longitude <-180 || longitude > 180) {
callback(new Error('请必须输入-180 ~ 180内的数据且小数点后最多保留六位'));
} else {
callback();
}
}
// if (longitude <-180 || longitude > 180 ||longitude.toString().split(".")[1].length>6) {
// callback(new Error('-180 ~ 180'));
// } else {
// callback();
// }
}, },
trigger: 'blur' trigger: 'blur'
} }
@ -536,15 +550,29 @@
if (value === '' || value === null) { if (value === '' || value === null) {
return callback(new Error('请必须输入-90 ~ 90内的数据且小数点后最多保留六位')); return callback(new Error('请必须输入-90 ~ 90内的数据且小数点后最多保留六位'));
} }
if(/[\u4e00-\u9fff]/.test(value)){ const regexTwo = /^[+-]?(\d+(\.\d*)?|\.\d*[1-9]\d*)$/;
if(!regexTwo.test(value)){
return callback(new Error('请勿输入非数字')); return callback(new Error('请勿输入非数字'));
} }
const latitude = parseFloat(value); const latitude = parseFloat(value);
if (latitude <-90 || latitude > 90 ||latitude.toString().split(".")[1].length>6) { if(latitude.toString().includes('.')==true){
if (latitude <-90 || latitude > 90 ||latitude.toString().split(".")[1].length>6) {
callback(new Error('请必须输入-90 ~ 90内的数据且小数点后最多保留六位')); callback(new Error('请必须输入-90 ~ 90内的数据且小数点后最多保留六位'));
} else { } else {
callback(); callback();
} }
}else{
if (latitude <-90 || latitude > 90) {
callback(new Error('请必须输入-90 ~ 90内的数据且小数点后最多保留六位'));
} else {
callback();
}
}
// if (latitude <-90 || latitude > 90 ||latitude.toString().split(".")[1].length>6) {
// callback(new Error('-90 ~ 90'));
// } else {
// callback();
// }
}, },
trigger: 'blur' trigger: 'blur'
} }
@ -768,6 +796,10 @@
}); });
}, },
cancelGt() {
this.showGt = false;
this.resetQueryGt();
},
// //
cancel() { cancel() {

View File

@ -216,14 +216,14 @@ export default {
projectDepartName: [ projectDepartName: [
{ required: true, message: "项目名称不能为空", trigger: "blur" } { required: true, message: "项目名称不能为空", trigger: "blur" }
], ],
projectHeadName: [ // projectHeadName: [
{ required: true, message: "负责人名称不能为空", trigger: "blur" } // { required: true, message: "", trigger: "blur" }
], // ],
// appnum: [ // appnum: [
// { required: true, message: "APP", trigger: "blur" } // { required: true, message: "APP", trigger: "blur" }
// ], // ],
contactInformation: [ contactInformation: [
{ required: true, message: "手机号码不能为空", trigger: "blur" }, // { required: true, message: "", trigger: "blur" },
{ {
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码", message: "请输入正确的手机号码",
@ -393,6 +393,13 @@ export default {
// //
picturesPreview(row) { picturesPreview(row) {
this.dialogImageUrls = []; this.dialogImageUrls = [];
if(row.appnum==0){
this.$alert('该项目部暂无APP轮播图', '提示', {
type: 'warning',
confirmButtonText: '确定',
});
return;
}
getProject(row.projectId).then(response => { getProject(row.projectId).then(response => {
response.data.fileList.forEach(item => { response.data.fileList.forEach(item => {
this.dialogImageUrls.push({ this.dialogImageUrls.push({