Compare commits
No commits in common. "2a957f7427544f6378f0a0466db912e69434d9f3" and "42dacfa6f05b3ac34784aa077f084a17b1010156" have entirely different histories.
2a957f7427
...
42dacfa6f0
|
@ -215,9 +215,13 @@ export default {
|
||||||
async handler(newVal, oldVal) {
|
async handler(newVal, oldVal) {
|
||||||
const sampleData = getSampleData(newVal.inputFileName)
|
const sampleData = getSampleData(newVal.inputFileName)
|
||||||
if (sampleData) {
|
if (sampleData) {
|
||||||
const { data } = sampleData
|
const { data, from } = sampleData
|
||||||
this.sampleDetail = data
|
this.sampleDetail = data
|
||||||
this.changeChartByType('sample')
|
this.changeChartByType('sample')
|
||||||
|
if (from == 'db') {
|
||||||
|
this.sampleDetail = data
|
||||||
|
}
|
||||||
|
this.ROIAnalyzeLists = data.ROIAnalyzeLists || []
|
||||||
} else {
|
} else {
|
||||||
if (newVal.sampleId) {
|
if (newVal.sampleId) {
|
||||||
this.getDetailFromDB()
|
this.getDetailFromDB()
|
||||||
|
@ -268,7 +272,7 @@ export default {
|
||||||
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
|
const { success, result, message } = await postAction('/selfStation/Reprocessing', formData)
|
||||||
if (success) {
|
if (success) {
|
||||||
const analyseList = this.getROIAnalyzeListsFromResult(result)
|
const analyseList = this.getROIAnalyzeListsFromResult(result)
|
||||||
this.ROIAnalyzeLists = this.spectraType == 'sample' ? analyseList : []
|
this.ROIAnalyzeLists = analyseList
|
||||||
updateSampleData({
|
updateSampleData({
|
||||||
inputFileName,
|
inputFileName,
|
||||||
key: 'ROIAnalyzeLists',
|
key: 'ROIAnalyzeLists',
|
||||||
|
@ -405,7 +409,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取谱详情
|
// 获取样品详情
|
||||||
async getDetailFromDB() {
|
async getDetailFromDB() {
|
||||||
const { dbName, sampleId, analyst, inputFileName } = this.sample
|
const { dbName, sampleId, analyst, inputFileName } = this.sample
|
||||||
try {
|
try {
|
||||||
|
@ -430,6 +434,7 @@ export default {
|
||||||
})
|
})
|
||||||
|
|
||||||
const analyseList = this.getROIAnalyzeListsFromResult(result.sample)
|
const analyseList = this.getROIAnalyzeListsFromResult(result.sample)
|
||||||
|
this.ROIAnalyzeLists = analyseList
|
||||||
updateSampleData({
|
updateSampleData({
|
||||||
inputFileName,
|
inputFileName,
|
||||||
key: 'ROIAnalyzeLists',
|
key: 'ROIAnalyzeLists',
|
||||||
|
|
|
@ -26,16 +26,8 @@
|
||||||
@resize="handleChartResize"
|
@resize="handleChartResize"
|
||||||
/>
|
/>
|
||||||
<div class="bar">
|
<div class="bar">
|
||||||
<div>{{ visualMap.max }}</div>
|
<div>{{ visualMapMax }}</div>
|
||||||
<div class="bar-main">
|
<div class="bar-main"></div>
|
||||||
<a-slider
|
|
||||||
v-model="visualMap.value"
|
|
||||||
range
|
|
||||||
vertical
|
|
||||||
:max="visualMap.max"
|
|
||||||
@afterChange="handleSliderChange"
|
|
||||||
></a-slider>
|
|
||||||
</div>
|
|
||||||
<div>0</div>
|
<div>0</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -232,6 +224,7 @@ export default {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
showROI: true,
|
showROI: true,
|
||||||
|
myChart: null,
|
||||||
startChannel: null,
|
startChannel: null,
|
||||||
endChannel: null,
|
endChannel: null,
|
||||||
boundaryList: [], // 最终生成的框
|
boundaryList: [], // 最终生成的框
|
||||||
|
@ -239,6 +232,8 @@ export default {
|
||||||
isLog: true, // 当前右侧的图表是否是log
|
isLog: true, // 当前右侧的图表是否是log
|
||||||
currBoundaryItem: null, // 当前正在操作的方框
|
currBoundaryItem: null, // 当前正在操作的方框
|
||||||
|
|
||||||
|
visualMapMax: 0,
|
||||||
|
|
||||||
chartAxis: cloneDeep(ChartAxis),
|
chartAxis: cloneDeep(ChartAxis),
|
||||||
boundary: [],
|
boundary: [],
|
||||||
|
|
||||||
|
@ -248,12 +243,6 @@ export default {
|
||||||
g: 0,
|
g: 0,
|
||||||
c: 0,
|
c: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
visualMap: {
|
|
||||||
// 右侧范围选择
|
|
||||||
value: [0, 0],
|
|
||||||
max: 0,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -368,52 +357,23 @@ export default {
|
||||||
|
|
||||||
// 构造一个scatter 的点
|
// 构造一个scatter 的点
|
||||||
buildScatterItem(xAxis, yAxis, count) {
|
buildScatterItem(xAxis, yAxis, count) {
|
||||||
|
const { r, g, b } = this.interpolateColor(1 - count / this.visualMapMax)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
value: [xAxis, yAxis, count],
|
value: [xAxis, yAxis],
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: this.getScatterItemColor(count),
|
color: `rgb(${r}, ${g}, ${b})`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取一个点的颜色
|
|
||||||
getScatterItemColor(count) {
|
|
||||||
const [min, max] = this.visualMap.value
|
|
||||||
let color = ''
|
|
||||||
if (count >= max) {
|
|
||||||
color = '#f00'
|
|
||||||
} else if (count <= min) {
|
|
||||||
color = '#fff'
|
|
||||||
} else {
|
|
||||||
const { r, g, b } = this.interpolateColor(1 - (count - min) / (max - min))
|
|
||||||
color = `rgb(${r}, ${g}, ${b})`
|
|
||||||
}
|
|
||||||
return color
|
|
||||||
},
|
|
||||||
|
|
||||||
// 设置右侧滑块参数
|
|
||||||
setVisialMapParams() {
|
setVisialMapParams() {
|
||||||
const counts = this.histogramDataList
|
const counts = this.histogramDataList.filter(({ c }) => c).map(({ c }) => c)
|
||||||
.filter(({ c }) => c)
|
if (counts.length) {
|
||||||
.map(({ c }) => c)
|
this.visualMapMax = counts.sort((a, b) => b - a)[0]
|
||||||
.sort((a, b) => b - a)
|
} else {
|
||||||
const max = (counts[0] || 0) + 100
|
this.visualMapMax = 0
|
||||||
// 要求在最大值基础上加100
|
}
|
||||||
this.visualMap.max = max
|
|
||||||
this.visualMap.value = [0, max]
|
|
||||||
},
|
|
||||||
|
|
||||||
// 右侧滑块改变
|
|
||||||
handleSliderChange() {
|
|
||||||
this.scatterList.forEach((item) => {
|
|
||||||
item.itemStyle.color = this.getScatterItemColor(item.value[2])
|
|
||||||
})
|
|
||||||
|
|
||||||
this.$refs.chartTwoDRef.setOption({
|
|
||||||
series: {
|
|
||||||
data: this.scatterList,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 颜色插值算法
|
// 颜色插值算法
|
||||||
|
@ -750,35 +710,7 @@ export default {
|
||||||
&-main {
|
&-main {
|
||||||
width: 14px;
|
width: 14px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
background: linear-gradient(to bottom, #ff0000 0, #fff 100%);
|
||||||
.ant-slider {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
::v-deep {
|
|
||||||
.ant-slider-handle {
|
|
||||||
left: -2px;
|
|
||||||
right: -2px;
|
|
||||||
border-radius: 0;
|
|
||||||
margin-left: 0;
|
|
||||||
box-shadow: none;
|
|
||||||
border: 0;
|
|
||||||
background: #0cebc9;
|
|
||||||
height: 6px;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-slider-rail {
|
|
||||||
width: 100%;
|
|
||||||
background: #084248 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-slider-track {
|
|
||||||
width: 100%;
|
|
||||||
background: linear-gradient(to bottom, #f00 0, #fff 100%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -796,9 +728,11 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
&.disabled {
|
&.disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
|
||||||
.boundary-item-left,
|
.boundary-item-left,
|
||||||
.boundary-item-right {
|
.boundary-item-right {
|
||||||
pointer-events: none;
|
cursor: default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user