bug调整
This commit is contained in:
@@ -47,8 +47,6 @@ export const getFirstRoute = (routes: RouteRecordRaw[], menuType = 'tab'): false
|
|||||||
})
|
})
|
||||||
let find: boolean | RouteRecordRaw = false
|
let find: boolean | RouteRecordRaw = false
|
||||||
for (const key in routes) {
|
for (const key in routes) {
|
||||||
console.log(`11111111`,routes[key].path);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
routes[key].meta?.type == 'menu' &&
|
routes[key].meta?.type == 'menu' &&
|
||||||
routes[key].meta?.menu_type == menuType &&
|
routes[key].meta?.menu_type == menuType &&
|
||||||
|
|||||||
@@ -185,9 +185,17 @@ const changeProductLine = () => {
|
|||||||
/**
|
/**
|
||||||
* 选择待上传文件
|
* 选择待上传文件
|
||||||
*/
|
*/
|
||||||
const choose = (e: any) => {
|
const choose = (e: any, fileList: UploadUserFile[]) => {
|
||||||
form.file = e.raw
|
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 => {
|
const handleExceed: UploadProps['onExceed'] = files => {
|
||||||
uploadEventData.value!.clearFiles()
|
uploadEventData.value!.clearFiles()
|
||||||
const file = files[0] as UploadRawFile
|
const file = files[0] as UploadRawFile
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
<event-upload-popup ref='eventUploadPopup' />
|
<event-upload-popup ref='eventUploadPopup' />
|
||||||
|
|
||||||
<el-radio-group v-model='radio' id='tabTitle' @change='switchRadio'>
|
<el-radio-group v-model='radio' id='tabTitle' @change='switchRadio'>
|
||||||
<el-radio-button label='暂降数据' />
|
<el-radio-button value='暂降数据' >暂降数据</el-radio-button>
|
||||||
<el-radio-button label='电压暂降事件统计' />
|
<el-radio-button value='电压暂降事件统计' >电压暂降事件统计</el-radio-button>
|
||||||
<el-radio-button label='耐受曲线信息' />
|
<el-radio-button value='耐受曲线信息' >耐受曲线信息</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div class='tableExtraButton'>
|
<div class='tableExtraButton'>
|
||||||
<el-button :icon='Upload' type='primary' @click='importEventData'>导入</el-button>
|
<el-button :icon='Upload' type='primary' @click='importEventData'>导入</el-button>
|
||||||
@@ -172,7 +172,7 @@ const tableStore = new TableStore({
|
|||||||
// 注入到子组件
|
// 注入到子组件
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tableHeader.value.setTheDate(1)
|
// tableHeader.value.setTheDate(1)
|
||||||
})
|
})
|
||||||
//初始化页面
|
//初始化页面
|
||||||
const initData = async () => {
|
const initData = async () => {
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<SecondSheet>
|
<SecondSheet>
|
||||||
<div style="height: 100%; overflow: hidden">
|
<div style='height: 100%; overflow: hidden'>
|
||||||
<div class="switch-tab">
|
<div class='switch-tab'>
|
||||||
<el-radio-group v-model="radio" size="small">
|
<el-radio-group v-model='radio' size='small'>
|
||||||
<el-radio-button label="三维图" />
|
<el-radio-button value='三维图'>三维图</el-radio-button>
|
||||||
<el-radio-button label="表格" />
|
<el-radio-button value='表格'>表格</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<Table ref="tableRef" height="auto" isGroup />
|
<Table ref='tableRef' height='auto' isGroup />
|
||||||
<SecondSheet v-if="radio === '三维图'">
|
<SecondSheet v-if="radio === '三维图'">
|
||||||
<MyEchart :options="options" v-if="options"></MyEchart>
|
<MyEchart :options='options' v-if='options'></MyEchart>
|
||||||
</SecondSheet>
|
</SecondSheet>
|
||||||
</div>
|
</div>
|
||||||
</SecondSheet>
|
</SecondSheet>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang='ts' setup>
|
||||||
import { ref, provide } from 'vue'
|
import { ref, provide } from 'vue'
|
||||||
import SecondSheet from '@/components/secondSheet/index.vue'
|
import SecondSheet from '@/components/secondSheet/index.vue'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
@@ -25,7 +25,7 @@ import MyEchart from '@/components/echarts/MyEchart.vue'
|
|||||||
const radio = ref('三维图')
|
const radio = ref('三维图')
|
||||||
const options = ref()
|
const options = ref()
|
||||||
const apiData = ref()
|
const apiData = ref()
|
||||||
const tableStore = new TableStore({
|
const tableStore3D = new TableStore({
|
||||||
showPage: false,
|
showPage: false,
|
||||||
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
// 若页面表格高度需要调整,请修改publicHeight(内容区域除表格外其他内容的高度)
|
||||||
url: '/advance-boot/sgEvent/3DList',
|
url: '/advance-boot/sgEvent/3DList',
|
||||||
@@ -44,8 +44,8 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
loadCallback: () => {
|
loadCallback: () => {
|
||||||
const eventCount = tableStore.table.data.values
|
const eventCount = tableStore3D.table.data.values
|
||||||
tableStore.table.data = {
|
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'],
|
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'],
|
durations: ['0.01~0.02', '0.02~0.05', '0.05~0.07', '0.07~0.10', '0.10~1.00'],
|
||||||
values: [
|
values: [
|
||||||
@@ -136,9 +136,9 @@ const tableStore = new TableStore({
|
|||||||
msg: '查询成功'
|
msg: '查询成功'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
apiData.value = tableStore.table.data
|
apiData.value = tableStore3D.table.data
|
||||||
tableStore.table.column![0].children![1].children = []
|
tableStore3D.table.column![0].children![1].children = []
|
||||||
tableStore.table.column![0].children![1].children!.push(
|
tableStore3D.table.column![0].children![1].children!.push(
|
||||||
...(apiData.value.durations.map((item: string) => {
|
...(apiData.value.durations.map((item: string) => {
|
||||||
return {
|
return {
|
||||||
title: item,
|
title: item,
|
||||||
@@ -146,12 +146,12 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
}) as any[])
|
}) as any[])
|
||||||
)
|
)
|
||||||
tableStore.table.data = apiData.value.table.rows
|
tableStore3D.table.data = apiData.value.table.rows
|
||||||
initEchart()
|
initEchart()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 注入到子组件
|
// 注入到子组件
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore3D', tableStore3D)
|
||||||
|
|
||||||
const initEchart = () => {
|
const initEchart = () => {
|
||||||
options.value = {
|
options.value = {
|
||||||
@@ -176,7 +176,7 @@ const initEchart = () => {
|
|||||||
},
|
},
|
||||||
backgroundColor: 'rgba(0,0,0,0.35)',
|
backgroundColor: 'rgba(0,0,0,0.35)',
|
||||||
borderWidth: 0,
|
borderWidth: 0,
|
||||||
formatter: function (params: any) {
|
formatter: function(params: any) {
|
||||||
let tips = ''
|
let tips = ''
|
||||||
tips += '<font>暂降幅值(p.u.):' + apiData.value.amplitudes[params.value[0]] + '</font><br/>'
|
tips += '<font>暂降幅值(p.u.):' + apiData.value.amplitudes[params.value[0]] + '</font><br/>'
|
||||||
tips += '<font>持续时间(s):' + apiData.value.durations[params.value[1]] + '</font><br/>'
|
tips += '<font>持续时间(s):' + apiData.value.durations[params.value[1]] + '</font><br/>'
|
||||||
@@ -248,16 +248,16 @@ const initEchart = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const search = (id:string,beginTime:string,endTime:string) => {
|
const search = (id: string, beginTime: string, endTime: string) => {
|
||||||
// 从父组件tableStore获取参数
|
// 从父组件tableStore3D获取参数
|
||||||
tableStore.table.params.searchBeginTime = beginTime
|
tableStore3D.table.params.searchBeginTime = beginTime
|
||||||
tableStore.table.params.searchEndTime = endTime
|
tableStore3D.table.params.searchEndTime = endTime
|
||||||
tableStore.table.params.userId = id
|
tableStore3D.table.params.userId = id
|
||||||
tableStore.index()
|
tableStore3D.index()
|
||||||
}
|
}
|
||||||
defineExpose({ search })
|
defineExpose({ search })
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang='scss'>
|
||||||
.switch-tab {
|
.switch-tab {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 16px;
|
right: 16px;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--生产线管理界面-->
|
<!--生产线管理界面-->
|
||||||
<template>
|
<template>
|
||||||
<div class='default-main'>
|
<div class='default-main'>
|
||||||
<TableHeader>
|
<TableHeader :showReset="false">
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button type='primary' @click='refresh' class='ml10' :icon='Refresh'>刷新</el-button>
|
<el-button type='primary' @click='refresh' class='ml10' :icon='Refresh'>刷新</el-button>
|
||||||
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增</el-button>
|
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增</el-button>
|
||||||
|
|||||||
Reference in New Issue
Block a user