Commit 3bb56ece authored by 张冬's avatar 张冬

聊天问题

parent 4aad38f2
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<!-- 在线对话 --> <!-- 在线对话 -->
<div class="dialogue" style="margin-top: 30px;" v-show="dialogue"> <div class="dialogue" style="margin-top: 30px;" v-show="dialogue">
<JwChat :taleList="dialogueList" scrollType="scroll" @enter="bindEnter" v-model="content" :toolConfig="tool" > <JwChat :taleList="dialogueList" scrollType="scroll" @enter="bindEnter" v-model="content" :toolConfig="tool" >
<el-button slot="tools" style="float:right" class="abs" @click="dialogue=false">关闭聊天框</el-button>
</JwChat> </JwChat>
</div> </div>
<!-- <!--
...@@ -222,9 +223,9 @@ ...@@ -222,9 +223,9 @@
data() { data() {
return { return {
tool: { tool: {
show: [''], show: ['11'],
callback: this.toolEvent, callback: this.toolEvent,
showEmoji: true, showEmoji: false,
}, },
issueTable: false, issueTable: false,
openStatus: '', openStatus: '',
...@@ -681,6 +682,11 @@ ...@@ -681,6 +682,11 @@
</script> </script>
<style scoped> <style scoped>
.abs{
position: absolute;
right:100px;
bottom:-91px
}
.flex-left { .flex-left {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
<dataBreadcrumb :breads="breads"></dataBreadcrumb> <dataBreadcrumb :breads="breads"></dataBreadcrumb>
<div>中国标准时间:{{ currentTime }}</div> <div>中国标准时间:{{ currentTime }}</div>
<div class="hal"> <div class="hal">
<h2 style="text-align: center;">{{projectName}}项目开标大厅</h2> <h2 style="text-align: center">{{ projectName }}项目开标大厅</h2>
<div class="time-message flex-between"> <div class="time-message flex-between">
<div class="flex"> <div class="flex">
<p>截标倒计时:</p> <p>截标倒计时:</p>
<timeDown :remain-time="remaintime" @countDowmEnd="remaintimeEnd"></timeDown> <timeDown :remain-time="remaintime" @countDowmEnd="remaintimeEnd"></timeDown>
</div> </div>
<div class="flex" v-show="openStatus==2"> <div class="flex" v-show="openStatus == 2">
<p>解密倒计时:</p> <p>解密倒计时:</p>
<timeDown :remain-time="decodeTime" @countDowmEnd="decodeTimeEnd"></timeDown> <timeDown :remain-time="decodeTime" @countDowmEnd="decodeTimeEnd"></timeDown>
</div> </div>
<div class="flex" v-show="openStatus==2"> <div class="flex" v-show="openStatus == 2">
<p>签名倒计时:</p> <p>签名倒计时:</p>
<timeDown :remain-time="signatureTime" @countDowmEnd="signatureTimeEnd"></timeDown> <timeDown :remain-time="signatureTime" @countDowmEnd="signatureTimeEnd"></timeDown>
</div> </div>
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
<div class="flex"> <div class="flex">
<div class="hal-left"> <div class="hal-left">
<div> <div>
<h1>签到 {{!leftmessage.signIn?"否":"是"}}</h1> <h1>签到 {{ !leftmessage.signIn ? '否' : '是' }}</h1>
<h1>解密 {{!leftmessage.decode?"否":"是"}}</h1> <h1>解密 {{ !leftmessage.decode ? '否' : '是' }}</h1>
<h1>签名 {{!leftmessage.signature?"否":"是"}}</h1> <h1>签名 {{ !leftmessage.signature ? '否' : '是' }}</h1>
</div> </div>
</div> </div>
<div class="hal-center" v-chat-scroll> <div class="hal-center" v-chat-scroll>
<ul > <ul>
<li v-for="(item,index) in halList" :key="index" class="flex-item"> <li v-for="(item, index) in halList" :key="index" class="flex-item">
<div>{{ item.time }}</div> <div>{{ item.time }}</div>
<div>{{ item.role }}</div> <div>{{ item.role }}</div>
<div>{{ item.name }}</div> <div>{{ item.name }}</div>
...@@ -38,13 +38,20 @@ ...@@ -38,13 +38,20 @@
</ul> </ul>
</div> </div>
<div class="hal-right"> <div class="hal-right">
<el-button @click="dialogFormVisible=true" style="margin-left:10px">开标规则说明</el-button> <el-button @click="dialogFormVisible = true" style="margin-left: 10px">开标规则说明</el-button>
<el-button @click="isdialogue">在线对话<i class="el-icon-chat-dot-round"></i></el-button> <el-button @click="isdialogue">在线对话<i class="el-icon-chat-dot-round"></i></el-button>
<el-button :disabled="!isDecode" v-show="openStatus==2&&!leftmessage.decode" @click="changeDecode" type="primary">解密投标文件</el-button> <el-button
:disabled="!isDecode"
v-show="openStatus == 2 && !leftmessage.decode"
@click="changeDecode"
type="primary"
>解密投标文件</el-button
>
</div> </div>
<!-- 在线对话 --> <!-- 在线对话 -->
<div class="dialogue" style="margin-top: 30px;" v-show="dialogue"> <div class="dialogue" style="margin-top: 30px" v-show="dialogue">
<JwChat :taleList="dialogueList" scrollType="scroll" @enter="bindEnter" v-model="content" :toolConfig="tool" > <JwChat :taleList="dialogueList" scrollType="scroll" @enter="bindEnter" v-model="content" :toolConfig="tool">
<el-button slot="tools" style="float: right" class="abs" @click="dialogue = false">关闭聊天框</el-button>
</JwChat> </JwChat>
</div> </div>
<!-- <div class="dialogue" style="margin-top: 30px;" v-show="dialogue"> <!-- <div class="dialogue" style="margin-top: 30px;" v-show="dialogue">
...@@ -85,38 +92,31 @@ ...@@ -85,38 +92,31 @@
</el-dialog> </el-dialog>
<!-- 开标一览表 --> <!-- 开标一览表 -->
<el-dialog :visible.sync="isopenInfo" title="开标一览表"> <el-dialog :visible.sync="isopenInfo" title="开标一览表">
<nopageTable :tableData="tableData" :columns="nopagecolumns" :margin-top="0" :margin-bottom="0"> <nopageTable :tableData="tableData" :columns="nopagecolumns" :margin-top="0" :margin-bottom="0"> </nopageTable>
</nopageTable>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="isopenInfo=false">关闭 </el-button> <el-button @click="isopenInfo = false">关闭 </el-button>
<el-button :disabled="!isSignature" v-show="openStatus==2&&!leftmessage.signature" @click="changeSignature" type="primary">签名</el-button> <el-button
:disabled="!isSignature"
v-show="openStatus == 2 && !leftmessage.signature"
@click="changeSignature"
type="primary"
>签名</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import { signdetail } from '@api/purchaser/bid';
signdetail import { openUrl } from '@utils/common';
} from '@api/purchaser/bid' import { openBidsign, opentimeInfo, openInfolist, decode, signature } from '@api/supply/bid';
import { import { getTime } from '@utils/time';
openUrl import nopageTable from '@components/nopageTable.vue';
} from '@utils/common' import dataBreadcrumb from '@components/dataBreadcrumb.vue';
import { import timeDown from '@components/timeDown.vue';
openBidsign, import dataTable from '@components/dataTable.vue';
opentimeInfo, export default {
openInfolist,
decode,
signature
} from '@api/supply/bid'
import {
getTime
} from '@utils/time'
import nopageTable from '@components/nopageTable.vue'
import dataBreadcrumb from '@components/dataBreadcrumb.vue'
import timeDown from '@components/timeDown.vue'
import dataTable from '@components/dataTable.vue'
export default {
components: { components: {
dataBreadcrumb, dataBreadcrumb,
timeDown, timeDown,
...@@ -128,29 +128,30 @@ ...@@ -128,29 +128,30 @@
tool: { tool: {
show: [''], show: [''],
callback: this.toolEvent, callback: this.toolEvent,
showEmoji: true, showEmoji: true
}, },
issueTable:"", issueTable: '',
openStatus: "", openStatus: '',
isSignature: false, isSignature: false,
isDecode: false, isDecode: false,
dialogue: false, dialogue: false,
isopenInfo: false, isopenInfo: false,
remaintime: "", remaintime: '',
decodeTime: "", decodeTime: '',
signatureTime: "", signatureTime: '',
projectName: "", projectName: '',
pageObj: { pageObj: {
size: 10, size: 10,
total: 1000, total: 1000,
currentPage: 1, currentPage: 1,
func: (currentPage) => { func: (currentPage) => {
this.pageTurning(currentPage) this.pageTurning(currentPage);
} }
}, },
dialogFormVisible: false, dialogFormVisible: false,
tableData: [], tableData: [],
columns: [{ columns: [
{
label: '中标供应商', label: '中标供应商',
prop: 'name' prop: 'name'
}, },
...@@ -171,7 +172,8 @@ ...@@ -171,7 +172,8 @@
slot: 'operate' slot: 'operate'
} }
], // ], //
nopagecolumns: [{ nopagecolumns: [
{
label: '投标公司', label: '投标公司',
prop: 'companyName' prop: 'companyName'
}, },
...@@ -181,13 +183,14 @@ ...@@ -181,13 +183,14 @@
}, },
{ {
label: '是否签名', label: '是否签名',
prop: 'isSign', prop: 'isSign'
}, }
], // ], //
isOpenbid: false, isOpenbid: false,
buttonWords: '立即开标', buttonWords: '立即开标',
openbidButton: false, openbidButton: false,
halList: [{ halList: [
{
time: '17:56:56', time: '17:56:56',
role: '招标人', role: '招标人',
person: '谢天', person: '谢天',
...@@ -204,245 +207,224 @@ ...@@ -204,245 +207,224 @@
seconds: '60', seconds: '60',
currentTime: '', currentTime: '',
breads: ['招标管理', '招标项目管理', '工作台'], breads: ['招标管理', '招标项目管理', '工作台'],
leftmessage: "", leftmessage: '',
websocket: "", websocket: '',
dialogueList: [], dialogueList: [],
halList: [], halList: [],
content: "", content: '',
myId: "" myId: ''
} };
}, },
mounted() { mounted() {
this.add(); this.add();
}, },
created() { created() {
// 中国标准时间 // 中国标准时间
let currentTime = getTime() let currentTime = getTime();
this.currentTime = currentTime this.currentTime = currentTime;
this.timer1 = setInterval(() => { this.timer1 = setInterval(() => {
let currentTime = getTime() let currentTime = getTime();
this.currentTime = currentTime this.currentTime = currentTime;
}, 1000) }, 1000);
this.projectName = localStorage.getItem("projectName") this.projectName = localStorage.getItem('projectName');
this.getsigndetail(); this.getsigndetail();
this.openBidsign(); this.openBidsign();
this.createWebSocket() this.createWebSocket();
this.myId = JSON.parse(localStorage.getItem("userInfo")).userId this.myId = JSON.parse(localStorage.getItem('userInfo')).userId;
// 长轮训获取 // 长轮训获取
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.getsigndetail(); this.getsigndetail();
}, 5000); }, 5000);
}, },
methods: { methods: {
openInfo(){ openInfo() {
this.isopenInfo=true this.isopenInfo = true;
this.getopenInfo(); this.getopenInfo();
}, },
refrsh(){ refrsh() {
history.go(0) history.go(0);
}, },
// 解密 // 解密
async changeDecode() { async changeDecode() {
let projectId = localStorage.getItem("projectId") let projectId = localStorage.getItem('projectId');
try { try {
const { const { msg, code } = await decode(projectId);
msg, if (code == 200) {
code this.$message.success(msg);
} = await decode(projectId)
if(code==200){
this.$message.success(msg)
this.openBidsign(); this.openBidsign();
}else{ } else {
this.$message.error(msg) this.$message.error(msg);
} }
} catch (e) { } catch (e) {
console.log(e) console.log(e);
} }
}, },
// 签名 // 签名
async changeSignature() { async changeSignature() {
let projectId = localStorage.getItem("projectId") let projectId = localStorage.getItem('projectId');
try { try {
const { const { msg, code } = await signature(projectId);
msg, if (code == 200) {
code, this.$message.success(msg);
} = await signature(projectId)
if(code==200){
this.$message.success(msg)
this.openBidsign(); this.openBidsign();
}else{ } else {
this.$message.error(msg) this.$message.error(msg);
} }
} catch (e) { } catch (e) {
console.log(e) console.log(e);
} }
}, },
isdialogue() { isdialogue() {
this.dialogue = !this.dialogue this.dialogue = !this.dialogue;
}, },
// websocket // websocket
createWebSocket() { createWebSocket() {
let token = localStorage.getItem("token") let token = localStorage.getItem('token');
let projectId = localStorage.getItem("projectId") let projectId = localStorage.getItem('projectId');
this.websocket = new WebSocket(`ws:${openUrl}/webSocket/${projectId}/${token}`) this.websocket = new WebSocket(`ws:${openUrl}/webSocket/${projectId}/${token}`);
// 连接成功时 // 连接成功时
this.websocket.onopen = () => {} this.websocket.onopen = () => {};
this.websocket.onmessage = event => { this.websocket.onmessage = (event) => {
// 后端发送的消息在event.data中 // 后端发送的消息在event.data中
let data = JSON.parse(event.data); let data = JSON.parse(event.data);
console.log(data) console.log(data);
if (data.type == 1) { if (data.type == 1) {
if(data.userId==this.myId){ if (data.userId == this.myId) {
data.mine=true data.mine = true;
}else{ } else {
data.mine=false data.mine = false;
} }
const msgObj = { const msgObj = {
"date":data.time , date: data.time,
"text": { text: {
"text": data.chatContent text: data.chatContent
}, },
"mine": data.mine, mine: data.mine,
"name": data.name, name: data.name,
"img": "@static/images/tou.jpg" img: '@static/images/tou.jpg'
} };
this.dialogueList.push(msgObj) this.dialogueList.push(msgObj);
} else { } else {
this.halList.push(data) this.halList.push(data);
}
}
this.websocket.onclose = function() {
console.log('关闭了')
} }
};
this.websocket.onclose = function () {
console.log('关闭了');
};
// 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常 // 监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常
window.onbeforeunload = function() { (window.onbeforeunload = function () {
this.websocket.close() this.websocket.close();
}, }),
// 路由跳转时结束websocket链接 // 路由跳转时结束websocket链接
this.$router.afterEach(function() { this.$router.afterEach(function () {
this.websocket.close() this.websocket.close();
}) });
}, },
bindEnter() { bindEnter() {
const content = this.content const content = this.content;
if (!content) return; if (!content) return;
this.websocket.send(content) this.websocket.send(content);
}, },
back() { back() {
this.$router.go(-1) this.$router.go(-1);
}, },
// 截标时间到了 // 截标时间到了
remaintimeEnd(val) { remaintimeEnd(val) {},
},
// 解密时间到了 // 解密时间到了
decodeTimeEnd(val) { decodeTimeEnd(val) {
this.isDecode = val this.isDecode = val;
}, },
// 签名时间到了 // 签名时间到了
signatureTimeEnd(val) { signatureTimeEnd(val) {
this.isSignature = val this.isSignature = val;
}, },
// 计算分秒倒计时 // 计算分秒倒计时
add: function() { add: function () {
var _this = this var _this = this;
var time = window.setInterval(function() { var time = window.setInterval(function () {
if (_this.seconds === 0 && _this.minutes !== 0) { if (_this.seconds === 0 && _this.minutes !== 0) {
_this.seconds = 59 _this.seconds = 59;
_this.minutes -= 1 _this.minutes -= 1;
} else if (_this.minutes === 0 && _this.seconds === 0) { } else if (_this.minutes === 0 && _this.seconds === 0) {
_this.seconds = 0 _this.seconds = 0;
window.clearInterval(time) window.clearInterval(time);
} else { } else {
_this.seconds -= 1 _this.seconds -= 1;
} }
}, 1000) }, 1000);
}, },
// 截标时间到了 // 截标时间到了
countDowmEnd(val) { countDowmEnd(val) {
this.openbidButton = val this.openbidButton = val;
}, },
// 左边信息栏 // 左边信息栏
async openBidsign() { async openBidsign() {
let projectId = localStorage.getItem("projectId") let projectId = localStorage.getItem('projectId');
try { try {
const { const { data, code } = await openBidsign(projectId);
data, this.leftmessage = data;
code
} = await openBidsign(projectId)
this.leftmessage = data
} catch (e) { } catch (e) {
console.log(e) console.log(e);
} }
}, },
// 获取时间比较 // 获取时间比较
async getsigndetail() { async getsigndetail() {
try { try {
let projectId = localStorage.getItem("projectId") let projectId = localStorage.getItem('projectId');
var { var { data, code, msg } = await opentimeInfo(projectId);
data,
code,
msg
} = await opentimeInfo(projectId)
if (code == 200) { if (code == 200) {
this.remaintime = Number(data.remainTime); this.remaintime = Number(data.remainTime);
this.storagedecodeTime = Number(data.decodeTime) this.storagedecodeTime = Number(data.decodeTime);
this.storagesignatureTime = Number(data.signatureTime) this.storagesignatureTime = Number(data.signatureTime);
} else { } else {
this.$message.error(msg) this.$message.error(msg);
} }
var { var { data, code } = await signdetail(projectId);
data,
code
} = await signdetail(projectId)
if (code == 200) { if (code == 200) {
this.openStatus = data.openStatus this.openStatus = data.openStatus;
this.issueTable=data.issueTable this.issueTable = data.issueTable;
let localTime = new Date().getTime(); let localTime = new Date().getTime();
console.log(this.storagedecodeTime, "..............") console.log(this.storagedecodeTime, '..............');
let comparyTime = this.storagedecodeTime - (localTime - data.openBidTime) / 1000 let comparyTime = this.storagedecodeTime - (localTime - data.openBidTime) / 1000;
if (comparyTime > 0) { if (comparyTime > 0) {
this.decodeTime = comparyTime this.decodeTime = comparyTime;
console.log("大于") console.log('大于');
} else { } else {
console.log("小于") console.log('小于');
this.isDecode = true this.isDecode = true;
} }
let comparyTime1 = this.storagesignatureTime - (localTime - data.openBidTime) / 1000 let comparyTime1 = this.storagesignatureTime - (localTime - data.openBidTime) / 1000;
if (comparyTime > 0) { if (comparyTime > 0) {
this.signatureTime = comparyTime1 this.signatureTime = comparyTime1;
console.log("大于") console.log('大于');
} else { } else {
console.log("小于") console.log('小于');
this.isSignature = true this.isSignature = true;
} }
} }
} catch (e) { } catch (e) {
console.log(e) console.log(e);
} }
}, },
// 开标一栏表 // 开标一栏表
async getopenInfo() { async getopenInfo() {
try { try {
let projectId = localStorage.getItem("projectId") let projectId = localStorage.getItem('projectId');
const { const { data, code } = await openInfolist(projectId);
data,
code
} = await openInfolist(projectId)
if (code == 200) { if (code == 200) {
for (let item of data) { for (let item of data) {
if (item.isSign) { if (item.isSign) {
item.isSign = "是" item.isSign = '是';
} else { } else {
item.isSign = "否" item.isSign = '否';
} }
} }
this.tableData = data this.tableData = data;
} }
} catch (e) { } catch (e) {
console.log(e) console.log(e);
}
} }
},
}, },
// updated() { // updated() {
// // 聊天定位到底部 // // 聊天定位到底部
...@@ -454,81 +436,83 @@ ...@@ -454,81 +436,83 @@
destroyed() { destroyed() {
//清除定时器 //清除定时器
clearInterval(this.timer1); clearInterval(this.timer1);
this.websocket.close() this.websocket.close();
}
} }
};
</script> </script>
<style scoped> <style scoped>
.flex-left { .abs {
position: absolute;
right: 100px;
bottom: -91px;
}
.flex-left {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
} }
.flex-right { .flex-right {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.hal { .hal {
position: relative; position: relative;
} }
.dialogue { .dialogue {
position: absolute; position: absolute;
top: 10%; top: 10%;
right: 10%; right: 10%;
border:1px solid #CCCCCC; border: 1px solid #cccccc;
padding:10px padding: 10px;
} }
.dialogue>.dialogueList { .dialogue > .dialogueList {
box-sizing: border-box; box-sizing: border-box;
padding: 20px; padding: 20px;
overflow: auto; overflow: auto;
border: 1px solid #DCDFE6; border: 1px solid #dcdfe6;
width: 400px; width: 400px;
height: 300px; height: 300px;
} }
.dialogueList>li { .dialogueList > li {
margin-bottom: 20px; margin-bottom: 20px;
} }
.explain>h1 { .explain > h1 {
text-align: center; text-align: center;
margin: 30px 0 margin: 30px 0;
} }
.buttons { .buttons {
margin: 100px 0; margin: 100px 0;
} }
.hal-left { .hal-left {
width: 200px; width: 200px;
}
} .hal-left > div {
.hal-left>div {
width: 100%; width: 100%;
height: 300px; height: 300px;
border: 1px solid #000; border: 1px solid #000;
box-sizing: border-box; box-sizing: border-box;
padding: 40px 20px padding: 40px 20px;
} }
.hal-right {
.hal-right {
width: 200px; width: 200px;
height: 500px; height: 500px;
} }
.hal-right>button { .hal-right > button {
margin-bottom: 20px; margin-bottom: 20px;
} }
.hal-center { .hal-center {
flex: 1; flex: 1;
height: 500px; height: 500px;
border: 1px solid #000; border: 1px solid #000;
...@@ -536,41 +520,39 @@ ...@@ -536,41 +520,39 @@
box-sizing: border-box; box-sizing: border-box;
padding: 30px; padding: 30px;
overflow: auto; overflow: auto;
} }
.hal-center>ul>li { .hal-center > ul > li {
margin-bottom: 30px; margin-bottom: 30px;
} }
.hal-center>ul>li>div { .hal-center > ul > li > div {
margin-right: 10px; margin-right: 10px;
font-size: 16px; font-size: 16px;
} }
.button-pos { .button-pos {
margin-top: 50px; margin-top: 50px;
} }
.time-message { .time-message {
width: 60%; width: 60%;
margin: 10px auto; margin: 10px auto;
font-size: 16px; font-size: 16px;
} }
.hal-left h1 { .hal-left h1 {
margin-bottom: 50px; margin-bottom: 50px;
/* letter-spacing:5px */ /* letter-spacing:5px */
} }
.bid-message { .bid-message {
flex-wrap: wrap; flex-wrap: wrap;
font-size: 16px; font-size: 16px;
} }
.bid-message>div { .bid-message > div {
margin-right: 50px; margin-right: 50px;
margin-bottom: 30px; margin-bottom: 30px;
} }
</style> </style>
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