修改浙江无线测试用例bug
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
<el-icon :style="{ color: '#0000FF' }">
|
||||
<el-tooltip placement="bottom" :hide-after="0">
|
||||
<template #content>
|
||||
<span>绑定测试项</span>
|
||||
<span>数据绑定</span>
|
||||
</template>
|
||||
<SetUp @click.stop="bind(node, data)" />
|
||||
</el-tooltip>
|
||||
@@ -70,7 +70,7 @@
|
||||
<el-icon :style="{ color: '#0000FF' }">
|
||||
<el-tooltip placement="bottom" :hide-after="0">
|
||||
<template #content>
|
||||
<span>修改测试项</span>
|
||||
<span> {{ data.pid ? '修改测试项' : ' 修改测试方案' }}</span>
|
||||
</template>
|
||||
|
||||
<Edit @click.stop="edit(node, data)" />
|
||||
@@ -104,6 +104,7 @@ import { ElTree } from 'element-plus'
|
||||
import { Plus, Edit, Delete, SetUp } from '@element-plus/icons-vue'
|
||||
import { delRecord } from '@/api/cs-device-boot/planData'
|
||||
import popup from './popup.vue'
|
||||
import { getDeviceList } from '@/api/cs-device-boot/planData'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
defineOptions({
|
||||
name: 'govern/schemeTree'
|
||||
@@ -112,6 +113,7 @@ interface Props {
|
||||
width?: string
|
||||
canExpand?: boolean
|
||||
}
|
||||
|
||||
const visible1 = ref(false)
|
||||
const visible2 = ref(false)
|
||||
const visible3 = ref(false)
|
||||
@@ -269,10 +271,20 @@ const edit = async (node: Node, data: any) => {
|
||||
.catch(e => { })
|
||||
}
|
||||
/** 删除树节点 */
|
||||
const del = (node: Node, data: any) => {
|
||||
const del =async (node: Node, data: any) => {
|
||||
let titleList = ''
|
||||
planId.value = data.id
|
||||
await getDeviceList({
|
||||
id: data.id,
|
||||
isTrueFlag: 1
|
||||
}).then(res => {
|
||||
if (res.data.length > 0) {
|
||||
titleList = '已绑定数据_'
|
||||
}
|
||||
|
||||
})
|
||||
//删除方案/测试项
|
||||
ElMessageBox.confirm('是否确认删除?', {
|
||||
ElMessageBox.confirm(titleList + '是否确认删除?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
|
||||
85
src/views/govern/device/planData/components/transient.vue
Normal file
85
src/views/govern/device/planData/components/transient.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
|
||||
<TableHeader :showReset="false">
|
||||
<!-- <template v-slot:select>
|
||||
<el-form-item label="用户状态">
|
||||
<el-select v-model="tableStore.table.params.searchState" placeholder="选择用户状态">
|
||||
<el-option v-for="(item, index) in userState" :label="item.label" :key="index"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</template>
|
||||
-->
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { ref, provide, onMounted } from 'vue'
|
||||
import { getEventByItem } from '@/api/cs-device-boot/planData'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
const props = defineProps({
|
||||
activeName: String
|
||||
})
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/data/getEventByItem',
|
||||
method: 'POST',
|
||||
paramsPOST: true,
|
||||
showPage: false,
|
||||
column: [
|
||||
{ title: '项目名称', field: 'projectName', minWidth: '130' },
|
||||
{ title: '测试项名称', field: 'itemName', minWidth: '130' },
|
||||
{ title: '装置名称', field: 'devName', minWidth: '130' },
|
||||
{ title: '发生时刻', field: 'startTime', minWidth: '130' },
|
||||
{ title: '持续时间', field: 'persistTime', minWidth: '130' },
|
||||
{ title: '事件描述', field: 'showName', minWidth: '130' },
|
||||
{ title: '暂降幅值', field: 'featureAmplitude', minWidth: '130' },
|
||||
{ title: '相别', field: 'phaseType', minWidth: '130' },
|
||||
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
disabled: row => {
|
||||
return row.state !== 1
|
||||
},
|
||||
click: row => {
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
loadCallback: () => {
|
||||
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
const init = () => {
|
||||
tableStore.table.params.id = props.activeName
|
||||
// getEventByItem({ id: props.activeName }).then(res => {
|
||||
|
||||
// })
|
||||
tableStore.index()
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
})
|
||||
defineExpose({ init })
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -189,9 +189,41 @@ export default {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
//组件搜索
|
||||
filterNode(value, data) {
|
||||
filterNode(value, data, node) {
|
||||
if (!value) return true
|
||||
return data.name.indexOf(value) !== -1
|
||||
// return data.name.includes(value)
|
||||
if (data.name) {
|
||||
|
||||
return this.chooseNode(value, data, node)
|
||||
}
|
||||
},
|
||||
|
||||
// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符.
|
||||
chooseNode(value, data, node) {
|
||||
|
||||
if (data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
const level = node.level
|
||||
// 如果传入的节点本身就是一级节点就不用校验了
|
||||
if (level === 1) {
|
||||
return false
|
||||
}
|
||||
// 先取当前节点的父节点
|
||||
let parentData = node.parent
|
||||
// 遍历当前节点的父节点
|
||||
let index = 0
|
||||
while (index < level - 1) {
|
||||
// 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤
|
||||
if (parentData.data.name.indexOf(value) !== -1) {
|
||||
return true
|
||||
}
|
||||
// 否则的话再往上一层做匹配
|
||||
parentData = parentData.parent
|
||||
index++
|
||||
}
|
||||
// 没匹配到返回false
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user