|
|
@@ -11,6 +11,7 @@ import WaveChart from './components/WaveChart.vue'
|
|
|
import { STOPPED_COLOR, statusGradientColor } from './statusColor'
|
|
|
import { DEVICE_POINT_TO_TYPE, DEVICE_POINTS, PRIMARY_DEVICE_POINT, type Annotation, type AnnotationLabel, type Cycle, type DevicePoint, type Fault, type MeasurementType, type PeriodDetail, type QueryOption, type SitePoint, type TimePoint, type QueryOptionsResponse, type WaveWindowFile, type WaveWindowResponse } from './types'
|
|
|
|
|
|
+const DEFAULT_DEVICE_PART = '7号机组一缸'
|
|
|
const queryMeta = ref<QueryOptionsResponse | null>(null)
|
|
|
const selectedDevicePart = ref('')
|
|
|
const selectedDevicePoints = ref<DevicePoint[]>([PRIMARY_DEVICE_POINT])
|
|
|
@@ -18,14 +19,13 @@ const fileListPoint = ref<DevicePoint | string>(PRIMARY_DEVICE_POINT)
|
|
|
const minTime = ref('')
|
|
|
const maxTime = ref('')
|
|
|
const selectedTimeRangePoint = ref<DevicePoint | ''>('')
|
|
|
-const windowSize = ref(4)
|
|
|
+const windowSize = ref(50)
|
|
|
const maxPoints = ref(200000)
|
|
|
const noSampling = ref(false)
|
|
|
const includeStopped = ref(false)
|
|
|
const abnormalOnly = ref(false)
|
|
|
const noCycleOnly = ref(false)
|
|
|
const minStatus = ref<number | null>(null)
|
|
|
-const firstCycleOnly = ref(false)
|
|
|
const sitePointOptions = ref<SitePoint[]>([])
|
|
|
const selectedSitePoints = ref<string[]>([])
|
|
|
const pksTimeBounds = ref<{ min: string | null; max: string | null } | null>(null)
|
|
|
@@ -66,7 +66,7 @@ const unitNumber = computed(() => {
|
|
|
const match = /^([789])号机组/.exec(selectedDevicePart.value)
|
|
|
return match ? match[1] : null
|
|
|
})
|
|
|
-const isPksMode = computed(() => firstCycleOnly.value && !!unitNumber.value)
|
|
|
+const isPksMode = computed(() => !!unitNumber.value)
|
|
|
const isPksOnly = computed(() => isPksMode.value && !selectedDevicePoints.value.length && selectedSitePoints.value.length > 0)
|
|
|
const canQueryTimePoints = computed(() => Boolean(selectedDevicePart.value) && (selectedDevicePoints.value.length > 0 || (isPksMode.value && selectedSitePoints.value.length > 0)))
|
|
|
const pointModel = computed({
|
|
|
@@ -278,7 +278,9 @@ async function loadOptions() {
|
|
|
try {
|
|
|
const result = await fetchQueryOptions()
|
|
|
queryMeta.value = result
|
|
|
- selectedDevicePart.value = result.deviceParts[0] ?? ''
|
|
|
+ selectedDevicePart.value = result.deviceParts.includes(DEFAULT_DEVICE_PART)
|
|
|
+ ? DEFAULT_DEVICE_PART
|
|
|
+ : result.deviceParts[0] ?? ''
|
|
|
selectedTimeRangePoint.value = ''
|
|
|
syncTimeBounds(true)
|
|
|
initialized.value = true
|
|
|
@@ -390,7 +392,7 @@ async function loadWaveWindowNow() {
|
|
|
points,
|
|
|
maxPoints: maxPoints.value,
|
|
|
noSampling: noSampling.value,
|
|
|
- firstCycleOnly: firstCycleOnly.value,
|
|
|
+ firstCycleOnly: true,
|
|
|
sitePoints: isPksMode.value ? selectedSitePoints.value : [],
|
|
|
})
|
|
|
if (requestId === waveRequestId) {
|
|
|
@@ -746,13 +748,7 @@ watch(noCycleOnly, () => {
|
|
|
watch(minStatus, () => {
|
|
|
if (initialized.value) scheduleTimePoints()
|
|
|
})
|
|
|
-watch(firstCycleOnly, () => {
|
|
|
- if (!initialized.value) return
|
|
|
- windowSize.value = firstCycleOnly.value ? 50 : 4
|
|
|
- markChartDirty()
|
|
|
- void loadWaveWindowNow()
|
|
|
-})
|
|
|
-watch([firstCycleOnly, unitNumber], async () => {
|
|
|
+watch(unitNumber, async () => {
|
|
|
if (!initialized.value) return
|
|
|
if (isPksMode.value) {
|
|
|
await loadSitePoints()
|
|
|
@@ -1047,10 +1043,6 @@ onBeforeUnmount(() => {
|
|
|
:title="isPksOnly ? '仅 PKS 点位组合下不可用' : (noCycleOnly ? '勾选无周期时忽略质心距离' : undefined)"
|
|
|
/>
|
|
|
</label>
|
|
|
- <label class="field field-first-cycle">
|
|
|
- <span class="field-label">首个周期</span>
|
|
|
- <el-checkbox v-model="firstCycleOnly" class="query-checkbox" size="large" :disabled="queryLoading">连续曲线</el-checkbox>
|
|
|
- </label>
|
|
|
</div>
|
|
|
<label class="field window-field">
|
|
|
<span class="field-label">时间窗口 <em>{{ isPksOnly ? '时间点数量' : '文件数量' }}</em></span>
|