修改敏感元器件

This commit is contained in:
GGJ
2024-12-06 16:30:16 +08:00
parent 366f561aa5
commit 7255c3ea90

View File

@@ -4,32 +4,18 @@
<el-form label-width='auto' :inline='true'> <el-form label-width='auto' :inline='true'>
<el-form-item label='生产线'> <el-form-item label='生产线'>
<el-select v-model='form.productLineId'> <el-select v-model='form.productLineId'>
<el-option <el-option v-for='item in productLineOptions' :key='item.id' :label='item.name'
v-for='item in productLineOptions' :value='item.id' />
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='终端'> <el-form-item label='终端'>
<el-select v-model='form.machineId' placeholder='暂无终端'> <el-select v-model='form.machineId' placeholder='暂无终端'>
<el-option <el-option v-for='item in machineOptions' :key='item.id' :label='item.name' :value='item.id' />
v-for='item in machineOptions'
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='敏感元器件'> <el-form-item label='敏感元器件'>
<el-select v-model='form.unitId' placeholder='暂无元器件'> <el-select v-model='form.unitId' placeholder='暂无元器件' @change="changeUnit" clearable>
<el-option <el-option v-for='item in unitOptions' :key='item.id' :label='item.name' :value='item.id' />
v-for='item in unitOptions'
:key='item.id'
:label='item.name'
:value='item.id'
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -153,8 +139,9 @@ const search = async (id: string, beginTime: string, endTime: string) => {
unitOptions.value = res.data unitOptions.value = res.data
if (unitOptions.value.length > 0) { if (unitOptions.value.length > 0) {
form.unitId = unitOptions.value[0].id form.unitId = unitOptions.value[0].id
unit.value = unitOptions.value[0] unit.value = JSON.parse(JSON.stringify(unitOptions.value[0]))
} }
}) })
const data = { const data = {
@@ -168,6 +155,13 @@ const search = async (id: string, beginTime: string, endTime: string) => {
reDrawPic() reDrawPic()
}) })
}
const changeUnit = (id: any) => {
if (id == undefined) return
let list = unitOptions.value.filter((item: any) => item.id == id)
unit.value = JSON.parse(JSON.stringify(list[0]))
reDrawPic()
} }
const options = ref() const options = ref()
@@ -178,7 +172,7 @@ const initOptions = () => {
left: '10px' left: '10px'
}, },
tooltip: { tooltip: {
formatter: function(a: any) { formatter: function (a: any) {
if (a[0].value[3] == undefined) { if (a[0].value[3] == undefined) {
return return
} }
@@ -209,7 +203,7 @@ const initOptions = () => {
series: [ series: [
{ {
type: 'line', type: 'line',
color:'#ff0000', color: '#ff0000',
data: [ data: [
[unit.value.vtcTimeUpper / 1000, 0], [unit.value.vtcTimeUpper / 1000, 0],
[unit.value.vtcTimeUpper / 1000, unit.value.vtcAmpUpper], [unit.value.vtcTimeUpper / 1000, unit.value.vtcAmpUpper],
@@ -222,7 +216,7 @@ const initOptions = () => {
}, },
{ {
type: 'line', type: 'line',
color:'#ff0000', color: '#ff0000',
data: [ data: [
[unit.value.vtcTimeLower / 1000, 0], [unit.value.vtcTimeLower / 1000, 0],
[unit.value.vtcTimeLower / 1000, unit.value.vtcAmpLower], [unit.value.vtcTimeLower / 1000, unit.value.vtcAmpLower],
@@ -261,9 +255,9 @@ const initOptions = () => {
const reDrawPic = () => { const reDrawPic = () => {
//清洗要显示的数据 //清洗要显示的数据
if (eventData.value.length > 0) { if (eventData.value.length > 0) {
unOverEvent.value=[] unOverEvent.value = []
overEvent.value=[] overEvent.value = []
unKnownEvent.value=[] unKnownEvent.value = []
for (let event of eventData.value) { for (let event of eventData.value) {
//判断落在哪个区域内 //判断落在哪个区域内
let eventTime = Number(event.duration) / 1000 let eventTime = Number(event.duration) / 1000