检测计划新增数据处理原则字段、全局配置中移除数据处理原则字段
This commit is contained in:
@@ -25,7 +25,8 @@ export namespace Plan {
|
||||
|
||||
associateReport:number;//是否关联报告模板 0否 1是
|
||||
reportTemplateName:string;
|
||||
reportTemplateVersion:string
|
||||
reportTemplateVersion:string;
|
||||
dataRule:string //数据处理原则
|
||||
}
|
||||
|
||||
// 检测计划 + 分页
|
||||
|
||||
@@ -8,7 +8,6 @@ export namespace Base {
|
||||
id: string; //系统配置表Id
|
||||
autoGenerate:number;//检测报告是否自动生成0 否;1是
|
||||
maxTime:number;//最大复检次数,默认3次
|
||||
dataRule:string;//数据处理原则,关联字典(所有值、部分值、cp95值、平均值、任意值),默认任意值
|
||||
state: number; //状态
|
||||
createBy?: string| null; //创建用户
|
||||
createTime?: string| null; //创建时间
|
||||
|
||||
@@ -47,6 +47,16 @@
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理原则" prop="dataRule" :label-width="110">
|
||||
<el-select v-model="formContent.dataRule" placeholder="请选择数据处理原则" autocomplete="off" :disabled="isSelectDisabled" clearable>
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Data_Rule')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="守时检测" :label-width="100" prop='timeCheck'>
|
||||
<el-radio-group v-model="formContent.timeCheck">
|
||||
@@ -181,6 +191,7 @@ const filterMethod = (query: string, item: { label?: string }) => {
|
||||
associateReport:0,
|
||||
reportTemplateName:'',
|
||||
reportTemplateVersion:'',
|
||||
dataRule:'',
|
||||
})
|
||||
return { dialogVisible, titleType, formContent }
|
||||
}
|
||||
@@ -214,6 +225,7 @@ const filterMethod = (query: string, item: { label?: string }) => {
|
||||
associateReport:0,
|
||||
reportTemplateName:'',
|
||||
reportTemplateVersion:'',
|
||||
dataRule:'',
|
||||
}
|
||||
)
|
||||
|
||||
@@ -233,6 +245,7 @@ const baseRules: Record<string, Array<FormItemRule>> = {
|
||||
datasourceIds: [{ required: true, message: '数据源必选!', trigger: 'change' }],
|
||||
scriptId: [{ required: true, message: '检测脚本必选!', trigger: 'change' }],
|
||||
errorSysId: [{ required: true, message: '误差体系必选!', trigger: 'change' }],
|
||||
dataRule: [{ required: true, message: '数据处理原则必选!', trigger: 'change' }],
|
||||
};
|
||||
|
||||
// 使用计算属性根据 scene 动态生成规则
|
||||
@@ -278,12 +291,19 @@ const rules = computed(() => {
|
||||
|
||||
|
||||
if (formContent.id) {
|
||||
// 把数据处理原则转成字典ID
|
||||
const patternItem = dictStore.getDictData('Data_Rule').find(item => item.name === formContent.dataRule);
|
||||
if (patternItem) {
|
||||
formContent.dataRule = patternItem.id;
|
||||
}
|
||||
|
||||
if( mode.value === '比对式'){
|
||||
await updatePlan(formContent)
|
||||
}else{
|
||||
|
||||
await updatePlan({...formContent,'sourceIds':[formContent.sourceIds],'datasourceIds':[formContent.datasourceIds]});
|
||||
}
|
||||
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
|
||||
} else {
|
||||
@@ -292,6 +312,11 @@ const rules = computed(() => {
|
||||
if (patternItem) {
|
||||
formContent.pattern = patternItem.id;
|
||||
}
|
||||
// 把数据处理原则转成字典ID
|
||||
const patternItem2 = dictStore.getDictData('Data_Rule').find(item => item.name === formContent.dataRule);
|
||||
if (patternItem2) {
|
||||
formContent.dataRule = patternItem2.id;
|
||||
}
|
||||
if( mode.value === '比对式'){
|
||||
await addPlan(formContent);
|
||||
}else{
|
||||
|
||||
@@ -120,18 +120,18 @@ const dataSourceType = computed(() => {
|
||||
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{ type: 'selection', fixed: 'left', minWidth: 70 },
|
||||
{ type: 'index', fixed: 'left', minWidth: 70, label: '序号' },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
width: 220,
|
||||
minWidth: 220,
|
||||
search: { el: 'input' },
|
||||
},
|
||||
{
|
||||
prop: 'testState',
|
||||
label: '检测状态',
|
||||
width: 120,
|
||||
minWidth: 120,
|
||||
enum:dictTestState,
|
||||
search: { el:'select',props: { filterable: true }},
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
@@ -144,7 +144,7 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
{
|
||||
prop: 'reportState',
|
||||
label: '检测报告状态',
|
||||
width: 120,
|
||||
minWidth: 120,
|
||||
enum:dictReportState,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
@@ -157,7 +157,7 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
{
|
||||
prop: 'result',
|
||||
label: '检测结果',
|
||||
width: 120,
|
||||
minWidth: 120,
|
||||
enum:dictResult,
|
||||
search: { el: 'select', props: { filterable: true } },
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
@@ -171,7 +171,7 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 200,
|
||||
minWidth: 200,
|
||||
render: scope => {
|
||||
if (scope.row.createTime) {
|
||||
const date = new Date(scope.row.createTime);
|
||||
@@ -217,7 +217,7 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
{
|
||||
prop: 'scriptId',
|
||||
label: '检测脚本',
|
||||
width: 360,
|
||||
minWidth: 360,
|
||||
render: scope => {
|
||||
return (
|
||||
<span>{scope.row.scriptName}</span>
|
||||
@@ -227,7 +227,7 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
{
|
||||
prop: 'errorSysId',
|
||||
label: '误差体系',
|
||||
width: 240,
|
||||
minWidth: 240,
|
||||
render: scope => {
|
||||
return (
|
||||
<el-link type='primary' link onClick={() => showData(scope.row)}>
|
||||
@@ -266,8 +266,15 @@ const columns = reactive<ColumnProps<Plan.ReqPlan>[]>([
|
||||
return dictItem ? dictItem.name : '/' // 如果找到匹配的项,返回对应的 name
|
||||
},
|
||||
},
|
||||
{
|
||||
prop: 'dataRule',
|
||||
label: '数据处理原则',
|
||||
enum: dictStore.getDictData('Data_Rule'),
|
||||
fieldNames: { label: 'name', value: 'id' },
|
||||
minWidth: 120,
|
||||
},
|
||||
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 300 },
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 300 },
|
||||
])
|
||||
|
||||
|
||||
|
||||
@@ -20,18 +20,18 @@
|
||||
<el-input number v-model.number='TestConfigForm.maxTime' placeholder="请输入检测最大次数" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='数据处理原则' prop='dataRule' :label-width="140">
|
||||
<el-select v-model="TestConfigForm.dataRule" clearable placeholder="请选择数据处理原则">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Data_Rule')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item label='数据处理原则' prop='dataRule' :label-width="140">-->
|
||||
<!-- <el-select v-model="TestConfigForm.dataRule" clearable placeholder="请选择数据处理原则">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in dictStore.getDictData('Data_Rule')"-->
|
||||
<!-- :key="item.id"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.id"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-form :model="RegResForm" ref='dialogFormRef' :rules='rules'>
|
||||
@@ -228,7 +228,6 @@ const TestConfigForm = ref<Base.ResTestConfig>({
|
||||
id: '',
|
||||
autoGenerate: 0,
|
||||
maxTime: 3,
|
||||
dataRule: '',
|
||||
state: 1, //状态
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user