|
@@ -50,9 +50,23 @@ let waveRequestId = 0
|
|
|
|
|
|
|
|
const pointNames = computed(() => queryMeta.value?.pointNames ?? [])
|
|
const pointNames = computed(() => queryMeta.value?.pointNames ?? [])
|
|
|
|
|
|
|
|
|
|
+const pointCounts = computed<Record<string, { pre: number | null; ab: number | null }>>(() => {
|
|
|
|
|
+ const map: Record<string, { pre: number | null; ab: number | null }> = {}
|
|
|
|
|
+ for (const name of pointNames.value) {
|
|
|
|
|
+ map[name] = {
|
|
|
|
|
+ pre: queryMeta.value?.pretrainCounts?.[name] ?? null,
|
|
|
|
|
+ ab: queryMeta.value?.abnormalCounts?.[name] ?? null,
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return map
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
function pointLabel(pointName: string): string {
|
|
function pointLabel(pointName: string): string {
|
|
|
- const count = queryMeta.value?.pretrainCounts?.[pointName]
|
|
|
|
|
- return count ? `${pointName} (${count})` : pointName
|
|
|
|
|
|
|
+ const { pre, ab } = pointCounts.value[pointName] ?? { pre: null, ab: null }
|
|
|
|
|
+ const inner: string[] = []
|
|
|
|
|
+ if (pre != null) inner.push(String(pre))
|
|
|
|
|
+ if (ab != null) inner.push(String(ab))
|
|
|
|
|
+ return inner.length ? `${pointName} (${inner.join(' · ')})` : pointName
|
|
|
}
|
|
}
|
|
|
const selectedOptionRows = computed<QueryOption[]>(() => (
|
|
const selectedOptionRows = computed<QueryOption[]>(() => (
|
|
|
queryMeta.value?.options.filter((row) => (
|
|
queryMeta.value?.options.filter((row) => (
|
|
@@ -633,7 +647,14 @@ onBeforeUnmount(() => {
|
|
|
placeholder="输入机组、气缸或部位关键词"
|
|
placeholder="输入机组、气缸或部位关键词"
|
|
|
filter-placeholder="搜索采样点"
|
|
filter-placeholder="搜索采样点"
|
|
|
>
|
|
>
|
|
|
- <el-option v-for="pointName in pointNames" :key="pointName" :label="pointLabel(pointName)" :value="pointName" />
|
|
|
|
|
|
|
+ <el-option v-for="pointName in pointNames" :key="pointName" :label="pointLabel(pointName)" :value="pointName">
|
|
|
|
|
+ <span>{{ pointName }}</span>
|
|
|
|
|
+ <template v-if="pointCounts[pointName]?.pre !== null || pointCounts[pointName]?.ab !== null">
|
|
|
|
|
+ <span class="point-counts">
|
|
|
|
|
+ (<span v-if="pointCounts[pointName]?.pre !== null">{{ pointCounts[pointName]?.pre }}</span><template v-if="pointCounts[pointName]?.pre !== null && pointCounts[pointName]?.ab !== null"> · </template><span v-if="pointCounts[pointName]?.ab !== null" class="abnormal-count">{{ pointCounts[pointName]?.ab }}</span>)
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</label>
|
|
</label>
|
|
|
<div class="field field-types">
|
|
<div class="field field-types">
|