bug调整

This commit is contained in:
2024-12-02 15:31:06 +08:00
parent 4347f4b15b
commit d61559d5bb
5 changed files with 39 additions and 33 deletions

View File

@@ -47,8 +47,6 @@ export const getFirstRoute = (routes: RouteRecordRaw[], menuType = 'tab'): false
})
let find: boolean | RouteRecordRaw = false
for (const key in routes) {
console.log(`11111111`,routes[key].path);
if (
routes[key].meta?.type == 'menu' &&
routes[key].meta?.menu_type == menuType &&

View File

@@ -185,9 +185,17 @@ const changeProductLine = () => {
/**
* 选择待上传文件
*/
const choose = (e: any) => {
form.file = e.raw
const choose = (e: any, fileList: UploadUserFile[]) => {
const file = e.raw
if (file.type === 'text/csv' || file.name.endsWith('.csv')) {
form.file = file
} else {
ElMessage.error('请选择CSV文件')
fileList.pop() // 移除无效文件
form.file = null
}
}
const handleExceed: UploadProps['onExceed'] = files => {
uploadEventData.value!.clearFiles()
const file = files[0] as UploadRawFile

View File

@@ -19,9 +19,9 @@
<event-upload-popup ref='eventUploadPopup' />
<el-radio-group v-model='radio' id='tabTitle' @change='switchRadio'>
<el-radio-button label='暂降数据' />
<el-radio-button label='电压暂降事件统计' />
<el-radio-button label='耐受曲线信息' />
<el-radio-button value='暂降数据' >暂降数据</el-radio-button>
<el-radio-button value='电压暂降事件统计' >电压暂降事件统计</el-radio-button>
<el-radio-button value='耐受曲线信息' >耐受曲线信息</el-radio-button>
</el-radio-group>
<div class='tableExtraButton'>
<el-button :icon='Upload' type='primary' @click='importEventData'>导入</el-button>
@@ -172,7 +172,7 @@ const tableStore = new TableStore({
// 注入到子组件
provide('tableStore', tableStore)
onMounted(() => {
tableHeader.value.setTheDate(1)
// tableHeader.value.setTheDate(1)
})
//初始化页面
const initData = async () => {

View File

@@ -1,21 +1,21 @@
<template>
<SecondSheet>
<div style="height: 100%; overflow: hidden">
<div class="switch-tab">
<el-radio-group v-model="radio" size="small">
<el-radio-button label="三维图" />
<el-radio-button label="表格" />
<div style='height: 100%; overflow: hidden'>
<div class='switch-tab'>
<el-radio-group v-model='radio' size='small'>
<el-radio-button value='三维图'>三维图</el-radio-button>
<el-radio-button value='表格'>表格</el-radio-button>
</el-radio-group>
</div>
<Table ref="tableRef" height="auto" isGroup />
<Table ref='tableRef' height='auto' isGroup />
<SecondSheet v-if="radio === '三维图'">
<MyEchart :options="options" v-if="options"></MyEchart>
<MyEchart :options='options' v-if='options'></MyEchart>
</SecondSheet>
</div>
</SecondSheet>
</template>
<script lang="ts" setup>
<script lang='ts' setup>
import { ref, provide } from 'vue'
import SecondSheet from '@/components/secondSheet/index.vue'
import Table from '@/components/table/index.vue'
@@ -25,7 +25,7 @@ import MyEchart from '@/components/echarts/MyEchart.vue'
const radio = ref('三维图')
const options = ref()
const apiData = ref()
const tableStore = new TableStore({
const tableStore3D = new TableStore({
showPage: false,
// 若页面表格高度需要调整请修改publicHeight(内容区域除表格外其他内容的高度)
url: '/advance-boot/sgEvent/3DList',
@@ -44,8 +44,8 @@ const tableStore = new TableStore({
}
],
loadCallback: () => {
const eventCount = tableStore.table.data.values
tableStore.table.data = {
const eventCount = tableStore3D.table.data.values
tableStore3D.table.data = {
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: [
@@ -136,9 +136,9 @@ const tableStore = new TableStore({
msg: '查询成功'
}
}
apiData.value = tableStore.table.data
tableStore.table.column![0].children![1].children = []
tableStore.table.column![0].children![1].children!.push(
apiData.value = tableStore3D.table.data
tableStore3D.table.column![0].children![1].children = []
tableStore3D.table.column![0].children![1].children!.push(
...(apiData.value.durations.map((item: string) => {
return {
title: item,
@@ -146,12 +146,12 @@ const tableStore = new TableStore({
}
}) as any[])
)
tableStore.table.data = apiData.value.table.rows
tableStore3D.table.data = apiData.value.table.rows
initEchart()
}
})
// 注入到子组件
provide('tableStore', tableStore)
provide('tableStore3D', tableStore3D)
const initEchart = () => {
options.value = {
@@ -249,15 +249,15 @@ const initEchart = () => {
}
}
const search = (id: string, beginTime: string, endTime: string) => {
// 从父组件tableStore获取参数
tableStore.table.params.searchBeginTime = beginTime
tableStore.table.params.searchEndTime = endTime
tableStore.table.params.userId = id
tableStore.index()
// 从父组件tableStore3D获取参数
tableStore3D.table.params.searchBeginTime = beginTime
tableStore3D.table.params.searchEndTime = endTime
tableStore3D.table.params.userId = id
tableStore3D.index()
}
defineExpose({ search })
</script>
<style lang="scss">
<style lang='scss'>
.switch-tab {
position: absolute;
right: 16px;

View File

@@ -1,7 +1,7 @@
<!--生产线管理界面-->
<template>
<div class='default-main'>
<TableHeader>
<TableHeader :showReset="false">
<template v-slot:operation>
<el-button type='primary' @click='refresh' class='ml10' :icon='Refresh'>刷新</el-button>
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增</el-button>