Browse Source

优化

master
LiLongLong 5 months ago
parent
commit
2192774632
  1. 41
      src/views/graphite/index.vue

41
src/views/graphite/index.vue

@ -115,7 +115,8 @@ import { getTxnRecord } from "@/services/txn";
import { useSettingStore } from "@/stores/setting";
import { useCraftStore } from "@/stores/craft";
import PhotoSvg from "@/assets/photo_icon.svg";
//
const statusStore = useStatusStore();
const craftStore = useCraftStore();
const craftInfo = ref(craftStore.craftInfo);
const settingStore = useSettingStore();
@ -143,8 +144,14 @@ watch(
}
}
);
//
const statusStore = useStatusStore();
watch(()=>statusStore.status,(newVal)=>{
console.log('newVal---', newVal)
if(newVal){
onUpateHeatAreaUI()
}
})
const heatAearStatusList = ref(statusStore.status?.heatArea || []);
const heatList: any = ref([]);
const craftVisible = ref(false);
@ -152,7 +159,6 @@ let tubeList = reactive<any>([]);
const selectedColor = "#4F85FB";
const emptyColor = "#FFFFFF";
const taskName = ref("");
let globeStatus: any = 0;
onMounted(() => {
//6
heatList.value = settingStore.heatAreaConfig.map((item:any) => {
@ -173,11 +179,6 @@ onMounted(() => {
//socket
const wsClient = createWebSocket(sharedWsUrl);
const subscription = wsClient.dataOb.subscribe((data) => {
if(!globeStatus){// TODO
console.log('globeStatus====', data)
}
globeStatus = 1;
if (data.type === "cmd") {
const cmdInfo = getTxnRecord(data.data.commandId, "task");
if (cmdInfo) {
@ -267,7 +268,6 @@ const onCraftStart = () => {
//
let hasCraft = true;
let len = selectedTrayList.value.length;
console.log('selectedTrayList---', selectedTrayList.value)
for (let i = 0; i < len; i++) {
let item = selectedTrayList.value[i];
if (!item.craftInfo) {
@ -340,7 +340,6 @@ const onAddSolution = (data: any) => {
ElMessage.error(res.msg);
}
});
globeStatus = 0;
// tubeList.forEach((item: any) => {
// if (ids.includes(item.id)) {
// item.default = defaultColor;
@ -453,6 +452,22 @@ const onMoveToHeat = () => {
}
});
};
//UI
const onUpateHeatAreaUI = () => {
//1
if (!selectedTrayList.value.length) {
ElMessage.error("请选择目标加热区");
return;
}
//2
if (selectedTrayList.value.length != 1) {
ElMessage.error("只能选择一个加热区");
return;
}
let selectedDataItem = selectedTrayList.value[0];
//UI
let list = [...heatList.value];
list.forEach((item: any) => {
@ -468,7 +483,8 @@ const onMoveToHeat = () => {
item.default = "";
});
heatList.value = [...list];
};
console.log('heatList.value---', heatList.value)
}
//()
const currentSelectedTube = ref({});
@ -500,6 +516,7 @@ const onMoveToOperationArea = () => {
heatList.value.forEach((item: any) => {
if (item.id == selectedDataItem.id) {
tubeList = [...item.tubeList];
item.isSelect = false;
}
});
onSelectedTray(selectedDataItem, "isMove");

Loading…
Cancel
Save