误差体系禁用

This commit is contained in:
sjl
2024-12-24 20:22:36 +08:00
parent f17f5c9925
commit f0edeaee85
8 changed files with 368 additions and 62 deletions

View File

@@ -0,0 +1,181 @@
<template>
<div class="data-check-content">
<div class="content-tree" >
<el-tree
:default-expanded-keys="['0', '0-1', '0-2', '0-3', '1']"
node-key="id"
:data="data"
:props="defaultProps"
@node-click="handleNodeClick" />
</div>
<div class="content-right-Tabs" style="height: 500px;">
<el-tabs type="border-card" style="height: 100%;">
<el-tab-pane
v-for="tab in tabs"
:key="tab.name"
:label="tab.label"
:name="tab.name">
<!-- 频率tab -->
<el-tabs type="border-card" style="height: 430px;">
<el-tab-pane
v-for="subTab in tab.subTabs"
:key="subTab.name"
:label="subTab.label"
:name="subTab.name">
<!-- 子标签页内容 -->
</el-tab-pane>
</el-tabs>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { data } from "@/api/plan/autoTest.json";
const tabs = ref([
{
label: '频率',
name: 'resultTab',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab' }
]
},
{
label: '电压',
name: 'resultTab1',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab1' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab1' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab1' }
]
},
{
label: '电流',
name: 'resultTab2',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab2' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab2' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab2' }
]
},
{
label: '电压不平衡度',
name: 'resultTab3',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab3' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab3' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab3' }
]
},
{
label: '电流不平衡度',
name: 'resultTab4',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab4' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab4' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab4' }
]
},
{
label: '谐波电压',
name: 'resultTab5',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab5' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab5' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab5' }
]
},
{
label: '谐波电流',
name: 'resultTab6',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab6' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab6' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab6' }
]
},
{
label: '间谐波电压',
name: 'resultTab7',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab7' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab7' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab7' }
]
},
{
label: '间谐波电流',
name: 'resultTab8',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab8' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab8' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab8' }
]
},
{
label: '电压暂升暂降',
name: 'resultTab9',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab9' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab9' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab9' }
]
},
{
label: '闪变',
name: 'resultTab10',
subTabs: [
{ label: '额度工作条件下的检测', name: 'quotaConditionTab10' },
{ label: '电压对频率测量的影响', name: 'voltageFrequencyImpactTab10' },
{ label: '谐波对频率测量的影响', name: 'harmonicFrequencyImpactTab10' }
]
}
]);
const defaultProps = {
children: "children",
label: "name",
pid: "pid",
};
const handleNodeClick = (data: any) => {
console.log(data);
};
</script>
<style scoped>
.data-check-content {
display: flex;
gap: 20px;
}
.content-tree {
width: 300px;
height: 500px;
border: 1px solid #dcdfe6;
border-radius: 4px;
margin-right: 10px;
overflow: auto; /* 同时启用垂直和水平滚动 */
overflow-x: auto; /* 确保水平滚动条生效 */
}
/* 确保 el-tree 内容可以超出容器宽度 */
.el-tree {
width: fit-content; /* 根据内容自适应宽度 */
}
.content-right-Tabs {
flex: 1; /* 根据需要调整宽度比例 */
}
</style>

View File

@@ -1,45 +1,93 @@
<template>
<el-dialog title="请确认检测脚本值类型" v-model='dialogVisible' @close="close" v-bind="dialogSmall">
<div>
<el-form :model="formContent" ref='dialogFormRef'>
<el-form-item label="检测脚本值类型" >
<el-select clearable placeholder="请选择类型检测脚本值类型" >
<el-option label="相对值" :value="0"></el-option>
<el-option label="绝对值" :value="1"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-dialog :title="dialogTitle"
v-model='dialogVisible'
@close="close"
v-bind="dialogBig"
width="1400px">
<div class="dialog-content" >
<el-form :model='formContent' label-width="auto" class="form-three ">
<el-form-item label="脚本名称" prop='name'>
<el-input v-model='formContent.name' />
</el-form-item>
<el-form-item label="参照标准名称" prop='standardName'>
<el-input v-model='formContent.standardName' />
</el-form-item>
<el-form-item label="标准推行年份" prop='standardTime'>
<el-date-picker
v-model="formContent.standardTime"
type="year"
placeholder="请选择标准推行年份"
/>
</el-form-item>
<el-form-item label='值类型' prop='valueType' >
<el-select v-model="formContent.valueType" filterable clearable placeholder="请选择值类型">
<el-option
v-for="item in dictStore.getDictData('Script_Value_Type')"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<TestScriptDetail />
<template #footer>
<div >
<el-button @click='close()'> </el-button>
<el-button type="primary" @click='save()'>保存</el-button>
</div>
<template #footer>
<div >
<el-button @click='close()'> </el-button>
<el-button type="primary" @click='save()'>新增</el-button>
</div>
</template>
</el-dialog>
</template>
</el-dialog>
</template>
<script setup lang='ts'>
import { dialogSmall } from '@/utils/elementBind'
import { ElMessage, type FormItemRule } from 'element-plus'
import { computed, reactive, type Ref, ref } from 'vue'
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
import { dialogBig } from '@/utils/elementBind'
import { computed, ref } from 'vue'
import { useDictStore } from '@/stores/modules/dict'
import TestScriptDetail from '@/views/machine/testScript/components/testScriptDetail.vue';
import { type TestScript } from '@/api/device/interface/testScript';
const modeId = ref()
// 定义弹出组件元信息
const dialogFormRef = ref()
const dictStore = useDictStore()
function useMetaInfo() {
const dialogVisible = ref(false)
const formContent = ref()
return { dialogVisible, formContent }
const titleType = ref('add')
const formContent = ref<TestScript.ResTestScript>({
name: '',
type: '',
valueType:'',
pattern: modeId.value,
standardName: '',
standardTime: '',
state:1,
})
return { dialogVisible, titleType,formContent }
}
const { dialogVisible, formContent } = useMetaInfo()
const { dialogVisible, titleType,formContent } = useMetaInfo()
let dialogTitle = computed(() => {
return titleType.value === 'add' ? '新增检测脚本' : '编辑检测脚本'
})
// 清空formContent
const resetFormContent = () => {
formContent.value = {
name: '',
type: '',
valueType:'',
pattern: modeId.value,
standardName: '',
standardTime: '',
state:1,
}
}
@@ -60,7 +108,9 @@ const dialogFormRef = ref()
// 打开弹窗,可能是新增,也可能是编辑
const open = (currentMode: string) => {
const open = (sign: string,row: any,currentMode: string) => {
titleType.value = sign
modeId.value = dictStore.getDictData('Pattern').find(item => item.name === currentMode)?.id;
// 重置表单
dialogFormRef.value?.resetFields()
dialogVisible.value = true
@@ -72,4 +122,10 @@ const props = defineProps<{
refreshTable: (() => Promise<void>) | undefined;
}>()
</script>
</script>
<style scoped>
/* .dialog-content {
padding: 10px;
} */
</style>