Browse Source

优化

master
陈裕财 4 years ago
parent
commit
c4895f98db
  1. 7
      src/views/xm/core/xmProject/XmProjectAdd.vue
  2. 8
      src/views/xm/core/xmProject/XmProjectEdit.vue
  3. 211
      src/views/xm/core/xmProjectGroup/XmProjectGroupOkr.vue
  4. 609
      src/views/xm/core/xmProjectGroupFormwork/XmProjectGroupFormwork.vue

7
src/views/xm/core/xmProject/XmProjectAdd.vue

@ -141,9 +141,7 @@
import { listOption } from '@/api/mdp/meta/itemOption';//
import { addXmProject } from '@/api/xm/core/xmProject';
import { mapGetters } from 'vuex';
import XmProjectGroupFormwork from '../xmProjectGroupFormwork/XmProjectGroupFormwork';
import { getGroups } from '@/api/xm/core/xmProjectGroup';
export default {
@ -430,8 +428,7 @@
/**end 在上面加自定义方法**/
},//end method
components: {
XmProjectGroupFormwork
components: {
// 'xm-project-add':XmProjectEdit
},
mounted() {

8
src/views/xm/core/xmProject/XmProjectEdit.vue

@ -137,10 +137,7 @@
import { editXmProject } from '@/api/xm/core/xmProject';
import { uploadBase64 } from '@/api/mdp/arc/image';
import { mapGetters } from 'vuex';
import XmProjectGroupFormwork from '../xmProjectGroupFormwork/XmProjectGroupFormwork';
import { mapGetters } from 'vuex';
import { getGroups } from '@/api/xm/core/xmProjectGroup';
import html2canvas from 'html2canvas'
@ -668,8 +665,7 @@
/**end 在上面加自定义方法**/
},//end method
components: {
XmProjectGroupFormwork,html2canvas
components: { html2canvas
// 'xm-project-add':XmProjectEdit
},
mounted() {

211
src/views/xm/core/xmProjectGroup/XmProjectGroupOkr.vue

@ -1,211 +0,0 @@
<template>
<section class="page-container padding">
<el-row v-if="!isSelectSingleUser && !isSelectMultiUser">
<el-button type="primary" v-if="!groups||groups.length==0" @click="showGroupFormwork" icon="el-icon-plus">导入项目组</el-button>
<el-button type="plain" @click="showGroupState" icon="el-icon-s-data">小组进度</el-button>
<el-button type="plain" @click="xmRecordVisible=true" icon="el-icon-document">变化日志</el-button>
<el-button type="plain" @click="doSearchImGroupsByProjectId" icon="el-icon-document">绑定即聊情况</el-button>
<el-button @click="groupRoleDescVisible=true" icon="el-icon-document">角色说明</el-button>
</el-row>
<el-row v-else>
<el-button type="primary" @click="userConfirm" icon="el-icon-finished">确认选择用户</el-button>
</el-row>
<el-row>
<vue-okr-tree :data="okrTreeData"
show-collapsable
default-expand-all
node-key="id"
current-lable-class-name="crrentClass"
:render-content="renderContent"
@node-click="handleNodeClick"
direction="horizontal"
></vue-okr-tree>
</el-row>
<el-dialog
title="操作"
:visible.sync="groupOperSelectVisible"
width="30%" >
<el-row>
<el-button @click="showAdd">新增一级小组</el-button>
<el-button @click="showAddSub(editForm)">新增下级小组</el-button>
<el-button type="primary" @click="showEdit(editForm)">小组明细</el-button>
<el-button @click="handleDel(editForm)">删除小组</el-button>
</el-row>
</el-dialog>
</section>
</template>
<script>
import util from '@/common/js/util';//
import {sn} from '@/common/js/sequence';//
//import Sticky from '@/components/Sticky' // header
//import { listOption } from '@/api/mdp/meta/itemOption';//
import { updateGroup,getGroups } from '@/api/xm/core/xmProjectGroup';
import { mapGetters } from 'vuex';
import XmProjectGroupEdit from "./XmProjectGroupEdit"
import {VueOkrTree} from 'vue-okr-tree';
import 'vue-okr-tree/dist/vue-okr-tree.css'
export default {
computed: {
...mapGetters([
'userInfo','roles'
]),
okrTreeData(){
var groups=this.groups;
groups.forEach(i=>{
i.label=i.groupName
if(i.groupUsers){
var groupUsers=i.groupUsers;
groupUsers.forEach(i=>i.label=i.username)
i.children=groupUsers
}
})
var topLabel="组织架构"
if(this.xmProduct&&this.xmProduct.id){
topLabel=this.xmProduct.name+"-产品组织架构"
}else if(this.selProject && this.selProject.id){
topLabel=this.selProject.name+"-项目组织架构"
}
var data=[{
label:topLabel,
children:groups
}
]
return data;
}
},
props: ["selProject" ,"isSelectSingleUser","isSelectMultiUser",'xmProduct','xmIteration'],
watch:{
selProject(){
this.getXmProjectGroup();
},
xmProduct(){
this.getXmProjectGroup();
},
xmIteration(){
this.getXmProjectGroup();
}
},
data() {
return {
load:{ list: false, edit: false, del: false, add: false },//...
/**begin 自定义属性请在下面加 请加备注**/
groupSelectVisible: true,
groups:[],
editForm: {
id:'',groupName:'',projectId:''
},
addForm: {
id:'',groupName:'',projectId:''
},
groupOperSelectVisible:false,
/**end 自定义属性请在上面加 请加备注**/
}
},//end data
methods: {
onGroupSelected(selGroups){
this.load.edit=true
if(selGroups != null){
let groups = [];
selGroups.forEach(i=>{
let group = {
"id":i.id,
"groupName": i.groupName,
"groupUsers": i.groupUsers,
"projectId": i.projectId,
"pgTypeName": i.pgTypeName,
"pgTypeId": i.pgTypeId
};
groups.push(group);
});
if(selGroups.length==0){
this.$message({showClose: true, message: "最少保留一个小组", type: 'error' });
this.load.edit=false
return;
}
updateGroup(groups).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
//this.groups = res.data.data;
this.$message({showClose: true, message: tips.msg, type: 'success' });
}else{
this.$message({showClose: true, message: tips.msg, type: 'error' });
}
this.getXmProjectGroup();
this.load.edit=false
}).catch( err => this.load.edit = false );
}
//this.groupSelectVisible=false;
},
getXmProjectGroup() {
this.load.list = true;
let params = {
};
if(this.selProject){
params.projectId=this.selProject.id
}
if(this.xmIteration){
params.iterationId=this.xmIteration.id
}
if(this.xmProduct){
params.productId=this.xmProduct.id
}
getGroups(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.groups = res.data.data;
}else{
this.$message({showClose: true, message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
/**begin 自定义函数请在下面加**/
onUserSelected:function(users){
this.$emit("user-confirm",users);
},
renderCurrentClass (node) {
return 'label-bg-blue'
},
handleNodeClick (data) {
this.groupOperSelectVisible=true;
this.editForm=data;
},
renderContent (h, node) {
return (
<div class={'diy-wrapper', node.isCurrent ? 'current-select' : ''}>
<div class={'diy-con-name',node.data.userid? 'el-icon-user':''}>{node.data.label}<div></div></div>
<div class="diy-con-content">
{node.data.leaderUsername?
(<div> {node.data.leaderUsername }</div>
)
:
(<div> </div>)
}
</div>
</div>
)
}
/**end 自定义函数请在上面加**/
},//end methods
components: {
VueOkrTree,XmProjectGroupEdit,
//
},
mounted() {
this.$nextTick(() => {
this.getXmProjectGroup();
});
}
}
</script>
<style scoped>
</style>

609
src/views/xm/core/xmProjectGroupFormwork/XmProjectGroupFormwork.vue

@ -1,609 +0,0 @@
<template>
<section class="page-container padding">
<el-row>
<el-col :span="24">
<el-button v-if="!isSelectSingleUser && !isSelectMultiUser" type="primary" @click="showGroupFormwork" icon="el-icon-plus">导入项目组</el-button>
<el-button v-if="!isSelectSingleUser && !isSelectMultiUser" type="primary" @click="groupConfirm" icon="el-icon-finished">保存</el-button>
<el-button v-if="!isSelectSingleUser && !isSelectMultiUser" type="plain" @click="showGroupState" icon="el-icon-s-data">小组进度</el-button>
<el-button v-else type="primary" @click="userConfirm" icon="el-icon-finished">确认选择用户</el-button>
<el-button v-if="!isSelectSingleUser && !isSelectMultiUser" type="plain" @click="xmRecordVisible=true" icon="el-icon-document">变化日志</el-button>
<el-button v-if="!isSelectSingleUser && !isSelectMultiUser" type="plain" @click="doSearchImGroupsByProjectId" icon="el-icon-document">绑定即聊情况</el-button>
<el-button @click="groupRoleDescVisible=true" icon="el-icon-document">角色说明</el-button>
<el-tooltip v-if="isSelectSingleUser!='1' && isSelectMultiUser !='1'" content="黄色表示组长"><span class="addXmProjectGroupFormworkSquare"></span></el-tooltip>
<el-tooltip v-else content="黄色表示选中"><span class="addXmProjectGroupFormworkSquare">选中</span></el-tooltip>
</el-col>
</el-row>
<el-row>
<vue-okr-tree :data="okrTreeData"
show-collapsable
default-expand-all
node-key="id"
current-lable-class-name="crrentClass"
:render-content="renderContent"
@node-click="handleNodeClick"
direction="horizontal"
></vue-okr-tree>
</el-row>
<el-drawer append-to-body
title="角色说明"
size="60%"
:visible.sync="groupRoleDescVisible"
direction="rtl"
ref="drawer"
>
<el-row class="page-main page-height-90">
<el-collapse>
<el-collapse-item title="项目经理:项目整体、团队、进度、质量、计划、风险、沟通管理等" name="3">
<div>项目立项项目预算项目进度项目成本项目合同项目延期项目预算变更等</div>
<div>团队建立项目管理组建立业务组指定组长组员管理加人减人指派组长</div>
<div>计划建立计划计划预算管理基于计划细化任务迭代计划制定与执行等</div>
<div>任务建立任务删除任务指派责任人任务预算变更任务提交测试测试结果反馈任务结算</div>
<div>质量审核测试方案定时查看质量报告</div>
<div>风险风险预测风险应对措施管理等</div>
<div>需求确保任务与需求的关联关系正确范围正确及时跟进需求的变化 </div>
</el-collapse-item>
<el-collapse-item title="项目管理者: 项目经理、技术经理、项目副经理、技术副经理等具有全项目范围管理权限的管理人员。由项目经理指派。" name="4">
<div>团队建立项目管理组建立业务组指定组长组员管理加人减人指派组长</div>
<div>进度计划建立计划细化计划计划管理计划预算管理等 </div>
<div>任务建立任务删除任务指派责任人任务预算变更任务提交测试测试结果反馈任务结算</div>
<div>质量审核测试方案定时查看质量报告等</div>
<div>风险风险预测风险应对措施管理等</div>
<div>需求确保任务与需求的关联关系正确范围正确及时跟进需求的变化</div>
</el-collapse-item>
<el-collapse-item title="组长:每个小组的组长,由项目管理者指定" name="5">
<div>团队组员管理加人减人</div>
<div>进度计划建立计划细化计划计划管理计划预算管理定期查看小组的工作进度情况各成员的进度情况跟踪</div>
<div>任务建立任务删除任务指派责任人任务预算变更任务提交测试测试结果反馈任务结算</div>
<div>质量审核测试方案定时查看质量报告等</div>
<div>风险风险预测风险应对措施管理等</div>
<div>需求确保任务与需求的关联关系正确范围正确及时跟进需求的变化</div>
</el-collapse-item>
<el-collapse-item title="任务责任人:每个任务的责任人,由组长、项目管理者指定" name="6">
<div> 团队对任务的候选人执行人进行统一管理跟踪</div>
<div>进度计划定期查看负责的任务的进度情况各成员的进度情况跟踪</div>
<div>任务任务预算变更任务提交测试测试结果反馈任务结算</div>
<div>质量审核测试方案定时查看质量报告等</div>
<div>风险风险预测风险应对措施管理等</div>
<div>需求确保任务与需求的关联关系正确范围正确及时跟进需求的变化</div>
</el-collapse-item>
<el-collapse-item title="任务候选人:每个任务的候选人,由任务责任人、组长、项目管理者指定或者由用户自行加入。" name="7">
<div> 团队查看团队成员加入任务候选人队列退出任务候选人队列不能加入具体的小组</div>
<div>进度计划定期查看已关注的任务的进度情况</div>
<div>任务关注任务取消关注任务查询任务加入任务候选人队列退出候选人队列等 </div>
<div>需求查看相关的需求及其滚动信息</div>
</el-collapse-item>
<el-collapse-item title="任务执行人:每个任务的具体执行人,由任务责任人、组长、项目管理者指定。" name="8">
<div> 团队查看团队成员加入业务小组退出小组</div>
<div>进度计划定期查看已执行的任务的进度情况</div>
<div>任务关注任务取消关注任务查询任务加入任务候选人队列退出候选人队列提交测试提交结算申请等</div>
<div>需求查看相关的需求及其滚动信息</div>
</el-collapse-item>
<el-collapse-item title="产品经理" name="9">
<div> 团队查看团队成员加入业务小组退出小组</div>
<div>进度计划定期查看已执行的任务的进度情况</div>
<div>任务关注任务取消关注任务查询任务加入任务候选人队列退出候选人队列提交测试提交结算申请等</div>
<div>需求查看相关的需求及其滚动信息</div>
</el-collapse-item>
<el-collapse-item title="测试经理" name="10">
</el-collapse-item>
<el-collapse-item title="开发者" name="11">
</el-collapse-item>
<el-collapse-item title="项目管理委员会" name="1">
<div>用户决策根据场景可给予用户操作建议或安全提示但不能代替用户进行决策</div>
<div>结果可控用户可以自由的进行操作包括撤销回退和终止当前操作等</div>
</el-collapse-item>
<el-collapse-item title="客户项目经理" name="2">
<div>用户决策根据场景可给予用户操作建议或安全提示但不能代替用户进行决策</div>
<div>结果可控用户可以自由的进行操作包括撤销回退和终止当前操作等</div>
</el-collapse-item>
</el-collapse>
<el-button @click="groupRoleDescVisible=false">关闭</el-button>
</el-row>
</el-drawer>
<el-drawer append-to-body title="选择员工" :visible.sync="userSelectVisible" size="60%">
<users-select :select-userids="filters.ids?filters.ids.map(i=>i.id):[]" @confirm="onUserSelected" ref="usersSelect"></users-select>
</el-drawer>
<el-drawer v-if="selProject" :title="selProject==null?'操作日志':selProject.name+'团队操作日志'" center :visible.sync="xmRecordVisible" size="50%" :close-on-click-modal="false" append-to-body>
<xm-record :obj-type="'group'" :visible="xmRecordVisible" :project-id="selProject.id" :simple="1"></xm-record>
</el-drawer>
<el-drawer v-if="selProject" :title="selProject==null?'进度':selProject.name+'团队进度'" center :visible.sync="xmProjectGroupStateVisible" size="80%" :close-on-click-modal="false" append-to-body>
<xm-project-group-state-mng :sel-project="selProject" :visible="xmProjectGroupStateVisible" ></xm-project-group-state-mng>
</el-drawer>
</section>
</template>
<script>
import util from '@/common/js/util'; //
import {sn} from '@/common/js/sequence'; //
//import Sticky from '@/components/Sticky' // header
import { listOption } from '@/api/mdp/meta/itemOption';//
import {addXmProjectGroupFormwork,delXmProjectGroupFormwork,listXmProjectGroupFormwork} from '@/api/xm/core/xmProjectGroupFormwork';
import { listImGroup} from '@/api/mdp/im/group/imGroup';
import { publishMessage} from '@/api/mdp/im/imPush';
import UsersSelect from "@/views/mdp/sys/user/UsersSelect";
import XmProjectGroupStateMng from '../xmProjectGroupState/XmProjectGroupStateMng';//
import {mapGetters} from 'vuex'
import {VueOkrTree} from 'vue-okr-tree';
import 'vue-okr-tree/dist/vue-okr-tree.css'
export default {
computed: {
...mapGetters([
'workShop','userInfo','roles'
]),
okrTreeData(){
var groups=this.xmProjectGroupFormworkSels;
groups.forEach(i=>{
i.label=i.groupName
if(i.groupUsers){
var groupUsers=i.groupUsers;
groupUsers.forEach(i=>i.label=i.username)
i.children=groupUsers
}
})
var topLabel="组织架构"
if(this.xmProduct&&this.xmProduct.id){
topLabel=this.xmProduct.name+"-产品组织架构"
}else if(this.selProject && this.selProject.id){
topLabel=this.selProject.name+"-项目组织架构"
}
var data=[{
label:topLabel,
children:groups
}
]
return data;
}
},
//
props: ['visible',"selGroups",'selProject','isSelectSingleUser','isSelectMultiUser','xmProduct'],
watch: {
"selGroups": function(selGroups) {
if(this.selGroups){
this.selGroups.forEach(i=>{
if(i.groupUsers){
i.groupUsers.forEach(k=>k.isSelected="0")
}
})
this.xmProjectGroupFormworkSels = JSON.parse(JSON.stringify(this.selGroups));
}else{
this.xmProjectGroupFormworkSels = [];
}
if(this.imGroupVisible){
this.doSearchImGroupsByProjectId()
}
this.applyData();
},
'visible': function(visible) {
if (visible == true) {
}
},
},
data() {
return {
sectionLoading: false,
filters: {
key: '',
name:'dddddddddddddddddddddddddd'
},
load: {list: false,edit: false,del: false,add: false}, //...
sels: [], //
options: {
projectGroupType:[]
}, // params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
/**begin 自定义属性请在下面加 请加备注**/
xmProjectGroupFormworkSels: [],
userSelectVisible: false,
groupSelectVisible: false,
needAddGroupNameValue: '',
needAddGroupUserIndex: 0,
isSels: [],
convertXmProjectGroupFormworks: [],
projectGroupType:null,
xmRecordVisible:false,
xmProjectGroupStateVisible:false,
imGroups:[],
imGroupVisible:false,
groupRoleDescVisible:false,
setTemplateVisible:false,
tableHeight:300,
/**end 自定义属性请在上面加 请加备注**/
}
}, //end data
methods: {
toggleHead(index,valueIndex) {
if(this.isSelectSingleUser=='1' || this.isSelectMultiUser=='1'){
if(this.xmProjectGroupFormworkSels[index].groupUsers[valueIndex].isSelected == '1'){
this.xmProjectGroupFormworkSels[index].groupUsers[valueIndex].isSelected ='0'
}else{
this.xmProjectGroupFormworkSels[index].groupUsers[valueIndex].isSelected ='1'
}
}else{
if(this.xmProjectGroupFormworkSels[index].groupUsers[valueIndex].isHead =='1'){
this.xmProjectGroupFormworkSels[index].groupUsers[valueIndex].isHead = '0';
}else{
this.xmProjectGroupFormworkSels[index].groupUsers.forEach(u=>{
u.isHead = '0';
});
this.xmProjectGroupFormworkSels[index].groupUsers[valueIndex].isHead = '1';
}
}
},
applyData(){
let checked = this.convertXmProjectGroupFormworks.filter(i=>this.xmProjectGroupFormworkSels.some(j=> j.groupName == i.groupName));
if(checked && checked.length > 0){
checked.forEach(item=>{
if(this.$refs.groupTable){
this.$refs.groupTable.toggleRowSelection(item,true);
}
});
}
},
//
changesels(row) {
this.$refs.groupTable.toggleRowSelection(row);
},
//
addIsSels(v){
this.isSels = v;
},
//ok
addGroupName() {
let that = this;
if(!this.selProject || !this.selProject.id){
this.$message({showClose: true,
message:"未知项目,不允许添加小组",
type: 'error'
});
return false;
}
if(this.projectGroupType==null){
this.$message({showClose: true,
message:"项目小组类型为空,请选择小组类型后操作",
type: 'error'
});
return false;
}
if(!this.needAddGroupNameValue) {
this.$message({showClose: true,
message:"小组名称不能为空",
type: 'error'
});
return;
}
if(this.convertXmProjectGroupFormworks.some(i=>i.groupName==this.needAddGroupNameValue.trim())){
this.$message({showClose: true,
message:"团队名已经存在",
type: 'error'
});
return false;
}
let params = {
"groupName": this.needAddGroupNameValue,
"isPub": "1",
"pgTypeId":this.projectGroupType.optionValue,
"pgTypeName":this.projectGroupType.optionName
};
if(!this.userInfo.isPlatformAdmin && !this.userInfo.isSuperAdmin){
params.branchId = this.workShop.branchId;
params.isPub = "0";
}
that.sectionLoading = true;
addXmProjectGroupFormwork(params).then((res) => {
that.sectionLoading = false;
var tips = res.data.tips;
var data=res.data.data;
if (tips.isOk) {
that.needAddGroupNameValue = '';
this.getXmProjectGroupFormworks()
}
this.$message({showClose: true,
message: tips.msg,
type: tips.isOk ? 'success' : 'error'
});
}).catch(err => this.sectionLoading = false);
},
//ok
deleteGroup(index,row){
let that = this;
let params =row
if (!params.id) {return;}
this.$confirm('此操作将永久删除该团队名, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.sectionLoading = true;
delXmProjectGroupFormwork(params).then((res) => {
that.sectionLoading = false;
var tips = res.data.tips;
if (tips.isOk) {
that.convertXmProjectGroupFormworks.splice(index,1);
}
that.$message({
message: tips.msg,
type: tips.isOk ? 'success' : 'error'
});
}).catch(err => that.sectionLoading = false);
}).catch(() => {});
},
//
getXmProjectGroupFormworks() {
let params = {};
params.branchId = this.workShop.branchId;
this.load.list = true;
listXmProjectGroupFormwork(params).then((res) => {
var tips = res.data.tips;
if (tips.isOk) {
let allXmProjectGroupFormwork = res.data.data;
const len = allXmProjectGroupFormwork.length;
let convert = [];
for(let i=0;i<len;i++) {
let xmProjectGroupFormwork = allXmProjectGroupFormwork[i];
let json = {
"groupUsers": [],
"id": xmProjectGroupFormwork.id,
"groupName": xmProjectGroupFormwork.groupName,
"isPub": xmProjectGroupFormwork.isPub,
"pgTypeId":xmProjectGroupFormwork.pgTypeId,
"pgTypeName":xmProjectGroupFormwork.pgTypeName,
}
convert.push(json);
}
this.convertXmProjectGroupFormworks = convert;
console.log("applyData");
} else {
this.$message({showClose: true,
message: tips.msg,
type: 'error'
});
}
this.load.list =false
}).then(()=>{
this.$nextTick(() => {
this.applyData();
})
}).catch(err =>this.load.list =false);
},
//
groupConfirm(){
this.$emit("select-confirm",this.xmProjectGroupFormworkSels);
},
userConfirm(){
var users=[];
this.xmProjectGroupFormworkSels.forEach(i=>{
if(i.groupUsers){
i.groupUsers.forEach(k=>{
if(k.isSelected=='1'){
users.push(k);
}
})
}
})
if(this.isSelectSingleUser=='1'){
if(users.length>1){
this.$message({showClose: true,
message: '只能选中一个用户',
type: 'error'
});
return
}
}
this.$emit("user-confirm",users);
},
//
groupNameConfirm() {
this.isSels.forEach(i=>{
if(!this.xmProjectGroupFormworkSels.some(j=>j.groupName == i.groupName)){
i.projectId=this.selProject.id
i.projectName=this.selProject.name
this.xmProjectGroupFormworkSels.push(i);
}
});
//this.xmProjectGroupFormworkSels = this.xmProjectGroupFormworkSels.filter(i=> this.isSels.some(j=>j.groupName == i.groupName));
console.log(this.xmProjectGroupFormworkSels);
this.groupSelectVisible = false;
},
//
addGroupUser(index) {
this.needAddGroupUserIndex = index;
this.userSelectVisible = true;
},
//
onUserSelected: function(groupUsers) {
const index = this.needAddGroupUserIndex;
let user = this.xmProjectGroupFormworkSels[index].groupUsers;
groupUsers.forEach((u) => {
if(!user.some(i=>i.userid === u.userid)){
let json = {
"userid": u.userid,
"username": u.username,
"isHead": '0',
'isSelected':'0'
};
user.push(json);
}
});
this.userSelectVisible = false;
},
delGroupUser(index,vindex) {
this.xmProjectGroupFormworkSels[index].groupUsers.splice(vindex,1);
},
delGroup(group,index) {
this.xmProjectGroupFormworkSels.splice(index,1);
},
/**begin 自定义函数请在下面加**/
showGroupFormwork:function(){
this.groupSelectVisible=true;
this.$nextTick(() => {
this.applyData();
})
},
showGroupState(){
this.xmProjectGroupStateVisible=true;
},
doSearchImGroupsByProjectId(){
var params={bizPid:this.selProject.id}
listImGroup(params).then(res=>{
this.imGroupVisible=true;
var tips = res.data.tips;
if(tips.isOk){
this.imGroups=res.data.data;
}
this.$message({showClose: true,
message: tips.msg,
type: tips.isOk ? 'success' : 'error'
});
});
},
doCreateImGroup(group){
if(group.groupUsers && group.groupUsers.length>0){
var params={
msgId:sn(),
groupId:group.id,
groupName:group.name,
msgType:'group',
action:'channelGroupCreate',
cuserid:this.userInfo.userid,
cusername:this.userInfo.username,
branchId:this.userInfo.branchId,
bizId:group.id,
bizPid:this.selProject.id,
users:group.groupUsers.map(gu=>{
return {
userid:gu.userid,
username:gu.username
}
})
}
publishMessage(params).then(res=>{
var tips = res.data.tips;
if(tips.isOk){
params.id=params.groupId
this.imGroups.push(params);
}
this.$message({showClose: true,
message: tips.msg,
type: tips.isOk ? 'success' : 'error'
});
})
}else{
that.$message({
message: "组员为空,不允许绑定",
type: 'error'
});
}
},
renderCurrentClass (node) {
return 'label-bg-blue'
},
handleNodeClick (data) {
alert(`我是${data.label},我被点击了`)
},
renderContent (h, node) {
return (
<div class={'diy-wrapper', node.isCurrent ? 'current-select' : ''}>
<div class={'diy-con-name',node.data.userid? 'el-icon-user':''}>{node.data.label}</div>
<div class="diy-con-content">
{node.data.leaderUsername?
(<div> {node.data.leaderUsername }</div>
)
:
(<div> </div>)
}
</div>
</div>
)
}
/**end 自定义函数请在上面加**/
}, //end methods
components: {
UsersSelect,XmProjectGroupStateMng,VueOkrTree
//
},
mounted() {
this.$nextTick(() => {
var subHeight=400/1000 * window.innerHeight;
this.tableHeight = window.innerHeight -subHeight;
if(this.selGroups){
this.selGroups.forEach(i=>{
if(i.groupUsers){
i.groupUsers.forEach(k=>k.isSelected="0")
}
})
this.xmProjectGroupFormworkSels = JSON.parse(JSON.stringify(this.selGroups));
}
this.getXmProjectGroupFormworks();
listOption([{categoryId:'all',itemCode:'projectGroupType'}] ).then(res=>{
if(res.data.tips.isOk){
this.options['projectGroupType']=res.data.data.projectGroupType
}
});
});
}
}
</script>
<style>
.label-class-blue{
color: #1989fa;
}
.label-bg-blue{
background: #1989fa;
color: #fff;
}
.diy-wrapper{
padding:10px
}
.no-padding{
padding: 0 !important;
}
.diy-wrapper.left-child{
border: 1px solid red;
}
.diy-con-name{
color: black;
}
.crrentClass{
border: 1px solid red;
color: blue;
}
</style>
<style scoped>
</style>
Loading…
Cancel
Save