mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 13:26:44 +08:00
新增加二期的api配置,
This commit is contained in:
15
src/api/boe/HRBP.js
Normal file
15
src/api/boe/HRBP.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import ajax from '@/api/boe/boeApiAjax.js'
|
||||
|
||||
/**
|
||||
* 获取课程审核的 HRBP 审核 人信息
|
||||
* 机构的id
|
||||
* organization_id
|
||||
*/
|
||||
const getHRBP = function(orgId) {
|
||||
return ajax.get('/b1/system/user/org-hrbp?organization_id='+orgId);
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
getHRBP
|
||||
}
|
||||
63
src/api/phase2/stat.js
Normal file
63
src/api/phase2/stat.js
Normal file
@@ -0,0 +1,63 @@
|
||||
/**文章模块的相关处理*/
|
||||
import ajax from '@/utils/xajax.js'
|
||||
|
||||
/**
|
||||
* 发送事件,具体事件参考后台管理的事件查看
|
||||
*参数如下:
|
||||
{
|
||||
"key": "ReadCase",//后台的事件key
|
||||
"title": "浏览案例【案例名称】",//事件的标题
|
||||
"parameters":"",//用户自定义参数 name:value,name:value
|
||||
"content": "案例名称",//事件的内容
|
||||
"objId": "案例id",//关联的id
|
||||
"objType": "3",//关联的类型
|
||||
"objInfo": "记录一般折内容部分",
|
||||
"aid": "用户的id", //当前登录人的id
|
||||
"aname": "用户的名称,用于显示",//当前人的姓名
|
||||
"status": 1 //状态,直接写1
|
||||
}
|
||||
*
|
||||
*/
|
||||
const sendEvent = function(data) {
|
||||
return ajax.get('/xboe/m/stat/event/send');
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户的统计信息
|
||||
* @param {Object} aid 主页人的id
|
||||
* @param {Object} data 参数 []数组,10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数,空数组 返回用户的全部类型统计。
|
||||
*/
|
||||
const userTotal = function(aid,data) {
|
||||
return ajax.postJson('/xboe/m/stat/user/total/'+aid,data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户动态,分页查询
|
||||
*
|
||||
* @param {
|
||||
pageIndex,
|
||||
pageSize,
|
||||
contentType:'',内容类型
|
||||
aid:'', //指定用户的动态,
|
||||
hidden:true/false,//是否隐藏,不指定,查询全部
|
||||
} data
|
||||
*/
|
||||
const userDynamicList = function(data) {
|
||||
return ajax.post('/xboe/m/stat/userdynamic/list',data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户最近 days 天的U币记录
|
||||
* @param {String} aid 用户的id
|
||||
* @param {Integer} days 整数,最近几天的记录
|
||||
*/
|
||||
const userCoinList = function(aid,days) {
|
||||
return ajax.get('xboe/m/stat/usercoinrecord/list?aid='+aid+'&days='+days);
|
||||
}
|
||||
|
||||
export default {
|
||||
sendEvent,
|
||||
userTotal,
|
||||
userDynamicList,
|
||||
userCoinList
|
||||
}
|
||||
123
src/components/System/chooseOrg.vue
Normal file
123
src/components/System/chooseOrg.vue
Normal 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>
|
||||
Reference in New Issue
Block a user