|
@@ -80,7 +80,7 @@ const columns = [
|
80
|
80
|
dataIndex: '',
|
81
|
81
|
key: '',
|
82
|
82
|
align: 'center',
|
83
|
|
- render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toedit(record.channelId)} >编辑</a>,
|
|
83
|
+ render: (text, record) => <a style={{ color: '#66B3FF' }} onClick={() => toedit(record.channelId)} >编辑</a>,
|
84
|
84
|
},
|
85
|
85
|
];
|
86
|
86
|
|
|
@@ -93,16 +93,16 @@ function toAdd() {
|
93
|
93
|
},
|
94
|
94
|
});
|
95
|
95
|
}
|
96
|
|
- // 跳编辑页面
|
97
|
|
- function toedit(channelId) {
|
98
|
|
- // alert(channelId)
|
99
|
|
- router.push({
|
100
|
|
- pathname: '/channel/editChannel',
|
101
|
|
- query: {
|
102
|
|
- id: channelId,
|
103
|
|
- },
|
104
|
|
- });
|
105
|
|
- }
|
|
96
|
+// 跳编辑页面
|
|
97
|
+function toedit(channelId) {
|
|
98
|
+ // alert(channelId)
|
|
99
|
+ router.push({
|
|
100
|
+ pathname: '/channel/editChannel',
|
|
101
|
+ query: {
|
|
102
|
+ id: channelId,
|
|
103
|
+ },
|
|
104
|
+ });
|
|
105
|
+}
|
106
|
106
|
|
107
|
107
|
const header = props => {
|
108
|
108
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
@@ -118,11 +118,11 @@ const header = props => {
|
118
|
118
|
url: '/api/admin/channel',
|
119
|
119
|
method: 'GET',
|
120
|
120
|
params: { ...params },
|
121
|
|
- // eslint-disable-next-line no-shadow
|
122
|
|
- }).then(data => {
|
|
121
|
+ // eslint-disable-next-line no-shadow
|
|
122
|
+ }).then(data => {
|
123
|
123
|
console.log(data)
|
124
|
124
|
setData(data)
|
125
|
|
- })
|
|
125
|
+ })
|
126
|
126
|
}
|
127
|
127
|
// value 的值
|
128
|
128
|
function handleChange(value) {
|
|
@@ -133,25 +133,25 @@ const header = props => {
|
133
|
133
|
function queryList() {
|
134
|
134
|
getList({ pageNum: 1, pageSize: 10, channelId: localStorage.getItem('value') })
|
135
|
135
|
}
|
136
|
|
- // 重置
|
137
|
|
- function reset() {
|
138
|
|
- getList({ pageNum: 1, pageSize: 10 })
|
139
|
|
- }
|
|
136
|
+ // 重置
|
|
137
|
+ function reset() {
|
|
138
|
+ getList({ pageNum: 1, pageSize: 10 })
|
|
139
|
+ }
|
140
|
140
|
|
141
|
|
- // 跳编辑页
|
142
|
|
- function toEdit() {
|
143
|
|
- router.push({
|
144
|
|
- pathname: '/integralMall/editGoods',
|
145
|
|
- query: {
|
146
|
|
- a: 'b',
|
147
|
|
- },
|
148
|
|
- });
|
149
|
|
-}
|
|
141
|
+ // 跳编辑页
|
|
142
|
+ function toEdit() {
|
|
143
|
+ router.push({
|
|
144
|
+ pathname: '/integralMall/editGoods',
|
|
145
|
+ query: {
|
|
146
|
+ a: 'b',
|
|
147
|
+ },
|
|
148
|
+ });
|
|
149
|
+ }
|
150
|
150
|
|
151
|
151
|
// 分页
|
152
|
152
|
function onChange(pageNumber) {
|
153
|
153
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
154
|
|
- getList({ pageNum: pageNumber, pageSize: 9 })
|
|
154
|
+ getList({ pageNum: pageNumber, pageSize: 9 })
|
155
|
155
|
}
|
156
|
156
|
|
157
|
157
|
return (
|
|
@@ -160,21 +160,21 @@ const header = props => {
|
160
|
160
|
<div>
|
161
|
161
|
<span className={channels.selectName}>渠道名称</span>
|
162
|
162
|
<Select defaultValue="请选择" style={{ width: 180 }} onChange={handleChange}>
|
163
|
|
- <option value="">全部</option>
|
164
|
|
- {data.channelNmae.map(Item =>
|
165
|
|
- <Option value={ Item.channelId }> { Item.channelName } </Option>,
|
166
|
|
- )}
|
167
|
|
- {/* {listItems} */}
|
|
163
|
+ <option value="">全部</option>
|
|
164
|
+ {data.channelNmae.map(Item =>
|
|
165
|
+ <Option value={Item.channelId}> {Item.channelName} </Option>,
|
|
166
|
+ )}
|
|
167
|
+ {/* {listItems} */}
|
168
|
168
|
</Select>
|
169
|
169
|
</div>
|
170
|
170
|
<div >
|
171
|
|
- <Button type="primary" onClick={() => queryList() }>查询</Button>
|
172
|
|
- {/* <Button onClick={() => reset() }>重置</Button> */}
|
|
171
|
+ <Button type="primary" onClick={() => queryList()}>查询</Button>
|
|
172
|
+ {/* <Button onClick={() => reset() }>重置</Button> */}
|
173
|
173
|
</div>
|
174
|
174
|
</div>
|
175
|
175
|
<Button type="danger" onClick={toAdd} className={channels.about} >新增</Button>
|
176
|
176
|
<Table dataSource={data.result.records} columns={columns} pagination={{ pageSize: 10, total: data.result.total, onChange }} />
|
177
|
|
- </>
|
|
177
|
+ </>
|
178
|
178
|
)
|
179
|
179
|
}
|
180
|
180
|
|