diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 8447349..873cb0a 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -216,7 +216,8 @@ import { isShowOther } from "@/utils/formPackageCommon.js"; import { EventBus } from "@/utils/eventBus"; import { getuuid } from "@/utils/index.js"; import { isRegent } from "@/utils/index.js"; -import moment from "moment"; +import { isValueEmpty } from '@/utils/index.js'; + import _ from "lodash"; export default { inject: ['templateFillType', 'getZdxgjl', 'updateZdxgjl'], @@ -415,7 +416,7 @@ export default { onCopy(rowIndex, col) { if (col.copyFrom) { - if (this.isValueEmpty(this.localDataSource[rowIndex][col.copyFrom])) {//没有值就不用复制了 + if (isValueEmpty(this.localDataSource[rowIndex][col.copyFrom])) {//没有值就不用复制了 return } this.updateDataSourceByRowIndex(rowIndex, { [col.prop]: this.localDataSource[rowIndex][col.copyFrom] }, "clickable") @@ -470,7 +471,7 @@ export default { this.columns.forEach((col, colIndex) => { if (col.headerSelectKey && col.headerOptions && col.fillType === this.templateFillType) { const headerValue = this.headerSelectFields[col.headerSelectKey]; - if (this.isValueEmpty(headerValue)) { + if (isValueEmpty(headerValue)) { const errorItem = { rowIndex: -1, // 表头特殊标记 colIndex, @@ -524,7 +525,7 @@ export default { } } } else { - if (this.isValueEmpty(mainValue) && !col.bodyDisabled && col.bodyType !== 'span' && col.bodyType !== 'button') { + if (isValueEmpty(mainValue) && !col.bodyDisabled && col.bodyType !== 'span' && col.bodyType !== 'button') { const errorItem = { rowIndex, colIndex, @@ -540,7 +541,7 @@ export default { if (col.bodySubKey && !col.bodySubDisabled && col.bodySubType !== 'span' && col.bodySubType !== "button") { const subValue = row[col.bodySubKey]; console.log(col, subValue, "subValue") - if (this.isValueEmpty(subValue)) { + if (isValueEmpty(subValue)) { const errorItem = { rowIndex, colIndex, @@ -563,7 +564,7 @@ export default { return; } const otherValue = row[col.otherCode]; - if (this.isValueEmpty(otherValue)) { + if (isValueEmpty(otherValue)) { const errorItem = { rowIndex, colIndex, @@ -636,7 +637,7 @@ export default { this.columns.forEach((col, colIndex) => { const currentValue = row[col.prop]; const compareToValue = row[col.compareTo]; - if (col.compareTo && !this.isValueEmpty(currentValue) && !this.isValueEmpty(compareToValue)) { + if (col.compareTo && !isValueEmpty(currentValue) && !isValueEmpty(compareToValue)) { // 比较当前值和compareTo值,如果不相等则设置橙色背景 if (!isEqual(currentValue, compareToValue)) { this.setOrangeBg(rowIndex, colIndex, col.prop, true); @@ -651,7 +652,7 @@ export default { const currentValue = row[col.bodySubKey]; const compareToValue = row[col.bodySubCompareTo]; - if (!this.isValueEmpty(currentValue) && !this.isValueEmpty(compareToValue)) { + if (!isValueEmpty(currentValue) && !isValueEmpty(compareToValue)) { // 比较当前值和compareTo值,如果不相等则设置橙色背景 if (!isEqual(currentValue, compareToValue)) { this.setOrangeBg(rowIndex, colIndex, col.bodySubKey, true); diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 8ded2d0..6ba9680 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -34,16 +34,15 @@