zmh
2 years ago
4 changed files with 113 additions and 6 deletions
@ -1,7 +1,9 @@ |
|||
'use strict'; |
|||
|
|||
import * as example from './example' |
|||
import * as tags from './tags' |
|||
|
|||
export default { |
|||
...example, |
|||
...tags |
|||
} |
@ -0,0 +1,90 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
export function getTagList(params) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
dispatch: dispatch, |
|||
query: params, |
|||
actionType: 'GET_TAG_LIST', |
|||
url: ApiTable.getTags, |
|||
msg: { error: '获取标签列表失败' }, |
|||
reducer: { name: 'tagList' } |
|||
}); |
|||
} |
|||
|
|||
export function postTagSets(data) { |
|||
return dispatch => basicAction({ |
|||
type: 'post', |
|||
data: data, |
|||
dispatch: dispatch, |
|||
actionType: 'POST_TAG_SET', |
|||
url: ApiTable.postTagSets, |
|||
msg: { option: '新增标签集' }, |
|||
reducer: {} |
|||
}); |
|||
} |
|||
|
|||
export function putTagSets(id, data) { |
|||
return dispatch => basicAction({ |
|||
type: 'put', |
|||
data: data, |
|||
dispatch, |
|||
actionType: 'PUT_TAG_SET', |
|||
url: ApiTable.putTagSets.replace('{id}', id), |
|||
msg: { |
|||
option: '修改标签集', |
|||
} |
|||
}); |
|||
} |
|||
|
|||
export function delTagSets(id) { |
|||
return dispatch => basicAction({ |
|||
type: 'del', |
|||
dispatch, |
|||
actionType: 'DELETE_TAG_SET', |
|||
url: ApiTable.delTagSets.replace('{id}', id), |
|||
msg: { |
|||
option: '删除标签集', |
|||
} |
|||
}); |
|||
} |
|||
|
|||
export function postTags(data) { |
|||
return dispatch => basicAction({ |
|||
type: 'post', |
|||
data: data, |
|||
dispatch: dispatch, |
|||
actionType: 'POST_TAGS', |
|||
url: ApiTable.postTags, |
|||
msg: { option: '新增标签' }, |
|||
reducer: {} |
|||
}); |
|||
} |
|||
|
|||
export function putTags(id, data) { |
|||
return dispatch => basicAction({ |
|||
type: 'put', |
|||
data: data, |
|||
dispatch, |
|||
actionType: 'PUT_TAGS', |
|||
url: ApiTable.putTags.replace('{id}', id), |
|||
msg: { |
|||
option: '修改标签', |
|||
} |
|||
}); |
|||
} |
|||
|
|||
export function delTags(id) { |
|||
return dispatch => basicAction({ |
|||
type: 'del', |
|||
dispatch, |
|||
actionType: 'DELETE_TAGS', |
|||
url: ApiTable.delTags.replace('{id}', id), |
|||
msg: { |
|||
option: '删除标签', |
|||
} |
|||
}); |
|||
} |
@ -0,0 +1,7 @@ |
|||
.tags { |
|||
line-height: 26px; |
|||
background: rgb(228, 228, 228); |
|||
color: rgb(0, 0, 0); |
|||
margin-right: 20px; |
|||
margin-bottom: 16px; |
|||
} |
Loading…
Reference in new issue