Commit a5d35ee6 authored by anxixi's avatar anxixi

行业报告开发

parent a8b84647
......@@ -4,6 +4,7 @@ module.exports = {
findProject:"Find Techs",
findCustomer:"Find Clients",
professionfocusing:"Focus",
industry:'Industry Reports',
cooperationcase:"Cases",
knowledge: "Resources",
industryActive:"News",
......@@ -1991,7 +1992,17 @@ module.exports = {
beijingtime:'Beijing Time',
version:'Select version',
maxUpload:'Upload image size cannot exceed',
}
},
//行业报告
industryjson:{
share1:'Share to WeChat Moments',
share2:"Open WeChat and click'Discovery' at the bottom",
share3:"Use'sweep' to share the file to the circle of friends",
loading:'Loading...',
nomore:'No more',
allchannels:'All channels',
},
}
......@@ -5,6 +5,7 @@ module.exports = {
findCustomer: "找客户",
professionfocusing: "行业聚焦",
cooperationcase: "合作案例",
industry:'行业报告',
knowledge: "知识资源",
industryActive: "行业动态",
aboutUs: "关于我们",
......@@ -2089,8 +2090,17 @@ module.exports = {
beijingtime:'北京时间',
version:'选择版本',
maxUpload:'上传图片大小不能超过',
}
},
//行业报告
industryjson:{
share1:'分享到微信朋友圈',
share2:"打开微信,点击底部的'发现'",
share3:"使用'扫一扫'即可将该文件分享至朋友圈",
loading:'加载中...',
nomore:'没有更多了',
allchannels:'全部频道',
},
}
......@@ -36,26 +36,6 @@
<i class="iconfont icon-xiaoxi"></i>
<div id="redMsg" v-if="messageVisible"></div>
</span>
<!-- <span class="roleSpan" v-if="!isShow">-->
<!-- <img style="margin-right: 5px;height: 18px" src="../../assets/img/svip.png" alt="图片" v-if="userInfo&&userInfo.isPrivilegeVip==1">-->
<!-- <span style="margin-right: 5px;" v-if="userInfo&&userInfo.empType!=2&&userInfo.authenticationState==2&&userInfo.isPrivilegeVip!=1">-->
<!-- <img src="../../assets/img/vipIcon@2x.png" alt="">-->
<!-- </span>-->
<!-- <span style="margin-right: 5px;" v-if="userInfo&&userInfo.empType!=2&&userInfo.authenticationState!=2&&userInfo.isPrivilegeVip!=1">-->
<!-- <img src="../../assets/img/vipGrayIcon@2x.png" alt="">-->
<!-- </span>-->
<!-- <i style="background: #FF5D5D;border-radius: 3px;" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==5"><img-->
<!-- :src="lang=='en'?require('../../assets/img/PM@2x.png'):require('../../assets/img/xiaoshouIcon@2x.png')" alt=""></i>-->
<!-- <i style="background: #FF5D5D;border-radius: 3px;" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==2"><img-->
<!-- :src="lang=='en'?require('../../assets/img/OM@2x.png'):require('../../assets/img/yunyingIcon@2x.png')" alt=""></i>-->
<!-- <i style="background: #5D78FF;border-radius: 3px;" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.empType==1"><img-->
<!-- :src="lang=='en'?require('../../assets/img/corporate@2x.png'):require('../../assets/img/bigBusinessIcon@2x.png')" alt=""></i>-->
<!-- <i style="background: #5D78FF;border-radius: 3px;" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.empType==0"><img-->
<!-- :src="lang=='en'?require('../../assets/img/startUp@2x.png'):require('../../assets/img/smallBusinessIcon@2x.png')" alt=""></i>-->
<!-- <i style="background: #5D78FF;border-radius: 3px;" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==1"><img-->
<!-- :src="lang=='en'?require('../../assets/img/adminIcon@2x.png'):require('../../assets/img/adminIcon@2x.png')" alt=""></i>-->
<!-- </span>-->
<!-- <span style="margin: 0;margin-top: -2px;" v-if="userInfo&&!isShow">|</span>-->
<span @click="changeLangEvent()" class="langHoverSpan"><i :class="lang==='zh-CN'?'selectedLang':''">中文</i><i> / </i><i
:class="lang==='en'?'selectedLang':''">En</i></span>
</div>
......@@ -73,16 +53,6 @@
<img src="../../assets/img/index/headerDefault.png" alt="">
<p class="user-name" v-if="userInfo&&(userInfo.empName||userInfo.empAccount)">{{userInfo&&userInfo.empName?userInfo.empName : userInfo.empAccount}}</p>
<p class="auth-info authinfo">
<!-- <img src="../../assets/img/svip.png" alt="" v-if="userInfo&&userInfo.isPrivilegeVip==1">-->
<!-- <span v-else>-->
<!-- <img src="../../assets/img/vipIcon@2x.png" alt="图片" v-if="userInfo&&userInfo.empType!=2&&userInfo.authenticationState==2">-->
<!-- <img src="../../assets/img/vipGrayIcon@2x.png" alt="图片" v-if="userInfo&&userInfo.empType!=2&&userInfo.authenticationState!=2">-->
<!-- </span>-->
<!-- <img :src="diven_zh?require('../../assets/img/PM@2x.png'):require('../../assets/img/xiaoshouIcon@2x.png')" alt="图片" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==5">-->
<!-- <img :src="diven_zh?require('../../assets/img/OM@2x.png'):require('../../assets/img/yunyingIcon@2x.png')" alt="图片" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==2">-->
<!-- <img :src="diven_zh?require('../../assets/img/corporate@2x.png'):require('../../assets/img/bigBusinessIcon@2x.png')" alt="图片" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==7 || userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==6">-->
<!-- <img :src="diven_zh?require('../../assets/img/startUp@2x.png'):require('../../assets/img/smallBusinessIcon@2x.png')" alt="图片" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==4 || userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==3">-->
<!-- <img :src="diven_zh?require('../../assets/img/admin@2x.png'):require('../../assets/img/adminIcon@2x.png')" alt="图片" v-if="userInfo&&userInfo.roleList.length>0&&userInfo.roleList[0].roleType==1">-->
</p>
</div>
......@@ -118,20 +88,6 @@
</li>
</ul>
</div>
<!--<div class="projectUl">-->
<!--<p class="title"><span>{{$t("drawerInfo.projects")}}</span><span>{{$t("drawerInfo.submitPro")}}</span></p>-->
<!--<ul>-->
<!--<li>-->
<!--<img src="../../assets/img/index/Bitmap(1).png" alt="">-->
<!--<span>创新奇智</span>-->
<!--</li>-->
<!--<li>-->
<!--<img src="../../assets/img/index/Bitmap(1).png" alt="">-->
<!--<span>创新奇智qqq</span>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
<div class="buttonwrapper">
<el-button @click="handleLogout">
{{$t("topNav.logout")}}
......@@ -175,19 +131,24 @@
activeIndex: '1',
list: [{
id: 1,
name: "index"
name: "index",
path:'/',
}, {
id: 2,
name: "findProject"
name: "findProject",
path:'/seeprojectlist',
}, {
id: 3,
name: "findCustomer"
name: "findCustomer",
path:'/bigBusiness/list',
}, {
id: 4,
name: this.$i18n.locale=='zh-CN'?"newsArticle":"industryActive"
name: this.$i18n.locale=='zh-CN'?"newsArticle":"industryActive",
path:this.$i18n.locale=='zh-CN'?"/contentall":"/lndustryfocus",
}, {
id: 6,
name: "cooperationcase"
name: "industry",
path:'/industrypage',
}],
currentIndex: this.publicFun.getCookie("currentNav")==null||this.publicFun.getCookie("currentNav")==undefined||this.publicFun.getCookie("currentNav")==1||this.publicFun.getCookie("currentNav")==2?0:this.publicFun.getCookie("currentNav"),
lang: this.$i18n.locale,
......@@ -246,24 +207,13 @@
handleClick(data,index) {
this.$emit('aboutwebtn',index+'');
if(this.currentIndex!=index){
}
this.currentIndex = index;
this.publicFun.setUserInfoCookie("currentNav",index);
if(index==4) this.$router.push("/successfulcase");
if(index==3) this.$i18n.locale=='zh-CN'?this.$router.push("/contentall"):this.$router.push("/lndustryfocus");
if(index==0) this.$router.push("/");
if(index==1) this.$router.push("/seeprojectlist");
else if(index==2) this.$router.push("/bigBusiness/list");
// if(index!=3){
this.$emit("itemNav",index);
globalMsg.$emit("sendItemNav",index);
// }
this.$router.push(data.path);
this.$emit("itemNav",index);
globalMsg.$emit("sendItemNav",index);
if(index==0) this.maiDianFunc("pcindex");
else this.maiDianFunc(data.name);
},
handleShowChildren(index){
......
......@@ -56,7 +56,7 @@
expertVisible:false
}
},
props:['activityId','registerType'],
props:['activityId','registerType','reportId'],
methods: {
closeSensor(){
......@@ -105,6 +105,7 @@
account: this.registerForm.phone,
code: this.registerForm.code,
activityId:this.activityId?this.activityId:undefined,
reportId:this.reportId?this.reportId:undefined,
autoRegisterState:this.registerType?this.registerType:undefined
};
this.fullscreenLoading = true;
......
......@@ -177,7 +177,7 @@ router.beforeEach((to, from, next) => {
if(!publicFun.getCookie("userInfo")){
if(to.name == 'dashboard'||to.name=='indexView'|| to.name == 'login' || to.name == 'mobileLoginCmpt'|| to.name == 'emailLoginCmpt'|| to.name == 'mobileRegisterCmpt'|| to.name == 'emailRegisterCmpt'||to.name=='completeInfoCmpt'|| to.name == 'successCmpt'||to.name=='findPasswordCmpt'||to.name=='modifyPasswordCmpt'||to.name=='passSuccessCmpt'||to.name=='indexView'||to.name=="mobileIndex"||to.name=="mobileLogin"||to.name=="loginByPhone"||to.name=="loginByEmail"||to.name=="mobileRegister"||to.name=="duijieshareRequire"||to.name=="duijieshareProject"||to.name=="knowledgeList"||to.name=="knowledgeDetail"||to.name=='vip'||to.name=='vipList'||to.name=='loadEmail'||to.name=='openEmail'||to.name=="viewRequire"||to.name=="duijiephoneBusinessList"||to.name=="duijiephoneBusinessDetail"||to.name=="duijiephoneRequireDetail"||to.name=="bigBusinessList"||to.name=="bigBusinessDetail"||to.name=="requireDetail"||to.name=="mixSearch"||to.name=="activitylist"||to.name=="activitydetail"||to.name=="activitySearchResult"||to.name=="activityapplyForProject"||to.name=='wechatLogin'||to.name=='newPage'||to.name=='bindAccount'||to.name=='subjectsecondStage'||to.name=='subjectsecondStageDetail'||to.name=='subjectmasterComment'||to.name=='subjectmasterList'||to.name=='subjectmasterDetail'||to.name=='subjectfirstStage'||to.name=='subjectcommentMore'||to.name=='subjectList'||to.name=="subjectresultpage"||to.name=="mineIndex"||to.name=="subjectStage"||to.name=="articleList"||to.name=="articleFlagList"||to.name=="articleDetail"||to.name=="mobileSearch"||to.name=="tryNewPage"||to.name=="industryReport"||to.name=="pdf"){
} else{
if(to.path == '/contentall'||to.path == '/contentdetail'||to.path == '/tabconnect'||to.path == '/thirdStage'||to.path == '/questionfill'||to.path == '/questionfillpc'||to.path == '/casedetailschild'||to.path == '/lndustryfocuschild'||to.path == '/successfulcasechild'||to.path == '/projectdetails'||to.path == '/seeprojectlist'||to.path == '/projectlist'||to.path == '/viewproject'||to.path == '/templateMobile1'||to.path == '/knowledge'||to.path == '/knowledgedetails'||to.path == '/termserviceed'||to.path == '/privacypolicyed'||to.path == '/contactused'||to.path == '/aboutused'||to.path == '/casedetailsed'||to.path == '/lndustryfocused'||to.path == '/successfulcaseed'||to.path == '/usehelped'||to.path == '/useHelp'||to.path == '/reminder'||to.path == '/contactus' ||to.path == '/privacypolicy' ||to.path == '/termservice' ||to.path == '/casedetails' ||to.path == '/successfulcase' ||to.path == '/lndustryfocus' ||to.path == '/aboutus'||to.path=='/applicationnotice' ){
if(to.path == '/industrypage'||to.path == '/contentall'||to.path == '/contentdetail'||to.path == '/tabconnect'||to.path == '/thirdStage'||to.path == '/questionfill'||to.path == '/questionfillpc'||to.path == '/casedetailschild'||to.path == '/lndustryfocuschild'||to.path == '/successfulcasechild'||to.path == '/projectdetails'||to.path == '/seeprojectlist'||to.path == '/projectlist'||to.path == '/viewproject'||to.path == '/templateMobile1'||to.path == '/knowledge'||to.path == '/knowledgedetails'||to.path == '/termserviceed'||to.path == '/privacypolicyed'||to.path == '/contactused'||to.path == '/aboutused'||to.path == '/casedetailsed'||to.path == '/lndustryfocused'||to.path == '/successfulcaseed'||to.path == '/usehelped'||to.path == '/useHelp'||to.path == '/reminder'||to.path == '/contactus' ||to.path == '/privacypolicy' ||to.path == '/termservice' ||to.path == '/casedetails' ||to.path == '/successfulcase' ||to.path == '/lndustryfocus' ||to.path == '/aboutus'||to.path=='/applicationnotice' ){
}else{
if(to.path == '/projectlist' || to.path == '/phoneBusinessList'){
......
......@@ -162,6 +162,11 @@ const router = new Router({
component: resolve => require(['views/conmanagementpage/contentdetails.vue'], resolve).catch(routerUtils.catchImport),
meta: {title: '最新资讯详情'}
},
{
path: '/industrypage',
component: resolve => require(['views/industryreportspage/industrypage.vue'], resolve).catch(routerUtils.catchImport),
meta: {title: '行业报告'}
},
// {
// path: '/knowledge',
// component: resolve => require(['views/knowledge/computer/computerlist.vue'], resolve),
......@@ -652,6 +657,16 @@ const router = new Router({
component: resolve => require(['views/conmanagementpage/contentarticle.vue'], resolve).catch(routerUtils.catchImport),
meta: {title: '发布文章'}
},
{
path: '/industrymanagement',
component: resolve => require(['views/industryreportspage/industrymanagement.vue'], resolve).catch(routerUtils.catchImport),
meta: {title: '行业报告'}
},
{
path: '/pushindustry',
component: resolve => require(['views/industryreportspage/pushindustry.vue'], resolve).catch(routerUtils.catchImport),
meta: {title: '创建报告'}
},
]
},
{
......
......@@ -201,4 +201,9 @@ export default {
reportAxios(params){
return api.fetchLoadingPost("/business/subject/addCommentsReport",params);
},
//行业报告右侧推荐
getMarvellousArticle (params){
return api.fetchGet('/business/report/getMarvellousArticle');
},
}
\ No newline at end of file
<template>
<div class="soutform" style="margin-top: 20px;background: #ECECF2;">
<el-row class="">
<el-row>
<el-row class="tabPdding">
<el-row class="statebottm">
<page-screen :screenlist="channelList" :checkboxGroupstate="channelrow" :screenchildListIf="false" ref="channelchild" titleName="按频道检索 " @changecheck="channelData"></page-screen>
......
......@@ -20,7 +20,7 @@
<div class="divclasschild">
<div>
<div style="width: 100%;margin-right: 30px;">
<div :style="positions?'position: fixed;top: 0;background: #ffffff;z-index: 99;width: 56%;':'position: relative;width: 100%;'">
<div :style="positions?'position: fixed;top: 0;background: #ffffff;z-index: 99;width: calc(100% - 590px);':'position: relative;width: 100%;'">
<el-tabs class="content_tab" v-if="issearchclas" v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="(item,index) in channelListmax" :key="index" :label="item.channelName" :name="item.channelId+''"></el-tab-pane>
</el-tabs>
......
......@@ -699,34 +699,6 @@
isprogress(){
this.isuploadshow = true;
},
videohandleBeforeFile(file){
var nameArr = file.name.split('.');
const isOgg = nameArr[nameArr.length - 1] === 'Ogg';
const isWebM = nameArr[nameArr.length - 1] === 'WebM';
const isMp4 = nameArr[nameArr.length - 1] === 'mp4';
const isLt200M = file.size / 1024 / 1024 <= 200;
if ( !isMp4 && !isOgg && !isWebM) {
this.$message.error('上传文件格式错误');
}else if(!isLt200M){
this.$message.error('上传文件大小不能超过 200MB');
}
this.isflag = 1;
return ( isMp4 || isOgg || isWebM) && isLt200M;
},
audiohandleBeforeFile(file){
var nameArr = file.name.split('.');
const isOgg = nameArr[nameArr.length - 1] === 'Ogg';
const isWebM = nameArr[nameArr.length - 1] === 'Wav';
const isMp3 = nameArr[nameArr.length - 1] === 'mp3';
const isLt200M = file.size / 1024 / 1024 <= 200;
if ( !isMp3 && !isOgg && !isWebM) {
this.$message.error('上传文件格式错误');
}else if(!isLt200M){
this.$message.error('上传文件大小不能超过 200MB');
}
this.isflag = 1;
return ( isMp3 || isOgg || isWebM) && isLt200M;
},
//附件上传之前判断文件格式
handleBeforeFile(file) {
if(this.formData.videoAudioType == 0){
......
......@@ -126,7 +126,7 @@
<div @click="totalStrdto.pages==cur_page||totalStrdto.pages==0?'':addclkreply()">
<p class="addclkreply">
<span v-if="totalStrdto.pages==cur_page">暂无更多评论</span>
<span v-else>查看更多评论 <i style="color: #5D78FF;font-size: 12px;" class="iconfont icon-xiala"></i></span>
<span v-if="totalStrdto.pages > cur_page">查看更多评论 <i style="color: #5D78FF;font-size: 12px;" class="iconfont icon-xiala"></i></span>
</p>
</div>
</div>
......
<template>
<div style="width: 320px">
<div :style="istopShow==true?'position: fixed;top: 0;z-index:0;':istopShow==3?'position: fixed;top: 70px;z-index:0;':''">
<div v-if="!isindustry" :style="istopShow==true?'position: fixed;top: 0;z-index:0;':istopShow==3?'position: fixed;top: 70px;z-index:0;':''">
<div class="content_right" v-if="hotlist&&hotlist.length>0">
<p><span>&nbsp;</span>热门文章</p>
<div class="hto_content">
......@@ -48,7 +48,20 @@
</div>
</div>
</div>
<div v-else :style="istopShow==true?'position: fixed;top: 0;z-index:0;':istopShow==3?'position: fixed;top: 70px;z-index:0;':''">
<div class="content_right" v-if="hotlist&&hotlist.length>0">
<p><span>&nbsp;</span>精彩内容 <i @click="gocontentall" style="position: absolute;right: 0px;top: 0px;font-size: 14px;font-weight: normal;cursor: pointer;">查看更多 > </i></p>
<div class="hto_content">
<div style="cursor: pointer;width: 100%;" v-for="(item,index) in hotlist" :key="index" @click="gocontent(item,true)">
<p class="imgInfo" style="width: 80px;height: 56px;" :style="{backgroundImage:'url('+(item.contentCoverUrl?item.contentCoverUrl:item.contentUrl?item.contentUrl.split(',')[0]:'')+')'}">
<!-- <img :src="item.contentCoverUrl?item.contentCoverUrl:item.contentUrl?item.contentUrl.split(',')[0]:''" alt="图片">-->
</p>
<p class="ellipsisFont2" style="width: 225px;height: 54px;">{{item.contentTitle}}</p>
</div>
</div>
</div>
</div>
</div>
</template>
......@@ -66,7 +79,7 @@
}
},
props:[
'isstate'
'isstate','isindustry'
],
methods:{
getselectHotContent(params){
......@@ -82,6 +95,19 @@
return false;
});
},
getMarvellousArticle(){
api.getMarvellousArticle().then(response => {
if(response.code == 0) {
this.hotlist = response.result;
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
selectProfessorRecommendedContent(params){
api.selectProfessorRecommendedContent(params).then(response => {
if(response.code == 0) {
......@@ -131,6 +157,9 @@
window.open(this.publicFun.getCurrentHrefEnv()+"#/contentdetail?id="+row.contentId+'&newnpen=true');
// this.$router.push({path:"/contentdetail",query:{id:row.contentId}});
},
gocontentall(){
window.open(this.publicFun.getCurrentHrefEnv()+"#/contentall?newnpen=true");
},
},
mounted() {
// let params = {
......@@ -157,6 +186,7 @@
font-size: 16px;
font-weight: bold;
border-bottom: 2px solid #E8EAF3;
position: relative;
>span{
border-left: 2px solid #5D78FF;
margin-right: 10px;
......
......@@ -3,7 +3,7 @@
<page-top v-show="istopShow" v-if='islogindata/2 === 0' :key='islogindata' :initStyle="isInit" :documentFront="documentFront" :pathfrom="pathfrom" :isShow="isShow" :isOther="isOther" @aboutwebtn="aboutwebtn" :numone="numone" @itemNav="sendItemNav"></page-top>
<page-top v-show="istopShow" v-else :key='islogindata' :initStyle="isInit" :documentFront="documentFront" :pathfrom="pathfrom" :isShow="isShow" :isOther="isOther" @aboutwebtn="aboutwebtn" :numone="numone" @itemNav="sendItemNav"></page-top>
<div class="page-content popper-boundaries">
<router-view @itemBtn="sendbtns" />
<router-view @itemBtn="sendbtns" />
</div>
<PageBottom v-if="isShow" @itemBtn="sendbtn" @aboutwebtn="aboutwebtn" style="z-index: 1;position: relative;"></PageBottom>
</div>
......
import api from '../../../api/api';
import Qs from 'qs';
export default {
selectCityList(params) {
return api.fetchLoadingGet('/business/geo/selectCityList?geoId=' + params);
},
//添加行业报告
addindustry (url,params){
return api.fetchLogin(url,params);
},
//行业报告最大下载量
getReportDownloadCount (){
return api.fetchGet('/business/report/getReportDownloadCount');
},
//行业报告删除
setReportDownloadCount (params){
return api.fetchLogin('/business/report/setReportDownloadCount' ,Qs.stringify(params));
},
//行业报告分类
dataGroupAllList (){
return api.fetchGet('/business/report/dataGroupAllList');
},
//行业报告列表
backList (params){
return api.fetchGet('/business/report/backList' +params);
},
//行业报告编辑数据
getindustry (params){
return api.fetchGet('/business/report/get?reportId=' +params);
},
//行业报告删除
deleteindustsry (params){
return api.fetchLogin('/business/report/delete' ,Qs.stringify(params));
},
//列表修改首页、置顶操作
marktype (url,params){
return api.fetchLogin(url,Qs.stringify(params));
},
//行业报告前端列表
showList (url,params){
return api.fetchLoadingGet(url +params);
},
//行业报告下载链接
getDownloadUrl (params){
return api.fetchLoadingGet('/business/report/getDownloadUrl?reportId=' +params);
},
//获取域名
selectBasicParams( ) {
return api.fetchLogin( '/base/tools/selectBasicParams');
},
//行业报告右侧推荐
getMarvellousArticle (params){
return api.fetchLoadingGet('/business/report/getMarvellousArticle');
},
}
\ No newline at end of file
<template>
<div class="soutform" style="margin-top: 20px;background: #ECECF2;">
<el-row>
<el-row class="tabPdding">
<el-row class="statebottm">
<page-screen :screenlist="groupalllist" :screenchildListIf="false" ref="classifychild" titleName="按分类检索 " @changecheck="classifyData"></page-screen>
</el-row>
<el-row class="statebottm" style="line-height: 60px;">
<span style="font-weight: bold;padding: 0 45px 0 10px;">版本:</span>
<el-radio v-model="radio" label="0">全部</el-radio>
<el-radio v-model="radio" label="zh">中文</el-radio>
<el-radio v-model="radio" label="en">英文</el-radio>
</el-row>
<el-row style="margin: 20px 0 0 10px" class="contnetform">
<el-form :inline="true" label-width="80px" label-position="left" style="width: 100%;">
<el-form-item label="创建时间">
<template slot-scope="scope">
<div style="display:flex;">
<el-date-picker style="width: 200px;" v-model="searchs.startDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('operationjson.authBegin')"></el-date-picker>
<p style="width: 50px;text-align: center">{{$t('operationjson.tos')}}</p>
<el-date-picker style="width: 200px;" v-model="searchs.endDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" :placeholder="$t('operationjson.authEnd')"></el-date-picker>
<el-input style="width: 240px;margin-left: 20px;" v-model="searchs.keyWords"
placeholder="请输入关键字"></el-input>
<el-button type="primary" style="width: 140px;margin-left: 20px" @click="searchCik">{{$t('operationjson.search')}}</el-button>
</div>
</template>
</el-form-item>
</el-form>
</el-row>
</el-row>
<el-row class="contentPadding">
<el-form :inline="true">
<el-form-item>
<el-button type="primary" @click="newreports">发布行业报告</el-button>
</el-form-item>
</el-form>
<el-table :data="industryalllist" tooltip-effect="dark" class="projectTable2">
<el-table-column label="ID" prop="reportId" align="center" width="50">
</el-table-column>
<el-table-column prop="reportTitle" label="标题" align="center" width="170">
<template slot-scope="scope">
{{scope.row.reportTitle}}
<p>
<span style="color: #FF5D5D;margin-right: 5px;" v-if="scope.row.isTop== 1">[ 置顶 ]</span>
<span style="color: #5D78FF" v-if="scope.row.isHomePage== 1">[ 首页 ]</span>
</p>
</template>
</el-table-column>
<el-table-column prop="baseDataVO.dataName" label="行业通俗标签" align="center">
</el-table-column>
<el-table-column prop="languageType" label="版本" align="center">
<template slot-scope="scope">
{{scope.row.languageType=='zh'?'中文':'英文'}}
</template>
</el-table-column>
<el-table-column prop="createdTime" label="创建时间" align="center">
</el-table-column>
<el-table-column prop="createdName" label="创建人" align="center">
</el-table-column>
<el-table-column prop="contentNum" label="阅读量/下载/分享数" align="center">
<template slot-scope="scope">
{{scope.row.readCount}}/{{scope.row.downloadNumber}}/{{scope.row.shareCount}}
</template>
</el-table-column>
<el-table-column label="操作" width="200" align='center'>
<template slot-scope="scope">
<el-button type="text" @click="viewShow(scope.row)">查看</el-button>
<el-button type="text" @click="editreports(scope.row)">编辑</el-button>
<el-button type="text" @click="deletereports(scope.row)">删除</el-button>
<el-button type="text" @click="getmark(scope.row,1)">{{scope.row.isHomePage== 1?'取消首页':'首页'}}</el-button>
<el-button type="text" @click="getmark(scope.row,2)">{{scope.row.isTop== 1?'取消置顶':'置顶'}}</el-button>
</template>
</el-table-column>
<template slot="empty">
<i class="iconfont icon-hezi501 datai"></i>
<p class="datap">{{$t('listjson.notfoundyet')}}</p>
</template>
</el-table>
<div class="pagination">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
background
:page-sizes="[10, 20, 30, 40, 50]"
:page-size="10"
:current-page="searchs.pageSize"
layout=" total, prev, pager, next"
:total="totalListResult">
</el-pagination>
</div>
</el-row>
</el-row>
</div>
</template>
<script>
import api from "./api/api";
import pageScreen from "../../components/index/Pagescreen";
export default {
name: "industryall",
data() {
return {
groupalllist:[],
searchs:{
pageIndex:10,
pageSize:1,
languageType:this.radio,
},
cur_page: 1, //页数
totalListResult: 0,
numberData: 10, //设置个数
reportslist:[],
radio:'0',
industryalllist:[],
}
},
components:{
pageScreen
},
methods:{
//按条件检索
classifyData(data){
this.searchs.dataIds = data;
this.getsearchreports();
},
searchCik(){
this.getsearchreports();
},
//发布行业报告
newreports(){
this.$router.push({path:'/pushindustry'})
},
//查看
viewShow(row){
},
//编辑
editreports(row){
this.$router.push({path:"/pushindustry",query:{reportId:row.reportId}});
},
//删除
deletereports(row){
this.$confirm('是否确认删除', {
cancelButtonText: '取消',
confirmButtonText: '确认',
type: '',
customClass: 'deleteConfirm'
}).then(() => {
api.deleteindustsry({reportId:row.reportId}).then(response => {
if(response.code == 0) {
this.$message.success('删除成功');
this.searchs.pageSize = 1;
this.getsearchreports();
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}).catch(() => {
});
},
// 分页导航
handleCurrentChange(val) {
this.searchs.pageIndex = val;
this.getsearchreports();
},
//设置个数
handleSizeChange(val) {
this.searchs.pageSize = val;
this.getsearchreports();
},
//行业报告列表
getsearchreports(){
let pagedata = '?pageIndex='+this.searchs.pageIndex+'&pageSize='+this.searchs.pageSize;
let startDate = this.searchs.startDate?'&startDate='+this.searchs.startDate:'';
let dataIds = this.searchs.dataIds?'&dataIds='+this.searchs.dataIds:'';
let endDate = this.searchs.endDate?'&endDate='+this.searchs.endDate:'';
let keyWords = this.searchs.keyWords?'&keyWords='+this.searchs.keyWords:'';
let languageType = this.radio=='zh'?'&languageType=zh':this.radio=='en'?'&languageType=en':'';
let params = pagedata + dataIds + startDate + endDate + keyWords + languageType;
api.backList(params).then(response => {
if(response.code == 0) {
this.industryalllist = response.result.records;
this.totalListResult = response.result.total;
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
//置顶等操作
getmark(row,state){
let urls = state == 1?'/business/report/isHomePage':'/business/report/isTop';
let params = {
reportId:row.reportId,
};
if(state == 1){
params.isHomePage = row.isHomePage== 0?1:0;
}else if(state == 2){
params.isTop = row.isTop== 0?1:0;
}
api.marktype(urls,params).then(response => {
if(response.code == 0) {
this.$message.success('操作成功');
this.getsearchreports();
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
},
mounted() {
this.getsearchreports();
api.dataGroupAllList().then(response => {
if(response.code == 0) {
response.result.forEach( ( item ) => {
item.checked = false;
item.industryName = item.dataName;
item.industryId = item.dataId;
item.screenchildList = null;
} );
this.groupalllist = response.result;
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div class="soutform loginedWrapper">
<div class="breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/projectdynamics' }">{{$t("releasejson.wrkbench")}}</el-breadcrumb-item>
<el-breadcrumb-item>行业报告</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="projectTabadd">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="行业报告" name="first">
<industryall v-if='showNum/2 === 0' :key='showNum' ref="childone"></industryall>
<industryall v-else :key='showNum' ref="childone"></industryall>
</el-tab-pane>
<el-tab-pane label="设置" name="second">
<div style="margin-top: 20px;">
<el-form label-position="right" label-width="180px" class="contnetform180" >
<el-form-item label="每天下载数量:">
<el-input @input="changenumber" v-model="numberData" type="number" style="width: 400px;" placeholder="1-99999"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getsaveSettingInfo">保存</el-button>
</el-form-item>
</el-form>
</div>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import api from "./api/api";
import industryall from "./industryall";
export default {
name: "industrymanagement",
data() {
return {
activeName:'first',
showNum: 2,
numberData:''
}
},
components:{
industryall
},
methods:{
handleClick(tab, event){
},
changenumber(){
if(this.numberData.length>10)this.numberData=this.numberData.slice(0,10);
this.numberData=this.numberData.replace(/\D/g,'');
},
getsaveSettingInfo(){
if(this.numberData == ''){
this.$message.error('请输入正确的数值');
return
}
api.setReportDownloadCount({count:this.numberData}).then(response => {
if(response.code == 0) {
this.$message.success('修改成功');
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
getReportDownloadCount(){
api.getReportDownloadCount().then(response => {
if(response.code == 0) {
this.numberData = response.result;
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
},
mounted() {
this.getReportDownloadCount();
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div class="foutdiv" style="max-width: 1440px;margin: 0 auto;">
<div style="bottom:100px;" class="hendtop" @click="handleScrollTop" v-if="positions">
<i style="font-size: 24px;color: #9197B4;" class="iconfont icon-dingbu"></i>
</div>
<div style="height: 200px;position: relative;" >
<img :src="$i18n.locale=='zh-CN'?require('../../assets/img/industryzh.png'):require('../../assets/img/industryen.png')" style="width: 100%;height: 200px;">
</div>
<div class="divclasschild">
<div>
<div style="width: 100%;margin-right: 30px;">
<div :style="positions?'position: fixed;top: 0;background: #ffffff;z-index: 99;width: calc(100% - 590px);':'position: relative;width: 100%;'">
<el-tabs class="content_tab" v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="(item,index) in groupalllistmax" :key="index" :label="$i18n.locale=='zh-CN'?item.dataName:item.dataNameEn" :name="item.dataId+''"></el-tab-pane>
</el-tabs>
<p :style="$i18n.locale=='zh-CN'?'top: 10px;':'top: 25px;'" style="position: absolute;right: 10px;color: #69697A;font-size: 16px;cursor: pointer;" @click="allclk">
<i style="color: #69697A;font-size: 16px;" class="iconfont icon-gengduo-2"></i>
{{$t('operationjson.counts')}}
</p>
</div>
<ul class="infinite-list contentlist_ul" v-infinite-scroll="load" infinite-scroll-disabled="disabled">
<li v-for="(item,index) in contentList" :key="index" class="infinite-list-item contentlist_li">
<div class="gendisplay">
<div @click="gocontentdetail(item)">
<img style="width: 45px;" src="../../assets/img/industryreport/pdf@2x.png" alt="">
</div>
<div>
<p @click="gocontentdetail(item)">
{{item.reportTitle}}
</p>
<div class="gendisplay">
<p>
<span>{{item.baseDataVO.dataName}}</span>
<span>{{$t('commonTips.downloads')}}{{item.downloadNumber}}</span>
</p>
<p>
<span @click="gocontentdetail(item)" style="margin-right: 20px">
<i style="margin-right: 10px;font-size: 16px;" class="iconfont icon-download-fill"></i>
{{$t('newprojecttext.download')}}
</span>
<span>
<el-popover
placement="top-start"
width="180"
trigger="hover">
<div class="centerQrCode" style="text-align: center">
<span style="font-size: 12px;">{{$t('industryjson.share1')}}</span>
<VueQRCodeComponent style="margin:10px 0 10px 17px;" :text="urltext" :size="120" :margin="0"></VueQRCodeComponent>
<span style="font-size: 12px;">{{$t('industryjson.share2')}}</span>
<span style="font-size: 12px;">{{$t('industryjson.share3')}}</span>
</div>
<i slot="reference">
<i style="margin-right: 10px;font-size: 14px;" class="iconfont icon-fenxiang"></i>
{{$t('shareInfo.shareTitle')}}
</i>
</el-popover>
</span>
</p>
</div>
</div>
</div>
</li>
</ul>
<p style="color: #9197B4;margin-top: 40px;" v-if="loading">{{$t('industryjson.loading')}}</p>
<p style="color: #9197B4;margin-top: 40px;" v-if="!loading">{{$t('industryjson.nomore')}}</p>
</div>
<div v-if="$i18n.locale=='zh-CN'" style="width: 320px;">
<hotArticlepage :isstate="false" :isindustry="true" ref="hotstate"></hotArticlepage>
</div>
</div>
</div>
<!--新增-->
<el-dialog :title="$t('industryjson.allchannels')" :visible.sync="expertVisible" :append-to-body="true" :close-on-click-modal="false" class="dialogWrap500 dialogWrap640">
<div style="margin: 0 auto;width: 80%;">
<el-button @click="channelel(item,index)" v-for="(item,index) in groupalllist" :key="index" style="margin: 10px 0 0 10px" size="mini">{{$i18n.locale=='zh-CN'?item.dataName:item.dataNameEn}}</el-button>
</div>
</el-dialog>
<expertVisible ref="login" :registerType="101" :reportId="reportId"></expertVisible>
</div>
</template>
<script>
import api from "./api/api";
import hotArticlepage from "../conmanagementpage/hotarticlepage";
import VueQRCodeComponent from "vue-qrcode-component";
import expertVisible from "../../components/login/quicklogin";
export default {
name : "industrypage",
data() {
return {
activeName:'',
count:100,
groupalllist:[],
groupalllistmax:[],
cur_page: 1, //页数
totalListResult: 0,
numberData: 10, //设置个数
searchs:{
pageIndex:1,
pageSize:10,
},
contentList:[],
loading:true,
pages:0,
expertVisible:false,
urltext:'',
positions:false,
urltext:'',
reportId:undefined,
}
},
components:{
hotArticlepage,VueQRCodeComponent,expertVisible
},
computed: {
noMore () {
return this.searchs.pageIndex == this.pages
},
disabled () {
return this.noMore
}
},
methods:{
//点击分类
classifyclk(row){
this.searchs = {};
this.searchs.classifyId = row[0].classifyId;
this.searchs.pageIndex = 1;
this.getselectContentList();
//右侧推荐
let params = {
classifyId:row[0].classifyId
};
this.$refs.hotstate.getselectHotContent(params);
},
//点击返回顶部
handleScrollTop(){
window.scrollTo(0, 0);
},
//点击全部
allclk(){
this.expertVisible = true;
},
//弹框显示
channelel(row,index){
this.searchs.dataId = row.dataId;
this.activeName = row.dataId+'';
this.expertVisible = false;
this.searchs.pageIndex = 1;
this.searchs.pageSize = 10;
this.contentList = [];
if(this.positions){
window.scrollTo(0, 220);
}
this.getselectContentList();
if(index>=8){
this.groupalllistmax.splice(this.groupalllistmax.length-1,1);
this.groupalllistmax.push(row);
}
},
handleClick(row){
this.searchs = {};
this.searchs.dataId = row.name;
this.searchs.pageIndex = 1;
this.searchs.pageSize = 10;
this.getselectContentList();
this.contentList = [];
if(this.positions){
window.scrollTo(0, 220);
}
},
load () {
if(this.searchs.pageIndex <= this.pages){
this.searchs.pageIndex++;
this.getselectContentList();
}
},
//频道
selectContentgroupalllist(){
api.dataGroupAllList().then(response => {
if(response.code == 0) {
if(response.result){
response.result.unshift({
dataId: 0,
dataName: this.$t('operationjson.counts'),
})
}
this.groupalllist = response.result;
for(let i in this.groupalllist){
if(this.groupalllistmax.length < 7){
this.groupalllistmax.push(this.groupalllist[i]);
}
}
this.activeName = this.groupalllist[0].dataId+'';
this.searchs.dataId = this.groupalllist[0].dataId;
this.getselectContentList();
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
//文章列表
getselectContentList(){
let dataId = this.searchs.dataId==0?'':'&dataIds='+this.searchs.dataId;
let pagedata = '?pageIndex='+this.searchs.pageIndex+'&pageSize='+this.searchs.pageSize;
let params = pagedata+dataId;
let searchsurl = '/business/report/showList';
this.loading = true;
api.showList(searchsurl,params).then(response => {
if(response.code == 0) {
if(this.searchs.pageSize == 1){
this.contentList = response.result.records;
}else{
for(let i in response.result.records){
this.contentList.push(response.result.records[i]);
}
}
this.pages = response.result.pages;
this.totalListResult = response.result.total;
this.loading = false;
if(this.contentList.length>4){
window.addEventListener('scroll', this.menu);
}else{
window.removeEventListener('scroll', this.menu);
}
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
menu(){
let scroll = document.documentElement.scrollTop || document.body.scrollTop;
if(scroll>280){
this.positions = true;
globalMsg.$emit('topShow',false);
globalMsg.$emit('topShowpage',true);
}else{
this.positions = false;
globalMsg.$emit('topShow',true);
globalMsg.$emit('topShowpage',false);
}
},
//报告下载
gocontentdetail(row){
this.reportId = row.reportId;
if(!this.publicFun.getCookie("userInfo")){
this.$refs.login.isexpertVisible();
return
}
api.getDownloadUrl(row.reportId).then(response => {
if(response.code == 0) {
const elink = document.createElement('a');
elink.href = response.result;
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
},
},
beforeDestroy() { // 在组件生命周期结束的时候销毁。
window.removeEventListener('scroll', this.menu);
globalMsg.$emit('topShow',true);
},
mounted() {
this.selectContentgroupalllist();
if(this.$route.query.classifyId){
let params = [{classifyId:this.$route.query.classifyId,classifyName:this.$route.query.classifyName}];
this.classifyclk(params);
}
if(this.$i18n.locale=='zh-CN'){
//右侧热门
let params = {};
this.$refs.hotstate.getMarvellousArticle();
}
api.selectBasicParams().then(response => {
if(response.code == 0) {
this.urltext = response.result.websitePrefix+'#/industryReport';
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}
}
</script>
<style scoped lang="scss">
.foutdiv{
padding:60px 0;
min-height: 600px;
background: #ffffff;
}
.foutdivchild{
min-height: 600px;
background: #ffffff;
}
.divclasschild{
margin: 25px 120px 0;
>div{
display: -webkit-flex;/*新版本语法:chrome 21+*/
display: -webkit-box;/*老版本语法:Safari,iOS,Android browser,old Webkit browser*/
display: -moz-box;/*老版本语法:Firefox(buggy)*/
display: -ms-flexbox;/*混合版本语法:IE 10*/
display: flex;/*新版本语法:opera 12.1,Firefox 22+*/
}
}
.contentlist_ul{
/*>li:nth-child(1){*/
/* >div{*/
/* padding: 10px 0 25px 0;*/
/* }*/
/*}*/
}
.state_code{
display: -webkit-flex;/*新版本语法:chrome 21+*/
display: -webkit-box;/*老版本语法:Safari,iOS,Android browser,old Webkit browser*/
display: -moz-box;/*老版本语法:Firefox(buggy)*/
display: -ms-flexbox;/*混合版本语法:IE 10*/
display: flex;/*新版本语法:opera 12.1,Firefox 22+*/
>p{
position: absolute;
bottom: 0px;
color: #AAAAAA;
>span{
margin-right: 15px;
}
}
>p:nth-child(1){
left: 0px;
}
>p:nth-child(2){
right: 30px;
}
}
.isstate_code{
display: -webkit-flex;/*新版本语法:chrome 21+*/
display: -webkit-box;/*老版本语法:Safari,iOS,Android browser,old Webkit browser*/
display: -moz-box;/*老版本语法:Firefox(buggy)*/
display: -ms-flexbox;/*混合版本语法:IE 10*/
display: flex;/*新版本语法:opera 12.1,Firefox 22+*/
>p{
color: #AAAAAA;
>span{
margin-right: 15px;
}
}
>p:nth-child(1){
width: 100%;
}
>p:nth-child(2){
width: 50px;
}
}
.contentlist_li{
/*cursor: pointer;*/
border-bottom: 1px solid #E9EAF3;
>div{
width: 100%;
display: -webkit-flex;/*新版本语法:chrome 21+*/
display: -webkit-box;/*老版本语法:Safari,iOS,Android browser,old Webkit browser*/
display: -moz-box;/*老版本语法:Firefox(buggy)*/
display: -ms-flexbox;/*混合版本语法:IE 10*/
display: flex;/*新版本语法:opera 12.1,Firefox 22+*/
padding: 25px 0;
text-align: left;
>div:nth-child(1){
}
>div:nth-child(2){
width: 100%;
margin-left: 35px;
/*width: 500px;*/
>p{
text-align: left;
color: #1A1A1E;
font-size: 18px;
font-weight: bold;
margin-bottom: 15px;
cursor: pointer;
}
>p:hover{
color: #5d78ff !important;
}
>div{
color: #AAAAAA;
font-size: 14px;
>p:nth-child(1){
width: 100%;
>span:nth-child(1){
background: #F8F8F8;
padding: 3px 10px;
margin-right: 20px;
}
}
>p:nth-child(2){
width: 400px;
text-align: right;
padding-right: 10px;
cursor: pointer;
>span:nth-child(1):hover{
color: #5d78ff !important;
}
>span:nth-child(2):hover{
color: #5d78ff !important;
}
}
}
}
}
}
.hendtop{
position: fixed;
right: 40px;
z-index: 99;
border: 1px solid #E8EAF3;
background:#FFFFFF;
box-shadow:0px 2px 8px 0px rgba(0,0,0,0.1);
border-radius: 50%;
width: 50px;
height: 50px;
line-height: 50px;
cursor: pointer;
}
.imgInfo{
border-radius: 3px;
border:1px solid #DCDFF1;
width: 200px !important;
height: 114px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.namep:hover{
color: #5d78ff !important;
cursor:pointer;
}
</style>
\ No newline at end of file
<template>
<div class="soutform loginedWrapper">
<div class="breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/projectdynamics' }">{{$t("releasejson.wrkbench")}}</el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/conmanagement' }">内容管理</el-breadcrumb-item>
<el-breadcrumb-item>{{$route.query.reportId?'编辑报告':'创建报告'}}</el-breadcrumb-item>
</el-breadcrumb>
</div>
<div class="projectTabadd">
<el-tabs v-model="activeName">
<el-tab-pane :label="$route.query.reportId?'编辑报告':'创建报告'" name="first">
<div style="margin-top: 20px;">
<el-form label-position="right" :model="formData" :rules="rules" ref="formData" label-width="180px" class="contnetform180" >
<el-form-item label="版本:" prop="languageType" style="width: 100%;">
<el-radio v-model="formData.languageType" label="zh">中文</el-radio>
<el-radio v-model="formData.languageType" label="en">英文</el-radio>
</el-form-item>
<el-form-item label="标题:" prop="reportTitle">
<el-input v-model="formData.reportTitle" maxlength="100" placeholder="请输入标题" style="width: 600px;"></el-input>
</el-form-item>
<el-form-item label="行业通俗分类:" prop="baseDataId">
<el-select v-model="formData.baseDataId" placeholder="请选择" style="width: 600px;">
<el-option
style="width: 600px;"
v-for="item in groupalllist"
:key="item.dataId"
:label="item.dataName"
:value="item.dataId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="请选择:">
<el-checkbox v-model="isHomePage">首页</el-checkbox>
<el-checkbox v-model="isTop">置顶</el-checkbox>
</el-form-item>
<el-form-item label="文章内容:" ref="formintroduction" style="width: 100%;">
<rich-text @dataEvent="statedata" :channelIntroduction="formData.contentDetail"></rich-text>
<div v-show="false" v-html="formData.contentDetail" id="content1"></div>
</el-form-item>
<el-form-item label="附件:" prop="reportUrl" style="width: 100%;">
<p>附件只支持pdf,最大50M;</p>
<div class="uploadImg" style="position: relative">
<el-upload
style="width: 50%"
class="upload-demo"
:action=uploadVideo
:multiple="false"
name="fileUpload"
:limit="1"
:headers="publicFun.getHeadersFunc()"
:file-list="fileList"
:on-progress="isprogress"
:on-success="uploadComplete"
:before-upload="handleBeforeFile"
:on-remove="handleRemove">
<el-button size="small" type="primary">上传附件</el-button>
</el-upload>
<el-button style="position: absolute;left: 0px;top: 5px;" v-if="isuploadshow" size="small" type="primary" @click="isupload">上传附件</el-button>
<span class="errorTextproject" style="top: 175px;" v-if="isShowErrorText">{{$t("workPlace.sendRequireForm.uploadingAccessory")}}</span>
</div>
</el-form-item>
</el-form>
</div>
<el-row style="margin: 40px 0 20px 0; text-align: center;width: 100%;">
<el-button type="primary" @click="submitform()">提交</el-button>
<el-button @click="$router.push('/industrymanagement')" plain>取消</el-button>
</el-row>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import api from "./api/api";
import richText from "../publishactivity/richtext";
export default {
name: "pushindustry",
data() {
return {
activeName:'first',
formData:{
baseDataId:'',
languageType:'zh',
},
isHomePage:false,
isTop:false,
//校验
rules: {
reportTitle: [{required: true,message:'请输入标题',trigger: 'blur'}],
baseDataId: [{required: true,message:'请选择分类',trigger: 'change'}],
reportUrl: [{required: true,message:'请上传附件',trigger: 'change'}],
},
groupalllist:[],
uploadVideo: '/base/upload/uploadPdf',//pdf文件上传地址
isflag:0,
isShowErrorText:false,
fileList:[],
isuploadshow:false,
}
},
components:{
richText
},
methods:{
//发布
submitform(){
this.$refs.formData.validate((valid) => {
if(valid) {
console.log(this.formData)
if(this.isHomePage){
this.formData.isHomePage = 1;
}
if(this.isTop){
this.formData.isTop = 1;
}
let urls = this.$route.query.reportId?'/business/report/edit':'/business/report/add';
api.addindustry(urls,this.formData).then(response => {
if(response.code == 0) {
this.$message.success(this.$route.query.reportId?'编辑成功':'发布成功');
this.$router.push({path:"/industrymanagement",query:{}});
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}
});
},
//富文本内容
statedata(val){
this.formData.contentDetail = val;
this.$refs.formintroduction.clearValidate();
},
//音视频上传前
isprogress(){
this.isuploadshow = true;
},
//附件上传之前判断文件格式
handleBeforeFile(file) {
var nameArr = file.name.split('.');
const ispdf = nameArr[nameArr.length - 1] === 'pdf';
const isPDF = nameArr[nameArr.length - 1] === 'PDF';
const isLt20M = file.size / 1024 / 1024 <= 20;
if ( !ispdf && !isPDF) {
this.$message.error('上传文件格式错误');
}else if(!isLt20M){
this.$message.error('上传文件大小不能超过 50MB');
}
this.isflag = 1;
return ( ispdf || isPDF) && isLt20M;
},
isupload(){
this.$message.error(this.$t('newprojecttext.deletevideo'));
},
//上传文件成功回调
uploadComplete(res,file){
if(res.code == 0){
this.formData.reportUrl = res.result.fileUpload;
this.isflag = 0;
this.isShowErrorText = false;
this.isuploadshow = true;
}else{
this.isuploadshow = false;
this.$message.error(this.$t('newprojecttext.uploadfailed'));
}
},
//删除上传文件
handleRemove(){
this.fileList = [];
this.formData.reportUrl = '';
this.isflag = 0;
this.isuploadshow = false;
},
},
mounted() {
api.dataGroupAllList().then(response => {
if(response.code == 0) {
this.groupalllist = response.result;
} else {
this.$message.error(response.msgCode);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
if(this.$route.query.reportId){
api.getindustry(this.$route.query.reportId).then(response => {
if(response.code == 0) {
this.formData = response.result;
if(this.formData.isHomePage == 1)this.isHomePage = true;
if(this.formData.isTop == 1)this.isTop = true;
if(this.formData.reportUrl){
this.fileList.push({url:this.formData.reportUrl,name:'pdf文件'})
this.isuploadshow = true;
}
} else {
this.$message.error(response.msg);
}
})
.catch(error => {
console.log("提交出错");
return false;
});
}
}
}
</script>
<style scoped>
</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