mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 11: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_PAGE = "/userbasic/user/list post";
|
||||||
//学员列表 没有分页数据 只能通过名称检索 速度较快
|
// //学员列表 没有分页数据 只能通过名称检索 速度较快
|
||||||
export const USER_LIST = "/userbasic/user/searchList post";
|
// export const USER_LIST = "/userbasic/user/searchList post";
|
||||||
export const ORG_LIST = "/userbasic/org/list post";
|
// export const ORG_LIST = "/userbasic/org/list post";
|
||||||
export const ORG_CHILD_LIST = "/userbasic/org/info post";
|
// export const ORG_CHILD_LIST = "/userbasic/org/info post";
|
||||||
// export const AUDIENCE_LIST = '/userbasic/audience/list post'
|
// // export const AUDIENCE_LIST = '/userbasic/audience/list post'
|
||||||
//当前用户可以查看的受众接口
|
// //当前用户可以查看的受众接口
|
||||||
export const AUDIENCE_LIST = "/userbasic/audience/userAudiences post";
|
// export const AUDIENCE_LIST = "/userbasic/audience/userAudiences post";
|
||||||
export const USER_PERMISSION = "/userbasic/permission/listByUser post";
|
// export const USER_PERMISSION = "/userbasic/permission/listByUser post";
|
||||||
export const CASE_PAGE = "/systemapi/xboe/m/boe/cases/pagelist post formData";
|
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 EXAM_PAPER_PAGE = "/systemapi/xboe/m/exam/paper/querylist post formData";
|
||||||
export const TEST_PAGE = "/api/b1/system/quiz/quiz-list 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 = {
|
// export function useBoeApi(_url, params = {}, config = {
|
||||||
init: true,
|
// init: true,
|
||||||
result: res => res.result,
|
// result: res => res.result,
|
||||||
}) {
|
// }) {
|
||||||
|
|
||||||
const state = reactive({
|
// const state = reactive({
|
||||||
data: [],
|
// data: [],
|
||||||
loading: false,
|
// loading: false,
|
||||||
});
|
// });
|
||||||
watch(() => params, () => {
|
// watch(() => params, () => {
|
||||||
fetch();
|
// fetch();
|
||||||
});
|
// });
|
||||||
|
|
||||||
function fetch() {
|
// function fetch() {
|
||||||
state.loading = true;
|
// state.loading = true;
|
||||||
return boeRequest(_url, params).then(r => {
|
// return boeRequest(_url, params).then(r => {
|
||||||
state.data = config.result(r);
|
// state.data = config.result(r);
|
||||||
state.loading = false;
|
// state.loading = false;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
config.init && fetch();
|
// config.init && fetch();
|
||||||
return {
|
// return {
|
||||||
...toRefs(state),
|
// ...toRefs(state),
|
||||||
fetch,
|
// fetch,
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function useBoeUserListPage(_url, params = {}, init = true) {
|
// export function useBoeUserListPage(_url, params = {}, init = true) {
|
||||||
|
|
||||||
const state = reactive({
|
// const state = reactive({
|
||||||
data: [],
|
// data: [],
|
||||||
loading: false,
|
// loading: false,
|
||||||
total: 0,
|
// total: 0,
|
||||||
totalPage: 0,
|
// totalPage: 0,
|
||||||
page: 1,
|
// page: 1,
|
||||||
...params
|
// ...params
|
||||||
});
|
// });
|
||||||
|
|
||||||
watch(() => params.keyword, throttle(fetch, 600));
|
// watch(() => params.keyword, throttle(fetch, 600));
|
||||||
watch(() => params.page, fetch);
|
// watch(() => params.page, fetch);
|
||||||
|
|
||||||
function fetch() {
|
// function fetch() {
|
||||||
state.loading = true;
|
// state.loading = true;
|
||||||
if (!params.keyword) {
|
// if (!params.keyword) {
|
||||||
state.loading = false;
|
// state.loading = false;
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
return boeRequest(_url, params).then(r => {
|
// return boeRequest(_url, params).then(r => {
|
||||||
state.data = params.page === 1 ? r.result.userInfoList : [...state.data, ...r.result.userInfoList];
|
// state.data = params.page === 1 ? r.result.userInfoList : [...state.data, ...r.result.userInfoList];
|
||||||
state.totalPage = r.result.totalPage;
|
// state.totalPage = r.result.totalPage;
|
||||||
state.total = r.result.totalElement;
|
// state.total = r.result.totalElement;
|
||||||
state.loading = false;
|
// state.loading = false;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
|
||||||
init && fetch();
|
// init && fetch();
|
||||||
return {
|
// return {
|
||||||
...toRefs(state),
|
// ...toRefs(state),
|
||||||
fetch,
|
// fetch,
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
export function useNewRowsPageNoInit(_url, params) {
|
export function useNewRowsPageNoInit(_url, params) {
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
data: [],
|
data: [],
|
||||||
|
|||||||
@@ -74,8 +74,8 @@
|
|||||||
margin: 0px 4px 120px 10px;
|
margin: 0px 4px 120px 10px;
|
||||||
border: 1px solid #f0f0f0;
|
border: 1px solid #f0f0f0;
|
||||||
">
|
">
|
||||||
<BaseTable ref="stuTableRef" :columns="stuColumns" :url="USER_LIST_PAGE" pageKey="page"
|
<BaseTable ref="stuTableRef" :columns="stuColumns" :url="USER_LIST_PAGE" pageKey="pageNo"
|
||||||
:request="useBoeApiUserInfoPage" v-model:params="nameSearch" v-model:selectedRows="stuSelectRows"
|
:request="useNewRowsPageNoInit" v-model:params="nameSearch" v-model:selectedRows="stuSelectRows"
|
||||||
type="checkbox"></BaseTable>
|
type="checkbox"></BaseTable>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -128,8 +128,8 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="tableBox tabb">
|
<div class="tableBox tabb">
|
||||||
<BaseTable ref="auditTableRef" :columns="audiColums" :url="AUDIENCE_LIST" page-key="page"
|
<BaseTable ref="auditTableRef" :columns="audiColums" :url="AUDIENCE_LIST" page-key="pageNo"
|
||||||
:request="useBoeApiAuditPage" v-model:params="audienceName" v-model:selectedRows="auditSelectRows"
|
v-model:params="audienceName" v-model:selectedRows="auditSelectRows"
|
||||||
v-model:selectedRowKeys="auditSelectRowKeys" type="checkbox"></BaseTable>
|
v-model:selectedRowKeys="auditSelectRowKeys" type="checkbox"></BaseTable>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -311,16 +311,10 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { message } from "ant-design-vue";
|
import { message } from "ant-design-vue";
|
||||||
import { computed, defineEmits, defineProps, ref, watch, onMounted, reactive, nextTick } from "vue";
|
import { computed, defineEmits, defineProps, ref, watch, onMounted, reactive, nextTick } from "vue";
|
||||||
import { boeRequest, useBoeApi, useBoeApiPage, useBoeApiUserInfoPage, useBoeApiAuditPage } from "@/api/request";
|
import {useNewRowsPageNoInit, useBoeApiAuditPage,request,useRequest } from "@/api/request";
|
||||||
import {
|
|
||||||
ORG_CHILD_LIST,
|
|
||||||
ORG_LIST,
|
|
||||||
USER_LIST_PAGE,
|
|
||||||
AUDIENCE_LIST,
|
|
||||||
} from "@/api/ThirdApi";
|
|
||||||
import dialog from "@/utils/dialog";
|
import dialog from "@/utils/dialog";
|
||||||
|
import {AUDIENCE_LIST, ORG_CHILD_LIST, ORG_LIST, STUDENT_LIST, USER_LIST_PAGE} from "@/api/apis";
|
||||||
import BaseTable from "@/components/common/BaseTable";
|
import BaseTable from "@/components/common/BaseTable";
|
||||||
import { STUDENT_LIST } from "@/api/apis";
|
|
||||||
// 推荐接口
|
// 推荐接口
|
||||||
import { caseRecommend, userList } from '@/api/case'
|
import { caseRecommend, userList } from '@/api/case'
|
||||||
|
|
||||||
@@ -426,11 +420,11 @@ const searchOrgName = ref({
|
|||||||
});
|
});
|
||||||
const stageIds = computed(() => props.stage);
|
const stageIds = computed(() => props.stage);
|
||||||
|
|
||||||
const { data: orgData, fetch: searchOrg } = useBoeApiPage(
|
const { data: orgData, fetch: searchOrg } = useRequest(
|
||||||
ORG_LIST,
|
ORG_LIST,
|
||||||
searchOrgName.value
|
searchOrgName.value
|
||||||
);
|
);
|
||||||
const { data: treeData, loading: orgLoading } = useBoeApi(
|
const { data: treeData, loading: orgLoading } = useRequest(
|
||||||
ORG_LIST,
|
ORG_LIST,
|
||||||
{ keyword: "" },
|
{ keyword: "" },
|
||||||
{
|
{
|
||||||
@@ -438,7 +432,7 @@ const { data: treeData, loading: orgLoading } = useBoeApi(
|
|||||||
result: (res) => res.result.map((e) => ({ ...e, isLeaf: false })),
|
result: (res) => res.result.map((e) => ({ ...e, isLeaf: false })),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const { data: treeOrgData, loading: orgOrgLoading } = useBoeApi(
|
const { data: treeOrgData, loading: orgOrgLoading } = useRequest(
|
||||||
ORG_LIST,
|
ORG_LIST,
|
||||||
{ keyword: "" },
|
{ keyword: "" },
|
||||||
{
|
{
|
||||||
@@ -601,7 +595,7 @@ function searchAudi() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onLoadData(treeNode) {
|
function onLoadData(treeNode) {
|
||||||
return boeRequest(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
|
return request(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
|
||||||
(r) => {
|
(r) => {
|
||||||
treeNode.dataRef.treeChildList = r.result.directChildList;
|
treeNode.dataRef.treeChildList = r.result.directChildList;
|
||||||
treeData.value = [...treeData.value];
|
treeData.value = [...treeData.value];
|
||||||
@@ -610,7 +604,7 @@ function onLoadData(treeNode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onLoadOrgData(treeNode) {
|
function onLoadOrgData(treeNode) {
|
||||||
return boeRequest(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
|
return request(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
|
||||||
(r) => {
|
(r) => {
|
||||||
treeNode.dataRef.treeChildList = r.result.directChildList;
|
treeNode.dataRef.treeChildList = r.result.directChildList;
|
||||||
treeOrgData.value = [...treeOrgData.value];
|
treeOrgData.value = [...treeOrgData.value];
|
||||||
|
|||||||
Reference in New Issue
Block a user