|
|
@ -87,7 +87,12 @@ |
|
|
|
<el-input v-model="form1.datatype" autocomplete="off" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="阈值" prop="ratio"> |
|
|
|
<el-input v-model.number="form1.ratio" autocomplete="off" /> |
|
|
|
<el-input |
|
|
|
v-model="form1.ratio" |
|
|
|
:formatter="formatNumber" |
|
|
|
:parser="parseNumber" |
|
|
|
placeholder="只能输入数字" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
@ -95,7 +100,6 @@ |
|
|
|
<el-button type="primary" @click="submitForm1">保存</el-button> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog :title="title" v-model="open2" width="500px" append-to-body :before-close="handleClose2"> |
|
|
|
<el-form ref="clasFormRef2" :model="form2" :rules="rules2" label-width="120px" size="small"> |
|
|
|
<el-form-item label="业务类型" prop="regexName"> |
|
|
@ -105,7 +109,12 @@ |
|
|
|
<el-input v-model="form2.regexPattern" autocomplete="off" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="阈值" prop="ratio"> |
|
|
|
<el-input v-model.number="form2.ratio" autocomplete="off" /> |
|
|
|
<el-input |
|
|
|
v-model="form2.ratio" |
|
|
|
:formatter="formatNumber" |
|
|
|
:parser="parseNumber" |
|
|
|
placeholder="只能输入数字" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template #footer> |
|
|
@ -125,7 +134,12 @@ |
|
|
|
<el-input v-model="form3.colAttr" autocomplete="off" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="阈值" prop="ratio"> |
|
|
|
<el-input v-model.number="form3.ratio" autocomplete="off" /> |
|
|
|
<el-input |
|
|
|
v-model="form3.ratio" |
|
|
|
:formatter="formatNumber" |
|
|
|
:parser="parseNumber" |
|
|
|
placeholder="只能输入数字" |
|
|
|
></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属系统" prop="ssysId"> |
|
|
|
<el-select v-model="form3.ssysId" placeholder="请选择系统" clearable allow-create filterable style="width: 350px"> |
|
|
@ -185,16 +199,16 @@ const clasFormRef1 = ref(null); // 值类型 formRef |
|
|
|
const clasFormRef2 = ref(null); // 业务类型 formRef |
|
|
|
const clasFormRef3 = ref(null); // 字段处理类型 formRef |
|
|
|
|
|
|
|
const form1 = reactive({ |
|
|
|
const form1 = ref({ |
|
|
|
datatype: "", |
|
|
|
ratio: null, |
|
|
|
}); |
|
|
|
const form2 = reactive({ |
|
|
|
const form2 = ref({ |
|
|
|
regexName: "", |
|
|
|
regexPattern: "", |
|
|
|
ratio: null, |
|
|
|
}); |
|
|
|
const form3 = reactive({ |
|
|
|
const form3 = ref({ |
|
|
|
opType: "", |
|
|
|
colType: "", |
|
|
|
colAttr: "", |
|
|
@ -222,7 +236,20 @@ const rules3 = { |
|
|
|
const selectedRows1 = ref([]); |
|
|
|
const selectedRows2 = ref([]); |
|
|
|
const selectedRows3 = ref([]); |
|
|
|
const formatNumber = (value) => { |
|
|
|
if (!value) return value; |
|
|
|
value = value.replace(/[^\d.-]/g, ''); // 移除非数字、非小数点、非负号 |
|
|
|
value = value.replace(/^\./, '0.'); // 以.开头转为0. |
|
|
|
value = value.replace(/^\-/, '-0'); // 以-开头转为-0(可选) |
|
|
|
value = value.replace(/(\.\d{2})\d+/, '$1'); // 限制小数点后两位 |
|
|
|
value = value.replace(/^(-?\d+)-/, '$1'); // 防止中间出现负号 |
|
|
|
value = value.replace(/^(-?\d+)\.(\d*)\.*/, '$1.$2'); // 防止多个小数点 |
|
|
|
return value; |
|
|
|
}; |
|
|
|
|
|
|
|
const parseNumber = (value) => { |
|
|
|
return formatNumber(value); |
|
|
|
}; |
|
|
|
function handleSelectionChange1(val) { |
|
|
|
selectedRows1.value = val; |
|
|
|
} |
|
|
@ -232,7 +259,6 @@ function handleSelectionChange2(val) { |
|
|
|
function handleSelectionChange3(val) { |
|
|
|
selectedRows3.value = val; |
|
|
|
} |
|
|
|
|
|
|
|
async function getList1() { |
|
|
|
loading.value = true; |
|
|
|
try { |
|
|
@ -286,7 +312,7 @@ function handleSearch() { |
|
|
|
// ===== 值类型弹窗处理 ===== |
|
|
|
function openAddDialog1() { |
|
|
|
title.value = "新增值类型参数"; |
|
|
|
Object.assign(form1, { datatype: "", ratio: null }); |
|
|
|
Object.assign(form1.value, { datatype: "", ratio: null }); |
|
|
|
open1.value = true; |
|
|
|
} |
|
|
|
function openEditDialog1(row) { |
|
|
@ -295,14 +321,14 @@ function openEditDialog1(row) { |
|
|
|
return; |
|
|
|
} |
|
|
|
title.value = "编辑值类型参数"; |
|
|
|
Object.assign(form1, row); |
|
|
|
Object.assign(form1.value, row); |
|
|
|
open1.value = true; |
|
|
|
} |
|
|
|
|
|
|
|
function submitForm1() { |
|
|
|
clasFormRef1.value.validate(async (valid) => { |
|
|
|
if (!valid) return; |
|
|
|
const submitData = { ...form1,ssysId:queryForm.ssysId,mdlName:queryForm.mdlName }; |
|
|
|
const submitData = { ...form1.value,ssysId:queryForm.ssysId,mdlName:queryForm.mdlName }; |
|
|
|
try { |
|
|
|
if (title.value.includes("新增")) { |
|
|
|
await addDatatypeLabel(submitData); |
|
|
@ -348,7 +374,7 @@ function handleClose1(done) { |
|
|
|
// ===== 业务类型弹窗处理 ===== |
|
|
|
function openAddDialog2() { |
|
|
|
title.value = "新增业务类型参数"; |
|
|
|
Object.assign(form2, { |
|
|
|
Object.assign(form2.value, { |
|
|
|
regexName: "", |
|
|
|
regexPattern: "", |
|
|
|
ratio: null, |
|
|
@ -357,7 +383,7 @@ function openAddDialog2() { |
|
|
|
} |
|
|
|
function openAddDialog3() { |
|
|
|
title.value = "新增字段处理类型参数"; |
|
|
|
Object.assign(form3, { |
|
|
|
Object.assign(form3.value, { |
|
|
|
opType: "", |
|
|
|
colType: "", |
|
|
|
colAttr: "", |
|
|
@ -374,7 +400,7 @@ function openEditDialog2(row) { |
|
|
|
return; |
|
|
|
} |
|
|
|
title.value = "编辑业务类型参数"; |
|
|
|
Object.assign(form2, row); |
|
|
|
Object.assign(form2.value, row); |
|
|
|
open2.value = true; |
|
|
|
} |
|
|
|
|
|
|
@ -384,14 +410,14 @@ function openEditDialog3(row) { |
|
|
|
return; |
|
|
|
} |
|
|
|
title.value = "编辑字段处理类型参数"; |
|
|
|
Object.assign(form3, row); |
|
|
|
Object.assign(form3.value, row); |
|
|
|
open3.value = true; |
|
|
|
} |
|
|
|
|
|
|
|
function submitForm2() { |
|
|
|
clasFormRef2.value.validate(async (valid) => { |
|
|
|
if (!valid) return; |
|
|
|
const submitData = { ...form2,ssysId:queryForm.ssysId,mdlName:queryForm.mdlName}; |
|
|
|
const submitData = { ...form2.value,ssysId:queryForm.ssysId,mdlName:queryForm.mdlName}; |
|
|
|
try { |
|
|
|
if (title.value.includes("新增")) { |
|
|
|
await addBusiLabel(submitData); |
|
|
@ -410,7 +436,7 @@ function submitForm2() { |
|
|
|
function submitForm3() { |
|
|
|
clasFormRef3.value.validate(async (valid) => { |
|
|
|
if (!valid) return; |
|
|
|
const submitData = { ...form3}; |
|
|
|
const submitData = { ...form3.value}; |
|
|
|
try { |
|
|
|
if (title.value.includes("新增")) { |
|
|
|
await addDataopLabel(submitData); |
|
|
|