This commit is contained in:
shijing 2024-03-11 16:32:10 +08:00
commit 47b34cf175
9 changed files with 391 additions and 405 deletions

View File

@ -165,9 +165,8 @@ export default {
confirmButtonClass: "el-button--danger",
})
.then(() => {
this.$router.replace({ path: "/login" }).then(() => {
location.reload();
});
this.$TOOL.data.remove("TOKEN")
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
})
.catch(() => {
//退

View File

@ -36,7 +36,7 @@ router.beforeEach(async (to, from, next) => {
//动态标题
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") {
//删除路由(替换当前layout路由)

View File

@ -15,7 +15,7 @@ let requests = [];
// HTTP request 拦截器
axios.interceptors.request.use(
(config) => {
let token = tool.cookie.get("TOKEN")?tool.cookie.get("TOKEN"):tool.data.get("TOKEN");
let token = tool.data.get("TOKEN");
if(token){
config.headers[sysConfig.TOKEN_NAME] = sysConfig.TOKEN_PREFIX + token
}
@ -47,49 +47,41 @@ axios.interceptors.response.use(
title: '请求失败',
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{
// ElMessageBox.confirm('当前用户已被登出或无权限访问当前资源,请尝试重新登录后再操作。', '无权限访问', {
// type: 'error',
// closeOnClickModal: false,
// center: true,
// confirmButtonText: '重新登录'
// }).then(() => {
router.replace({path: '/login'});
// }).catch(() => {})
if (error.config.url.indexOf('auth/token/refresh/') != -1) {
isRefreshing = false;
requests=[];
router.push('/login');
return
}
if (!isRefreshing) {
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 {

View File

@ -67,7 +67,8 @@
</el-col>
<el-col :span="12" class="panel_item">
<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">
<span class="panel_value">{{ sectionData.total_production }}</span>
<span class="panel_unit">(t)</span>
@ -76,7 +77,8 @@
</el-row>
<el-row :gutter="16" style="height: 72px;margin-top: 4px">
<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">
<span class="panel_value">{{ sectionData.run_rate }}</span>
<span class="panel_unit">(%)</span>
@ -402,11 +404,10 @@ export default {
},
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 = new WebSocket(this.path + tool.data.get("TOKEN"))
//
this.ws.onopen = () => {
// console.log("socket");

View File

@ -8,60 +8,72 @@
<el-col>
<el-card header="产量及完成度" style="border-radius: 5px;box-shadow: none;">
<div class="itemsWrap">
<div class="items" >
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.total_production }}</div>
<div class="items">
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.total_production
}}</div>
<div class="item-name">月电石渣产量</div>
<el-progress :percentage="90" :text-inside="true" :stroke-width="14">
<span class="item-percent">90%</span>
</el-progress>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.total_production }}</div>
<div class="items">
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.total_production
}}</div>
<div class="item-name">月生料产量</div>
<el-progress :percentage="95" :text-inside="true" :stroke-width="14">
<span class="item-percent">95%</span>
</el-progress>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.total_production }}</div>
<div class="items">
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.total_production
}}</div>
<div class="item-name">月熟料产量</div>
<el-progress :percentage="98" :text-inside="true" :stroke-width="14">
<span class="item-percent">98%</span>
</el-progress>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.total_production }}</div>
<div class="items">
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.total_production
}}</div>
<div class="item-name">月水泥产量</div>
<el-progress :percentage="95" :text-inside="true" :stroke-width="14">
<span class="item-percent">95%</span>
</el-progress>
</div>
<div style="display: inline-block;">
<div class="items" >
<div class="item-number" v-if="yearData.电石渣">{{ yearData.电石渣.total_production }}</div>
<div class="items">
<div class="item-number" v-if="yearData.电石渣">{{
yearData.电石渣.total_production }}</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>
</el-progress>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.原料磨">{{ yearData.原料磨.total_production }}</div>
<div class="items">
<div class="item-number" v-if="yearData.原料磨">{{
yearData.原料磨.total_production }}</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>
</el-progress>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.total_production }}</div>
<div class="items">
<div class="item-number" v-if="yearData.回转窑">{{
yearData.回转窑.total_production }}</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>
</el-progress>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.水泥磨">{{ yearData.水泥磨.total_production }}</div>
<div class="items">
<div class="item-number" v-if="yearData.水泥磨">{{
yearData.水泥磨.total_production }}</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>
</el-progress>
</div>
@ -72,74 +84,90 @@
<el-col>
<el-card header="能耗" style="border-radius: 5px;box-shadow: none;">
<div class="itemsWrap">
<div class="items" >
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.电石渣">{{ monthData.电石渣.elec_consume_unit
}}</div>
<div class="item-name">月电石渣分布电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.elec_consume_unit
}}</div>
<div class="item-name">月生料分布电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.elec_consume_unit
}}</div>
<div class="item-name">月熟料分布电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.coal_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.coal_consume_unit
}}</div>
<div class="item-name">熟料月单位标煤耗</div>
</div>
<div style="display: inline-block;">
<div class="items" >
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.celec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.回转窑">{{
monthData.回转窑.celec_consume_unit }}</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-number" v-if="monthData.回转窑">{{
monthData.回转窑.cen_consume_unit }}</div>
<div class="item-name">熟料月综合能耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.水泥磨">{{
monthData.水泥磨.elec_consume_unit }}</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-number" v-if="monthData.水泥磨">{{
monthData.水泥磨.cen_consume_unit }}</div>
<div class="item-name">水泥月综合能耗</div>
</div>
</div>
</div>
<div class="itemsWrap">
<div class="items" >
<div class="item-number" v-if="yearData.电石渣">{{ yearData.电石渣.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.电石渣">{{ yearData.电石渣.elec_consume_unit
}}</div>
<div class="item-name">本年度电石渣分布电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.原料磨">{{ yearData.原料磨.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.原料磨">{{ yearData.原料磨.elec_consume_unit
}}</div>
<div class="item-name">本年度生料分布电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.elec_consume_unit
}}</div>
<div class="item-name">本年度熟料分布电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.coal_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.coal_consume_unit
}}</div>
<div class="item-name">本年度熟料单位标煤耗</div>
</div>
<div style="display: inline-block;">
<div class="items" >
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.celec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.回转窑">{{
yearData.回转窑.celec_consume_unit }}</div>
<div class="item-name">本年度熟料综合电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.回转窑">{{ yearData.回转窑.cen_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.回转窑">{{
yearData.回转窑.cen_consume_unit }}</div>
<div class="item-name">本年度熟料综合能耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.水泥磨">{{ yearData.水泥磨.elec_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.水泥磨">{{
yearData.水泥磨.elec_consume_unit }}</div>
<div class="item-name">本年度水泥粉磨分布电耗</div>
</div>
<div class="items" >
<div class="item-number" v-if="yearData.水泥磨">{{ yearData.水泥磨.cen_consume_unit }}</div>
<div class="items">
<div class="item-number" v-if="yearData.水泥磨">{{
yearData.水泥磨.cen_consume_unit }}</div>
<div class="item-name">本年度水泥综合能耗</div>
</div>
</div>
@ -150,19 +178,23 @@
<el-card header="成本统计" style="border-radius: 5px;box-shadow: none;">
<div class="itemsWrap">
<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>
<div class="items" >
<div class="item-number" v-if="monthData.原料磨">{{ monthData.原料磨.production_cost_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.原料磨">{{
monthData.原料磨.production_cost_unit }}</div>
<div class="item-name">月生料成本</div>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.回转窑">{{ monthData.回转窑.production_cost_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.回转窑">{{
monthData.回转窑.production_cost_unit }}</div>
<div class="item-name">月熟料成本</div>
</div>
<div class="items" >
<div class="item-number" v-if="monthData.水泥磨">{{ monthData.水泥磨.production_cost_unit }}</div>
<div class="items">
<div class="item-number" v-if="monthData.水泥磨">{{
monthData.水泥磨.production_cost_unit }}</div>
<div class="item-name">月水泥成本</div>
</div>
</div>
@ -189,17 +221,17 @@
</div>
</template>
<script>
export default {
export default {
data() {
return {
time: '',
day: '',
year_s:'',
month_s:'',
yearData:[],
monthData:[],
warningNum:0,
warningNum2:0,
year_s: '',
month_s: '',
yearData: [],
monthData: [],
warningNum: 0,
warningNum2: 0,
}
},
mounted() {
@ -207,7 +239,7 @@
let that = this;
var myDate = new Date();
let year = myDate.getFullYear();
let month = myDate.getMonth()+1;
let month = myDate.getMonth() + 1;
that.year_s = year;
that.month_s = month;
that.getYearData();
@ -220,31 +252,32 @@
},
methods: {
// Class
bindClass(type){
let classInfo = { socketDom: true, redColor: false,
orangeColor:false, yellowColor:false, blueColor:true }
if(type==''){
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"){
if (typeof (WebSocket) === "undefined") {
alert("您的浏览器不支持socket")
}else{
this.ws = new WebSocket(this.path+tool.cookie.get("TOKEN"))
} else {
this.ws = new WebSocket(this.path + tool.data.get("TOKEN"))
//
this.ws.onopen = ()=> {
this.ws.onopen = () => {
// console.log("socket");
setTimeout(()=>{
that.ws.send(JSON.stringify({'type': 'event'}))
},500)
setTimeout(() => {
that.ws.send(JSON.stringify({ 'type': 'event' }))
}, 500)
}
//
this.ws.onmessage = (msg)=>{
this.ws.onmessage = (msg) => {
let data = JSON.parse(msg.data)
console.log(data)
that.getWraningNum();
@ -257,9 +290,9 @@
// }
};
// error
this.ws.onerror = function(error) {
this.ws.onerror = function (error) {
console.log('ws断开,尝试重连')
setTimeout(()=>{
setTimeout(() => {
this.ws = null;
this.init()
}, 5000)
@ -277,17 +310,17 @@
}
},
//
getWraningNum(){
getWraningNum() {
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.$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;
that.warningNum2 = res.count;
})
},
getYearData(){
getYearData() {
let that = this;
let obj = {};
obj.year_s = this.year_s;
@ -302,7 +335,7 @@
that.yearData = yearData;
})
},
getMonthData(){
getMonthData() {
let that = this;
let obj = {};
obj.year_s = this.year_s;
@ -318,23 +351,23 @@
that.monthData = monthData;
})
},
showTime(){
showTime() {
this.time = this.$TOOL.dateFormat(new Date(), 'hh:mm:ss')
this.day = this.$TOOL.dateFormat(new Date(), 'yyyy年MM月dd日')
},
interEvent(){
this.$router.replace({path:'/events'})
interEvent() {
this.$router.replace({ path: '/events' })
},
interEquipment(){
this.$router.replace({path:'/em/equipmentc'})
interEquipment() {
this.$router.replace({ path: '/em/equipmentc' })
},
}
}
}
</script>
<style scoped lang="scss">
.items{
.items {
display: inline-block;
width: 200px;
padding: 20px;
@ -343,35 +376,39 @@
border: 1px solid #cccccc;
border-radius: 10px;
box-shadow: 0 0 10px 6px #eeeeee57;
}
.item-number{
}
.item-number {
font-weight: 600;
font-size: 24px;
color: #1e2126;
letter-spacing: .1px;
text-align: left;
line-height: 36px;
}
.item-name{
}
.item-name {
font-size: 14px;
color: #4e5b71;
letter-spacing: .1px;
text-align: left;
line-height: 20px;
}
.item-percent{
}
.item-percent {
font-size: 12px;
color: #ffffff;
letter-spacing: .08px;
text-align: left;
line-height: 12px;
}
.socketDom{
}
.socketDom {
position: absolute;
top: 10vh;
left: 50%;
font-size: 20px;
font-weight:bold;
font-weight: bold;
transform: translateX(-50%);
z-index: 101;
color: #ffffff;
@ -381,24 +418,28 @@
border-radius: 5px;
}
.redColor{
.redColor {
color: red;
border: 1px solid red;
background: rgba(255, 0, 0, 0.2);
}
.orangeColor{
.orangeColor {
color: orange;
border: 1px solid orange;
background: rgba(255,165,0,.2);
background: rgba(255, 165, 0, .2);
}
.yellowColor{
.yellowColor {
color: yellow;
background: rgba(255,255,0,.2);
background: rgba(255, 255, 0, .2);
border: 1px solid yellow;
}
.blueColor{
.blueColor {
color: #2378f7;
background: rgb(35, 120, 247,.2);
background: rgb(35, 120, 247, .2);
border: 1px solid #2378f7;
}
</style>

View File

@ -62,6 +62,7 @@
export default {
data() {
return {
redirect: undefined,
userType: "admin",
visitorsdialog: false,
visitorform: {},
@ -99,6 +100,12 @@ export default {
this.form.password = "user";
}
},
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true,
},
},
mounted() { },
methods: {
@ -117,19 +124,19 @@ export default {
//token
try {
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_REFRESH", res.refresh);
that.$TOOL.cookie.set("TOKEN_REFRESH", res.refresh);
that.$TOOL.data.set("TOKEN_TIME", new Date().getTime());
try {
var res1 = await that.$API.auth.info.get();
that.$TOOL.data.set("USER_INFO", res1);
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
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'
}
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {
@ -157,31 +164,6 @@ export default {
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) {
that.islogin = false;
console.log(err);
@ -192,52 +174,6 @@ export default {
} finally {
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() {
this.visitorsdialog = true;

View File

@ -28,6 +28,7 @@
export default {
data() {
return {
redirect: undefined,
form: {
phone: "",
code: "",
@ -58,6 +59,14 @@ export default {
},
mounted() {
},
watch: {
$route: {
handler: function (route) {
this.redirect = route.query && route.query.redirect;
},
immediate: true,
},
},
methods: {
async getYzm() {
@ -86,18 +95,17 @@ export default {
this.$refs.loginForm.validate(async (valid) => {
if (valid) {
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_REFRESH", res.refresh);
that.$TOOL.cookie.set("TOKEN_REFRESH", res.refresh);
that.$TOOL.data.set("TOKEN_TIME", new Date().getTime());
that.$API.auth.info.get().then(res1 => {
that.$TOOL.data.set("USER_INFO", res1);
that.$TOOL.data.set("PERMISSIONS", Object.keys(res1.perms));
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'
}
if (this.$TOOL.data.get('BASE_INFO').base.base_name_short.indexOf('曲阳') != -1) {

View File

@ -138,7 +138,9 @@ export default {
}
},
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("MENU")
this.$TOOL.data.remove("PERMISSIONS")

View File

@ -776,8 +776,15 @@ export default {
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 => {
this.equipmentOptions1 = res;
})
this.$API.em.equipment.cquery.req({
page: 0,
querys: [
[{ field: 'name', compare: 'contains', value: '电阻炉' }],
[{ field: 'name', compare: 'contains', value: '升降式退火炉' }]
]
}).then(res => {