-
- Snapshot
+
+ Snapshot
-
+
@@ -84,8 +69,7 @@
+
+
-
+
*C +
-
+
*C 2
+
@@ -34,24 +26,17 @@
-
+
Add
+ Modify
- Channel: {{ tooltipChannel }}
E to C :
- C = {{ scientificNotationStr2Fixed(e2c[0]) }} + {{ scientificNotationStr2Fixed(e2c[1]) }} *E +
+ C = {{ scientificNotationStr2Fixed(e2c[0]) }} + {{ scientificNotationStr2Fixed(e2c[1]) }} *E +
{{ scientificNotationStr2Fixed(e2c[2]) }} *E 2
@@ -95,30 +79,21 @@
C to E :
E =
-
E to C :
- C = {{ scientificNotationStr2Fixed(newE2C[0]) }} + {{ scientificNotationStr2Fixed(newE2C[1]) }} *E
+ C = {{ scientificNotationStr2Fixed(newE2C[0]) }} + {{ scientificNotationStr2Fixed(newE2C[1]) }}
+ *E
+ {{ scientificNotationStr2Fixed(newE2C[2]) }} *E 2
@@ -465,6 +440,8 @@ export default {
count: 0, //反算时需要传递的数值 非反算的情况下不需要传递 数值大小是 第一次调用接口时返回的tableWidgets 大小
isInverse: false, // 是否需要反算
gammaIsFitting: false,
+
+ selectedRowKeys: []
}
},
created() {
@@ -489,12 +466,13 @@ export default {
})
if (res.success) {
- const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries, newCToE, newEToC } = res.result
+ const { CToE, EToC, gammaEnergy, gammaSpectrum, max, min, oldScatterSeries, newCToE, newEToC, tableWidgets } = res.result
this.c2e = CToE
this.e2c = EToC
this.oldScatterSeries = oldScatterSeries
this.count = oldScatterSeries.length
+ this.list = tableWidgets
const { max: _max, min: _min, interval: _interval } = splitAxis(max, min, 4)
@@ -615,6 +593,40 @@ export default {
this.isInverse = true
},
+
+ // 编辑新的Channel 和 Energy 到表格里
+ handleModifyChannelAndEnergy() {
+ if (this.selectedRowKeys.length) {
+ const centroid = parseFloat(this.channelAndEnergyModel.channel)
+ const energy = parseFloat(this.channelAndEnergyModel.energy)
+
+ if (Number.isNaN(centroid) || Number.isNaN(energy)) {
+ this.$message.warn('Format is invalid.')
+ return
+ }
+
+ const [currSelectedIndex] = this.selectedRowKeys
+
+ this.list[currSelectedIndex].channel = centroid
+ this.list[currSelectedIndex].energy = energy
+ }
+ },
+ // 表格单行点击
+ getRowEvent(record, index) {
+ return {
+ on: {
+ click: () => {
+ this.handleRowClick(record, index)
+ }
+ }
+ }
+ },
+ handleRowClick(row, index) {
+ // 强制单选:直接覆盖数组,只存当前行的 row-key(rowCount)
+ this.selectedRowKeys = [index]
+ // 回填表单数据
+ this.channelAndEnergyModel = cloneDeep(row)
+ },
// 输入框发生变化
newCalibrationFuncModelChange(val, a) {
// 输入内容的时候 需要清空table数据 20231028:Xiao
@@ -827,6 +839,7 @@ p {
border: 1px solid #0c6a66;
padding: 10px;
}
+
.gamma-spectrum-qc {
.gamma-spectrum-chart {
height: 200px;
@@ -905,7 +918,7 @@ p {
flex: 1;
gap: 10px;
- > div {
+ >div {
&:first-child {
flex: 10;
}