-
Configure
+
Configure chart
@@ -44,26 +44,52 @@ export default {
total: 0,
queryParams: {
page: 1,
- size: 10,
+ size: 100,
create_time_begin: '',
create_time_end: '',
},
tableData: [],
- dateRage: []
+ dateRage: [],
+ chartData: {
+ xAxisData: [],
+ seriesData: []
+ }, // xe131m_conc
}
},
created () {
this.onSearch()
},
mounted() {
- // this.chart()
+ this.chart()
},
methods: {
onSearch () {
this.loading = true
this.$axios.get(window.CONFIG.baseUrl + '/nuclide/query_samples', { params: this.queryParams }).then((res) => {
+ debugger
this.tableData = res.data.items
this.total = res.data.pagination.total_count
+
+ res.data.items.forEach(item => {
+ switch (item.type) { // 最多只有
+ case 'aaaaaa':
+ break
+ case 'bbbbbb':
+ break
+ case 'cccccc':
+ break
+ case 'dddddd':
+ break
+ case 'eeeeee':
+ break
+ default:
+ }
+
+ this.chartData.seriesData.push({
+
+ })
+ })
+
}).finally(() => {
this.loading = false
})
@@ -73,7 +99,7 @@ export default {
this.queryParams.create_time_end = dates[1]
},
chart() {
- this.myChart = this.$echarts.init(this.$refs.chartDomx)
+ this.myChart = this.$echarts.init(this.$refs.chartDom)
const option = {
grid: {
left: 60,
@@ -150,24 +176,54 @@ export default {
color: ['#0A4072', '#683F14', '#0F605A', '#0F5A7A', '#5C5F25'],
series: [
{
+ name: 'aaa',
+ type: 'scatter',
symbolSize: 20,
data: [
[10.0, 8.04],
[8.07, 6.95],
[13.0, 7.58],
[9.05, 8.81],
+ ],
+ },
+ {
+ name: 'bbb',
+ type: 'scatter',
+ symbolSize: 20,
+ data: [
[11.0, 8.33],
[14.0, 7.66],
[13.4, 6.81],
[10.0, 6.33],
+ ],
+ },
+ {
+ name: 'ccc',
+ type: 'scatter',
+ symbolSize: 20,
+ data: [
[14.0, 8.96],
[12.5, 6.82],
[9.15, 7.2],
[11.5, 7.2],
+ ],
+ },
+ {
+ name: 'ddd',
+ type: 'scatter',
+ symbolSize: 20,
+ data: [
[3.03, 4.23],
[12.2, 7.83],
[2.02, 4.47],
[1.05, 3.33],
+ ],
+ },
+ {
+ name: 'eee',
+ type: 'scatter',
+ symbolSize: 20,
+ data: [
[4.05, 4.96],
[6.03, 7.24],
[12.0, 6.26],
@@ -175,8 +231,7 @@ export default {
[7.08, 5.82],
[5.02, 5.68]
],
- type: 'scatter'
- }
+ },
]
}
this.myChart.setOption(option)
diff --git a/src/views/chart/pages/MonitorResult.vue b/src/views/chart/pages/MonitorResult.vue
new file mode 100644
index 0000000..8ff93a5
--- /dev/null
+++ b/src/views/chart/pages/MonitorResult.vue
@@ -0,0 +1,370 @@
+
+
+
Monitor result
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Start training
+
+
+
End training
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/chart/pages/Predict.vue b/src/views/chart/pages/Predict.vue
index e38c8ca..8b7b422 100644
--- a/src/views/chart/pages/Predict.vue
+++ b/src/views/chart/pages/Predict.vue
@@ -12,9 +12,9 @@
-->
-
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -80,7 +76,8 @@ export default {
data() {
return {
loading: false,
- total: 0,
+ datasetId: '',
+ datasetIdOptions: [],
queryParams: {
page: 1,
size: 10,
@@ -111,16 +108,23 @@ export default {
},
],
caseOptions: [],
- tableData: [],
fileList: [],
modelTypes: [],
- currentFile: null
+ currentFile: null,
+ myChart: null,
+ chartData: {
+ datasetSource: []
+ },
+ outPath: ''
}
},
created () {
// color: ['#0A4072', '#683F14', '#0F605A', '#0F5A7A', '#5C5F25']
// this.onSearch()
- this.getCaseData()
+ this.getDataset()
+ },
+ mounted() {
+ this.chart()
},
methods: {
onSearch () {
@@ -129,21 +133,42 @@ export default {
formData.append("file", this.currentFile)
formData.append("case_no", this.queryParams.case_no)
formData.append("model_types", this.queryParams.model_types)
- this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => {
- this.tableData = res.data.items
- this.total = res.data.pagination.total_count
+ // this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => {
+ this.$axios.post(window.CONFIG.baseUrl + '/train-oneday/predict_with_label', formData, { headers: { "Content-Type": "multipart/form-data" } }).then((res) => {
+ this.chartData.dataset = res.echart_data
+ this.myChart.setOption({
+ dataset: {
+ source: res.echart_data
+ },
+ })
}).finally(() => {
this.loading = false
})
},
- getCaseData () {
- this.loading = true
- this.$axios.get(window.CONFIG.baseUrl + '/train-oneday/query_train_datasets', { params: this.queryParams }).then((res) => {
- this.caseOptions = res.data.items
- }).finally(() => {
- this.loading = false
+ getDataset() {
+ this.$axios.get(window.CONFIG.baseUrl + '/train-oneday/query_train_datasets', { params: { page: 1, size: 100 } }).then((res) => {
+ this.datasetIdOptions = res.data.items
})
},
+ async getCaseData(datasetId) {
+ const res = await this.$axios.get(window.CONFIG.baseUrl + '/train-oneday/query_train_cases', { params: { dataset_id: datasetId, model_type: '', case_no: '', page: 1, size: 100 } })
+ this.caseOptions = this.removeDuplicatesByMap(res.data.items)
+ },
+ removeDuplicatesByMap(arr) {
+ const map = new Map()
+ arr.forEach(item => {
+ if (!map.has(item.case_no)) {
+ map.set(item.case_no, item)
+ }
+ })
+ return Array.from(map.values())
+ },
+ caseChange(id) {
+ const arr = this.caseOptions.filter(item => item.case_no === id)
+ if(arr.length) {
+ this.outPath = arr[0].out_path
+ }
+ },
// 文件选择变化
handleChange(file, fileList) {
if (file) {
@@ -155,9 +180,86 @@ export default {
modelTypeChange(data) {
this.queryParams.model_types = data.join(',')
},
- async onDownload() {
- const res = await this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: '' }}) // 理解:path应该是查询成功后返回的路径
- debugger
+ onDownload() {
+ const arr = this.queryParams.model_types.split(',')
+ arr.forEach(item => {
+ const url = this.outPath + '\\' + this.queryParams.case_no + '_' + item + '_ROC.json'
+ const path = url.replace(/\\/g, '/')
+ this.$axios.get(window.CONFIG.baseUrl + '/download', { params: { path: path }})
+ })
+ },
+ chart() {
+ this.myChart = this.$echarts.init(this.$refs.chartDom)
+ const option = {
+ grid: {
+ left: 40,
+ right: 20,
+ bottom: 10,
+ top: 20,
+ containLabel: true,
+ },
+ xAxis: {
+ type: 'category',
+ axisLine: {
+ lineStyle: {
+ color: '#273F4B',
+ width: 1,
+ },
+ },
+ axisTick: {
+ lineStyle: {
+ color: '#152029',
+ width: 1,
+ },
+ },
+ axisLabel: {
+ color: '#a2b4c9',
+ // rotate: 0
+ },
+ splitLine: {
+ lineStyle: {
+ color: '#152029',
+ type: 'dashed',
+ },
+ },
+ },
+ yAxis: {
+ type: 'value',
+ axisLine: {
+ show: true,
+ lineStyle: {
+ color: '#273F4B',
+ },
+ },
+ axisLabel: {
+ color: '#a2b4c9',
+ },
+ splitLine: {
+ lineStyle: {
+ color: '#152029',
+ type: 'dashed',
+ },
+ },
+ // axisTick: {
+ // show: true,
+ // lineStyle: {
+ // color: '#f00'
+ // }
+ // }
+ },
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: {
+ type: 'shadow'
+ }
+ },
+ color: ['#0A4072', '#683F14', '#0F605A', '#0F5A7A', '#5C5F25'],
+ dataset: {
+ source: this.chartData.datasetSource
+ },
+ series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }]
+ }
+ this.myChart.setOption(option)
},
},
}
@@ -165,8 +267,11 @@ export default {
diff --git a/src/views/chart/pages/WindMap.vue b/src/views/chart/pages/WindMap.vue
index bcb9aae..8ca5213 100644
--- a/src/views/chart/pages/WindMap.vue
+++ b/src/views/chart/pages/WindMap.vue
@@ -19,6 +19,7 @@ export default {
pressureData: null,
temperatureData: null,
atmosphericData: null,
+ gridHalfwidthDeg: 6,
}
},
watch: {
@@ -45,7 +46,7 @@ export default {
date: '2024-05-20',
lon_center: 116,
lat_center: 39,
- grid_halfwidth_deg: 1
+ grid_halfwidth_deg: this.gridHalfwidthDeg
}
this.loading = true
const res = await this.$axios.post(window.CONFIG.baseUrl + '/nuclide-sim/calculate_atmospheric_stability', params, {
@@ -61,7 +62,7 @@ export default {
date: '2024-05-20',
lon_center: 116,
lat_center: 39,
- grid_halfwidth_deg: 1
+ grid_halfwidth_deg: this.gridHalfwidthDeg
}
try {
this.loading = true
@@ -90,7 +91,7 @@ export default {
switch (val) {
case 'Wind':
// loadWindfield(this.viewer)
- loadWindfieldWithDataNew(this.viewer, this.windData)
+ loadWindfieldWithDataNew(this.viewer, this.windData, this.gridHalfwidthDeg)
break
case 'AtmosphericStability':
debugger
@@ -103,7 +104,7 @@ export default {
loadHeatmapByData(this.viewer, this.temperatureData)
break
default:
- loadWindfieldWithDataNew(this.viewer, this.windData)
+ loadWindfieldWithDataNew(this.viewer, this.windData, this.gridHalfwidthDeg)
}
},
findLayerByName(layerName) {
@@ -150,7 +151,7 @@ export default {
flyToBeijing() {
// 北京坐标(经度, 纬度, 高度)
- const beijingPosition = Cesium.Cartesian3.fromDegrees(116.3903, 39.9001, 600000)
+ const beijingPosition = Cesium.Cartesian3.fromDegrees(116.3903, 39.9001, 160000)
this.viewer.camera.flyTo({
destination: beijingPosition, // 目标位置
diff --git a/src/views/chart/pages/WindMap/WindField.js b/src/views/chart/pages/WindMap/WindField.js
index cb49dd9..73c4abb 100644
--- a/src/views/chart/pages/WindMap/WindField.js
+++ b/src/views/chart/pages/WindMap/WindField.js
@@ -306,7 +306,7 @@ export const loadWindfieldWithData = (viewer, windData) => {
}
}
-export const loadWindfieldWithDataNew = (viewer, windData) => {
+export const loadWindfieldWithDataNew = (viewer, windData, num) => {
const { windU, windV, windOptions } = getInitWindOptions()
const { lon_min: lo1, lat_max: la2, lon_max: lo2, lat_min: la1 } = windData
@@ -323,8 +323,8 @@ export const loadWindfieldWithDataNew = (viewer, windData) => {
windV.data.push(item[3])
})
- windU.header.nx = windV.header.nx = 13
- windU.header.ny = windV.header.ny = 13
+ windU.header.nx = windV.header.nx = num * 2 + 1
+ windU.header.ny = windV.header.ny = num * 2 + 1
windU.header.dx = windV.header.dx = 1
windU.header.dy = windV.header.dy = 1