Commit 7c86688b authored by anxixi's avatar anxixi

文章相关开发

parent c792d09c
......@@ -372,32 +372,32 @@
if(this.$route.query.remind){
const empinfo = JSON.parse(this.Base64.decode(this.publicFun.getCookie("userInfo")));
//empType 0 小b 1 大b 2 内部用户
if(empinfo.empType == 0){
api.tipInfo().then(response => {
if(response.code == 0) {
for ( let i in response.result) {
if(response.result[i] == 'TIP004'){
this.Visible4 = true;
}
if(response.result[i] == 'TIP003'){
this.Visible3 = true;
}
if(response.result[i] == 'TIP002'){
this.Visible2 = true;
}
if(response.result[i] == 'TIP001'){
this.Visible1 = true;
}
}
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}
// if(empinfo.empType == 0){
// api.tipInfo().then(response => {
// if(response.code == 0) {
// for ( let i in response.result) {
// if(response.result[i] == 'TIP004'){
// this.Visible4 = true;
// }
// if(response.result[i] == 'TIP003'){
// this.Visible3 = true;
// }
// if(response.result[i] == 'TIP002'){
// this.Visible2 = true;
// }
// if(response.result[i] == 'TIP001'){
// this.Visible1 = true;
// }
// }
// } else {
// this.$message.error(response.msgCode);
// }
// })
// .catch(error => {
// console.log("提交出错");
// return false;
// });
// }
}
},
beforeRouteLeave(to,from,next){
......
......@@ -3,197 +3,197 @@ import Qs from 'qs';
export default {
selectCityList(params) {
return api.fetchGet('/business/geo/selectCityList?geoId=' + params);
return api.fetchLoadingGet('/business/geo/selectCityList?geoId=' + params);
},
//频道列表
searchContentChannel (params){
return api.fetchPost('/base/article/searchContentChannel',params);
return api.fetchLogin('/base/article/searchContentChannel',params);
},
//添加频道
addContentChannel (url,params){
return api.fetchPost(url,params);
return api.fetchLogin(url,params);
},
//获取单个频道信息
getContentChannel(params) {
return api.fetchGet('/base/article/getContentChannel?channelId=' + params);
return api.fetchLoadingGet('/base/article/getContentChannel?channelId=' + params);
},
//删除单个频道信息
removeContentChannel(params) {
return api.fetchGet('/base/article/removeContentChannel?channelId=' + params);
return api.fetchLoadingGet('/base/article/removeContentChannel?channelId=' + params);
},
//修改频道序号
changeContentChannelSort (params){
return api.fetchPost('/base/article/changeContentChannelSort',params);
return api.fetchLogin('/base/article/changeContentChannelSort',params);
},
//获取单个分类信息
getContentClassify(params) {
return api.fetchGet('/base/article/getContentClassify?classifyId=' + params);
return api.fetchLoadingGet('/base/article/getContentClassify?classifyId=' + params);
},
//删除单个分类信息
removeContentClassify(params) {
return api.fetchGet('/base/article/removeContentClassify?classifyId=' + params);
return api.fetchLoadingGet('/base/article/removeContentClassify?classifyId=' + params);
},
//修改频道序号
changeContentClassifySort (params){
return api.fetchPost('/base/article/changeContentClassifySort',params);
return api.fetchLogin('/base/article/changeContentClassifySort',params);
},
//分类列表
searchContentClassify (params){
return api.fetchPost('/base/article/searchContentClassify',params);
return api.fetchLogin('/base/article/searchContentClassify',params);
},
//添加分类
addContentClassify (url,params){
return api.fetchPost(url,params);
return api.fetchLogin(url,params);
},
//技术领域
selectSmallBusinessTree (){
return api.fetchGet('/business/industry/selectSmallBusinessTree');
return api.fetchLoadingGet('/business/industry/selectSmallBusinessTree');
},
//行业领域
selectBigBusinessTree (){
return api.fetchGet('/business/industry/selectBigBusinessTree');
return api.fetchLoadingGet('/business/industry/selectBigBusinessTree');
},
//数据字典列表
searchBaseData (params){
return api.fetchPost('/base/article/searchBaseData',params);
return api.fetchLogin('/base/article/searchBaseData',params);
},
//获取单个数据字典信息
getBaseData(params) {
return api.fetchGet('/base/article/getBaseData?dataId=' + params);
return api.fetchLoadingGet('/base/article/getBaseData?dataId=' + params);
},
//添加数据字典
addBaseData (url,params){
return api.fetchPost(url,params);
return api.fetchLogin(url,params);
},
//删除单个数据字典
removeBaseData(params) {
return api.fetchGet('/base/article/removeBaseData?dataId=' + params);
return api.fetchLoadingGet('/base/article/removeBaseData?dataId=' + params);
},
// 发布文章
// 获取频道下拉
getSelectChannels() {
return api.fetchGet('/base/article/getSelectChannels' );
return api.fetchLoadingGet('/base/article/getSelectChannels' );
},
// 获取分类下拉
getSelectClassifies() {
return api.fetchGet('/base/article/getSelectClassifies' );
return api.fetchLoadingGet('/base/article/getSelectClassifies' );
},
//通过code获取数据
selectDictList (params){
return api.fetchGet('/business/dict/selectDictList?groupCode='+params);
return api.fetchLoadingGet('/business/dict/selectDictList?groupCode='+params);
},
//获取数据字典下拉
getSelectData (){
return api.fetchGet('/base/article/getSelectData');
return api.fetchLoadingGet('/base/article/getSelectData');
},
//专家列表
searchProfessor (params){
return api.fetchPost('/base/professor/searchProfessor',params);
return api.fetchLogin('/base/professor/searchProfessor',params);
},
//添加专家
addProfessor (params){
return api.fetchPost('/base/subject/addProfessor',params);
return api.fetchLogin('/base/subject/addProfessor',params);
},
//查询专家信息
searchAccount( params ) {
return api.fetchGet( '/base/subject/searchAccount?empAccount=' + params );
return api.fetchLoadingGet( '/base/subject/searchAccount?empAccount=' + params );
},
//发布文章
pushArticleContent (url,params){
return api.fetchPost(url,params);
return api.fetchLogin(url,params);
},
//敏感词检测
checkSensitiveContent (params){
return api.fetchPost('/business/sensitive/checkSensitiveContent',params);
return api.fetchLogin('/business/sensitive/checkSensitiveContent',params);
},
//频道列表条件
getChannelList() {
return api.fetchGet('/base/article/getChannelList' );
return api.fetchLoadingGet('/base/article/getChannelList' );
},
//分类列表条件
getClassifyList() {
return api.fetchGet('/base/article/getClassifyList' );
return api.fetchLoadingGet('/base/article/getClassifyList' );
},
//文章列表
searchContents (params){
return api.fetchPost('/base/article/searchContents',params);
return api.fetchLogin('/base/article/searchContents',params);
},
//文章上线离线
onlineContent (params){
return api.fetchPost('/base/article/onlineContent',params);
return api.fetchLogin('/base/article/onlineContent',params);
},
//删除文章
removeArticleContent( params ) {
return api.fetchGet( '/base/article/removeArticleContent?contentId=' + params );
return api.fetchLoadingGet( '/base/article/removeArticleContent?contentId=' + params );
},
//置顶等操作和取消
markContent (params){
return api.fetchPost('/base/article/markContent',params);
return api.fetchLogin('/base/article/markContent',params);
},
//获取文章信息
getArticleContent( params ) {
return api.fetchGet( '/base/article/getArticleContent?contentId=' + params );
return api.fetchLoadingGet( '/base/article/getArticleContent?contentId=' + params );
},
// 获取设置信息
getSettingInfo() {
return api.fetchGet('/base/article/getSettingInfo' );
return api.fetchLoadingGet('/base/article/getSettingInfo' );
},
// 保存设置信息
saveSettingInfo(params) {
return api.fetchPost('/base/article/saveSettingInfo',params );
return api.fetchLogin('/base/article/saveSettingInfo',params );
},
//文章 频道
selectContentChannelList() {
return api.fetchPost('/business/content/selectContentChannelList' );
return api.fetchLogin('/business/content/selectContentChannelList' );
},
// 文章列表
selectContentList(url,params) {
return api.fetchPost(url,params );
return api.fetchLogin(url,params );
},
//热门文章
selectHotContent(params) {
return api.fetchPost('/business/content/selectHotContent' ,params);
return api.fetchLogin('/business/content/selectHotContent' ,params);
},
//专家推荐
selectProfessorRecommendedContent() {
return api.fetchPost('/business/content/selectProfessorRecommendedContent' );
return api.fetchLogin('/business/content/selectProfessorRecommendedContent' );
},
//文章详情
selectContentById(params) {
return api.fetchPost('/business/content/selectContentById' , Qs.stringify(params));
return api.fetchLogin('/business/content/selectContentById' , Qs.stringify(params));
},
//查询文章评论
selectContentCommentsList(params) {
return api.fetchPost('/business/content/selectContentCommentsList' , params);
return api.fetchLogin('/business/content/selectContentCommentsList' , params);
},
//查询文章评论
addContentComments(params) {
return api.fetchPost('/business/content/addContentComments' , params);
return api.fetchLogin('/business/content/addContentComments' , params);
},
//文章点赞
addOrSubtractHot(params) {
return api.fetchPost('/business/content/addOrSubtractHot' , params);
return api.fetchLogin('/business/content/addOrSubtractHot' , params);
},
//获取域名
selectBasicParams( ) {
return api.fetchPost( '/base/tools/selectBasicParams');
return api.fetchLogin( '/base/tools/selectBasicParams');
},
//查询举报类型
getselectDictList(params){
return api.fetchGet('/business/dict/selectDictList?groupCode='+'comments_report');
return api.fetchLoadingGet('/business/dict/selectDictList?groupCode='+'comments_report');
},
//举报
reportAxios(params){
......
......@@ -131,7 +131,7 @@
</el-form>
<el-row style="margin: 40px 0 20px 0; text-align: center;width: 100%;">
<el-button type="primary" @click="submitform">提交</el-button>
<el-button @click="backd" plain>预览</el-button>
<el-button v-if="!$route.query.contentId" @click="backd" plain>预览</el-button>
<el-button @click="$router.push('/conmanagement')" plain>取消</el-button>
</el-row>
</div>
......@@ -317,7 +317,7 @@
richText,upImg,uploadCover
},
methods: {
submitform(){
submitform(isview){
if(this.formData.publishType == 1 && !this.formData.publishTime && this.formData.publishTime != ""){
this.$message.error('请选择发布时间')
return
......@@ -364,11 +364,20 @@
}else{
this.formData.firstPic = 0;
}
let urls = this.$route.query.contentId?'/base/article/editArticleContent':'/base/article/pushArticleContent'
let urls = '';
if(isview){
urls = '/base/article/previewArticleContent';
}else{
urls = this.$route.query.contentId?'/base/article/editArticleContent':'/base/article/pushArticleContent';
}
api.pushArticleContent(urls,this.formData).then(response => {
if(response.code == 0) {
this.$message.success(this.$route.query.contentId?'编辑成功':'发布成功');
this.$router.push({path:"/conmanagement",query:{}});
if(isview){
window.open(this.publicFun.getCurrentHrefEnv()+"#/contentdetail?id="+response.result.contentId+'&preview=true');
}else{
this.$message.success(this.$route.query.contentId?'编辑成功':'发布成功');
this.$router.push({path:"/conmanagement",query:{}});
}
} else {
this.$message.error(response.msg);
}
......@@ -389,7 +398,7 @@
});
},
backd(){
window.open(this.publicFun.getCurrentHrefEnv()+"#/contentdetail?id="+''+'&preview='+'')
this.submitform(true);
},
//富文本内容
statedata(val){
......
<template>
<div class="foutdiv">
<div style="bottom:295px;" class="hendtop">
<div v-if="$route.query.preview" style="top:100px;" class="weimatop">
<i>手机预览</i>
<VueQRCodeComponent :text="urltext+contentData.contentId+'&isShow=true'" :size="220" :margin="0"></VueQRCodeComponent>
</div>
<div v-if="!$route.query.preview" style="bottom:295px;" class="hendtop">
<el-popover
placement="top-start"
width="140"
trigger="hover">
<div style="text-align: center">
<img src="../../assets/img/Wechat585.jpeg" style="width: 120px;height: 120px;" alt="">
<VueQRCodeComponent :text="urltext+contentData.contentId" :size="120" :margin="0"></VueQRCodeComponent>
</div>
<i slot="reference" style="font-size: 20px;color: #9197B4;" class="iconfont icon-fenxiang"></i>
</el-popover>
</div>
<div style="bottom:230px;" class="hendtop" @click="handleScrollId">
<!-- 评论-->
<div v-if="!$route.query.preview" style="bottom:230px;" class="hendtop" @click="handleScrollId">
<div v-if="totalStrdto.total>0" class="alarm">
{{totalStrdto.totalStr}}
</div>
<i style="font-size: 20px;color: #9197B4;" class="iconfont icon-pinglun"></i>
</div>
<div @click="getaddOrSubtractHot(false)" style="bottom:165px;" class="hendtop">
<!-- 赞-->
<div v-if="!$route.query.preview" @click="getaddOrSubtractHot(false)" style="bottom:165px;" class="hendtop">
<div v-if="contentData.contentHot>0" class="alarm">
{{contentData.contentHotStr}}
</div>
......@@ -55,7 +61,7 @@
<p>免责声明:</p>
{{settingStatementContent}}
</div>
<div class="content_right">
<div v-if="!$route.query.preview" class="content_right">
<p><span>&nbsp;</span>评论 <i>( {{totalStrdto.totalStr}} )</i></p>
<div id="totaltop">
<div style="width: 50px;">
......@@ -143,11 +149,12 @@
<script>
import api from "./api/api";
import hotArticlepage from "./hotarticlepage";
import VueQRCodeComponent from "vue-qrcode-component";
export default {
name: "contentdetail",
components:{
hotArticlepage
hotArticlepage,VueQRCodeComponent
},
data() {
return {
......@@ -170,6 +177,7 @@
dictname:'',
dicttext:'',
dictData:{},
urltext:'',
}
},
methods:{
......@@ -184,7 +192,8 @@
//右侧推荐
let params = {
hotContentChangeDTO:{
dataList:response.result.dataList
dataList:response.result.dataList,
contentId:this.$route.query.id
}
};
this.$refs.hotstate.getselectHotContent(params);
......@@ -385,11 +394,22 @@
if(res.code==0){
this.reportTypeList = res.result;
}else{
this.$toast(res.msg);
this.$message.error(res.msgCode);
}
}).catch((err)=>{
this.$toast(err);
})
api.selectBasicParams().then(response => {
if(response.code == 0) {
this.urltext = response.result.websitePrefix+'#/articleDetail?id=';
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}
}
......@@ -514,6 +534,23 @@
}
}
.weimatop{
position: fixed;
right: 100px;
border: 1px solid #E8EAF3;
background:#FFFFFF;
box-shadow:0px 2px 8px 0px rgba(0,0,0,0.1);
width: 260px;
height: 300px;
padding: 20px;
text-align: center;
cursor: pointer;
z-index: 9;
>i{
font-size: 24px;
}
}
.hendtop{
position: fixed;
right: 40px;
......
import api from '../../../api/api';
import Qs from 'qs';
export default {
selectNationList (){
......@@ -32,7 +32,12 @@ export default {
tipInfo (){
return api.fetchPost('/business/tip/tipInfo');
},
selectBaseDataList (){
return api.fetchPost('/business/content/selectBaseDataList');
},
addEmpDataLabel (params){
return api.fetchPost('/business/content/addEmpDataLabel',params);
},
//翻译
transAxios(params){
return api.fetchLoadingLogin("/business/trans/commonTrans",params);
......
......@@ -98,6 +98,22 @@
<el-button type="primary" @click="reject(4)">{{$t("Otherjson.goview")}}</el-button>
</el-row>
</el-dialog>
<el-dialog title="请选择您感兴趣的领域" :close-on-press-escape="false" :visible.sync="Visible5" :append-to-body="true" :close-on-click-modal="false" class="dialogWrap500 dialogWrap640">
<div style="margin: 20px auto;display: flex;width: 80%;flex-wrap:wrap;">
<div class="contactscss" style="display: flex" :class="item.state?'':'iscontactscss'" v-for="(item,index) in fielddata">
<div @click="contactsclk(item)">
<div class="images" :class="item.state?'':'isimages'">
<div></div>
<i></i>
</div>
<span style="padding-right: 20px">{{item.dataName}}</span>
</div>
</div>
</div>
<el-row style="padding-top: 20px;text-align: center">
<el-button type="primary" @click="baseDataList()">下一步</el-button>
</el-row>
</el-dialog>
</div>
</template>
......@@ -118,9 +134,11 @@
Visible2:false,
Visible3:false,
Visible4:false,
Visible5:false,
isTrans:this.$i18n.locale=="zh-CN"?false:true,
lang:this.$i18n.locale,
userInfo:this.publicFun.getCookie("userInfo")?JSON.parse(this.Base64.decode(this.publicFun.getCookie("userInfo"))):null,
fielddata:[],
}
},
components:{
......@@ -133,6 +151,29 @@
// console.log(JSON.parse(this.Base64.decode(this.publicFun.getCookie("userInfo"))))
},
methods : {
//个性化
contactsclk(val){
val.state = !val.state;
this.$forceUpdate();
},
//选择感兴趣
baseDataList(){
let dataId = [];
for(let i in this.fielddata){
if(this.fielddata[i].state){
dataId.push(this.fielddata[i].dataId);
}
}
api.addEmpDataLabel(dataId).then((res)=>{
if(res.code==0){
this.Visible5 = false;
}else{
this.$message.error(res.msg);
}
}).catch((err)=>{
this.$message.error(err);
})
},
// 分页导航
handleCurrentChange(val) {
this.cur_page = val;
......@@ -275,6 +316,8 @@
this.translateFunc();
},
},
mounted(){
// const empinfo = JSON.parse(this.Base64.decode(this.publicFun.getCookie("userInfo")));
......@@ -287,7 +330,39 @@
if(this.publicFun.isgetUserRoleFunc(8)){
api.tipInfo().then(response => {
if(response.code == 0) {
if(response.result.length == 0){
api.selectBaseDataList().then((res)=>{
if(res.code==0){
res.result.forEach((item,index)=>{
item.state = false;
})
this.fielddata = res.result;
}else{
this.$message.error(res.msg);
}
}).catch((err)=>{
this.$message.error(err);
})
this.Visible5 = true;
}
for ( let i in response.result) {
if(response.result.indexOf('TIP005') > -1){
}else{
api.selectBaseDataList().then((res)=>{
if(res.code==0){
res.result.forEach((item,index)=>{
item.state = false;
})
this.fielddata = res.result;
}else{
this.$message.error(res.msg);
}
}).catch((err)=>{
this.$message.error(err);
})
this.Visible5 = true;
}
if(response.result[i] == 'TIP004'){
this.Visible4 = true;
}
......@@ -326,7 +401,7 @@
}
</script>
<style>
<style lang="scss" scoped>
.pagination {
padding: 20px 0;
text-align: center;
......@@ -334,4 +409,45 @@
.fontcolor {
color: #5D78FF;
}
.contactscss{
height: 35px;
line-height: 35px;
cursor: pointer;
padding-left: 20px;
border-radius: 3px;
margin: 0 20px 20px 0;
text-align: center;
background: #5D78FF;
color: #FFFFFF;
font-size: 14px;
position: relative;
.images{
div{
position: absolute;
top: -15px;
left: -15px;
transform:rotate(-45deg);
width: 0;
height: 0;
border: 15px solid;
border-color: transparent transparent #FF9E29;
}
i{
position: absolute;
left: 3px;
top: -9px;
font-size: 10px;
color: #ffffff;
}
}
}
.iscontactscss{
background: #F2F2F2!important;
color: #3F3F53!important;
}
.isimages{
div{
border-color: transparent transparent #DEDEDE!important;
}
}
</style>
\ No newline at end of file
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