Procházet zdrojové kódy

feat: 日志的修改

outaozhen před 4 roky
rodič
revize
ef050487a0

+ 42 - 11
src/pages/Customer/Client/components/ClientDetail/LowerList.jsx

@@ -1,6 +1,8 @@
-import { Tabs, List, Row, Col } from 'antd'
+import { Tabs, List, Row, Col, Table } from 'antd'
 import React from 'react'
 import { dayjsFormat } from '@/utils/utils'
+import consts from '@/consts'
+import { isDevMode } from '@/utils/env'
 
 export const servicelogEnum = {
   1: '上门服务',
@@ -15,6 +17,44 @@ const ClientLowerList = props => {
     servicelist
   } = props
   const { TabPane } = Tabs
+  const columns = [
+    {
+      title: '日期',
+      dataIndex: 'createTime',
+      key: 'createTime',
+      width: 100
+    },
+    {
+      title: '操作人',
+      dataIndex: 'operatorName',
+      key: 'operatorName',
+      width: 115,
+      render: (_, record) => (
+        <div className="flex items-center flex-row ml-2">
+          <img
+            className="w-full max-w-30px h-30px border rounded-30px"
+            src={
+              (isDevMode() ? 'http://cld2qa.com' : 'http://zhcld.com') +
+              (record?.avatar ?? consts.DEFAULT_AVATAR)
+            }
+          />
+          <span className="ml-1">{record.operatorName}</span>
+        </div>
+      )
+    },
+    {
+      title: '操作',
+      dataIndex: 'operationType',
+      key: 'operationType',
+      width: 75
+    },
+    {
+      title: '操作内容',
+      dataIndex: 'content',
+      key: 'content',
+      width: 150
+    }
+  ]
   return (
     <div>
       <div className="pl-4">
@@ -47,16 +87,7 @@ const ClientLowerList = props => {
           </TabPane>
           <TabPane tab="日志" key="日志">
             <div className="sheet-panel-record">
-              <List
-                dataSource={logs}
-                split={false}
-                renderItem={item => (
-                  <List.Item>
-                    <a>@{item.operatorName}</a> {item.content}
-                    <List.Item.Meta description={dayjsFormat(item.createTime)} />
-                  </List.Item>
-                )}
-              />
+              <Table rowKey="id" columns={columns} dataSource={logs} pagination={false} />
             </div>
           </TabPane>
         </Tabs>

+ 42 - 11
src/pages/Customer/Company/components/CompanyDetail/LowerList.jsx

@@ -1,5 +1,7 @@
-import { Tabs, List, Row, Col } from 'antd'
+import { Tabs, List, Row, Col, Table } from 'antd'
 import { dayjsFormat } from '@/utils/utils'
+import consts from '@/consts'
+import { isDevMode } from '@/utils/env'
 
 export const servicelogEnum = {
   1: '上门服务',
@@ -15,6 +17,44 @@ const CompanyLowerList = props => {
   } = props
 
   const { TabPane } = Tabs
+  const columns = [
+    {
+      title: '日期',
+      dataIndex: 'createTime',
+      key: 'createTime',
+      width: 100
+    },
+    {
+      title: '操作人',
+      dataIndex: 'operatorName',
+      key: 'operatorName',
+      width: 115,
+      render: (_, record) => (
+        <div className="flex items-center flex-row ml-2">
+          <img
+            className="w-full max-w-30px h-30px border rounded-30px"
+            src={
+              (isDevMode() ? 'http://cld2qa.com' : 'http://zhcld.com') +
+              (record?.avatar ?? consts.DEFAULT_AVATAR)
+            }
+          />
+          <span className="ml-1">{record.operatorName}</span>
+        </div>
+      )
+    },
+    {
+      title: '操作',
+      dataIndex: 'operationType',
+      key: 'operationType',
+      width: 75
+    },
+    {
+      title: '操作内容',
+      dataIndex: 'content',
+      key: 'content',
+      width: 150
+    }
+  ]
   return (
     <div>
       <div className="pl-4">
@@ -47,16 +87,7 @@ const CompanyLowerList = props => {
           </TabPane>
           <TabPane tab="日志" key="日志">
             <div className="sheet-panel-record">
-              <List
-                dataSource={logs}
-                split={false}
-                renderItem={item => (
-                  <List.Item>
-                    <a>@{item.operatorName}</a> {item.content}
-                    <List.Item.Meta description={dayjsFormat(item.createTime)} />
-                  </List.Item>
-                )}
-              />
+              <Table rowKey="id" columns={columns} dataSource={logs} pagination={false} />
             </div>
           </TabPane>
         </Tabs>

+ 42 - 11
src/pages/Product/Cloud/components/Detail/LowerList.jsx

@@ -1,6 +1,8 @@
 import React from 'react'
-import { Tabs, List, Row, Col } from 'antd'
+import { Tabs, List, Row, Col, Table } from 'antd'
 import { dayjsFormat } from '@/utils/utils'
+import consts from '@/consts'
+import { isDevMode } from '@/utils/env'
 import { servicelogEnum } from '@/pages/Customer/Client/components/ClientDetail/LowerList'
 
 const RoadpricingLowerList = props => {
@@ -9,6 +11,44 @@ const RoadpricingLowerList = props => {
     serviceLog
   } = props
   const { TabPane } = Tabs
+  const columns = [
+    {
+      title: '日期',
+      dataIndex: 'create_time',
+      key: 'create_time',
+      width: 100
+    },
+    {
+      title: '操作人',
+      dataIndex: 'operatorName',
+      key: 'operatorName',
+      width: 115,
+      render: (_, record) => (
+        <div className="flex items-center flex-row ml-2">
+          <img
+            className="w-full max-w-30px h-30px border rounded-30px"
+            src={
+              (isDevMode() ? 'http://cld2qa.com' : 'http://zhcld.com') +
+              (record?.avatar ?? consts.DEFAULT_AVATAR)
+            }
+          />
+          <span className="ml-1">{record.operatorName}</span>
+        </div>
+      )
+    },
+    {
+      title: '操作',
+      dataIndex: 'operationType',
+      key: 'operationType',
+      width: 75
+    },
+    {
+      title: '操作内容',
+      dataIndex: 'content',
+      key: 'content',
+      width: 150
+    }
+  ]
   return (
     <div>
       <div className="pl-4">
@@ -41,16 +81,7 @@ const RoadpricingLowerList = props => {
           </TabPane>
           <TabPane tab="日志" key="日志">
             <div className="sheet-panel-record">
-              <List
-                dataSource={log}
-                split={false}
-                renderItem={item => (
-                  <List.Item>
-                    <a>@{item.operatorName}</a> {item.content}
-                    <List.Item.Meta description={dayjsFormat(item.create_time)} />
-                  </List.Item>
-                )}
-              />
+              <Table rowKey="id" columns={columns} dataSource={log} pagination={false} />
             </div>
           </TabPane>
         </Tabs>

+ 42 - 12
src/pages/Product/Lock/LockStore/components/LockDetail/LowerList.jsx

@@ -1,27 +1,57 @@
-import { Tabs, List } from 'antd'
-import { dayjsFormat } from '@/utils/utils'
+import { Tabs, Table } from 'antd'
+import consts from '@/consts'
+import { isDevMode } from '@/utils/env'
 
 const LockLowerList = props => {
   const {
     log: { log: logs = [] }
   } = props
   const { TabPane } = Tabs
+  const columns = [
+    {
+      title: '日期',
+      dataIndex: 'createTime',
+      key: 'createTime',
+      width: 100
+    },
+    {
+      title: '操作人',
+      dataIndex: 'operatorName',
+      key: 'operatorName',
+      width: 115,
+      render: (_, record) => (
+        <div className="flex items-center flex-row ml-2">
+          <img
+            className="w-full max-w-30px h-30px border rounded-30px"
+            src={
+              (isDevMode() ? 'http://cld2qa.com' : 'http://zhcld.com') +
+              (record?.avatar ?? consts.DEFAULT_AVATAR)
+            }
+          />
+          <span className="ml-1">{record.operatorName}</span>
+        </div>
+      )
+    },
+    {
+      title: '操作',
+      dataIndex: 'operationType',
+      key: 'operationType',
+      width: 75
+    },
+    {
+      title: '操作内容',
+      dataIndex: 'content',
+      key: 'content',
+      width: 150
+    }
+  ]
   return (
     <div>
       <div className="pl-4">
         <Tabs>
           <TabPane tab="日志" key="日志">
             <div className="sheet-panel-record">
-              <List
-                dataSource={logs}
-                split={false}
-                renderItem={item => (
-                  <List.Item>
-                    <a>@{item.operatorName}</a> {item.content}
-                    <List.Item.Meta description={dayjsFormat(item.createTime)} />
-                  </List.Item>
-                )}
-              />
+              <Table rowKey="id" columns={columns} dataSource={logs} pagination={false} />
             </div>
           </TabPane>
         </Tabs>