Преглед на файлове

修改线上评论功能

Renxy преди 1 година
родител
ревизия
637b4d33a4
променени са 4 файла, в които са добавени 23 реда и са изтрити 7 реда
  1. 1 1
      .umirc.ts
  2. 6 2
      src/pages/Cad/components/CadOADetail.js
  3. 15 3
      src/pages/Cad/detail.js
  4. 1 1
      src/pages/Flow/OaAuditDetail.js

+ 1 - 1
.umirc.ts

@@ -47,7 +47,7 @@ export default defineConfig({
   proxy: {
     '/api': {
       // target: 'http://192.168.20.232:1007/',
-      target: 'http://47.96.12.136:8788/',
+      target: 'http://47.96.12.136:8895/',
       // target: 'https://work.greentech.com.cn/',
       changeOrigin: true,
     },

+ 6 - 2
src/pages/Cad/components/CadOADetail.js

@@ -1,8 +1,10 @@
 import AttachmentTable from '@/components/AttachmentTable';
 import { Card, Row, Col, Table } from 'antd';
-import { useRequest, useNavigate } from '@umijs/max';
+import { useRequest, useNavigate, useModel } from '@umijs/max';
 
 const CadOADetail = (props) => {
+  const { initialState } = useModel('@@initialState');
+  const user = initialState?.user || {};
   let navigate = useNavigate();
   const { data, fileList } = props;
 
@@ -10,7 +12,7 @@ const CadOADetail = (props) => {
     //item是 地址/图纸名称
     const names = item.split('/');
     const name = names?.length > 1 ? names[1] : names[0];
-    return { path: item, name };
+    return { path: item, name, project_id: data.project_id };
   });
 
   const columns = [
@@ -26,7 +28,9 @@ const CadOADetail = (props) => {
           onClick={() =>
             navigate('/cad/detail', {
               state: {
+                user,
                 path: record.path,
+                project_id: record.project_id,
               },
             })
           }

+ 15 - 3
src/pages/Cad/detail.js

@@ -17,6 +17,7 @@ const CadDeTail = () => {
   const {
     state: { path, user = {}, project_id },
   } = location;
+  console.log('---------------------------', path, user, project_id);
 
   //当前登录的用户信息
   let currentUser = {
@@ -160,16 +161,21 @@ const CadDeTail = () => {
             content: data.data.content,
             doc_id,
             parent_id: 0,
+            with_mark: data.data.withMark,
+            mark: data.data.mark,
           };
           runAdd(paramsAdd);
           break;
         case 'reply':
           const paramsReply = {
+            id: 0,
             project_id,
             user_name: user.CName,
             content: data.data.content,
             doc_id,
             parent_id: data.data.parentId,
+            with_mark: data.data.withMark,
+            mark: data.data.mark,
           };
           runAdd(paramsReply);
           break;
@@ -190,6 +196,8 @@ const CadDeTail = () => {
             content: data.data.content,
             doc_id,
             parent_id: 0,
+            with_mark: data.data.withMark,
+            mark: data.data.mark,
           };
           runAdd(paramsEdit);
           break;
@@ -200,7 +208,8 @@ const CadDeTail = () => {
   }, []);
 
   const getRows = (list) => {
-    return list.map((item) => {
+    if (!list || list?.length == 0) return [];
+    return list?.map((item) => {
       const {
         user_id,
         user_name,
@@ -208,6 +217,8 @@ const CadDeTail = () => {
         parent_id = 0,
         content,
         create_time,
+        mark,
+        with_mark,
         children,
       } = item;
       return {
@@ -222,8 +233,9 @@ const CadDeTail = () => {
         withAt: 'NO',
         withMark: 'NO',
         content,
-        mark: '',
-        replyList: children ? getRows(children) : [],
+        mark,
+        withMark: with_mark,
+        replyList: getRows(children),
       };
     });
   };

+ 1 - 1
src/pages/Flow/OaAuditDetail.js

@@ -85,7 +85,7 @@ function OaAuditDetail(props) {
   } = useRequest(queryCadInfo, {
     manual: true,
     formatResult: (res) => {
-      console.log(res);
+      console.log('--------66666666------------', res);
       return res?.data?.info;
     },
   });