更新chat模块文本编辑

This commit is contained in:
unknown 2022-06-10 17:30:39 +08:00
parent 02499f3eb1
commit e8bdecdfb9
16 changed files with 255 additions and 62 deletions

View File

@ -1,36 +1,37 @@
<template> <template>
<div id="app"> <div id="app">
<router-view/> <router-view/>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'App', name: 'App',
components: { components: {
} }
} }
</script> </script>
<style> <style>
html, body, #app{ html, body, #app{
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 100%; height: 100%;
width: 100%; width: 100%;
border: 0; border: 0;
font-size: 100%; font-size: 100%;
line-height: 1.2; line-height: 1.2;
font: inherit; /* 所有元素字体一致 */ font: inherit; /* 所有元素字体一致 */
vertical-align: baseline; /* 行内元素垂直对齐:父级元素基线 */ vertical-align: baseline; /* 行内元素垂直对齐:父级元素基线 */
text-align: center; /* 水平居中 */ text-align: center; /* 水平居中 */
font-family: Helvetica, Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
color: #000000; /*font-family: Helvetica, Arial, sans-serif;*/
}
color: #000000;
</style> }
</style>

View File

@ -31,7 +31,6 @@ img {
} }
.el-menu-item { .el-menu-item {
margin: 10px 0;
font-size: 1.1rem; font-size: 1.1rem;
} }
::v-deep .el-submenu__title { ::v-deep .el-submenu__title {

18
src/assets/font/font.css Normal file
View File

@ -0,0 +1,18 @@
@font-face {
font-family: "fs-gb2312";
src: url("./fs-gb2312.ttf");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "kaiti";
src: url("./simkai.ttf");
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "heiti";
src: url("./simhei.ttf");
font-weight: normal;
font-style: normal;
}

Binary file not shown.

BIN
src/assets/font/simfang.ttf Normal file

Binary file not shown.

BIN
src/assets/font/simhei.ttf Normal file

Binary file not shown.

BIN
src/assets/font/simkai.ttf Normal file

Binary file not shown.

BIN
src/assets/font/simsun.ttc Normal file

Binary file not shown.

View File

@ -82,6 +82,7 @@ export default {
<style> <style>
.el-menu-item { .el-menu-item {
margin: 10px 0;
font-size: 0.9rem !important; font-size: 0.9rem !important;
} }
::v-deep .el-submenu__title { ::v-deep .el-submenu__title {

View File

@ -19,6 +19,9 @@ import "/src/assets/icon/iconfont.css"
import * as echarts from 'echarts' import * as echarts from 'echarts'
// 时间 // 时间
import moment from "moment" import moment from "moment"
import "./assets/font/font.css";
Vue.prototype.$md5 = md5; Vue.prototype.$md5 = md5;
Vue.use(api) Vue.use(api)

View File

@ -13,19 +13,15 @@
<div class="headersecond"> <div class="headersecond">
<!-- 新增 绑定点击事件 显示内容国际化 -->
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd()">添加</el-button>
<!-- 批量删除 使用图标 -->
<el-button type="primary" icon="el-icon-delete" @click="batchDelete()">删除</el-button>
<!-- 输入框 双向绑定数据 自带清空 --> <!-- 输入框 双向绑定数据 自带清空 -->
<span style="font-size: 14px">&nbsp;&nbsp;&nbsp;&nbsp;手机号</span> <span style="font-size: 14px">手机号</span>
<el-input v-model="searchInfo.keyWords" suffix-icon="el-icon-edit" clearable placeholder="请输入手机号"></el-input> <el-input v-model="searchInfo.phone" suffix-icon="el-icon-edit" clearable placeholder="请输入手机号"></el-input>
<!-- 下拉选框 --> <!-- 下拉选框 -->
<span style="font-size: 14px">&nbsp;&nbsp;&nbsp;&nbsp;用户类型</span> <span style="font-size: 14px">&nbsp;&nbsp;&nbsp;&nbsp;用户类型</span>
<el-select v-model="searchInfo.standardId" clearable filterable placeholder="请选择"> <el-select v-model="searchInfo.role" clearable filterable placeholder="请选择">
<el-option v-for="item in standardAll" <el-option v-for="item in standardAll"
:key="item.standardId" :key="item.standardId"
:label="item.standardId" :label="item.standardId"
@ -35,6 +31,8 @@
<!-- 搜索按钮 --> <!-- 搜索按钮 -->
<el-button style="margin-left:10px" type="primary" icon="el-icon-search" @click="getData()" >搜索</el-button> <el-button style="margin-left:10px" type="primary" icon="el-icon-search" @click="getData()" >搜索</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd()">添加</el-button>
</div> </div>
</div> </div>
@ -53,10 +51,10 @@
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50"></el-table-column> <!-- --> <el-table-column type="selection" width="50"></el-table-column> <!-- -->
<el-table-column prop="standardId" label="用户ID" align="center" width="300"></el-table-column> <el-table-column prop="userId" label="用户ID" align="center" width="300"></el-table-column>
<el-table-column prop="standardCon" label="用户名" align="left" width="100"></el-table-column> <el-table-column prop="userName" label="用户名" align="left" width="200"></el-table-column>
<el-table-column prop="standardPointNum" label="分解数量" align="center" width="120"></el-table-column> <el-table-column prop="role" label="用户权限" align="center" width="120"></el-table-column>
<el-table-column label="操作" width="200" align="center" > <el-table-column label="操作" width="50" align="center" >
<template slot-scope="scope"> <!-- 作用域插槽 --> <template slot-scope="scope"> <!-- 作用域插槽 -->
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">{{ ("handle.edit") }}</el-button> <el-button size="small" @click="handleEdit(scope.$index, scope.row)">{{ ("handle.edit") }}</el-button>
<el-button @click.native.prevent="deleteRow(scope.$index, scope.row);" type="danger" size="small">{{ ("handle.dele") }}</el-button> <el-button @click.native.prevent="deleteRow(scope.$index, scope.row);" type="danger" size="small">{{ ("handle.dele") }}</el-button>
@ -129,8 +127,8 @@ export default {
return{ return{
// //
searchInfo:{ searchInfo:{
keyWords:"", phone:"",
standardId:"", role:"",
}, },
// //
Rules: { Rules: {

View File

@ -11,23 +11,24 @@
<div class="card"> <div class="card">
<el-image :src="chat" class="flot-img"/> <el-image :src="chat" class="flot-img"/>
<div class="card-content-left"> <div class="card-content-left">
<h3>交流互动</h3> <h2>交流互动</h2>
<div>dadasdadsad</div> <div class="chat-content" v-html="content">
<div>dsvdsvsdvsdvds</div> </div>
</div> </div>
</div> </div>
<div class="card"> <div class="card">
<div class="chat-link"> <div class="chat-link">
<div class="chat-link" style="cursor: pointer"> <div class="chat-link" style="cursor: pointer" @click="goToForum(1)">
<el-image :src="chat_link1" class="img-link"/> <el-image :src="chat_link1" class="img-link"/>
<div class="chat-link">参赛资讯</div> <div class="chat-link">参赛资讯</div>
</div> </div>
<div class="chat-link" style="cursor: pointer"> <div class="chat-link" style="cursor: pointer" @click="goToForum(2)">
<el-image :src="chat_link2" class="img-link"/> <el-image :src="chat_link2" class="img-link"/>
<div class="chat-link">选手交流</div> <div class="chat-link">选手交流</div>
</div> </div>
<div class="chat-link" style="cursor: pointer"> <div class="chat-link" style="cursor: pointer" @click="goToForum(3)">
<el-image :src="chat_link3" class="img-link"/> <el-image :src="chat_link3" class="img-link"/>
<div class="chat-link">专家答疑</div> <div class="chat-link">专家答疑</div>
</div> </div>
@ -52,14 +53,30 @@ export default {
chat_link1: "/api/files/chat-icon.png", chat_link1: "/api/files/chat-icon.png",
chat_link2: "/api/files/chat-icon.png", chat_link2: "/api/files/chat-icon.png",
chat_link3: "/api/files/chat-icon.png", chat_link3: "/api/files/chat-icon.png",
urlOne:"",
urlTwo:"",
urlThree:"",
contentLoading: true, contentLoading: true,
loadingBg: "#FFF", loadingBg: "#FFF",
content: '',
contentMd:''
} }
}, },
methods:{ methods:{
goToForum(linkNum){
switch (linkNum){
case 1:
window.location.href= this.urlOne
break;
case 2:
window.location.href= this.urlTwo
break;
case 3:
window.location.href= this.urlThree
break;
}
},
initPage(){ initPage(){
pageUtils.checkComp(this.$router,this.$route.params.compId,this.$api); pageUtils.checkComp(this.$router,this.$route.params.compId,this.$api);
this.$api.getPageData(this.$route.params.compId,'chat').then((res) => { this.$api.getPageData(this.$route.params.compId,'chat').then((res) => {
@ -70,6 +87,11 @@ export default {
this.chat_link2 = res.data.logoTwo; this.chat_link2 = res.data.logoTwo;
this.chat_link3 = res.data.logoThree; this.chat_link3 = res.data.logoThree;
this.chat = res.data.imgUrl; this.chat = res.data.imgUrl;
this.content = res.data.content;
this.contentMd = res.data.contentMd;
this.urlOne = res.data.urlOne;
this.urlTwo = res.data.urlTwo;
this.urlThree = res.data.urlThree;
this.contentLoading = false; this.contentLoading = false;
}else { }else {
Message.warning("该页面不存在"); Message.warning("该页面不存在");
@ -129,3 +151,16 @@ export default {
</style> </style>
<style src="@/assets/css/common.css" scoped/> <style src="@/assets/css/common.css" scoped/>
<style lang="scss">
.chat-content{
p{
font-size: 1rem;
line-height:2.0
}
@media (min-width: 2000px) {
p{
font-size: 1.2rem;
}
}
}
</style>

View File

@ -8,13 +8,17 @@
<mavon-editor :ishljs="true" v-model="data" @change="change"/> <mavon-editor :ishljs="true" v-model="data" @change="change"/>
<div class="button-group"> <div class="button-group">
<el-button type="primary" @click="submit">提交</el-button> <el-button type="primary" @click="submit">提交</el-button>
<el-button>取消</el-button> <el-button @click="cancel">取消</el-button>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import {Message} from "element-ui";
import pageUtils from "@/utils/pageUtils";
export default { export default {
name: "ChatEdit", name: "ChatEdit",
@ -26,15 +30,61 @@ export default {
}, },
methods:{ methods:{
cancel(){
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/chat")
},
change(value,render){ change(value,render){
this.html = render; this.html = render;
}, },
initPage(){
pageUtils.checkComp(this.$router,this.$route.params.compId,this.$api);
this.$api.getPageData(this.$route.params.compId,'chat').then((res) => {
console.log(res);
//
if (res.data.show) {
this.data = res.data.contentMd;
}else {
Message.warning("该页面不存在");
this.$router.push({
path: '/404'
});
}
})
},
submit(){ submit(){
console.log(this.data); console.log(this.data);
console.log(this.html); console.log(this.html);
let chatInfo = {
content : this.html,
contentMd : this.data,
compId : this.$route.params.compId
}
this.$api.chatContentUpdate(chatInfo)
.then((res) =>{
if (res.status === 0) {
Message.success("保存成功")
//
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/chat")
}else if (res.status === 20){
Message.error("文件上传失败")
}else if (res.status === 10){
Message.error("系统错误")
}else {
Message.error("权限不足或其他错误")
}
})
.catch(function (res) {
alert(res);
});
} }
},
mounted() {
this.initPage()
} }
} }

View File

@ -15,7 +15,7 @@
</Video> </Video>
</div> </div>
<div class="card-content"> <div class="card-content">
<div>{{ content }}</div> <div></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -5,18 +5,33 @@
<el-breadcrumb-item :to="{ path: '/' + this.$route.params.compId + '/home' }">赛事首页</el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/' + this.$route.params.compId + '/home' }">赛事首页</el-breadcrumb-item>
<el-breadcrumb-item>编辑</el-breadcrumb-item> <el-breadcrumb-item>编辑</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
<mavon-editor :ishljs="true" v-model="data" @save="save"/> <mavon-editor :ishljs="true" v-model="data" @save="save" :xss-options="xssOptions" @change="change"/>
<div class="button-group">
<el-button type="primary" @click="submit">提交</el-button>
<el-button @click="cancel">取消</el-button>
</div>
</div> </div>
</template> </template>
<script> <script>
import pageUtils from "@/utils/pageUtils";
import {Message} from "element-ui";
export default { export default {
name: "HomeEdit", name: "HomeEdit",
data(){ data(){
return{ return{
data: "", data: "",
html:"",
xssOptions:{
whiteList: {
div: ['style'],
img:['src','width','height','style'],
a: ['href', 'title', 'target','style']
}
}
} }
}, },
@ -27,12 +42,72 @@ export default {
// renderhtml // renderhtml
console.log(value); console.log(value);
console.log(render); console.log(render);
},
cancel(){
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/chat")
},
change(value,render){
this.html = render;
},
initPage(){
pageUtils.checkComp(this.$router,this.$route.params.compId,this.$api);
this.$api.getPageData(this.$route.params.compId,'home').then((res) => {
console.log(res);
//
if (res.data.show) {
// this.data = res.data.contentMd;
}else {
Message.warning("该页面不存在");
this.$router.push({
path: '/404'
});
}
})
},
submit(){
console.log(this.data);
console.log(this.html);
let chatInfo = {
content : this.html,
contentMd : this.data,
compId : this.$route.params.compId
}
this.$api.homeContentUpdate(chatInfo)
.then((res) =>{
if (res.status === 0) {
Message.success("保存成功")
//
pageUtils.openPage(this.$router,"/" + this.$route.params.compId +"/chat")
}else if (res.status === 20){
Message.error("文件上传失败")
}else if (res.status === 10){
Message.error("系统错误")
}else {
Message.error("权限不足或其他错误")
}
})
.catch(function (res) {
alert(res);
});
} }
},
mounted() {
this.initPage()
} }
} }
</script> </script>
<style>
.button-group{
margin-top: 50px;
}
</style>
<style src="@/assets/css/common.css" scoped> <style src="@/assets/css/common.css" scoped>
</style> </style>

View File

@ -54,6 +54,18 @@ export const register = data => {
data data
}) })
}; };
export const chatContentUpdate = data => {
return axios({
headers:{
"Authorization": localStorage.getItem("systemToken")
},
url: '/chat/updateContentByCompId',
method: 'post',
data
})
};
// 默认全部倒出 // 默认全部倒出
// 根据需要进行 // 根据需要进行
export default { export default {
@ -62,5 +74,6 @@ export default {
getComp, getComp,
getPageData, getPageData,
login, login,
register register,
chatContentUpdate
} }