|
@@ -4387,17 +4387,18 @@ export default {
|
|
|
answerValue = item.collectionOptionList[0].answerValue;
|
|
answerValue = item.collectionOptionList[0].answerValue;
|
|
|
itemData = item.collectionOptionList[0];
|
|
itemData = item.collectionOptionList[0];
|
|
|
}
|
|
}
|
|
|
- let value = answerValue
|
|
|
|
|
- ? answerValue.replace(/[^\d.-]/g, '') // 移除所有非法字符
|
|
|
|
|
- .replace(/^\./, '') // 移除开头的小数点
|
|
|
|
|
- .replace(/\.$/, '') // 移除结尾的小数点(如果需要)
|
|
|
|
|
- // .replace(/(?<=.)-/g, '') // 移除除了开头位置外的所有负号
|
|
|
|
|
- .replace(/^-/, 'NEGATIVE_MARKER') // 先标记开头的负号
|
|
|
|
|
- .replace(/-/g, '') // 移除所有负号
|
|
|
|
|
- .replace(/NEGATIVE_MARKER/, '-') // 恢复开头的负号
|
|
|
|
|
- .replace(/\.+/g, '.') // 多个小数点合并为一个
|
|
|
|
|
- .replace(/(\..*)\./g, '$1') // 只保留第一个小数点
|
|
|
|
|
- : '';
|
|
|
|
|
|
|
+ let value = answerValue
|
|
|
|
|
+ ? answerValue
|
|
|
|
|
+ .replace(/[^\d.-]/g, '') // 移除所有非法字符
|
|
|
|
|
+ .replace(/^\./, '') // 移除开头的小数点
|
|
|
|
|
+ .replace(/\.$/, '') // 移除结尾的小数点(如果需要)
|
|
|
|
|
+ // .replace(/(?<=.)-/g, '') // 移除除了开头位置外的所有负号
|
|
|
|
|
+ .replace(/^-/, 'NEGATIVE_MARKER') // 先标记开头的负号
|
|
|
|
|
+ .replace(/-/g, '') // 移除所有负号
|
|
|
|
|
+ .replace(/NEGATIVE_MARKER/, '-') // 恢复开头的负号
|
|
|
|
|
+ .replace(/\.+/g, '.') // 多个小数点合并为一个
|
|
|
|
|
+ .replace(/(\..*)\./g, '$1') // 只保留第一个小数点
|
|
|
|
|
+ : '';
|
|
|
// let value = answerValue
|
|
// let value = answerValue
|
|
|
// ? answerValue.replace(
|
|
// ? answerValue.replace(
|
|
|
// /[^-\d.]|(?<!\d)\.|\.(?!\d)|^[.]$|^[+-]$|^[+-]\.$|(?<=\.\d*)\.|(?<=\d\.\d*)\.(?=\d)/g,
|
|
// /[^-\d.]|(?<!\d)\.|\.(?!\d)|^[.]$|^[+-]$|^[+-]\.$|(?<=\.\d*)\.|(?<=\d\.\d*)\.(?=\d)/g,
|
|
@@ -4407,7 +4408,10 @@ export default {
|
|
|
this.$set(itemData, 'answerValue', value);
|
|
this.$set(itemData, 'answerValue', value);
|
|
|
if (value) {
|
|
if (value) {
|
|
|
// 最大值
|
|
// 最大值
|
|
|
- let maxValue = item.collectionOptionList[0].maxValue == null ? item.collectionOptionList[0].maxValue : item.collectionOptionList[0].maxValue.toString();
|
|
|
|
|
|
|
+ let maxValue =
|
|
|
|
|
+ item.collectionOptionList[0].maxValue == null
|
|
|
|
|
+ ? item.collectionOptionList[0].maxValue
|
|
|
|
|
+ : item.collectionOptionList[0].maxValue.toString();
|
|
|
if (maxValue && maxValue != '') {
|
|
if (maxValue && maxValue != '') {
|
|
|
if (value > Number(maxValue)) {
|
|
if (value > Number(maxValue)) {
|
|
|
this.$set(itemData, 'ruleMessage', '最大值为:' + maxValue);
|
|
this.$set(itemData, 'ruleMessage', '最大值为:' + maxValue);
|
|
@@ -4418,7 +4422,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//最小值
|
|
//最小值
|
|
|
- let minValue = item.collectionOptionList[0].minValue == null ? item.collectionOptionList[0].minValue : item.collectionOptionList[0].minValue.toString();
|
|
|
|
|
|
|
+ let minValue =
|
|
|
|
|
+ item.collectionOptionList[0].minValue == null
|
|
|
|
|
+ ? item.collectionOptionList[0].minValue
|
|
|
|
|
+ : item.collectionOptionList[0].minValue.toString();
|
|
|
if (minValue && minValue != '') {
|
|
if (minValue && minValue != '') {
|
|
|
if (value < Number(minValue)) {
|
|
if (value < Number(minValue)) {
|
|
|
this.$set(itemData, 'ruleMessage', '最小值为:' + minValue);
|
|
this.$set(itemData, 'ruleMessage', '最小值为:' + minValue);
|
|
@@ -4630,7 +4637,10 @@ export default {
|
|
|
// this.showCode = false;
|
|
// this.showCode = false;
|
|
|
}
|
|
}
|
|
|
// 生动化陈列是否可以编辑
|
|
// 生动化陈列是否可以编辑
|
|
|
- if (this.$route.query.types == 'edit' && (this.photoIdentifyType == '6' || this.photoIdentifyType == '7')) {
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ this.$route.query.types == 'edit' &&
|
|
|
|
|
+ (this.photoIdentifyType == '6' || this.photoIdentifyType == '7')
|
|
|
|
|
+ ) {
|
|
|
this.isEditSDHCL = false;
|
|
this.isEditSDHCL = false;
|
|
|
} else {
|
|
} else {
|
|
|
this.isEditSDHCL = true;
|
|
this.isEditSDHCL = true;
|
|
@@ -5670,7 +5680,7 @@ export default {
|
|
|
traverseCollectionItems(items) {
|
|
traverseCollectionItems(items) {
|
|
|
// 处理一层子项(如果有)
|
|
// 处理一层子项(如果有)
|
|
|
if (items.collectionOptionList && items.collectionOptionList.length > 0) {
|
|
if (items.collectionOptionList && items.collectionOptionList.length > 0) {
|
|
|
- if(items.answerValue == items.collectionOptionList[0].collectionOptionId ){
|
|
|
|
|
|
|
+ if (items.answerValue == items.collectionOptionList[0].collectionOptionId) {
|
|
|
items.collectionOptionList.forEach((item) => {
|
|
items.collectionOptionList.forEach((item) => {
|
|
|
// 处理二层子项(如果有)
|
|
// 处理二层子项(如果有)
|
|
|
if (item.collectionItems && item.collectionItems.length > 0) {
|
|
if (item.collectionItems && item.collectionItems.length > 0) {
|
|
@@ -5681,7 +5691,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onSubmit() {
|
|
onSubmit() {
|
|
@@ -6331,16 +6340,16 @@ export default {
|
|
|
telConfirm(val) {
|
|
telConfirm(val) {
|
|
|
let item = '';
|
|
let item = '';
|
|
|
let answerValue = '';
|
|
let answerValue = '';
|
|
|
- if (
|
|
|
|
|
|
|
+ if (val.answerValue != null) {
|
|
|
|
|
+ answerValue = val.answerValue;
|
|
|
|
|
+ item = val;
|
|
|
|
|
+ } else if (
|
|
|
val.collectionOptionList &&
|
|
val.collectionOptionList &&
|
|
|
val.collectionOptionList.length &&
|
|
val.collectionOptionList.length &&
|
|
|
val.collectionOptionList[0].answerValue
|
|
val.collectionOptionList[0].answerValue
|
|
|
) {
|
|
) {
|
|
|
answerValue = val.collectionOptionList[0].answerValue;
|
|
answerValue = val.collectionOptionList[0].answerValue;
|
|
|
item = val.collectionOptionList[0];
|
|
item = val.collectionOptionList[0];
|
|
|
- } else {
|
|
|
|
|
- answerValue = val.answerValue;
|
|
|
|
|
- item = val;
|
|
|
|
|
}
|
|
}
|
|
|
if (!/^1[123456789]\d{9}$/.test(answerValue) || answerValue == '') {
|
|
if (!/^1[123456789]\d{9}$/.test(answerValue) || answerValue == '') {
|
|
|
this.$toast(val.collectionName + '格式错误');
|
|
this.$toast(val.collectionName + '格式错误');
|