mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 10:56:46 +08:00
案例推荐接口问题
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
//学员列表带分页
|
||||
export const USER_LIST_PAGE = "/userbasic/user/list post";
|
||||
//学员列表 没有分页数据 只能通过名称检索 速度较快
|
||||
export const USER_LIST = "/userbasic/user/searchList post";
|
||||
export const ORG_LIST = "/userbasic/org/list post";
|
||||
export const ORG_CHILD_LIST = "/userbasic/org/info post";
|
||||
// export const AUDIENCE_LIST = '/userbasic/audience/list post'
|
||||
//当前用户可以查看的受众接口
|
||||
export const AUDIENCE_LIST = "/userbasic/audience/userAudiences post";
|
||||
export const USER_PERMISSION = "/userbasic/permission/listByUser post";
|
||||
// export const USER_LIST_PAGE = "/userbasic/user/list post";
|
||||
// //学员列表 没有分页数据 只能通过名称检索 速度较快
|
||||
// export const USER_LIST = "/userbasic/user/searchList post";
|
||||
// export const ORG_LIST = "/userbasic/org/list post";
|
||||
// export const ORG_CHILD_LIST = "/userbasic/org/info post";
|
||||
// // export const AUDIENCE_LIST = '/userbasic/audience/list post'
|
||||
// //当前用户可以查看的受众接口
|
||||
// export const AUDIENCE_LIST = "/userbasic/audience/userAudiences post";
|
||||
// export const USER_PERMISSION = "/userbasic/permission/listByUser post";
|
||||
export const CASE_PAGE = "/systemapi/xboe/m/boe/cases/pagelist post formData";
|
||||
export const EXAM_PAPER_PAGE = "/systemapi/xboe/m/exam/paper/querylist post formData";
|
||||
export const TEST_PAGE = "/api/b1/system/quiz/quiz-list post formData";
|
||||
|
||||
@@ -80,68 +80,68 @@ export function useBoeApiPage(_url, params = {}, config = {
|
||||
};
|
||||
}
|
||||
|
||||
export function useBoeApi(_url, params = {}, config = {
|
||||
init: true,
|
||||
result: res => res.result,
|
||||
}) {
|
||||
// export function useBoeApi(_url, params = {}, config = {
|
||||
// init: true,
|
||||
// result: res => res.result,
|
||||
// }) {
|
||||
|
||||
const state = reactive({
|
||||
data: [],
|
||||
loading: false,
|
||||
});
|
||||
watch(() => params, () => {
|
||||
fetch();
|
||||
});
|
||||
// const state = reactive({
|
||||
// data: [],
|
||||
// loading: false,
|
||||
// });
|
||||
// watch(() => params, () => {
|
||||
// fetch();
|
||||
// });
|
||||
|
||||
function fetch() {
|
||||
state.loading = true;
|
||||
return boeRequest(_url, params).then(r => {
|
||||
state.data = config.result(r);
|
||||
state.loading = false;
|
||||
});
|
||||
}
|
||||
// function fetch() {
|
||||
// state.loading = true;
|
||||
// return boeRequest(_url, params).then(r => {
|
||||
// state.data = config.result(r);
|
||||
// state.loading = false;
|
||||
// });
|
||||
// }
|
||||
|
||||
config.init && fetch();
|
||||
return {
|
||||
...toRefs(state),
|
||||
fetch,
|
||||
};
|
||||
}
|
||||
// config.init && fetch();
|
||||
// return {
|
||||
// ...toRefs(state),
|
||||
// fetch,
|
||||
// };
|
||||
// }
|
||||
|
||||
export function useBoeUserListPage(_url, params = {}, init = true) {
|
||||
// export function useBoeUserListPage(_url, params = {}, init = true) {
|
||||
|
||||
const state = reactive({
|
||||
data: [],
|
||||
loading: false,
|
||||
total: 0,
|
||||
totalPage: 0,
|
||||
page: 1,
|
||||
...params
|
||||
});
|
||||
// const state = reactive({
|
||||
// data: [],
|
||||
// loading: false,
|
||||
// total: 0,
|
||||
// totalPage: 0,
|
||||
// page: 1,
|
||||
// ...params
|
||||
// });
|
||||
|
||||
watch(() => params.keyword, throttle(fetch, 600));
|
||||
watch(() => params.page, fetch);
|
||||
// watch(() => params.keyword, throttle(fetch, 600));
|
||||
// watch(() => params.page, fetch);
|
||||
|
||||
function fetch() {
|
||||
state.loading = true;
|
||||
if (!params.keyword) {
|
||||
state.loading = false;
|
||||
return;
|
||||
}
|
||||
return boeRequest(_url, params).then(r => {
|
||||
state.data = params.page === 1 ? r.result.userInfoList : [...state.data, ...r.result.userInfoList];
|
||||
state.totalPage = r.result.totalPage;
|
||||
state.total = r.result.totalElement;
|
||||
state.loading = false;
|
||||
});
|
||||
}
|
||||
// function fetch() {
|
||||
// state.loading = true;
|
||||
// if (!params.keyword) {
|
||||
// state.loading = false;
|
||||
// return;
|
||||
// }
|
||||
// return boeRequest(_url, params).then(r => {
|
||||
// state.data = params.page === 1 ? r.result.userInfoList : [...state.data, ...r.result.userInfoList];
|
||||
// state.totalPage = r.result.totalPage;
|
||||
// state.total = r.result.totalElement;
|
||||
// state.loading = false;
|
||||
// });
|
||||
// }
|
||||
|
||||
init && fetch();
|
||||
return {
|
||||
...toRefs(state),
|
||||
fetch,
|
||||
};
|
||||
}
|
||||
// init && fetch();
|
||||
// return {
|
||||
// ...toRefs(state),
|
||||
// fetch,
|
||||
// };
|
||||
// }
|
||||
export function useNewRowsPageNoInit(_url, params) {
|
||||
const state = reactive({
|
||||
data: [],
|
||||
|
||||
Reference in New Issue
Block a user