From ef44f648613b11e7fda7a412845c84222c890f68 Mon Sep 17 00:00:00 2001 From: Maple <869445424@qq.com> Date: Thu, 14 Aug 2025 16:42:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E6=96=BD=E5=B7=A5=E7=AB=8B=E9=A1=B9?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=86=85=E5=AE=B9=E4=B8=AD=EF=BC=8C=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=AF=A6=E6=83=85=E5=88=9D=E6=AD=A5=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E8=BF=98=E5=AD=98=E5=9C=A8=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/auto-imports.d.ts | 2 +- src/views/project/TurbineCard.vue | 62 ++++++++++++------------ src/views/project/index.vue | 79 +++++++++++++++++++++++++++---- 3 files changed, 104 insertions(+), 39 deletions(-) diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 369aad4..eab6be6 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -70,6 +70,6 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' import('vue') } diff --git a/src/views/project/TurbineCard.vue b/src/views/project/TurbineCard.vue index 70764b9..bf02fef 100644 --- a/src/views/project/TurbineCard.vue +++ b/src/views/project/TurbineCard.vue @@ -3,22 +3,22 @@ import { computed } from 'vue' import WindTurbine from './icons/WindTurbine.vue' interface Turbine { - id: number - turbineNo: string - status: 0 | 1 | 2 // 0 待施工 1 施工中 2 已完成 - lat?: number - lng?: number + id: number + turbineNo: string + status: 0 | 1 | 2 // 0 待施工 1 施工中 2 已完成 + lat?: number + lng?: number } const props = defineProps<{ modelValue: Turbine }>() const emit = defineEmits<{ - (e: 'update:modelValue', v: Turbine): void - (e: 'map'): void + (e: 'update:modelValue', v: Turbine): void + (e: 'map'): void }>() const turbine = computed({ - get: () => props.modelValue, - set: v => emit('update:modelValue', v) + get: () => props.modelValue, + set: (v) => emit('update:modelValue', v), }) /* 状态文字 & 颜色 */ @@ -27,34 +27,36 @@ const statusColorMap = { 0: '#FF7D00', 1: '#165DFF', 2: '#00B42A' } /* 点击循环切换 */ function toggleStatus() { - const next = ((turbine.value.status + 1) % 3) as 0 | 1 | 2 - turbine.value = { ...turbine.value, status: next } + const next = ((turbine.value.status + 1) % 3) as 0 | 1 | 2 + turbine.value = { ...turbine.value, status: next } } function updateNo(val: string) { - turbine.value = { ...turbine.value, turbineNo: val } + turbine.value = { ...turbine.value, turbineNo: val } } \ No newline at end of file + diff --git a/src/views/project/index.vue b/src/views/project/index.vue index 3c7d76f..3cd052d 100644 --- a/src/views/project/index.vue +++ b/src/views/project/index.vue @@ -347,6 +347,53 @@ + + + + + + {{ detailData.projectName || '-' }} + {{ detailData.projectCode || '-' }} + + + {{ PROJECT_STATUS_MAP[detailData.status] || detailData.statusLabel || '-' }} + + + {{ detailData.projectCategory || '-' }} + + {{ detailData.inspectionUnit || '-' }} + {{ detailData.inspectionContact || '-' }} + {{ detailData.inspectionPhone || '-' }} + + {{ detailData.client || '-' }} + {{ detailData.clientContact || '-' }} + {{ detailData.clientPhone || '-' }} + + {{ detailData.farmName || '-' }} + {{ detailData.farmAddress || '-' }} + + {{ detailData.projectManagerName || '-' }} + {{ detailData.scale || detailData.projectScale || '-' }} + {{ detailData.turbineModel || '-' }} + + {{ detailData.startDate || '-' }} + {{ detailData.endDate || '-' }} + + + + {{ detailData.projectIntro || '-' }} + + + + + + @@ -412,6 +459,12 @@ const dataList = ref([]) const userLoading = ref(false) const userOptions = ref<{ label: string, value: string }[]>([]) + +// 详情弹窗状态 +const detailVisible = ref(false) +const detailLoading = ref(false) +const detailData = ref({}) + const searchForm = reactive>({ projectName: '', status: undefined, @@ -979,19 +1032,29 @@ const deleteItem = async (record: T.ProjectResp) => { } } -const viewDetail = (record: T.ProjectResp) => { +const viewDetail = async (record: T.ProjectResp) => { const projectId = record.id || record.projectId if (!projectId) { Message.error('项目ID不存在') return } - - router.push({ - name: 'ProjectDetail', - params: { - id: projectId.toString(), - }, - }) + detailVisible.value = true + detailLoading.value = true + try { + // /project/detail/{projectId} + const res = await getProjectDetail(projectId) + const data = (res as any).data || res || {} + // 若后端返回status为数字,补充状态文案 + if (typeof data.status === 'number' && !data.statusLabel) { + data.statusLabel = PROJECT_STATUS_MAP[data.status] + } + detailData.value = data + } catch (e) { + console.error('获取项目详情失败:', e) + Message.error('获取项目详情失败') + } finally { + detailLoading.value = false + } } const openImportModal = () => { From cce71885b844fc43b1944a95dfdd6aa1ceb70215 Mon Sep 17 00:00:00 2001 From: chabai <14799297+dhasjklhdfjkasfbhfasfj@user.noreply.gitee.com> Date: Thu, 14 Aug 2025 17:09:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8C=89=E7=85=A7=E8=A6=81=E6=B1=82?= =?UTF-8?q?=E5=B0=86=E5=8E=9F=E6=9C=AC=E7=9A=84=E6=95=B0=E6=8D=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=E6=94=BE=E5=88=B0=E2=80=9C=E6=88=91?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E4=BD=9C=E5=8F=B0=E2=80=9D=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E9=87=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/route.ts | 102 ++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/router/route.ts b/src/router/route.ts index ddc8ced..c632539 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -906,12 +906,61 @@ export const systemRoutes: RouteRecordRaw[] = [ }, ], }, - // start + + { + path: '/construction-operation-platform', + name: 'ConstructionOperationPlatform', + component: Layout, + redirect: '/construction-operation-platform/implementation-workflow/field-construction', + meta: { title: '我的工作台', icon: 'tool', hidden: false, sort: 5 }, + children: [ + // { + // path: '/construction-operation-platform/implementation-workflow', + // name: 'ImplementationWorkflow', + // component: () => import('@/components/ParentView/index.vue'), + // redirect: '/construction-operation-platform/implementation-workflow/field-construction', + // meta: { title: '项目实施工作流程', icon: 'fork', hidden: false }, + // children: [ + { + path: '/construction-operation-platform/implementation-workflow/data-processing/data-storage/attachment', + name: 'AttachmentManagement', + component: () => import('@/views/construction-operation-platform/implementation-workflow/data-processing/data-storage/index.vue'), + meta: { title: '附件管理', icon: 'attachment', hidden: false }, + }, + { + path: '/construction-operation-platform/implementation-workflow/data-processing/model-config', + name: 'ModelConfig', + component: () => import('@/views/construction-operation-platform/implementation-workflow/data-processing/model-config/index.vue'), + meta: { title: '模型配置', icon: 'robot', hidden: false }, + }, + { + path: '/construction-operation-platform/implementation-workflow/field-construction', + name: 'FieldConstruction', + component: () => import('@/components/ParentView/index.vue'), + redirect: '/construction-operation-platform/implementation-workflow/field-construction/project-list', + meta: { title: '我的项目', icon: 'construction', hidden: false }, + children: [ + { + path: '/project-management/projects/list', + name: 'ProjectList', + component: () => import('@/views/project-management/projects/list/index.vue'), + meta: { + title: '项目列表', + icon: 'unordered-list', + hidden: false, + }, + }, + { + path: '/construction-operation-platform/implementation-workflow/field-construction/technology', + name: 'FieldConstructionTechnology', + component: () => import('@/views/project-operation-platform/implementation-workflow/field-construction/project-list/index.vue'), + meta: { title: '我的施工', icon: 'tool', hidden: false }, + }, + // start // 数据管理 { path: '/data-management', name: 'DataManagement', - component: Layout, redirect: '/data-management/project-management/project-template', meta: { title: '数据管理', icon: 'database', hidden: false, sort: 4 }, children: [ @@ -1027,55 +1076,6 @@ export const systemRoutes: RouteRecordRaw[] = [ ], }, // end - { - path: '/construction-operation-platform', - name: 'ConstructionOperationPlatform', - component: Layout, - redirect: '/construction-operation-platform/implementation-workflow/field-construction', - meta: { title: '我的工作台', icon: 'tool', hidden: false, sort: 5 }, - children: [ - // { - // path: '/construction-operation-platform/implementation-workflow', - // name: 'ImplementationWorkflow', - // component: () => import('@/components/ParentView/index.vue'), - // redirect: '/construction-operation-platform/implementation-workflow/field-construction', - // meta: { title: '项目实施工作流程', icon: 'fork', hidden: false }, - // children: [ - { - path: '/construction-operation-platform/implementation-workflow/data-processing/data-storage/attachment', - name: 'AttachmentManagement', - component: () => import('@/views/construction-operation-platform/implementation-workflow/data-processing/data-storage/index.vue'), - meta: { title: '附件管理', icon: 'attachment', hidden: false }, - }, - { - path: '/construction-operation-platform/implementation-workflow/data-processing/model-config', - name: 'ModelConfig', - component: () => import('@/views/construction-operation-platform/implementation-workflow/data-processing/model-config/index.vue'), - meta: { title: '模型配置', icon: 'robot', hidden: false }, - }, - { - path: '/construction-operation-platform/implementation-workflow/field-construction', - name: 'FieldConstruction', - component: () => import('@/components/ParentView/index.vue'), - redirect: '/construction-operation-platform/implementation-workflow/field-construction/project-list', - meta: { title: '我的项目', icon: 'construction', hidden: false }, - children: [ - { - path: '/project-management/projects/list', - name: 'ProjectList', - component: () => import('@/views/project-management/projects/list/index.vue'), - meta: { - title: '项目列表', - icon: 'unordered-list', - hidden: false, - }, - }, - { - path: '/construction-operation-platform/implementation-workflow/field-construction/technology', - name: 'FieldConstructionTechnology', - component: () => import('@/views/project-operation-platform/implementation-workflow/field-construction/project-list/index.vue'), - meta: { title: '我的施工', icon: 'tool', hidden: false }, - }, { path: '/construction-operation-platform/implementation-workflow/project-delivery', name: 'ProjectDelivery',