添加本地缓存功能
处理散点图矩形框拖拽、update、unzoom 操作有问题 处理散点图鼠标滑过,坐标指示器与轴数据重叠的问题 右侧ROI 曲线增加提示框
This commit is contained in:
		
							parent
							
								
									ddf2f4c7db
								
							
						
					
					
						commit
						eaa8927e3a
					
				| 
						 | 
				
			
			@ -142,7 +142,7 @@ export default {
 | 
			
		|||
        if (sampleData) {
 | 
			
		||||
          const { data, from } = sampleData
 | 
			
		||||
          this.sampleDetail = data
 | 
			
		||||
          // this.changeChartByType('sample')
 | 
			
		||||
          this.handleChangeResult(data)
 | 
			
		||||
          if (from == 'db') {
 | 
			
		||||
            this.sampleDetail = data
 | 
			
		||||
            this.emitGetFiles(data)
 | 
			
		||||
| 
						 | 
				
			
			@ -160,9 +160,6 @@ export default {
 | 
			
		|||
      deep: true,
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    // this.getSelfStationSampleDetail()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    refreshRoi(data) {
 | 
			
		||||
      const { list, start, stop } = data
 | 
			
		||||
| 
						 | 
				
			
			@ -206,39 +203,7 @@ export default {
 | 
			
		|||
            from: 'file',
 | 
			
		||||
          })
 | 
			
		||||
          this.sampleDetail = result
 | 
			
		||||
          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)
 | 
			
		||||
          this.handleChangeResult(result)
 | 
			
		||||
          this.isLoading = false
 | 
			
		||||
        } else {
 | 
			
		||||
          this.$message.error(message)
 | 
			
		||||
| 
						 | 
				
			
			@ -247,6 +212,41 @@ export default {
 | 
			
		|||
        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() {
 | 
			
		||||
      if (this._cancelToken && typeof this._cancelToken == 'function') {
 | 
			
		||||
        this._cancelToken()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,8 +33,8 @@
 | 
			
		|||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <!-- 2D图表结束 -->
 | 
			
		||||
      <CustomChart v-if="active == 1" key="1" ref="roiLimitsRef" :option="gammaOption" />
 | 
			
		||||
      <CustomChart v-if="active == 2" key="2" ref="roiLimitsRef" :option="betaOption" />
 | 
			
		||||
      <CustomChart v-if="active == 1" key="1" ref="gammaLineChartRef" :option="gammaOption" />
 | 
			
		||||
      <CustomChart v-if="active == 2" key="2" ref="betaLineChartRef" :option="betaOption" />
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
| 
						 | 
				
			
			@ -43,7 +43,7 @@
 | 
			
		|||
import CustomChart from '@/components/CustomChart/index.vue'
 | 
			
		||||
import ColorPalette from './ColorPalette.vue'
 | 
			
		||||
import { getXAxisAndYAxisByPosition, rangeNumber } from '@/utils/chartHelper.js'
 | 
			
		||||
import { getAction, putAction, deleteAction } from '../../../api/manage'
 | 
			
		||||
import { putAction } from '../../../api/manage'
 | 
			
		||||
import SampleDataMixin from '../SampleDataMixin'
 | 
			
		||||
const buttons = ['Beta-Gamma', 'Gamma', 'Beta']
 | 
			
		||||
// Beta-Gamma 的配置
 | 
			
		||||
| 
						 | 
				
			
			@ -66,6 +66,9 @@ const twoDOption = {
 | 
			
		|||
      lineStyle: {
 | 
			
		||||
        type: 'dashed',
 | 
			
		||||
      },
 | 
			
		||||
      label: {
 | 
			
		||||
        backgroundColor: 'rgba(119, 181, 213, 1)',
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  xAxis: {
 | 
			
		||||
| 
						 | 
				
			
			@ -325,6 +328,7 @@ const betaOption = {
 | 
			
		|||
    type: 'line',
 | 
			
		||||
    smooth: true,
 | 
			
		||||
    showSymbol: false,
 | 
			
		||||
    animation: false,
 | 
			
		||||
    symbol: 'circle',
 | 
			
		||||
    symbolSize: 6,
 | 
			
		||||
    data: [],
 | 
			
		||||
| 
						 | 
				
			
			@ -823,12 +827,6 @@ export default {
 | 
			
		|||
    // 点击Update
 | 
			
		||||
    async handleUpdate() {
 | 
			
		||||
      const { inputFileName } = this.sampleData
 | 
			
		||||
      let params = {
 | 
			
		||||
        sampleFileName: inputFileName,
 | 
			
		||||
        startChannel: this.startChannel,
 | 
			
		||||
        endChannel: this.endChannel,
 | 
			
		||||
        ROINum: this.currIdx + 1,
 | 
			
		||||
      }
 | 
			
		||||
      try {
 | 
			
		||||
        const { success, result, message } = await putAction(
 | 
			
		||||
          `/selfStation/updateROI?sampleFileName=${inputFileName}&startChannel=${this.startChannel}&endChannel=${
 | 
			
		||||
| 
						 | 
				
			
			@ -851,13 +849,13 @@ export default {
 | 
			
		|||
          }
 | 
			
		||||
          this.$emit('refreshRoi', obj)
 | 
			
		||||
          // this.$bus.$emit('updateRoi', obj.list)
 | 
			
		||||
          // this.boundaryData = {
 | 
			
		||||
          //   minX: obj.start,
 | 
			
		||||
          //   maxX: obj.stop,
 | 
			
		||||
          //   minY: 0,
 | 
			
		||||
          //   maxY: 4096,
 | 
			
		||||
          //   color: '#99CA53',
 | 
			
		||||
          // }
 | 
			
		||||
          this.boundaryData = {
 | 
			
		||||
            minX: obj.start,
 | 
			
		||||
            maxX: obj.stop,
 | 
			
		||||
            minY: 0,
 | 
			
		||||
            maxY: 4096,
 | 
			
		||||
            color: '#99CA53',
 | 
			
		||||
          }
 | 
			
		||||
          // this.reDrawRect()
 | 
			
		||||
        }
 | 
			
		||||
      } catch (error) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,7 +27,10 @@ const roiLimitsOption = {
 | 
			
		|||
    right: 18,
 | 
			
		||||
    bottom: 45,
 | 
			
		||||
  },
 | 
			
		||||
  tooltip: {},
 | 
			
		||||
  tooltip: {
 | 
			
		||||
    show: true,
 | 
			
		||||
    trigger: 'axis',
 | 
			
		||||
  },
 | 
			
		||||
  xAxis: {
 | 
			
		||||
    type: 'category',
 | 
			
		||||
    boundaryGap: false,
 | 
			
		||||
| 
						 | 
				
			
			@ -75,8 +78,8 @@ const roiLimitsOption = {
 | 
			
		|||
    type: 'line',
 | 
			
		||||
    smooth: true,
 | 
			
		||||
    showSymbol: false,
 | 
			
		||||
    symbol: 'circle',
 | 
			
		||||
    symbolSize: 6,
 | 
			
		||||
    // symbol: 'circle',
 | 
			
		||||
    // symbolSize: 6,
 | 
			
		||||
    data: [],
 | 
			
		||||
    itemStyle: {
 | 
			
		||||
      normal: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user