更新chat模块文本编辑
This commit is contained in:
parent
02499f3eb1
commit
e8bdecdfb9
|
@ -27,10 +27,11 @@ html, body, #app{
|
|||
vertical-align: baseline; /* 行内元素垂直对齐:父级元素基线 */
|
||||
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';
|
||||
|
||||
/*font-family: Helvetica, Arial, sans-serif;*/
|
||||
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ img {
|
|||
}
|
||||
|
||||
.el-menu-item {
|
||||
margin: 10px 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
::v-deep .el-submenu__title {
|
||||
|
|
|
@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -82,6 +82,7 @@ export default {
|
|||
|
||||
<style>
|
||||
.el-menu-item {
|
||||
margin: 10px 0;
|
||||
font-size: 0.9rem !important;
|
||||
}
|
||||
::v-deep .el-submenu__title {
|
||||
|
|
|
@ -19,6 +19,9 @@ import "/src/assets/icon/iconfont.css"
|
|||
import * as echarts from 'echarts'
|
||||
// 时间
|
||||
import moment from "moment"
|
||||
|
||||
import "./assets/font/font.css";
|
||||
|
||||
Vue.prototype.$md5 = md5;
|
||||
|
||||
Vue.use(api)
|
||||
|
|
|
@ -13,19 +13,15 @@
|
|||
|
||||
<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"> 手机号:</span>
|
||||
<el-input v-model="searchInfo.keyWords" suffix-icon="el-icon-edit" clearable placeholder="请输入手机号"></el-input>
|
||||
<span style="font-size: 14px">手机号:</span>
|
||||
<el-input v-model="searchInfo.phone" suffix-icon="el-icon-edit" clearable placeholder="请输入手机号"></el-input>
|
||||
|
||||
<!-- 下拉选框 -->
|
||||
<span style="font-size: 14px"> 用户类型:</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"
|
||||
:key="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 type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd()">添加</el-button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -53,10 +51,10 @@
|
|||
@selection-change="handleSelectionChange">
|
||||
|
||||
<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="standardCon" label="用户名" align="left" width="100"></el-table-column>
|
||||
<el-table-column prop="standardPointNum" label="分解数量" align="center" width="120"></el-table-column>
|
||||
<el-table-column label="操作" width="200" align="center" >
|
||||
<el-table-column prop="userId" label="用户ID" align="center" width="300"></el-table-column>
|
||||
<el-table-column prop="userName" label="用户名" align="left" width="200"></el-table-column>
|
||||
<el-table-column prop="role" label="用户权限" align="center" width="120"></el-table-column>
|
||||
<el-table-column label="操作" width="50" align="center" >
|
||||
<template slot-scope="scope"> <!-- 作用域插槽 -->
|
||||
<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>
|
||||
|
@ -129,8 +127,8 @@ export default {
|
|||
return{
|
||||
//搜索数据
|
||||
searchInfo:{
|
||||
keyWords:"",
|
||||
standardId:"",
|
||||
phone:"",
|
||||
role:"",
|
||||
},
|
||||
//表单验证
|
||||
Rules: {
|
||||
|
|
|
@ -11,23 +11,24 @@
|
|||
<div class="card">
|
||||
<el-image :src="chat" class="flot-img"/>
|
||||
<div class="card-content-left">
|
||||
<h3>交流互动</h3>
|
||||
<div>dadasdadsad</div>
|
||||
<div>dsvdsvsdvsdvds</div>
|
||||
<h2>交流互动</h2>
|
||||
<div class="chat-content" v-html="content">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<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"/>
|
||||
<div class="chat-link">参赛资讯</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"/>
|
||||
<div class="chat-link">选手交流</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"/>
|
||||
<div class="chat-link">专家答疑</div>
|
||||
</div>
|
||||
|
@ -52,14 +53,30 @@ export default {
|
|||
chat_link1: "/api/files/chat-icon.png",
|
||||
chat_link2: "/api/files/chat-icon.png",
|
||||
chat_link3: "/api/files/chat-icon.png",
|
||||
|
||||
urlOne:"",
|
||||
urlTwo:"",
|
||||
urlThree:"",
|
||||
contentLoading: true,
|
||||
loadingBg: "#FFF",
|
||||
content: '',
|
||||
contentMd:''
|
||||
}
|
||||
},
|
||||
|
||||
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(){
|
||||
pageUtils.checkComp(this.$router,this.$route.params.compId,this.$api);
|
||||
this.$api.getPageData(this.$route.params.compId,'chat').then((res) => {
|
||||
|
@ -70,6 +87,11 @@ export default {
|
|||
this.chat_link2 = res.data.logoTwo;
|
||||
this.chat_link3 = res.data.logoThree;
|
||||
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;
|
||||
}else {
|
||||
Message.warning("该页面不存在");
|
||||
|
@ -129,3 +151,16 @@ export default {
|
|||
</style>
|
||||
|
||||
<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>
|
|
@ -8,13 +8,17 @@
|
|||
<mavon-editor :ishljs="true" v-model="data" @change="change"/>
|
||||
<div class="button-group">
|
||||
<el-button type="primary" @click="submit">提交</el-button>
|
||||
<el-button>取消</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {Message} from "element-ui";
|
||||
import pageUtils from "@/utils/pageUtils";
|
||||
|
||||
export default {
|
||||
name: "ChatEdit",
|
||||
|
||||
|
@ -26,15 +30,61 @@ export default {
|
|||
},
|
||||
|
||||
methods:{
|
||||
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,'chat').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.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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</Video>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div>{{ content }}</div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,18 +5,33 @@
|
|||
<el-breadcrumb-item :to="{ path: '/' + this.$route.params.compId + '/home' }">赛事首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>编辑</el-breadcrumb-item>
|
||||
</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>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pageUtils from "@/utils/pageUtils";
|
||||
import {Message} from "element-ui";
|
||||
|
||||
export default {
|
||||
name: "HomeEdit",
|
||||
|
||||
data(){
|
||||
return{
|
||||
data: "",
|
||||
html:"",
|
||||
xssOptions:{
|
||||
whiteList: {
|
||||
div: ['style'],
|
||||
img:['src','width','height','style'],
|
||||
a: ['href', 'title', 'target','style']
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -27,12 +42,72 @@ export default {
|
|||
// render是html格式
|
||||
console.log(value);
|
||||
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>
|
||||
|
||||
<style>
|
||||
.button-group{
|
||||
margin-top: 50px;
|
||||
}
|
||||
</style>
|
||||
<style src="@/assets/css/common.css" scoped>
|
||||
|
||||
</style>
|
|
@ -54,6 +54,18 @@ export const register = data => {
|
|||
data
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
export const chatContentUpdate = data => {
|
||||
return axios({
|
||||
headers:{
|
||||
"Authorization": localStorage.getItem("systemToken")
|
||||
},
|
||||
url: '/chat/updateContentByCompId',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
};
|
||||
// 默认全部倒出
|
||||
// 根据需要进行
|
||||
export default {
|
||||
|
@ -62,5 +74,6 @@ export default {
|
|||
getComp,
|
||||
getPageData,
|
||||
login,
|
||||
register
|
||||
register,
|
||||
chatContentUpdate
|
||||
}
|
Loading…
Reference in New Issue