Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
47b34cf175
|
|
@ -165,9 +165,8 @@ export default {
|
||||||
confirmButtonClass: "el-button--danger",
|
confirmButtonClass: "el-button--danger",
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$router.replace({ path: "/login" }).then(() => {
|
this.$TOOL.data.remove("TOKEN")
|
||||||
location.reload();
|
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
//取消退出
|
//取消退出
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ router.beforeEach(async (to, from, next) => {
|
||||||
//动态标题
|
//动态标题
|
||||||
document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}`
|
document.title = to.meta.title ? `${to.meta.title} - ${config.APP_NAME}` : `${config.APP_NAME}`
|
||||||
|
|
||||||
let token = tool.cookie.get("TOKEN");
|
let token = tool.data.get("TOKEN");
|
||||||
//去往登录页
|
//去往登录页
|
||||||
if (to.path === "/login") {
|
if (to.path === "/login") {
|
||||||
//删除路由(替换当前layout路由)
|
//删除路由(替换当前layout路由)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ let requests = [];
|
||||||
// HTTP request 拦截器
|
// HTTP request 拦截器
|
||||||
axios.interceptors.request.use(
|
axios.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
let token = tool.cookie.get("TOKEN")?tool.cookie.get("TOKEN"):tool.data.get("TOKEN");
|
let token = tool.data.get("TOKEN");
|
||||||
if(token){
|
if(token){
|
||||||
config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
|
config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
|
||||||
}
|
}
|
||||||
|
|
@ -47,49 +47,41 @@ axios.interceptors.response.use(
|
||||||
title: '请求失败',
|
title: '请求失败',
|
||||||
message: "账户密码错误或已禁用"
|
message: "账户密码错误或已禁用"
|
||||||
});
|
});
|
||||||
// if (!isRefreshing) {
|
|
||||||
// isRefreshing = true;
|
|
||||||
// axios({
|
|
||||||
// method: 'post',
|
|
||||||
// url: sysConfig.API_URL+'/auth/token/refresh/',
|
|
||||||
// headers: {
|
|
||||||
// Authorization: `Bearer ${tool.cookie.get("TOKEN")}`,
|
|
||||||
// },
|
|
||||||
// data:{refresh:tool.cookie.get("TOKEN_REFRESH")}
|
|
||||||
// }).then(res=>{
|
|
||||||
// debugger;
|
|
||||||
// console.log(res.data.access);
|
|
||||||
// // 替换本地的token
|
|
||||||
// tool.cookie.set("TOKEN", res.data.access);
|
|
||||||
// tool.data.set("TOKEN_TIME", new Date().getTime());
|
|
||||||
// error.config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + res.data.access;
|
|
||||||
// isRefreshing = false;
|
|
||||||
// requests.forEach(cb => cb())
|
|
||||||
// //发起后将requests置空
|
|
||||||
// requests=[];
|
|
||||||
// return axios(error.config)
|
|
||||||
// }).catch(()=>{
|
|
||||||
// // refresh_token 有值 , 但是过期了, 请求失败
|
|
||||||
// router.push('/login')
|
|
||||||
// })
|
|
||||||
|
|
||||||
// }else{
|
|
||||||
// //如果正在刷新token,将发起的请求暂存在requests中
|
|
||||||
// return new Promise((resolve)=>{
|
|
||||||
// requests.push(()=>{
|
|
||||||
// resolve(axios(error.config));
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
}else{
|
}else{
|
||||||
// ElMessageBox.confirm('当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。', '无权限访问', {
|
if (error.config.url.indexOf('auth/token/refresh/') != -1) {
|
||||||
// type: 'error',
|
isRefreshing = false;
|
||||||
// closeOnClickModal: false,
|
requests=[];
|
||||||
// center: true,
|
router.push('/login');
|
||||||
// confirmButtonText: '重新登录'
|
return
|
||||||
// }).then(() => {
|
}
|
||||||
router.replace({path: '/login'});
|
if (!isRefreshing) {
|
||||||
// }).catch(() => {})
|
isRefreshing = true;
|
||||||
|
axios({
|
||||||
|
method: 'post',
|
||||||
|
url: sysConfig.API_URL+'/auth/token/refresh/',
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${tool.data.get("TOKEN")}`,
|
||||||
|
},
|
||||||
|
data:{refresh:tool.data.get("TOKEN_REFRESH")}
|
||||||
|
}).then(res=>{
|
||||||
|
// 替换本地的token
|
||||||
|
tool.data.set("TOKEN", res.data.access);
|
||||||
|
tool.data.set("TOKEN_TIME", new Date().getTime());
|
||||||
|
error.config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + res.data.access;
|
||||||
|
isRefreshing = false;
|
||||||
|
requests.forEach(cb => cb())
|
||||||
|
//发起后将requests置空
|
||||||
|
requests=[];
|
||||||
|
return axios(error.config)
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
//如果正在刷新token,将发起的请求暂存在requests中
|
||||||
|
return new Promise((resolve)=>{
|
||||||
|
requests.push(()=>{
|
||||||
|
resolve(axios(error.config));
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,8 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" class="panel_item">
|
<el-col :span="12" class="panel_item">
|
||||||
<div class="panel_label"><img src="img/total_production.png"
|
<div class="panel_label"><img src="img/total_production.png"
|
||||||
style="height: 24px;vertical-align:middle;" />产品产量</div>
|
style="height: 24px;vertical-align:middle;" />产品产量
|
||||||
|
</div>
|
||||||
<div class="pannel_number">
|
<div class="pannel_number">
|
||||||
<span class="panel_value">{{ sectionData.total_production }}</span>
|
<span class="panel_value">{{ sectionData.total_production }}</span>
|
||||||
<span class="panel_unit">(t)</span>
|
<span class="panel_unit">(t)</span>
|
||||||
|
|
@ -76,7 +77,8 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="16" style="height: 72px;margin-top: 4px">
|
<el-row :gutter="16" style="height: 72px;margin-top: 4px">
|
||||||
<el-col :span="12" class="panel_item">
|
<el-col :span="12" class="panel_item">
|
||||||
<div class="panel_label"><img src="img/run_rate.png" style="height: 24px;vertical-align:middle;" /> 运转率</div>
|
<div class="panel_label"><img src="img/run_rate.png" style="height: 24px;vertical-align:middle;" /> 运转率
|
||||||
|
</div>
|
||||||
<div class="pannel_number">
|
<div class="pannel_number">
|
||||||
<span class="panel_value">{{ sectionData.run_rate }}</span>
|
<span class="panel_value">{{ sectionData.run_rate }}</span>
|
||||||
<span class="panel_unit">(%)</span>
|
<span class="panel_unit">(%)</span>
|
||||||
|
|
@ -402,11 +404,10 @@ export default {
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
var that = this
|
var that = this
|
||||||
// console.log(tool.cookie.get("TOKEN"))
|
|
||||||
if (typeof (WebSocket) === "undefined") {
|
if (typeof (WebSocket) === "undefined") {
|
||||||
alert("您的浏览器不支持socket")
|
alert("您的浏览器不支持socket")
|
||||||
} else {
|
} else {
|
||||||
this.ws = new WebSocket(this.path + tool.cookie.get("TOKEN"))
|
this.ws = new WebSocket(this.path + tool.data.get("TOKEN"))
|
||||||
//监听是否连接成功
|
//监听是否连接成功
|
||||||
this.ws.onopen = () => {
|
this.ws.onopen = () => {
|
||||||
// console.log("socket连接成功");
|
// console.log("socket连接成功");
|
||||||
|
|
|
||||||
|
|
@ -8,63 +8,75 @@
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-card header="产量及完成度" style="border-radius: 5px;box-shadow: none;">
|
<el-card header="产量及完成度" style="border-radius: 5px;box-shadow: none;">
|
||||||
<div class="itemsWrap">
|
<div class="itemsWrap">
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.total_production }}</div>
|
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.total_production
|
||||||
|
}}</div>
|
||||||
<div class="item-name">月电石渣产量</div>
|
<div class="item-name">月电石渣产量</div>
|
||||||
<el-progress :percentage="90" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="90" :text-inside="true" :stroke-width="14">
|
||||||
<span class="item-percent">90%</span>
|
<span class="item-percent">90%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.total_production }}</div>
|
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.total_production
|
||||||
|
}}</div>
|
||||||
<div class="item-name">月生料产量</div>
|
<div class="item-name">月生料产量</div>
|
||||||
<el-progress :percentage="95" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="95" :text-inside="true" :stroke-width="14">
|
||||||
<span class="item-percent">95%</span>
|
<span class="item-percent">95%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.total_production }}</div>
|
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.total_production
|
||||||
|
}}</div>
|
||||||
<div class="item-name">月熟料产量</div>
|
<div class="item-name">月熟料产量</div>
|
||||||
<el-progress :percentage="98" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="98" :text-inside="true" :stroke-width="14">
|
||||||
<span class="item-percent">98%</span>
|
<span class="item-percent">98%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.total_production }}</div>
|
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.total_production
|
||||||
|
}}</div>
|
||||||
<div class="item-name">月水泥产量</div>
|
<div class="item-name">月水泥产量</div>
|
||||||
<el-progress :percentage="95" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="95" :text-inside="true" :stroke-width="14">
|
||||||
<span class="item-percent">95%</span>
|
<span class="item-percent">95%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.电石渣">{{ yearData.电石渣.total_production }}</div>
|
<div class="item-number" v-if="yearData.电石渣">{{
|
||||||
|
yearData.电石渣.total_production }}</div>
|
||||||
<div class="item-name">本年累计电石渣产量</div>
|
<div class="item-name">本年累计电石渣产量</div>
|
||||||
<el-progress :percentage="75" status="success" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="75" status="success" :text-inside="true"
|
||||||
|
:stroke-width="14">
|
||||||
<span class="item-percent">75%</span>
|
<span class="item-percent">75%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.原料磨">{{ yearData.原料磨.total_production }}</div>
|
<div class="item-number" v-if="yearData.原料磨">{{
|
||||||
|
yearData.原料磨.total_production }}</div>
|
||||||
<div class="item-name">本年累计生料产量</div>
|
<div class="item-name">本年累计生料产量</div>
|
||||||
<el-progress :percentage="70" status="success" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="70" status="success" :text-inside="true"
|
||||||
|
:stroke-width="14">
|
||||||
<span class="item-percent">70%</span>
|
<span class="item-percent">70%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.total_production }}</div>
|
<div class="item-number" v-if="yearData.回转窑">{{
|
||||||
|
yearData.回转窑.total_production }}</div>
|
||||||
<div class="item-name">本年累计熟料产量</div>
|
<div class="item-name">本年累计熟料产量</div>
|
||||||
<el-progress :percentage="80" status="success" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="80" status="success" :text-inside="true"
|
||||||
|
:stroke-width="14">
|
||||||
<span class="item-percent">80%</span>
|
<span class="item-percent">80%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.水泥磨">{{ yearData.水泥磨.total_production }}</div>
|
<div class="item-number" v-if="yearData.水泥磨">{{
|
||||||
|
yearData.水泥磨.total_production }}</div>
|
||||||
<div class="item-name">本年累计水泥产量</div>
|
<div class="item-name">本年累计水泥产量</div>
|
||||||
<el-progress :percentage="75" status="success" :text-inside="true" :stroke-width="14">
|
<el-progress :percentage="75" status="success" :text-inside="true"
|
||||||
|
:stroke-width="14">
|
||||||
<span class="item-percent">75%</span>
|
<span class="item-percent">75%</span>
|
||||||
</el-progress>
|
</el-progress>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
@ -72,76 +84,92 @@
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-card header="能耗" style="border-radius: 5px;box-shadow: none;">
|
<el-card header="能耗" style="border-radius: 5px;box-shadow: none;">
|
||||||
<div class="itemsWrap">
|
<div class="itemsWrap">
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.elec_consume_unit }}</div>
|
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.elec_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">月电石渣分布电耗</div>
|
<div class="item-name">月电石渣分布电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.elec_consume_unit }}</div>
|
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.elec_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">月生料分布电耗</div>
|
<div class="item-name">月生料分布电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.elec_consume_unit }}</div>
|
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.elec_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">月熟料分布电耗</div>
|
<div class="item-name">月熟料分布电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.coal_consume_unit }}</div>
|
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.coal_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">熟料月单位标煤耗</div>
|
<div class="item-name">熟料月单位标煤耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.celec_consume_unit }}</div>
|
<div class="item-number" v-if="monthData.回转窑">{{
|
||||||
<div class="item-name">熟料月综合电耗</div>
|
monthData.回转窑.celec_consume_unit }}</div>
|
||||||
</div>
|
<div class="item-name">熟料月综合电耗</div>
|
||||||
|
</div>
|
||||||
<div class="items" >
|
|
||||||
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.cen_consume_unit }}</div>
|
<div class="items">
|
||||||
<div class="item-name">熟料月综合能耗</div>
|
<div class="item-number" v-if="monthData.回转窑">{{
|
||||||
</div>
|
monthData.回转窑.cen_consume_unit }}</div>
|
||||||
<div class="items" >
|
<div class="item-name">熟料月综合能耗</div>
|
||||||
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.elec_consume_unit }}</div>
|
</div>
|
||||||
<div class="item-name">月水泥粉磨分布电耗</div>
|
<div class="items">
|
||||||
</div>
|
<div class="item-number" v-if="monthData.水泥磨">{{
|
||||||
<div class="items" >
|
monthData.水泥磨.elec_consume_unit }}</div>
|
||||||
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.cen_consume_unit }}</div>
|
<div class="item-name">月水泥粉磨分布电耗</div>
|
||||||
<div class="item-name">水泥月综合能耗</div>
|
</div>
|
||||||
</div>
|
<div class="items">
|
||||||
|
<div class="item-number" v-if="monthData.水泥磨">{{
|
||||||
|
monthData.水泥磨.cen_consume_unit }}</div>
|
||||||
|
<div class="item-name">水泥月综合能耗</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="itemsWrap">
|
<div class="itemsWrap">
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.电石渣">{{ yearData.电石渣.elec_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.电石渣">{{ yearData.电石渣.elec_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">本年度电石渣分布电耗</div>
|
<div class="item-name">本年度电石渣分布电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.原料磨">{{ yearData.原料磨.elec_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.原料磨">{{ yearData.原料磨.elec_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">本年度生料分布电耗</div>
|
<div class="item-name">本年度生料分布电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.elec_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.elec_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">本年度熟料分布电耗</div>
|
<div class="item-name">本年度熟料分布电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.coal_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.coal_consume_unit
|
||||||
|
}}</div>
|
||||||
<div class="item-name">本年度熟料单位标煤耗</div>
|
<div class="item-name">本年度熟料单位标煤耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.celec_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.回转窑">{{
|
||||||
|
yearData.回转窑.celec_consume_unit }}</div>
|
||||||
<div class="item-name">本年度熟料综合电耗</div>
|
<div class="item-name">本年度熟料综合电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.cen_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.回转窑">{{
|
||||||
|
yearData.回转窑.cen_consume_unit }}</div>
|
||||||
<div class="item-name">本年度熟料综合能耗</div>
|
<div class="item-name">本年度熟料综合能耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.水泥磨">{{ yearData.水泥磨.elec_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.水泥磨">{{
|
||||||
|
yearData.水泥磨.elec_consume_unit }}</div>
|
||||||
<div class="item-name">本年度水泥粉磨分布电耗</div>
|
<div class="item-name">本年度水泥粉磨分布电耗</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="yearData.水泥磨">{{ yearData.水泥磨.cen_consume_unit }}</div>
|
<div class="item-number" v-if="yearData.水泥磨">{{
|
||||||
|
yearData.水泥磨.cen_consume_unit }}</div>
|
||||||
<div class="item-name">本年度水泥综合能耗</div>
|
<div class="item-name">本年度水泥综合能耗</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
@ -150,21 +178,25 @@
|
||||||
<el-card header="成本统计" style="border-radius: 5px;box-shadow: none;">
|
<el-card header="成本统计" style="border-radius: 5px;box-shadow: none;">
|
||||||
<div class="itemsWrap">
|
<div class="itemsWrap">
|
||||||
<div class="items">
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.production_cost_unit }}</div>
|
<div class="item-number" v-if="monthData.电石渣">{{
|
||||||
|
monthData.电石渣.production_cost_unit }}</div>
|
||||||
<div class="item-name">月电石渣成本</div>
|
<div class="item-name">月电石渣成本</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.production_cost_unit }}</div>
|
<div class="item-number" v-if="monthData.原料磨">{{
|
||||||
|
monthData.原料磨.production_cost_unit }}</div>
|
||||||
<div class="item-name">月生料成本</div>
|
<div class="item-name">月生料成本</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.production_cost_unit }}</div>
|
<div class="item-number" v-if="monthData.回转窑">{{
|
||||||
|
monthData.回转窑.production_cost_unit }}</div>
|
||||||
<div class="item-name">月熟料成本</div>
|
<div class="item-name">月熟料成本</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="items" >
|
<div class="items">
|
||||||
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.production_cost_unit }}</div>
|
<div class="item-number" v-if="monthData.水泥磨">{{
|
||||||
|
monthData.水泥磨.production_cost_unit }}</div>
|
||||||
<div class="item-name">月水泥成本</div>
|
<div class="item-name">月水泥成本</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -173,12 +205,12 @@
|
||||||
<el-badge :value="warningNum" :max="99" style="margin: 10px;">
|
<el-badge :value="warningNum" :max="99" style="margin: 10px;">
|
||||||
<div class="items" style="margin:0;" @click="interEvent">
|
<div class="items" style="margin:0;" @click="interEvent">
|
||||||
<div class="item-number">能耗超标报警</div>
|
<div class="item-number">能耗超标报警</div>
|
||||||
</div>
|
</div>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
<el-badge :value="warningNum2" :max="99" style="margin: 10px;">
|
<el-badge :value="warningNum2" :max="99" style="margin: 10px;">
|
||||||
<div class="items" style="margin:0" @click="interEquipment">
|
<div class="items" style="margin:0" @click="interEquipment">
|
||||||
<div class="item-number">设备检验</div>
|
<div class="item-number">设备检验</div>
|
||||||
</div>
|
</div>
|
||||||
</el-badge>
|
</el-badge>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -189,216 +221,225 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
time: '',
|
time: '',
|
||||||
day: '',
|
day: '',
|
||||||
year_s:'',
|
year_s: '',
|
||||||
month_s:'',
|
month_s: '',
|
||||||
yearData:[],
|
yearData: [],
|
||||||
monthData:[],
|
monthData: [],
|
||||||
warningNum:0,
|
warningNum: 0,
|
||||||
warningNum2:0,
|
warningNum2: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$emit('on-mounted');
|
||||||
|
let that = this;
|
||||||
|
var myDate = new Date();
|
||||||
|
let year = myDate.getFullYear();
|
||||||
|
let month = myDate.getMonth() + 1;
|
||||||
|
that.year_s = year;
|
||||||
|
that.month_s = month;
|
||||||
|
that.getYearData();
|
||||||
|
that.getMonthData();
|
||||||
|
that.getWraningNum();
|
||||||
|
// this.showTime();
|
||||||
|
// setInterval(()=>{
|
||||||
|
// this.showTime()
|
||||||
|
// },1000)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 动态绑定Class
|
||||||
|
bindClass(type) {
|
||||||
|
let classInfo = {
|
||||||
|
socketDom: true, redColor: false,
|
||||||
|
orangeColor: false, yellowColor: false, blueColor: true
|
||||||
|
}
|
||||||
|
if (type == '') {
|
||||||
|
classInfo.redColor = true
|
||||||
|
}
|
||||||
|
return classInfo
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
var that = this
|
||||||
|
if (typeof (WebSocket) === "undefined") {
|
||||||
|
alert("您的浏览器不支持socket")
|
||||||
|
} else {
|
||||||
|
this.ws = new WebSocket(this.path + tool.data.get("TOKEN"))
|
||||||
|
//监听是否连接成功
|
||||||
|
this.ws.onopen = () => {
|
||||||
|
// console.log("socket连接成功");
|
||||||
|
setTimeout(() => {
|
||||||
|
that.ws.send(JSON.stringify({ 'type': 'event' }))
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
|
||||||
|
//接听服务器发回的信息并处理展示
|
||||||
|
this.ws.onmessage = (msg) => {
|
||||||
|
let data = JSON.parse(msg.data)
|
||||||
|
console.log(data)
|
||||||
|
that.getWraningNum();
|
||||||
|
// if(data.type=='event'){
|
||||||
|
// that.bindClass();
|
||||||
|
// }if(data.type=='ticket'){
|
||||||
|
|
||||||
|
// }if(data.type=='remaind'){
|
||||||
|
|
||||||
|
// }
|
||||||
|
};
|
||||||
|
// 监听并处理error事件
|
||||||
|
this.ws.onerror = function (error) {
|
||||||
|
console.log('ws断开,尝试重连')
|
||||||
|
setTimeout(() => {
|
||||||
|
this.ws = null;
|
||||||
|
this.init()
|
||||||
|
}, 5000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
getMessage(msg) {
|
||||||
this.$emit('on-mounted');
|
|
||||||
let that = this;
|
|
||||||
var myDate = new Date();
|
|
||||||
let year = myDate.getFullYear();
|
|
||||||
let month = myDate.getMonth()+1;
|
|
||||||
that.year_s = year;
|
|
||||||
that.month_s = month;
|
|
||||||
that.getYearData();
|
|
||||||
that.getMonthData();
|
|
||||||
that.getWraningNum();
|
|
||||||
// this.showTime();
|
|
||||||
// setInterval(()=>{
|
|
||||||
// this.showTime()
|
|
||||||
// },1000)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 动态绑定Class
|
|
||||||
bindClass(type){
|
|
||||||
let classInfo = { socketDom: true, redColor: false,
|
|
||||||
orangeColor:false, yellowColor:false, blueColor:true }
|
|
||||||
if(type==''){
|
|
||||||
classInfo.redColor = true
|
|
||||||
}
|
|
||||||
return classInfo
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
var that = this
|
|
||||||
// console.log(tool.cookie.get("TOKEN"))
|
|
||||||
if(typeof(WebSocket) === "undefined"){
|
|
||||||
alert("您的浏览器不支持socket")
|
|
||||||
}else{
|
|
||||||
this.ws = new WebSocket(this.path+tool.cookie.get("TOKEN"))
|
|
||||||
//监听是否连接成功
|
|
||||||
this.ws.onopen = ()=> {
|
|
||||||
// console.log("socket连接成功");
|
|
||||||
setTimeout(()=>{
|
|
||||||
that.ws.send(JSON.stringify({'type': 'event'}))
|
|
||||||
},500)
|
|
||||||
}
|
|
||||||
|
|
||||||
//接听服务器发回的信息并处理展示
|
|
||||||
this.ws.onmessage = (msg)=>{
|
|
||||||
let data = JSON.parse(msg.data)
|
|
||||||
console.log(data)
|
|
||||||
that.getWraningNum();
|
|
||||||
// if(data.type=='event'){
|
|
||||||
// that.bindClass();
|
|
||||||
// }if(data.type=='ticket'){
|
|
||||||
|
|
||||||
// }if(data.type=='remaind'){
|
|
||||||
|
|
||||||
// }
|
|
||||||
};
|
|
||||||
// 监听并处理error事件
|
|
||||||
this.ws.onerror = function(error) {
|
|
||||||
console.log('ws断开,尝试重连')
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.ws = null;
|
|
||||||
this.init()
|
|
||||||
}, 5000)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getMessage(msg) {
|
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
if (this.ws) {
|
if (this.ws) {
|
||||||
this.ws.close();
|
this.ws.close();
|
||||||
this.ws = null;
|
this.ws = null;
|
||||||
console.log("socket已经关闭");
|
console.log("socket已经关闭");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//获取报警事件数量
|
//获取报警事件数量
|
||||||
getWraningNum(){
|
getWraningNum() {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$API.ecm.event.list.req({cates__code__in:'consume_exceed',is_handled:0,page:1}).then((res) => {
|
that.$API.ecm.event.list.req({ cates__code__in: 'consume_exceed', is_handled: 0, page: 1 }).then((res) => {
|
||||||
that.warningNum = res.count;
|
that.warningNum = res.count;
|
||||||
})
|
})
|
||||||
that.$API.em.equipment.list.req({tag:'near_check',type:20,page:1}).then((res) => {
|
that.$API.em.equipment.list.req({ tag: 'near_check', type: 20, page: 1 }).then((res) => {
|
||||||
debugger;
|
debugger;
|
||||||
that.warningNum2 = res.count;
|
that.warningNum2 = res.count;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getYearData(){
|
getYearData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.year_s = this.year_s;
|
obj.year_s = this.year_s;
|
||||||
obj.type = 'year_s';
|
obj.type = 'year_s';
|
||||||
obj.page = 0;
|
obj.page = 0;
|
||||||
this.$API.enm.enstat.req(obj).then((res) => {
|
this.$API.enm.enstat.req(obj).then((res) => {
|
||||||
let yearData = {};
|
let yearData = {};
|
||||||
res.forEach(item => {
|
res.forEach(item => {
|
||||||
let label = item.mgroup_name;
|
let label = item.mgroup_name;
|
||||||
yearData[label] = item;
|
yearData[label] = item;
|
||||||
});
|
});
|
||||||
that.yearData = yearData;
|
that.yearData = yearData;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getMonthData(){
|
getMonthData() {
|
||||||
let that = this;
|
let that = this;
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.year_s = this.year_s;
|
obj.year_s = this.year_s;
|
||||||
obj.month_s = this.month_s;
|
obj.month_s = this.month_s;
|
||||||
obj.type = 'month_s';
|
obj.type = 'month_s';
|
||||||
obj.page = 0;
|
obj.page = 0;
|
||||||
that.$API.enm.enstat.req(obj).then((res) => {
|
that.$API.enm.enstat.req(obj).then((res) => {
|
||||||
let monthData = {};
|
let monthData = {};
|
||||||
res.forEach(item => {
|
res.forEach(item => {
|
||||||
let label = item.mgroup_name;
|
let label = item.mgroup_name;
|
||||||
monthData[label] = item;
|
monthData[label] = item;
|
||||||
});
|
});
|
||||||
that.monthData = monthData;
|
that.monthData = monthData;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
showTime(){
|
showTime() {
|
||||||
this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss')
|
this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss')
|
||||||
this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日')
|
this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日')
|
||||||
},
|
},
|
||||||
interEvent(){
|
interEvent() {
|
||||||
this.$router.replace({path:'/events'})
|
this.$router.replace({ path: '/events' })
|
||||||
},
|
},
|
||||||
interEquipment(){
|
interEquipment() {
|
||||||
this.$router.replace({path:'/em/equipmentc'})
|
this.$router.replace({ path: '/em/equipmentc' })
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.items{
|
.items {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border: 1px solid #cccccc;
|
border: 1px solid #cccccc;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
box-shadow: 0 0 10px 6px #eeeeee57;
|
box-shadow: 0 0 10px 6px #eeeeee57;
|
||||||
}
|
}
|
||||||
.item-number{
|
|
||||||
font-weight: 600;
|
.item-number {
|
||||||
font-size: 24px;
|
font-weight: 600;
|
||||||
color: #1e2126;
|
font-size: 24px;
|
||||||
letter-spacing: .1px;
|
color: #1e2126;
|
||||||
text-align: left;
|
letter-spacing: .1px;
|
||||||
line-height: 36px;
|
text-align: left;
|
||||||
}
|
line-height: 36px;
|
||||||
.item-name{
|
}
|
||||||
font-size: 14px;
|
|
||||||
color: #4e5b71;
|
.item-name {
|
||||||
letter-spacing: .1px;
|
font-size: 14px;
|
||||||
text-align: left;
|
color: #4e5b71;
|
||||||
line-height: 20px;
|
letter-spacing: .1px;
|
||||||
}
|
text-align: left;
|
||||||
.item-percent{
|
line-height: 20px;
|
||||||
font-size: 12px;
|
}
|
||||||
color: #ffffff;
|
|
||||||
letter-spacing: .08px;
|
.item-percent {
|
||||||
text-align: left;
|
font-size: 12px;
|
||||||
line-height: 12px;
|
color: #ffffff;
|
||||||
}
|
letter-spacing: .08px;
|
||||||
.socketDom{
|
text-align: left;
|
||||||
position: absolute;
|
line-height: 12px;
|
||||||
top: 10vh;
|
}
|
||||||
left: 50%;
|
|
||||||
font-size: 20px;
|
.socketDom {
|
||||||
font-weight:bold;
|
position: absolute;
|
||||||
transform: translateX(-50%);
|
top: 10vh;
|
||||||
z-index: 101;
|
left: 50%;
|
||||||
color: #ffffff;
|
font-size: 20px;
|
||||||
border: 1px solid #99fffe;
|
font-weight: bold;
|
||||||
background: rgba(11, 101, 140, 0.451);
|
transform: translateX(-50%);
|
||||||
padding: 10px 20px;
|
z-index: 101;
|
||||||
border-radius: 5px;
|
color: #ffffff;
|
||||||
|
border: 1px solid #99fffe;
|
||||||
|
background: rgba(11, 101, 140, 0.451);
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
}
|
}
|
||||||
.redColor{
|
|
||||||
color: red;
|
.redColor {
|
||||||
border: 1px solid red;
|
color: red;
|
||||||
background: rgba(255, 0, 0, 0.2);
|
border: 1px solid red;
|
||||||
|
background: rgba(255, 0, 0, 0.2);
|
||||||
}
|
}
|
||||||
.orangeColor{
|
|
||||||
color: orange;
|
.orangeColor {
|
||||||
border: 1px solid orange;
|
color: orange;
|
||||||
background: rgba(255,165,0,.2);
|
border: 1px solid orange;
|
||||||
|
background: rgba(255, 165, 0, .2);
|
||||||
}
|
}
|
||||||
.yellowColor{
|
|
||||||
color: yellow;
|
.yellowColor {
|
||||||
background: rgba(255,255,0,.2);
|
color: yellow;
|
||||||
border: 1px solid yellow;
|
background: rgba(255, 255, 0, .2);
|
||||||
|
border: 1px solid yellow;
|
||||||
}
|
}
|
||||||
.blueColor{
|
|
||||||
color: #2378f7;
|
.blueColor {
|
||||||
background: rgb(35, 120, 247,.2);
|
color: #2378f7;
|
||||||
border: 1px solid #2378f7;
|
background: rgb(35, 120, 247, .2);
|
||||||
|
border: 1px solid #2378f7;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" style="width: 100%" :loading="islogin" round @click="login">{{ $t("login.signIn")
|
<el-button type="primary" style="width: 100%" :loading="islogin" round @click="login">{{ $t("login.signIn")
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<!-- <div class="login-reg">
|
<!-- <div class="login-reg">
|
||||||
|
|
@ -62,6 +62,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
redirect: undefined,
|
||||||
userType: "admin",
|
userType: "admin",
|
||||||
visitorsdialog: false,
|
visitorsdialog: false,
|
||||||
visitorform: {},
|
visitorform: {},
|
||||||
|
|
@ -99,6 +100,12 @@ export default {
|
||||||
this.form.password = "user";
|
this.form.password = "user";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
$route: {
|
||||||
|
handler: function (route) {
|
||||||
|
this.redirect = route.query && route.query.redirect;
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() { },
|
mounted() { },
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -117,19 +124,19 @@ export default {
|
||||||
//获取token
|
//获取token
|
||||||
try {
|
try {
|
||||||
var res = await that.$API.auth.token.post(data);
|
var res = await that.$API.auth.token.post(data);
|
||||||
that.$TOOL.cookie.set("TOKEN", res.access, {
|
|
||||||
expires: that.form.autologin ? 24 * 60 * 60 : 0,
|
|
||||||
});
|
|
||||||
that.$TOOL.data.set("TOKEN", res.access);
|
that.$TOOL.data.set("TOKEN", res.access);
|
||||||
that.$TOOL.data.set("TOKEN_REFRESH", res.refresh);
|
that.$TOOL.data.set("TOKEN_REFRESH", res.refresh);
|
||||||
that.$TOOL.cookie.set("TOKEN_REFRESH", res.refresh);
|
|
||||||
that.$TOOL.data.set("TOKEN_TIME", new Date().getTime());
|
that.$TOOL.data.set("TOKEN_TIME", new Date().getTime());
|
||||||
try {
|
try {
|
||||||
var res1 = await that.$API.auth.info.get();
|
var res1 = await that.$API.auth.info.get();
|
||||||
that.$TOOL.data.set("USER_INFO", res1);
|
that.$TOOL.data.set("USER_INFO", res1);
|
||||||
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
|
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
|
||||||
|
|
||||||
let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
|
let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
|
||||||
if (base_dashboard == null || base_dashboard == undefined) {
|
if (this.redirect) {
|
||||||
|
base_dashboard = this.redirect;
|
||||||
|
}
|
||||||
|
else if (base_dashboard == null || base_dashboard == undefined) {
|
||||||
base_dashboard = '/dashboard'
|
base_dashboard = '/dashboard'
|
||||||
}
|
}
|
||||||
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
|
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
|
||||||
|
|
@ -157,31 +164,6 @@ export default {
|
||||||
path: base_dashboard,
|
path: base_dashboard,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// if(this.$TOOL.data.get('BASE_INFO').base.base_name_short=='托克逊能管'){//托克逊
|
|
||||||
// this.$router.replace({
|
|
||||||
// path: "/dashboard_enm",
|
|
||||||
// });
|
|
||||||
// }else{//曲阳金隅
|
|
||||||
// that.$API.am.area.list.req({page_size:999}).then(res => {
|
|
||||||
// if (res.err_msg) {
|
|
||||||
// } else {
|
|
||||||
// debugger;
|
|
||||||
// let areaList = res.results;
|
|
||||||
// that.$TOOL.data.set("qyjyAreaList", areaList);
|
|
||||||
// if(res1.type==='employee'){
|
|
||||||
// this.$router.replace({
|
|
||||||
// path: "/",
|
|
||||||
// });
|
|
||||||
// }else{
|
|
||||||
// this.$router.replace({
|
|
||||||
// path: "/rpm/rpj",
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// that.$message.success("Login Success 登录成功");
|
|
||||||
// that.islogin = false;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
that.islogin = false;
|
that.islogin = false;
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
@ -192,52 +174,6 @@ export default {
|
||||||
} finally {
|
} finally {
|
||||||
that.islogin = false;
|
that.islogin = false;
|
||||||
}
|
}
|
||||||
// var res = await this.$API.auth.token.post(data)
|
|
||||||
// console.log(res, err)
|
|
||||||
// if(!res){
|
|
||||||
// this.islogin = false
|
|
||||||
// this.$message.warning(res.err_msg)
|
|
||||||
// return false
|
|
||||||
// }else{
|
|
||||||
// this.$TOOL.cookie.set("TOKEN", res.token, {
|
|
||||||
// expires: this.form.autologin? 24*60*60 : 0
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// if(user.code == 200){
|
|
||||||
|
|
||||||
// this.$TOOL.data.set("USER_INFO", user.data.userInfo)
|
|
||||||
// }else{
|
|
||||||
|
|
||||||
// }
|
|
||||||
//获取菜单
|
|
||||||
// var menu = null
|
|
||||||
// if(this.form.user == 'admin'){
|
|
||||||
// menu = await this.$API.system.menu.myMenus.get()
|
|
||||||
// }else{
|
|
||||||
// menu = await this.$API.demo.menu.get()
|
|
||||||
// }
|
|
||||||
// if(menu.code == 200){
|
|
||||||
// if(menu.data.menu.length==0){
|
|
||||||
// this.islogin = false
|
|
||||||
// this.$alert("当前用户无任何菜单权限,请联系系统管理员", "无权限访问", {
|
|
||||||
// type: 'error',
|
|
||||||
// center: true
|
|
||||||
// })
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
// this.$TOOL.data.set("MENU", menu.data.menu)
|
|
||||||
// this.$TOOL.data.set("PERMISSIONS", menu.data.permissions)
|
|
||||||
// }else{
|
|
||||||
// this.islogin = false
|
|
||||||
// this.$message.warning(menu.message)
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
|
|
||||||
// this.$router.replace({
|
|
||||||
// path: '/'
|
|
||||||
// })
|
|
||||||
// this.$message.success("Login Success 登录成功")
|
|
||||||
// this.islogin = false
|
|
||||||
},
|
},
|
||||||
visitors() {
|
visitors() {
|
||||||
this.visitorsdialog = true;
|
this.visitorsdialog = true;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn')
|
<el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <div class="login-reg">
|
<!-- <div class="login-reg">
|
||||||
{{$t('login.noAccount')}} <router-link to="/user_register">{{$t('login.createAccount')}}</router-link>
|
{{$t('login.noAccount')}} <router-link to="/user_register">{{$t('login.createAccount')}}</router-link>
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
redirect: undefined,
|
||||||
form: {
|
form: {
|
||||||
phone: "",
|
phone: "",
|
||||||
code: "",
|
code: "",
|
||||||
|
|
@ -58,6 +59,14 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route: {
|
||||||
|
handler: function (route) {
|
||||||
|
this.redirect = route.query && route.query.redirect;
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getYzm() {
|
async getYzm() {
|
||||||
|
|
@ -86,18 +95,17 @@ export default {
|
||||||
this.$refs.loginForm.validate(async (valid) => {
|
this.$refs.loginForm.validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$API.auth.login_sms_code.req(that.form).then(res => {
|
this.$API.auth.login_sms_code.req(that.form).then(res => {
|
||||||
that.$TOOL.cookie.set("TOKEN", res.access, {
|
|
||||||
expires: that.form.autologin ? 24 * 60 * 60 : 0,
|
|
||||||
});
|
|
||||||
that.$TOOL.data.set("TOKEN", res.access);
|
that.$TOOL.data.set("TOKEN", res.access);
|
||||||
that.$TOOL.data.set("TOKEN_REFRESH", res.refresh);
|
that.$TOOL.data.set("TOKEN_REFRESH", res.refresh);
|
||||||
that.$TOOL.cookie.set("TOKEN_REFRESH", res.refresh);
|
|
||||||
that.$TOOL.data.set("TOKEN_TIME", new Date().getTime());
|
that.$TOOL.data.set("TOKEN_TIME", new Date().getTime());
|
||||||
that.$API.auth.info.get().then(res1 => {
|
that.$API.auth.info.get().then(res1 => {
|
||||||
that.$TOOL.data.set("USER_INFO", res1);
|
that.$TOOL.data.set("USER_INFO", res1);
|
||||||
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
|
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
|
||||||
let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
|
let base_dashboard = this.$TOOL.data.get('BASE_INFO').base.base_dashboard;
|
||||||
if (base_dashboard == null || base_dashboard == undefined) {
|
if (this.redirect) {
|
||||||
|
base_dashboard = this.redirect;
|
||||||
|
}
|
||||||
|
else if (base_dashboard == null || base_dashboard == undefined) {
|
||||||
base_dashboard = '/dashboard'
|
base_dashboard = '/dashboard'
|
||||||
}
|
}
|
||||||
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
|
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
this.$TOOL.cookie.remove("TOKEN")
|
this.$TOOL.data.remove("TOKEN")
|
||||||
|
this.$TOOL.data.remove("TOKEN_TIME")
|
||||||
|
this.$TOOL.data.remove("TOKEN_REFRESH")
|
||||||
this.$TOOL.data.remove("USER_INFO")
|
this.$TOOL.data.remove("USER_INFO")
|
||||||
this.$TOOL.data.remove("MENU")
|
this.$TOOL.data.remove("MENU")
|
||||||
this.$TOOL.data.remove("PERMISSIONS")
|
this.$TOOL.data.remove("PERMISSIONS")
|
||||||
|
|
|
||||||
|
|
@ -776,8 +776,15 @@ export default {
|
||||||
this.$API.em.equipment.cquery.req({
|
this.$API.em.equipment.cquery.req({
|
||||||
page: 0,
|
page: 0,
|
||||||
querys: [
|
querys: [
|
||||||
[{ field: 'name', compare: 'contains', value: '单坩埚熔化炉' }],
|
[{ field: 'name', compare: 'contains', value: '单坩埚熔化炉' }]
|
||||||
[{ field: 'name', compare: 'contains', value: '单坩埚熔化炉' }],
|
]
|
||||||
|
}).then(res => {
|
||||||
|
this.equipmentOptions1 = res;
|
||||||
|
})
|
||||||
|
this.$API.em.equipment.cquery.req({
|
||||||
|
page: 0,
|
||||||
|
querys: [
|
||||||
|
[{ field: 'name', compare: 'contains', value: '电阻炉' }],
|
||||||
[{ field: 'name', compare: 'contains', value: '升降式退火炉' }]
|
[{ field: 'name', compare: 'contains', value: '升降式退火炉' }]
|
||||||
]
|
]
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue