合并调整冲突修改

This commit is contained in:
daihh
2022-09-09 16:33:35 +08:00
15 changed files with 620 additions and 565 deletions

View File

@@ -34,6 +34,7 @@
{{teacher && teacher.join(',')}}</el-form-item>
<!-- <el-form-item label="系统标签">{{courseInfo.tags}}</el-form-item> -->
<el-form-item label="课程来源">{{courseInfo.source == 2?'外部':'内部'}}</el-form-item>
<el-form-item label="资源归属" >{{orgName}}</el-form-item>
<el-form-item label="目标人群">{{courseInfo.forUsers}}</el-form-item>
<el-form-item label="观看设置">
{{courseInfo.device == 3? '多端可见': courseInfo.device == 2?'移动端可见':'PC端可见'}}
@@ -60,7 +61,7 @@
<el-col :span="8">
<div @click.stop="chooseFile">
<imageUpload :disabled="true" :value="courseCoverurl" width="160px" height="90px" @success="uploadCoverImgSuccess" @subimage="acceptimage" @remove="removeCoverImgSuccess"></imageUpload>
</div>
<div>上传为16:9(:800*450)的png或jpg图片</div>
</el-col>
@@ -93,6 +94,11 @@
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="资源归属" required>
<el-input placeholder="请选择" v-model="orgName" >
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
</el-input>
</el-form-item>
<el-form-item label="目标人群" >
<el-input maxlength="50" show-word-limit v-model="courseInfo.forUsers" placeholder="目标人群(限50字以内)"></el-input>
</el-form-item>
@@ -216,7 +222,7 @@
</el-tab-pane>
</el-tabs>
<filecloud :show="dlgFileChoose.show" @choose="changeCourseImage" @close="choseChoose"></filecloud>
<chooseOrg ref="refChooseOrg" @confirm="confirmChooseOrg"></chooseOrg>
</div>
</template>
@@ -233,6 +239,7 @@ import pdfPreview from "@/components/PdfPreview/index.vue";
import weikeContent from "@/components/Course/weikeContent.vue";
import catalogCourseware from "@/components/Course/catalogCourseware.vue";
import apiCourse from "@/api/modules/course.js";
import apiOrg from '../../api/system/organiza.js';
import scene from "../../api/modules/scene.js";
import exam from "@/components/Course/exam";
import homework from "@/components/Course/homework";
@@ -244,6 +251,7 @@ import audioPlayer from "@/components/AudioPlayer/index.vue";
import apiCourseFile from '@/api/modules/courseFile.js';
import filecloud from '@/components/FileCloud/index.vue';
import { mapGetters, mapActions } from "vuex";
import chooseOrg from '@/components/System/chooseOrg.vue';
// import hyperLink from '@/components/Course/hyperLink.vue';
export default {
name: "auditCourse1",
@@ -258,11 +266,12 @@ export default {
WxEditor,
pdfPreview,
videoPlayer,
audioPlayer
audioPlayer,
chooseOrg
// hyperLink
},
computed: {
...mapGetters(["resOwnerMap", "sysTypeMap"])
...mapGetters(["resOwnerMap", "sysTypeMap","identity"])
},
props: {
id: {
@@ -326,6 +335,8 @@ export default {
label: "name"
},
courseCoverurl: "",
orgName:'',
orgKid:'',
courseInfo: {}, //基本信息
dataList: [],
activeName: "info",
@@ -360,7 +371,16 @@ export default {
});
},
methods: {
showChooseOrg(){
this.$refs.refChooseOrg.dlgShow = true;
},
confirmChooseOrg(orgInfo){
//console.log(orgInfo,'orgInfo');
this.orgName=orgInfo.name;
this.orgKid=orgInfo.kid;
this.courseInfo.orgId=orgInfo.id;
this.$refs.refChooseOrg.dlgShow = false;
},
chooseFile(){
this.dlgFileChoose.show=true;
},
@@ -570,6 +590,16 @@ export default {
apiCoursePortal.detail(this.id,true).then(rs => {
if (rs.status == 200) {
this.courseInfo = rs.result.course;
//加载所属机构名称
this.orgKid='';
if(this.courseInfo.orgId){
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){
this.orgName=rrs.result.name;
this.orgKid=rrs.result.kid;
}
})
}
this.teacherList = rs.result.teachers;
this.teacherName = rs.result.teachers;
this.teacher = rs.result.teachers.map(res => res.teacherName);

View File

@@ -41,6 +41,7 @@
<!-- <el-form-item label="系统标签">
{{courseInfo.tags}}
</el-form-item> -->
<el-form-item label="资源归属" >{{orgName}}</el-form-item>
<el-form-item label="目标人群" >
{{courseInfo.forUsers}}
</el-form-item>
@@ -75,7 +76,7 @@
<el-col :span="8">
<div @click.stop="chooseFile">
<imageUpload :disabled="true" :value="courseCoverurl" width="160px" height="90px" @subimage="acceptimage" @success="uploadCoverImgSuccess" @remove="removeCoverImgSuccess"></imageUpload>
</div>
<div>上传为16:9(:800*450)的png或jpg图片</div>
</el-col>
@@ -108,6 +109,11 @@
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="资源归属" required>
<el-input placeholder="请选择" v-model="orgName" >
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
</el-input>
</el-form-item>
<el-form-item label="目标人群" >
<el-input maxlength="50" show-word-limit v-model="courseInfo.forUsers" placeholder="目标人群(限50字以内)"></el-input>
</el-form-item>
@@ -254,17 +260,19 @@
</el-col>
</el-row>
<filecloud :show="dlgFileChoose.show" @choose="changeCourseImage" @close="choseChoose"></filecloud>
<chooseOrg ref="refChooseOrg" @confirm="confirmChooseOrg"></chooseOrg>
</div>
</template>
<script>
import apiCoursePortal from "@/api/modules/coursePortal.js";
import apiOrg from '../../api/system/organiza.js';
import exam from "@/components/Course/exam";
import homework from "@/components/Course/homework";
import pdfPreview from "@/components/PdfPreview/index.vue";
import assess from "@/components/Course/assess";
import apiTag from "../../api/modules/tag.js";
import chooseOrg from '@/components/System/chooseOrg.vue';
import {
formatDate,
courseType,
@@ -297,7 +305,8 @@ export default {
pdfPreview,
videoPlayer,
audioPlayer,
hyperLink
hyperLink,
chooseOrg
},
props: {
id: {
@@ -318,7 +327,7 @@ export default {
}
},
computed: {
...mapGetters(['resOwnerMap','sysTypeMap']),
...mapGetters(['resOwnerMap','sysTypeMap','identity']),
},
data() {
return {
@@ -358,6 +367,8 @@ export default {
typeList: [], // 资源归属
showTags: [], //用于显示标签
teacherList: [],
orgName:'',
orgKid:'',
courseInfo: {},
courseCoverurl: "",
sysTypeListMap:[],
@@ -401,8 +412,17 @@ export default {
})
},
methods: {
chooseFile(){
showChooseOrg(){
this.$refs.refChooseOrg.dlgShow = true;
},
confirmChooseOrg(orgInfo){
//console.log(orgInfo,'orgInfo');
this.orgName=orgInfo.name;
this.orgKid=orgInfo.kid;
this.courseInfo.orgId=orgInfo.id;
this.$refs.refChooseOrg.dlgShow = false;
},
chooseFile(){
this.dlgFileChoose.show=true;
},
choseChoose(){
@@ -610,6 +630,16 @@ export default {
apiCoursePortal.detail(this.id,true).then(rs => {
if (rs.status == 200) {
this.courseInfo = rs.result.course;
//加载所属机构名称
this.orgKid='';
if(this.courseInfo.orgId){
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){
this.orgName=rrs.result.name;
this.orgKid=rrs.result.kid;
}
})
}
if(rs.result.course.coverImg !== '') {
this.courseCoverurl = this.fileBaseUrl + rs.result.course.coverImg;
}

View File

@@ -73,16 +73,11 @@
:props="{ value: 'id', label: 'name' }"
:options="sysTypeListMap"></el-cascader>
</el-form-item>
<!-- <el-form-item label="资源归属" required>
<el-cascader
placeholder="选择资源归属"
style="width: 100%;"
clearable
v-model="resOwnerArray"
:props="{ value: 'code', label: 'name' }"
:options="resOwnerListMap"
></el-cascader>
</el-form-item> -->
<el-form-item label="资源归属" required>
<el-input placeholder="请选择" v-model="orgName" >
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
</el-input>
</el-form-item>
<el-form-item label="场景" v-show="!weike.onlyRequired">
<el-select v-model="courseInfo.forScene" style="width: 100%;">
<el-option v-for="item in sceneList" :key="item.id" :label="item.name" :value="item.id"></el-option>
@@ -219,15 +214,7 @@
:options="sysTypeListMap">
</el-cascader>
</el-form-item>
<!-- <el-form-item label="资源归属" required>
<el-cascader
placeholder="选择资源归属"
style="width: 100%;"
clearable
v-model="resOwnerArray"
:props="{ value: 'code', label: 'name' }"
:options="resOwnerListMap"></el-cascader>
</el-form-item> -->
<el-form-item label="场景">
<el-select v-model="courseInfo.forScene" style="width: 100%;">
<el-option v-for="item in sceneList" :key="item.id" :label="item.name" :value="item.id"></el-option>
@@ -254,6 +241,11 @@
</el-form-item>
</el-col>
</el-form-item>
<el-form-item label="资源归属" required>
<el-input placeholder="请选择" v-model="orgName" >
<el-button v-if="identity==3 || identity==5" @click="showChooseOrg()" slot="append" icon="el-icon-search">选择</el-button>
</el-input>
</el-form-item>
<el-form-item label="目标人群" required>
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
</el-form-item>
@@ -378,6 +370,7 @@
</el-dialog>
<!--选择图片-->
<filecloud :show="dlgFileChoose.show" @choose="changeCourseImage" @close="choseChoose"></filecloud>
<chooseOrg ref="refChooseOrg" @confirm="confirmChooseOrg"></chooseOrg>
</div>
</template>
<script>
@@ -391,19 +384,24 @@ import scene from '../../api/modules/scene.js';
import apiUserGroup from '../../api/modules/usergroup.js';
import apiTeacher from '../../api/modules/teacher.js';
import apiTag from '../../api/modules/tag.js';
import apiHRBP from '../../api/boe/HRBP.js';
import apiCourse from '../../api/modules/course.js';
import apiOrg from '../../api/system/organiza.js';
import apiUser from '../../api/system/user.js';
import WxEditor from '@/components/Editor/index.vue';
import catalogSort from '@/components/Course/catalogSort.vue';
import { courseType, getType } from '../../utils/tools.js';
import { mapGetters, mapActions } from 'vuex';
import filecloud from '@/components/FileCloud/index.vue';
import chooseOrg from '@/components/System/chooseOrg.vue';
export default {
props: {},
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice},
components: { weikeContent, catalogCourseware, imageUpload, WxEditor, catalogSort,agreement,filecloud,choice,chooseOrg},
data() {
return {
checked:false,
courseInfoFormCheckedShow:false,
orgChooseShow:false,
weikeReset: '',
onlineReset: '',
sysTypeListMap: [],
@@ -432,11 +430,14 @@ export default {
courseCoverurl: '', //显示的图片
btnLoading: false,
requireSaveCourse: false,
orgName:'',
orgKid:'',
courseInfo: {
id: '',
name: '',
orderStudy: false,
type: 10,
orgId:'',
coverImg: '',
source: 1,
forUsers: '',
@@ -493,7 +494,7 @@ export default {
this.getSceneData();
},
computed: {
...mapGetters(['resOwnerMap', 'sysTypeMap']),
...mapGetters(['resOwnerMap', 'sysTypeMap','userInfo','identity']),
catalogTree() {
let treeList = [];
let $this = this;
@@ -531,8 +532,19 @@ export default {
this.loadResOwners();
this.loadSysTypes();
this.loadUserGroup();
},
methods: {
showChooseOrg(){
this.$refs.refChooseOrg.dlgShow = true;
},
confirmChooseOrg(orgInfo){
//console.log(orgInfo,'orgInfo');
this.orgName=orgInfo.name;
this.orgKid=orgInfo.kid;
this.courseInfo.orgId=orgInfo.id;
this.$refs.refChooseOrg.dlgShow = false;
},
getTeacherList(res) {
this.teacherValues = res;
},
@@ -652,11 +664,29 @@ export default {
this.onlineReset = Math.round(Math.random()) + '';
this.courseChooseShow = true;
this.biaoke.tabIndex = 'base';
this.courseInfo.orgId=this.userInfo.departId;
if(!this.courseInfo.orgId){
this.courseInfo.orgId=this.userInfo.departId;
}
this.orgKid='';
if(this.courseInfo.orgId){
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){
this.orgName=rrs.result.name;
this.orgKid=rrs.result.kid;
}
})
}
} else {
//console.log(editData,'editData');
this.weikeReset = editData.id;
this.onlineReset = editData.id;
//console.log("编辑课程?");
this.orgName=editData.orgName;
this.courseInfo.orgId=editData.orgId;
this.curCourseId = editData.id; //设置
this.courseInfo.type = editData.type; //设置课程类型,因为这里的课程对象可能不全,所以只能设置值,不能整个对象附值
this.getDetail(editData.id); //获取课程的详细信息
@@ -667,6 +697,7 @@ export default {
this.biaoke.dlgShow = true;
}
}
},
resetCurCourseContent() {
this.curContent = { id: '', contentType: 0, contentName: '', content: '', csectionId: '', contentName: '', contentRefId: '', courseId: this.courseInfo.id };
@@ -747,22 +778,53 @@ export default {
this.contentInfo.list = result.contents;
this.sectionInfo.list = result.sections;
this.courseTeachers = result.teachers; //课程的老师信息
if(!this.courseInfo.orgId){
//根据课程创建者获取机构id
apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{
if(ors.status==200){
$this.courseInfo.orgId=ors.result.id;
apiOrg.getSimple(ors.result.id).then(rrs=>{
if(rrs.status==200){
$this.orgName=rrs.result.name;
$this.orgKid=rrs.result.kid;
}
})
}else{
//
}
})
}else{
apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{
if(rrs.status==200){
$this.orgName=rrs.result.name;
$this.orgKid=rrs.result.kid;
}
})
}
this.resOwnerArray=[];
if (result.course.resOwner1 == '') {
this.resOwnerArray.push(result.course.resOwner1);
}else if(result.course.resOwner2 == ''){
}
if(result.course.resOwner2 == ''){
this.resOwnerArray.push(result.course.resOwner2);
}else if(result.course.resOwner3 == ''){
}
if(result.course.resOwner3 == ''){
this.resOwnerArray.push(result.course.resOwner3);
}
if (result.course.sysType3 == '' && result.course.sysType2 == '') {
this.sysTypeList = [result.course.sysType1];
} else if (result.course.sysType3 == '') {
this.sysTypeList = [result.course.sysType1, result.course.sysType2];
} else {
this.sysTypeList = [result.course.sysType1, result.course.sysType2, result.course.sysType3];
this.sysTypeList=[];
if(result.course.sysType1!='' && result.course.sysType1!='0'){
this.sysTypeList.push(result.course.sysType1);
}
if(result.course.sysType2!='' && result.course.sysType2!='0'){
this.sysTypeList.push(result.course.sysType2);
}
if(result.course.sysType3!='' && result.course.sysType3!='0'){
this.sysTypeList.push(result.course.sysType3);
}
//console.log(this.sysTypeList,'this.sysTypeList');
//受众处理crowds
let crowdList=[];
if(result.crowds && result.crowds.length>0){
@@ -1116,6 +1178,7 @@ export default {
return pass;
},
submitCourse() {
if(this.biaoke.dlgShow && !this.unsavedContent()){
this.$message.error('您有未保存的内容,请先保存');
return;
@@ -1124,6 +1187,18 @@ export default {
this.$message.error('您有未保存的内容,请先保存');
return;
}
//console.log(this.courseInfo.orgId,'this.courseInfo.orgId');
//console.log(this.orgKid,'this.orgKid');
if(!this.courseInfo.orgId){
this.$message.error('请选择资源归属');
return;
}
if(!this.orgKid){
this.$message.error('资源归属无关联HRBP信息');
return;
}
//console.log(this.resOwnerListMap[0],'this.resOwnerListMap[0]');
//return;
let ownerCode=this.resOwnerListMap[0].code;
@@ -1214,22 +1289,39 @@ export default {
};
this.btnLoading = true;
let $this = this;
apiCourse.submitCourse(postData).then(res => {
//this.btnLoading=false;
setTimeout(function() {
//先获取课程内容
apiHRBP.getHRBP(this.orgKid).then(rs=>{
if(rs.status==200 && rs.result.length>0){
let hrbpUser=rs.result[0];
postData.auditUser={
email:hrbpUser.email,
code:hrbpUser.user_no,
name:hrbpUser.real_name,
kid:hrbpUser.user_id,
orgId:hrbpUser.orgnization_id
}
apiCourse.submitCourse(postData).then(res => {
//this.btnLoading=false;
setTimeout(function() {
$this.btnLoading = false;
}, 1000);
if (res.status === 200) {
//提交成功,直接关闭当前窗口
this.$message.success('提交成功!!!');
this.biaoke.dlgShow = false;
this.weike.dlgShow = false;
//提交成功回调处理
this.$emit('submitSuccess');
} else {
this.$message.error(res.message);
}
});
}else{
$this.btnLoading = false;
}, 1000);
if (res.status === 200) {
//提交成功,直接关闭当前窗口
this.$message.success('提交成功!!!');
this.biaoke.dlgShow = false;
this.weike.dlgShow = false;
//提交成功回调处理
this.$emit('submitSuccess');
} else {
this.$message.error(res.message);
this.$message.error('获取审核HRBP失败:'+rs.message);
}
});
})
},
// 教师列标,远程查询
async remoteFindTeacher(query) {

View File

@@ -0,0 +1,123 @@
<template>
<!--机构树-->
<div>
<el-dialog title="先择组织机构" :append-to-body="true" :visible.sync="dlgShow" :before-close="handleClose" :close-on-click-modal="false" width="500px" custom-class="g-dialog">
<div>
<!--
<el-input placeholder="" v-model="orgName">
<i slot="prefix" class="el-input__icon el-icon-search"></i>
</el-input>
-->
</div>
<div style="overflow-y: auto;height: 400px;">
<el-tree
ref="treeRef"
node-key="id"
:lazy="true"
:props="departProps"
:load="loadNode"
@node-click="handleDepartNodeClick"
:expand-on-click-node="false"
:render-content="renderContent"
:default-expanded-keys="['-1']">
</el-tree>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dlgShow = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import usergroupApi from "@/api/modules/usergroup";
import orgApi from "@/api/system/organiza";
export default{
props:{
},
data(){
return {
dlgShow:false,
orgName:'',
chooseOrg:{},
departData:[],
departProps: {
children: 'children',
label: 'name'
}
}
},
methods:{
handleClose(){
this.dlgShow=false
},
renderContent(h, { node, data, store }) {
let checked=data.id==this.chooseOrg.id;
if(checked){
return (<span class="custom-tree-node">
<span>{node.label}</span>
<span class="el-icon-check"></span>
</span>);
}else{
return (<span class="custom-tree-node"> <span>{node.label}</span></span>);
}
},
loadNode(node, resolve) {
var parentId = null;
if (node.level === 0) {
resolve([{name:'组织机构树',id:'-1'}]);
}else{
if(node.level === 1){
parentId = '-1';
}else{
parentId = node.data.id;
}
usergroupApi.userOrgs(parentId).then(res =>{
if (res.status == 200) {
if(res.result != null && res.result.length > 0){
resolve(res.result);
}else{
resolve([]);
}
}else{
this.$message.error('查询用户的机构失败');
}
});
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleDepartNodeClick(data){
this.chooseOrg.id = data.id;
this.chooseOrg.name=data.name;
this.chooseOrg.kid=data.kid;
},
confirm(){
if(!this.chooseOrg.id){
this.$message.error('请选择一个机构');
return;
}
//this.dlgShow=false;
this.$emit('confirm',this.chooseOrg);
}
}
}
</script>
<style scoped>
/* .is-current{
background-color: #ffff7f;
} */
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
</style>

View File

@@ -79,11 +79,17 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
}
},
mounted() {
this.sex = this.userInfo.sex;
// 判断路由是进入的学员默认页面就重置setCurIdentity
if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){
this.setCurIdentity(1);
this.sex = this.userInfo.sex;
let iden=this.$route.query.identity;
if(iden){
this.setCurIdentity(parseInt(iden));
}else{
// 判断路由是进入的学员默认页面就重置setCurIdentity
if(this.$route.path == '/uc/study/task' || this.$route.path == '/study/index'){
this.setCurIdentity(1);
}
}
//let testName='京东方科技集团股份有限公司/北京中祥英科技有限公司/技术中心';
//this.orgInfo=cutFullName(testName,1);
this.orgInfo=cutFullName(this.userInfo.departFullName,1);