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: calc(100% - 30px);
.everyPersonList {
width: 100%;
height: 35px;
line-height: 35px;
margin-top: 10px;
padding: 0px 50px;
font-size: 13px;
color: #f1f1f7;
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;
&:nth-child(3n) {
background-image: url(../../../assets/img/ddkz/12.png);
background-size: 100% 100%;
}
.teamInfo {
width: 100%;
height: 30px;
text-align: center;
&:nth-child(3n+1) {
background-image: url(../../../assets/img/ddkz/13.png);
background-size: 100% 100%;
}
&>span {
margin-left: 20px;
color: white;
&>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;
&::-webkit-scrollbar {
display: none;
}
&:hover {
color: green;
cursor: pointer;
.everyPersonList {
width: 100%;
height: 30px;
line-height: 35px;
padding-left: 70px;
margin-top: 5px;
.isOnline {
width: 10px;
height: 10px;
border-radius: 50%;
display: inline-block;
margin-right: 5px;
}
.username {
color: white;
}
}
&>span:first-child {
float: left;
&>div:nth-child(3n) {
background-image: url(@/assets/img/ddkz/12.png);
background-size: 100% 100%;
}
&>span:last-child {
width: 10px;
height: 10px;
border-radius: 50%;
display: block;
float: left;
margin-top: 12.5px;
margin-left: 5px;
&>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 {
......
......@@ -23,8 +23,8 @@
<el-input v-model="item.teamName"></el-input>
</el-form-item>
<!-- <el-form-item label="参会立场"> -->
<!-- <el-input v-model="formData.teamType"></el-input> -->
<!-- <el-select v-model="item.teamType" placeholder="请选择">
<!-- <el-input v-model="formData.teamType"></el-input> -->
<!-- <el-select v-model="item.teamType" placeholder="请选择">
<el-option v-for="item in teamType" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select> -->
......@@ -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,20 +285,24 @@ export default {
})
},
createMeeting() {
this.formData.chatroomOwner = this.userInfo.account;
this.formData.teams.forEach(item => {
item.createTime = getTime_extent(0).currentDate;
item.wpinfo.forEach(item1 => {
item.member.push(item1.account);
if (this.formData.director.length > 0) {
this.formData.chatroomOwner = this.userInfo.account;
this.formData.teams.forEach(item => {
item.createTime = getTime_extent(0).currentDate;
item.wpinfo.forEach(item1 => {
item.member.push(item1.account);
})
});
createChatRoom(this.formData).then(res => {
if (res == '创建成功') {
this.$message.success('聊天室创建成功!');
}
}).catch(error => {
this.$message.error(error);
})
});
createChatRoom(this.formData).then(res => {
if (res == '创建成功') {
this.$message.success('聊天室创建成功!');
}
}).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.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 {
this.queryChatRoomListFn({ userId: this.userInfo.account, status: this.form.status == '' ? null : this.form.status, chatRoomName: this.form.chatRoomName == '' ? null : this.form.chatRoomName })
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;
}
}
}
}
......
This diff is collapsed.
......@@ -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,21 +53,37 @@ 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) {
removeExercise(item.id).then(res => {
if (res == 1) {
this.$message.success('删除演习成功!');
this.searchChatList();
}
}).catch(error => {
this.$message.error(error.message);
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
removeExercise(item.id).then(res => {
if (res == 1) {
this.$message.success('删除演习成功!');
this.searchChatList();
}
}).catch(error => {
this.$message.error(error.message);
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
//启动演习
startExercise(item) {
......@@ -78,18 +98,30 @@ export default {
},
//结束演习
stopExercise(item) {
let params = {
chatRoomId: item.id,
result: '暂无'
};
stopExercise(params).then(res => {
if (res == 1) {
this.$message.success('此演习结束!');
this.searchChatList();
}
}).catch(error => {
this.$message.error(error.message);
this.$prompt('请输入演习结果', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea'
}).then(({ value }) => {
let params = {
chatRoomId: item.id,
result: value
};
stopExercise(params).then(res => {
if (res == 1) {
this.$message.success('此演习结束!');
this.searchChatList();
}
}).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