diff --git a/web/client/src/sections/metadataManagement/actions/index.js b/web/client/src/sections/metadataManagement/actions/index.js index 444af37..3cf897c 100644 --- a/web/client/src/sections/metadataManagement/actions/index.js +++ b/web/client/src/sections/metadataManagement/actions/index.js @@ -1,7 +1,9 @@ 'use strict'; import * as example from './example' +import * as tags from './tags' export default { ...example, + ...tags } \ No newline at end of file diff --git a/web/client/src/sections/metadataManagement/actions/tags.js b/web/client/src/sections/metadataManagement/actions/tags.js new file mode 100644 index 0000000..c80258c --- /dev/null +++ b/web/client/src/sections/metadataManagement/actions/tags.js @@ -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: '删除标签', + } + }); +} \ No newline at end of file diff --git a/web/client/src/sections/metadataManagement/containers/style.less b/web/client/src/sections/metadataManagement/containers/style.less new file mode 100644 index 0000000..ffa8700 --- /dev/null +++ b/web/client/src/sections/metadataManagement/containers/style.less @@ -0,0 +1,7 @@ +.tags { + line-height: 26px; + background: rgb(228, 228, 228); + color: rgb(0, 0, 0); + margin-right: 20px; + margin-bottom: 16px; +} \ No newline at end of file diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 4e0a78d..521ea6b 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -2,13 +2,21 @@ import request from 'superagent'; export const ApiTable = { - login: 'login', - logout: 'logout', - validatePhone: 'validate/phone', - + login: 'login', + logout: 'logout', + validatePhone: 'validate/phone', + //标签管理 + getTags: 'tags', + postTagSets: 'tag-sets', + putTagSets: 'tag-sets/{id}', + delTagSets: 'tag-sets/{id}', + postTags: 'tags', + putTags: 'tags/{id}', + delTags: 'tags/{id}', + }; export const RouteTable = { - fileUpload: '/_upload/new', - cleanUpUploadTrash: '/_upload/cleanup', + fileUpload: '/_upload/new', + cleanUpUploadTrash: '/_upload/cleanup', };