Commit bb1b3df5 by haozhenhua

hzh

parent d7064cb0
...@@ -546,7 +546,7 @@ ...@@ -546,7 +546,7 @@
<div class="header-main-tool" @click="onselect('declare')"><span>政策资讯</span><i <div class="header-main-tool" @click="onselect('declare')"><span>政策资讯</span><i
class="el-icon-caret-bottom"></i></div> class="el-icon-caret-bottom"></i></div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="222222">222222</el-dropdown-item> <el-dropdown-item v-for="item in titles" :command="item.title">{{item.name}}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
......
function getQueryStringMap(){ function getQueryStringMap() {
//取得查询字符串并去掉开头的问号 //取得查询字符串并去掉开头的问号
var str = (location.search.length>0?location.search.substring(1):""); var str = (location.search.length > 0 ? location.search.substring(1) : "");
var args = {};//保存数据的对象 var args = {};//保存数据的对象
items = str.length?str.split('&'):[];//取得每一项 items = str.length ? str.split('&') : [];//取得每一项
var item = null; var item = null;
var name = null; var name = null;
var value = null; var value = null;
for(var i=0; i<items.length;i++){ for (var i = 0; i < items.length; i++) {
item = items[i].split('='); item = items[i].split('=');
name = decodeURIComponent(item[0]); name = decodeURIComponent(item[0]);
value = decodeURIComponent(item[1]); value = decodeURIComponent(item[1]);
if(name.length){ if (name.length) {
args[name] = value; args[name] = value;
} }
} }
return args; return args;
} }
var queryMap=getQueryStringMap();//解析当前的查询字符串 var queryMap = getQueryStringMap();//解析当前的查询字符串
function addCSS(csspath) { function addCSS(csspath) {
var link = document.createElement('link'); var link = document.createElement('link');
link.type = 'text/css'; link.type = 'text/css';
link.rel = 'stylesheet'; link.rel = 'stylesheet';
link.href = csspath; link.href = csspath;
document.getElementsByTagName("head")[0].appendChild(link); document.getElementsByTagName("head")[0].appendChild(link);
} }
var currentTheme=(queryMap["paramtheme"] && queryMap["paramtheme"] !="default")?queryMap["paramtheme"]:""; var currentTheme = (queryMap["paramtheme"] && queryMap["paramtheme"] != "default") ? queryMap["paramtheme"] : "";
//axios.get("/vue/comp/base").then(function (res) { //axios.get("/vue/comp/base").then(function (res) {
$.base64.utf8encode = true; $.base64.utf8encode = true;
basecomp.forEach(function (comp) { basecomp.forEach(function (comp) {
try{ try {
var obj = eval("(" + comp + ")"); var obj = eval("(" + comp + ")");
Vue.component(obj.vname, obj); Vue.component(obj.vname, obj);
}catch(e){ } catch (e) {
console.log(e); console.log(e);
} }
}); });
console.log("load base component finished..."); console.log("load base component finished...");
function buildPromise(compath) { function buildPromise(compath) {
return Promise.resolve(new Promise(function (resolve, reject) { return Promise.resolve(new Promise(function (resolve, reject) {
//异步加载组件 //异步加载组件
axios.get(compath,{"headers":{"theme":currentTheme}}).then(function (res) { axios.get(compath, { "headers": { "theme": currentTheme } }).then(function (res) {
console.log(compath); console.log(compath);
var obj = eval("(" + unescape(res.data) + ")"); var obj = eval("(" + unescape(res.data) + ")");
resolve(obj); resolve(obj);
...@@ -47,16 +47,16 @@ function addCSS(csspath) { ...@@ -47,16 +47,16 @@ function addCSS(csspath) {
console.log(reason) console.log(reason)
}) })
})); }));
} }
function componentFactory(comname) { function componentFactory(comname) {
var compath = "/vue/comp/" + comname; var compath = "/vue/comp/" + comname;
var tmpFunc = function () { var tmpFunc = function () {
return buildPromise(compath); return buildPromise(compath);
} }
return tmpFunc; return tmpFunc;
} }
window.componentFactory = componentFactory; window.componentFactory = componentFactory;
Vue.mixin({ Vue.mixin({
props: ["modelName"], props: ["modelName"],
computed: Vuex.mapState({ computed: Vuex.mapState({
currentUser: state => { currentUser: state => {
...@@ -80,7 +80,7 @@ function addCSS(csspath) { ...@@ -80,7 +80,7 @@ function addCSS(csspath) {
socketClient: state => { socketClient: state => {
return state.socketClient; return state.socketClient;
}, },
istabclick:state => { istabclick: state => {
return state.istabclick; return state.istabclick;
}, },
}), }),
...@@ -89,18 +89,18 @@ function addCSS(csspath) { ...@@ -89,18 +89,18 @@ function addCSS(csspath) {
return "web/" + this.ctlName + "/" + md; return "web/" + this.ctlName + "/" + md;
}, },
} }
}); });
var routes = []; var routes = [];
var codepaths = {}; var codepaths = {};
var mapTile = {}; var mapTile = {};
var mapRouterEntry = {}; var mapRouterEntry = {};
var isp=0; var isp = 0;
//菜单的全局缓存 //菜单的全局缓存
//var global_rsconfig=null; //var global_rsconfig=null;
//axios.get("/web/metaCtl/getRouteConfigWithoutProduct").then(d => { //axios.get("/web/metaCtl/getRouteConfigWithoutProduct").then(d => {
isp=routePath.isp; isp = routePath.isp;
Object.keys(routePath.bizs).map((k) => { Object.keys(routePath.bizs).map((k) => {
//path是路由,静态的路由 //path是路由,静态的路由
var pathTmp = routePath.bizs[k].path; var pathTmp = routePath.bizs[k].path;
var codepath = routePath.bizs[k].codepath; var codepath = routePath.bizs[k].codepath;
...@@ -111,11 +111,11 @@ function addCSS(csspath) { ...@@ -111,11 +111,11 @@ function addCSS(csspath) {
tmp.components[pathTmp] = componentFactory(routePath.bizs[k].comname); tmp.components[pathTmp] = componentFactory(routePath.bizs[k].comname);
mapTile[pathTmp] = routePath.bizs[k].title; mapTile[pathTmp] = routePath.bizs[k].title;
if(isp==0){ if (isp == 0) {
if(pathTmp=="/"){ if (pathTmp == "/") {
tmp.components[pathTmp] = componentFactory("moreservice"); tmp.components[pathTmp] = componentFactory("moreservice");
tmp["query"]={"itemtype":"ip"}; tmp["query"] = { "itemtype": "ip" };
console.log("ppppppppppppppppppppppppppppppppp",tmp); console.log("ppppppppppppppppppppppppppppppppp", tmp);
} }
} }
routes.push(tmp); routes.push(tmp);
...@@ -123,38 +123,38 @@ function addCSS(csspath) { ...@@ -123,38 +123,38 @@ function addCSS(csspath) {
} }
codepaths[pathTmp] = codepath;//暂存每个叶子节点对应的codepath codepaths[pathTmp] = codepath;//暂存每个叶子节点对应的codepath
}); });
//元数据分析时会为每个叶子节点动态生成codepath,按照code生成从根开始的路径 //元数据分析时会为每个叶子节点动态生成codepath,按照code生成从根开始的路径
console.log(JSON.stringify(codepaths)); console.log(JSON.stringify(codepaths));
var router = new VueRouter({ var router = new VueRouter({
routes: routes, routes: routes,
}); });
router.mapTile = mapTile; router.mapTile = mapTile;
router.mapRouterEntry = mapRouterEntry; router.mapRouterEntry = mapRouterEntry;
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
popupsCode:null, popupsCode: null,
count: 1, count: 1,
products: null, products: null,
currentCodePath: "", currentCodePath: "",
istabclick: false, istabclick: false,
currentUser: null, currentUser: null,
currentCompany:null, currentCompany: null,
curSelRow: {}, curSelRow: {},
header_height: "200", header_height: "200",
socketClient: null, socketClient: null,
logoUrl: "", logoUrl: "",
appimgUrl: "", appimgUrl: "",
currentChatTo: "", currentChatTo: "",
pfooterinfo:null, pfooterinfo: null,
}, },
mutations: { mutations: {
increment(state) { increment(state) {
state.count++ state.count++
}, },
} }
}); });
function headtransparent(){ function headtransparent() {
// $("#header").addClass("headtransparent"); // $("#header").addClass("headtransparent");
$("#leftmenudiv").addClass("menutransparent"); $("#leftmenudiv").addClass("menutransparent");
$(".spechorizotal .nav_color").css("color", "white"); $(".spechorizotal .nav_color").css("color", "white");
...@@ -167,8 +167,8 @@ function addCSS(csspath) { ...@@ -167,8 +167,8 @@ function addCSS(csspath) {
$("#loginbtn").css("color", "white"); $("#loginbtn").css("color", "white");
$("#appname").css("color", "white"); $("#appname").css("color", "white");
// $("#footer").show(); // $("#footer").show();
} }
function headnotransparent(){ function headnotransparent() {
$(".spechorizotal .nav_color").css("color", "black"); $(".spechorizotal .nav_color").css("color", "black");
$(".spechorizotal .nav_color:hover").css("color", "#2692FF"); $(".spechorizotal .nav_color:hover").css("color", "#2692FF");
// $("#header").removeClass("headtransparent"); // $("#header").removeClass("headtransparent");
...@@ -176,9 +176,9 @@ function addCSS(csspath) { ...@@ -176,9 +176,9 @@ function addCSS(csspath) {
$("#loginbtn").css("color", "#2692FF"); $("#loginbtn").css("color", "#2692FF");
$("#appname").css("color", "#2692FF"); $("#appname").css("color", "#2692FF");
$("#footer").hide(); $("#footer").hide();
$('.app-stage').css('min-height','0px'); $('.app-stage').css('min-height', '0px');
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log("enter before..........................."); console.log("enter before...........................");
console.log(to); console.log(to);
//设置当前访问的叶子节点的codepath //设置当前访问的叶子节点的codepath
...@@ -191,9 +191,9 @@ function addCSS(csspath) { ...@@ -191,9 +191,9 @@ function addCSS(csspath) {
this.isfront = false this.isfront = false
} }
if (keyCodePath == '/login') { if (keyCodePath == '/login') {
$('.app-stage').css('min-height','0px'); $('.app-stage').css('min-height', '0px');
}else { } else {
$('.app-stage').css('min-height','100%'); $('.app-stage').css('min-height', '100%');
} }
if (keyCodePath != '/' && keyCodePath != '/bycquerytm' && keyCodePath != '/bytmmonit' && keyCodePath != '/tmtransactionmarket' if (keyCodePath != '/' && keyCodePath != '/bycquerytm' && keyCodePath != '/bytmmonit' && keyCodePath != '/tmtransactionmarket'
&& keyCodePath != '/selftmreg' && keyCodePath != '/bytmmonitlist' && keyCodePath != '/bytmmonitlistdetails' && keyCodePath != '/bytmmonitagency' && keyCodePath != '/selftmreg' && keyCodePath != '/bytmmonitlist' && keyCodePath != '/bytmmonitlistdetails' && keyCodePath != '/bytmmonitagency'
...@@ -202,7 +202,7 @@ function addCSS(csspath) { ...@@ -202,7 +202,7 @@ function addCSS(csspath) {
&& keyCodePath != '/icproductdetail' && keyCodePath != '/icnameresult' && keyCodePath != '/iframehtml') { && keyCodePath != '/icproductdetail' && keyCodePath != '/icnameresult' && keyCodePath != '/iframehtml') {
$('#header_row').addClass('houtai'); $('#header_row').addClass('houtai');
$('#header_row').removeClass('qiantai'); $('#header_row').removeClass('qiantai');
}else { } else {
$('#header_row').removeClass('houtai'); $('#header_row').removeClass('houtai');
$('#header_row').addClass('qiantai'); $('#header_row').addClass('qiantai');
} }
...@@ -220,7 +220,7 @@ function addCSS(csspath) { ...@@ -220,7 +220,7 @@ function addCSS(csspath) {
$("#welcome").css("color", "#2692ff"); $("#welcome").css("color", "#2692ff");
$("#exitbtn").css("color", "#2692ff"); $("#exitbtn").css("color", "#2692ff");
$("#adminbtn").css("color", "#2692ff"); $("#adminbtn").css("color", "#2692ff");
}else { } else {
$("#welcome").css("color", "#fff"); $("#welcome").css("color", "#fff");
$("#exitbtn").css("color", "#fff"); $("#exitbtn").css("color", "#fff");
$("#adminbtn").css("color", "#fff"); $("#adminbtn").css("color", "#fff");
...@@ -242,45 +242,45 @@ function addCSS(csspath) { ...@@ -242,45 +242,45 @@ function addCSS(csspath) {
store.state.currentCodePath = codepaths[keyCodePath]; store.state.currentCodePath = codepaths[keyCodePath];
} }
next(); next();
}); });
Vue.use(window['vue-cropper']) Vue.use(window['vue-cropper'])
var app = new Vue({ var app = new Vue({
el: "#app", el: "#app",
router: router, router: router,
store: store, store: store,
data: function () { data: function () {
return { return {
areaName: '北京', areaName: '北京',
areaArr:[ areaArr: [
{ {
name:'A-G', name: 'A-G',
lists:['北京>','安徽>','重庆>','福建>','广东>','广西>','甘肃>','贵州>'] lists: ['北京>', '安徽>', '重庆>', '福建>', '广东>', '广西>', '甘肃>', '贵州>']
}, },
{ {
name:'H-J', name: 'H-J',
lists:['河北>','河南>','海南>','湖北>','湖南>','黑龙江>','吉林>','江苏>','江西>'] lists: ['河北>', '河南>', '海南>', '湖北>', '湖南>', '黑龙江>', '吉林>', '江苏>', '江西>']
}, },
{ {
name:'L-S', name: 'L-S',
lists:['辽宁>','内蒙古>','宁夏>','青海>','上海>','四川>','山东>','山西>','陕西>'] lists: ['辽宁>', '内蒙古>', '宁夏>', '青海>', '上海>', '四川>', '山东>', '山西>', '陕西>']
}, },
{ {
name:'T-Z', name: 'T-Z',
lists:['天津>','新疆>','西藏>','云南>','浙江>'] lists: ['天津>', '新疆>', '西藏>', '云南>', '浙江>']
} }
], ],
loadingHome: false, loadingHome: false,
headerRowType:false, headerRowType: false,
popupsHeight:null, popupsHeight: null,
popupslineHeight:null, popupslineHeight: null,
popupsType:false, popupsType: false,
popupsDataList:[], popupsDataList: [],
pDataKey: 0, pDataKey: 0,
pTowDataKey: null, pTowDataKey: null,
popupsData:[], popupsData: [],
// //
switchcompany:null, switchcompany: null,
companys:[], companys: [],
catas: [ catas: [
], ],
...@@ -302,39 +302,43 @@ function addCSS(csspath) { ...@@ -302,39 +302,43 @@ function addCSS(csspath) {
editableTabsValue2: '/', editableTabsValue2: '/',
isShowMenu: "true", isShowMenu: "true",
currentCompany: null, currentCompany: null,
bankAccount:null, bankAccount: null,
footerInfo: null, footerInfo: null,
qrcodeurl:"", qrcodeurl: "",
pfooterinfo:null, pfooterinfo: null,
serviceqq: null, serviceqq: null,
servicetel: null, servicetel: null,
wxJpg:'/imgs/wxJpg.jpg', wxJpg: '/imgs/wxJpg.jpg',
homeobj:null, homeobj: null,
isfront:true, isfront: true,
stageType: true, stageType: true,
isleyu:true, isleyu: true,
isphone:false, isphone: false,
istop:false, istop: false,
iswx:false, iswx: false,
themename:"", themename: "",
showWxrm:false, showWxrm: false,
showPhoneNum:false, showPhoneNum: false,
rsData:[] rsData: [],
titles: [{
title: 'declare',
name: '申报通知'
}]
}; };
}, },
created() { created() {
var url = window.location.href; var url = window.location.href;
var arr1 = url.replace("?paramtheme=spring","").split("/#"); var arr1 = url.replace("?paramtheme=spring", "").split("/#");
var titleValue = ""; var titleValue = "";
if(url.indexOf("isModifyTitle=1")>=0){ if (url.indexOf("isModifyTitle=1") >= 0) {
titleValue = localStorage.getItem("titleValue"); titleValue = localStorage.getItem("titleValue");
// localStorage.setItem("lastaccess",""); // localStorage.setItem("lastaccess","");
}else{ } else {
titleValue=""; titleValue = "";
// localStorage.setItem("titleValue",""); // localStorage.setItem("titleValue","");
} }
if(url.indexOf("isDirectJump=1")>=0 && arr1.length==2){ if (url.indexOf("isDirectJump=1") >= 0 && arr1.length == 2) {
this.refreshLoginState(()=>{ this.refreshLoginState(() => {
this.directJump(); this.directJump();
//需要返回公司信息和主题信息后更新顶部菜单 //需要返回公司信息和主题信息后更新顶部菜单
this.showtopmenu(); this.showtopmenu();
...@@ -342,8 +346,8 @@ function addCSS(csspath) { ...@@ -342,8 +346,8 @@ function addCSS(csspath) {
// $("#idtitle").text(titleValue); // $("#idtitle").text(titleValue);
// } // }
}); });
}else{ } else {
this.refreshLoginState(()=>{ this.refreshLoginState(() => {
this.initIndexPage(); this.initIndexPage();
//需要返回公司信息和主题信息后更新顶部菜单 //需要返回公司信息和主题信息后更新顶部菜单
this.showtopmenu(); this.showtopmenu();
...@@ -357,33 +361,33 @@ function addCSS(csspath) { ...@@ -357,33 +361,33 @@ function addCSS(csspath) {
updated() { updated() {
}, },
computed:{ computed: {
isdefault:function(){ isdefault: function () {
if(this.currentCompany && this.currentCompany.siteTheme!="default"){ if (this.currentCompany && this.currentCompany.siteTheme != "default") {
return true; return true;
}else{ } else {
return false; return false;
} }
}, },
}, },
mounted() { mounted() {
var sself=this; var sself = this;
if(queryMap["paramtheme"]){ if (queryMap["paramtheme"]) {
companyinfo.company.siteTheme=queryMap["paramtheme"]; companyinfo.company.siteTheme = queryMap["paramtheme"];
} }
this.currentCompany= companyinfo.company; this.currentCompany = companyinfo.company;
if(this.currentCompany.siteTheme && this.currentCompany.siteTheme!=""){ if (this.currentCompany.siteTheme && this.currentCompany.siteTheme != "") {
currentTheme=this.currentCompany.siteTheme; currentTheme = this.currentCompany.siteTheme;
this.themename=(currentTheme=="default"?"":currentTheme); this.themename = (currentTheme == "default" ? "" : currentTheme);
if(this.themename!=""){ if (this.themename != "") {
addCSS("/css/"+this.themename+".css"); addCSS("/css/" + this.themename + ".css");
} }
} }
this.$store.state.currentCompany = this.currentCompany; this.$store.state.currentCompany = this.currentCompany;
this.bankAccount=companyinfo.bankAccount; this.bankAccount = companyinfo.bankAccount;
this.footerInfo = companyinfo.footerinfo; this.footerInfo = companyinfo.footerinfo;
this.pfooterinfo= this.footerInfo; this.pfooterinfo = this.footerInfo;
this.$store.state.pfooterinfo = this.footerInfo; this.$store.state.pfooterinfo = this.footerInfo;
this.serviceqq = "http://wpa.qq.com/msgrd?v=3&uin=" + this.currentCompany.serviceqq + "&site=qq&menu=yes"; this.serviceqq = "http://wpa.qq.com/msgrd?v=3&uin=" + this.currentCompany.serviceqq + "&site=qq&menu=yes";
if (this.footerInfo) { if (this.footerInfo) {
...@@ -391,13 +395,13 @@ function addCSS(csspath) { ...@@ -391,13 +395,13 @@ function addCSS(csspath) {
} else { } else {
this.servicetel = "请完善客服电话"; this.servicetel = "请完善客服电话";
} }
var own=sself; var own = sself;
if(companyinfo){ if (companyinfo) {
own.findAllServicesitemA(); own.findAllServicesitemA();
own.showtopmenu(); own.showtopmenu();
own.popupsHeight = 'height:' + 390*document.body.clientWidth/1920 + "px"; own.popupsHeight = 'height:' + 390 * document.body.clientWidth / 1920 + "px";
own.popupslineHeight = 'line-height:' + (350*document.body.clientWidth/1920/5) + "px"; own.popupslineHeight = 'line-height:' + (350 * document.body.clientWidth / 1920 / 5) + "px";
// sself.getReq("/wxop/pushmsgWxop/getQr", {scene:"18396816928"}).then(function (r) { // sself.getReq("/wxop/pushmsgWxop/getQr", {scene:"18396816928"}).then(function (r) {
// console.log("11111111rrrrrrrrrrrrrrrrrrrrrrrrr"); // console.log("11111111rrrrrrrrrrrrrrrrrrrrrrrrr");
...@@ -437,10 +441,10 @@ function addCSS(csspath) { ...@@ -437,10 +441,10 @@ function addCSS(csspath) {
// }; // };
// f(); // f();
//获取被授权的公司列表 //获取被授权的公司列表
this.postReq("/web/companyCtl/refQuery",{fields:["id","name"],datapriv:true}).then(d=>{ this.postReq("/web/companyCtl/refQuery", { fields: ["id", "name"], datapriv: true }).then(d => {
if(d && d.data){ if (d && d.data) {
d.data.forEach(r=>{ d.data.forEach(r => {
sself.companys.push({label:r.name,value:r.id}); sself.companys.push({ label: r.name, value: r.id });
}); });
} }
}); });
...@@ -461,8 +465,8 @@ function addCSS(csspath) { ...@@ -461,8 +465,8 @@ function addCSS(csspath) {
// initMainHeight(); // initMainHeight();
// }); // });
// initMainHeight(); // initMainHeight();
$('#app').scroll(()=>{ $('#app').scroll(() => {
if(this.homeobj && this.homeobj.doScroll){ if (this.homeobj && this.homeobj.doScroll) {
this.homeobj.doScroll($('#app').scrollTop()); this.homeobj.doScroll($('#app').scrollTop());
} }
}); });
...@@ -474,48 +478,48 @@ function addCSS(csspath) { ...@@ -474,48 +478,48 @@ function addCSS(csspath) {
window.addEventListener('popstate', this.goBack, false); window.addEventListener('popstate', this.goBack, false);
} }
this.isShowMenu = false; this.isShowMenu = false;
setTimeout(()=>{ setTimeout(() => {
$("#app").css("visibility", "visible"); $("#app").css("visibility", "visible");
$("#imglogo").css("visibility", "visible"); $("#imglogo").css("visibility", "visible");
},100); }, 100);
setTimeout(()=>{ setTimeout(() => {
$("#footer").css("visibility", "visible"); $("#footer").css("visibility", "visible");
},3000); }, 3000);
localStorage.setItem("areaName", this.areaName); localStorage.setItem("areaName", this.areaName);
}, },
methods: { methods: {
areachoice(name) { areachoice(name) {
this.areaName = name.slice(0,name.indexOf('>')); this.areaName = name.slice(0, name.indexOf('>'));
console.log(name.slice(0,name.indexOf('>'))) console.log(name.slice(0, name.indexOf('>')))
}, },
fetchMetaData(cbk){ fetchMetaData(cbk) {
if(global_rsconfig){ if (global_rsconfig) {
cfg=global_rsconfig; cfg = global_rsconfig;
if(cfg){ if (cfg) {
this.rsData=[]; this.rsData = [];
cfg.children.forEach(r=>{ cfg.children.forEach(r => {
if(r.istop){ if (r.istop) {
this.rsData.push(r); this.rsData.push(r);
} }
}); });
if(cbk){ if (cbk) {
cbk(); cbk();
} }
} }
}else{ } else {
this.$root.getReq("/web/metaCtl/getRsConfig",null).then(cfg=>{ this.$root.getReq("/web/metaCtl/getRsConfig", null).then(cfg => {
global_rsconfig=cfg; global_rsconfig = cfg;
if(cfg){ if (cfg) {
this.rsData=[]; this.rsData = [];
cfg.children.forEach(r=>{ cfg.children.forEach(r => {
if(r.istop){ if (r.istop) {
this.rsData.push(r); this.rsData.push(r);
} }
}); });
if(cbk){ if (cbk) {
cbk(); cbk();
} }
...@@ -523,29 +527,38 @@ function addCSS(csspath) { ...@@ -523,29 +527,38 @@ function addCSS(csspath) {
}); });
} }
console.log(this.rsData,'======___________________+++++++++++++++++++++++') console.log(this.rsData, '======___________________+++++++++++++++++++++++')
}, },
backstageHandleCommand (name) { backstageHandleCommand(name) {
console.log(name); console.log(name);
if ( name == '退出') { if (name == '退出') {
this.onselect('exit') this.onselect('exit')
}else { } else {
this.goadmin() this.goadmin()
} }
}, },
handleCommand(item) { handleCommand(item) {
// this.$message('click on item ' + command); // this.$message('click on item ' + command);
console.log(item); console.log(item, "----------------");
// let obj = command.split('/') // let obj = command.split('/')
// this.onMenuSelect(obj[1]) // this.onMenuSelect(obj[1])
var index = item.code; var index = item.code;
var self = this;
if (item == "declare") {
this.stageType = false;
this.pushx({
title: "政策资讯",
name: "/declare"
});
return false;
}
if (index == 'areapatentmonitor') { if (index == 'areapatentmonitor') {
this.stageType = false; this.stageType = false;
this.pushx({ this.pushx({
title:"区域专利监控", title: "区域专利监控",
name:"/iframehtmlone", name: "/iframehtmlone",
params:{url: 'https://zhuanzhidao.gongsibao.com/#/regionalpatentmonitoring'} params: { url: 'https://zhuanzhidao.gongsibao.com/#/regionalpatentmonitoring' }
}) })
// this.loadingHome = true; // this.loadingHome = true;
// setTimeout(()=>{ // setTimeout(()=>{
...@@ -556,9 +569,9 @@ function addCSS(csspath) { ...@@ -556,9 +569,9 @@ function addCSS(csspath) {
if (index == 'entdecide') { if (index == 'entdecide') {
this.stageType = false; this.stageType = false;
this.pushx({ this.pushx({
title:"企业决策", title: "企业决策",
name:"/iframehtmltwo", name: "/iframehtmltwo",
params:{url: 'https://zhuanzhidao.gongsibao.com/#/businessdecisions'} params: { url: 'https://zhuanzhidao.gongsibao.com/#/businessdecisions' }
}) })
return false; return false;
} }
...@@ -567,10 +580,10 @@ function addCSS(csspath) { ...@@ -567,10 +580,10 @@ function addCSS(csspath) {
name: item.path name: item.path
}); });
}, },
getQrCode(){ getQrCode() {
if(this.footerInfo){ if (this.footerInfo) {
return this.footerInfo.wxQrCodeUrl; return this.footerInfo.wxQrCodeUrl;
}else{ } else {
return ""; return "";
} }
}, },
...@@ -587,48 +600,48 @@ function addCSS(csspath) { ...@@ -587,48 +600,48 @@ function addCSS(csspath) {
* } * }
*/ */
windowOpen(obj){ windowOpen(obj) {
if(!obj){ if (!obj) {
this.$message.warning("参数错误"); this.$message.warning("参数错误");
return; return;
} }
if(!obj.url){ if (!obj.url) {
this.$message.warning("url参数错误"); this.$message.warning("url参数错误");
return; return;
} }
var param="?isDirectJump=1"; var param = "?isDirectJump=1";
if(obj.title){ if (obj.title) {
param=param+"&isModifyTitle=1"; param = param + "&isModifyTitle=1";
localStorage.setItem("titleValue",obj.title); localStorage.setItem("titleValue", obj.title);
}else{ } else {
localStorage.setItem("titleValue",""); localStorage.setItem("titleValue", "");
} }
var params = obj.params; var params = obj.params;
for(var i=0;i<params.length;i++){ for (var i = 0; i < params.length; i++) {
if(params[i] && params[i].name && params[i].value){ if (params[i] && params[i].name && params[i].value) {
param=param+"&"+params[i].name+"="+params[i].value; param = param + "&" + params[i].name + "=" + params[i].value;
} }
} }
var qurl = obj.url+param; var qurl = obj.url + param;
window.open(qurl); window.open(qurl);
}, },
leyuhover(){ leyuhover() {
var self = this; var self = this;
self.isleyu = false; self.isleyu = false;
self.isphone=false; self.isphone = false;
self.istop=false; self.istop = false;
self.iswx = false; self.iswx = false;
}, },
phonehover(){ phonehover() {
var self = this; var self = this;
self.isleyu = true; self.isleyu = true;
self.isphone = true; self.isphone = true;
self.istop=false; self.istop = false;
self.iswx = false; self.iswx = false;
self.showPhoneNum = true; self.showPhoneNum = true;
}, },
phoneleave(){ phoneleave() {
var self =this; var self = this;
console.log(123); console.log(123);
self.showPhoneNum = false; self.showPhoneNum = false;
}, },
...@@ -637,47 +650,47 @@ function addCSS(csspath) { ...@@ -637,47 +650,47 @@ function addCSS(csspath) {
self.showWxrm = true; self.showWxrm = true;
self.isleyu = true; self.isleyu = true;
self.isphone = false; self.isphone = false;
self.istop=false; self.istop = false;
self.iswx = true; self.iswx = true;
}, },
rwmover(){ rwmover() {
var self = this; var self = this;
self.showWxrm = false; self.showWxrm = false;
}, },
tophover(){ tophover() {
var self = this; var self = this;
self.isleyu = true; self.isleyu = true;
self.isphone = false; self.isphone = false;
self.istop=true; self.istop = true;
self.iswx = false; self.iswx = false;
}, },
goServiceDetails(item){ goServiceDetails(item) {
if (item.code == 'zzsbzc') { if (item.code == 'zzsbzc') {
$('.popups').fadeOut(0); $('.popups').fadeOut(0);
this.popupsType = false; this.popupsType = false;
this.$root.pushx({ this.$root.pushx({
title:"自主商标注册", title: "自主商标注册",
name:"/selftmreg", name: "/selftmreg",
params:{itemCode:item.code} params: { itemCode: item.code }
}); });
}else { } else {
headnotransparent(); headnotransparent();
this.windowOpen({ this.windowOpen({
url:window.location.href.split("#")[0]+"#/servicedetails", url: window.location.href.split("#")[0] + "#/servicedetails",
title:"服务详情", title: "服务详情",
params:[ params: [
{name:"sdsId",value: item.id} { name: "sdsId", value: item.id }
] ]
}) })
// window.open(window.location.href.split("#")[0]+"#/servicedetails?isDirectJump=1&sdsId=" + item.id) // window.open(window.location.href.split("#")[0]+"#/servicedetails?isDirectJump=1&sdsId=" + item.id)
} }
setTimeout(()=>{ setTimeout(() => {
this.$refs.topmenu.fetchMetaData(()=>{ this.$refs.topmenu.fetchMetaData(() => {
}); });
},300); }, 300);
}, },
popupsList (list,key) { popupsList(list, key) {
this.popupsDataList = list.smallList; this.popupsDataList = list.smallList;
this.pDataKey = key; this.pDataKey = key;
this.pTowDataKey = key; this.pTowDataKey = key;
...@@ -685,16 +698,16 @@ function addCSS(csspath) { ...@@ -685,16 +698,16 @@ function addCSS(csspath) {
popupsLeave() { popupsLeave() {
this.pTowDataKey = null; this.pTowDataKey = null;
}, },
findAllServicesitemA(){ findAllServicesitemA() {
this.company_id=this.$root.currentCompany.id; this.company_id = this.$root.currentCompany.id;
var params={company_id:this.$root.currentCompany.id}; var params = { company_id: this.$root.currentCompany.id };
var that=this; var that = this;
// this.$root.postReq("/web/serviceitemCtl/getAllProducts", params).then(function(d) { // this.$root.postReq("/web/serviceitemCtl/getAllProducts", params).then(function(d) {
// console.log(d,",getAllProducts-----------------"); // console.log(d,",getAllProducts-----------------");
that.popupsData = []; that.popupsData = [];
// if(d.status==0 && d.data){ // if(d.status==0 && d.data){
productLst.forEach(r=>{ productLst.forEach(r => {
if(r){ if (r) {
that.popupsData.push(r); that.popupsData.push(r);
} }
that.popupsDataList = that.popupsData[0].smallList; that.popupsDataList = that.popupsData[0].smallList;
...@@ -702,37 +715,37 @@ function addCSS(csspath) { ...@@ -702,37 +715,37 @@ function addCSS(csspath) {
// } // }
// }) // })
}, },
hidePanel (event) { hidePanel(event) {
var ap = $("#servicecat")[0]; var ap = $("#servicecat")[0];
var sp = document.getElementsByClassName("popups")[0]; var sp = document.getElementsByClassName("popups")[0];
if(sp && ap){ if (sp && ap) {
if(!sp.contains(event.target) && !ap.contains(event.target)){ if (!sp.contains(event.target) && !ap.contains(event.target)) {
$('.popups').fadeOut(0); $('.popups').fadeOut(0);
}else { } else {
var leftNum = $("#header_row")[0].offsetLeft - 10; var leftNum = $("#header_row")[0].offsetLeft - 10;
var leftLong = $("#servicecat")[0].offsetLeft + ($("#servicecat")[0].offsetLeft/2); var leftLong = $("#servicecat")[0].offsetLeft + ($("#servicecat")[0].offsetLeft / 2);
var widthImg = $("#elImg").width(); var widthImg = $("#elImg").width();
$('.popups-kailong').css("left",(widthImg + leftLong) + 'px'); $('.popups-kailong').css("left", (widthImg + leftLong) + 'px');
$('.popups').css("left", leftNum + 'px'); $('.popups').css("left", leftNum + 'px');
$('.popups').fadeIn(0); $('.popups').fadeIn(0);
} }
} }
}, },
directJump(){ directJump() {
// debugger // debugger
var url = location.href; var url = location.href;
var params = url.replace("?paramtheme=spring","").split("/#")[1]; var params = url.replace("?paramtheme=spring", "").split("/#")[1];
var arr1 = params.split("?"); var arr1 = params.split("?");
var jumpName = arr1[0]; var jumpName = arr1[0];
var jumpObj = {}; var jumpObj = {};
if(arr1.length==2){ if (arr1.length == 2) {
var arr2 = arr1[1].split("&"); var arr2 = arr1[1].split("&");
for(var i=0;i<arr2.length;i++){ for (var i = 0; i < arr2.length; i++) {
if(arr2[i]){ if (arr2[i]) {
var arr3 = arr2[i].split("="); var arr3 = arr2[i].split("=");
var name = arr3[0]; var name = arr3[0];
var value = arr3[1]; var value = arr3[1];
jumpObj[name]=value; jumpObj[name] = value;
} }
} }
} }
...@@ -743,7 +756,7 @@ function addCSS(csspath) { ...@@ -743,7 +756,7 @@ function addCSS(csspath) {
}); });
}, },
initIndexPage(){ initIndexPage() {
var url = location.href; var url = location.href;
console.log(url); console.log(url);
if (url.indexOf("bycdetailtm?sbzch") > 0) { if (url.indexOf("bycdetailtm?sbzch") > 0) {
...@@ -755,23 +768,23 @@ function addCSS(csspath) { ...@@ -755,23 +768,23 @@ function addCSS(csspath) {
params: { sbzch: obj2[0], gjfl: obj2[1] } params: { sbzch: obj2[0], gjfl: obj2[1] }
}); });
// headnotransparent(); // headnotransparent();
}else if (url.indexOf("bycquerytm?tmmonitzcr") > 0) { } else if (url.indexOf("bycquerytm?tmmonitzcr") > 0) {
var obj1 = url.split("bycquerytm?tmmonitzcr=")[1]; var obj1 = url.split("bycquerytm?tmmonitzcr=")[1];
var obj1=decodeURI(obj1); var obj1 = decodeURI(obj1);
this.pushx({ this.pushx({
title: "", title: "",
name: "/bycquerytm", name: "/bycquerytm",
params: { tmmonitzcr: obj1 } params: { tmmonitzcr: obj1 }
}); });
// headnotransparent(); // headnotransparent();
}else if (url.indexOf("bycquerytm") > 0){ } else if (url.indexOf("bycquerytm") > 0) {
// alert("bycquerytm"); // alert("bycquerytm");
this.pushx({ this.pushx({
title: "", title: "",
name: "/bycquerytm" name: "/bycquerytm"
}); });
// headnotransparent(); // headnotransparent();
}else if (url.indexOf("bycnoticedetailtm?name") > 0) { } else if (url.indexOf("bycnoticedetailtm?name") > 0) {
var obj1 = url.split("bycnoticedetailtm?name=")[1]; var obj1 = url.split("bycnoticedetailtm?name=")[1];
var obj2 = obj1.split("&imgurl="); var obj2 = obj1.split("&imgurl=");
var na = decodeURI(obj2[0]); var na = decodeURI(obj2[0]);
...@@ -791,25 +804,25 @@ function addCSS(csspath) { ...@@ -791,25 +804,25 @@ function addCSS(csspath) {
params: { code: obj1 } params: { code: obj1 }
}); });
// headnotransparent(); // headnotransparent();
}else if (url.indexOf("bytmmonitagency?agency_name=") > 0) { } else if (url.indexOf("bytmmonitagency?agency_name=") > 0) {
var obj1 = url.split("bytmmonitagency?agency_name=")[1]; var obj1 = url.split("bytmmonitagency?agency_name=")[1];
var obj1=decodeURI(obj1); var obj1 = decodeURI(obj1);
this.pushx({ this.pushx({
title: "", title: "",
name: "/bytmmonitagency", name: "/bytmmonitagency",
params: { agency_name: obj1 } params: { agency_name: obj1 }
}); });
}else if (url.indexOf("bycncldetail") > 0) { } else if (url.indexOf("bycncldetail") > 0) {
this.pushx({ this.pushx({
title: "商标尼斯查询", title: "商标尼斯查询",
name: "/bycncldetail" name: "/bycncldetail"
}); });
}else if (url.indexOf("bycnoticetm") > 0) { } else if (url.indexOf("bycnoticetm") > 0) {
this.pushx({ this.pushx({
title: "商标公告查询", title: "商标公告查询",
name: "/bycnoticetm" name: "/bycnoticetm"
}); });
}else if (url.indexOf("bycnoticeindex") > 0) { } else if (url.indexOf("bycnoticeindex") > 0) {
var obj1 = url.split("bycnoticeindex?noticetype=")[1]; var obj1 = url.split("bycnoticeindex?noticetype=")[1];
var obj2 = obj1.split("&noticenumber="); var obj2 = obj1.split("&noticenumber=");
var noticetype = decodeURI(obj2[0]); var noticetype = decodeURI(obj2[0]);
...@@ -819,11 +832,11 @@ function addCSS(csspath) { ...@@ -819,11 +832,11 @@ function addCSS(csspath) {
name: "/bycnoticeindex", name: "/bycnoticeindex",
params: { noticetype: noticetype, noticenumber: noticenumber } params: { noticetype: noticetype, noticenumber: noticenumber }
}); });
}else if(url.indexOf("selftmreg") > 0){ } else if (url.indexOf("selftmreg") > 0) {
this.$root.pushx({ this.$root.pushx({
title:"自主商标注册", title: "自主商标注册",
name:"/selftmreg", name: "/selftmreg",
params:{itemCode:"zzsbzc"} params: { itemCode: "zzsbzc" }
}); });
} }
else if (url.indexOf("bytmmonitlist") > 0) { else if (url.indexOf("bytmmonitlist") > 0) {
...@@ -832,13 +845,13 @@ function addCSS(csspath) { ...@@ -832,13 +845,13 @@ function addCSS(csspath) {
name: "/bytmmonitlist" name: "/bytmmonitlist"
}); });
// headnotransparent(); // headnotransparent();
}else if (url.indexOf("bytmmonitdynamics") > 0) { } else if (url.indexOf("bytmmonitdynamics") > 0) {
this.pushx({ this.pushx({
title: "", title: "",
name: "/bytmmonitdynamics" name: "/bytmmonitdynamics"
}); });
// headnotransparent(); // headnotransparent();
}else if (url.indexOf("bytmmonit") > 0) { } else if (url.indexOf("bytmmonit") > 0) {
this.pushx({ this.pushx({
title: "商标监控", title: "商标监控",
name: "/bytmmonit" name: "/bytmmonit"
...@@ -846,62 +859,62 @@ function addCSS(csspath) { ...@@ -846,62 +859,62 @@ function addCSS(csspath) {
// headnotransparent(); // headnotransparent();
} else { } else {
//检查lastaccess //检查lastaccess
var to =this.localdata("lastaccess"); var to = this.localdata("lastaccess");
if(to && to.name.indexOf("roleview")>=0){ if (to && to.name.indexOf("roleview") >= 0) {
this.isfront=false; this.isfront = false;
} }
if(to && to.name.indexOf("login")<0 && this.currentUser){ if (to && to.name.indexOf("login") < 0 && this.currentUser) {
this.pushx(to); this.pushx(to);
}else{ } else {
if(this.currentUser){ if (this.currentUser) {
this.$root.pushx({ this.$root.pushx({
"title":"首页", "title": "首页",
"name":"/" "name": "/"
}); });
}else{ } else {
this.$router.push("/"); this.$router.push("/");
} }
} }
} }
}, },
showHeadLogo(){ showHeadLogo() {
$("#imglogo").css("visibility", "visible"); $("#imglogo").css("visibility", "visible");
}, },
contextCompany(){ contextCompany() {
if(this.switchcompany){ if (this.switchcompany) {
return this.switchcompany; return this.switchcompany;
}else{ } else {
if(location.host.indexOf("igirl.gongsibao.com")<0){ if (location.host.indexOf("igirl.gongsibao.com") < 0) {
}else{ } else {
this.showHeadLogo(); this.showHeadLogo();
} }
return this.currentCompany; return this.currentCompany;
} }
}, },
channelchange(v){ channelchange(v) {
/*获取当前公司信息,获取当前公司的管理员,作登录, /*获取当前公司信息,获取当前公司的管理员,作登录,
重定向对应公司子域名,重写退出方法, 重定向对应公司子域名,重写退出方法,
发送切换前平台账号并登录后重定向平台 发送切换前平台账号并登录后重定向平台
检查平台登录成功要清空本地缓存的平台账号 检查平台登录成功要清空本地缓存的平台账号
*/ */
this.localdata("beforeswitchinfo",{"userid":this.currentUser.id}); this.localdata("beforeswitchinfo", { "userid": this.currentUser.id });
if(v){ if (v) {
this.postReq("/web/userCtl/switchUser",{companyid:v}).then(d=>{ this.postReq("/web/userCtl/switchUser", { companyid: v }).then(d => {
if(d.status==0 && d.data){ if (d.status == 0 && d.data) {
var redirecthost=d.data.domainname; var redirecthost = d.data.domainname;
var urlpath=""; var urlpath = "";
if(d.data.env=="dev"){ if (d.data.env == "dev") {
urlpath="http://"+redirecthost; urlpath = "http://" + redirecthost;
}else{ } else {
urlpath="https://"+redirecthost; urlpath = "https://" + redirecthost;
} }
//新域登录,不允许跨域 //新域登录,不允许跨域
// this.postReq(urlpath+"/web/userCtl/switchLogin",{companyid:v}).then(d=>{ // this.postReq(urlpath+"/web/userCtl/switchLogin",{companyid:v}).then(d=>{
// window.location.href=urlpath; // window.location.href=urlpath;
// }); // });
window.location.href=urlpath+"?sw=0162951413"; window.location.href = urlpath + "?sw=0162951413";
} }
}); });
} }
...@@ -929,57 +942,57 @@ function addCSS(csspath) { ...@@ -929,57 +942,57 @@ function addCSS(csspath) {
this.$refs.topmenu.fetchMetaData(); this.$refs.topmenu.fetchMetaData();
}*/ }*/
}, },
functest(item){ functest(item) {
if (item.code=="forus" || item.code=="solvr" || item.code=="opmethods" || item.code=="clientdemos"){ if (item.code == "forus" || item.code == "solvr" || item.code == "opmethods" || item.code == "clientdemos") {
return true; return true;
}else{ } else {
return false; return false;
} }
}, },
mnufunc(item){ mnufunc(item) {
item = { item = {
code: item.split('/')[1] code: item.split('/')[1]
} }
if (item.code == 'login') { if (item.code == 'login') {
return false; return false;
} }
if(currentTheme=="winter"){ if (currentTheme == "winter") {
if(item.code == 'home' || item.code == 'patentsearch' || item.code == 'entdecide'|| item.code == 'areapatentmonitor' || item.code == 'servicecat'){ if (item.code == 'home' || item.code == 'patentsearch' || item.code == 'entdecide' || item.code == 'areapatentmonitor' || item.code == 'servicecat') {
return true; return true;
}else{ } else {
return false; return false;
} }
}else{ } else {
if(item.code == 'patentsearch' || item.code == 'entdecide'|| item.code == 'areapatentmonitor'){ if (item.code == 'patentsearch' || item.code == 'entdecide' || item.code == 'areapatentmonitor') {
return false; return false;
} }
if(this.contextCompany() && this.contextCompany().id!=1){/* 其它站点*/ if (this.contextCompany() && this.contextCompany().id != 1) {/* 其它站点*/
// console.log(JSON.stringify(this.contextCompany())); // console.log(JSON.stringify(this.contextCompany()));
if(currentTheme!="autumn" && item.code=="zcfw"){ if (currentTheme != "autumn" && item.code == "zcfw") {
return false; return false;
} }
if(item.code=="siteapply" || ((item.code=="servicecat") && !this.isfront) if (item.code == "siteapply" || ((item.code == "servicecat") && !this.isfront)
|| (item.code=="servicecat" && this.contextCompany().siteTheme!="default") || || (item.code == "servicecat" && this.contextCompany().siteTheme != "default") ||
(item.code=="servicecat" && this.contextCompany().siteTheme=="default" && window.location.hash.indexOf("login")>=0) (item.code == "servicecat" && this.contextCompany().siteTheme == "default" && window.location.hash.indexOf("login") >= 0)
|| item.code=="forus" || item.code=="solvr" || item.code=="opmethods" || item.code=="clientdemos"){ || item.code == "forus" || item.code == "solvr" || item.code == "opmethods" || item.code == "clientdemos") {
return false; return false;
}else{ } else {
return true; return true;
} }
}else{ } else {
if(item.code=="servicecat" || item.code=="tmtransactionmarket" || item.code=="home" || item.code=="bycquerytm" || item.code=="bytmmonit"){ if (item.code == "servicecat" || item.code == "tmtransactionmarket" || item.code == "home" || item.code == "bycquerytm" || item.code == "bytmmonit") {
return false; return false;
} }
if(this.codePath.indexOf("bycquerytm")>=0 && this.functest(item)){ if (this.codePath.indexOf("bycquerytm") >= 0 && this.functest(item)) {
return false; return false;
} }
if(this.codePath.indexOf("bytmmonit")>=0 && this.functest(item)){ if (this.codePath.indexOf("bytmmonit") >= 0 && this.functest(item)) {
return false; return false;
} }
if(this.codePath.indexOf("tmtransactionmarket")>=0 && this.functest(item)){ if (this.codePath.indexOf("tmtransactionmarket") >= 0 && this.functest(item)) {
return false; return false;
} }
if( item.code=="zcfw"){ if (item.code == "zcfw") {
return false; return false;
} }
...@@ -989,11 +1002,11 @@ function addCSS(csspath) { ...@@ -989,11 +1002,11 @@ function addCSS(csspath) {
} }
}, },
goBack(event) { goBack(event) {
if(!this.isfront){ if (!this.isfront) {
alert("请选择后台页面中的页签进行快捷导航"); alert("请选择后台页面中的页签进行快捷导航");
history.go(1); history.go(1);
return; return;
}else{ } else {
this.pushx({ this.pushx({
title: "首页", title: "首页",
name: "/" name: "/"
...@@ -1002,7 +1015,7 @@ function addCSS(csspath) { ...@@ -1002,7 +1015,7 @@ function addCSS(csspath) {
} }
}, },
backhome(){ backhome() {
this.pushx({ this.pushx({
title: "首页", title: "首页",
...@@ -1010,7 +1023,7 @@ function addCSS(csspath) { ...@@ -1010,7 +1023,7 @@ function addCSS(csspath) {
}); });
this.isfront = true; this.isfront = true;
this.stageType = true; this.stageType = true;
this.isShowMenu=false; this.isShowMenu = false;
this.hidetabs(); this.hidetabs();
// setTimeout(()=>{ // setTimeout(()=>{
// this.$refs.topmenu.fetchMetaData(()=>{ // this.$refs.topmenu.fetchMetaData(()=>{
...@@ -1020,8 +1033,8 @@ function addCSS(csspath) { ...@@ -1020,8 +1033,8 @@ function addCSS(csspath) {
this.popupsType = true; this.popupsType = true;
}, },
goadmin(){ goadmin() {
this.isfront=false; this.isfront = false;
this.pushx({ this.pushx({
title: "每日概览", title: "每日概览",
name: "/roleview" name: "/roleview"
...@@ -1030,7 +1043,7 @@ function addCSS(csspath) { ...@@ -1030,7 +1043,7 @@ function addCSS(csspath) {
}, },
aboutus: function () { aboutus: function () {
console.log("---------------------------------------"); console.log("---------------------------------------");
this.popupsType=false; this.popupsType = false;
this.pushx({ this.pushx({
title: "关于我们", title: "关于我们",
name: "/aboutus" name: "/aboutus"
...@@ -1044,14 +1057,14 @@ function addCSS(csspath) { ...@@ -1044,14 +1057,14 @@ function addCSS(csspath) {
$(".el-tabs__nav-scroll").hide(); $(".el-tabs__nav-scroll").hide();
$(".el-tabs--border-card > .el-tabs__header").css("border-bottom", "none"); $(".el-tabs--border-card > .el-tabs__header").css("border-bottom", "none");
}, },
localdata(key,item){ localdata(key, item) {
if(item){ if (item) {
localStorage.setItem(key,JSON.stringify(item)); localStorage.setItem(key, JSON.stringify(item));
}else{ } else {
var strobj=localStorage.getItem(key); var strobj = localStorage.getItem(key);
if(strobj){ if (strobj) {
return JSON.parse(strobj); return JSON.parse(strobj);
}else{ } else {
return null; return null;
} }
...@@ -1061,15 +1074,15 @@ function addCSS(csspath) { ...@@ -1061,15 +1074,15 @@ function addCSS(csspath) {
console.log(to); console.log(to);
let exittabs = this.editableTabs2.filter(tab => tab.name == to.name); let exittabs = this.editableTabs2.filter(tab => tab.name == to.name);
if(window.location.href.indexOf("isModifyTitle=1")<0){//若是window.open 打开的页面 则不记录最后一次的点击 if (window.location.href.indexOf("isModifyTitle=1") < 0) {//若是window.open 打开的页面 则不记录最后一次的点击
var beforeaccess = this.localdata("lastaccess"); var beforeaccess = this.localdata("lastaccess");
//缓存记录倒数第二次的点击,目前用于订单修改返回 //缓存记录倒数第二次的点击,目前用于订单修改返回
this.localdata("beforeaccess",beforeaccess); this.localdata("beforeaccess", beforeaccess);
//缓存记录最后一次的点击 //缓存记录最后一次的点击
this.localdata("lastaccess",to); this.localdata("lastaccess", to);
} }
//记录当前to到内存,key是路由路径 //记录当前to到内存,key是路由路径
this.localdata(to.name,to); this.localdata(to.name, to);
if (exittabs.length > 0) { if (exittabs.length > 0) {
this.editableTabsValue2 = to.name; this.editableTabsValue2 = to.name;
this.$nextTick(() => { this.$nextTick(() => {
...@@ -1098,16 +1111,16 @@ function addCSS(csspath) { ...@@ -1098,16 +1111,16 @@ function addCSS(csspath) {
}); });
}, },
showtopmenu(){ showtopmenu() {
console.log('检索'); console.log('检索');
this.isfront=true; this.isfront = true;
var test=window.location.hash; var test = window.location.hash;
console.log("nnnnnnnnnnnnnnnnnnnnnnnnn===============",test); console.log("nnnnnnnnnnnnnnnnnnnnnnnnn===============", test);
if (test.indexOf('moreservice') == '-1' && test!="#/") { if (test.indexOf('moreservice') == '-1' && test != "#/") {
this.popupsType = false; this.popupsType = false;
$(".spechorizotal .nav_color").css("color", "black"); $(".spechorizotal .nav_color").css("color", "black");
$(".spechorizotal .nav_color:hover").css("color", "#2692FF"); $(".spechorizotal .nav_color:hover").css("color", "#2692FF");
}else { } else {
this.popupsType = true; this.popupsType = true;
} }
...@@ -1133,29 +1146,29 @@ function addCSS(csspath) { ...@@ -1133,29 +1146,29 @@ function addCSS(csspath) {
console.log(this.currentCodePath); console.log(this.currentCodePath);
this.editableTabsValue2 = tab.name; this.editableTabsValue2 = tab.name;
//点击页签时,先获取以前的缓存to //点击页签时,先获取以前的缓存to
var tovalue=this.localdata(tab.name); var tovalue = this.localdata(tab.name);
//点击页签时,设置一个全局的环境变量宣称当前的操作为点击页签 //点击页签时,设置一个全局的环境变量宣称当前的操作为点击页签
this.$store.state.istabclick=true; this.$store.state.istabclick = true;
if(tab.name =="/"){ if (tab.name == "/") {
this.showtopmenu(); this.showtopmenu();
this.hidetabs(); this.hidetabs();
this.isShowMenu=false; this.isShowMenu = false;
} }
if (tab.name == "home") { if (tab.name == "home") {
this.$router.push("/"); this.$router.push("/");
this.hidetabs(); this.hidetabs();
this.isShowMenu=false; this.isShowMenu = false;
} else { } else {
console.log("================mmmmmmmmmmmmmmmmmmmmmmmmmmmmm==============="); console.log("================mmmmmmmmmmmmmmmmmmmmmmmmmmmmm===============");
console.log(JSON.stringify(this.editableTabs2)); console.log(JSON.stringify(this.editableTabs2));
console.log(tab.name); console.log(tab.name);
if(tovalue){ if (tovalue) {
if(tovalue.params){ if (tovalue.params) {
this.$router.push({path:tovalue.name,query:tovalue.params}); this.$router.push({ path: tovalue.name, query: tovalue.params });
}else{ } else {
this.$router.push({path:tovalue.name}); this.$router.push({ path: tovalue.name });
} }
}else{ } else {
this.$router.push(tab.name); this.$router.push(tab.name);
} }
} }
...@@ -1231,11 +1244,11 @@ function addCSS(csspath) { ...@@ -1231,11 +1244,11 @@ function addCSS(csspath) {
}); });
}, },
isUrlSw(){ isUrlSw() {
var pas=location.href.split("?"); var pas = location.href.split("?");
if(pas && pas.length==2){ if (pas && pas.length == 2) {
var swnames=pas[1].split("="); var swnames = pas[1].split("=");
if(swnames && swnames[0]=="sw"){ if (swnames && swnames[0] == "sw") {
return true; return true;
} }
} }
...@@ -1243,18 +1256,18 @@ function addCSS(csspath) { ...@@ -1243,18 +1256,18 @@ function addCSS(csspath) {
}, },
checkLogin: function (cbk) { checkLogin: function (cbk) {
var self = this; var self = this;
var param={}; var param = {};
var puser=this.localdata("beforeswitchinfo"); var puser = this.localdata("beforeswitchinfo");
if(puser && puser.userid){ if (puser && puser.userid) {
param.isswitch=1;//表示当前是切换 param.isswitch = 1;//表示当前是切换
param.userid=puser.userid; param.userid = puser.userid;
} }
if(queryMap["sw"]){ if (queryMap["sw"]) {
param.isswitch=1; param.isswitch = 1;
} }
if(queryMap["paramtheme"]){ if (queryMap["paramtheme"]) {
param.paramtheme=queryMap["paramtheme"]; param.paramtheme = queryMap["paramtheme"];
} }
// var pas=location.href.split("?"); // var pas=location.href.split("?");
// if(pas && pas.length==2){ // if(pas && pas.length==2){
...@@ -1263,17 +1276,17 @@ function addCSS(csspath) { ...@@ -1263,17 +1276,17 @@ function addCSS(csspath) {
// param.isswitch=1; // param.isswitch=1;
// } // }
// } // }
var owner=self; var owner = self;
self.postReq("/web/userCtl/checkLogin", param).then(function (d) { self.postReq("/web/userCtl/checkLogin", param).then(function (d) {
//登录igirl--平台刷新页面后,清空beforeswitchinfo //登录igirl--平台刷新页面后,清空beforeswitchinfo
if(location.host.indexOf("igirl.gongsibao.com")>=0 || location.host.indexOf("igsuper.gongsibao.com")>=0){ if (location.host.indexOf("igirl.gongsibao.com") >= 0 || location.host.indexOf("igsuper.gongsibao.com") >= 0) {
localStorage.removeItem("beforeswitchinfo"); localStorage.removeItem("beforeswitchinfo");
} }
// alert(d.data.company.siteTheme); // alert(d.data.company.siteTheme);
if (d && d.status == 0 && d.data.status != -99) { if (d && d.status == 0 && d.data.status != -99) {
//修改样式header //修改样式header
self.$store.state.currentUser = d.data; self.$store.state.currentUser = d.data;
self.currentUser=d.data; self.currentUser = d.data;
// if (d.data.company) { // if (d.data.company) {
// self.currentCompany = d.data.company; // self.currentCompany = d.data.company;
// //设置全具主题 // //设置全具主题
...@@ -1302,8 +1315,8 @@ function addCSS(csspath) { ...@@ -1302,8 +1315,8 @@ function addCSS(csspath) {
} }
} else { } else {
if (d && d.data) { if (d && d.data) {
self.$store.state.currentUser =null; self.$store.state.currentUser = null;
self.currentUser=null; self.currentUser = null;
// self.currentCompany = d.data.company; // self.currentCompany = d.data.company;
// //设置全具主题 // //设置全具主题
// if(self.currentCompany.siteTheme && self.currentCompany.siteTheme!=""){ // if(self.currentCompany.siteTheme && self.currentCompany.siteTheme!=""){
...@@ -1340,10 +1353,10 @@ function addCSS(csspath) { ...@@ -1340,10 +1353,10 @@ function addCSS(csspath) {
showLogin: function () { showLogin: function () {
}, },
siteapply(){ siteapply() {
this.pushx({ this.pushx({
title:"站点申请", title: "站点申请",
name:"/siteapply" name: "/siteapply"
}); });
}, },
hideLogin: function () { hideLogin: function () {
...@@ -1378,11 +1391,11 @@ function addCSS(csspath) { ...@@ -1378,11 +1391,11 @@ function addCSS(csspath) {
title: "登录", title: "登录",
name: "/login" name: "/login"
}); });
setTimeout(()=>{ setTimeout(() => {
this.$refs.topmenu.fetchMetaData(()=>{ this.$refs.topmenu.fetchMetaData(() => {
}); });
},300); }, 300);
} }
if (k == "roleview") { if (k == "roleview") {
this.pushx({ this.pushx({
...@@ -1393,25 +1406,25 @@ function addCSS(csspath) { ...@@ -1393,25 +1406,25 @@ function addCSS(csspath) {
if (k == "exit") { if (k == "exit") {
var objuser=this.localdata("beforeswitchinfo"); var objuser = this.localdata("beforeswitchinfo");
var param=null; var param = null;
var isRtnPlatform=false; var isRtnPlatform = false;
if(objuser && objuser.userid){ if (objuser && objuser.userid) {
isRtnPlatform=true; isRtnPlatform = true;
param={"userid":objuser.userid}; param = { "userid": objuser.userid };
} }
this.getReq("/web/userCtl/exit", null).then(function (r) { this.getReq("/web/userCtl/exit", null).then(function (r) {
if(!self.isUrlSw()){//如果不是渠道退出,否则返回平台 if (!self.isUrlSw()) {//如果不是渠道退出,否则返回平台
self.$store.state.currentUser = null; self.$store.state.currentUser = null;
self.hidetabs(); self.hidetabs();
self.$nextTick(() => { self.$nextTick(() => {
self.backhome(); self.backhome();
}); });
}else{ } else {
if(r.data && r.data.env=="dev"){ if (r.data && r.data.env == "dev") {
location.href="http://igsuper.gongsibao.com"; location.href = "http://igsuper.gongsibao.com";
}else{ } else {
location.href="https://igirl.gongsibao.com"; location.href = "https://igirl.gongsibao.com";
} }
} }
}); });
...@@ -1424,14 +1437,14 @@ function addCSS(csspath) { ...@@ -1424,14 +1437,14 @@ function addCSS(csspath) {
// }else { // }else {
// headtransparent() // headtransparent()
// } // }
console.log(index,'sssssssssssssss'); console.log(index, 'sssssssssssssss');
var self = this; var self = this;
if (index == 'patentsearch') { if (index == 'patentsearch') {
this.stageType = false; this.stageType = false;
this.pushx({ this.pushx({
title:"区域专利监控", title: "区域专利监控",
name:"/iframehtml", name: "/iframehtml",
params:{url: 'https://zhuanzhidao.gongsibao.com/#/patentsimplesearch'} params: { url: 'https://zhuanzhidao.gongsibao.com/#/patentsimplesearch' }
}) })
return false; return false;
} }
...@@ -1439,9 +1452,9 @@ function addCSS(csspath) { ...@@ -1439,9 +1452,9 @@ function addCSS(csspath) {
this.stageType = false; this.stageType = false;
this.pushx({ this.pushx({
title:"区域专利监控", title: "区域专利监控",
name:"/iframehtmlone", name: "/iframehtmlone",
params:{url: 'https://zhuanzhidao.gongsibao.com/#/regionalpatentmonitoring'} params: { url: 'https://zhuanzhidao.gongsibao.com/#/regionalpatentmonitoring' }
}) })
// this.loadingHome = true; // this.loadingHome = true;
// setTimeout(()=>{ // setTimeout(()=>{
...@@ -1452,15 +1465,15 @@ function addCSS(csspath) { ...@@ -1452,15 +1465,15 @@ function addCSS(csspath) {
if (index == 'entdecide') { if (index == 'entdecide') {
this.stageType = false; this.stageType = false;
this.pushx({ this.pushx({
title:"企业决策", title: "企业决策",
name:"/iframehtmltwo", name: "/iframehtmltwo",
params:{url: 'https://zhuanzhidao.gongsibao.com/#/businessdecisions'} params: { url: 'https://zhuanzhidao.gongsibao.com/#/businessdecisions' }
}) })
return false; return false;
} }
if(index=="forus" || index=="solvr" || index=="opmethods" || index=="clientdemos"){ if (index == "forus" || index == "solvr" || index == "opmethods" || index == "clientdemos") {
self.homeobj.getNavIndex(index); self.homeobj.getNavIndex(index);
$("#app").animate({scrollTop:window.innerHeight},500) $("#app").animate({ scrollTop: window.innerHeight }, 500)
return false; return false;
} }
if (index == "servicecat") { if (index == "servicecat") {
...@@ -1476,22 +1489,22 @@ function addCSS(csspath) { ...@@ -1476,22 +1489,22 @@ function addCSS(csspath) {
// return; // return;
// } // }
if(index=="zcfw"){ if (index == "zcfw") {
if(location.href.indexOf("https")>=0){ if (location.href.indexOf("https") >= 0) {
window.open("https://"+location.host+"?paramtheme=spring"); window.open("https://" + location.host + "?paramtheme=spring");
}else{ } else {
window.open("https://"+location.host+"?paramtheme=spring"); window.open("https://" + location.host + "?paramtheme=spring");
} }
return; return;
} }
if(index=="/"){ if (index == "/") {
this.stageType = true; this.stageType = true;
if(this.homeobj && this.currentCompany.id==1){ if (this.homeobj && this.currentCompany.id == 1) {
this.homeobj.a=false; this.homeobj.a = false;
} }
if(this.homeobj && this.currentCompany.id!=1){ if (this.homeobj && this.currentCompany.id != 1) {
this.homeobj.moreservice("ip"); this.homeobj.moreservice("ip");
} }
this.popupsType = true; this.popupsType = true;
...@@ -1524,8 +1537,8 @@ function addCSS(csspath) { ...@@ -1524,8 +1537,8 @@ function addCSS(csspath) {
}, },
getReq(path, data) { getReq(path, data) {
var self = this; var self = this;
return new Promise(function(resv,reject){ return new Promise(function (resv, reject) {
axios.get(path, { params: data, "headers": { "theme":currentTheme,"codepath": self.codePath, "companyid":self.contextCompany()?self.contextCompany().id:"" } }).then(function (r) { axios.get(path, { params: data, "headers": { "theme": currentTheme, "codepath": self.codePath, "companyid": self.contextCompany() ? self.contextCompany().id : "" } }).then(function (r) {
if (r && r.data && r.data.status == -99) { if (r && r.data && r.data.status == -99) {
self.$store.state.currentUser = null; self.$store.state.currentUser = null;
self.hideMask(); self.hideMask();
...@@ -1549,7 +1562,7 @@ function addCSS(csspath) { ...@@ -1549,7 +1562,7 @@ function addCSS(csspath) {
} }
resv(r.data ? r.data : null); resv(r.data ? r.data : null);
} }
}).catch(function(e){ }).catch(function (e) {
reject(e); reject(e);
}); });
}); });
...@@ -1557,7 +1570,7 @@ function addCSS(csspath) { ...@@ -1557,7 +1570,7 @@ function addCSS(csspath) {
}, },
postReq(path, data) { postReq(path, data) {
var self = this; var self = this;
return axios.post(path, data, { "headers": {"theme":currentTheme, 'codepath': self.codePath, "companyid": self.contextCompany()?self.contextCompany().id:"" } }).then(function (r) { return axios.post(path, data, { "headers": { "theme": currentTheme, 'codepath': self.codePath, "companyid": self.contextCompany() ? self.contextCompany().id : "" } }).then(function (r) {
if (r && r.data && r.data.status == -99) { if (r && r.data && r.data.status == -99) {
self.$store.state.currentUser = null; self.$store.state.currentUser = null;
self.hideMask(); self.hideMask();
...@@ -1578,6 +1591,6 @@ function addCSS(csspath) { ...@@ -1578,6 +1591,6 @@ function addCSS(csspath) {
}); });
}, },
}, },
}); });
//}); //});
//}); //});
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