This commit is contained in:
Zhang HaoYang 2023-12-28 01:08:41 +08:00
parent 78eb84b2b8
commit a877721a8b
5 changed files with 633 additions and 194 deletions

View File

@ -7,6 +7,7 @@
:root { :root {
--theme-color-trans: rgba(206, 206, 206, 0.66);
--table-bg-color: rgba(16, 18, 27, 0.39); --table-bg-color: rgba(16, 18, 27, 0.39);
--table-bg-color-hover: rgb(16, 18, 27); --table-bg-color-hover: rgb(16, 18, 27);
--table-border : #f6f6f6; --table-border : #f6f6f6;
@ -32,6 +33,7 @@
} }
.light-mode { .light-mode {
--theme-color-trans: rgba(60, 58, 58, 0.55);
--table-border : #b9b9b9; --table-border : #b9b9b9;
--font-bg-theme-reverse:rgba(16 18 27 / 40%); --font-bg-theme-reverse:rgba(16 18 27 / 40%);
--font-border: rgb(108, 155, 255); --font-border: rgb(108, 155, 255);
@ -1072,6 +1074,7 @@ body.light-mode .video-bg:before {
flex-wrap:nowrap; flex-wrap:nowrap;
flex-direction:row; flex-direction:row;
justify-content:space-around; justify-content:space-around;
} }
.MyButton{ .MyButton{

View File

@ -105,7 +105,7 @@
<div class="ArticleContent"> <div class="ArticleContent">
<div v-if="UrlObj.desc == null" style="background-color: var(--theme-bg-color); <div v-if="UrlObj.desc == null" style="background-color: var(--theme-bg-color);
border-radius:5px;height:250px;margin-top:50px;text-align: center"> border-radius:5px;height:250px;margin-top:50px;text-align: center">
<el-empty description="描述文字" style="width:80%;height:250px;margin-left:50px;"></el-empty> <el-empty description="暂无描述,敬请期待" style="width:80%;height:250px;margin-left:50px;"></el-empty>
</div> </div>
{{ UrlObj.desc }} {{ UrlObj.desc }}
</div> </div>
@ -120,12 +120,17 @@
<div class="TitleFont"><i class="el-icon-s-marketing"></i>热度趋势</div> <div class="TitleFont"><i class="el-icon-s-marketing"></i>热度趋势</div>
</div> </div>
<div class="ArticleContent"> <div class="ArticleContent">
<div id="ManuEchart" style="width:550px;height:300px;"></div> <div v-if="!xTime[0]" style="background-color: var(--theme-bg-color);
border-radius:5px;height:250px;margin-top:50px;text-align: center">
<el-empty description="暂无记录,敬请期待" style="width:80%;height:250px;margin-left:50px;"></el-empty>
</div>
<div v-if="YView" id="ManuEchart" style="width:550px;height:300px;"></div>
</div> </div>
</div> </div>
</div> </div>
<!--用户评论--> <!--用户评论-->
<div id="用户评论" class="JustBack" style="width:670px;height:auto;display:flex; flex-direction: column; flex-wrap: nowrap;"> <div v-show="update" id="用户评论" class="JustBack" style="width:670px;height:auto;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div class="JustBack" style="width:670px;height:auto;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div style="width:670px;color: var(--theme-color)"> <div style="width:670px;color: var(--theme-color)">
<div class="HeadLine" style="margin-top:30px"> <div class="HeadLine" style="margin-top:30px">
<div class="HeadSquare"></div> <div class="HeadSquare"></div>
@ -133,12 +138,113 @@
</div> </div>
<div class="ArticleContent" style="margin-left:6px !important;width:580px !important;"> <div class="ArticleContent" style="margin-left:6px !important;width:580px !important;">
<el-card style="background-color: var(--theme-comment-color)"> <el-card style="background-color: var(--theme-comment-color)">
<div style="display: flex;flex-direction: column;flex-wrap: nowrap">
<!-- 发布评论 -->
<el-card style="background-color: var(--theme-comment-color) !important">
<el-form style="width:560px;" ref="form" :rules="rules" :model="form">
<div style="display: flex;flex-direction: column;flex-wrap: nowrap">
<el-form-item prop="rating">
<span style="font-family: STHupo;color:var(--theme-color)">请输入评分</span>
<el-rate style="margin-top:5px" v-model="form.rating" show-text ></el-rate>
</el-form-item>
<div style="display: flex;flex-direction: row;margin-top:5px">
<img class="little-Circle" style="width:60px !important;height: 60px !important;" src="../../assets/img/beauty.jpg"/>
<el-form-item prop="content">
<el-input v-model="form.content" style="width:350px;margin-top:12px;margin-left:10px;" type="textarea" placeholder="请输入一条友善的评论~"></el-input>
</el-form-item>
<el-form-item label="用户id" prop="userId" style="display: none">
<el-input v-model="form.userId" placeholder='用户id' clearable ></el-input>
</el-form-item>
<el-form-item label="urlid" prop="urlId" style="display: none">
<el-input v-model="form.urlId" placeholder='用户id' clearable ></el-input>
</el-form-item>
<el-form-item label="rootCommentId" prop="rootCommentId" style="display: none">
<el-input v-model="form.rootCommentId" placeholder='rootCommentId' clearable ></el-input>
</el-form-item>
<el-form-item>
<el-button type="success" plain style="height:40px;width:70px;margin-left:10px;margin-top:12px" @click="submitComment('form')">
<span style="font-family: STHupo;font-size:20px;margin-left:-5px;">提交</span>
</el-button>
</el-form-item>
<UserComment></UserComment> </div>
</div>
</el-form>
</el-card> </el-card>
<!--评论-->
<el-card style="background-color: var(--theme-comment-color) !important;margin-top:10px">
<div style="display: flex;flex-direction: column;flex-wrap: wrap">
<span style="font-family: STHupo;font-size:25px;margin-left:-10px;color:var(--theme-color)">评论广场</span>
<!--单条评论-->
<div v-for="(item,index) in allcomment" :key="index" class="circleRoll" style="margin-top:50px">
<div style="width:100%;height:2px;background-color: var(--theme-color-trans)"></div>
<div style="display:flex;flex-direction: row;flex-wrap: nowrap;margin-top:40px">
<img class="little-Circle" style="width:50px !important;height:50px !important;margin-top:20px;" src="../../assets/img/beauty.jpg"/>
<div style="display: flex;flex-direction: column">
<div style="display: flex;flex-direction: row;color:var(--theme-color);margin-left:5px;">
<span style="font-family: STHupo;width:50px">用户:</span><span style="font-size:13px;margin-left:5px;width:100px">{{item.user.userLogin}}</span>
<span style="font-family: STHupo;margin-left:15px;width:100px">评论时间:</span><span style="font-size:13px;margin-left:0px;width:150px">{{dateFormat('YYYY-mm-dd',item.commentTime)}}</span>
</div>
<div class='arrow-box popper border arrow-left'
style="background-color: var(--theme-comment-color);margin-left:10px;margin-top:7px;width:430px;border: 5px solid var(--border-color)">
<div style="min-height:60px;margin-left:15px;margin-top:15px;color:var(--theme-color);font-size:15px">
{{item.content}}
</div>
</div>
<div style="display: flex;flex-direction: row-reverse;width:100%;height:42px">
<span style="font-size:18px;font-family: STHupo;line-height:40px;margin-left:5px;margin-left:10px;">{{item.likeCount}}</span>
<el-button type="danger" class="el-icon-thumb" size="medium"
plain circle style="margin-top:6px;margin-left:20px;" @click="LikeMe(item.id)">
</el-button>
<span style="font-size:18px;font-family: STHupo;line-height:40px;margin-left:10px" >回复</span>
<el-button type="success" class="el-icon-chat-dot-square" size="medium" plain circle
style="margin-top:6px;margin-left:70px" @click="addReply(item.id)">
</el-button>
</div> </div>
<!--子评论-->
<div v-for="(item2,index2) in rootId_AllComment[item.id]" :key="index2" >
<img class="little-Circle" style="width:50px !important;height:50px !important;margin-top:40px;" src="../../assets/img/beauty.jpg"/>
<el-card style="border:var(--border-color) 5px solid;min-height:60px;
background-color: var(--theme-comment-color) !important;
margin-top:-70px;margin-left:70px;">
<div style="display: flex;flex-direction: column;flex-wrap: wrap;font-size:17px">
<div style="display: flex;flex-direction: row;color:var(--theme-color);margin-left:-15px;">
<span style="width:auto;font-weight:650;margin-top:10px;margin-left:10px">{{item2.user.userLogin}}</span>
<span style="font-family: STHupo;width:50px;margin-top:11px;margin-left:10px;color: rgba(255,78,78,0.5)!important;">回复 </span>
<span style="width:70px;font-weight:650;margin-top:10px;margin-left:7px">{{item2.RootUser}} </span>
</div>
</div>
<el-card style="font-size:15px;border:var(--border-color) 5px solid;margin-top:10px;
display: flex;flex-direction: column;flex-wrap: wrap;
background-color: var(--theme-comment-color) !important;color:var(--theme-color)">
{{item2.content}}
</el-card >
<div style="color:var(--theme-color);margin-top:10px;font-size:16px;margin-left:130px">
<span style="font-family: STHupo;margin-left:12px;width:100px">评论时间: </span>
{{dateFormat('YYYY-mm-dd',item2.commentTime)}}
</div>
<div style="display: flex;flex-direction: row-reverse;width:100%;height:42px;margin-top:6px">
<span style="font-size:18px;font-family: STHupo;line-height:40px;margin-left:5px;margin-left:10px;">{{item.likeCount}}</span>
<el-button type="danger" class="el-icon-thumb" size="medium" plain circle style="margin-top:6px;margin-left:20px;" >
</el-button>
<span style="font-size:18px;font-family: STHupo;line-height:40px;margin-left:10px">回复</span>
<el-button type="success" class="el-icon-chat-dot-square" size="medium"
plain circle style="margin-top:6px;margin-left:70px" @click="addReply(item2.id)">
<i class="myIcon2"></i>
</el-button>
</div>
</el-card>
</div>
</div>
</div>
</div>
</div>
</el-card>
</div>
<UserComment></UserComment>
</el-card>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -149,6 +255,33 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog title="回复" :visible.sync="openAddCategory" width="30%"
append-to-body
:close-on-click-modal="false"
:before-close="closeDialog"
>
<el-form ref="form" :rules="rules" class="login_container" :model="form"
style="margin-top:-10px" status-icon label-width="100px" >
<el-form-item label="回复内容" prop="content">
<el-input v-model="form.content" placeholder='回复内容' clearable></el-input>
</el-form-item>
<el-form-item label="用户id" prop="userId" style="display: none">
<el-input v-model="form.userId" placeholder='用户id' clearable ></el-input>
</el-form-item>
<el-form-item label="urlid" prop="urlId" style="display: none">
<el-input v-model="form.urlId" placeholder='用户id' clearable ></el-input>
</el-form-item>
<el-form-item label="rootCommentId" prop="rootCommentId" style="display: none">
<el-input v-model="form.rootCommentId" placeholder='rootCommentId' clearable ></el-input>
</el-form-item>
<el-form-item>
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: space-between">
<el-button @click="submitApply('form')" type="primary" style=";margin-top:10px">确认</el-button>
</div>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template> </template>
<script> <script>
import HotRecomment from "@/components/detail/HotRecomment.vue"; import HotRecomment from "@/components/detail/HotRecomment.vue";
@ -167,6 +300,11 @@ export default {
components: {LeftSide, HotRecomment, NewRecomment, RandomRecomment, UserComment}, components: {LeftSide, HotRecomment, NewRecomment, RandomRecomment, UserComment},
data() { data() {
return { return {
userId:'',
//
LikeNum:{},
flag1:true,
flag2:true,
category: [{ category: [{
name:'网站信息', name:'网站信息',
childUC:[] childUC:[]
@ -203,21 +341,34 @@ export default {
imageCode: null, imageCode: null,
// //
allcomment:[], allcomment:[],
//
rootcomment:[],
// id // id
rootId_AllComment:{1:[],2:[]}, rootId_AllComment:{},
//
update:true,
//
openAddCategory:false,
//
rootid:'',
//
form:{
urlId:'',
userId:'',
content:'',
rootCommentId:'',
rating:'',
},
rules: {
rating: [{ required: 'true', message: '请输入评分!', trigger: 'blur' }],
content: [{ required: 'true', message: '请输入评价!', trigger: 'blur' }],
}
} }
}, },
watch: { watch: {
'$route': 'getPath' '$route': 'getPath'
}, },
mounted() { mounted() {
// this.GetAllComment(); // this.GetAllComment();
this.GetAllComment();
}, },
created() { created() {
this.UrlId = this.$route.query.uid; this.UrlId = this.$route.query.uid;
@ -225,10 +376,213 @@ export default {
if(this.UrlId){ if(this.UrlId){
this.ViewByTime(this.UrlId) this.ViewByTime(this.UrlId)
} }
this.getUser();
// this.funFrame(); // this.funFrame();
}, },
computed: {}, computed: {},
methods: { methods: {
closeDialog() {
var that = this;
//
this.GetAllComment();
this.reload();
//
that.form = {
urlId:'',
userId:'',
content:'',
rootCommentId:'',
rating:'',
}
//
this.openAddCategory=false;
},
//
addReply(rootid){
this.openAddCategory=true;
this.rootid = rootid;
},
getUser() {
let _this = this;
if(localStorage.getItem("Authorization") && localStorage.getItem("userId")){
_this.userId = localStorage.getItem("userId")
} else {
Vue.prototype.$notify.error({
title: '错误',
message: "登录状态失效,请重新登录!",
offset: 0
});
}
},
// 0
submitApply(rulelist){
var _this = this;
_this.form.rating = 0;
_this.form.rootCommentId = _this.rootid;
console.log(this.form);
if(localStorage.getItem("Authorization") && localStorage.getItem("userId")){
_this.$refs[rulelist].validate((valid)=>{
if(valid){
axios({
method: 'post',
//
url: '/api/comment/comment',
// URL
params: {
urlId:this.form.urlId,
userId:this.form.userId,
content:this.form.content,
rootCommentId:this.form.rootCommentId,
rating:this.form.rating,
}
}).then((res)=> {
if (res.data.code === 500) {
Vue.prototype.$notify.error({
title: '错误',
message: res.data.msg,
offset: 50
});
} else {
Vue.prototype.$notify({
title: '成功',
message: ('i', {style: 'color: teal'}, "更新成功!"),
type: 'success',
offset: 50
});
this.closeDialog();
this.form = {
urlId:'',
userId:'',
content:'',
rootCommentId:'',
rating:'',
}
}
})
}else{
return;
}
});
}else {
Vue.prototype.$notify.error({
title: '请先登录!',
message: '',
offset: 50
})
}
},
//
submitComment(rulelist){
var _this = this;
console.log(this.form);
if(localStorage.getItem("Authorization") && localStorage.getItem("userId")){
_this.$refs[rulelist].validate((valid)=>{
if(valid){
console.log(this.form);
axios({
method: 'post',
//
url: '/api/comment/comment',
// URL
params: {
urlId:this.form.urlId,
userId:this.form.userId,
content:this.form.content,
rootCommentId:this.form.rootCommentId,
rating:this.form.rating,
}
}).then((res)=> {
if (res.data.code === 500) {
Vue.prototype.$notify.error({
title: '错误',
message: res.data.msg,
offset: 50
});
} else {
Vue.prototype.$notify({
title: '成功',
message: ('i', {style: 'color: teal'}, "更新成功!"),
type: 'success',
offset: 50
});
this.reload();
this.form = {
urlId:'',
userId:'',
content:'',
rootCommentId:'',
rating:'',
}
}
})
}else{
return;
}
});
}else {
Vue.prototype.$notify.error({
title: '请先登录!',
message: '',
offset: 50
})
}
},
reload() {
//
this.update = false
//
// this.$nextTickDOM
this.$nextTick(() => {
this.update = true
})
},
//
LikeMe(id){
var that = this;
axios({
method: 'get',
url: '/api/comment/addLikeCount',
params: {
id:id
}
})
that.GetAllComment();
this.reload();
},
//
getCurrentDate(){
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1;
let day = now.getDate();
return year + "-" + month + "-" + day;
},
dateFormat(fmt, date) {
let ret="";
date=new Date(date);
const opt = {
'Y+': date.getFullYear().toString(), //
'm+': (date.getMonth() + 1).toString(), //
'd+': date.getDate().toString(), //
'H+': date.getHours().toString(), //
'M+': date.getMinutes().toString(), //
'S+': date.getSeconds().toString() //
//
}
for (let k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt)
if (ret) {
fmt = fmt.replace(
ret[1],
ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
)
}
}
return fmt
},
getPath() { getPath() {
if(this.$route.query.name){ if(this.$route.query.name){
@ -238,38 +592,41 @@ export default {
} }
}, },
// iframe
// funFrame(){
// var iframe = document.getElementById("myframe");
// var url = this.UrlObj.url;
// iframe.src = url;
// },
// //
func0(commentId){ func0(comment,rootId){
var that = this; var that = this;
that.allcomment.forEach(function(value){ if(comment.nextNodes.length != 0){
if(value.root_comment_id == commentId){ var rootUser = comment.user.userLogin;
that.rootId_AllComment[commentId].push(value); console.log(comment.user.userLogin);
this.func0(value.id); that.rootId_AllComment[String(rootId)] = that.rootId_AllComment[String(rootId)].concat(comment.nextNodes);
Object.keys(comment.nextNodes).forEach(key => {
that.$set(comment.nextNodes[key],'RootUser',rootUser);
this.func0(comment.nextNodes[key],rootId);
})
}
} }
})}
, ,
// //
GetAllComment(){ GetAllComment(){
let _this = this; let _this = this;
axios.get('/api/comment/view_comment', { axios.get('/api/comment/UrlId', {
params: { params: {
UrlId:_this.UrlId
} }
}).then(function (res) { }).then(function (res) {
_this.allcomment = res.data; _this.allcomment = res.data;
}).catch((error) => { _this.form.userId = _this.userId;
// Vue.prototype.$notify.error({ _this.form.urlId = _this.UrlId;
// title: '', _this.form.rootCommentId = 0;
// message: error, //
// offset: 0 //
// }); Object.keys(res.data).forEach(key => {
_this.rootId_AllComment[res.data[key].id] = [];
_this.func0(res.data[key],res.data[key].id);
}) })
})
}, },
// 访 // 访
ViewByTime(id) { ViewByTime(id) {
@ -284,14 +641,10 @@ export default {
_this.xTime.push(res.data[key].time); _this.xTime.push(res.data[key].time);
_this.YView.push(res.data[key].views); _this.YView.push(res.data[key].views);
}) })
if(_this.xTime[0] != undefined){
_this.initEchart(_this.xTime,_this.YView); _this.initEchart(_this.xTime,_this.YView);
} }
}).catch((error) => { }
// Vue.prototype.$notify.error({
// title: '',
// message: error,
// offset: 0
// });
}) })
}, },
// //
@ -309,12 +662,6 @@ export default {
} }
return false; return false;
}).catch((error) => {
// Vue.prototype.$notify.error({
// title: '',
// message: error === null ? '' : error,
// offset: 0
// });
}) })
return this.imageCode return this.imageCode
}, },
@ -323,21 +670,6 @@ export default {
var that = this; var that = this;
window.open(that.UrlObj.url, '_blank') window.open(that.UrlObj.url, '_blank')
}, },
//
getFormatDate() {
var that = this;
console.log(this.UnDate + "传入时间戳");
var date = new Date(this.UnDate);// 10*1000131000
var Y = date.getFullYear() + '年';
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月';
var D = date.getDate() + '日 ';
// var h = date.getHours() + ':';
// var m = date.getMinutes() + ':';
// var s = date.getSeconds();
that.Cdate = "" + Y + M + D;
},
// Echart // Echart
initEchart(xline,yline) { initEchart(xline,yline) {
// var that = this; // var that = this;
@ -429,21 +761,24 @@ export default {
}).then((res) => { }).then((res) => {
that.UrlObj = res.data.data; that.UrlObj = res.data.data;
that.UnDate = that.UrlObj.createtime; that.UnDate = that.UrlObj.createtime;
}).catch((error) => { var date = new Date(this.UnDate);// 10*1000131000
// Vue.prototype.$notify.error({ var Y = date.getFullYear() + '年';
// title: '', var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月';
// message: error === null ? '' : error, var D = date.getDate() + '日 ';
// offset: 0 // var h = date.getHours() + ':';
// }); // var m = date.getMinutes() + ':';
}); // var s = date.getSeconds();
this.getFormatDate(); that.Cdate = "" + Y + M + D;
if(that.UrlObj.desc == null){
that.flag1 = false;
}
})
}, },
//
WarnToAdmin() { },
// this.GetAllComment();
// console.log(this.allcomment);
}
}
} }
</script> </script>
<style lang="css"> <style lang="css">
@ -457,6 +792,8 @@ export default {
<style scoped> <style scoped>
/**按钮样式:**/
/**标签详情**/ /**标签详情**/
.ArticleContent { .ArticleContent {
width: 80%; width: 80%;
@ -580,4 +917,25 @@ a {
font-weight: bold; font-weight: bold;
margin-top: 2rem; margin-top: 2rem;
} }
.login_container {
width: 400px;
border: 1px solid #eaeaea;
margin: 100px auto;
padding: 35px 35px 15px 35px;
box-sizing: border-box;
border-radius: 15px;
background-color: #fff;
box-shadow: 0 0 25px #cac6c6;
.login_title{
color: #505458;
text-align: center;
margin-bottom: 40px;}
}
::v-deep .el-dialog__body{
background-image: url("../../assets/img/SkyPic.jpg");
margin-top:15px;
height:300px;
}
</style> </style>

View File

@ -1,47 +1,5 @@
<template> <template>
<div style="display: flex;flex-direction: column;flex-wrap: nowrap"> <div>
<!-- 发布评论 -->
<el-card style="background-color: var(--theme-comment-color) !important">
<form style="width:560px;">
<div style="display: flex;flex-direction: column;flex-wrap: nowrap">
<span style="font-family: STHupo;color:var(--theme-color)">请输入评分</span>
<el-rate style="margin-top:5px" ></el-rate>
<div style="display: flex;flex-direction: row;margin-top:5px">
<img class="little-Circle" style="width:60px !important;height: 60px !important;" src="../../assets/img/beauty.jpg"/>
<el-input style="width:350px;margin-top:12px;margin-left:10px;" type="textarea" placeholder="请输入一条友善的评论~"></el-input>
<el-button type="success" plain style="height:40px;width:70px;margin-left:10px;margin-top:12px">
<span style="font-family: STHupo;font-size:20px;margin-left:-5px;">提交</span>
</el-button>
</div>
</div>
</form>
</el-card>
<!--评论-->
<el-card style="background-color: var(--theme-comment-color) !important;margin-top:10px">
<div style="display: flex;flex-direction: column;flex-wrap: wrap">
<span style="font-family: STHupo;font-size:25px;margin-left:-10px;color:var(--theme-color)">评论广场</span>
<!--单条评论-->
<el-divider></el-divider>
<div style="display: flex;flex-direction: row;flex-wrap: nowrap;margin-top:40px">
<img class="little-Circle" style="width:50px !important;height:50px !important;margin-top:20px;" src="../../assets/img/beauty.jpg"/>
<div style="display: flex;flex-direction: column">
<div style="display: flex;flex-direction: row;color:var(--theme-color);margin-left:5px;">
<span style="font-family: STHupo;width:50px">用户:</span><span style="font-size:13px;margin-left:5px;width:100px">JK少女</span>
<span style="font-family: STHupo;margin-left:15px;width:100px">评论时间:</span><span style="font-size:13px;margin-left:0px;width:150px">2023年12月22日</span>
</div>
<div class='arrow-box popper border arrow-left'
style="background-color: var(--theme-comment-color);margin-left:10px;margin-top:7px;width:430px;border: 3px solid var(--border-color)">
<div style="margin-left:10px;margin-top:5px;color:var(--theme-color);font-size:15px">
8~18 位包含大小写字母数字特殊字符的密码8~18 位包含大小写字母数字特殊字符的密码8~18 位包含大小写字母数字特殊字符的密码
</div>
</div>
<div style="display: flex;flex-direction: row-reverse;width:100%;height:42px">
<span style="font-size:18px;font-family: STHupo;line-height:40px;margin-left:5px;margin-left:10px;">112</span>
<el-button type="danger" icon="myIcon" size="medium" plain circle style="margin-top:6px;margin-left:20px;" ></el-button>
<span style="font-size:18px;font-family: STHupo;line-height:40px;margin-left:10px">评论</span>
<el-button type="success" icon="myIcon2" size="medium" plain circle style="margin-top:6px;margin-left:70px" ></el-button>
</div>
<!--子评论--> <!--子评论-->
<el-card style="background-color: var(--theme-comment-color) !important;margin-top:50px;margin-left:70px"> <el-card style="background-color: var(--theme-comment-color) !important;margin-top:50px;margin-left:70px">
<div style="display: flex;flex-direction: column;flex-wrap: wrap"> <div style="display: flex;flex-direction: column;flex-wrap: wrap">
@ -60,17 +18,15 @@
内容丰富多元,节目持续更新,内容播放清晰流畅,操作界面简单友好,真正为用户带来悦享品质的观映体验 内容丰富多元,节目持续更新,内容播放清晰流畅,操作界面简单友好,真正为用户带来悦享品质的观映体验
</div> </div>
</el-card> </el-card>
</div>
</div>
</div>
</el-card>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name:"UserComment", name:"UserComment",
props: {
Singlecomment: Object
},
data() { data() {
return { return {
visible: false, visible: false,
@ -155,13 +111,10 @@ $popper-background-color: #000;
&::before { &::before {
z-index: 3; z-index: 3;
left: -1px; left: -1px;
border-width: 6px; border-width: 6px;
border-style: solid; border-style: solid;
border-color: transparent transparent $popper-border-color $popper-border-color; border-color: transparent transparent $popper-border-color $popper-border-color;
box-shadow: 3px 3px 3px 0 rgba(0, 0, 0, 0.3); box-shadow: 3px 3px 3px 0 rgba(0, 0, 0, 0.3);
} }
} }

View File

@ -7,7 +7,7 @@
<div class="base-style" style="margin-top:20px;font-family: SimHei;font-size:18px;font-weight:600;margin-left:20px"> <div class="base-style" style="margin-top:20px;font-family: SimHei;font-size:18px;font-weight:600;margin-left:20px">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-button @click="openAddCategoryFun()" type="primary" plain size="medium" round >创建标签</el-button> <el-button @click="openAddCategoryFun()" type="primary" plain size="medium" round >新增网址</el-button>
</el-col> </el-col>
<el-col :span="24" style="margin-top:20px"> <el-col :span="24" style="margin-top:20px">
<el-input <el-input
@ -22,7 +22,9 @@
<el-table class="MyTable" <el-table class="MyTable"
:data="List" :data="List"
header-row-class-name="table_header_class" header-row-class-name="table_header_class"
border> border
max-height="400"
>
<el-table-column <el-table-column
align="center" align="center"
type="index" type="index"
@ -31,15 +33,20 @@
label="序号" label="序号"
width="50"> width="50">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" key="name" prop="name" label="网站名" width="190">
<template slot-scope="scope">
align="center" <el-tooltip placement="top" width="150"
prop="name" trigger="hover"
label="网站名" effect="dark" close-delay="2000">
width="180"> <div class="MyPopover" slot="content">{{scope.row.name}}</div>
<div>
<span>{{ scope.row.name.substr(0,12)}}</span>
<span v-if="(scope.row.name).length > 12">...</span>
</div>
</el-tooltip>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="root" prop="root"
label="所属分类" label="所属分类"
@ -51,11 +58,18 @@
label="创建时间" label="创建时间"
width="140"> width="140">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" key="desc" prop="desc" label="描述" width="100">
align="center" <!-- <template slot-scope="scope">-->
prop="desc" <!-- <el-tooltip placement="top" width="150"-->
label="描述" <!-- trigger="hover"-->
width="100"> <!-- effect="dark" close-delay="2000">-->
<!-- <div class="MyPopover" slot="content">{{scope.row.desc}}</div>-->
<!-- <div>-->
<!-- <span>{{ scope.row.desc.substr(0,12)}}</span>-->
<!-- <span v-if="(scope.row.desc).length > 12">...</span>-->
<!-- </div>-->
<!-- </el-tooltip>-->
<!-- </template>-->
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
@ -89,15 +103,28 @@
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" key="isNeedAgent" prop="isNeedAgent" label="是否需要代理" width="120">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isNeedAgent"
:active-value="1"
:inactive-value="0"
active-color="#13ce66"
inactive-color="#ff4949"
disabled
>
</el-switch>
</template>
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="weigh" prop="weigh"
label="权重" label="权重"
width="80"> width="80">
</el-table-column> </el-table-column>
<el-table-column prop="date" label="操作" width="160"> <el-table-column prop="date" label="操作" width="160" >
<template slot-scope="scope"> <template slot-scope="scope">
<div class="ButtonBlock"> <div class="ButtonBlock" >
<img class="MyButton" @click="handleEdit(scope.row)" <img class="MyButton" @click="handleEdit(scope.row)"
src="../../../assets/img/EditButton.svg" style="width:60px"> src="../../../assets/img/EditButton.svg" style="width:60px">
<img class="MyButton" @click="handleDelete(scope.row)" <img class="MyButton" @click="handleDelete(scope.row)"
@ -106,37 +133,80 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog title="新增分类" :visible.sync="openAddCategory" width="30%" <div style="width:100%;height:100px"></div>
<el-dialog title="新增分类" :visible.sync="openAddCategory" width="45%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="closeDialog" :before-close="closeDialog"
> >
<el-form ref="form" :rules="rules" class="login_container" :model="form" <el-form ref="form" :rules="rules" class="login_container" :model="form"
style="margin-top:-10px" status-icon label-width="100px" > style="margin-top:-10px" status-icon label-width="100px" >
<el-form-item label="分类名" prop="name"> <el-form-item label="网站URL" prop="name">
<el-input v-model="form.name" placeholder='分类名称' clearable></el-input> <el-input v-model="form.url" placeholder='网站URL' clearable></el-input>
<el-button @click="Analysis(form.url)" type="primary" plain size="medium" round >解析URL</el-button>
</el-form-item> </el-form-item>
<el-form-item label="网站名" prop="name">
<el-input v-model="form.name" placeholder='网站名' clearable ></el-input>
</el-form-item>
<el-form-item label="网站图标" prop="icon">
<el-input v-model="form.icon" placeholder='网站图标' clearable ></el-input>
</el-form-item>
<el-form-item label="网站Tag" prop="tags">
<el-input v-model="form.tags" placeholder='网站Tag' clearable ></el-input>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="网站归类" prop="cate_id">
<el-select v-model="form.cate_id" prop="cate_id"
value-key="deviceType" placeholder="请选择">
<el-option
v-for="item in Cate"
:key="item.id"
:label="item.rootName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="分类权重" prop="weigh" > <el-form-item label="分类权重" prop="weigh" >
<el-input v-model="form.weigh" placeholder='分类权重' clearable ></el-input> <el-input v-model="form.weigh" placeholder='分类权重' clearable ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="用户id" prop="userId" style="display: none"> </el-col>
<el-input v-model="form.userId" placeholder='用户id' clearable ></el-input> </el-row>
</el-form-item> <el-row>
<el-col :span="12">
<el-form-item label="是否启用" prop="status"> <el-form-item label="是否启用" prop="status">
<el-radio-group v-model="form.status" > <el-radio-group v-model="form.status" >
<el-radio :label="0">有效</el-radio> <el-radio :label="0">启用</el-radio>
<el-radio :label="1">无效</el-radio> <el-radio :label="1">禁用</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否公开" prop="needLogin"> <el-form-item label="是否公开" prop="needLogin">
<el-radio-group v-model="form.needLogin" > <el-radio-group v-model="form.needLogin" >
<el-radio :label="1">公开</el-radio> <el-radio :label="1">公开</el-radio>
<el-radio :label="0">私有</el-radio> <el-radio :label="0">私有</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="需要代理" prop="is_need_agent">
<el-radio-group v-model="form.is_need_agent" >
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item> <el-form-item>
<div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: space-between"> <div style="display: flex;flex-direction: row;align-items: center;flex-wrap: nowrap;justify-content: space-between;width:60%">
<el-button @click="addCategory('form')" type="primary" style=";margin-top:10px">确认</el-button> <el-button @click="addCategory('form')" type="primary" style=";margin-top:10px">确认</el-button>
<el-button @click="reset('form')" type="success" style=";margin-top:10px">重置</el-button>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -156,6 +226,8 @@ export default {
}, },
data() { data() {
return { return {
//
Cate:[],
// //
titlename:null, titlename:null,
// //
@ -170,22 +242,30 @@ export default {
form:{ form:{
name:'', name:'',
weigh:'', weigh:'',
needLogin:'',
status:'', status:'',
userId:'', icon:'',
cate_id:'',
url:'',
tags:'',
desc:'',
is_need_agent:'',
}, },
// //
rules: { rules: {
name: [{ required: 'true', message: '请输入分类名', trigger: 'blur' }], name: [{ required: 'true', message: '请输入网站名', trigger: 'blur' }],
weigh: [{ required: 'true', message: '请输入权重', trigger: 'blur' }], weigh: [{ required: 'true', message: '请输入权重', trigger: 'blur' }],
needLogin: [{ required: 'true', message: '请完善信息', trigger: 'blur' }], needLogin: [{ required: 'true', message: '请完善信息', trigger: 'blur' }],
status: [{ required: 'true', message: '请输入是否启用', trigger: 'blur' }], status: [{ required: 'true', message: '请输入是否启用', trigger: 'blur' }],
userId: [{ required: 'true', message: '登录信息有误', trigger: 'blur' }], icon: [{ required: 'true', message: '请完善信息', trigger: 'blur' }],
cate_id: [{ required: 'true', message: '请完善信息', trigger: 'blur' }],
url: [{ required: 'true', message: '请完善信息', trigger: 'blur' }],
tags: [{ required: 'true', message: '请完善信息', trigger: 'blur' }],
is_need_agent: [{ required: 'true', message: '请完善信息', trigger: 'blur' }],
} }
} }
}, },
mounted() { mounted() {
// this.getFormatDate(); this.GetData();
}, },
created() { created() {
this.getUserInfo(); this.getUserInfo();
@ -193,6 +273,36 @@ export default {
}, },
computed: {}, computed: {},
methods: { methods: {
//
reset(){
this.form = {
name:'',
weigh:'',
status:'',
icon:'',
cate_id:'',
url:'',
tags:'',
desc:'',
is_need_agent:'',
}
},
//
Analysis(url){
let that = this;
axios({
method:'post',
url:'/api/UrlAndCate/disposeUrl',
params:{
url:url
}
}).then(function(res){
that.form.icon = res.data.data.iconUrl;
that.form.name = res.data.data.title;
that.form.desc = res.data.data.description;
that.form.tags = res.data.data.keywords;
});
},
// //
handleDelete(index) { handleDelete(index) {
var that=this; var that=this;
@ -204,11 +314,10 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// //
url: '/api/UrlAndCate/deleteCateByCateId', url: '/api/admin/weblist/deleteUrl',
// URL // URL
params: { params: {
Id: index.id, urlId:index.urlId,
userId:this.userId,
} }
}).then(function (res) { }).then(function (res) {
if (res.data.code === 500) { if (res.data.code === 500) {
@ -240,13 +349,17 @@ export default {
closeDialog() { closeDialog() {
var that = this; var that = this;
// //
this.GetData();
// //
that.form = { that.form = {
name:'', name:'',
weigh:'', weigh:'',
needLogin:'',
status:'', status:'',
icon:'',
cate_id:'',
url:'',
tags:'',
desc:'',
is_need_agent:'',
} }
// //
this.dialogVisible = false; this.dialogVisible = false;
@ -255,8 +368,8 @@ export default {
// : // :
openAddCategoryFun(){ openAddCategoryFun(){
var _this = this; var _this = this;
console.log(_this.List); _this.titlename="新增网址";
_this.titlename="新增分类"; console.log(this.List);
_this.openAddCategory=true; _this.openAddCategory=true;
}, },
// //
@ -275,14 +388,18 @@ export default {
axios({ axios({
method: 'post', method: 'post',
// //
url: '/api/UrlAndCate/insertCateByUser', url: '/api/admin/weblist/insertUrlByUser',
// URL // URL
params: { params: {
name: this.form.name, name: this.form.name,
weigh: this.form.weigh, weigh: this.form.weigh,
icon:this.form.icon,
cate_id:this.form.cate_id,
status: this.form.status, status: this.form.status,
need_login: this.form.need_login, need_login: this.form.need_login,
is_need_agent:this.form.is_need_agent,
userId: this.form.userId, userId: this.form.userId,
desc: this.form.desc,
} }
}).then(function (res) { }).then(function (res) {
if (res.data.code === 500) { if (res.data.code === 500) {
@ -338,7 +455,6 @@ export default {
let _this = this; let _this = this;
if(localStorage.getItem("Authorization") && localStorage.getItem("userId")){ if(localStorage.getItem("Authorization") && localStorage.getItem("userId")){
_this.userId = localStorage.getItem("userId") _this.userId = localStorage.getItem("userId")
_this.GetData();
} else { } else {
Vue.prototype.$notify.error({ Vue.prototype.$notify.error({
title: '错误', title: '错误',
@ -350,6 +466,7 @@ export default {
GetData(){ GetData(){
// //
var that = this; var that = this;
axios({ axios({
method:'post', method:'post',
url:'/api/UrlAndCate/disposeBookmarkToJson', url:'/api/UrlAndCate/disposeBookmarkToJson',
@ -361,6 +478,11 @@ export default {
var tmp2 = []; var tmp2 = [];
for(let i=0;i< tmp.length;i++){ for(let i=0;i< tmp.length;i++){
var rootName = tmp[i].name; var rootName = tmp[i].name;
var catenum = tmp[i].cateId;
var CateItem = {};
CateItem['id'] = catenum;
CateItem['rootName'] = rootName;
that.Cate.push(CateItem);
tmp[i].childUC = tmp[i].childUC.map(item=>{ tmp[i].childUC = tmp[i].childUC.map(item=>{
return{ return{
...item, ...item,
@ -377,8 +499,9 @@ export default {
var D = date.getDate() + '日 '; var D = date.getDate() + '日 ';
that.List[i].createtime = "" + Y + M + D; that.List[i].createtime = "" + Y + M + D;
} }
}) });
that.form.userId = that.userId; that.form.userId = that.userId;
}, },
} }
@ -397,8 +520,10 @@ export default {
text-align: center; text-align: center;
} }
.MyTable{ .MyTable{
overflow:auto;
margin-top:10px; margin-top:10px;
width: 100%; height:600px;
width: 95%;
background-color:var(--table-bg-color); background-color:var(--table-bg-color);
color:var(--theme-color); color:var(--theme-color);
border-radius: 5px; border-radius: 5px;
@ -418,7 +543,7 @@ export default {
border: var(--table-border) solid 3px; border: var(--table-border) solid 3px;
} }
.login_container { .login_container {
width: 400px; width: 550px;
border: 1px solid #eaeaea; border: 1px solid #eaeaea;
margin: 100px auto; margin: 100px auto;
padding: 35px 35px 15px 35px; padding: 35px 35px 15px 35px;
@ -435,6 +560,6 @@ export default {
::v-deep .el-dialog__body{ ::v-deep .el-dialog__body{
background-image: url("../../../assets/img/SkyPic.jpg"); background-image: url("../../../assets/img/SkyPic.jpg");
margin-top:15px; margin-top:15px;
height:500px; height:700px;
} }
</style> </style>