Commit fea26476 authored by xinzhedeai's avatar xinzhedeai

dp 获取roleinfo,区分用户类别ls处理

parent 069e7154
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<h2>威海高新区科技企业孵化信息平台</h2> <h2>威海高新区科技企业孵化信息平台</h2>
</div> </div>
<div class="go-back"> <div class="go-back">
<a @click="goBackendHome">进入后台</a> <a @click="goBackendHome">进入后台</a>
</div> </div>
</header> </header>
</div> </div>
...@@ -142,28 +142,168 @@ export default { ...@@ -142,28 +142,168 @@ export default {
setTimeout(() => { setTimeout(() => {
this.sjzl(); this.sjzl();
this.srph(); this.srph();
this.qycxcysjfx(); this.qycxcysjfx();
this.fhqfhqysjfx(); this.fhqfhqysjfx();
this.fhqyndsjsfbhqs(); this.fhqyndsjsfbhqs();
this.zfqyndsjsfbhqs(); this.zfqyndsjsfbhqs();
}, 900); }, 900);
// 登录权限获取
(t.getInfo = function () {
var url = t.LOCAL_API + "/auth/info";
return reqApi.common.requst
.call(that.$route, "get", url)
.then((res) => {
if (!res.error && res.user) {
// 设置全局登录用户类别标记
localStorage.setItem(
"groupIdByloginType",
res.user.jobs.length && res.user.jobs[0]["id"]
);
m.init();
} else {
m.loginView = qf.UI.popWindow({
cover: true,
coverFull: true,
className: "login-ctn",
//container:b0_e, // id || Element对象
//backgroundColor:'rgba(0,0,0,.4);backdrop-filter:blur(15px);',
closeEvent: true,
html: '<div class="liner"></div>',
onload: function (v) {
m.loginView = v;
var el = v.el;
v.setStyle(v.Wrap, {
height: "5.04rem",
width: "9.12rem",
zIndex: 10,
borderRadius: ".06rem",
overflow: "hidden",
});
el.innerHTML = `<div class="l-left"><h3>Welcome!</h3><h4>高区应急综合管理平台</h4></div><div class="pop-login" ><div class="inbox-range"><div class="ctn-fix"><form class="el-form login-form el-form--label-left"><h3 class="title">登录</h3><div class="el-form-item is-required el-form-item--small"><div class="el-form-item__content" style=""><div class="el-input el-input--small el-input--prefix"><input type="text" autocomplete="off" placeholder="账号" class="el-input__inner"><span class="el-input__prefix el-icon-s-custom"></span></div></div><div class="el-form-item__error">用户名不能为空</div></div>
<div class="el-form-item is-required el-form-item--small"><div class="el-form-item__content" style=""><div class="el-input el-input--small el-input--prefix"><input type="password" autocomplete="off" placeholder="密码" class="el-input__inner"><span class="el-input__prefix el-icon-key"></span></div></div><div class="el-form-item__error">密码不能为空</div></div>
<div class="el-form-item is-required el-form-item--small">
<div class="el-form-item__content" style="display:flex;justify-content:space-between;">
<div class="el-input el-input--small el-input--prefix" style="width:50%;">
<input type="text" autocomplete="off" placeholder="验证码" class="el-input__inner">
<span class="el-input__prefix el-icon-circle-check"></span></div>
<div class="login-code"><img src=""></div>
</div><div class="el-form-item__error">验证码不能为空</div></div>
<div class="el-form-item el-form-item--small" style="width: 100%;"><div class="el-form-item__content" style="margin-left: 0px;"><button type="button" class="el-button el-button--primary el-button--medium" style="width: 100%;">登 录</button></div></div></form></div></div></div>`;
// 校验
m.loginView.check = function (el) {
var itemContent = el.parentNode.parentNode;
if (qf.trim(el.value)) {
return (
itemContent.nextElementSibling.classList.remove("open"),
1
);
} else {
itemContent.nextElementSibling.classList.add("open");
el.focus();
}
};
m.loginView.inputs = el.querySelectorAll("input");
for (var input of m.loginView.inputs) {
input.onblur = function (e) {
var tag = e.target || e.srcElement;
m.loginView.check(tag);
};
}
// 验证码
(m.loginView.refreshCodeImg = function () {
m.getCodeImg().then((res) => {
var img = el.querySelector(".login-code>img");
img.src = res.img;
m.loginView.uuid = res.uuid;
});
})();
m.loginView.loginCheck = function () {
var inputs = m.loginView.inputs;
var username = inputs[0],
password = inputs[1],
captcha = inputs[2];
if (
m.loginView.check(username) &&
m.loginView.check(password) &&
m.loginView.check(captcha)
) {
var param = {
username: username.value,
password: encrypt(password.value),
code: captcha.value,
uuid: m.loginView.uuid,
};
var l1 = qf.UI.loading({ zIndex: 2051, timer: 10000 });
m.login(param)
.then((res) => {
l1.close();
if (res.token && res.user) {
m.init();
m.setToken(res.token);
m.loginView.remove();
} else {
new qf.UI.Notify({
zIndex: 2050,
type: "warning",
duration: 3000,
autoOpen: true,
message: res.message || res.msg || "",
});
m.loginView.refreshCodeImg();
}
})
.catch(function (e) {
console.log("catch ________________ ", e);
});
}
};
// 回车事件
m.loginView.keyup = function (e) {
if (e.keyCode === 13) {
m.loginView.loginCheck();
}
};
window.addEventListener("keyup", m.loginView.keyup);
},
click: function (tag) {
if (tag.nodeName === "BUTTON") {
m.loginView.loginCheck();
} else if (tag.nodeName === "IMG") {
m.loginView.refreshCodeImg();
}
},
close: function (e) {
window.removeEventListener("keyup", m.loginView.keyup);
delete m.loginView;
},
});
}
});
})();
}); });
}, },
methods: { methods: {
goBackendHome(){ goBackendHome() {
if(localStorage.getItem('groupIdByloginType')*1 == 1){ // 孵化器用户 if (localStorage.getItem("groupIdByloginType") * 1 == 1) {
location.href = '/home/enterprise' // 孵化器用户
return location.href = "/home/enterprise";
} return;
if(localStorage.getItem('groupIdByloginType')*1 == 2){ // 科技据用户 }
location.href = '/home/tech' if (localStorage.getItem("groupIdByloginType") * 1 == 2) {
return // 科技据用户
} location.href = "/home/tech";
location.reload() return;
}, }
location.reload();
},
initMap() { initMap() {
var VUE = this; var VUE = this;
VUE.map = new AMap.Map("container", { VUE.map = new AMap.Map("container", {
...@@ -175,10 +315,40 @@ export default { ...@@ -175,10 +315,40 @@ export default {
console.log(VUE.map, "map"); console.log(VUE.map, "map");
// addMarker(); // addMarker();
var markers = [ var markers = [
{ position: [116.481181, 39.989792], extraData: {incubatorName: '23423', operatingAgency: '111', incubatorCount:0, graduationCount:11,totalArea:22, totalIncome:223} }, {
{ position: [116.305467, 39.989799], extraData: {incubatorName: '666', operatingAgency: '111', incubatorCount:0, graduationCount:11,totalArea:22, totalIncome:223} }, position: [116.481181, 39.989792],
{ position: [116.305467, 39.807761], extraData: {incubatorName: '6664444', operatingAgency: '111', incubatorCount:0, graduationCount:11,totalArea:22, totalIncome:223} }, extraData: {
] incubatorName: "23423",
operatingAgency: "111",
incubatorCount: 0,
graduationCount: 11,
totalArea: 22,
totalIncome: 223,
},
},
{
position: [116.305467, 39.989799],
extraData: {
incubatorName: "666",
operatingAgency: "111",
incubatorCount: 0,
graduationCount: 11,
totalArea: 22,
totalIncome: 223,
},
},
{
position: [116.305467, 39.807761],
extraData: {
incubatorName: "6664444",
operatingAgency: "111",
incubatorCount: 0,
graduationCount: 11,
totalArea: 22,
totalIncome: 223,
},
},
];
// 添加一些分布不均的点到地图上,地图上添加三个点标记,作为参照 // 添加一些分布不均的点到地图上,地图上添加三个点标记,作为参照
markers.forEach(function (item, index) { markers.forEach(function (item, index) {
...@@ -211,7 +381,7 @@ export default { ...@@ -211,7 +381,7 @@ export default {
document.getElementById("goMoreBtn").onclick = function () { document.getElementById("goMoreBtn").onclick = function () {
// alert(this.getAttribute('data-id')) // alert(this.getAttribute('data-id'))
// VUE.$route.push('/home/enterprise') // VUE.$route.push('/home/enterprise')
location.href = '/home/tech?id=' + this.getAttribute('data-id') location.href = "/home/tech?id=" + this.getAttribute("data-id");
}; };
}); });
}, },
...@@ -226,7 +396,9 @@ export default { ...@@ -226,7 +396,9 @@ export default {
<dd><font>使用总面积:</font><span>${item.totalArea || 0}(㎡)</span></dd> <dd><font>使用总面积:</font><span>${item.totalArea || 0}(㎡)</span></dd>
<dd><font>总收入:</font><span>${item.totalIncome || 0}万元</span></dd> <dd><font>总收入:</font><span>${item.totalIncome || 0}万元</span></dd>
</dl> </dl>
<button type="button" id="goMoreBtn" data-id="${item.incubatorName}">更多</button> <button type="button" id="goMoreBtn" data-id="${
item.incubatorName
}">更多</button>
</div>`; </div>`;
this.infoWindow.setContent(content); this.infoWindow.setContent(content);
this.infoWindow.open(this.map, marker.getPosition()); this.infoWindow.open(this.map, marker.getPosition());
...@@ -242,7 +414,7 @@ export default { ...@@ -242,7 +414,7 @@ export default {
}); });
}, },
srph() { srph() {
// 收入排行 // 收入排行f
request({ request({
url: "api/homePage/incubatorLeaderboard", url: "api/homePage/incubatorLeaderboard",
method: "get", method: "get",
...@@ -338,8 +510,8 @@ export default { ...@@ -338,8 +510,8 @@ export default {
dataLabels: { dataLabels: {
format: "<b>{point.name}</b>: {point.percentage:.1f} %", format: "<b>{point.name}</b>: {point.percentage:.1f} %",
style: { style: {
fontSize: '0.17rem', // 设置系列文本的字体大小 fontSize: "0.17rem", // 设置系列文本的字体大小
} },
}, },
}, },
}, },
...@@ -642,7 +814,6 @@ export default { ...@@ -642,7 +814,6 @@ export default {
fontSize: "0.17rem", fontSize: "0.17rem",
}, },
}, },
}, },
yAxis: { yAxis: {
title: { title: {
...@@ -656,13 +827,12 @@ export default { ...@@ -656,13 +827,12 @@ export default {
align: "high", align: "high",
y: -10, y: -10,
x: 25, x: 25,
}, },
labels: { labels: {
style: { style: {
fontSize: '0.17rem', // 设置 Y 轴文字大小 fontSize: "0.17rem", // 设置 Y 轴文字大小
} },
} },
}, },
plotOptions: {}, plotOptions: {},
series: [ series: [
...@@ -1863,9 +2033,11 @@ export default { ...@@ -1863,9 +2033,11 @@ export default {
//padding:.08rem .10rem; //padding:.08rem .10rem;
//background:no-repeat center center url('~@/assets/images/layout/side_l_md.png');background-size:100% 100%; //background:no-repeat center center url('~@/assets/images/layout/side_l_md.png');background-size:100% 100%;
// background-color: rgba(29, 57, 110, 0.65); // background-color: rgba(29, 57, 110, 0.65);
background: linear-gradient(to right, background: linear-gradient(
rgba(0, 60, 144, 0.9), /* #003c90 - 90% 不透明度 */ to right,
rgba(0, 44, 106, 0.7) /* #002c6a - 70% 不透明度 */ rgba(0, 60, 144, 0.9),
/* #003c90 - 90% 不透明度 */ rgba(0, 44, 106, 0.7)
/* #002c6a - 70% 不透明度 */
); );
.chart { .chart {
...@@ -1957,17 +2129,17 @@ export default { ...@@ -1957,17 +2129,17 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
padding-left: .5rem; padding-left: 0.5rem;
&:before { &:before {
content: ""; content: "";
height: .44rem; height: 0.44rem;
width: .44rem; width: 0.44rem;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
background-size: 100% auto; background-size: 100% auto;
top: 0.35rem; top: 0.35rem;
position: absolute; position: absolute;
left: .2rem; left: 0.2rem;
//background-image:url('~@/assets/images/layout/md31_i1.png'); //background-image:url('~@/assets/images/layout/md31_i1.png');
} }
h6 { h6 {
......
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