From 542a3137c719432312aa8917092cbb46c687c7ac Mon Sep 17 00:00:00 2001 From: lihui_ocr Date: Thu, 9 May 2024 13:28:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=BB=88=E5=AE=A1=E8=AE=B0=E5=BF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/final.ts | 12 ++++---- src/views/final/aside/Aside.vue | 20 +++++++++---- src/views/final/content/Content.vue | 8 ++---- src/views/final/content/ListContent.vue | 17 +++++++++-- src/views/final/index.vue | 34 ++++++++++++++++++---- src/views/task/content/Content.vue | 38 +++++++++++++++++++------ src/views/task/modal/ImgDetailModal.vue | 2 ++ 7 files changed, 97 insertions(+), 34 deletions(-) diff --git a/src/store/modules/final.ts b/src/store/modules/final.ts index e0b3ddb..cec50ec 100644 --- a/src/store/modules/final.ts +++ b/src/store/modules/final.ts @@ -1,11 +1,10 @@ -import { defineStore } from 'pinia' -import { store } from '@/store' -import { getFilter } from '@/api/home/filter' -import { getConfig } from '@/api/system/user' +import { getFilter } from '@/api/home/filter'; import { asideMap } from "@/config/final"; -import { cloneDeep, isEqual } from "lodash-es"; +import { store } from '@/store'; +import { cloneDeep } from "lodash-es"; +import { defineStore } from 'pinia'; -import type { AsideConfig } from '/#/api' +import type { AsideConfig } from '/#/api'; export interface ConfigState { systemConfig: AsideConfig | null @@ -59,6 +58,7 @@ export const useFinalStore = defineStore({ console.log("systemConfig----------", config); }, setAsideValue(value) { +console.log(value) this.asideValue = value }, setListKey() { diff --git a/src/views/final/aside/Aside.vue b/src/views/final/aside/Aside.vue index 1f77dc8..e34885c 100644 --- a/src/views/final/aside/Aside.vue +++ b/src/views/final/aside/Aside.vue @@ -42,8 +42,11 @@ const configFilterRef = ref([]) // 获取排序的值 initAsideValueRef.value = cloneDeep(asideMap) onBeforeMount(async () => { + + finalStore.fetchConfig() finalStore.fetchCustomConfig() + }) Object.keys(asideMap).forEach((key) => { @@ -74,6 +77,8 @@ const mousetrap = inject('mousetrap') as any mousetrap.bind('[', collapseHandler) onMounted(() => { + + //console.log(asideMap) nextTick(() => { computeSlideHeight() }) @@ -110,9 +115,7 @@ function computeSlideHeight() { useWindowSizeFn(computeSlideHeight, 280) -onBeforeMount(async () => { - finalStore.fetchCustomConfig() -}) + nextTick(() => { finalStore.$subscribe(() => { @@ -221,7 +224,7 @@ nextTick(() => { } }) customTempObjRef.value = customObjRef.value - console.log('asideValue直接处理后的结果', asideValue) + console.log('asideValue直接处理后的结果q', asideValue) console.log('customTempObjRef.value', customTempObjRef.value) const tempobj = cloneDeep(asideValue) console.log('tempObj', tempobj) @@ -251,12 +254,17 @@ nextTick(() => { }) watch(asideVisible, (newVal) => { + Object.keys(asideValue).forEach((key) => { if (newVal[key] === false) asideValue[key] = asideMap[key].defaultValue }) }) +watch(asideValue, (newVal) => { + + console.log(newVal) +}) const asideEnter = ref(false) const showCollapse = computed(() => { @@ -332,10 +340,10 @@ function updateComponent(key, e) { customObjRef.value = tempobj // asideValue = Object.assign({}, asideValue, tempobj); console.log('asideValue跟新值', tempobj) - finalStore.setAsideValue(tempobj) + finalStore.setAsideValue(tempobj) } defineExpose({ - showSearch, + showSearch,asideValue }) useKeydown('s', () => setShowSearch(true)) diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 9e77e7f..de80d9c 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -57,7 +57,7 @@ const props = defineProps({ default: '', }, }) -const emit = defineEmits(['changeShow']) +const emit = defineEmits(['changeShow','goDetailx']) function changeContent() { emit('changeShow') } @@ -614,10 +614,8 @@ function validate(items: any[]) { } function goDetail(row) { - router.push({ - name: 'final-detail', - query: { id: row.id, packageid: row.packageid, taskindex: row.taskIndex, type: 'table' }, - }) + emit('goDetailx',{ id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'table' }) + } function resetHandler() { diff --git a/src/views/final/content/ListContent.vue b/src/views/final/content/ListContent.vue index b106352..a1a8322 100644 --- a/src/views/final/content/ListContent.vue +++ b/src/views/final/content/ListContent.vue @@ -21,8 +21,12 @@ const props = defineProps({ type: String, default: '', }, + asidevalue:{ + type:Object, + default:{} + } }) -const emit = defineEmits(['changeShow']) +const emit = defineEmits(['changeShow','goDetailx']) const aa = ref(true) const haeaderstore = useDataHeaderStore() const headerref = ref(null) @@ -239,10 +243,17 @@ function isValidTimestamp(value) { // 查看详情页 function goDetail(row) { - router.push({ + console.log(props.asidevalue.asideValue +) + const tempobj = cloneDeep(props.asidevalue.asideValue) + console.log('tempObj', tempobj) + finalStore.setAsideValue(tempobj) + + emit('goDetailx',{ id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'card' }) + /* router.push({ name: 'final-detail', query: { id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'card' }, - }) + })*/ } // 小结批量不通过 function repeatBatchReject(items) { diff --git a/src/views/final/index.vue b/src/views/final/index.vue index f866777..1178646 100644 --- a/src/views/final/index.vue +++ b/src/views/final/index.vue @@ -4,15 +4,19 @@ import Aside from './aside/Aside.vue' import Content from './content/Content.vue' import ListContent from './content/ListContent.vue' import Robot from '@/components/Robot/index.vue' +import Task from"@/views/task/content/Content.vue" + defineOptions({ name: 'FinalMain', }) const showList = ref(true) +const showDetail = ref(false) const contentRef: any = ref(null) const ListRef: any = ref(null) const asideref = ref(null) const taskvalue = ref('') +const detaiitem = ref({}) function inputChange(keyword) { if (asideref.value?.showSearch) taskvalue.value = keyword @@ -25,32 +29,50 @@ function inputChange(keyword) { else contentRef.value.filterTableData(keyword) } +function goDetailx(item){ + detaiitem.value=item + showDetail.value=true + if (item.type == 'table'){ + showList.value = false + } + else{ + showList.value = true + } + +} +function goBack(){ + showDetail.value=false +} onMounted(() => { - const searchParams = new URLSearchParams(window.location.search) - const type = searchParams.get('type') +// const searchParams = new URLSearchParams(window.location.search) + /* const type = searchParams.get('type') if (type == 'table') showList.value = false else showList.value = true -}) +*/})