diff --git a/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue index 9cddec2..d0f1f62 100644 --- a/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/EfficiencyCalibrationModal.vue @@ -22,10 +22,10 @@ }" > - + - + Insert @@ -257,6 +257,7 @@ export default { option: cloneDeep(initialOption), selectedRowKeys: [], model: {}, + emptyModal: {}, currSelectedDataSource: '', appliedDataSource: '', opts: { @@ -356,6 +357,9 @@ export default { // 表格单行点击 handleRowClick(row) { this.model = cloneDeep(row) + this.model.channel = parseFloat(Number(this.model.channel).toPrecision(6)) + this.model.energy = parseFloat(Number(this.model.energy).toPrecision(6)) + this.emptyModal = cloneDeep(row) }, // 插入 @@ -404,12 +408,23 @@ export default { item.id = index }) }, + handleChannelChange(e) { + if (e.target.value != parseFloat(Number(this.emptyModal.channel).toPrecision(6))) { + this.emptyModal.channel = e.target.value + } + }, + handleEnergyChange(e) { + console.log(e.target.value) + if (e.target.value != parseFloat(Number(this.emptyModal.energy).toPrecision(6))) { + this.emptyModal.energy = e.target.value + } + }, // 修改 handleModify() { if (this.selectedRowKeys.length) { - const energy = parseFloat(this.model.energy) - const efficiency = parseFloat(this.model.efficiency) + const energy = parseFloat(this.emptyModal.energy) + const efficiency = parseFloat(this.emptyModal.efficiency) if (Number.isNaN(energy) || Number.isNaN(efficiency)) { this.$message.warn('Format is invalid.') diff --git a/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue index b61ba7b..ef52148 100644 --- a/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/EnergyCalibrationModal.vue @@ -22,10 +22,10 @@ }" > - + - + Insert @@ -219,6 +219,7 @@ export default { option: cloneDeep(initialOption), selectedRowKeys: [], model: {}, + emptyModal: {}, currSelectedDataSource: '', appliedDataSource: '', opts: { @@ -317,6 +318,9 @@ export default { // 表格单行点击 handleRowClick(row) { this.model = cloneDeep(row) + this.model.channel = parseFloat(Number(this.model.channel).toPrecision(6)) + this.model.energy = parseFloat(Number(this.model.energy).toPrecision(6)) + this.emptyModal = cloneDeep(row) }, // 插入 @@ -365,12 +369,23 @@ export default { item.id = index }) }, + handleChannelChange(e) { + if (e.target.value != parseFloat(Number(this.emptyModal.channel).toPrecision(6))) { + this.emptyModal.channel = e.target.value + } + }, + handleEnergyChange(e) { + console.log(e.target.value) + if (e.target.value != parseFloat(Number(this.emptyModal.energy).toPrecision(6))) { + this.emptyModal.energy = e.target.value + } + }, // 修改 handleModify() { if (this.selectedRowKeys.length) { - const centroid = parseFloat(this.model.channel) - const energy = parseFloat(this.model.energy) + const centroid = parseFloat(this.emptyModal.channel) + const energy = parseFloat(this.emptyModal.energy) if (Number.isNaN(centroid) || Number.isNaN(energy)) { this.$message.warn('Format is invalid.') diff --git a/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue b/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue index dce8e1b..acadd96 100644 --- a/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/ResolutionCalibrationModal.vue @@ -22,10 +22,10 @@ }" > - + - + Insert @@ -219,6 +219,7 @@ export default { option: cloneDeep(initialOption), selectedRowKeys: [], model: {}, + emptyModal: {}, currSelectedDataSource: '', appliedDataSource: '', opts: { @@ -316,6 +317,9 @@ export default { // 表格单行点击 handleRowClick(row) { this.model = cloneDeep(row) + this.model.channel = parseFloat(Number(this.model.channel).toPrecision(6)) + this.model.energy = parseFloat(Number(this.model.energy).toPrecision(6)) + this.emptyModal = cloneDeep(row) }, // 插入 @@ -364,12 +368,23 @@ export default { item.id = index }) }, + handleChannelChange(e) { + if (e.target.value != parseFloat(Number(this.emptyModal.channel).toPrecision(6))) { + this.emptyModal.channel = e.target.value + } + }, + handleEnergyChange(e) { + console.log(e.target.value) + if (e.target.value != parseFloat(Number(this.emptyModal.energy).toPrecision(6))) { + this.emptyModal.energy = e.target.value + } + }, // 修改 handleModify() { if (this.selectedRowKeys.length) { - const energy = parseFloat(this.model.energy) - const fwhm = parseFloat(this.model.fwhm) + const energy = parseFloat(this.emptyModal.energy) + const fwhm = parseFloat(this.emptyModal.fwhm) if (Number.isNaN(energy) || Number.isNaN(fwhm)) { this.$message.warn('Format is invalid.')