diff --git a/src/assets/money.png b/src/assets/money.png new file mode 100644 index 00000000..483dcf09 Binary files /dev/null and b/src/assets/money.png differ diff --git a/src/utils/tableStore.ts b/src/utils/tableStore.ts index a12583cc..b88e1cd2 100644 --- a/src/utils/tableStore.ts +++ b/src/utils/tableStore.ts @@ -40,7 +40,7 @@ export default class TableStore { loadCallback: null, resetCallback: null, beforeSearchFun: null, - height: 0, + height: '', publicHeight: 0 }) diff --git a/src/views/hsw/index.vue b/src/views/hsw/index.vue index be5dd5e0..5411e649 100644 --- a/src/views/hsw/index.vue +++ b/src/views/hsw/index.vue @@ -2,19 +2,32 @@
- + diff --git a/src/views/hsw/popupCalculator.vue b/src/views/hsw/popupCalculator.vue index 35827f26..af7470b2 100644 --- a/src/views/hsw/popupCalculator.vue +++ b/src/views/hsw/popupCalculator.vue @@ -1,77 +1,285 @@ + + diff --git a/src/views/hsw/sags3D.vue b/src/views/hsw/sags3D.vue index 1b75ae37..2cff0307 100644 --- a/src/views/hsw/sags3D.vue +++ b/src/views/hsw/sags3D.vue @@ -1,7 +1,16 @@ @@ -11,7 +20,12 @@ import { ref, onMounted, provide, defineOptions } from 'vue' import SecondSheet from '@/components/secondSheet/index.vue' import Table from '@/components/table/index.vue' import TableStore from '@/utils/tableStore' +import MyEchart from '@/components/echarts/MyEchart.vue' +import { log } from 'console' +const radio = ref('三维图') +const options = ref() +const apiData = ref() const tableStore = new TableStore({ showPage: false, // 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度) @@ -21,34 +35,262 @@ const tableStore = new TableStore({ { title: '电压暂降频次统计表', children: [ - { title: '暂降福度', field: 'loginName', width: '130' }, + { title: '暂降福度', field: 'amplitude', width: '130' }, { title: '持续时间', field: 'loginName', - children: [ - { title: '0.01-0.02', field: 'loginName' }, - { title: '0.02-0.05', field: 'loginName' }, - { title: '0.05-0.07', field: 'loginName' }, - { title: '0.07-0.10', field: 'loginName' }, - { title: '0.10-1.00', field: 'loginName' }, - ] + children: [] } ] } - ] + ], + loadCallback: () => { + tableStore.table.data = { + lineIds: [1, 5], + type: 1, + beginDate: '2019-01-01', + endDate: '2024-12-31', + amplitudes: ['0.8~0.9', '0.7~0.8', '0.6~0.7', '0.5~0.6', '0.4~0.5', '0.1~0.4'], + durations: ['0.01~0.02', '0.02~0.05', '0.05~0.07', '0.07~0.10', '0.10~1.00'], + values: [ + ['0.8~0.9', '0.01~0.02', '0'], + ['0.8~0.9', '0.02~0.05', '0'], + ['0.8~0.9', '0.05~0.07', '0'], + ['0.8~0.9', '0.07~0.10', '0'], + ['0.8~0.9', '0.10~1.00', '6'], + ['0.7~0.8', '0.01~0.02', '0'], + ['0.7~0.8', '0.02~0.05', '0'], + ['0.7~0.8', '0.05~0.07', '0'], + ['0.7~0.8', '0.07~0.10', '0'], + ['0.7~0.8', '0.10~1.00', '1'], + ['0.6~0.7', '0.01~0.02', '0'], + ['0.6~0.7', '0.02~0.05', '0'], + ['0.6~0.7', '0.05~0.07', '0'], + ['0.6~0.7', '0.07~0.10', '0'], + ['0.6~0.7', '0.10~1.00', '2'], + ['0.5~0.6', '0.01~0.02', '0'], + ['0.5~0.6', '0.02~0.05', '0'], + ['0.5~0.6', '0.05~0.07', '0'], + ['0.5~0.6', '0.07~0.10', '0'], + ['0.5~0.6', '0.10~1.00', '5'], + ['0.4~0.5', '0.01~0.02', '0'], + ['0.4~0.5', '0.02~0.05', '0'], + ['0.4~0.5', '0.05~0.07', '0'], + ['0.4~0.5', '0.07~0.10', '0'], + ['0.4~0.5', '0.10~1.00', '1'], + ['0.1~0.4', '0.01~0.02', '0'], + ['0.1~0.4', '0.02~0.05', '0'], + ['0.1~0.4', '0.05~0.07', '0'], + ['0.1~0.4', '0.07~0.10', '0'], + ['0.1~0.4', '0.10~1.00', '3'] + ], + table: { + total: 6, + rows: [ + { + searchValue: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remark: null, + params: {}, + amplitude: '0.8~0.9', + d005_007s: '0', + d001_002s: '0', + d002_005s: '0', + d010_100s: '6', + d007_010s: '0' + }, + { + searchValue: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remark: null, + params: {}, + amplitude: '0.7~0.8', + d005_007s: '0', + d001_002s: '0', + d002_005s: '0', + d010_100s: '1', + d007_010s: '0' + }, + { + searchValue: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remark: null, + params: {}, + amplitude: '0.6~0.7', + d005_007s: '0', + d001_002s: '0', + d002_005s: '0', + d010_100s: '2', + d007_010s: '0' + }, + { + searchValue: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remark: null, + params: {}, + amplitude: '0.5~0.6', + d005_007s: '0', + d001_002s: '0', + d002_005s: '0', + d010_100s: '5', + d007_010s: '0' + }, + { + searchValue: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remark: null, + params: {}, + amplitude: '0.4~0.5', + d005_007s: '0', + d001_002s: '0', + d002_005s: '0', + d010_100s: '1', + d007_010s: '0' + }, + { + searchValue: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remark: null, + params: {}, + amplitude: '0.1~0.4', + d005_007s: '0', + d001_002s: '0', + d002_005s: '0', + d010_100s: '3', + d007_010s: '0' + } + ], + code: 200, + msg: '查询成功' + } + } + apiData.value = tableStore.table.data + tableStore.table.column![0].children![1].children!.push( + ...(apiData.value.durations.map((item: string) => { + return { + title: item, + field: `d${item.replaceAll('.', '').replaceAll('~', '_')}s` + } + }) as any[]) + ) + tableStore.table.data = apiData.value.table.rows + initEchart() + } }) // 注入到子组件 provide('tableStore', tableStore) -// 默认参数 参数多的话可以使用Object.assign方法 -tableStore.table.params.pageSize = 9999 -tableStore.table.params.searchState = 1 -tableStore.table.params.searchValue = '' -tableStore.table.params.casualUser = -1 -tableStore.table.params.orderBy = '' - onMounted(() => { - // 加载数据 - tableStore.index() + search() }) +const initEchart = () => { + options.value = { + options: { + xAxis: null, + yAxis: null, + dataZoom: null, + backgroundColor: '#fff', + tooltip: { + trigger: 'axis' + }, + title: { + text: '暂降密度图', + x: 'center' + }, + xAxis3D: { + name: '暂降福度(p.u.)', + type: 'category', + data: apiData.value.amplitudes + }, + yAxis3D: { + name: '持续时间(s)', + type: 'category', + data: apiData.value.durations + }, + zAxis3D: { + name: '次数', + type: 'value' + }, + grid3D: { + boxWidth: 200, + boxDepth: 80, + viewControl: { + projection: 'perspective', + distance: 250 + }, + light: { + main: { + intensity: 1.2, + shadow: true + }, + ambient: { + intensity: 0.3 + } + } + }, + series: [ + { + type: 'bar3D', + data: apiData.value.values.map((item: [string, string, string]) => { + return [ + apiData.value.amplitudes.indexOf(item[0]), + apiData.value.durations.indexOf(item[1]), + item[2] + ] + }), + shading: 'lambert', + label: { + fontSize: 16, + borderWidth: 1 + }, + emphasis: { + label: { + fontSize: 20, + color: '#900' + }, + itemStyle: { + color: '#900' + } + } + } + ] + } + } +} +const search = () => { + // 从父组件tableStore获取参数 + tableStore.table.params.pageSize = 9999 + tableStore.table.params.searchState = 1 + tableStore.table.params.searchValue = '' + tableStore.table.params.casualUser = -1 + tableStore.table.params.orderBy = '' + tableStore.index() +} +defineExpose({ search }) + diff --git a/src/views/hsw/toleranceCurve.vue b/src/views/hsw/toleranceCurve.vue index 2c4911c0..d95ab5b9 100644 --- a/src/views/hsw/toleranceCurve.vue +++ b/src/views/hsw/toleranceCurve.vue @@ -1,7 +1,159 @@ - + + diff --git a/vite.config.ts b/vite.config.ts index 31c6a139..e79695ab 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,7 +11,7 @@ export default defineConfig({ host: '0.0.0.0', proxy: { '/api': { - target: 'http://192.168.1.31:10215', //数据中心 + target: 'http://192.168.1.81:10215', //数据中心 // target: 'http://192.168.1.81:10215', //数据中心 changeOrigin: true, rewrite: path => path.replace(/^\/api/, '') //路径重写,把'/api'替换为''