|
@@ -31,10 +31,10 @@
|
|
|
<ElInputNumber
|
|
<ElInputNumber
|
|
|
v-model="algoParams[item.prop]"
|
|
v-model="algoParams[item.prop]"
|
|
|
controls-position="right"
|
|
controls-position="right"
|
|
|
- :min="0"
|
|
|
|
|
:step="1"
|
|
:step="1"
|
|
|
style="width: 186px; margin-right: 5px"
|
|
style="width: 186px; margin-right: 5px"
|
|
|
:disabled="!algoParams.label"
|
|
:disabled="!algoParams.label"
|
|
|
|
|
+ placeholder="请输入检测数量"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
<el-form-item
|
|
@@ -115,6 +115,7 @@
|
|
|
import { Delete, Edit } from '@element-plus/icons-vue';
|
|
import { Delete, Edit } from '@element-plus/icons-vue';
|
|
|
import { SaveOutline } from '@vicons/ionicons5';
|
|
import { SaveOutline } from '@vicons/ionicons5';
|
|
|
import { labelNameMap } from './types';
|
|
import { labelNameMap } from './types';
|
|
|
|
|
+ import { getCriticalCounts } from './utils';
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
id: string;
|
|
id: string;
|
|
@@ -147,11 +148,17 @@
|
|
|
.map((item) => item.id);
|
|
.map((item) => item.id);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const algoParams = computed(
|
|
|
|
|
- () =>
|
|
|
|
|
- selectedAlgoDetail.value.metaValues.find((item) => item.id === props.id) ||
|
|
|
|
|
- ({} as AlgoParamMetaItem),
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ const algoParams = computed(() => {
|
|
|
|
|
+ const countList = getCriticalCounts(selectedAlgoDetail.value.extra);
|
|
|
|
|
+ const index = selectedAlgoDetail.value.metaValues.findIndex((item) => item.id === props.id);
|
|
|
|
|
+ if (index < 0) {
|
|
|
|
|
+ return {} as AlgoParamMetaItem;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const param = selectedAlgoDetail.value.metaValues[index];
|
|
|
|
|
+ param.criticalCount = countList && countList.length > index ? countList[index] : 0;
|
|
|
|
|
+ return param;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
const paramItems = ref([
|
|
const paramItems = ref([
|
|
|
{ label: '', type: 'label', prop: 'label' },
|
|
{ label: '', type: 'label', prop: 'label' },
|
|
@@ -165,7 +172,6 @@
|
|
|
(val) => {
|
|
(val) => {
|
|
|
if (!val) return;
|
|
if (!val) return;
|
|
|
const meta = metaObjList.value.find((item) => item.label === val);
|
|
const meta = metaObjList.value.find((item) => item.label === val);
|
|
|
- algoParams.value.criticalCount = 0;
|
|
|
|
|
algoParams.value.confidence = meta.confidence * 100;
|
|
algoParams.value.confidence = meta.confidence * 100;
|
|
|
algoParams.value['min-width'] = meta['min-width'];
|
|
algoParams.value['min-width'] = meta['min-width'];
|
|
|
algoParams.value['min-height'] = meta['min-height'];
|
|
algoParams.value['min-height'] = meta['min-height'];
|
|
@@ -208,7 +214,7 @@
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
if (param.type === 'criticalCount') {
|
|
if (param.type === 'criticalCount') {
|
|
|
- rule[`${param.label}.criticalCount`] = [
|
|
|
|
|
|
|
+ rule[`${param.label}${param.label ? '.' : ''}criticalCount`] = [
|
|
|
{
|
|
{
|
|
|
required: true,
|
|
required: true,
|
|
|
message: '请输入检测数量',
|
|
message: '请输入检测数量',
|