浏览代码

标题跳转

魏超 5 年前
父节点
当前提交
a36af570e9
共有 3 个文件被更改,包括 7 次插入4 次删除
  1. 2
    1
      src/pages/channel/channelList.jsx
  2. 3
    2
      src/pages/news/list/NewsList.jsx
  3. 2
    1
      src/pages/news/type/NewsType.jsx

+ 2
- 1
src/pages/channel/channelList.jsx 查看文件

8
 import apis from '../../services/apis';
8
 import apis from '../../services/apis';
9
 import request from '../../utils/request';
9
 import request from '../../utils/request';
10
 import channels from './channelList.less';
10
 import channels from './channelList.less';
11
+import Navigate from '@/components/Navigate';
11
 
12
 
12
 const columns = [
13
 const columns = [
13
   // {
14
   // {
23
     dataIndex: 'channelCode',
24
     dataIndex: 'channelCode',
24
     key: 'channelCode',
25
     key: 'channelCode',
25
     align: 'center',
26
     align: 'center',
26
-    render: text => <a>{text}</a>,
27
   },
27
   },
28
   {
28
   {
29
     title: '渠道名称',
29
     title: '渠道名称',
30
     dataIndex: 'channelName',
30
     dataIndex: 'channelName',
31
     key: 'channelName',
31
     key: 'channelName',
32
     align: 'center',
32
     align: 'center',
33
+    render: (text, record) => <Navigate to={`/channel/editChannel?id=${record.channelId}`}>{text}</Navigate>
33
   },
34
   },
34
   {
35
   {
35
     title: '联系人',
36
     title: '联系人',

+ 3
- 2
src/pages/news/list/NewsList.jsx 查看文件

13
 
13
 
14
 import AuthButton from '@/components/AuthButton';
14
 import AuthButton from '@/components/AuthButton';
15
 import EditIcon from '@/components/EditIcon';
15
 import EditIcon from '@/components/EditIcon';
16
+import Navigate from '@/components/Navigate';
16
 
17
 
17
 
18
 
18
 const { Option } = Select;
19
 const { Option } = Select;
188
 
189
 
189
     return (
190
     return (
190
       <Card
191
       <Card
191
-        hoverable
192
+        // hoverable
192
         style={{ height: '230px', minWidth: '570px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)', position: 'relative' }}
193
         style={{ height: '230px', minWidth: '570px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)', position: 'relative' }}
193
         cover={<img alt="example" src={data.newsImg} style={{ borderRadius: '12px 0 0 12px', width: '230px', height: '228px' }}></img>}
194
         cover={<img alt="example" src={data.newsImg} style={{ borderRadius: '12px 0 0 12px', width: '230px', height: '228px' }}></img>}
194
         bodyStyle={{ padding: '10px 20px' }}
195
         bodyStyle={{ padding: '10px 20px' }}
223
             textOverflow: 'ellipsis',
224
             textOverflow: 'ellipsis',
224
             whiteSpace: 'nowrap',
225
             whiteSpace: 'nowrap',
225
             width: '75%',
226
             width: '75%',
226
-          }}>{data.newsName}</p>
227
+          }}><Navigate to={`/news/list/editNewsList?newsId=${data.newsId}`}>{data.newsName}</Navigate></p>
227
           <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex' }}>
228
           <p style={{ fontSize: ' 0.106rem', color: '#555', marginBottom: '8px', display: 'flex' }}>
228
             <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>资讯类型:{data.newsType.newsTypeName}</span>
229
             <span style={{ display: 'inline-block', width: '50%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>资讯类型:{data.newsType.newsTypeName}</span>
229
             <span>状态:{data.newsStatus == 0 ? "已发布" : "未发布"}</span>
230
             <span>状态:{data.newsStatus == 0 ? "已发布" : "未发布"}</span>

+ 2
- 1
src/pages/news/type/NewsType.jsx 查看文件

8
 import request from '../../../utils/request'
8
 import request from '../../../utils/request'
9
 import BuildSelect from '../../../components/SelectButton/BuildSelect';
9
 import BuildSelect from '../../../components/SelectButton/BuildSelect';
10
 import styles from '../../style/GoodsList.less';
10
 import styles from '../../style/GoodsList.less';
11
+import Navigate from '@/components/Navigate';
11
 
12
 
12
 function NewsType(props) {
13
 function NewsType(props) {
13
   // 获取初始化数据
14
   // 获取初始化数据
92
       dataIndex: 'newsTypeName',
93
       dataIndex: 'newsTypeName',
93
       key: 'newsTypeName',
94
       key: 'newsTypeName',
94
       align: 'center',
95
       align: 'center',
95
-
96
+      render: (text, record) => <Navigate to={`/news/type/editNews?id=${record.newsTypeId}`}>{text}</Navigate>
96
     },
97
     },
97
     {
98
     {
98
       title: '操作',
99
       title: '操作',