添加本地缓存功能

处理散点图矩形框拖拽、update、unzoom 操作有问题
处理散点图鼠标滑过,坐标指示器与轴数据重叠的问题
右侧ROI 曲线增加提示框
This commit is contained in:
任珮宇 2024-01-17 14:44:24 +08:00
parent ddf2f4c7db
commit eaa8927e3a
3 changed files with 57 additions and 56 deletions

View File

@ -142,7 +142,7 @@ export default {
if (sampleData) { if (sampleData) {
const { data, from } = sampleData const { data, from } = sampleData
this.sampleDetail = data this.sampleDetail = data
// this.changeChartByType('sample') this.handleChangeResult(data)
if (from == 'db') { if (from == 'db') {
this.sampleDetail = data this.sampleDetail = data
this.emitGetFiles(data) this.emitGetFiles(data)
@ -160,9 +160,6 @@ export default {
deep: true, deep: true,
}, },
}, },
mounted() {
// this.getSelfStationSampleDetail()
},
methods: { methods: {
refreshRoi(data) { refreshRoi(data) {
const { list, start, stop } = data const { list, start, stop } = data
@ -206,39 +203,7 @@ export default {
from: 'file', from: 'file',
}) })
this.sampleDetail = result this.sampleDetail = result
const { this.handleChangeResult(result)
spectrumData,
betaEnergyData,
gammaEnergyData,
histogramDataList,
ROIOneList,
ROITwoList,
ROIThreeList,
ROIFourList,
ROIOneStart,
ROIOneStop,
ROITwoStart,
ROITwoStop,
ROIThreeStart,
ROIThreeStop,
ROIFourStart,
ROIFourStop,
} = this.sampleDetail
this.spectrumData = spectrumData
this.histogramDataList = histogramDataList
this.gammaEnergyData = gammaEnergyData
this.betaEnergyData = betaEnergyData
this.ROILists = [ROIOneList, ROITwoList, ROIThreeList, ROIFourList]
let roiParam1 = { start: ROIOneStart, stop: ROIOneStop }
let roiParam2 = { start: ROITwoStart, stop: ROITwoStop }
let roiParam3 = { start: ROIThreeStart, stop: ROIThreeStop }
let roiParam4 = { start: ROIFourStart, stop: ROIFourStop }
this.roiParamList.push(roiParam1, roiParam2, roiParam3, roiParam4)
let boundary1 = { minX: ROIOneStart, maxX: ROIOneStop, minY: 0, maxY: 4096 }
let boundary2 = { minX: ROITwoStart, maxX: ROITwoStop, minY: 0, maxY: 4096 }
let boundary3 = { minX: ROIThreeStart, maxX: ROIThreeStop, minY: 0, maxY: 4096 }
let boundary4 = { minX: ROIFourStart, maxX: ROIFourStop, minY: 0, maxY: 4096 }
this.boundaryList.push(boundary1, boundary2, boundary3, boundary4)
this.isLoading = false this.isLoading = false
} else { } else {
this.$message.error(message) this.$message.error(message)
@ -247,6 +212,41 @@ export default {
console.error(error) console.error(error)
} }
}, },
handleChangeResult(res) {
const {
spectrumData,
betaEnergyData,
gammaEnergyData,
histogramDataList,
ROIOneList,
ROITwoList,
ROIThreeList,
ROIFourList,
ROIOneStart,
ROIOneStop,
ROITwoStart,
ROITwoStop,
ROIThreeStart,
ROIThreeStop,
ROIFourStart,
ROIFourStop,
} = this.sampleDetail
this.spectrumData = spectrumData
this.histogramDataList = histogramDataList
this.gammaEnergyData = gammaEnergyData
this.betaEnergyData = betaEnergyData
this.ROILists = [ROIOneList, ROITwoList, ROIThreeList, ROIFourList]
let roiParam1 = { start: ROIOneStart, stop: ROIOneStop }
let roiParam2 = { start: ROITwoStart, stop: ROITwoStop }
let roiParam3 = { start: ROIThreeStart, stop: ROIThreeStop }
let roiParam4 = { start: ROIFourStart, stop: ROIFourStop }
this.roiParamList.push(roiParam1, roiParam2, roiParam3, roiParam4)
let boundary1 = { minX: ROIOneStart, maxX: ROIOneStop, minY: 0, maxY: 4096 }
let boundary2 = { minX: ROITwoStart, maxX: ROITwoStop, minY: 0, maxY: 4096 }
let boundary3 = { minX: ROIThreeStart, maxX: ROIThreeStop, minY: 0, maxY: 4096 }
let boundary4 = { minX: ROIFourStart, maxX: ROIFourStop, minY: 0, maxY: 4096 }
this.boundaryList.push(boundary1, boundary2, boundary3, boundary4)
},
cancelLastRequest() { cancelLastRequest() {
if (this._cancelToken && typeof this._cancelToken == 'function') { if (this._cancelToken && typeof this._cancelToken == 'function') {
this._cancelToken() this._cancelToken()

View File

@ -33,8 +33,8 @@
</div> </div>
</div> </div>
<!-- 2D图表结束 --> <!-- 2D图表结束 -->
<CustomChart v-if="active == 1" key="1" ref="roiLimitsRef" :option="gammaOption" /> <CustomChart v-if="active == 1" key="1" ref="gammaLineChartRef" :option="gammaOption" />
<CustomChart v-if="active == 2" key="2" ref="roiLimitsRef" :option="betaOption" /> <CustomChart v-if="active == 2" key="2" ref="betaLineChartRef" :option="betaOption" />
</div> </div>
</div> </div>
</template> </template>
@ -43,7 +43,7 @@
import CustomChart from '@/components/CustomChart/index.vue' import CustomChart from '@/components/CustomChart/index.vue'
import ColorPalette from './ColorPalette.vue' import ColorPalette from './ColorPalette.vue'
import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper.js' import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper.js'
import { getAction, putAction, deleteAction } from '../../../api/manage' import { putAction } from '../../../api/manage'
import SampleDataMixin from '../SampleDataMixin' import SampleDataMixin from '../SampleDataMixin'
const buttons = ['Beta-Gamma', 'Gamma', 'Beta'] const buttons = ['Beta-Gamma', 'Gamma', 'Beta']
// Beta-Gamma // Beta-Gamma
@ -66,6 +66,9 @@ const twoDOption = {
lineStyle: { lineStyle: {
type: 'dashed', type: 'dashed',
}, },
label: {
backgroundColor: 'rgba(119, 181, 213, 1)',
},
}, },
}, },
xAxis: { xAxis: {
@ -325,6 +328,7 @@ const betaOption = {
type: 'line', type: 'line',
smooth: true, smooth: true,
showSymbol: false, showSymbol: false,
animation: false,
symbol: 'circle', symbol: 'circle',
symbolSize: 6, symbolSize: 6,
data: [], data: [],
@ -823,12 +827,6 @@ export default {
// Update // Update
async handleUpdate() { async handleUpdate() {
const { inputFileName } = this.sampleData const { inputFileName } = this.sampleData
let params = {
sampleFileName: inputFileName,
startChannel: this.startChannel,
endChannel: this.endChannel,
ROINum: this.currIdx + 1,
}
try { try {
const { success, result, message } = await putAction( const { success, result, message } = await putAction(
`/selfStation/updateROI?sampleFileName=${inputFileName}&startChannel=${this.startChannel}&endChannel=${ `/selfStation/updateROI?sampleFileName=${inputFileName}&startChannel=${this.startChannel}&endChannel=${
@ -851,13 +849,13 @@ export default {
} }
this.$emit('refreshRoi', obj) this.$emit('refreshRoi', obj)
// this.$bus.$emit('updateRoi', obj.list) // this.$bus.$emit('updateRoi', obj.list)
// this.boundaryData = { this.boundaryData = {
// minX: obj.start, minX: obj.start,
// maxX: obj.stop, maxX: obj.stop,
// minY: 0, minY: 0,
// maxY: 4096, maxY: 4096,
// color: '#99CA53', color: '#99CA53',
// } }
// this.reDrawRect() // this.reDrawRect()
} }
} catch (error) { } catch (error) {

View File

@ -27,7 +27,10 @@ const roiLimitsOption = {
right: 18, right: 18,
bottom: 45, bottom: 45,
}, },
tooltip: {}, tooltip: {
show: true,
trigger: 'axis',
},
xAxis: { xAxis: {
type: 'category', type: 'category',
boundaryGap: false, boundaryGap: false,
@ -75,8 +78,8 @@ const roiLimitsOption = {
type: 'line', type: 'line',
smooth: true, smooth: true,
showSymbol: false, showSymbol: false,
symbol: 'circle', // symbol: 'circle',
symbolSize: 6, // symbolSize: 6,
data: [], data: [],
itemStyle: { itemStyle: {
normal: { normal: {