From f902de804426e203bb6ee20045fad07063adc13b Mon Sep 17 00:00:00 2001 From: "BOE\\10867418" Date: Fri, 18 Aug 2023 17:49:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/indexOvervoew.js | 2 +- src/api/indexProject.js | 2 +- src/views/report/Curriculum.vue | 31 +++++++++++++++------------- src/views/report/Learningpathmap.vue | 15 +++++++------- src/views/report/ReportProject.vue | 29 +++++++++++++++----------- 5 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/api/indexOvervoew.js b/src/api/indexOvervoew.js index 1d4353c8..933110f7 100644 --- a/src/api/indexOvervoew.js +++ b/src/api/indexOvervoew.js @@ -8,7 +8,7 @@ export const boeuExamPageList = (obj) => http.post('/boeu/exam/pageList', obj) //概览页面案例列表请求接口 export const boeuCasePageList = (obj) => http.post('/boeu/case/pageList', obj) // 请求组织接口 -export const userGetUserOrg = (obj) => http.post('/org/getUserOrg', obj) +export const userGetUserOrg = (obj) => https.get(`/organization/all/tree`,obj) // 请求所属组织接口 export const userInfo = (obj) => https.post('/user/info', obj) // 课程列表接口 diff --git a/src/api/indexProject.js b/src/api/indexProject.js index e3aafe5f..1b465964 100644 --- a/src/api/indexProject.js +++ b/src/api/indexProject.js @@ -1,7 +1,7 @@ import http from "./configz"; import https from './confign' // 请求组织接口 -export const userGetUserOrg = (obj) => https.post('/user/getUserOrg', obj) +export const userGetUserOrg = (obj) => http.post('/org/getUserOrg', obj) // 请求所属组织接口 export const userInfo = (obj) => https.post('/user/info', obj) // 项目列表 diff --git a/src/views/report/Curriculum.vue b/src/views/report/Curriculum.vue index f12da051..e22895d8 100644 --- a/src/views/report/Curriculum.vue +++ b/src/views/report/Curriculum.vue @@ -21,9 +21,9 @@ :allowClear="allowClear" style="width: 100%" :fieldNames="{ - label: 'name', - value: 'id', - children: 'treeChildList', + label: 'orgName', + value: 'organizationId', + children: 'childList', }" > @@ -141,9 +141,11 @@ import axios from "axios"; import Cookies from "vue-cookies"; import downLoad from "../../utils/downLoad"; import { message } from "ant-design-vue"; +import {useStore} from 'vuex' export default { name: "CurriculuM", setup() { + const store = useStore(); const state = reactive({ tableLoading: false, // table加载图标 tableDataTotal: 0, // 数据总条数 @@ -168,15 +170,16 @@ export default { const getOption = async () => {}; //请求组织接口 const getOrgList = async () => { - const result = await api.userGetUserOrg({}); - - if (result) { - state.option = result.data?.result?.list; - state.orgId = result.data?.result?.treeNodeList; - state.resetOrgId = result.data?.result?.treeNodeList; - result.data?.result?.userType === 1 - ? (state.allowClear = true) - : (state.allowClear = false); + let params = { + roleList: store.state.userInfo.roleList, + userId: store.state.userInfo.userId + } + const res = await api.userGetUserOrg(params); + if (res) { + state.option = res.data?.result; + state.orgId = [state.option[0]?.organizationId]; + state.resetOrgId = [state.option[0]?.organizationId]; + state.allowClear = true getTableData(); } }; @@ -194,8 +197,8 @@ export default { }; const res = await api.boeuCourseListPageV2(params); if (res) { - tableData.value = res.data.rows; - state.tableDataTotal = res.data.total; + tableData.value = res.data.result.rows; + state.tableDataTotal = res.data.result.total; state.tableLoading = false; } }; diff --git a/src/views/report/Learningpathmap.vue b/src/views/report/Learningpathmap.vue index 6f040d21..9cd646bb 100644 --- a/src/views/report/Learningpathmap.vue +++ b/src/views/report/Learningpathmap.vue @@ -5,6 +5,7 @@
{ - let params = { - roleList: store.state.userInfo.roleList, - userId: store.state.userInfo.userId - } - const res = await api.userGetUserOrg(params); + //todo 获取用户角色列表,判断里面是否有system-admin + // let roleList = store.state.userInfo.roleList; + const res = await api.userGetUserOrg(); if (res) { state.option = res.data?.result; - state.orgId = state.option[0]?.organizationId; - state.resetOrgId = state.option[0]?.organizationId; - state.allowClear = false + state.orgId = [state.option[0]?.organizationId]; + state.resetOrgId = [state.option[0]?.organizationId]; + state.allowClear = true; getTableData(); } }; diff --git a/src/views/report/ReportProject.vue b/src/views/report/ReportProject.vue index e426a46f..18b28a37 100644 --- a/src/views/report/ReportProject.vue +++ b/src/views/report/ReportProject.vue @@ -21,9 +21,9 @@ :allowClear="allowClear" style="width: 100%" :fieldNames="{ - label: 'name', - value: 'id', - children: 'treeChildList', + label: 'orgName', + value: 'organizationId', + children: 'childList', }" > @@ -169,9 +169,11 @@ import axios from "axios"; import Cookies from "vue-cookies"; import downLoad from "../../utils/downLoad"; import { message } from "ant-design-vue"; +import { useStore } from "vuex"; export default { name: "reportProject", setup() { + const store = useStore(); const state = reactive({ tableLoading: false, // table加载图标 tableDataTotal: 0, // 数据总条数 @@ -290,14 +292,16 @@ export default { }; //请求组织接口 const getOrgList = async () => { - const res = await api.userGetUserOrg({}); + let params = { + roleList: store.state.userInfo.roleList, + userId: store.state.userInfo.userId + } + const res = await api.userGetUserOrg(params); if (res) { - state.option = res.data?.result?.list; - state.orgId = res.data?.result?.treeNodeList; - state.resetOrgId = res.data?.result?.treeNodeList; - res.data?.result?.userType === 1 - ? (state.allowClear = true) - : (state.allowClear = false); + state.option = res.data?.result; + state.orgId = [state.option[0]?.organizationId]; + state.resetOrgId = [state.option[0]?.organizationId]; + state.allowClear = true getTableData(); } }; @@ -343,8 +347,9 @@ export default { }); return list; }; - tableData.value = fun(res.data.rows); - state.tableDataTotal = res.data.total; + tableData.value = fun(res.data.result.rows); + state.tableDataTotal = res.data.result.total; + console.log("safgaga"+res.data.result.total) state.tableLoading = false; } };