修改测试bug
This commit is contained in:
@@ -345,8 +345,9 @@ const unBindList = ref([])
|
||||
const bindList = ref([])
|
||||
//0 新增方案 1 修改方案 2 新增测试项 3 修改测试项 4 设备信息
|
||||
const open = async (val: any, id: any, name?: any) => {
|
||||
console.log("🚀 ~ open ~ val:", val)
|
||||
popupType.value = val
|
||||
title.value = val == 0 ? '新增方案' : val == 1 ? '修改方案' : val == 2 ? '新增测试项' : ('修改测试项' + '_' + name)
|
||||
title.value = val == 0 ? '新增方案' : val == 1 ? '修改方案' : val == 2 ? '新增测试项' : val == 3 ? '修改测试项' : ('绑定测试项' + '_' + name)
|
||||
dialogVisible.value = true
|
||||
planId.value = id
|
||||
//新增方案或者测试项数据
|
||||
@@ -477,7 +478,7 @@ const submit = () => {
|
||||
})
|
||||
}
|
||||
//修改测试项
|
||||
if (popupType.value == 3) {
|
||||
if (popupType.value == 3 || popupType.value == 4) {
|
||||
let subForm = JSON.parse(JSON.stringify(form1.value))
|
||||
subForm.list = checkedIdList.value
|
||||
updateRecord(subForm).then((res: any) => {
|
||||
|
||||
@@ -12,8 +12,16 @@
|
||||
<Icon name="el-icon-Search" style="font-size: 16px" />
|
||||
</template>
|
||||
</el-input>
|
||||
<Icon name="el-icon-Plus" size="18"
|
||||
class="fold ml10 menu-collapse" style="cursor: pointer" @click="onAdd"/>
|
||||
<el-tooltip placement="bottom" :hide-after="0">
|
||||
<template #content>
|
||||
<span>新增方案</span>
|
||||
</template>
|
||||
|
||||
<Icon name="el-icon-Plus" size="18" class="fold ml10 menu-collapse" style="cursor: pointer"
|
||||
@click="onAdd" />
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
<Icon @click="onMenuCollapse" :name="menuCollapse ? 'el-icon-Expand' : 'el-icon-Fold'"
|
||||
:class="menuCollapse ? 'unfold' : ''" size="18" class="fold ml10 menu-collapse"
|
||||
style="cursor: pointer" />
|
||||
@@ -29,24 +37,52 @@
|
||||
<span>{{ node.label }}</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
|
||||
|
||||
|
||||
|
||||
<a :style="{ marginRight: '0.5rem' }" v-if="data?.children">
|
||||
<el-icon :style="{ color: '#0000FF' }">
|
||||
<Plus @click.stop="add(node, data)" />
|
||||
|
||||
<el-tooltip placement="bottom" :hide-after="0">
|
||||
<template #content>
|
||||
<span>新增测试项</span>
|
||||
</template>
|
||||
<Plus @click.stop="add(node, data)" />
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
|
||||
</el-icon>
|
||||
</a>
|
||||
<a :style="{ marginRight: '0.5rem' }" v-else>
|
||||
<el-icon :style="{ color: '#0000FF' }">
|
||||
<SetUp @click.stop="bind(node, data)" />
|
||||
</el-icon>
|
||||
</a>
|
||||
<a :style="{ marginRight: '0.5rem' }">
|
||||
<el-icon :style="{ color: '#DA3434' }">
|
||||
<Delete @click.stop="del(node, data)" />
|
||||
<el-tooltip placement="bottom" :hide-after="0">
|
||||
<template #content>
|
||||
<span>绑定测试项</span>
|
||||
</template>
|
||||
<SetUp @click.stop="bind(node, data)" />
|
||||
</el-tooltip>
|
||||
|
||||
</el-icon>
|
||||
</a>
|
||||
<a :style="{ marginRight: '0.5rem' }">
|
||||
<el-icon :style="{ color: '#0000FF' }">
|
||||
<Edit @click.stop="edit(node, data)" />
|
||||
<el-tooltip placement="bottom" :hide-after="0">
|
||||
<template #content>
|
||||
<span>修改测试项</span>
|
||||
</template>
|
||||
|
||||
<Edit @click.stop="edit(node, data)" />
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
</el-icon>
|
||||
|
||||
</a>
|
||||
<a :style="{ marginRight: '0.5rem' }">
|
||||
<el-icon :style="{ color: '#DA3434' }">
|
||||
<Delete @click.stop="del(node, data)" />
|
||||
</el-icon>
|
||||
</a>
|
||||
</div>
|
||||
@@ -65,7 +101,7 @@ import { getSchemeTree, getTestRecordInfo } from '@/api/cs-device-boot/planData'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||
import { ElTree } from 'element-plus'
|
||||
import { Plus, Edit, Delete ,SetUp} from '@element-plus/icons-vue'
|
||||
import { Plus, Edit, Delete, SetUp } from '@element-plus/icons-vue'
|
||||
import { delRecord } from '@/api/cs-device-boot/planData'
|
||||
import popup from './popup.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
@@ -76,7 +112,10 @@ interface Props {
|
||||
width?: string
|
||||
canExpand?: boolean
|
||||
}
|
||||
|
||||
const visible1 = ref(false)
|
||||
const visible2 = ref(false)
|
||||
const visible3 = ref(false)
|
||||
const visible4 = ref(false)
|
||||
const { proxy } = useCurrentInstance()
|
||||
const menuCollapse = ref(false)
|
||||
const filterText = ref('')
|
||||
@@ -126,9 +165,9 @@ const onAdd = () => {
|
||||
}
|
||||
// 绑定数据
|
||||
const bind = (node: any, data: any) => {
|
||||
console.log("🚀 ~ bind ~ data:", data)
|
||||
emit('bind',data)
|
||||
|
||||
|
||||
emit('bind', data)
|
||||
|
||||
}
|
||||
/** 树形结构数据 */
|
||||
const defaultProps = {
|
||||
@@ -147,7 +186,7 @@ const props = withDefaults(
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart','onAdd','bind'])
|
||||
const emit = defineEmits(['init', 'checkChange', 'nodeChange', 'editNode', 'getChart', 'onAdd', 'bind'])
|
||||
const config = useConfig()
|
||||
const tree = ref()
|
||||
const treRef = ref()
|
||||
|
||||
@@ -100,8 +100,9 @@
|
||||
</el-collapse>
|
||||
|
||||
<div v-if="JSON.stringify(echartsData) != '{}' && deviceData?.records?.length != 0">
|
||||
<h3 class="mt10 mb10">历史趋势</h3>
|
||||
<div class="history_trend">
|
||||
<!-- <h3 class="mt10 mb10">历史趋势</h3> -->
|
||||
<el-tabs type="border-card" class="mt10">
|
||||
<el-tab-pane label="历史趋势"> <div class="history_trend" v-if="titleList != '(未绑定数据)'">
|
||||
<div class="history_header" ref="headerRef">
|
||||
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
|
||||
<TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange">
|
||||
@@ -154,6 +155,11 @@
|
||||
<MyEchart ref="historyChart" v-if="echartsData" :isExport="true" :options="echartsData" />
|
||||
</div>
|
||||
</div>
|
||||
<el-empty :style="EcharHeight" v-else description="未绑定数据" /></el-tab-pane>
|
||||
<el-tab-pane label="暂态数据">Config</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<el-empty v-else description="请选择设备" class="device-manage-right" />
|
||||
@@ -191,7 +197,7 @@ const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand')
|
||||
const volConTypeList = dictData.getBasicData('Dev_Connect')
|
||||
//值类型
|
||||
const pageHeight = mainHeight(20)
|
||||
const EcharHeight = ref(mainHeight(448))
|
||||
const EcharHeight = ref(mainHeight(483))
|
||||
const loading = ref(false)
|
||||
const searchForm: any = ref({})
|
||||
const typeOptions = [
|
||||
@@ -314,7 +320,7 @@ const onAdd = () => {
|
||||
handleOpen(0)
|
||||
}
|
||||
const bind = (data: any) => {
|
||||
handleOpen(3, data)
|
||||
handleOpen(4, data)
|
||||
}
|
||||
const handleOpen = (val: any, data?: any) => {
|
||||
if (!deviceData.value) {
|
||||
@@ -333,6 +339,10 @@ const handleOpen = (val: any, data?: any) => {
|
||||
let name: any = ''
|
||||
//数据绑定
|
||||
if (val == 3) {
|
||||
ids = data?.id
|
||||
// name = data?.name
|
||||
dialogRef.value.detailsType('table')
|
||||
} else if (val == 4) {
|
||||
ids = data?.id
|
||||
name = data?.name
|
||||
dialogRef.value.detailsType('table')
|
||||
@@ -477,15 +487,15 @@ const init = (flag: boolean) => {
|
||||
|
||||
echartsData.value = {
|
||||
|
||||
title: {
|
||||
text: chartTitle.value,
|
||||
left: '0',
|
||||
// title: {
|
||||
// text: chartTitle.value,
|
||||
// left: '0',
|
||||
|
||||
textStyle: {
|
||||
color: '#000',
|
||||
fontSize: '16'
|
||||
},
|
||||
},
|
||||
// textStyle: {
|
||||
// color: '#000',
|
||||
// fontSize: '16'
|
||||
// },
|
||||
// },
|
||||
toolbox: {
|
||||
featureProps: {
|
||||
myTool1: {
|
||||
@@ -505,8 +515,8 @@ const init = (flag: boolean) => {
|
||||
itemStyle: { opacity: 0 },//去圆点
|
||||
type: 'scroll', // 开启滚动分页
|
||||
right: 70,
|
||||
width: 550,
|
||||
|
||||
// width: 550,
|
||||
|
||||
// height: 50
|
||||
},
|
||||
grid: {
|
||||
@@ -846,15 +856,15 @@ const selectChange = (e: boolean) => {
|
||||
|
||||
if (activeColName.value == '0') {
|
||||
if (flag.value) {
|
||||
EcharHeight.value = mainHeight(492)
|
||||
EcharHeight.value = mainHeight(527)
|
||||
} else {
|
||||
EcharHeight.value = mainHeight(448)
|
||||
EcharHeight.value = mainHeight(483)
|
||||
}
|
||||
} else {
|
||||
if (flag.value) {
|
||||
EcharHeight.value = mainHeight(322)
|
||||
EcharHeight.value = mainHeight(357)
|
||||
} else {
|
||||
EcharHeight.value = mainHeight(280)
|
||||
EcharHeight.value = mainHeight(315)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -862,15 +872,15 @@ const selectChange = (e: boolean) => {
|
||||
const handleChange = () => {
|
||||
if (activeColName.value == '0') {
|
||||
if (flag.value) {
|
||||
EcharHeight.value = mainHeight(492)
|
||||
EcharHeight.value = mainHeight(527)
|
||||
} else {
|
||||
EcharHeight.value = mainHeight(448)
|
||||
EcharHeight.value = mainHeight(483)
|
||||
}
|
||||
} else {
|
||||
if (flag.value) {
|
||||
EcharHeight.value = mainHeight(322)
|
||||
EcharHeight.value = mainHeight(357)
|
||||
} else {
|
||||
EcharHeight.value = mainHeight(280)
|
||||
EcharHeight.value = mainHeight(315)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user