diff --git a/src/assets/styles/element.scss b/src/assets/styles/element.scss index f1b5357..45f84fc 100644 --- a/src/assets/styles/element.scss +++ b/src/assets/styles/element.scss @@ -58,4 +58,8 @@ } } +} + +.t-image-viewer { + z-index: 9999; } \ No newline at end of file diff --git a/src/components/check1/index.vue b/src/components/check1/index.vue index 2855fd7..875adba 100644 --- a/src/components/check1/index.vue +++ b/src/components/check1/index.vue @@ -1,10 +1,10 @@ @@ -118,7 +117,6 @@ const previewHandle = () => { - diff --git a/src/components/home/SavePhoto/index.vue b/src/components/home/SavePhoto/index.vue index 0399efc..fc7279f 100644 --- a/src/components/home/SavePhoto/index.vue +++ b/src/components/home/SavePhoto/index.vue @@ -2,7 +2,7 @@ import { savePhoto } from 'apis/home' import { getOreList } from 'apis/ore' import { FtMessage } from 'libs/message' -import { ImageViewer as TImageViewer } from 'tdesign-mobile-vue' +import { useHomeStore } from 'stores/homeStore' import { onMounted, ref } from 'vue' const props = defineProps({ @@ -69,14 +69,14 @@ const mousedownHandle = async (e: Event) => { } const activeTube = ref(Array.from({ length: 16 }).fill(false)) -const previewVisible = ref(false) -const photos = ref([]) + const previewHandle = () => { + const homeStore = useHomeStore() if (!props.url) { return } - photos.value = [props.url] - previewVisible.value = true + homeStore.photos = [props.url] + homeStore.previewVisible = true } @@ -114,7 +114,6 @@ const previewHandle = () => { - diff --git a/src/libs/http.ts b/src/libs/http.ts index c0c0fe7..42dc3a1 100644 --- a/src/libs/http.ts +++ b/src/libs/http.ts @@ -1,7 +1,7 @@ -import { HEADER_TOKEN_KEY } from '@/libs/constant' import axios from 'axios' import { FtMessage } from 'libs/message' import { getToken } from 'libs/token' +import { HEADER_TOKEN_KEY } from '@/libs/constant' const http = axios.create({ baseURL: import.meta.env.FT_API_BASE, diff --git a/src/stores/homeStore.ts b/src/stores/homeStore.ts index de5fe58..e36adf9 100644 --- a/src/stores/homeStore.ts +++ b/src/stores/homeStore.ts @@ -38,6 +38,8 @@ export const useHomeStore = defineStore('home', { selected: false, }, ], + photos: [], + previewVisible: false, }), actions: { selectChange(index: number) { diff --git a/src/stores/systemStore.ts b/src/stores/systemStore.ts index b9f49bd..22ea582 100644 --- a/src/stores/systemStore.ts +++ b/src/stores/systemStore.ts @@ -1,7 +1,7 @@ -import router from '@/router' import { logout } from 'apis/login' import { delToken } from 'libs/token' import { defineStore } from 'pinia' +import router from '@/router' export const useSystemStore = defineStore('system', { state: (): System.SystemStore => ({ diff --git a/src/types/craft.d.ts b/src/types/craft.d.ts index 603bce8..d4b9160 100644 --- a/src/types/craft.d.ts +++ b/src/types/craft.d.ts @@ -52,17 +52,17 @@ declare namespace CraftTypes { second: number } } - export type StepStruct = - | UpTrayStepStruct - | DownTrayStepStruct - | AddLiquidStepStruct - | MoveToSolStepStruct - | MoveToHeaterStepStruct - | ShakingStepStruct - | StartHeatingStepStruct - | StopHeatingStepStruct - | TakePhotoStepStruct - | DelayStepStruct + export type StepStruct + = | UpTrayStepStruct + | DownTrayStepStruct + | AddLiquidStepStruct + | MoveToSolStepStruct + | MoveToHeaterStepStruct + | ShakingStepStruct + | StartHeatingStepStruct + | StopHeatingStepStruct + | TakePhotoStepStruct + | DelayStepStruct type StepCmd = StepStruct['method'] interface AddCraftType { openDialog: () => void @@ -102,12 +102,12 @@ declare namespace CraftTypes { interface DryParams { second?: number, description?: string } interface AnnealParams {} - type StepParam = - | { method: 'preHeat', params: PreHeatParams } - | { method: 'addLiquid', params: AddLiquidParams } - | { method: 'startHeating', params: HeatParams } - | { method: 'shaking', params: DryParams } - | { method: 'takePhoto', params: AnnealParams } + type StepParam + = | { method: 'preHeat', params: PreHeatParams } + | { method: 'addLiquid', params: AddLiquidParams } + | { method: 'startHeating', params: HeatParams } + | { method: 'shaking', params: DryParams } + | { method: 'takePhoto', params: AnnealParams } interface StepItem { name: string diff --git a/src/types/home.d.ts b/src/types/home.d.ts index 1b15c87..dea227a 100644 --- a/src/types/home.d.ts +++ b/src/types/home.d.ts @@ -1,6 +1,8 @@ declare namespace Home { interface HomeStore { heatAreaList: HeatArea[] + photos: string[] + previewVisible: boolean } interface HeatArea { label: 'A-1' | 'A-2' | 'A-3' | 'A-4' | 'A-5' | 'A-6' diff --git a/src/views/container/index.vue b/src/views/container/index.vue index 7af489b..a91f312 100644 --- a/src/views/container/index.vue +++ b/src/views/container/index.vue @@ -1,9 +1,9 @@ @@ -498,7 +496,7 @@ const previewHandle = () => { - + diff --git a/src/views/ore/index.vue b/src/views/ore/index.vue index 28d975e..800b5cb 100644 --- a/src/views/ore/index.vue +++ b/src/views/ore/index.vue @@ -1,8 +1,8 @@