diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue index 4256a97..4874896 100644 --- a/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrumChart.vue @@ -18,6 +18,7 @@ { + this.opts.notMerge = false + this.twoDOption.brush = { toolbox: [] } + }) }, methods: { @@ -357,8 +357,6 @@ export default { this.twoDOption.yAxis.max = 256 this.emitRangeChange([0, 256, 0, 256]) - this.reDrawRect() - this.buildScatterList() }, @@ -436,9 +434,6 @@ export default { this.twoDOption.yAxis.max = rangeNumberFunc(y2) this.emitRangeChange([x1, x2, y1, y2]) - - this.reDrawRect() - this.buildScatterList() } @@ -452,7 +447,7 @@ export default { yAxis: { min: minY, max: maxY }, } = this.twoDOption - this.twoDOption.series.data = this.histogramDataDList + this.twoDOption.series[0].data = this.histogramDataDList .filter(({ b, g, c }) => c && b >= minX && b <= maxX && g >= minY && g <= maxY) .map(({ b, g, c }) => this.buildScatterItem(b, g, c)) }, @@ -488,7 +483,6 @@ export default { this.twoDOption.yAxis.max = x2 } - this.reDrawRect() this.buildScatterList() }, @@ -498,217 +492,44 @@ export default { if (this.showROI) { this.boundaryData.forEach(({ minX, maxX, minY, maxY, color }) => { - // rect 遵循 左下 右下 右上 左上 的顺序 + // rect 遵循 左下 右下 右上 左上 左下 的顺序 const rect = [ [minX, minY], [maxX, minY], [maxX, maxY], [minX, maxY], + [minX, minY], ] - rectList.push(...this.drawOneRect(rect, color)) + rectList.push(this.drawOneRect(rect, color)) }) } - this.twoDOption.series.markLine.data = rectList + const lineSeries = rectList.map((rect) => ({ + type: 'line', + ...rect, + zlevel: 11, + })) + + this.opts.notMerge = true + this.twoDOption.series.splice(1, this.twoDOption.series.length - 1, ...lineSeries) + this.$nextTick(() => { + this.opts.notMerge = false + this.twoDOption.brush = { toolbox: [] } + }) }, /** * 绘制一个矩形框区域 - * 矩形框在这里的实现是由几条线段围起来的,但由于线段在超出图表区域显示有问题,故作了以下处理 - * @param {*} rect 左下 右下 右上 左上 的顺序 + * @param {*} rect 左下 右下 右上 左上 左下 的顺序 */ drawOneRect(rect, color) { - const rectList = [] - const { - xAxis: { min: minX, max: maxX }, - yAxis: { min: minY, max: maxY }, - } = this.twoDOption - - const inchartPoints = this.getInChartPoints(rect) - const outchartPoints = rect.filter((pointItem) => !inchartPoints.includes(pointItem)) - // 如果框选范围内只有俩点 - if (inchartPoints.length == 2) { - const [point1, point2] = inchartPoints - const isVerticleLine = this.isVerticleLine(point1, point2) - // 如果是纵向标记线,判断另两个点是在左边还是右边 - if (isVerticleLine) { - const find = outchartPoints.find((outcharPoint) => point1[1] == outcharPoint[1]) // 找出纵坐标相同的在图表外面的点 - // 判断在图表外的这个点是在左边还是右边 - const isLeft = find[0] <= point1[0] - /** - * 如果在左边,推入左边俩点构成矩形 - * y - * |________________ - * | | - * |________________| - * | - * |——————————————————— x - **/ - - if (isLeft) { - inchartPoints.forEach((point) => { - rectList.push(this.generateLineDataByTwoPoints([minX, point[1]], point)) - }) - - rectList.push(this.generateLineDataByTwoPoints(point1, point2)) - } - // 如果是右边,同理,推入右边俩点构成矩形 - else { - inchartPoints.forEach((point) => { - rectList.push(this.generateLineDataByTwoPoints([maxX, point[1]], point)) - }) - rectList.push(this.generateLineDataByTwoPoints(point1, point2)) - } - } - // 如果是纵向标记线,判断另两个点是在上边还是下边 - else { - const find = outchartPoints.find((outcharPoint) => point1[0] == outcharPoint[0]) // 找出横坐标相同的在图表外面的点 - // 判断在图表外的这个点是在上边还是右边 - const isBottom = find[1] <= point1[1] - /** - * 如果在下边,推入下边俩点构成矩形 - **/ - - if (isBottom) { - inchartPoints.forEach((point) => { - rectList.push(this.generateLineDataByTwoPoints([point[0], minY], point)) - }) - - rectList.push(this.generateLineDataByTwoPoints(point1, point2)) - } - // 如果是上边,同理,推入上边俩点构成矩形 - else { - inchartPoints.forEach((point) => { - rectList.push(this.generateLineDataByTwoPoints([point[0], maxY], point)) - }) - - rectList.push(this.generateLineDataByTwoPoints(point1, point2)) - } - } - } - // 只有一个点在范围内,则是选中了矩形的一个角 - else if (inchartPoints.length == 1) { - const point = inchartPoints[0] - const isLeft = !!outchartPoints.find((outPoint) => outPoint[0] < point[0]) - const isBottom = !!outchartPoints.find((outPoint) => outPoint[1] < point[1]) - // 截取的右上角 - if (isLeft && isBottom) { - rectList.push(this.generateLineDataByTwoPoints(point, [minX, point[1]])) - rectList.push(this.generateLineDataByTwoPoints(point, [point[0], minY])) - } - // 截取的右下角 - if (isLeft && !isBottom) { - rectList.push(this.generateLineDataByTwoPoints(point, [minX, point[1]])) - rectList.push(this.generateLineDataByTwoPoints(point, [point[0], maxY])) - } - // 截取的左下角 - if (!isLeft && !isBottom) { - rectList.push(this.generateLineDataByTwoPoints(point, [maxX, point[1]])) - rectList.push(this.generateLineDataByTwoPoints(point, [point[0], maxY])) - } - // 截取的左上角 - if (!isLeft && isBottom) { - rectList.push(this.generateLineDataByTwoPoints(point, [maxX, point[1]])) - rectList.push(this.generateLineDataByTwoPoints(point, [point[0], minY])) - } - } - // 全在里面 - else if (inchartPoints.length == 4) { - // 按顺序挨个连起来,并且尾部连到头部 - rect.forEach((point, index) => { - if (index == rect.length - 1) { - rectList.push(this.generateLineDataByTwoPoints(point, rect[0])) - } else { - rectList.push(this.generateLineDataByTwoPoints(point, rect[index + 1])) - } - }) - } - // 全不在里面 - else { - // 筛选出所有的在框选范围内的横坐标 - const xAxisList = rect.map((item) => item[0]).filter((xAxis) => xAxis > minX && xAxis < maxX) - const leftBottomPoint = rect[0] - const rightBottomPoint = rect[1] - const rightTopPoint = rect[3] - const minYAxis = rightBottomPoint[1] - const maYAxis = rightTopPoint[1] - // 需要显示左右两侧的框线 - if (xAxisList.length == 4 && minYAxis < minY && maYAxis > maxY) { - const minAxis = Math.min(...xAxisList) - const maxAxis = Math.max(...xAxisList) - rectList.push(this.generateLineDataByTwoPoints([minAxis, minY], [minAxis, maxY])) - rectList.push(this.generateLineDataByTwoPoints([maxAxis, minY], [maxAxis, maxY])) - } - // 需要显示左右其中一条框线 - else if (xAxisList.length == 2 && minYAxis < minY && maYAxis > maxY) { - const xAxis = xAxisList[0] - rectList.push(this.generateLineDataByTwoPoints([xAxis, minY], [xAxis, maxY])) - } - - // 筛选出所有的在框选范围内的横坐标 - const yAxisList = rect.map((item) => item[1]).filter((xAxis) => xAxis > minY && xAxis < maxY) - const minXAxis = leftBottomPoint[0] - const maxXAxis = rightBottomPoint[0] - // 需要显示上下两侧的框线 - if (yAxisList.length == 4 && minXAxis < minX && maxXAxis > maxX) { - const minAxis = Math.min(...yAxisList) - const maxAxis = Math.max(...yAxisList) - rectList.push(this.generateLineDataByTwoPoints([minX, minAxis], [maxX, minAxis])) - rectList.push(this.generateLineDataByTwoPoints([minX, maxAxis], [maxX, maxAxis])) - } - // 需要显示左右其中一条框线 - else if (yAxisList.length == 2 && minXAxis < minX && maxXAxis > maxX) { - const yAxis = yAxisList[0] - rectList.push(this.generateLineDataByTwoPoints([minX, yAxis], [maxX, yAxis])) - } - } - // 补齐颜色 - rectList.forEach((item) => { - item[0].lineStyle = { + return { + data: rect, + symbol: 'none', + itemStyle: { color, - } - }) - return rectList - }, - - /** - * 获取在框选范围内的点列表 - * @param { Array> } rectInfo - */ - getInChartPoints(rectInfo) { - const { - xAxis: { min: minX, max: maxX }, - yAxis: { min: minY, max: maxY }, - } = this.twoDOption - - return rectInfo.filter((point) => { - const [xAxis, yAxis] = point - return xAxis >= minX && xAxis <= maxX && yAxis >= minY && yAxis <= maxY - }) - }, - - /** - * 根据俩点判断是横向还是纵向 - * x坐标相同,则是纵向,否则横向 - */ - isVerticleLine(point1, point2) { - return point1[0] == point2[0] ? true : false - }, - - /** - * 根据两个点生成一个markLine直线 - */ - generateLineDataByTwoPoints(point1, point2) { - return [ - { - xAxis: point1[0], - yAxis: point1[1], }, - { - xAxis: point2[0], - yAxis: point2[1], - }, - ] + } }, // 随机颜色算法 diff --git a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue index 374841c..03e8b58 100644 --- a/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue +++ b/src/views/spectrumAnalysis/components/Modals/AnalyzeInteractiveToolModal/index.vue @@ -127,6 +127,7 @@ @@ -762,6 +763,7 @@ export default { async getSelPosNuclide(row) { this.model.possibleNuclide = '' this.model.identifiedNuclide = '' + this.model.tolerance = 0.5 if (!row._possible) { this.$set(row, '_loading', true) diff --git a/src/views/spectrumAnalysis/components/Modals/CompareFromDBModal.vue b/src/views/spectrumAnalysis/components/Modals/CompareFromDBModal.vue index e42f966..fa3f05d 100644 --- a/src/views/spectrumAnalysis/components/Modals/CompareFromDBModal.vue +++ b/src/views/spectrumAnalysis/components/Modals/CompareFromDBModal.vue @@ -108,6 +108,7 @@ export default { this.columns = cloneDeep(columns) this.disableMixinCreated = true return { + searchSampleType: 'All', visible: false, loadType: 'compare', queryParam: { @@ -252,6 +253,7 @@ export default { const { success, result, message } = await getAction('/spectrumAnalysis/getDBSearchList', { AllUsers: this.allUsersValue, + sampleType: this.searchSampleType, }) if (success) { this.stationList = result.stationCode.map((item) => ({ label: item, value: item })) @@ -342,16 +344,22 @@ export default { }, ] if (event == 'B') { + this.searchSampleType = 'Beta' + this.getStationAndDetectorList() this.sampleTypeOption = arr_B this.$nextTick(() => { this.queryParam.sampleType = 'B' }) } else if (event == 'G') { + this.searchSampleType = 'Gamma' + this.getStationAndDetectorList() this.sampleTypeOption = arr_G this.$nextTick(() => { this.queryParam.sampleType = 'P' }) } else { + this.searchSampleType = 'All' + this.getStationAndDetectorList() this.sampleTypeOption = arr_A this.$nextTick(() => { this.queryParam.sampleType = '' diff --git a/src/views/stationOperation/index.vue b/src/views/stationOperation/index.vue index 07a503c..bfffec8 100644 --- a/src/views/stationOperation/index.vue +++ b/src/views/stationOperation/index.vue @@ -254,7 +254,7 @@ export default { try { this.isGettingDataList = true const res = await getAction('/jeecg-station-operation/stationOperation/findList') - res.forEach(item => { + res.forEach((item) => { const { stationId, stationName, stationType } = item item._stationId = `${stationId}${stationName}${stationType}` }) @@ -548,7 +548,10 @@ export default { // 地图图标点击 onMarkerClick(stationInfo) { - this.$refs.mapPane.handleOpenAnalyzeModal(stationInfo) + const { stationType } = stationInfo + if (stationType !== 'NRL' && stationType !== 'Nuclear Facility') { + this.$refs.mapPane.handleOpenAnalyzeModal(stationInfo) + } }, /** diff --git a/src/views/statistics/imsData/met/index.vue b/src/views/statistics/imsData/met/index.vue index 3ccea72..834b3a5 100644 --- a/src/views/statistics/imsData/met/index.vue +++ b/src/views/statistics/imsData/met/index.vue @@ -99,7 +99,7 @@ const columns = [ import { compareDate } from '../../commom' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { getAction, getFileAction } from '../../../../api/manage' -import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' +import moment from 'moment' export default { name: 'menuTree', mixins: [JeecgListMixin], @@ -109,8 +109,12 @@ export default { isImmediate: true, columns, queryParam: { - startTime: dateFormat(new Date(), 'yyyy-MM-dd'), - endTime: dateFormat(new Date(), 'yyyy-MM-dd'), + startTime: sessionStorage.getItem('currStartDate_sta') + ? sessionStorage.getItem('currStartDate_sta') + : moment().subtract(6, 'days').format('YYYY-MM-DD'), + endTime: sessionStorage.getItem('currEndDate_sta') + ? sessionStorage.getItem('currEndDate_sta') + : moment().format('YYYY-MM-DD'), stationIds: [], }, url: { @@ -184,13 +188,19 @@ export default { getAction(this.url.findStationList, { menuName: '' }).then((res) => { if (res.result.length > 0) { this.stationList = res.result.map((res) => ({ label: res.stationCode, value: res.stationId })) + // 进入页面自动查询 + let arr = sessionStorage.getItem('selectedSta_sta') + ? sessionStorage.getItem('selectedSta_sta').split(',') + : [] + this.queryParam.stationIds = arr.map((item) => Number(item)) + this.searchQueryData() } else { this.stationList = [] } }) }, handleSelectChange(val) { - console.log(val) + window.sessionStorage.setItem('selectedSta_sta', val) let length = this.stationList.length if (val.length === length) { this.allChecked = true @@ -202,31 +212,39 @@ export default { this.allChecked = val if (val) { this.queryParam.stationIds = this.stationList.map((item) => item.value) + window.sessionStorage.setItem('selectedSta_sta', this.queryParam.stationIds) } else { this.queryParam.stationIds = [] + window.sessionStorage.setItem('selectedSta_sta', []) } }, filterOption(input, option) { return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, + handleStartDateChange(date) { + window.sessionStorage.setItem('currStartDate_sta', date) + }, + handleEndDateChange(date) { + window.sessionStorage.setItem('currEndDate_sta', date) + }, }, computed: { formItems() { return [ - { - type: 'a-input', - label: '', - name: 'search', - props: { - placeholder: 'search...', - style: { - width: '166px', - }, - }, - style: { - width: 'auto', - }, - }, + // { + // type: 'a-input', + // label: '', + // name: 'search', + // props: { + // placeholder: 'search...', + // style: { + // width: '166px', + // }, + // }, + // style: { + // width: 'auto', + // }, + // }, { type: 'custom-all-select', label: 'Stations', @@ -262,6 +280,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleStartDateChange, + }, style: { width: 'auto', }, @@ -278,6 +299,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleEndDateChange, + }, style: { width: 'auto', }, diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/calibphd.vue b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/calibphd.vue index 100edca..98c4940 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/calibphd.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/calibphd.vue @@ -1,18 +1,25 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/detbkphd.vue b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/detbkphd.vue index 50119ae..40609d1 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/detbkphd.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/detbkphd.vue @@ -1,18 +1,25 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/qcphd.vue b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/qcphd.vue index 6128d25..b31392f 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/qcphd.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/qcphd.vue @@ -1,18 +1,25 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdf.vue b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdf.vue index fe399f6..9acd2f6 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdf.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdf.vue @@ -1,18 +1,26 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdp.vue b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdp.vue index d5d79db..d0662a8 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdp.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/betaGamma/sphdp.vue @@ -1,18 +1,26 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/calibphd.vue b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/calibphd.vue index 91016c7..2f2c9d6 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/calibphd.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/calibphd.vue @@ -1,18 +1,25 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/detbkphd.vue b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/detbkphd.vue index b4cf57e..7f32129 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/detbkphd.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/detbkphd.vue @@ -1,18 +1,25 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/qcphd.vue b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/qcphd.vue index ac9f1eb..96ada18 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/qcphd.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/qcphd.vue @@ -1,18 +1,25 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdf.vue b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdf.vue index 2f30266..4b52c35 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdf.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdf.vue @@ -1,18 +1,26 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdp.vue b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdp.vue index 4940e15..8690e4e 100644 --- a/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdp.vue +++ b/src/views/statistics/imsData/radionuclide/nobleGas/hpge/sphdp.vue @@ -1,18 +1,26 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue b/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue index bdafcd6..0bd7fed 100644 --- a/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue +++ b/src/views/statistics/imsData/radionuclide/particulate/blankphd.vue @@ -1,35 +1,13 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/particulate/detbkphd.vue b/src/views/statistics/imsData/radionuclide/particulate/detbkphd.vue index cfd0e21..4bff72c 100644 --- a/src/views/statistics/imsData/radionuclide/particulate/detbkphd.vue +++ b/src/views/statistics/imsData/radionuclide/particulate/detbkphd.vue @@ -1,6 +1,13 @@ diff --git a/src/views/statistics/imsData/radionuclide/particulate/qcphd.vue b/src/views/statistics/imsData/radionuclide/particulate/qcphd.vue index 246e6e5..93f3613 100644 --- a/src/views/statistics/imsData/radionuclide/particulate/qcphd.vue +++ b/src/views/statistics/imsData/radionuclide/particulate/qcphd.vue @@ -1,18 +1,25 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/particulate/sphdf.vue b/src/views/statistics/imsData/radionuclide/particulate/sphdf.vue index a412a18..82d2f03 100644 --- a/src/views/statistics/imsData/radionuclide/particulate/sphdf.vue +++ b/src/views/statistics/imsData/radionuclide/particulate/sphdf.vue @@ -1,18 +1,26 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/radionuclide/particulate/sphdp.vue b/src/views/statistics/imsData/radionuclide/particulate/sphdp.vue index 8ab5d85..0159de3 100644 --- a/src/views/statistics/imsData/radionuclide/particulate/sphdp.vue +++ b/src/views/statistics/imsData/radionuclide/particulate/sphdp.vue @@ -1,18 +1,26 @@ \ No newline at end of file diff --git a/src/views/statistics/imsData/stateOfHealth/alerts.vue b/src/views/statistics/imsData/stateOfHealth/alerts.vue index e3f9532..bcf1b72 100644 --- a/src/views/statistics/imsData/stateOfHealth/alerts.vue +++ b/src/views/statistics/imsData/stateOfHealth/alerts.vue @@ -79,7 +79,7 @@ const columns = [ import { compareDate } from '../../commom' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { getAction, getFileAction } from '../../../../api/manage' -import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' +import moment from 'moment' export default { name: 'menuTree', mixins: [JeecgListMixin], @@ -89,8 +89,12 @@ export default { isImmediate: true, columns, queryParam: { - startTime: dateFormat(new Date(), 'yyyy-MM-dd'), - endTime: dateFormat(new Date(), 'yyyy-MM-dd'), + startTime: sessionStorage.getItem('currStartDate_sta') + ? sessionStorage.getItem('currStartDate_sta') + : moment().subtract(6, 'days').format('YYYY-MM-DD'), + endTime: sessionStorage.getItem('currEndDate_sta') + ? sessionStorage.getItem('currEndDate_sta') + : moment().format('YYYY-MM-DD'), stationIds: [], }, url: { @@ -112,11 +116,6 @@ export default { handleExcel() { if (this.dataSource.length > 0) { this.excelLoading = true - // this.queryParam = { - // startTime: "2023-07-17", - // endTime: "2023-07-17", - // stationIds: [1] - // } let params = { ...this.queryParam, } @@ -144,11 +143,6 @@ export default { let days = compareDate(this.queryParam.startTime, this.queryParam.endTime) if (days <= 10) { this.isImmediate = false - // this.queryParam = { - // startTime: "2023-01-01", - // endTime: "2023-07-10", - // stationIds: [209, 210] - // } let params = { ...this.queryParam, pageNo: 1, @@ -175,6 +169,12 @@ export default { if (res.success) { if (res.result.length > 0) { this.stationList = res.result.map((res) => ({ label: res.stationCode, value: res.stationId })) + // 进入页面自动查询 + let arr = sessionStorage.getItem('selectedSta_sta') + ? sessionStorage.getItem('selectedSta_sta').split(',') + : [] + this.queryParam.stationIds = arr.map((item) => Number(item)) + this.searchQueryData() } else { this.stationList = [] } @@ -184,7 +184,7 @@ export default { }) }, handleSelectChange(val) { - console.log(val) + window.sessionStorage.setItem('selectedSta_sta', val) let length = this.stationList.length if (val.length === length) { this.allChecked = true @@ -196,31 +196,39 @@ export default { this.allChecked = val if (val) { this.queryParam.stationIds = this.stationList.map((item) => item.value) + window.sessionStorage.setItem('selectedSta_sta', this.queryParam.stationIds) } else { this.queryParam.stationIds = [] + window.sessionStorage.setItem('selectedSta_sta', []) } }, filterOption(input, option) { return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, + handleStartDateChange(date) { + window.sessionStorage.setItem('currStartDate_sta', date) + }, + handleEndDateChange(date) { + window.sessionStorage.setItem('currEndDate_sta', date) + }, }, computed: { formItems() { return [ - { - type: 'a-input', - label: '', - name: 'search', - props: { - placeholder: 'search...', - style: { - width: '166px', - }, - }, - style: { - width: 'auto', - }, - }, + // { + // type: 'a-input', + // label: '', + // name: 'search', + // props: { + // placeholder: 'search...', + // style: { + // width: '166px', + // }, + // }, + // style: { + // width: 'auto', + // }, + // }, { type: 'custom-all-select', label: 'Stations', @@ -256,6 +264,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleStartDateChange, + }, style: { width: 'auto', }, @@ -272,6 +283,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleEndDateChange, + }, style: { width: 'auto', }, diff --git a/src/views/statistics/imsData/stateOfHealth/rmssoh.vue b/src/views/statistics/imsData/stateOfHealth/rmssoh.vue index ff22b61..465561a 100644 --- a/src/views/statistics/imsData/stateOfHealth/rmssoh.vue +++ b/src/views/statistics/imsData/stateOfHealth/rmssoh.vue @@ -78,6 +78,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { getAction, getFileAction } from '../../../../api/manage' import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' import FileDetail from '../../fileDetail.vue' +import moment from 'moment' export default { name: 'menuTree', mixins: [JeecgListMixin], @@ -90,8 +91,12 @@ export default { isImmediate: true, columns, queryParam: { - startTime: dateFormat(new Date(), 'yyyy-MM-dd'), - endTime: dateFormat(new Date(), 'yyyy-MM-dd'), + startTime: sessionStorage.getItem('currStartDate_sta') + ? sessionStorage.getItem('currStartDate_sta') + : moment().subtract(6, 'days').format('YYYY-MM-DD'), + endTime: sessionStorage.getItem('currEndDate_sta') + ? sessionStorage.getItem('currEndDate_sta') + : moment().format('YYYY-MM-DD'), stationIds: [], }, url: { @@ -150,11 +155,6 @@ export default { let days = compareDate(this.queryParam.startTime, this.queryParam.endTime) if (days <= 10) { this.isImmediate = false - // this.queryParam = { - // startTime: "2023-01-01", - // endTime: "2023-07-10", - // stationIds: [209, 210] - // } let params = { ...this.queryParam, pageNo: 1, @@ -181,6 +181,12 @@ export default { if (res.success) { if (res.result.length > 0) { this.stationList = res.result.map((res) => ({ label: res.stationCode, value: res.stationId })) + // 进入页面自动查询 + let arr = sessionStorage.getItem('selectedSta_sta') + ? sessionStorage.getItem('selectedSta_sta').split(',') + : [] + this.queryParam.stationIds = arr.map((item) => Number(item)) + this.searchQueryData() } else { this.stationList = [] } @@ -190,7 +196,7 @@ export default { }) }, handleSelectChange(val) { - console.log(val) + window.sessionStorage.setItem('selectedSta_sta', val) let length = this.stationList.length if (val.length === length) { this.allChecked = true @@ -202,31 +208,39 @@ export default { this.allChecked = val if (val) { this.queryParam.stationIds = this.stationList.map((item) => item.value) + window.sessionStorage.setItem('selectedSta_sta', this.queryParam.stationIds) } else { this.queryParam.stationIds = [] + window.sessionStorage.setItem('selectedSta_sta', []) } }, filterOption(input, option) { return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, + handleStartDateChange(date) { + window.sessionStorage.setItem('currStartDate_sta', date) + }, + handleEndDateChange(date) { + window.sessionStorage.setItem('currEndDate_sta', date) + }, }, computed: { formItems() { return [ - { - type: 'a-input', - label: '', - name: 'search', - props: { - placeholder: 'search...', - style: { - width: '166px', - }, - }, - style: { - width: 'auto', - }, - }, + // { + // type: 'a-input', + // label: '', + // name: 'search', + // props: { + // placeholder: 'search...', + // style: { + // width: '166px', + // }, + // }, + // style: { + // width: 'auto', + // }, + // }, { type: 'custom-all-select', label: 'Stations', @@ -262,6 +276,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleStartDateChange, + }, style: { width: 'auto', }, @@ -278,6 +295,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleEndDateChange, + }, style: { width: 'auto', }, diff --git a/src/views/statistics/imsProducts/arr/index.vue b/src/views/statistics/imsProducts/arr/index.vue index 18fc93a..5d736a2 100644 --- a/src/views/statistics/imsProducts/arr/index.vue +++ b/src/views/statistics/imsProducts/arr/index.vue @@ -72,12 +72,22 @@ const columns = [ align: 'left', dataIndex: 'sampleId', }, + { + title: 'Qualifie', + align: 'left', + dataIndex: 'spectralQualifie', + }, + { + title: 'Analyst', + align: 'left', + dataIndex: 'analyst', + }, ] import { compareDate } from '../../commom' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { getAction, getFileAction } from '../../../../api/manage' -import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' import FileDetail from '../../fileDetail.vue' +import moment from 'moment' export default { name: 'menuTree', mixins: [JeecgListMixin], @@ -90,9 +100,14 @@ export default { isImmediate: true, columns, queryParam: { - startTime: dateFormat(new Date(), 'yyyy-MM-dd'), - endTime: dateFormat(new Date(), 'yyyy-MM-dd'), + startTime: sessionStorage.getItem('currStartDate_pro') + ? sessionStorage.getItem('currStartDate_pro') + : moment().subtract(6, 'days').format('YYYY-MM-DD'), + endTime: sessionStorage.getItem('currEndDate_pro') + ? sessionStorage.getItem('currEndDate_pro') + : moment().format('YYYY-MM-DD'), stationIds: [], + qualifie: undefined, }, url: { list: '/radionuclide/findAutoPage', @@ -109,7 +124,7 @@ export default { } }, created() { - this.queryParam.startTime = this.getBeforeDate(9) + // this.queryParam.startTime = this.getBeforeDate(9) this.findStationList() }, methods: { @@ -150,11 +165,6 @@ export default { let days = compareDate(this.queryParam.startTime, this.queryParam.endTime) if (days <= 10) { this.isImmediate = false - // this.queryParam = { - // startTime: "2023-01-01", - // endTime: "2023-07-10", - // stationIds: [209, 210] - // } let params = { ...this.queryParam, pageNo: 1, @@ -182,8 +192,13 @@ export default { if (res.result.length > 0) { this.stationList = res.result.map((res) => ({ label: res.stationCode, value: res.stationId })) // 进入页面自动查询 - this.queryParam.stationIds = this.stationList.map((item) => item.value) - this.allChecked = true + let arr = sessionStorage.getItem('selectedSta_pro') + ? sessionStorage.getItem('selectedSta_pro').split(',') + : [] + this.queryParam.stationIds = arr.map((item) => Number(item)) + this.queryParam.qualifie = sessionStorage.getItem('qualifie') + ? sessionStorage.getItem('qualifie') + : undefined this.searchQueryData() } else { this.stationList = [] @@ -194,7 +209,7 @@ export default { }) }, handleSelectChange(val) { - console.log(val) + window.sessionStorage.setItem('selectedSta_pro', val) let length = this.stationList.length if (val.length === length) { this.allChecked = true @@ -206,10 +221,22 @@ export default { this.allChecked = val if (val) { this.queryParam.stationIds = this.stationList.map((item) => item.value) + window.sessionStorage.setItem('selectedSta_pro', this.queryParam.stationIds) } else { this.queryParam.stationIds = [] + window.sessionStorage.setItem('selectedSta_pro', []) } }, + handleQualifieChange(val) { + this.queryParam.qualifie = val + sessionStorage.setItem('qualifie', val) + }, + handleStartDateChange(date) { + window.sessionStorage.setItem('currStartDate_pro', date) + }, + handleEndDateChange(date) { + window.sessionStorage.setItem('currEndDate_pro', date) + }, getBeforeDate(n) { var n = n var d = new Date() @@ -238,7 +265,7 @@ export default { computed: { formItems() { return [ - { + /*{ type: 'a-input', label: '', name: 'search', @@ -251,7 +278,7 @@ export default { style: { width: 'auto', }, - }, + },*/ { type: 'custom-all-select', label: 'Stations', @@ -287,6 +314,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleStartDateChange, + }, style: { width: 'auto', }, @@ -303,6 +333,31 @@ export default { width: '200px', }, }, + on: { + change: this.handleEndDateChange, + }, + style: { + width: 'auto', + }, + }, + { + type: 'a-select', + label: 'Qualifie', + name: 'qualifie', + props: { + allowClear: true, + placeholder: 'Select qualifie', + options: [ + { label: 'FULL', value: 'FULL' }, + { label: 'PREL', value: 'PREL' }, + ], + style: { + width: '200px', + }, + }, + on: { + change: this.handleQualifieChange, + }, style: { width: 'auto', }, diff --git a/src/views/statistics/imsProducts/rrr/index.vue b/src/views/statistics/imsProducts/rrr/index.vue index 81dc4db..42d1aae 100644 --- a/src/views/statistics/imsProducts/rrr/index.vue +++ b/src/views/statistics/imsProducts/rrr/index.vue @@ -72,12 +72,22 @@ const columns = [ align: 'left', dataIndex: 'sampleId', }, + { + title: 'Qualifie', + align: 'left', + dataIndex: 'spectralQualifie', + }, + { + title: 'Analyst', + align: 'left', + dataIndex: 'analyst', + }, ] import { compareDate } from '../../commom' import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { getAction, getFileAction } from '../../../../api/manage' -import dateFormat from '../../../../components/jeecg/JEasyCron/format-date' import FileDetail from '../../fileDetail.vue' +import moment from 'moment' export default { name: 'menuTree', mixins: [JeecgListMixin], @@ -90,9 +100,14 @@ export default { isImmediate: true, columns, queryParam: { - startTime: dateFormat(new Date(), 'yyyy-MM-dd'), - endTime: dateFormat(new Date(), 'yyyy-MM-dd'), + startTime: sessionStorage.getItem('currStartDate_pro') + ? sessionStorage.getItem('currStartDate_pro') + : moment().subtract(6, 'days').format('YYYY-MM-DD'), + endTime: sessionStorage.getItem('currEndDate_pro') + ? sessionStorage.getItem('currEndDate_pro') + : moment().format('YYYY-MM-DD'), stationIds: [], + qualifie: undefined, }, url: { list: '/radionuclide/findReviewedPage', @@ -109,7 +124,7 @@ export default { } }, created() { - this.queryParam.startTime = this.getBeforeDate(9) + // this.queryParam.startTime = this.getBeforeDate(9) this.findStationList() }, methods: { @@ -182,8 +197,13 @@ export default { if (res.result.length > 0) { this.stationList = res.result.map((res) => ({ label: res.stationCode, value: res.stationId })) // 进入页面自动查询 - this.queryParam.stationIds = this.stationList.map((item) => item.value) - this.allChecked = true + let arr = sessionStorage.getItem('selectedSta_pro') + ? sessionStorage.getItem('selectedSta_pro').split(',') + : [] + this.queryParam.stationIds = arr.map((item) => Number(item)) + this.queryParam.qualifie = sessionStorage.getItem('qualifie') + ? sessionStorage.getItem('qualifie') + : undefined this.searchQueryData() } else { this.stationList = [] @@ -194,7 +214,7 @@ export default { }) }, handleSelectChange(val) { - console.log(val) + window.sessionStorage.setItem('selectedSta_pro', val) let length = this.stationList.length if (val.length === length) { this.allChecked = true @@ -206,10 +226,22 @@ export default { this.allChecked = val if (val) { this.queryParam.stationIds = this.stationList.map((item) => item.value) + window.sessionStorage.setItem('selectedSta_pro', this.queryParam.stationIds) } else { this.queryParam.stationIds = [] + window.sessionStorage.setItem('selectedSta_pro', []) } }, + handleQualifieChange(val) { + this.queryParam.qualifie = val + sessionStorage.setItem('qualifie', val) + }, + handleStartDateChange(date) { + window.sessionStorage.setItem('currStartDate_pro', date) + }, + handleEndDateChange(date) { + window.sessionStorage.setItem('currEndDate_pro', date) + }, getBeforeDate(n) { var n = n var d = new Date() @@ -238,7 +270,7 @@ export default { computed: { formItems() { return [ - { + /*{ type: 'a-input', label: '', name: 'search', @@ -251,7 +283,7 @@ export default { style: { width: 'auto', }, - }, + },*/ { type: 'custom-all-select', label: 'Stations', @@ -287,6 +319,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleStartDateChange, + }, style: { width: 'auto', }, @@ -303,6 +338,31 @@ export default { width: '200px', }, }, + on: { + change: this.handleEndDateChange, + }, + style: { + width: 'auto', + }, + }, + { + type: 'a-select', + label: 'Qualifie', + name: 'qualifie', + props: { + allowClear: true, + placeholder: 'Select qualifie', + options: [ + { label: 'FULL', value: 'FULL' }, + { label: 'PREL', value: 'PREL' }, + ], + style: { + width: '200px', + }, + }, + on: { + change: this.handleQualifieChange, + }, style: { width: 'auto', }, diff --git a/src/views/statistics/list.vue b/src/views/statistics/list.vue index 7704928..be70c7e 100644 --- a/src/views/statistics/list.vue +++ b/src/views/statistics/list.vue @@ -44,6 +44,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { getAction, getFileAction } from '../../api/manage' import dateFormat from '../../components/jeecg/JEasyCron/format-date' import Detail from './detail.vue' +import moment from 'moment' export default { name: 'menuTree', props: { @@ -71,24 +72,34 @@ export default { type: String, default: '', }, + menuType: { + type: String, + default: '', + }, }, mixins: [JeecgListMixin], components: { Detail, }, watch: { - fileName: { - handler: function (val) { - if (val === 'QCPHD' || val === 'SPHDF' || val === 'SPHDP') { - this.$nextTick(() => { - this.queryParam.startTime = this.getBeforeDate(6) - }) - } + stationList: { + handler(val) { + let arr = sessionStorage.getItem(`selectedSta_${this.menuType}`) + ? sessionStorage.getItem(`selectedSta_${this.menuType}`).split(',') + : [] + this.queryParam.stationIds = arr.map((item) => Number(item)) + ;(this.queryParam.startTime = sessionStorage.getItem(`currStartDate_${this.menuType}`) + ? sessionStorage.getItem(`currStartDate_${this.menuType}`) + : moment().subtract(6, 'days').format('YYYY-MM-DD')), + (this.queryParam.endTime = sessionStorage.getItem(`currEndDate_${this.menuType}`) + ? sessionStorage.getItem(`currEndDate_${this.menuType}`) + : moment().format('YYYY-MM-DD')), + this.loadData() }, - immediate: true, }, }, data() { + this.disableMixinCreated = true return { excelLoading: false, spinning: false, @@ -96,8 +107,8 @@ export default { isDetail: false, queryParam: { dataType: this.dataType, - startTime: dateFormat(new Date(), 'yyyy-MM-dd'), - endTime: dateFormat(new Date(), 'yyyy-MM-dd'), + startTime: '', + endTime: '', stationIds: [], spectralQualifie: this.spectralQualifie, }, @@ -185,6 +196,8 @@ export default { this.isDetail = flag }, handleSelectChange(val) { + console.log(val) + window.sessionStorage.setItem(`selectedSta_${this.menuType}`, val) let length = this.stationList.length if (val.length === length) { this.allChecked = true @@ -196,34 +209,20 @@ export default { this.allChecked = val if (val) { this.queryParam.stationIds = this.stationList.map((item) => item.value) + window.sessionStorage.setItem(`selectedSta_${this.menuType}`, this.queryParam.stationIds) } else { this.queryParam.stationIds = [] + window.sessionStorage.setItem(`selectedSta_${this.menuType}`, []) } }, filterOption(input, option) { return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, - // 获取n天前的日期 - getBeforeDate(n) { - var n = n - var d = new Date() - var year = d.getFullYear() - var mon = d.getMonth() + 1 - var day = d.getDate() - if (day <= n) { - if (mon > 1) { - mon = mon - 1 - } else { - year = year - 1 - mon = 12 - } - } - d.setDate(d.getDate() - n) - year = d.getFullYear() - mon = d.getMonth() + 1 - day = d.getDate() - var s = year + '-' + (mon < 10 ? '0' + mon : mon) + '-' + (day < 10 ? '0' + day : day) - return s + handleStartDateChange(date) { + window.sessionStorage.setItem(`currStartDate_${this.menuType}`, date) + }, + handleEndDateChange(date) { + window.sessionStorage.setItem(`currEndDate_${this.menuType}`, date) }, }, computed: { @@ -278,6 +277,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleStartDateChange, + }, style: { width: 'auto', }, @@ -294,6 +296,9 @@ export default { width: '200px', }, }, + on: { + change: this.handleEndDateChange, + }, style: { width: 'auto', }, diff --git a/src/views/system/DetectorInfo.vue b/src/views/system/DetectorInfo.vue index 766d778..09449f5 100644 --- a/src/views/system/DetectorInfo.vue +++ b/src/views/system/DetectorInfo.vue @@ -43,52 +43,92 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -198,23 +238,28 @@ export default { data() { this.columns = columns const validateDetectorCode = (_, value, callback) => { - if (!value) { - callback(new Error('Please Enter Detector Code')) - } else { - if (value.length > 9) { - callback(new Error('Detector Code Limit 9')) + if(this.model.stationId){ + if (value) { + if (value.length > 9) { + callback(new Error('Detector Code Limit 9')) + } else { + callback() + } } else { - callback() + callback(new Error('Please Enter Code')) } + }else { + callback('Select Station First'); } } return { queryParam: {}, rules: { - detectorId: [{ required: true, message: 'Please Enter Detector Id' }], + // detectorId: [{ required: true, message: 'Please Enter Id' }, { validator: this.checkId }], detectorCode: [{ required: true, validator: validateDetectorCode }], - moddate: [{ required: true, message: 'Please Select Moddate' }] + stationId: [{ required: true, message: 'Please Select Station' }], + status: [{ required: true, message: 'Please Select Status' }] }, url: { list: '/gardsDetectors/findPage', @@ -222,7 +267,8 @@ export default { add: '/gardsDetectors/create', edit: '/gardsDetectors/update' }, - typeList: [] + typeList: [], + stationOptions: [], } }, created() { @@ -231,7 +277,7 @@ export default { methods: { async getTypeList() { try { - const res = await getAction('/gardsDetectors/findType') + const res = await getAction( '/gardsDetectors/findType') this.typeList = res.filter(item => item).map(item => ({ label: item, value: item })) } catch (error) { console.error(error) @@ -244,13 +290,15 @@ export default { onAdd() { this.isAdd = true - this.model = {} + this.model = { status: 'Operating' } + this.getStationList() this.visible = true }, onEdit() { if (this.selectedRowKeys && this.selectedRowKeys.length) { this.isAdd = false this.visible = true + this.getStationList() const find = this.dataSource.find(item => item.detectorId === this.selectedRowKeys[0]) this.model = cloneDeep(find) } else { @@ -274,6 +322,43 @@ export default { beforeSubmit() { this.model.moddate = moment(this.model.moddate).format('yyyy-MM-DD HH:mm:ss') + }, + + async getStationList() { + await getAction('/webStatistics/findStationList', { menuName: '' }).then((res) => { + if (res.success) { + if (res.result.length > 0) { + this.stationOptions = res.result.map((item) => { + return { + label: item.stationCode, + value: item.stationId, + } + }) + } else { + this.stationOptions = [] + } + } else { + this.$message.warning('This operation fails. Contact your system administrator') + } + }) + }, + + enterCode(){ + let stationId = this.model.stationId + if (stationId){ + let current = this.model.detectorCode + let stationCode = this.stationOptions.find(option => option.value === stationId).label; + let prefix = stationCode + "_" + if (!current.startsWith(prefix)){ + this.model.detectorCode = prefix + current + }else { + if (prefix === current){ + this.model.detectorCode = '' + } + } + }else { + this.model.detectorCode = '' + } } }, computed: {