微调
This commit is contained in:
@@ -14,5 +14,5 @@ export const dialogBig = {
|
|||||||
width:'1200px',
|
width:'1200px',
|
||||||
closeOnClickModal:false,
|
closeOnClickModal:false,
|
||||||
draggable:true,
|
draggable:true,
|
||||||
class:'dialog-big'
|
class:'dialog-big',
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="dialogTitle" :model-value="visible" @close="handleCancel" v-bind="dialogBig">
|
|
||||||
<el-table :data="errorData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" :span-method="spanMethod" border class="custom-table">
|
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig">
|
||||||
|
<div class="table-container">
|
||||||
|
<el-table :data="errorData"
|
||||||
|
height="500"
|
||||||
|
:header-cell-style="{ textAlign: 'center',backgroundColor: '#003078',color: '#fff' } "
|
||||||
|
:cell-style="{ textAlign: 'center' }"
|
||||||
|
style="width: 100%"
|
||||||
|
:span-method="spanMethod"
|
||||||
|
border
|
||||||
|
class="custom-table">
|
||||||
<el-table-column prop="measured" label="被测量" />
|
<el-table-column prop="measured" label="被测量" />
|
||||||
<el-table-column prop="deviceLevel" label="检测装置级别" />
|
<el-table-column prop="deviceLevel" label="检测装置级别" />
|
||||||
<el-table-column prop="measurementType" label="测量类型" />
|
<el-table-column prop="measurementType" label="测量类型" />
|
||||||
<el-table-column prop="condition" label="测量条件" />
|
<el-table-column prop="condition" label="测量条件" />
|
||||||
<el-table-column prop="maxErrorValue" label="最大误差" />
|
<el-table-column prop="maxErrorValue" label="最大误差" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div class="notes-container">
|
||||||
|
<label>注1:UN:测量的标称电压;IN:测量仪器的标称电流;Uh和Ih:测量值,h表示谐波次数。</label>
|
||||||
|
<label>注2:对于数字式接入监测终端,与电能质量信号采集单元联合准确度需满足本表要求。</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -17,37 +31,30 @@
|
|||||||
import type { ErrorSystem } from '@/api/device/interface/error'
|
import type { ErrorSystem } from '@/api/device/interface/error'
|
||||||
import errorDataList from '@/api/device/error/errorData'
|
import errorDataList from '@/api/device/error/errorData'
|
||||||
import type { TableColumnCtx } from 'element-plus'
|
import type { TableColumnCtx } from 'element-plus'
|
||||||
|
import { da } from 'element-plus/es/locale';
|
||||||
|
|
||||||
const errorData = errorDataList.errordetail
|
const errorData = errorDataList.errordetail
|
||||||
|
const dialogTitle = ref()
|
||||||
|
|
||||||
// 表格配置项
|
function useMetaInfo() {
|
||||||
const columns = reactive<ColumnProps<ErrorSystem.Error_detail>[]>([
|
const dialogVisible = ref(false)
|
||||||
{
|
const formContent = ref<ErrorSystem.ErrorSystemList>({
|
||||||
prop: 'measured',
|
id: '',
|
||||||
label: '被测量',
|
name: '',
|
||||||
},
|
standardName:'',
|
||||||
{
|
standardTime:'',
|
||||||
prop: 'deviceLevel',
|
devLevel:'',
|
||||||
label: '检测装置级别',
|
enable:1,
|
||||||
},
|
state:1,
|
||||||
{
|
})
|
||||||
prop: 'condition',
|
return { dialogVisible, formContent }
|
||||||
label: '测量条件',
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'measurementType',
|
|
||||||
label: '测量类型',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'maxErrorValue',
|
|
||||||
label: '最大误差',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
|
|
||||||
|
const { dialogVisible, formContent } = useMetaInfo()
|
||||||
|
|
||||||
interface SpanMethodProps {
|
interface SpanMethodProps {
|
||||||
row: ErrorSystem.Error_detail
|
row: ErrorSystem.ErrorSystemDetail
|
||||||
column: TableColumnCtx<ErrorSystem.Error_detail>
|
column: TableColumnCtx<ErrorSystem.ErrorSystemDetail>
|
||||||
rowIndex: number
|
rowIndex: number
|
||||||
columnIndex: number
|
columnIndex: number
|
||||||
}
|
}
|
||||||
@@ -110,41 +117,38 @@ const spanMethod = ({
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const close = () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
const props = defineProps<{
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
visible: boolean;
|
const open = async (sign: string, data: ErrorSystem.ErrorSystemList) => {
|
||||||
dialogTitle: string;
|
dialogTitle.value = sign + ' 误差体系'
|
||||||
|
dialogVisible.value = true
|
||||||
formData: {
|
if (data.id) {
|
||||||
measured: string,
|
formContent.value = data as ErrorSystem.ErrorSystemList;
|
||||||
deviceLevel: string,
|
}
|
||||||
condition: string,
|
}
|
||||||
maxErrorValue: string
|
|
||||||
};
|
|
||||||
}>();
|
|
||||||
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
(e: 'update:visible', value: boolean): void;
|
|
||||||
(e: 'submit', data: any): void;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
|
||||||
emit('update:visible', false); // 关闭对话框
|
|
||||||
};
|
|
||||||
|
|
||||||
// 当 props.visible 改变时,更新 formData
|
|
||||||
watch(() => props.visible, (newVal) => {
|
|
||||||
if (!newVal) {
|
|
||||||
// 这里可以重置表单数据,如果需要的话
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 对外映射
|
||||||
|
defineExpose({ open })
|
||||||
|
const props = defineProps<{
|
||||||
|
refreshTable: (() => Promise<void>) | undefined;
|
||||||
|
}>()
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
.table-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-table {
|
||||||
|
margin-bottom: 20px; /* 调整表格和注释之间的间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.notes-container {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -101,10 +101,10 @@
|
|||||||
import { type ErrorSystem } from '@/api/device/interface/error';
|
import { type ErrorSystem } from '@/api/device/interface/error';
|
||||||
import { useDictStore, } from '@/stores/modules/dict'
|
import { useDictStore, } from '@/stores/modules/dict'
|
||||||
import {CirclePlus, Delete, EditPen,CopyDocument} from '@element-plus/icons-vue'
|
import {CirclePlus, Delete, EditPen,CopyDocument} from '@element-plus/icons-vue'
|
||||||
import { FormItemRule } from 'element-plus';
|
import { FormItemRule } from 'element-plus';
|
||||||
import { onMounted, type PropType, Ref, ref, watch } from 'vue';
|
import { onMounted, type PropType, Ref, ref, watch } from 'vue';
|
||||||
import { defineEmits } from 'vue';
|
import { defineEmits } from 'vue';
|
||||||
import ProTable from '@/components/ProTable/index.vue'
|
import ProTable from '@/components/ProTable/index.vue'
|
||||||
const emit = defineEmits(['updateTableData']);
|
const emit = defineEmits(['updateTableData']);
|
||||||
const multipleSelection = ref<number[]>([])
|
const multipleSelection = ref<number[]>([])
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
<template #operation='scope'>
|
<template #operation='scope'>
|
||||||
<el-button type='primary' link :icon='View'>查看</el-button>
|
<el-button type='primary' link :icon='View' @click="openDialog('view', scope.row)">查看</el-button>
|
||||||
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -73,7 +73,13 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
|||||||
|
|
||||||
// 打开 drawer(新增、编辑)
|
// 打开 drawer(新增、编辑)
|
||||||
const openDialog = (titleType: string, row: Partial<ErrorSystem.ErrorSystemList> = {}) => {
|
const openDialog = (titleType: string, row: Partial<ErrorSystem.ErrorSystemList> = {}) => {
|
||||||
errorSystemPopup.value?.open(titleType, row)
|
if(titleType == 'view'){
|
||||||
|
errorStandardPopup.value?.open(row.name, row)
|
||||||
|
}else{
|
||||||
|
errorSystemPopup.value?.open(titleType, row)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<el-form-item label="源参数类型" :label-width="100" prop="sourceParamType">
|
<el-form-item label="源参数类型" :label-width="100" prop="sourceParamType">
|
||||||
<el-input v-model="formContent.sourceParamType" autocomplete="off"/>
|
<el-input v-model="formContent.sourceParamType" autocomplete="off"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="displayPid && displayPid!== '0'" label="源参数值" :label-width="100"
|
<el-form-item label="源参数值" :label-width="100"
|
||||||
prop="sourceParamValue">
|
prop="sourceParamValue">
|
||||||
<el-input v-model="formContent.sourceParamValue" autocomplete="off"/>
|
<el-input v-model="formContent.sourceParamValue" autocomplete="off"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {defineEmits, reactive, watch} from 'vue'
|
import {computed, defineEmits, reactive, watch} from 'vue'
|
||||||
import {dialogSmall} from "@/utils/elementBind"
|
import {dialogSmall} from "@/utils/elementBind"
|
||||||
import {TestSource} from "@/api/device/interface/testSource"
|
import {TestSource} from "@/api/device/interface/testSource"
|
||||||
import {ElMessage, FormItemRule} from "element-plus"
|
import {ElMessage, FormItemRule} from "element-plus"
|
||||||
@@ -56,11 +56,14 @@ const emit = defineEmits(['get-parameter'])
|
|||||||
// 计算属性,用于控制显示的 pid
|
// 计算属性,用于控制显示的 pid
|
||||||
const displayPid = computed({
|
const displayPid = computed({
|
||||||
get: () => {
|
get: () => {
|
||||||
|
|
||||||
return formContent.pId === '0' ? '' : formContent.pId;
|
return formContent.pId === '0' ? '' : formContent.pId;
|
||||||
},
|
},
|
||||||
set: (value) => {
|
set: (value) => {
|
||||||
|
|
||||||
formContent.pId = value;
|
formContent.pId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 树形节点配置
|
// 树形节点配置
|
||||||
@@ -95,13 +98,14 @@ const rules: reactive<Record<string, Array<FormItemRule>>> = reactive({
|
|||||||
sort: [{required: true, message: '排序必填!', trigger: 'blur'}]
|
sort: [{required: true, message: '排序必填!', trigger: 'blur'}]
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => formContent.pId, (newVal, oldVal) => {
|
// watch(() => formContent.pId, (newVal, oldVal) => {
|
||||||
if (newVal !== '0') {
|
|
||||||
rules.sourceParamValue = [{required: true, message: '源参数值必填!', trigger: 'blur'}]
|
// if (newVal !== '0') {
|
||||||
} else {
|
// rules.sourceParamValue = [{required: true, message: '源参数值必填!', trigger: 'blur'}]
|
||||||
rules.sourceParamValue = []
|
// } else {
|
||||||
}
|
// rules.sourceParamValue = []
|
||||||
})
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
let dialogTitle = computed(() => {
|
let dialogTitle = computed(() => {
|
||||||
return titleType.value === 'add' ? '新增源参数' : '编辑源参数'
|
return titleType.value === 'add' ? '新增源参数' : '编辑源参数'
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig">
|
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig" >
|
||||||
<div class="form-grid">
|
<div height="800">
|
||||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules'>
|
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' >
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="检测源名称" prop="name" :label-width="100">
|
<el-form-item label="检测源名称" prop="name" >
|
||||||
<el-input v-model='formContent.name' placeholder="检测源类型+设备类型简称+数字"/>
|
<el-input v-model='formContent.name' placeholder="检测源类型+设备类型简称+数字"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="设备类型" prop="devType" :label-width="100">
|
<el-form-item label="源型号" prop="devType" >
|
||||||
<el-select v-model='formContent.devType' placeholder="请选择设备类型">
|
<el-select v-model='formContent.devType' placeholder="请选择源型号">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dictStore.getDictData(dictTypeCode)"
|
v-for="item in dictStore.getDictData(dictTypeCode)"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="标准源" prop="type" :label-width="100">
|
<el-form-item label="标准源" prop="type">
|
||||||
<el-select v-model='formContent.type' placeholder="请选择检测源类型">
|
<el-select v-model='formContent.type' placeholder="请选择检测源类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dictStore.getDictData('Pq_Source_Type')"
|
v-for="item in dictStore.getDictData('Pq_Source_Type')"
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'devType',
|
prop: 'devType',
|
||||||
label: '设备类型',
|
label: '源型号',
|
||||||
enum: dictStore.getDictData('S_Dev_Type_'+dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.code),
|
enum: dictStore.getDictData('S_Dev_Type_'+dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.code),
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
search: { el: 'select' },
|
search: { el: 'select' },
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class='table-box' >
|
<div class='table-box' >
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-tab-pane label="检测相关配置">
|
<el-tab-pane label="检测相关配置">
|
||||||
<div class="form-grid">
|
<div >
|
||||||
<el-divider >检测配置</el-divider>
|
<el-divider >检测配置</el-divider>
|
||||||
<el-row :gutter="24" >
|
<el-row :gutter="24" >
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
|
|||||||
Reference in New Issue
Block a user