e54fb4ec by lihua

fix

1 parent 84b134a0
...@@ -1520,7 +1520,7 @@ const panelChange = (scope, row) => { ...@@ -1520,7 +1520,7 @@ const panelChange = (scope, row) => {
1520 </el-tooltip> 1520 </el-tooltip>
1521 <!-- 输入框右上角显示验证按钮 --> 1521 <!-- 输入框右上角显示验证按钮 -->
1522 <span v-if="item.validateBtn" style="position: absolute;right: 0;top: 0px" class="text_btn" @click="item.validateBtn.click">{{ item.validateBtn.label }}</span> 1522 <span v-if="item.validateBtn" style="position: absolute;right: 0;top: 0px" class="text_btn" @click="item.validateBtn.click">{{ item.validateBtn.label }}</span>
1523 <div v-if="item.validateMsg?.msg" class="validate-input-after-msg" :style="{ color: item.validateMsg.status == 'success' ? '#4FA55D' : '#E63E33', right: item.validateMsg.status == 'success' ? '-106px' : '-120px' }"><el-icon class="title-icon"><CircleCloseFilled v-if="item.validateMsg.status != 'success'" /> 1523 <div v-if="item.validateMsg?.msg" class="validate-input-after-msg" :style="{ color: item.validateMsg.status == 'success' ? '#4FA55D' : '#E63E33' }"><el-icon class="title-icon"><CircleCloseFilled v-if="item.validateMsg.status != 'success'" />
1524 <CircleCheckFilled v-else /></el-icon><span class="title_text">{{ item.validateMsg?.msg }}</span></div> 1524 <CircleCheckFilled v-else /></el-icon><span class="title_text">{{ item.validateMsg?.msg }}</span></div>
1525 <span v-if="item.afterMsg" style="color: #212121">{{ item.afterMsg }}</span> 1525 <span v-if="item.afterMsg" style="color: #212121">{{ item.afterMsg }}</span>
1526 </div> 1526 </div>
...@@ -2496,8 +2496,8 @@ const panelChange = (scope, row) => { ...@@ -2496,8 +2496,8 @@ const panelChange = (scope, row) => {
2496 display: flex; 2496 display: flex;
2497 align-items: center; 2497 align-items: center;
2498 position: absolute; 2498 position: absolute;
2499 top: 26px; 2499 top: 54px;
2500 right: -120px; 2500 left: 0px;
2501 2501
2502 :deep(.el-icon) { 2502 :deep(.el-icon) {
2503 width: 16px; 2503 width: 16px;
...@@ -2508,4 +2508,8 @@ const panelChange = (scope, row) => { ...@@ -2508,4 +2508,8 @@ const panelChange = (scope, row) => {
2508 } 2508 }
2509 } 2509 }
2510 } 2510 }
2511
2512 .mb8 {
2513 margin-bottom: 8px;
2514 }
2511 </style> 2515 </style>
......
...@@ -90,7 +90,7 @@ const tableInfo = ref({ ...@@ -90,7 +90,7 @@ const tableInfo = ref({
90 matchEnValue.value.value = labelRuleField.matchEnValue; 90 matchEnValue.value.value = labelRuleField.matchEnValue;
91 matchEnValue.value.disabled = false; 91 matchEnValue.value.disabled = false;
92 formRows.value = labelRuleField.vagueMatchRule || [{ matchValue: '', position: '', name: '', disabled: false }]; 92 formRows.value = labelRuleField.vagueMatchRule || [{ matchValue: '', position: '', name: '', disabled: false }];
93 93 tabsInfo.value.activeName = 'labelRuleField';
94 let labelRuleContent = detail.labelRuleContent || {}; 94 let labelRuleContent = detail.labelRuleContent || {};
95 95
96 ruleContentFormItems.value[1].visible = labelRuleContent.ruleType == 1; 96 ruleContentFormItems.value[1].visible = labelRuleContent.ruleType == 1;
...@@ -298,10 +298,10 @@ const newCreateLabelDialogInfo = ref({ ...@@ -298,10 +298,10 @@ const newCreateLabelDialogInfo = ref({
298 }, 298 },
299 submit: (btn, info) => { 299 submit: (btn, info) => {
300 // 需要验证两个 300 // 需要验证两个
301 let validateRuleField = () => { 301 let validateRuleField = (showMsg = true) => {
302 if (!matchChValue.value.value && !matchEnValue.value.value && (!formRows.value.length || (formRows.value.length == 1 && formRows.value[0].matchValue && 302 if (!matchChValue.value.value && !matchEnValue.value.value && (!formRows.value.length || (formRows.value.length == 1 && !formRows.value[0].matchValue &&
303 !formRows.value[0].position && !formRows.value[0].name))) { 303 !formRows.value[0].position && !formRows.value[0].name))) {
304 proxy.$ElMessage.error('字段识别匹配规则不能为空'); 304 showMsg && proxy.$ElMessage.error('字段识别匹配规则不能为空');
305 return false; 305 return false;
306 } 306 }
307 for (let i = 0; i < formRows.value.length; i++) { 307 for (let i = 0; i < formRows.value.length; i++) {
...@@ -311,7 +311,7 @@ const newCreateLabelDialogInfo = ref({ ...@@ -311,7 +311,7 @@ const newCreateLabelDialogInfo = ref({
311 continue; // 如果全为空,跳过这一行的校验 311 continue; // 如果全为空,跳过这一行的校验
312 } 312 }
313 if (!row.matchValue || !row.position || !row.name) { 313 if (!row.matchValue || !row.position || !row.name) {
314 proxy.$ElMessage.error('请填写完整的模糊匹配规则'); 314 showMsg && proxy.$ElMessage.error('请填写完整的模糊匹配规则');
315 return false; 315 return false;
316 } 316 }
317 } 317 }
...@@ -388,18 +388,42 @@ const newCreateLabelDialogInfo = ref({ ...@@ -388,18 +388,42 @@ const newCreateLabelDialogInfo = ref({
388 }) 388 })
389 } 389 }
390 } else { //只需匹配一项即可。 390 } else { //只需匹配一项即可。
391 if (!matchChValue.value.value && !matchEnValue.value.value && (!formRows.value.length || (formRows.value.length == 1 && formRows.value[0].matchValue && 391 if (tabsInfo.value.activeName == 'labelRuleField') { //先验证字段识别
392 !formRows.value[0].position && !formRows.value[0].name))) { // 没有配置字段识别内容 392 if (!matchChValue.value.value && !matchEnValue.value.value && (!formRows.value.length || (formRows.value.length == 1 && (!formRows.value[0].matchValue &&
393 !formRows.value[0].position && !formRows.value[0].name)))) { // 没有配置字段识别内容
394 ruleContentFormRef.value?.ruleFormRef?.validate((valid, errorItem) => {
395 if (valid) {
396 submitLabel();
397 } else {
398 proxy.$ElMessage.error('字段识别和内容识别不能同时为空');
399 return;
400 }
401 })
402 } else {
403 ruleContentFormRef.value?.ruleFormRef?.validate((valid, errorItem) => {
404 if (valid) {
405 submitLabel(); //只需要满足一个即可。
406 } else {
407 ruleContentFormRef.value?.ruleFormRef?.clearValidate(['builtInRuleCode', 'regularExpression', 'hitRate']);// 先清除验证
408 // 去 验证 字段识别
409 if (!validateRuleField(true)) {
410 return;
411 }
412 submitLabel();
413 }
414 })
415 }
416 } else {
393 ruleContentFormRef.value?.ruleFormRef?.validate((valid, errorItem) => { 417 ruleContentFormRef.value?.ruleFormRef?.validate((valid, errorItem) => {
394 if (valid) { 418 if (valid) {
395 submitLabel(); 419 submitLabel(); //只需要满足一个即可。
396 } else { 420 } else {
397 proxy.$ElMessage.error('字段识别和内容识别不能同时为空'); 421 if (!validateRuleField(false)) {
398 return; 422 return;
423 }
424 submitLabel();
399 } 425 }
400 }) 426 })
401 } else {
402 submitLabel();
403 } 427 }
404 } 428 }
405 } 429 }
...@@ -471,6 +495,8 @@ const handleCreate = () => { ...@@ -471,6 +495,8 @@ const handleCreate = () => {
471 matchEnValue.value.disabled = false; 495 matchEnValue.value.disabled = false;
472 formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }]; 496 formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }];
473 497
498 tabsInfo.value.activeName = 'labelRuleField';
499
474 ruleContentFormItems.value[1].visible = true; 500 ruleContentFormItems.value[1].visible = true;
475 ruleContentFormItems.value[2].visible = false; 501 ruleContentFormItems.value[2].visible = false;
476 ruleContentFormItems.value.forEach(item => { 502 ruleContentFormItems.value.forEach(item => {
...@@ -544,7 +570,8 @@ const ruleContentFormItems = ref([{ ...@@ -544,7 +570,8 @@ const ruleContentFormItems = ref([{
544 default: '', 570 default: '',
545 required: false, 571 required: false,
546 clearable: true, 572 clearable: true,
547 block: false, 573 col: 'mb8',
574 block: true,
548 visible: true, 575 visible: true,
549 validateBtn: { 576 validateBtn: {
550 value: 'validate', 577 value: 'validate',
...@@ -583,7 +610,7 @@ const ruleContentFormItems = ref([{ ...@@ -583,7 +610,7 @@ const ruleContentFormItems = ref([{
583 }, { 610 }, {
584 label: '命中率设置(%)', 611 label: '命中率设置(%)',
585 type: 'input', 612 type: 'input',
586 placeholder: '请输入0~100', 613 placeholder: '请输入1~100',
587 field: 'hitRate', 614 field: 'hitRate',
588 min: 1, 615 min: 1,
589 max: 100, 616 max: 100,
...@@ -593,7 +620,7 @@ const ruleContentFormItems = ref([{ ...@@ -593,7 +620,7 @@ const ruleContentFormItems = ref([{
593 block: true, 620 block: true,
594 clearable: true, 621 clearable: true,
595 visible: true, 622 visible: true,
596 width: '110px', 623 width: '100px',
597 beforeMsg: '一列数据中的非空数据,大于等于', 624 beforeMsg: '一列数据中的非空数据,大于等于',
598 afterMsg: ' %的数据符合以上识别条件,则认为命中该识别规则。' 625 afterMsg: ' %的数据符合以上识别条件,则认为命中该识别规则。'
599 }]); 626 }]);
...@@ -817,8 +844,9 @@ onBeforeMount(() => { ...@@ -817,8 +844,9 @@ onBeforeMount(() => {
817 .add-Icon { 844 .add-Icon {
818 display: flex; 845 display: flex;
819 align-items: center; 846 align-items: center;
820 margin-top: 13px; 847 margin-top: 4px;
821 width: 50%; 848 width: 50%;
849 margin-left: -4px;
822 850
823 .el-icon svg { 851 .el-icon svg {
824 height: 19px; 852 height: 19px;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!