mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-07 18:06:46 +08:00
Merge branch 'zcwy-0415' into zcwy-zsx0223
This commit is contained in:
@@ -80,3 +80,5 @@ export const getProjectCount = (projectId) => http.get('/admin/project/projectCo
|
||||
export const login = (obj) => http.post('/admin/CheckUser/userLogin', obj)
|
||||
export const userInfo = () => http.get('/admin/CheckUser/userInfo')
|
||||
|
||||
//修改备注
|
||||
export const editStudent = (obj) => http.post('/admin/student/editStudent', obj)
|
||||
@@ -20,3 +20,5 @@ export const dataStatisticsSelectV1= (obj) => http.post('/data/statistics/select
|
||||
export const dataStatisticsSelectV2= (obj) => http.post('/data/statistics/select/v2', obj )
|
||||
// 图表2 学习情况数据接口
|
||||
export const boeuStudyDataGetStudyStaisticsList= (obj) => http.post('/boeu/studyData/getStudyStatisticsList', obj )
|
||||
//查看用户有无权限
|
||||
export const reportOrgs = (obj) => https.get('/orgHrbp/reportOrgs', {params:obj} )
|
||||
@@ -594,6 +594,16 @@
|
||||
}
|
||||
];
|
||||
}
|
||||
if (n.indexOf("/trainingnewmanager") !== -1 || n.indexOf("/TrainingNewManager") !== -1) {
|
||||
state.list = [
|
||||
{
|
||||
name: "报表中心",
|
||||
},
|
||||
{
|
||||
name:'新任管理者培训数据'
|
||||
},
|
||||
];
|
||||
}
|
||||
if (n.indexOf("/learningpathmap") !== -1 || n.indexOf("/LearningPathMap") !== -1) {
|
||||
state.list = [
|
||||
{
|
||||
|
||||
@@ -573,6 +573,15 @@
|
||||
<router-link to="/employeelearning">员工学习数据</router-link>
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-menu-item key="sub17-4" v-if="checkMenu('trainingnewmanager')||checkOrgs()">
|
||||
<span
|
||||
:class="{
|
||||
circleActive: selectedKeys[0] === 'sub17-4' ? true : false,
|
||||
circle: selectedKeys[0] === 'sub17-4' ? false : true,
|
||||
}"
|
||||
></span>
|
||||
<router-link to="/trainingnewmanager">新任管理者培训数据</router-link>
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-menu-item key="sub16" v-if="checkMenu('OldSystemManage')">
|
||||
<div class="imgBox">
|
||||
@@ -697,11 +706,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {reactive, toRefs, onMounted, onUnmounted, watch} from "vue";
|
||||
import {reactive, toRefs, onMounted, onUnmounted, watch } from "vue";
|
||||
import {useRoute} from "vue-router";
|
||||
import {useStore} from "vuex";
|
||||
import {checkMenu} from "@/utils/utils";
|
||||
|
||||
import {checkMenu,checkOrgs} from "@/utils/utils";
|
||||
import { reportOrgs } from "@/api/indexProject";
|
||||
export default {
|
||||
name: "NavLeft",
|
||||
setup() {
|
||||
@@ -1022,6 +1031,12 @@ export default {
|
||||
selectedKeys: "sub17-3-2",
|
||||
pagename: "员工学习数据",
|
||||
},
|
||||
{
|
||||
href: "/trainingnewmanager",
|
||||
openKeys: "sub17",
|
||||
selectedKeys: "sub17-4",
|
||||
pagename: "新任管理者培训数据",
|
||||
},
|
||||
{
|
||||
href: "/oldsystemmanage",
|
||||
openKeys: "sub18",
|
||||
@@ -1160,7 +1175,6 @@ export default {
|
||||
const getClientHeight = () => {
|
||||
state.screenHeight = document.body.clientHeight;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
// console.log("11111", 1);
|
||||
window.addEventListener("resize", getClientHeight, false);
|
||||
@@ -1172,6 +1186,7 @@ export default {
|
||||
return {
|
||||
...toRefs(state),
|
||||
checkMenu,
|
||||
checkOrgs,
|
||||
onOpenChange,
|
||||
selectItem,
|
||||
packUp,
|
||||
|
||||
@@ -314,7 +314,7 @@ export default {
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
className: "h",
|
||||
customRender: ({record:{status}}) => ({1:'已完成',0:'未开始',9:'已完成'}[status] || '未开始'),
|
||||
customRender: ({record:{status}}) => ({2:'进行中',1:'未开始',9:'已完成'}[status] || '未开始'),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
||||
@@ -441,6 +441,10 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
remarksTrue: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
});
|
||||
|
||||
const { loading: stuAsyncLoading, start } = useAsyncStu(props.id, props.type, getStuList);
|
||||
@@ -540,7 +544,7 @@ const tablecolumns = ref([
|
||||
title: "操作",
|
||||
dataIndex: "operation",
|
||||
key: "operation",
|
||||
width: 210,
|
||||
width: 260,
|
||||
align: "center",
|
||||
slots: { customRender: "action" },
|
||||
},
|
||||
|
||||
12
src/main.js
12
src/main.js
@@ -64,6 +64,18 @@ async function getUserPermission() {
|
||||
async function getUserInfo() {
|
||||
const userInfo = await request(USER_INFO);
|
||||
store.commit("SET_USER", userInfo.data);
|
||||
axios({
|
||||
method: "get",
|
||||
url: "/userbasic/orgHrbp/reportOrgs",
|
||||
params: {
|
||||
workNum:userInfo.data.userNo
|
||||
},
|
||||
headers: {
|
||||
"XBOR-Access-token": Cookies.get("token"),
|
||||
},
|
||||
}).then(res=>{
|
||||
store.commit("SET_USER_ORGS", res.data);
|
||||
})
|
||||
}
|
||||
async function initDict(key) {
|
||||
const list = await getDictList(key);
|
||||
|
||||
@@ -17,6 +17,7 @@ export default createStore({
|
||||
routerId: null,
|
||||
projectTemplateId: null,
|
||||
userInfo: {},
|
||||
userInfoOrgs: [],
|
||||
orgtreeList: [],
|
||||
faceclassPic: null,
|
||||
faceclassClass: [],
|
||||
@@ -62,6 +63,9 @@ export default createStore({
|
||||
userInfo.avatar = userInfo.avatar?.includes(process.env.VUE_APP_AVATAR_PATH) ? userInfo.avatar : (process.env.VUE_APP_AVATAR_PATH + userInfo.avatar);
|
||||
state.userInfo = userInfo;
|
||||
},
|
||||
SET_USER_ORGS(state,orgs){
|
||||
state.userInfoOrgs = orgs;
|
||||
},
|
||||
SET_projectTemplateId(state, projectTemplateId) {
|
||||
state.projectTemplateId = projectTemplateId;
|
||||
},
|
||||
|
||||
@@ -57,7 +57,9 @@ export function checkOwner(per) {
|
||||
export function checkMenu(path = "") {
|
||||
return store?.state?.menus.some(t => path.split(",").some(s => "/" + s === t));
|
||||
}
|
||||
|
||||
export function checkOrgs(){
|
||||
return store?.state?.userInfoOrgs.length > 0
|
||||
}
|
||||
export function deepClone(obj) {
|
||||
let result = typeof obj.splice === "function" ? [] : {};
|
||||
if (obj && typeof obj === "object") {
|
||||
|
||||
@@ -18,6 +18,18 @@ export function downLoadZip(str, filename) {
|
||||
resolveBlob(res, mimeMap.zip,filename)
|
||||
})
|
||||
}
|
||||
const baseUrlManage = process.env.VUE_APP_BASE_API
|
||||
export function downLoadZipManage(str, filename) {
|
||||
var url = baseUrlManage + str
|
||||
axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
|
||||
}).then(res => {
|
||||
resolveBlob(res, mimeMap.xlsx,filename)
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 解析blob响应内容并下载
|
||||
* @param {*} res blob响应内容
|
||||
|
||||
@@ -163,6 +163,10 @@
|
||||
<span>任务列表</span>
|
||||
</div>
|
||||
<div class="tit_right">
|
||||
<div style="margin-right: 14px">
|
||||
<span style="margin-right: 8px" :style="{color: switchList ? '#4ea6ff' : '#ffb64e'}">{{switchList?'自由学习模式':'顺序学习模式'}}</span>
|
||||
<a-switch v-model:checked="switchList" />
|
||||
</div>
|
||||
<div class="btn btn1" @click="showChangeModal">
|
||||
<div class="btnText">移动任务到关卡</div>
|
||||
</div>
|
||||
@@ -547,7 +551,7 @@ function deleteTask(element, index) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const switchList = ref(false)
|
||||
const showChangeModal = () => {
|
||||
if (routerInfo.value?.chapterList?.length <= 1) {
|
||||
message.warning("请添加关卡!");
|
||||
|
||||
@@ -119,6 +119,10 @@
|
||||
<div class="boomcen">
|
||||
<div class="onerow">
|
||||
<div class="taskmain">任务列表</div>
|
||||
<div class="taskmain_switch">
|
||||
<span class="taskmain_switch_text" :style="{color: projectInfo?.projectInfo?.unlockMode == 1 ? '#4ea6ff' : '#ffb64e'}">{{projectInfo?.projectInfo?.unlockMode == 1 ?'自由学习模式':'顺序学习模式'}}</span>
|
||||
<a-switch v-model:checked="switchList" />
|
||||
</div>
|
||||
<button class="btn" @click="showChangeModal">
|
||||
移动任务到阶段
|
||||
</button>
|
||||
@@ -418,7 +422,7 @@ import {TASK_TYPE} from "@/utils/const";
|
||||
import {request} from "@/api/request";
|
||||
import {PROJECT_DETAIL_MODIFY, PROJECT_RELEASE} from "@/api/apis";
|
||||
import dialog from "@/utils/dialog";
|
||||
|
||||
import { editProjectModel } from "@/api/indexLearningPath";
|
||||
const route = useRoute();
|
||||
const courseRef = ref({})
|
||||
const visiblene = ref(false);
|
||||
@@ -460,6 +464,7 @@ function changeStageIndex(index) {
|
||||
const getTask = async () => {
|
||||
await api.getDraftTask({projectId: route.query.projectId}).then((res) => {
|
||||
projectInfo.value = res.data.data
|
||||
projectInfo.value.projectInfo.unlockMode == 1 ? switchList.value = true : switchList.value = false
|
||||
console.log("获取任务列表:" + JSON.stringify(projectInfo.value) )
|
||||
});
|
||||
};
|
||||
@@ -467,7 +472,11 @@ const getTask = async () => {
|
||||
const editTaskForType = (ele, index) => {
|
||||
courseRef.value['el' + ele.type].openDrawer(index, ele)
|
||||
};
|
||||
|
||||
const switchList = ref(false)
|
||||
watch(()=>switchList.value,(newVal)=>{
|
||||
newVal ? projectInfo.value.projectInfo.unlockMode = 1 : projectInfo.value.projectInfo.unlockMode = 2
|
||||
editProjectModel(projectInfo.value.projectInfo)
|
||||
})
|
||||
const showChangeModal = () => {
|
||||
if (projectInfo.value?.stageList?.length <= 1) {
|
||||
message.warning("请添加阶段!");
|
||||
@@ -1420,6 +1429,21 @@ const openCourse = (ele) => {
|
||||
color: #000000;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.taskmain_switch{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 268px;
|
||||
width: 150px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
|
||||
.taskmain_switch_text{
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: absolute;
|
||||
|
||||
@@ -827,6 +827,7 @@
|
||||
:stage="stage"
|
||||
:visable="tabFlag"
|
||||
:groupList="groupList"
|
||||
:remarksTrue="remarksTrue"
|
||||
>
|
||||
<template #extension="{ data: { record } }">
|
||||
<a-button @click="showStudent(record)" type="link"
|
||||
@@ -845,6 +846,11 @@
|
||||
@click="showChangeGroupModal(record)"
|
||||
>换组
|
||||
</a-button>
|
||||
<a-button
|
||||
type="link"
|
||||
@click="modifyRemarks(record)"
|
||||
>修改备注
|
||||
</a-button>
|
||||
</template>
|
||||
</TableStudent>
|
||||
</a-tab-pane>
|
||||
@@ -2347,6 +2353,43 @@
|
||||
<!-- 换组弹窗 -->
|
||||
<!-- 面授课开课弹框 -->
|
||||
<AddOpenCourse @call-parent-method="getTaskListAll" ref="coursePlanRef" :type="1"/>
|
||||
<!-- 修改备注弹窗 -->
|
||||
<a-modal
|
||||
v-model:visible="showRemarks"
|
||||
:footer="null"
|
||||
closable="false"
|
||||
style="margin-top: 400px"
|
||||
@cancel="of_remarks"
|
||||
>
|
||||
<div class="selectonlineface" :style="{ display: showRemarks ? 'block' : 'none' }">
|
||||
<div class="bg_headers"></div>
|
||||
<div class="bg_main">
|
||||
<div class="bg_main_header">
|
||||
<div>修改备注</div>
|
||||
<div class="bg_main_header_close" @click="of_remarks"></div>
|
||||
</div>
|
||||
<div class="bg_body">
|
||||
<div class="bg_body_bt" style="align-items: flex-start;">
|
||||
<!-- <div class="bg_body_bttext" style="margin-top: 5px;">修改备注</div> -->
|
||||
<div class="bg_body_input">
|
||||
<a-input v-model:value="remarks" placeholder="请输入" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg_footer">
|
||||
<div class="btn btn6" @click="of_remarks">
|
||||
<div class="btnText">取消</div>
|
||||
</div>
|
||||
<a-button
|
||||
class="btn btn6"
|
||||
@click="RemarksUpdata"
|
||||
>
|
||||
确定
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="jsx">
|
||||
@@ -2603,11 +2646,11 @@ export default {
|
||||
ellipsis: true,
|
||||
customRender: ({ record }) => (
|
||||
<div>
|
||||
{record.finishTaskNum == 0
|
||||
? "未开始"
|
||||
: record.finishTaskNum == record.totalTaskNum
|
||||
{record.stuStatus == 2
|
||||
? "进行中"
|
||||
: record.status == 1
|
||||
? "已完成"
|
||||
: "进行中"}
|
||||
: "未开始"}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
@@ -2620,6 +2663,15 @@ export default {
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "batch",
|
||||
key: "batch",
|
||||
width: 120,
|
||||
align: "center",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
},
|
||||
],
|
||||
loading: false,
|
||||
projectId: route.query.projectId,
|
||||
@@ -3038,6 +3090,10 @@ export default {
|
||||
facestudent: {},
|
||||
modal1Visible: false, // 证书预览
|
||||
changegroupV: false, //换组弹窗
|
||||
remarks: '',
|
||||
remarksId: '',
|
||||
remarksTrue: false,
|
||||
showRemarks: false, //修改备注
|
||||
checkgroupStuId: null, //换组id
|
||||
ImpoterGroupLeaderV: false, //导入小组长抽屉
|
||||
certificatelist: [],
|
||||
@@ -3394,6 +3450,26 @@ export default {
|
||||
state.checkgroupStuId = [];
|
||||
state.checkgroupStuId.push(record.id);
|
||||
};
|
||||
//修改备注
|
||||
const modifyRemarks = (record) => {
|
||||
state.remarks = record.batch
|
||||
state.remarksId = record.id
|
||||
state.showRemarks = true;
|
||||
}
|
||||
const of_remarks = () => {
|
||||
state.remarksTrue = false;
|
||||
state.showRemarks = false;
|
||||
}
|
||||
const RemarksUpdata = () => {
|
||||
apitl.editStudent({
|
||||
id: state.remarksId,
|
||||
batch: state.remarks
|
||||
}).then(res=>{
|
||||
console.log(res,'res')
|
||||
state.remarksTrue = true;
|
||||
})
|
||||
of_remarks()
|
||||
}
|
||||
const showModal2 = (item, isEdit) => {
|
||||
state.isEdit = isEdit;
|
||||
state.stugroup = true;
|
||||
@@ -5183,6 +5259,9 @@ export default {
|
||||
cancelyou,
|
||||
cancelcanyou,
|
||||
showChangeGroupModal,
|
||||
modifyRemarks,
|
||||
of_remarks,
|
||||
RemarksUpdata,
|
||||
changePaginationStu,
|
||||
handleChange,
|
||||
toEdit,
|
||||
@@ -6083,7 +6162,113 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.selectonlineface{
|
||||
z-index: 999;
|
||||
width: 679px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.21);
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: -100%;
|
||||
transform: translate(-50%, -50%);
|
||||
.bg_headers {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
background: linear-gradient(
|
||||
rgba(78, 166, 255, 0.2) 0%,
|
||||
rgba(78, 166, 255, 0) 100%
|
||||
);
|
||||
}
|
||||
.bg_main {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
.bg_main_header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 20px;
|
||||
padding-left: 26px;
|
||||
font-size: 16px;
|
||||
.bg_main_header_close {
|
||||
position: absolute;
|
||||
right: 42px;
|
||||
cursor: pointer;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-image: url(@/assets/images/coursewareManage/close.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
.bg_body {
|
||||
width: 80%;
|
||||
margin: 3px auto;
|
||||
|
||||
.bg_body_bt {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: end;
|
||||
margin: 14px auto;
|
||||
|
||||
.bg_body_bttext {
|
||||
width: 110px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
.bg_body_input {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
.ant-upload-picture-card-wrapper{
|
||||
width: 200px;
|
||||
margin-right: 18px;
|
||||
}
|
||||
}
|
||||
.bg_footer {
|
||||
width: 100%;
|
||||
margin-left: 174px;
|
||||
margin-top: 25px;
|
||||
margin-bottom: 20px;
|
||||
display: flex;
|
||||
|
||||
.btn {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: rgba(64, 158, 255, 0);
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 14px;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn6 {
|
||||
background-color: #4ea6ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.headers{
|
||||
margin-left: 38px;
|
||||
margin-right: 38px;
|
||||
margin-top: 30px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
.btn{
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.taskpage {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
75
src/views/report/TrainingNewManager.vue
Normal file
75
src/views/report/TrainingNewManager.vue
Normal file
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<div class="train_newman">
|
||||
<div class="title">新任管理者线下学习项目定制报表</div>
|
||||
<div class="btn" @click="downReport" v-if="uploadAdmin('training-admin')||adminType?.length>0">
|
||||
<div class="img"></div>
|
||||
<div class="text">报表下载</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed,onMounted,ref } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
import { reportOrgs } from "@/api/indexProject";
|
||||
import {downLoadZipManage} from "@/utils/zipdownload";
|
||||
const downReport = () => {
|
||||
console.log('下载报表')
|
||||
if(uploadAdmin('training-admin')){
|
||||
downLoadZipManage(`/admin/project/report/data`,'新任管理者培训数据')
|
||||
return
|
||||
}
|
||||
if(adminType?.value.length>0){
|
||||
let orgs = adminType.value.join(',')
|
||||
downLoadZipManage(`/admin/project/report/data?orgs=${orgs}`,'新任管理者培训数据')
|
||||
}
|
||||
}
|
||||
const userInfo = computed(() => store.state.userInfo);
|
||||
onMounted(()=>{
|
||||
getReportOrgs()
|
||||
})
|
||||
const store = useStore();
|
||||
const adminType = ref()
|
||||
const getReportOrgs = () => {
|
||||
reportOrgs({workNum: userInfo.value.userNo}).then((res) => {
|
||||
console.log(res,'res')
|
||||
adminType.value = res.data
|
||||
});
|
||||
};
|
||||
const uploadAdmin = (admin)=>{
|
||||
const roleCode = userInfo.value.roleList.map((item)=>item.roleCode)
|
||||
if (admin){
|
||||
return roleCode.some(t => t == admin)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.train_newman{
|
||||
margin: 40px 0 0 50px;
|
||||
.title{
|
||||
color: #000000;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #4ea6ff;
|
||||
.img {
|
||||
width: 17px;
|
||||
height: 16px;
|
||||
background-image: url(../../assets/images/coursewareManage/export1.png);
|
||||
background-size: 100% 100%;
|
||||
margin-right: 7px;
|
||||
}
|
||||
.text{
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user