|
|
|
|
@ -157,6 +157,7 @@
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts" name="MixTraceForward">
|
|
|
|
|
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
import { ArrowRight, Document, Folder } from '@element-plus/icons-vue';
|
|
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
|
|
import * as echarts from 'echarts';
|
|
|
|
|
@ -170,11 +171,12 @@ const barcodeIndex = source.barcodeIndex || {};
|
|
|
|
|
const treeProps = { children: 'children', label: 'label' };
|
|
|
|
|
const treeData = ref<any[]>(source.treeData || []);
|
|
|
|
|
const treeRef = ref();
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const searchText = ref('');
|
|
|
|
|
const barcodeType = ref(String(source.defaultBarcodeType || '2'));
|
|
|
|
|
const barcodeNo = ref(String(source.defaultBarcode || ''));
|
|
|
|
|
const barcodeType = ref(String(route.query.barcodeType || source.defaultBarcodeType || '2'));
|
|
|
|
|
const barcodeNo = ref(String(route.query.barcodeNo || source.defaultBarcode || ''));
|
|
|
|
|
const selectedNodeId = ref<string>('');
|
|
|
|
|
const curveCollapsed = ref(true);
|
|
|
|
|
|
|
|
|
|
@ -231,6 +233,23 @@ const handleSearch = () => {
|
|
|
|
|
ElMessage.success(`已定位条码: ${barcode}`);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const initFromRoute = () => {
|
|
|
|
|
// 优先使用路由参数,默认条码类型为成品胎(5)
|
|
|
|
|
const typeFromRoute = String(route.query.barcodeType || '').trim();
|
|
|
|
|
const noFromRoute = String(route.query.barcodeNo || '').trim();
|
|
|
|
|
|
|
|
|
|
if (typeFromRoute) {
|
|
|
|
|
barcodeType.value = typeFromRoute;
|
|
|
|
|
} else {
|
|
|
|
|
barcodeType.value = '5';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (noFromRoute) {
|
|
|
|
|
barcodeNo.value = noFromRoute;
|
|
|
|
|
handleSearch();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const initChart = () => {
|
|
|
|
|
if (!chartRef.value) return;
|
|
|
|
|
const cd = curveDataSource.value;
|
|
|
|
|
@ -385,7 +404,7 @@ const renderChartWithDelay = () => {
|
|
|
|
|
const toggleCurve = () => {
|
|
|
|
|
curveCollapsed.value = !curveCollapsed.value;
|
|
|
|
|
if (!curveCollapsed.value) {
|
|
|
|
|
renderChartWithDelay();
|
|
|
|
|
nextTick(() => initChart());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|