|
@@ -11,7 +11,8 @@ const api = {
|
|
|
contentsFetch: '/api/cms/contents/fetch',
|
|
|
pagesFetch: '/api/cms/pages/fetch',
|
|
|
imgNewsFetch: '/api/cms/imgnews/fetch',
|
|
|
- sourceQuery: '/api/code/dictionary/query'
|
|
|
+ sourceQuery: '/api/code/dictionary/query',
|
|
|
+ search: '/api/cms/contents/search'
|
|
|
};
|
|
|
|
|
|
const state = () => ({
|
|
@@ -26,10 +27,16 @@ const state = () => ({
|
|
|
contentsItem: null,
|
|
|
pagesItem: null,
|
|
|
upwindow: [],
|
|
|
- dict: {}
|
|
|
+ dict: {},
|
|
|
+ searchList: []
|
|
|
});
|
|
|
|
|
|
const actions = {
|
|
|
+ async search ({ commit }, { search }) {
|
|
|
+ const res = await $axios.get(api.search, { search });
|
|
|
+ commit('searchQuery', res);
|
|
|
+ return res;
|
|
|
+ },
|
|
|
async sourceQuery ({ commit }) {
|
|
|
const res = await $axios.get(api.sourceQuery, { parentCode: 'source' });
|
|
|
commit('sourceQuery', res);
|
|
@@ -105,6 +112,9 @@ const actions = {
|
|
|
};
|
|
|
|
|
|
const mutations = {
|
|
|
+ searchQuery(state, payload) {
|
|
|
+ state.searchList = payload.data;
|
|
|
+ },
|
|
|
sourceQuery(state, payload) {
|
|
|
state.dict.source = payload.data;
|
|
|
},
|