ソースを参照

我的发布详情公告组件传参调整

Liuzhenyu 1 ヶ月 前
コミット
d7d714a053

+ 0 - 1
src/components/notificationDetailsParts/questionInformation.vue

@@ -317,7 +317,6 @@ onMounted(() => {
 	if (currentType.value === 'edit' || currentType.value === 'detail') {
 		fetchInformation();
 	} else if (currentType.value === 'add') {
-		formData.vesselType = 'bulkCarrier';
 	}
 });
 

+ 12 - 7
src/views/notificationInfoManage/myPublish/components/detail.vue

@@ -5,11 +5,11 @@
 		</div>
 
 		<!-- 发布单位信息 -->
-		<PublishUnitInformation :information="formData" class="mb20" />
+		<PublishUnitInformation :formData="formData" class="mb20" />
 		<!-- 涉事主体基本信息 -->
-		<QuestionInformation ref="shipFormRef" :information="formData" />
+		<QuestionInformation ref="shipFormRef" :formData="formData" />
 		<!-- 水上交通安全通报信息 -->
-		<WaterSafetyInformation ref="waterSafetyRef" :information="formData" />
+		<WaterSafetyInformation ref="waterSafetyRef" :formData="formData" />
 		<!-- 操作记录 -->
 		<OperationLog v-if="route.query.type !== 'add'" />
 		<!-- 底部按钮区 -->
@@ -30,7 +30,7 @@ import PublishUnitInformation from '@/components/notificationDetailsParts/publis
 import QuestionInformation from '@/components/notificationDetailsParts/questionInformation.vue';
 import WaterSafetyInformation from '@/components/notificationDetailsParts/waterSafetyInformation.vue';
 import OperationLog from '@/components/notificationDetailsParts/operationLog.vue';
-import { addMyPublishApi } from '@/api/notificationInfoManage/myPublish';
+import { addMyPublishApi, fetchReleaseDetail } from '@/api/notificationInfoManage/myPublish';
 // --- 路由与Store ---
 const route = useRoute();
 const router = useRouter();
@@ -43,9 +43,9 @@ const shipFormRef = ref<any>();
 const formData = ref()
 
 onMounted(async () => {
-	const { type, info } = route.query;
-	if (typeof info === 'string') {
-		formData.value = JSON.parse(info)
+	const { type, releasedId } = route.query;
+	if (releasedId) {
+		await onFetchDetail(releasedId)
 	}
 	try {
 		switch (type as string) {
@@ -82,6 +82,11 @@ const onClickSave = () => {
 	// TODO 保存的接口
 }
 
+const onFetchDetail = async (params) => {
+	const response = await fetchReleaseDetail(params)
+	formData.value = response.data
+};
+
 const handleSubmit = async (type) => {
 	const shipFormData = shipFormRef.value.getFormData();
 	const middleList = waterSafetyRef.value.getFormData();

+ 5 - 8
src/views/notificationInfoManage/myPublish/index.vue

@@ -111,20 +111,17 @@ const onClickNames = (id) => {
 	getNotificationMattersList(id)
 }
 
-const handleEdit = async (id: string) => {
-	const response = await fetchReleaseDetail(id)
+const handleEdit = async (releasedId: string) => {
 	router.push({
-    name: 'editPublish',
-    query: { type: 'edit', info: JSON.stringify(response.data) }
+    name: 'detailPublish',
+    query: { type: 'edit', releasedId }
   });
 };
 
-const handleDetails = async (id: string) => {
-	const response = await fetchReleaseDetail(id)
-	
+const handleDetails = async (releasedId: string) => {
 	router.push({
     name: 'detailPublish',
-    query: { type: 'detail', info: JSON.stringify(response.data) }
+    query: { type: 'detail', releasedId }
   });
 };
 

+ 1 - 1
src/views/notificationInfoManage/myReceptionDisposal/components/detail.vue

@@ -11,7 +11,7 @@
 		<!-- 水上交通安全通报信息 -->
 		<WaterSafetyInformation :formData="formData" ref="noticeChildRef" />
 		<!-- 操作记录 -->
-		<OperationLog />
+		<OperationLog  :formData="formData" />
 		<!-- 接收单位处置意见 如果需要反馈则隐藏 -->
 		<ReceivingUnitOpinion />
 		<!-- 接收单位处理意见 -->