This commit is contained in:
parent
9621b98c3e
commit
7ddee268f5
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
|
@ -17,6 +17,8 @@ const routes = [
|
||||||
path: 'home',
|
path: 'home',
|
||||||
name: 'home',
|
name: 'home',
|
||||||
component: HomeView,
|
component: HomeView,
|
||||||
|
redirect: "/index",
|
||||||
|
|
||||||
meta: {
|
meta: {
|
||||||
isLogin: true
|
isLogin: true
|
||||||
},
|
},
|
||||||
|
@ -37,6 +39,14 @@ const routes = [
|
||||||
isLogin: true
|
isLogin: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path:"/chat",
|
||||||
|
name:"Chat",
|
||||||
|
component:()=>import("../views/main/Chat.vue"),
|
||||||
|
meta:{
|
||||||
|
isLogin:true
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="position:relative;top: 0;">
|
||||||
<div>
|
<div>
|
||||||
<el-row class="tac">
|
<el-row class="tac">
|
||||||
<el-col :span="4">
|
<el-col :span="4" >
|
||||||
<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" router>
|
<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
|
||||||
|
background-color="rgb(245,245,245)"
|
||||||
|
router>
|
||||||
<el-submenu index="1">
|
<el-submenu index="1">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<i class="el-icon-location"></i>
|
<i class="el-icon-location"></i>
|
||||||
<span>导航一</span>
|
<span>ChatABC</span>
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item-group>
|
<el-menu-item-group>
|
||||||
<el-menu-item index="params">首页</el-menu-item>
|
<el-menu-item index="index">首页</el-menu-item>
|
||||||
<el-menu-item index="table">选项2</el-menu-item>
|
<el-menu-item index="chat">选项2</el-menu-item>
|
||||||
</el-menu-item-group>
|
</el-menu-item-group>
|
||||||
|
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="18">
|
<el-col :span="20">
|
||||||
<router-view></router-view>
|
<router-view></router-view>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
|
@ -0,0 +1,302 @@
|
||||||
|
<template>
|
||||||
|
<div class="home">
|
||||||
|
<div class="header">
|
||||||
|
<h1 class="title">聊天室</h1>
|
||||||
|
<hr class="divide">
|
||||||
|
</div>
|
||||||
|
<div class="body">
|
||||||
|
<div v-for="(message, index) in messageList" :key="index">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="word" v-if="!message.isMine">
|
||||||
|
<div class="information">
|
||||||
|
<p>{{ message.nickName }} {{ message.time }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="info">
|
||||||
|
<el-avatar :src="message.pic" class="head"></el-avatar>
|
||||||
|
<div class="message">
|
||||||
|
<div class="detail">
|
||||||
|
{{ message.message }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="word-my" v-else>
|
||||||
|
<div class="outer">
|
||||||
|
<div class="information">
|
||||||
|
<p>{{ message.time }} {{ message.nickName }} </p>
|
||||||
|
</div>
|
||||||
|
<div class="info">
|
||||||
|
<div class="message">
|
||||||
|
<div class="detail">
|
||||||
|
{{ message.message }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-avatar :src="message.pic" class="head"></el-avatar>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="footer">
|
||||||
|
<div class="footer1">
|
||||||
|
<el-input type="textarea" :rows="8" resize="none" placeholder="" v-model="textarea" class="textarea">
|
||||||
|
</el-input>
|
||||||
|
<el-button class="button" @click="SendMessage(textarea)">发送</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
messageList: [
|
||||||
|
|
||||||
|
{
|
||||||
|
nickName: 'Cool',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 15:23:18',
|
||||||
|
message: '我怎么把文件放在服务器上,然后在公网对他进行访问?',
|
||||||
|
isMine: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
nickName: 'COOL',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 18:23:18',
|
||||||
|
message: '先xx后xx再xx',
|
||||||
|
isMine: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nickName: 'COOL',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 18:23:18',
|
||||||
|
message: '先xx后xx再xx',
|
||||||
|
isMine: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nickName: 'COOL',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 18:23:18',
|
||||||
|
message: '先xx后xx再xx',
|
||||||
|
isMine: true,
|
||||||
|
}, {
|
||||||
|
nickName: 'COOL',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 18:23:18',
|
||||||
|
message: '先xx后xx再xx',
|
||||||
|
isMine: true,
|
||||||
|
}, {
|
||||||
|
nickName: 'COOL',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 18:23:18',
|
||||||
|
message: '先xx后xx再xx',
|
||||||
|
isMine: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nickName: 'COOL',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 18:23:18',
|
||||||
|
message: '先xx后xx再xx',
|
||||||
|
isMine: true,
|
||||||
|
}, {
|
||||||
|
nickName: 'COOL',
|
||||||
|
pic: require("@/assets/img/cool.jpg"),
|
||||||
|
time: '2023/11/20 18:23:18',
|
||||||
|
message: '先xx后xx再xx',
|
||||||
|
isMine: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
textarea: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
SendMessage(textarea) {
|
||||||
|
//发送消息
|
||||||
|
console.log(textarea);
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.home {
|
||||||
|
|
||||||
|
|
||||||
|
.header {
|
||||||
|
.title {
|
||||||
|
margin-left: 20px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divide {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 10px;
|
||||||
|
border: 1;
|
||||||
|
height: 2px;
|
||||||
|
background-color: rgb(231, 231, 231);
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
overflow: auto;
|
||||||
|
/* 可选:设置最大高度以限制滚动区域 */
|
||||||
|
max-height: 350px;
|
||||||
|
|
||||||
|
.word {
|
||||||
|
.information {
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-top: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgb(32, 179, 86);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.head {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
padding-left: 7px;
|
||||||
|
padding-right: 7px;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
position: relative;
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
background-color: rgb(255, 255, 255);
|
||||||
|
max-width: 70%;
|
||||||
|
min-height: 40px;
|
||||||
|
//上下居中
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.detail::before {
|
||||||
|
position: absolute;
|
||||||
|
display: inline-block;
|
||||||
|
content: "";
|
||||||
|
width: 0px;
|
||||||
|
height: 0px;
|
||||||
|
border: 8px solid transparent;
|
||||||
|
top: 10px;
|
||||||
|
/*移到中间*/
|
||||||
|
border-right-color: #ffffff;
|
||||||
|
left: -16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.word-my {
|
||||||
|
//水平居右
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.outer {
|
||||||
|
|
||||||
|
.information {
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-top: 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgb(32, 179, 86);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.head {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.message {
|
||||||
|
padding-right: 7px;
|
||||||
|
padding-left: 7px;
|
||||||
|
margin-right: 18px;
|
||||||
|
margin-top: 10px;
|
||||||
|
position: relative;
|
||||||
|
font-size: 16px;
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
background-color: rgb(255, 255, 255);
|
||||||
|
max-width: 70%;
|
||||||
|
min-height: 40px;
|
||||||
|
//上下居中
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.detail::before {
|
||||||
|
position: absolute;
|
||||||
|
display: inline-block;
|
||||||
|
content: "";
|
||||||
|
width: 0px;
|
||||||
|
height: 0px;
|
||||||
|
border: 8px solid transparent;
|
||||||
|
top: 10px;
|
||||||
|
/*移到中间*/
|
||||||
|
border-left-color: #ffffff;
|
||||||
|
right: -16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
|
||||||
|
.footer1 {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 60px;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.textarea {
|
||||||
|
color: rgb(32, 179, 86);
|
||||||
|
|
||||||
|
width: 80%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
position: fixed;
|
||||||
|
right: 40px;
|
||||||
|
bottom: 20px;
|
||||||
|
background-color: rgb(233, 233, 233);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,19 +1,258 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="home">
|
||||||
|
<nav class="headerNav">
|
||||||
</div>
|
<div class="header">
|
||||||
|
<div class="welcDiv">
|
||||||
|
<span class="welcText">欢迎使用ChatABC</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-col>
|
||||||
|
<el-dropdown trigger="click" @command="handleCommand" class="dropdown">
|
||||||
|
<div class="el-dropdown-link">
|
||||||
|
<el-avatar :size="50" :src="headPic"></el-avatar>
|
||||||
|
<i class="el-icon-caret-bottom" style="font-size: 20px;color:aliceblue;"></i>
|
||||||
|
</div>
|
||||||
|
<el-dropdown-menu slot="dropdown" class="dropdownMenu">
|
||||||
|
<p style="color: aliceblue; font-size: 14px;text-align: center;">已登录用户Cool</p>
|
||||||
|
<hr style="border:none;height:1px;background-color: rgb(82, 87, 103);">
|
||||||
|
<el-dropdown-item icon="el-icon-user-solid" command="a" class="item">个人信息</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="el-icon-chat-dot-round" command="b" class="item">消息通知</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="el-icon-setting" command="c" class="item">设置</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon="el-icon-question" command="d" class="item">帮助</el-dropdown-item>
|
||||||
|
<el-dropdown-item icon=el-icon-switch-button command="e" class="item">退出</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</el-col>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<div style="height: 10000px;" class="detail">
|
||||||
|
<div class="left">
|
||||||
|
<h2 class="versionText">ChatABC Windows版 1.1.1</h2>
|
||||||
|
<p class="time">发布时间: 2023年11月17号</p>
|
||||||
|
<img src="../../assets/img/cool.jpg" class="img">
|
||||||
|
<br>
|
||||||
|
<el-button type="primary" round class="button" @click="download">立即下载</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<h2 class="versionText">ChatABC Linux版 1.1.1</h2>
|
||||||
|
<p class="time">发布时间: 2023年11月17号</p>
|
||||||
|
<img src="../../assets/img/cool.jpg" class="img">
|
||||||
|
<el-button type="primary" class="button" @click="download" round>立即下载</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
headPic: require("@/assets/img/cool.jpg"),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
download() {
|
||||||
|
//下载文件
|
||||||
|
var blob = new Blob(['Hello, this is the content of the file!'], { type: 'text/plain' });
|
||||||
|
var link = document.createElement('a');
|
||||||
|
link.download = 'example.txt';
|
||||||
|
link.href = window.URL.createObjectURL(blob);
|
||||||
|
document.body.appendChild(link); // 将 link 元素添加到 DOM 中
|
||||||
|
link.click(); // 模拟用户点击该元素
|
||||||
|
document.body.removeChild(link); // 下载完成后将 link 元素从 DOM 中移除
|
||||||
|
|
||||||
|
this.$message({
|
||||||
|
message: "下载成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCommand(command) {
|
||||||
|
if (command == "e") {
|
||||||
|
this.$router.push("/login");
|
||||||
|
this.$message({
|
||||||
|
message: "退出成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: "功能开发中" + command,
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.dropdown {}
|
||||||
|
|
||||||
|
.el-dropdown-link {
|
||||||
|
margin-top: 8px;
|
||||||
|
//居右
|
||||||
|
margin-left: 600px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdownMenu {
|
||||||
|
background-color: rgb(46, 50, 62);
|
||||||
|
border-color: rgb(46, 50, 62);
|
||||||
|
|
||||||
|
.item {
|
||||||
|
background-color: rgb(46, 50, 62);
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:hover {
|
||||||
|
background: rgb(46, 50, 62);
|
||||||
|
color: aliceblue;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.el-popper[x-placement^=bottom] .popper__arrow {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headerNav {
|
||||||
|
background-color: rgb(35, 40, 52) ;
|
||||||
|
// position: relative;
|
||||||
|
// right: 0;
|
||||||
|
// top: 0;
|
||||||
|
// left: 0;
|
||||||
|
|
||||||
|
height: 70px;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
background-color: rgb(35, 40, 52);
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
.welcDiv {
|
||||||
|
//居中
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-left: 300px;
|
||||||
|
|
||||||
|
.welcText {
|
||||||
|
color: aliceblue;
|
||||||
|
margin: 0;
|
||||||
|
//加粗
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 25px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.home {
|
||||||
|
background-color: rgb(46, 50, 62);
|
||||||
|
|
||||||
|
.detail {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
margin-top: 50px;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
background-color: rgb(35, 40, 52);
|
||||||
|
width: 50%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.versionText {
|
||||||
|
color: aliceblue;
|
||||||
|
//不加粗
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 25px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
color: aliceblue;
|
||||||
|
//不加粗
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 1;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: 140px;
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: 190px;
|
||||||
|
width: 200px;
|
||||||
|
//字体加粗
|
||||||
|
font-weight: bold;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
background-color: rgb(46, 50, 62);
|
||||||
|
width: 50%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.versionText {
|
||||||
|
color: aliceblue;
|
||||||
|
//不加粗
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 25px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
color: aliceblue;
|
||||||
|
//不加粗
|
||||||
|
font-weight: normal;
|
||||||
|
margin: 1;
|
||||||
|
padding: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: 140px;
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.button {
|
||||||
|
margin-top: 50px;
|
||||||
|
margin-left: 190px;
|
||||||
|
width: 200px;
|
||||||
|
//字体加粗
|
||||||
|
font-weight: bold;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}</style>
|
Loading…
Reference in New Issue