Commit c3b13e0a authored by forevertyler's avatar forevertyler

fix:sth

parent 2ac66a11
......@@ -35,3 +35,12 @@ export function listrealFan(query) {
params: query
})
}
// 查询风机设备基本信息列表
export function listFanSwitchHis(query) {
return request({
url: '/business/log/list',
method: 'get',
params: query
})
}
\ No newline at end of file
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
......@@ -9,49 +9,54 @@ import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
const whiteList = ['/login', '/register','/screen']
const whiteList = ['/login', '/register']
const isWhiteList = (path) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
}
router.beforeEach((to, from, next) => {
NProgress.start();
NProgress.start()
if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title);
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/
if (to.path === '/login') {
next({ path: '/screen' });
NProgress.done();
next({ path: '/' })
NProgress.done()
} else if (isWhiteList(to.path)) {
next();
next()
} else {
if (store.getters.roles.length === 0) {
isRelogin.show = true;
isRelogin.show = true
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
isRelogin.show = false;
isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => {
router.addRoutes(accessRoutes); // 动态添加路由
next({ ...to, replace: true }); // 确保路由加载完成
});
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err);
next({ path: '/screen' });
});
});
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
})
})
} else {
next();
next()
}
}
} else {
// 没有token
if (isWhiteList(to.path)) {
next();
// 在免登录白名单,直接进入
next()
} else {
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`);
NProgress.done();
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页
NProgress.done()
}
}
});
})
router.afterEach(() => {
NProgress.done()
......
......@@ -4,22 +4,22 @@
v-if="showMenu === 0"
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0"
></home>
<psxt
<!-- <psxt
v-if="showMenu === 3"
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0"
></psxt>
></psxt> -->
<v-scale-screen
ref="scale-screen"
width="1920"
height="1080"
:fullScreen="true"
width="10390"
height="3117"
:fullScreen="false"
>
<dlxt
<!-- <dlxt
v-if="showMenu === 6"
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0"
></dlxt>
<div class="container">
></dlxt> -->
<div class="container" :class="showMenu===0?'container0':''">
<!-- 头部 -->
<div class="header por">银洞坡金矿智能化综合管控平台</div>
<div class="sub-header">
......@@ -52,6 +52,7 @@
<div class="top-change">
<span @click="changeMenu(0)">首页</span>
<span @click="openVideo">企业宣传</span>
<span @click="sysAnalysis">系统分析</span>
<span @click="goToSys">后台管理</span>
</div>
</div>
......@@ -62,8 +63,8 @@
</div>
</div>
<rydw v-if="showMenu === 1" style="pointer-events: auto"></rydw>
<hjjc v-if="showMenu === 2" style="pointer-events: auto"></hjjc>
<!-- <rydw v-if="showMenu === 1" style="pointer-events: auto"></rydw>
<hjjc v-if="showMenu === 2" style="pointer-events: auto"></hjjc> -->
<!-- 底部 -->
<!-- <div class="footer">
......@@ -130,6 +131,9 @@ export default {
window.open(this.videoData);
return;
},
sysAnalysis(){
},
},
};
</script>
......@@ -158,19 +162,25 @@ export default {
.container {
width: 100%;
height: 100%;
background: url("~@/assets/images/screen/bg.png");
background: url("~@/assets/images/bigscreen/bg.png");
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
display: flex;
flex-direction: column;
padding: 0 20px;
padding: 0 240px;
// background-color: #08152a;
position: relative;
font-family: "SimHei";
pointer-events: none;
color: #fff;
}
.container0{
background: url("~@/assets/images/bigscreen/border.png");
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
}
/* 头部标题 */
.header {
// height: 80px;
......@@ -186,10 +196,10 @@ export default {
font-family: SimHei;
// font-weight: 500;
font-size: 38px;
font-size: 120px;
font-weight: bold;
color: #ffffff;
line-height: 55px;
line-height: 240px;
background: -webkit-gradient(
linear,
left top,
......@@ -206,12 +216,11 @@ export default {
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 70px;
}
.sub-header {
display: flex;
justify-content: space-between;
padding: 0 30px;
padding: 0 60px;
// transform-style: preserve-3d;
perspective: 1000px;
// transform: translateZ(-10px);
......@@ -221,28 +230,28 @@ export default {
.sub-header-right {
display: flex;
justify-content: space-between;
width: 494px;
margin-top: -30px;
width: 2000px;
margin-top: -150px;
.sub-item {
width: 134px;
width: 484px;
height: auto;
background: url("~@/assets/images/screen/normal.png") no-repeat center;
background: url("~@/assets/images/bigscreen/button_normal.png") no-repeat center;
background-size: 100%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
&.active {
background: url("~@/assets/images/screen/click.png") no-repeat center;
background: url("~@/assets/images/bigscreen/button_click.png") no-repeat center;
background-size: 100%;
}
p {
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 19px;
font-size: 68px;
color: #ffffff;
line-height: 55px;
line-height: 167px;
background: linear-gradient(
180deg,
#ffffff 0%,
......@@ -251,59 +260,72 @@ export default {
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
padding-bottom: 4px;
padding-bottom: 20px;
}
}
}
.sub-header-left {
transform: rotateZ(4deg);
transform: rotateZ(2deg);
}
.sub-header-right {
transform: rotateZ(-4deg);
transform: rotateZ(-2deg);
}
.top-change {
width: 425px;
height: 44px;
background: url("~@/assets/images/screen/top_bg.png") no-repeat center;
margin: 20px auto 0;
width: 1967px;
height: 300px;
background: url("~@/assets/images/bigscreen/top_bg.png") no-repeat center;
margin: -130px auto 0;
display: flex;
justify-content: space-evenly;
align-items: center;
font-size: 16px;
font-size: 56px;
color: #11e0ff;
span {
cursor: pointer;
text-indent: 1em;
position: relative;
margin-top: 130px;
display: block;
}
span:nth-child(1)::after {
content: "";
width: 17px;
height: 17px;
width: 46px;
height: 46px;
position: absolute;
background: url("~@/assets/images/screen/icon7.png") no-repeat center;
background: url("~@/assets/images/bigscreen/icon1.png") no-repeat center;
background-size: 100%;
left: -4px;
top: 0px;
top: 10px;
z-index: 20;
}
span:nth-child(2)::after {
content: "";
width: 17px;
height: 17px;
width: 46px;
height: 46px;
position: absolute;
background: url("~@/assets/images/screen/icon6.png") no-repeat center;
background: url("~@/assets/images/bigscreen/icon2.png") no-repeat center;
left: -4px;
top: 2px;
top: 10px;
z-index: 20;
}
span:nth-child(3)::after {
content: "";
width: 17px;
height: 17px;
width: 46px;
height: 46px;
position: absolute;
background: url("~@/assets/images/bigscreen/icon3.png") no-repeat center;
left: -4px;
top: 10px;
z-index: 20;
}
span:nth-child(4)::after {
content: "";
width: 46px;
height: 46px;
position: absolute;
background: url("~@/assets/images/screen/icon8.png") no-repeat center;
background: url("~@/assets/images/bigscreen/icon4.png") no-repeat center;
left: -4px;
top: 0px;
top: 10px;
z-index: 20;
}
}
......
<template>
<div>
<home
v-if="showMenu === 0"
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0"
></home>
<psxt
v-if="showMenu === 3"
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0"
></psxt>
<v-scale-screen
ref="scale-screen"
width="1920"
height="1080"
:fullScreen="true"
>
<dlxt
v-if="showMenu === 6"
style="position: absolute; top: 0; left: 0; right: 0; bottom: 0"
></dlxt>
<div class="container">
<!-- 头部 -->
<div class="header por">银洞坡金矿智能化综合管控平台</div>
<div class="sub-header">
<div class="sub-header-left">
<div
class="sub-item"
:class="showMenu == 1 ? 'active' : ''"
@click="changeMenu(1)"
>
<p>人员定位</p>
</div>
<div
class="sub-item"
@click="changeMenu(2)"
key=""
:class="showMenu == 2 ? 'active' : ''"
>
<p>环境监测</p>
</div>
<div
class="sub-item"
@click="changeMenu(3)"
key=""
:class="showMenu == 3 ? 'active' : ''"
>
<p>排水系统</p>
</div>
</div>
<div class="sub-header-mid">
<div class="top-change">
<span @click="changeMenu(0)">首页</span>
<span @click="openVideo">企业宣传</span>
<span @click="goToSys">后台管理</span>
</div>
</div>
<div class="sub-header-right">
<div class="sub-item" :class="showMenu == 4 ? 'active' : ''" @click="changeMenu(4)"><p>提升机系统</p></div>
<div class="sub-item" :class="showMenu == 5 ? 'active' : ''" @click="changeMenu(5)"><p>风机系统</p></div>
<div class="sub-item" :class="showMenu == 6 ? 'active' : ''" @click="changeMenu(6)"><p>电力系统</p></div>
</div>
</div>
<rydw v-if="showMenu === 1" style="pointer-events: auto"></rydw>
<hjjc v-if="showMenu === 2" style="pointer-events: auto"></hjjc>
<!-- 底部 -->
<!-- <div class="footer">
</div> -->
</div>
</v-scale-screen>
</div>
</template>
<script>
// import * as echarts from "echarts";
// import { getScale } from "@/utils/tylerlcl";
import { listVideo } from "@/api/tyler/mainVideo";
import screenfull from "screenfull";
import rydw from "./items/rydw.vue";
import hjjc from "./items/hjjc.vue";
import psxt from "./items/psxt.vue";
import home from "./items/home.vue";
import dlxt from "./items/dlxt.vue";
export default {
name: "cockpit",
components: {
home,
rydw,
hjjc,
psxt,
dlxt,
},
data() {
return {
previewUrl: process.env.VUE_APP_API_TARGET,
showMenu: 0,
videoData:null,
};
},
mounted() {
this.getVideo()
if (screenfull && screenfull.enabled && !screenfull.isFullscreen) {
screenfull.request();
}
// this.areaCharts();
// this.alarm30();
},
methods: {
getVideo(){
this.videoData = null;
listVideo().then(res => {
this.videoData = this.previewUrl + res.data;
})
},
changeMenu(val) {
this.showMenu = val;
},
goToSys() {
var link = this.$router.resolve({
path: "/",
});
window.open(link.href);
return;
},
openVideo(){
window.open(this.videoData);
return;
},
},
};
</script>
<style lang="scss" scoped>
/* 标题 */
@font-face {
font-family: "ysbth";
src: url("~@/assets/font/syhtCN-Medium.ttf") format("truetype");
}
@font-face {
font-family: "number";
src: url("~@/assets/font/DS-Digital.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
.por {
position: relative;
}
.poa {
position: absolute;
}
.psxt-bg {
background: url("~@/assets/images/screen/psxt/bg.png") no-repeat center;
}
/* 基础容器 */
.container {
width: 100%;
height: 100%;
background: url("~@/assets/images/screen/bg.png");
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
display: flex;
flex-direction: column;
padding: 0 20px;
// background-color: #08152a;
position: relative;
font-family: "SimHei";
pointer-events: none;
color: #fff;
}
/* 头部标题 */
.header {
// height: 80px;
text-align: center;
// margin-bottom: 20px;
// background: linear-gradient(90deg, rgba(0,72,143,0.8) 0%, rgba(0,36,71,0.6) 100%);
display: flex;
align-items: center;
justify-content: center;
// font-size: 2.5vw;
letter-spacing: 2px;
font-family: SimHei;
// font-weight: 500;
font-size: 38px;
font-weight: bold;
color: #ffffff;
line-height: 55px;
background: -webkit-gradient(
linear,
left top,
left bottom,
from(#ffffff),
color-stop(39.7216796875%, #f3f7fa),
to(#03a9ff)
);
background: linear-gradient(
180deg,
#ffffff 0%,
#f3f7fa 39.7216796875%,
#03a9ff 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 70px;
}
.sub-header {
display: flex;
justify-content: space-between;
padding: 0 30px;
// transform-style: preserve-3d;
perspective: 1000px;
// transform: translateZ(-10px);
pointer-events: auto;
}
.sub-header-left,
.sub-header-right {
display: flex;
justify-content: space-between;
width: 494px;
margin-top: -30px;
.sub-item {
width: 134px;
height: auto;
background: url("~@/assets/images/screen/normal.png") no-repeat center;
background-size: 100%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
&.active {
background: url("~@/assets/images/screen/click.png") no-repeat center;
background-size: 100%;
}
p {
font-family: Source Han Sans SC;
font-weight: bold;
font-size: 19px;
color: #ffffff;
line-height: 55px;
background: linear-gradient(
180deg,
#ffffff 0%,
#f3f7fa 39.7216796875%,
#03a9ff 100%
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
padding-bottom: 4px;
}
}
}
.sub-header-left {
transform: rotateZ(4deg);
}
.sub-header-right {
transform: rotateZ(-4deg);
}
.top-change {
width: 425px;
height: 44px;
background: url("~@/assets/images/screen/top_bg.png") no-repeat center;
margin: 20px auto 0;
display: flex;
justify-content: space-evenly;
align-items: center;
font-size: 16px;
color: #11e0ff;
span {
cursor: pointer;
text-indent: 1em;
position: relative;
}
span:nth-child(1)::after {
content: "";
width: 17px;
height: 17px;
position: absolute;
background: url("~@/assets/images/screen/icon7.png") no-repeat center;
left: -4px;
top: 0px;
z-index: 20;
}
span:nth-child(2)::after {
content: "";
width: 17px;
height: 17px;
position: absolute;
background: url("~@/assets/images/screen/icon6.png") no-repeat center;
left: -4px;
top: 2px;
z-index: 20;
}
span:nth-child(3)::after {
content: "";
width: 17px;
height: 17px;
position: absolute;
background: url("~@/assets/images/screen/icon8.png") no-repeat center;
left: -4px;
top: 0px;
z-index: 20;
}
}
::v-deep .screen-box {
pointer-events: none;
}
</style>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="" prop="fanName">
<el-select v-model="queryParams.fanName" placeholder="风机名称" clearable>
<el-option
v-for="dict in fanName"
:key="dict.value"
:label="dict.name"
:value="dict.name"
/>
</el-select>
</el-form-item>
<el-form-item label="">
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="infoList" >
<el-table-column label="风机名称" align="center" prop="fanName"/>
<el-table-column label="风机编号" align="center" prop="deviceId"/>
<el-table-column label="操作类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.fan_run_status" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status"></el-table-column>
<el-table-column label="操作时间" align="center" prop="time"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listFanSwitchHis } from "@/api/tyler/fan";
import { fanDeviceName } from "@/api/tyler/common";
export default {
name: "Info",
dicts: ['fan_run_status'],
data() {
return {
// 根路径
baseURL: process.env.VUE_APP_BASE_API,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 风机基本信息表格数据
infoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fanName: null,
deviceId: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
id: [
{ required: true, message: "id不能为空", trigger: "blur" }
],
fanName: [
{ required: true, message: "风机名称不能为空", trigger: "blur" }
],
deviceId: [
{ required: true, message: "风机编号不能为空", trigger: "blur" }
],
},
fanName:[],
dateRange:[],
};
},
created() {
fanDeviceName().then(res=>{
this.fanName = res.data;
})
this.getList();
},
methods: {
/** 查询风机基本信息列表 */
getList() {
this.loading = true;
listFanSwitchHis(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
fanName: null,
deviceId: null,
installationLocation: null,
powerSupplyVoltage: null,
motorCurrent: null,
operatingFrequency: null,
setFrequency: null,
windPressure: null,
windSpeed: null,
airVolume: null,
frontAxisTemperature: null,
rearAxisTemperature: null,
motorTemperature: null,
frontVibration: null,
rearVibration: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.resetForm("queryForm");
this.handleQuery();
},
}
};
</script>
......@@ -131,29 +131,26 @@ export default {
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true;
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
Cookies.set("username", this.loginForm.username, { expires: 30 })
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
Cookies.remove("username")
Cookies.remove("password")
Cookies.remove('rememberMe')
}
this.$store.dispatch("Login", this.loginForm)
.then(() => {
const redirectPath = this.redirect && this.redirect !== '/login' ? this.redirect : '/screen';
this.$router.push({ path: redirectPath }).catch(() => {});
})
.catch(() => {
this.loading = false;
if (this.captchaEnabled) {
this.getCode();
}
});
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{})
}).catch(() => {
this.loading = false
if (this.captchaEnabled) {
this.getCode()
}
})
}
});
})
}
}
};
......
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