Commit c08606a5 authored by 夏敏伟's avatar 夏敏伟

增加审批以及配置功能 修改部分bug

parent 9a640bea
import { get, post, addParam, addParamNew } from "../../util/http_util";
const PREFIX_RECORDS = 'api/rest/chat/approvalPending';
//待审批数据查询
export const getApprovalPending = (chatRoomName, currPage, pageSize, startTime, endTime, userId, messageStatus) => {
let url = `${PREFIX_RECORDS}/chatroom/page`;
url += addParamNew({ chatRoomName, currPage, pageSize, startTime, endTime, userId, messageStatus });
return get(url);
}
\ No newline at end of file
......@@ -13,8 +13,8 @@ export const createChatRoom = data => {
}
//查询某个聊天室(群组)详情信息
export const getChatRoomInfo = (id, userId) => {
return get(`${PREFIX_CHATROOM}/info?id=${id}&userId=${userId}`);
export const getChatRoomMemberInfo = (id, userId) => {
return get(`${PREFIX_CHATROOM}/memberInfo?id=${id}&userId=${userId}`);
}
//加入聊天室(群组)
......@@ -67,6 +67,10 @@ export const stopExercise = (data) => {
return post(`${PREFIX_CHATROOM}/end`, data);
}
//配置聊天室(群组)
export const setMember = (data) => {
return post(`${PREFIX_CHATROOM}/setMember`, data);
}
......
......@@ -310,7 +310,7 @@ let getTime_extent = (n) => {
let pre_rq = pre_year + '-' + pre_newMonth + '-' + pre_newDate;
let pre_rq_start = pre_year + '-' + pre_newMonth + '-' + pre_newDate + ' ' + '00:00:00';
let pre_rq_end = pre_year + '-' + pre_newMonth + '-' + pre_newDate + ' ' + '23:59:59';
let currentDate = pre_year + '-' + pre_newMonth + '-' + pre_newDate + ' ' +now.toLocaleTimeString();
let currentDate = pre_year + '-' + pre_newMonth + '-' + pre_newDate + ' ' + now.toLocaleTimeString();
return {
pre_rq,
pre_rq_start,
......@@ -471,6 +471,24 @@ const addParam = (param) => {
return url;
}
const addParamNew = param => {
let url = "", i = 0;
let keys = Object.getOwnPropertyNames(param);
keys.forEach(function (key, index) {
if (param[key] != undefined) {
if (i == 0) {
url += "?";
i++;
}
url += key + "=" + param[key];
if (index != keys.length - 1) {
url += "&";
}
}
});
return url;
}
let get_exame = (url, headers = {}) => {
return new Promise((resolve, reject) => {
fetch(url, {
......@@ -665,5 +683,6 @@ export {
delete_util_exame,
fileUpload_PUT,
post_technique,
post_technique_entity
post_technique_entity,
addParamNew
}
\ No newline at end of file
<template>
<el-dialog v-el-drag-dialog title="聊天室" :visible.sync="dialogVisible" width="40%" :before-close="handleClose"
<el-dialog v-el-drag-dialog :title="title" :visible.sync="dialogVisible" width="40%" :before-close="handleClose"
@open="handleDialogOpen">
<div class="info-messageInfo">
<div class="messageInfo-content">
......@@ -68,7 +68,8 @@ export default {
myStompClient: null,
file: null,
imgList: [],
noticeMessage: ''
noticeMessage: '',
title: '聊天室'
}
},
directives: {
......@@ -83,7 +84,6 @@ export default {
methods: {
handleClose() {
this.dialogVisible = false;
// this.$emit('handleCancel');
},
showDialog() {
this.dialogVisible = true;
......@@ -101,9 +101,6 @@ export default {
return new File([u8arr], `${filename}.${suffix}`, {
type: mime
})
},
upLoadImg() {
},
sendMessageFn() {
if (this.$refs.editor.innerHTML.trim().length > 0) {
......@@ -112,7 +109,7 @@ export default {
this.imgList = [];
tmpArr.forEach((item, index) => {
let tmpObj = { content: item, messageForm: 'TEXT' }
if (item.indexOf('data:image/jpeg;base64') == 0||item.indexOf('data:image/png;base64') == 0) {
if (item.indexOf('data:image/jpeg;base64') == 0 || item.indexOf('data:image/png;base64') == 0) {
let obj = { index: index, url: item }
this.imgList.push(obj);
tmpObj.messageForm = 'PICTURE';
......@@ -181,6 +178,7 @@ export default {
handleDialogOpen() {
// this.analogDataList = this.$props.analogData;
this.currentChatRoom = this.$props.currentChatRoomInfo;
this.title = this.currentChatRoom.teamInfo.teamName;
this.myStompClient = this.$props.stompClient;
//订阅
this.listChatroom(this.currentChatRoom);
......
......@@ -35,7 +35,7 @@
</div>
<div class="everyDayNew">
<div class="everyTemplate">
<div v-for="item1 in item.news"
<div v-for="(item1,index1) in item.news"
:class="['everyDayNewCard', 'cardType' + item1.teamInfo.teamType]">
<div class="everyDayNewCardTitle" v-text="item1.title"></div>
<div class="everyDayNewCardContent">
......@@ -90,14 +90,13 @@
<NoticeDialog ref="myNotice" :stompClient="stompClient" :currentChatRoomInfo="currentChatRoomInfo"></NoticeDialog>
<ChatRoomDialog ref="myChatRoom" :currentChatRoomInfo="currentChatRoomInfo" :stompClient="stompClient">
</ChatRoomDialog>
<ChatRoomPeople ref="myChatRoomPeople" :peopleList="peopleList"></ChatRoomPeople>
<ChatRoomPeople ref="myChatRoomPeople" :currentTeamInfo="currentChatRoomInfo"></ChatRoomPeople>
</div>
</template>
<script>
import goBack from '@/assets/img/xjs/4.png';
import { getRecordsByPaging, updateStatus } from '@/api/chat/chatRecords';
import { getChatRoomInfo } from "@/api/chat/chatRoom";
import { getTime_extent } from '@/util/http_util.js';
import NoticeDialog from '@/view/ddkz/components/noticeDialog.vue';
import ChatRoomDialog from "@/view/ddkz/components/chatRoomDialog.vue";
......@@ -120,7 +119,7 @@ export default {
newsList: [],
publicNoticeList: [],
stompClient: { connected: false },
peopleList: [],
// peopleList: [],
notifications: []
// status:false
}
......@@ -233,12 +232,6 @@ export default {
sendEmail() {
alert('敬请期待');
},
getCurrentTeamPeople(item) {
//查询聊天组的人员
getChatRoomInfo(item.id, this.userInfo.account).then(res => {
this.peopleList = res.chatRoomMemberRelationBOList;
});
},
showLiterature(url) {
window.open("api/rest/file/download/CHAT/" + url);
},
......@@ -270,7 +263,7 @@ export default {
on: {
//为按钮绑定点击事件
click: () => {
this.approvalNotice(item.id, 'REJECT')
this.approvalNotice(item.id, 'REFUSE')
}
},
style: {
......@@ -281,7 +274,7 @@ export default {
}, '驳回');
const contentDiv = h('div', {}, `内容:${item.content}`);
const fileDiv = h('div', {}, `测试.png`);
const fileDiv = h('div', {}, `附件名称:${item.remark==''?'暂无':item.remark}`);
const divTemplate = h('div', { style: { textAlign: 'center' } }, [agreeButton, rejectButton])
let myNotify = this.$notify({
title: item.title,
......@@ -290,7 +283,7 @@ export default {
message: h('div', {
style: {}
},
[contentDiv, fileDiv, divTemplate]
[contentDiv,fileDiv, divTemplate]
)
});
this.notifications[item.id] = myNotify
......@@ -344,7 +337,7 @@ export default {
// this.status = this.stompClient.connected;
this.listChatroom(this.currentChatRoomInfo);
//获取当前组成员
this.getCurrentTeamPeople(this.currentChatRoomInfo);
// this.getCurrentTeamPeople(this.currentChatRoomInfo);
//获取当前公告列表
this.getRecordsByPagingFn(this.currentChatRoomInfo);
}
......
<template>
<el-dialog v-el-drag-dialog title="人员情况" :visible.sync="dialogVisible" width="40%"
:before-close="handleClose" @open="handleDialogOpen">
<el-dialog v-el-drag-dialog title="人员情况" :visible.sync="dialogVisible" width="40%" :before-close="handleClose"
@open="handleDialogOpen">
<div class="info-personInfo">
<div class="personInfo-content">
<div v-for="item in personList" class="everyPersonList">
<span v-text="item.userId" @click="selectPerson(item);"></span>
<div v-for="item in personList" class="everyTeam">
<div class="teamInfo">
<span>队伍名称:<span>{{ item.teamName }}</span></span>
<!-- <span>角色:<span>{{ item.teamType }}</span></span> -->
</div>
<div class="peopleInfo">
<div v-for="item1 in item.teamMemberStateBOList" class="everyPersonList">
<span class="isOnline" :style="{ backgroundColor: item1.online ? 'green' : 'gray' }"></span>
<span class="username" :style="{ color: item1.online ? 'green' : 'white' }"
v-text="item1.userId"></span>
</div>
</div>
</div>
</div>
</div>
......@@ -14,18 +24,20 @@
<script>
import elDragDialog from "@/util/directive/el-dragDialog";
import { getChatRoomMemberInfo } from "@/api/chat/chatRoom";
export default {
data() {
return {
dialogVisible: false,
personList: []
personList: [],
teamInfo: {}
}
},
directives: {
elDragDialog
},
props: {
peopleList: Array
currentTeamInfo: Object
},
methods: {
handleClose() {
......@@ -35,7 +47,25 @@ export default {
this.dialogVisible = true;
},
handleDialogOpen() {
this.personList = this.$props.peopleList;
this.teamInfo = this.$props.currentTeamInfo;
this.getCurrentTeamPeople(this.teamInfo);
},
getCurrentTeamPeople(item) {
//查询聊天组的人员
getChatRoomMemberInfo(item.id, this.userInfo.account).then(res => {
this.personList = res;
}).catch(error => {
this.$message.error(error);
});
},
},
computed: {
userInfo() {
if (this.$store.getters.userInfo) {
return this.$store.getters.userInfo;
} else {
return { account: "" };
}
}
}
}
......@@ -68,60 +98,80 @@ export default {
.personInfo-content {
width: 100%;
height: 100%;
.everyTeam {
width: calc(33% - 10px);
height: calc(100% - 30px);
border: 1px solid #3a5f94c9;
border-radius: 6px;
padding: 5px;
box-sizing: border-box;
float: left;
margin-top: 10px;
margin-left: 8px;
.everyPersonList {
.teamInfo {
width: 100%;
height: 35px;
line-height: 35px;
margin-top: 10px;
padding: 0px 50px;
font-size: 13px;
color: #f1f1f7;
box-sizing: border-box;
height: 30px;
text-align: center;
&:nth-child(3n) {
background-image: url(../../../assets/img/ddkz/12.png);
background-size: 100% 100%;
}
&>span {
margin-left: 20px;
color: white;
&:nth-child(3n+1) {
background-image: url(../../../assets/img/ddkz/13.png);
background-size: 100% 100%;
&>span {
color: #2c8aeb;
}
}
&:nth-child(3n+2) {
background-image: url(../../../assets/img/ddkz/14.png);
background-size: 100% 100%;
}
&>span {
float: left;
margin-left: 10px;
.peopleInfo {
width: 100%;
height: calc(100% - 30px);
overflow-y: auto;
&:hover {
color: green;
cursor: pointer;
&::-webkit-scrollbar {
display: none;
}
&>span:first-child {
float: left;
}
.everyPersonList {
width: 100%;
height: 30px;
line-height: 35px;
padding-left: 70px;
margin-top: 5px;
&>span:last-child {
.isOnline {
width: 10px;
height: 10px;
border-radius: 50%;
display: block;
float: left;
margin-top: 12.5px;
margin-left: 5px;
display: inline-block;
margin-right: 5px;
}
.username {
color: white;
}
}
&>div:nth-child(3n) {
background-image: url(@/assets/img/ddkz/12.png);
background-size: 100% 100%;
}
&>div:nth-child(3n+1) {
background-image: url(@/assets/img/ddkz/13.png);
background-size: 100% 100%;
}
&>div:nth-child(3n+2) {
background-image: url(@/assets/img/ddkz/14.png);
background-size: 100% 100%;
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -39,6 +39,7 @@ export default {
title: '',
content: '',
attachment: '',
remark:'',
messageForm: null
},
formatFile: format_file(),
......@@ -76,7 +77,7 @@ export default {
} else {
this.form.messageForm = 'TEXT';
}
this.form.remark = file.name;
});
},
handleRemove() {
......@@ -92,7 +93,7 @@ export default {
messageForm: null
};
this.handleRemove();
this.dialogVisible = false;
},
handleDialogOpen() {
this.myStompClient = this.$props.stompClient;
......
......@@ -20,10 +20,9 @@
</div>
<div class="top-nav3">
<div class="top-nav3-content">
<!-- <div class="top-nav3-content-user" @click="dialogVisible = true;">
<i class="el-icon-user-solid"></i>
<span v-text="userInfo.username"></span>
</div> -->
<div class="top-nav3-content-user" @click="dialogVisible = true;">
<i class="el-icon-user-solid"></i><span v-text="userInfo.username"></span>
</div>
<!-- <div class="top-nav3-content-user" v-if="noteNum > 0">
<a @click="queryNotification()" class="nav-link">
<div class="nav-counter nav-counter-red" v-text="noteNum"></div>
......@@ -402,7 +401,7 @@ export default {
position: absolute;
text-align: center;
top: 20px;
left: 6%;
left: 7%;
.module-info {
width: 33%;
......@@ -440,7 +439,7 @@ export default {
right: 0px;
text-align: center;
top: 20px;
right: 6%;
right: 7%;
.module-info {
width: 33%;
......@@ -484,9 +483,9 @@ export default {
}
.top-nav3 {
width: 60px;
width: 100px;
height: 40px;
padding-left: 2%;
padding-left: 1%;
position: absolute;
top: 20px;
right: 0px;
......@@ -498,7 +497,7 @@ export default {
line-height: 32px;
position: relative;
top: calc(50% - 16px);
font-size: 17px;
font-size: 15px;
}
.top-nav3-content-user {
......
......@@ -94,10 +94,10 @@
</div>
</el-form-item>
<el-form-item label="组长" v-if="item.wpinfo.length>0">
<el-form-item label="组长" v-if="item.wpinfo.length > 0">
<el-select v-model="item.leader" placeholder="请选择组长">
<el-option v-for="item in item.wpinfo" :key="item.account" :label="item.account"
:value="item.account">
<el-option v-for="item1 in item.wpinfo" :key="item1.account" :label="item1.account"
:value="item1.account">
</el-option>
</el-select>
</el-form-item>
......@@ -121,7 +121,7 @@ export default {
chatroomOwner: null,
conRemark: '',
nickname: '',
director:[],
director: [],
chatroomHeadPic: '',
teams: [
{
......@@ -285,6 +285,7 @@ export default {
})
},
createMeeting() {
if (this.formData.director.length > 0) {
this.formData.chatroomOwner = this.userInfo.account;
this.formData.teams.forEach(item => {
item.createTime = getTime_extent(0).currentDate;
......@@ -299,6 +300,9 @@ export default {
}).catch(error => {
this.$message.error(error);
})
} else {
this.$message.warning('导演部不能为空!');
}
}
},
computed: {
......@@ -363,8 +367,7 @@ export default {
box-sizing: border-box;
border-radius: 4px;
&>div:first-child
{
&>div:first-child {
margin-top: 10px;
display: flex;
......
......@@ -4,7 +4,7 @@
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="form.dateRange" type="daterange" range-separator="至"
start-placeholder="开始时间" end-placeholder="结束时间" :default-time="['00:00:00', '23:59:59']">
</el-date-picker>
<el-input class="myInput" v-model="form.chatRoomName" placeholder="请输入聊天室名称" clearable></el-input>
<el-input v-model="form.chatRoomName" placeholder="请输入聊天室名称" clearable></el-input>
<el-select style="margin-left: 10px;" v-model="form.status" placeholder="请选择审批状态" clearable>
<el-option v-for="item in stateList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
......@@ -14,29 +14,38 @@
<div class="yxspContent">
<el-table :data="meetingList" tooltip-effect="dark" style="width: 100%;" height="calc(100% - 60px)">
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column>
<el-table-column prop="nickname" label="演习标题" align="center"></el-table-column>
<el-table-column prop="conRemark" label="演习方" align="center"></el-table-column>
<el-table-column prop="createTime" label="发送标题" align="center"></el-table-column>
<el-table-column prop="status.name" label="发送内容" align="center"></el-table-column>
<el-table-column prop="createTime" label="发送附件" align="center"></el-table-column>
<el-table-column prop="chatRoomInfo.nickname" label="演习标题" align="center"></el-table-column>
<el-table-column prop="teamInfo.teamType" label="演习方" align="center"></el-table-column>
<el-table-column prop="title" label="发送标题" align="center"></el-table-column>
<el-table-column prop="content" label="发送内容" align="center"></el-table-column>
<el-table-column prop="remark" label="发送附件" align="center"></el-table-column>
<el-table-column prop="createTime" label="开始时间" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="500">
<template slot-scope="scope">
<el-button size="mini" type="primary">详情</el-button>
<el-button v-if="scope.row.status.name == '审核中'" size="mini" type="danger"
<!-- <el-button size="mini" type="primary">详情</ el-button> -->
<el-button v-if="(scope.row.messageStatus?scope.row.messageStatus.name:null) == '待审批'" size="mini" type="success"
@click="passNotice(scope.row)">同意</el-button>
<el-button v-if="(scope.row.messageStatus?scope.row.messageStatus.name:null) == '待审批'" size="mini" type="danger"
@click="rejectNotice(scope.row)">驳回</el-button>
<el-button v-if="scope.row.status.name == '待开始'" size="mini" type="success"
@click="passNotice(scope.row)">审核通过</el-button>
<el-tag v-if="scope.row.status.name == '审核通过'" type="success" effect="dark">已通过</el-tag>
<el-tag v-if="scope.row.status.name == '审核未通过'" type="danger" effect="dark">未通过</el-tag>
<el-tag v-if="(scope.row.messageStatus?scope.row.messageStatus.name:null) == '已同意'" type="success" effect="dark">已通过</el-tag>
<el-tag v-if="(scope.row.messageStatus?scope.row.messageStatus.name:null) == '已拒绝'" type="danger" effect="dark">未通过</el-tag>
</template>
</el-table-column>
</el-table>
<div class="pagination-div">
<el-pagination class="myPagination" background layout="total, sizes, prev, pager, next, jumper"
:current-page="pageObj.currentPage" :total="pageObj.total" @current-change="handleCurrentChange"
@size-change="handleSizeChange" :page-size="pageObj.everySize" :page-sizes="[10, 20, 50, 100]">
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { getApprovalPending } from '@/api/chat/chatApproval';
import { updateStatus } from '@/api/chat/chatRecords';
import { getTime_extent } from '@/util/http_util.js';
export default {
data() {
return {
......@@ -46,27 +55,74 @@ export default {
status: null
},
stateList: [
{ label: '审核通过', value: 'PASSED' },
{ label: '审核未通过', value: 'REJECT' },
{ label: '审核中', value: 'INREVIEW' },
{ label: '已同意', value: 'PASS' },
{ label: '已拒绝', value: 'REFUSE' },
{ label: '待审批', value: 'PENDING_APPROVAL' },
],
meetingList: []
meetingList: [],
pageObj: {
currentPage: 1,
everySize: 10,
total: 0
}
}
},
methods: {
rejectNotice(item) {
updateStatus(item.id, 'REFUSE').then(res => {
this.$message.success(res);
this.searchChatList();
}).catch(error => {
this.$message.error(error);
})
},
passNotice(item) {
updateStatus(item.id, 'PASS').then(res => {
this.$message.success(res);
this.searchChatList();
}).catch(error => {
this.$message.error(error);
})
},
searchChatList() {
if (this.form.dateRange.length == 2) {
this.queryChatRoomListFn({ startTime: this.form.dateRange[0], endTime: this.form.dateRange[1], userId: this.userInfo.account, status: this.form.status == '' ? null : this.form.status, chatRoomName: this.form.chatRoomName == '' ? null : this.form.chatRoomName })
this.getApprovalPendingFn(this.form.chatRoomName, this.pageObj.currentPage, this.pageObj.pageSize, this.form.dateRange[0], this.form.dateRange[1], this.userInfo.account, this.form.status);
} else {
this.queryChatRoomListFn({ userId: this.userInfo.account, status: this.form.status == '' ? null : this.form.status, chatRoomName: this.form.chatRoomName == '' ? null : this.form.chatRoomName })
this.getApprovalPendingFn(this.form.chatRoomName, this.pageObj.currentPage, this.pageObj.pageSize, null, null, this.userInfo.account, this.form.status);
}
},
getApprovalPendingFn(...params) {
getApprovalPending(...params).then(res => {
this.meetingList = res.records;
this.pageObj.currentPage = res.currentPage;
this.pageObj.pageSize = res.pageSize;
this.pageObj.total = res.total;
}).catch(error => {
this.$message.error(error.message);
})
},
handleCurrentChange(currentPage) {
this.pageObj.currentPage = currentPage;
this.searchChatList();
},
handleSizeChange(pageSize) {
this.pageObj.everySize = pageSize;
this.searchChatList();
},
},
computed: {
userInfo() {
if (this.$store.getters.userInfo) {
return this.$store.getters.userInfo;
} else {
return { account: "" };
}
}
},
mounted() {
this.getApprovalPendingFn(null, this.pageObj.currentPage, this.pageObj.pageSize, this.form.dateRange.length > 0 ? this.form.dateRange[0] : null, this.form.dateRange.length > 0 ? this.form.dateRange[1] : null, this.userInfo.account, null);
}
}
</script>
......@@ -97,6 +153,7 @@ export default {
.el-input {
float: left;
width: 200px;
height: 40px;
margin-left: 10px;
.el-input__inner {
......@@ -216,6 +273,10 @@ export default {
box-shadow: 0 0 10px #1b6097;
background-color: #1d2d46;
}
.el-input--suffix .el-input__inner{
height: 28px;
}
}
}
}
......
<template>
<el-dialog title="演习配置" :visible.sync="dialogVisible" width="40%" :before-close="handleClose" @open="handleDialogOpen">
<div class="configExercise">
<el-form class="yhf" v-for="(item, index) in formData.teams" :key="index" label-width="80px">
<el-form-item label="队伍名称">
<el-input class="teamName" v-model="item.teamName" v-if="item.teamType != 'DIRECTOR'"></el-input>
<el-tag class="myTag" v-if="item.teamType == 'DIRECTOR'" type="success" effect="dark"
v-text="item.teamType == 'DIRECTOR' ? '导演组' : ''"></el-tag>
<span class="myIcon el-icon-remove-outline"
v-if="item.teamType != 'DIRECTOR' && formData.teams.length > 1" @click="removeTeam(index)"></span>
</el-form-item>
<el-form-item label="参会人员">
<div class="PackView_transfer">
<div class="ta-transfer">
<div class="ta-transfer_left">
<div class="transfer-view-head">
<div class="head_left">
<el-checkbox :indeterminate="item.invoking.isIndeterminate"
:disabled='allData.length == 0' v-model="item.invoking.checkAll"
@change="handleCheckAllChange($event, index, true)">人员列表</el-checkbox>
</div>
<div class="head_right">
<span>{{ item.invoking.selected_num }}</span>
<span>/</span>
<span>{{ allData.length }}</span>
</div>
</div>
<div class="transfer-view-main">
<el-checkbox-group v-model="item.invoking.checkedCities"
@change="handleCheckedCitiesChange($event, index, true)">
<div class="transfer-view-item" v-for="(item1, index1) in allData">
<el-checkbox :label="item1.id" :key="item1.account">{{ item1.account
}}</el-checkbox>
</div>
</el-checkbox-group>
</div>
</div>
<div class="ta-transfer_btn">
<el-button type="primary" :disabled='item.parameter.selected_num == 0'
@click="removePeopleFromMeeting(index)" icon="el-icon-arrow-left">离席</el-button>
<el-button type="primary" :disabled='item.invoking.selected_num == 0'
@click='addPeopleToMeeting(index)'>参会
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
</div>
<div class="ta-transfer_right">
<div class="transfer-view-head">
<div class="head_left">
<el-checkbox :indeterminate="item.parameter.isIndeterminate"
:disabled='item.wpinfo.length == 0' v-model="item.parameter.checkAll"
@change="handleCheckAllChange($event, index)">
参会人员
</el-checkbox>
</div>
<div class="head_right">
<span>{{ item.parameter.selected_num }}</span>
<span>/</span>
<span>{{ item.wpinfo.length }}</span>
</div>
</div>
<div class="transfer-view-main">
<el-checkbox-group v-model="item.parameter.checkedCities"
@change="handleCheckedCitiesChange($event, index)">
<div class="transfer-view-item" v-for="(item1, index1) in item.wpinfo">
<el-checkbox :label="item1.id" :key="item1.account">{{ item1.account
}}</el-checkbox>
</div>
</el-checkbox-group>
</div>
</div>
</div>
</div>
</el-form-item>
<el-form-item label="组长" v-if="item.wpinfo.length > 0 && item.teamType != 'DIRECTOR'">
<el-select class="mySelect" v-model="item.leader" placeholder="请选择组长">
<el-option v-for="item1 in item.wpinfo" :key="item1.account" :label="item1.account"
:value="item1.account">
</el-option>
</el-select>
</el-form-item>
<el-divider v-if="index != formData.teams.length - 1"></el-divider>
</el-form>
<div class="buttonDiv">
<el-button type="primary" @click="addTeam">增加与会方</el-button>
<el-button type="success" @click="submitExercisePeople">提交</el-button>
</div>
</div>
</el-dialog>
</template>
<script>
import { getChatRoomMemberInfo, setMember } from "@/api/chat/chatRoom";
import { getUserList } from '@/api/user.js';
export default {
data() {
return {
dialogVisible: false,
exerciseObj: {},
formData: {
id: '',
director: [],
teams: [
{
member: [],
teamName: '',
teamType: null,
invoking: {
checkedCities: [],
selected_num: 0,
isIndeterminate: false,
checkAll: false
},
parameter: {
isIndeterminate: false,
checkAll: false,
checkedCities: [],
selected_num: 0,
dataAll: []
},
wpinfo: [],
leader: null
}
]
},
allData: [],
tmpArr: [],
exerciseList: []
}
},
props: {
currentExercise: Object
},
methods: {
handleClose() {
this.dialogVisible = false;
},
showDialog() {
this.dialogVisible = true;
},
getChatRoomMemberList(item) {
getChatRoomMemberInfo(item.id, this.userInfo.account).then(res => {
this.exerciseList = res;
let tmpList = [];
this.formData.teams = [];
this.exerciseList.forEach((item, index) => {
let obj = {
member: [],
teamName: item.teamName,
teamType: item.teamType,
invoking: {
checkedCities: [],
selected_num: 0,
isIndeterminate: false,
checkAll: false
},
parameter: {
isIndeterminate: false,
checkAll: false,
checkedCities: [],
selected_num: 0,
dataAll: []
},
wpinfo: [],
leader: item.leader
};
item.teamMemberStateBOList.forEach((item1, index1) => {
obj.wpinfo.push(this.allData.filter(item2 => { return item2.account == item1.userId })[0]);
});
item.teamMemberStateBOList.forEach((item1, index1) => {
this.allData = this.allData.filter(item2 => { return item2.account != item1.userId });
});
tmpList.push(obj);
})
let index = tmpList.findIndex(item => item.teamType == 'DIRECTOR');
if (index > 0) {
tmpList.unshift(tmpList.splice(index, 1)[0])
}
this.formData.teams = tmpList;
}).catch(error => {
this.$message.error(error);
})
},
handleDialogOpen() {
this.exerciseObj = this.$props.currentExercise;
this.allData = this.tmpArr;
this.getChatRoomMemberList(this.exerciseObj);
},
addTeam() {
this.formData.teams.push(
{
teamName: '',
member: [],
invoking: {
checkedCities: [],
selected_num: 0,
isIndeterminate: false,
checkAll: false
},
parameter: {
isIndeterminate: false,
checkAll: false,
checkedCities: [],
selected_num: 0,
dataAll: []
},
wpinfo: [],
leader: null
}
);
},
addPeopleToMeeting(index) { //参会
let formData = this.formData.teams[index].invoking.checkedCities
for (const key in formData) {
for (const k in this.allData) {
if (this.allData[k].id == formData[key]) {
this.formData.teams[index].wpinfo.push.apply(this.formData.teams[index].wpinfo, this.allData.splice(k, 1))
}
}
}
for (const key in this.formData.teams[index].wpinfo) {
this.formData.teams[index].parameter.dataAll.push(this.formData.teams[index].wpinfo[key].id)
}
this.formData.teams[index].invoking.selected_num = 0
this.formData.teams[index].invoking.isIndeterminate = false
this.formData.teams[index].invoking.checkedCities = []
this.formData.teams[index].invoking.checkAll = false
},
removePeopleFromMeeting(index) { //离席
let formData = this.formData.teams[index].parameter.checkedCities
for (const key in formData) {
for (const k in this.formData.teams[index].wpinfo) {
if (this.formData.teams[index].wpinfo[k].id == formData[key]) {
this.allData.push.apply(this.allData, this.formData.teams[index].wpinfo.splice(k, 1))
}
}
}
this.formData.teams[index].parameter.selected_num = 0
this.formData.teams[index].parameter.isIndeterminate = false
this.formData.teams[index].parameter.checkedCities = []
this.formData.teams[index].parameter.checkAll = false
},
// ----------------------------
handleCheckAllChange(val, index, falg) { //点击全选
let tmpArr = [];
this.allData.forEach(item => {
tmpArr.push(item.id);
});
if (falg) {
this.formData.teams[index].invoking.checkedCities = val ? tmpArr : [];
this.formData.teams[index].invoking.selected_num = val ? tmpArr.length : 0
this.formData.teams[index].invoking.isIndeterminate = false;
} else {
this.formData.teams[index].parameter.checkedCities = val ? this.formData.teams[index].parameter.dataAll : []
this.formData.teams[index].parameter.selected_num = val ? this.formData.teams[index].parameter.dataAll.length : 0
this.formData.teams[index].parameter.isIndeterminate = false;
}
},
handleCheckedCitiesChange(value, index, falg) { //判断是否触发全选
if (falg) {
this.formData.teams[index].invoking.selected_num = value.length
value.length >= 1 ? this.formData.teams[index].invoking.isIndeterminate = true : this.formData.teams[index].invoking.isIndeterminate = false
if (this.allData.length == value.length) {
this.formData.teams[index].invoking.checkAll = true
this.formData.teams[index].invoking.isIndeterminate = false
} else {
this.formData.teams[index].invoking.checkAll = false
}
} else {
this.formData.teams[index].parameter.selected_num = value.length
value.length >= 1 ? this.formData.teams[index].parameter.isIndeterminate = true : this.formData.teams[index].parameter.isIndeterminate = false
if (this.formData.teams[index].wpinfo.length == value.length) {
this.formData.teams[index].parameter.checkAll = true
this.formData.teams[index].parameter.isIndeterminate = false
} else {
this.formData.teams[index].parameter.checkAll = false
}
}
},
getUserListFn() {
getUserList().then(res => {
this.allData = res;
this.tmpArr = res;
})
},
removeTeam(index) {
if (this.formData.teams.length > 1) {
this.allData = this.allData.concat(this.formData.teams[index].wpinfo);
this.formData.teams.splice(index, 1)
} else {
this.$message.warning('最后一组,不能移除!');
}
},
submitExercisePeople() {
let tmpArr = {
id: this.exerciseObj.id,
director: [],
teams: []
};
this.formData.teams.forEach((item, index) => {
if (item.teamType == 'DIRECTOR') {
this.formData.director = [];
item.wpinfo.forEach(item1 => {
this.formData.director.push(item1.account);
})
tmpArr.director = this.formData.director;
} else {
item.member = [];
item.wpinfo.forEach(item1 => {
item.member.push(item1.account);
})
tmpArr.teams.push(item);
}
});
if (tmpArr.teams.length > 0) {
setMember(tmpArr).then(res => {
this.$message.success(res);
}).catch(error => {
this.$message.error(error.message);
})
} else {
this.$message.warning('除导演部外,不存在其他演习方,此演习不能修改!');
}
}
},
computed: {
userInfo() {
if (this.$store.getters.userInfo) {
return this.$store.getters.userInfo;
} else {
return { account: "" };
}
}
},
mounted() {
this.getUserListFn();
}
}
</script>
<style lang="scss">
.el-dialog {
padding: 20px;
box-sizing: border-box;
background-color: transparent;
background-image: url(../../../assets/img/home/dialog.png);
background-size: 100% 100%;
background-repeat: no-repeat;
.el-dialog__header {
text-align: center;
.el-dialog__headerbtn {
top: 35px;
.el-dialog__close {
color: white;
}
}
}
.el-dialog__body {
height: 600px;
.configExercise {
width: 100%;
height: 94%;
overflow-y: auto;
.yhf {
width: 98%;
.teamName {
width: 200px;
.el-input__inner {
color: white !important;
background: none !important;
border: 1px solid #3a5f94c9 !important;
box-shadow: 0 0 10px #3a5f94c9;
}
}
.myTag {
margin-left: 20px;
}
.myIcon {
float: right;
color: red;
font-size: 20px;
margin-top: 8px;
cursor: pointer;
}
.mySelect {
.el-input__inner {
color: white !important;
background: none !important;
border: 1px solid #3a5f94c9 !important;
box-shadow: 0 0 10px #3a5f94c9;
}
}
.el-divider {
background-color: #3a5f94c9 !important;
}
.ta-transfer {
width: 98%;
height: 300px;
// margin-bottom: 50px;
margin-left: 1%;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
.ta-transfer_left,
.ta-transfer_right {
width: 30%;
height: 100%;
background-color: #ffffff;
border: 1px solid #ebeef5;
border-radius: 5px;
.transfer-view-head {
width: 100%;
height: 50px;
background-color: #f5f7fa;
border-bottom: 1px solid #ebeef5;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 10px;
box-sizing: border-box;
.head_left {
display: flex;
width: 70%;
height: 100%;
.el-checkbox {
display: flex;
align-items: center;
height: 100%;
width: 100%;
}
.el-checkbox__label {
font-size: 16px;
}
}
.head_right {
width: 30%;
span {
font-size: 14px;
color: #909399;
}
}
}
.transfer-view-main {
width: 100%;
height: calc(100% - 50px);
padding: 10px 10px 0 10px;
box-sizing: border-box;
overflow-y: auto;
.transfer-view-item {
margin-bottom: 10px;
width: 100%;
height: 20px;
// background-color: #c5c1c1;
display: flex;
align-items: center;
.el-checkbox {
display: flex;
align-items: center;
width: 100%;
height: 100%;
.el-checkbox__label {
color: #606266;
}
.el-checkbox__input.is-checked+.el-checkbox__label {
color: #409eff;
}
}
.el-checkbox:hover {
.el-checkbox__label {
color: #409eff;
}
}
}
}
}
.ta-transfer_btn {
display: flex;
justify-content: center;
align-items: center;
width: 30%;
height: 100px;
}
}
}
.buttonDiv {
text-align: center;
}
}
}
}
</style>
\ No newline at end of file
......@@ -22,7 +22,8 @@
<el-table-column prop="createTime" label="演习结果" align="center"></el-table-column>
<el-table-column prop="status.name" label="演习状态" align="center"></el-table-column>
<el-table-column prop="createTime" label="开始时间" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="500">
<el-table-column prop="result" label="演习结果" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="300">
<template slot-scope="scope">
<el-button v-if="scope.row.status.name !== '进行中'" size="mini" type="danger"
@click="deleteExercise(scope.row)">删除</el-button>
......@@ -30,15 +31,18 @@
@click="startExercise(scope.row)">启动</el-button>
<el-button v-if="scope.row.status.name == '进行中'" size="mini" type="warning"
@click="stopExercise(scope.row)">结束</el-button>
<el-button size="mini" type="primary" @click="configExercise(scope.row)">配置</el-button>
</template>
</el-table-column>
</el-table>
</div>
<DdkzConfigExercise ref="myConfigExercise" :currentExercise="myCurrentExercise"></DdkzConfigExercise>
</div>
</template>
<script>
import { getChatRoomList, startExercise, stopExercise, removeExercise } from "@/api/chat/chatRoom";
import ddkzConfigExercise from "@/view/sjgl/ddkzConfig/ddkzConfigExercise.vue";
export default {
data() {
return {
......@@ -49,13 +53,22 @@ export default {
},
meetingList: [],
exerciseList: [{ label: '待开始', value: 'CREATED' }, { label: '进行中', value: 'ONGOING' }, { label: '已结束', value: 'CLOSED' }]
exerciseList: [{ label: '待开始', value: 'CREATED' }, { label: '进行中', value: 'ONGOING' }, { label: '已结束', value: 'CLOSED' }],
myCurrentExercise:{}
}
},
components: {
DdkzConfigExercise: ddkzConfigExercise
},
methods: {
handleSelectionChange() { },
//删除演习
deleteExercise(item) {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeExercise(item.id).then(res => {
if (res == 1) {
this.$message.success('删除演习成功!');
......@@ -64,6 +77,13 @@ export default {
}).catch(error => {
this.$message.error(error.message);
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
//启动演习
startExercise(item) {
......@@ -78,9 +98,14 @@ export default {
},
//结束演习
stopExercise(item) {
this.$prompt('请输入演习结果', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea'
}).then(({ value }) => {
let params = {
chatRoomId: item.id,
result: '暂无'
result: value
};
stopExercise(params).then(res => {
if (res == 1) {
......@@ -90,6 +115,13 @@ export default {
}).catch(error => {
this.$message.error(error.message);
});
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
queryChatRoomListFn(param) {
getChatRoomList(param).then(res => {
......@@ -103,6 +135,13 @@ export default {
} else {
this.queryChatRoomListFn({ userId: this.userInfo.account, status: this.form.status == '' ? null : this.form.status, keyword: this.form.keyword == '' ? null : this.form.keyword })
}
},
//配置演习
configExercise(item){
this.$nextTick(() => {
this.$refs.myConfigExercise.showDialog();
})
this.myCurrentExercise = item;
}
},
computed: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment