Commit 45c0c843 authored by liuzhaoh's avatar liuzhaoh

Merge branch 'dev' of http://app.bmetech.com/liuzhaohui/dctomproject into dev

parents 8d356ea1 c006b496
......@@ -193,6 +193,15 @@ watch(
},
{ deep: true }
);
// 监听默认分页大小变化
watch(
() => props.defaultPageSize,
(newSize) => {
pageSize.value = newSize;
// emitPaginationChange();
}
);
</script>
<style lang="scss" scoped>
......
......@@ -11,6 +11,7 @@
:is-active="sidebar"
/>
<h3>DC-TOM管理平台</h3>
<div class="go-tom" @click="goTom">Eco-TOM三流合一</div>
<div class="right-block">
<el-dropdown class="right-menu-item"
trigger="click"
......@@ -86,6 +87,10 @@ export default {
});
}
};
const goTom = () => {
router.push({ path: '/intermediate' });
}
// 监听路由变化,更新面包屑
watch(() => route.path, () => {
......@@ -116,11 +121,11 @@ export default {
userName,
logout,
sidebar,
toggleSideBar
toggleSideBar,
goTom
};
},
created() {
console.log("layout created");
},
};
</script>
......@@ -134,9 +139,11 @@ export default {
width: 200px;
height: 100%;
background: linear-gradient(180deg, #018796, #014155);
transition: all 0.3s ease;
}
.colWidth {
width: 63px;
transition: all 0.3s ease;
}
.right {
min-height: 100%;
......@@ -168,6 +175,25 @@ export default {
left: 50px;
top: 14px;
}
.go-tom {
font-size: 0.9rem;
margin-top: - 16px;
top: 50%;
height: 32px;
line-height: 32px;
padding: 0 20px;
position: absolute;
right: 200px;
color: #ffffff;
background: #2182a0;
border: 1px solid #2182a0;
border-radius: 6px;
cursor: pointer;
transition: all 0.3s ease;
&:hover {
box-shadow: 0px 1.33px 16px 0px rgba(83, 100, 170, 0.5);
}
}
.right-block {
line-height: 50px;
float: right;
......@@ -226,4 +252,8 @@ export default {
color: #000;
font-weight: 600;
}
.el-menu--collapse {
width: auto !important;
}
</style>
......@@ -2,7 +2,6 @@
import {defineStore} from 'pinia'
import user from './user';
import menu from './menu';
console.log(user.actions)
//第一个参敬是应用程序中store的唯一id,就是给数据仓库起个名字
//第二个参数是一个对象,store的配置项,比如配置store内的嫩据,修改数据的方法等等
......
......@@ -109,6 +109,11 @@ const routes = [
},
]
},
{
path: '/intermediate',
component: () => import('@/views/intermediate/index.vue'),
meta: { title: '中间页面' }
},
{
path: '/login',
component: () => import('../views/login/index.vue'),
......@@ -125,6 +130,12 @@ const router = createRouter({
// 添加全局路由守卫
router.beforeEach((to, from, next) => {
// 如果是从登录页面来的,并且不是去中间页的,就重定向到中间页
if (to.path === '/intermediate') {
next();
return;
}
// 登录页面不需要权限验证
if (to.path === '/login') {
next();
......
......@@ -52,7 +52,6 @@ router.beforeEach(async (to, from, next) => {
try {
next()
} catch (error) {
console.log(error)
// remove token and go to login page to re-login
await store.resetToken()
// Message.warning(error || 'Has Error')
......
......@@ -166,7 +166,7 @@ const formInline = ref({
eventName: "",
name: "",
dusterName: "",
deviceType: "",
deviceType: route.query.deviceType ? Number(route.query.deviceType) : "",
suspendFlag: "0",
date: route.query.startTime
? [
......
......@@ -820,7 +820,6 @@ const dispatchHandle = async (url,param) => {
searchData();
}
} catch (e) {
console.log(e);
}
}
......@@ -1239,7 +1238,6 @@ const pageSize = ref(20);
const handlePaginationChange = (pagination) => {
currentPage.value = pagination.currentPage;
pageSize.value = pagination.pageSize;
console.log("分页变化", pagination);
};
</script>
......
......@@ -202,7 +202,6 @@ const tableData = reactive({
const total = ref(0);
const getAllDustList = () => {
const url = "/bag/cycle/getReplaceListPage";
console.log(formInline.value.date);
const params = {
compart: formInline.value.compart,
dusterName: formInline.value.dusterName,
......
......@@ -42,7 +42,6 @@ watch(
() => props.dustLineInfo,
() => {
initChart();
console.log("props.dustLineInfo", props.dustLineInfo);
},
{ deep: true }
......
......@@ -38,7 +38,6 @@ const initChart = () => {
};
onMounted(() => {
console.log(props.chartData, 'props.chartData')
if (props.chartData) {
initChart();
}
......
......@@ -10,6 +10,7 @@
:class="[{ active: activeSpot === index }, `status-${spot.status}`]"
@mouseenter="handleSpotHover(index)"
@mouseleave="handleSpotLeave"
@click="handleSpotClick(spot)"
:style="{
left: spot.x + '%',
top: spot.y + '%',
......@@ -61,9 +62,8 @@
<script setup>
import { onMounted, onBeforeUnmount, ref, watch } from "vue";
import * as echarts from "echarts";
import { getLineOption } from "@/utils/chart";
import { useRouter } from "vue-router";
const router = useRouter();
const props = defineProps({
mapList: {
type: Array,
......@@ -125,6 +125,15 @@ const activeSpot = ref(null);
const showDetail = ref(false);
const hoverTimer = ref(null);
const handleSpotClick = (spot) => {
router.push({
path: "/monitor",
query: {
dusterNo: spot.no,
},
});
}
const clearTimer = () => {
if (hoverTimer.value) {
clearTimeout(hoverTimer.value);
......@@ -179,7 +188,6 @@ const getStatusText = (status) => {
};
const initMap = () => {
console.log(props.mapList, 'props.mapList')
spots.value = props.mapList || [];
}
......@@ -308,7 +316,7 @@ onBeforeUnmount(() => {
position: absolute;
left: calc(100% + 35px); // 减小与连接线的距离
top: -40px; // 调整垂直位置
width: 200px;
width: 300px;
background: rgba(0, 22, 40, 0.5);
backdrop-filter: blur(8px);
border: 1px solid rgba(255, 255, 255, 0.3);
......
......@@ -36,7 +36,6 @@
<script setup>
import { ref, onMounted, onBeforeUnmount, computed, nextTick } from "vue";
import { getHealthOverview, getHealthStatistic, getExceptionMonitor, getDusterAlarm } from "@/request/api/dashboard";
import { useRoute, useRouter } from "vue-router";
import msgItem from "./components/msg-item.vue";
import chartLine from "./components/chart-line.vue";
import mapSvg from "./components/map-svg.vue";
......@@ -53,8 +52,6 @@ const customColors = [
];
const chartData = ref(null)
const route = useRoute();
const router = useRouter();
const msgList = ref([
]);
......
......@@ -227,7 +227,6 @@ const togglePanel = () => {
};
const handleDeviceChange = (value) => {
console.log("value", value);
initChart();
};
......
......@@ -31,35 +31,21 @@ const props = defineProps({
});
const borderColor = computed(() => {
if (props.progress < 60) {
if (props.progress < 70) {
return 'box-color-60'
} else if (props.progress < 90) {
} else if (props.progress < 100) {
return 'box-color-90'
}
return 'box-color-default'
});
const diagonalPatternColor = computed(() => {
if (props.progress < 60) {
if (props.progress < 70) {
return 'diagonal-pattern-60'
} else if (props.progress < 90) {
} else if (props.progress < 100) {
return 'diagonal-pattern-90'
}
return 'diagonal-pattern-default'
});
const customColors = [
{ color: "#ff6a6a", percentage: 60 },
{ color: "#f5c701", percentage: 80 },
{ color: "#08c733", percentage: 100 },
];
const customColorMethod = (percentage) => {
if (percentage < 60) {
return customColors[0].color;
}
if (percentage < 90) {
return customColors[1].color;
}
return customColors[2].color;
};
watch(
() => props.progress,
(newProgress) => {
......
......@@ -75,7 +75,7 @@
<common-table
:data="tableData"
:columns="tableColumns"
:default-page-size="10"
:default-page-size="pageSize"
@pagination-change="handlePaginationChange"
:total="total"
:pagination-texts="{
......@@ -193,7 +193,7 @@ const formInline = ref({
});
const currentPage = ref(1);
const pageSize = ref(10);
const pageSize = ref(20);
const total = ref(0);
const dusterLeakNum = ref(0);
const healthPercent = ref("100%");
......@@ -319,7 +319,7 @@ const handlePaginationChange = (pagination) => {
const onSubmit = () => {
currentPage.value = 1;
pageSize.value = 10;
pageSize.value = 20;
getData();
};
......@@ -372,6 +372,7 @@ const handleDusterLeakNumClick = () => {
query: {
startTime: moment().subtract(24, 'hours').format("YYYY-MM-DD HH:mm:ss"),
endTime: moment().format("YYYY-MM-DD HH:mm:ss"),
deviceType: 200003 // 默认为布袋告警
},
});
};
......@@ -500,7 +501,7 @@ const getData = () => {
const refreshData = () => {
currentPage.value = 1;
pageSize.value = 10;
pageSize.value = 20;
formInline.value = {
region: "",
deviceName: "",
......
......@@ -151,10 +151,8 @@ const props = defineProps({
watch(
() => props.infoObjProps,
(newVal) => {
console.log(newVal);
// Object.assign(infoObj, newVal);
infoObj = newVal;
console.log(infoObj);
},
{ deep: true, inmediate: true }
);
......
......@@ -140,9 +140,6 @@ const formInline = reactive({
productionLineId: " ",
});
const onSubmit = () => {
console.log("submit!");
};
const tableData = ref([]);
const tableColumns = ref([
{
......
<template>
<div class="intermediate-page">
<iframe
ref="iframeRef"
class="iframe-box"
src="https://screen.bmetech.com/steelmakingScreen/#/ecoDashboard"
frameborder="0"
></iframe>
<div class="back-btn" :style="backBtnStyle">
<div class="back" @click="handleBack">
<img src="@/assets/icons/menu-icon.png" alt="" />
<span>管理平台</span>
</div>
</div>
</div>
</template>
<script setup>
import { useRouter } from "vue-router";
import { ref, onMounted, computed, onUnmounted } from "vue";
const router = useRouter();
const windowHeight = ref(window.innerHeight);
const windowWidth = ref(window.innerWidth);
const iframeRef = ref(null);
// 设计稿尺寸
const DESIGN_WIDTH = 1920;
const DESIGN_HEIGHT = 1080;
// 计算缩放比例和位置
const backBtnStyle = computed(() => {
// 根据高度计算缩放比例
const scale = windowHeight.value / DESIGN_HEIGHT;
// 计算实际宽度
const actualWidth = DESIGN_WIDTH * scale;
// 计算左侧留白
const leftMargin = (windowWidth.value - actualWidth) / 2;
// 按钮在设计稿中的位置
const designLeft = 500;
const designTop = 14;
return {
transform: `scale(${scale})`,
transformOrigin: 'left top',
left: `${leftMargin + designLeft * scale}px`,
top: `${designTop * scale}px`,
};
});
// 监听窗口大小变化
const updateWindowSize = () => {
windowHeight.value = window.innerHeight;
windowWidth.value = window.innerWidth;
};
// 处理iframe消息
const handleMessage = (event) => {
// 确保消息来源是我们的iframe
if (iframeRef.value && event.source === iframeRef.value.contentWindow) {
try {
// 如果消息是字符串,尝试解析JSON
const data = typeof event.data === 'string' ? JSON.parse(event.data) : event.data;
// 根据消息类型处理
if (data.type === 'navigation' && data.target === 'dashboard') {
handleBack();
}
} catch (error) {
console.error('Error processing iframe message:', error);
}
}
};
onMounted(() => {
window.addEventListener("resize", updateWindowSize);
// 添加消息监听器
window.addEventListener('message', handleMessage);
});
onUnmounted(() => {
window.removeEventListener("resize", updateWindowSize);
// 移除消息监听器
window.removeEventListener('message', handleMessage);
});
const handleBack = () => {
router.push("/dashboard");
};
</script>
<style lang="scss" scoped>
.intermediate-page {
height: 100vh;
width: 100%;
position: relative;
display: flex;
justify-content: center;
align-items: center;
background-color: #000;
.iframe-box {
width: 100%;
height: 100%;
}
.back-btn {
position: fixed;
.back {
width: 140px;
height: 42px;
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
cursor: pointer;
background: rgba(31, 40, 163, 0.5215686275);
border: 1px solid #56a7aa;
border-radius: 10px;
padding: 0 10px;
transition: all 0.3s ease;
&:hover {
box-shadow: 0 0 10px 0 #56a7aa;
}
}
img {
display: block;
width: 32px;
height: 32px;
object-fit: contain;
border-radius: 50%;
}
span {
display: block;
width: 80px;
color: #ffffff;
text-align: center;
}
}
}
</style>
......@@ -379,7 +379,7 @@ export default {
if (!regex.test(value)) {
callback(
new Error(
"密码不符合规范,必须包含至少一个数字、英文字母、“~!@#$%^&*()<>”中的一个特殊字符"
"密码不符合规范,必须包含至少一个数字、英文字母、~!@#$%^&*()<>中的一个特殊字符"
)
);
} else if (this.ruleForm.checkPass !== "") {
......@@ -554,7 +554,6 @@ export default {
if (getToken("rememberMe") == "true") {
this.loginOldForm.account = encryptUtf8ToBase64(getToken("account"));
this.loginOldForm.password = encryptUtf8ToBase64(getToken("remmberPWS"));
console.log(this.loginOldForm);
} else {
this.loginOldForm.account = "";
this.loginOldForm.password = "";
......@@ -676,7 +675,6 @@ export default {
};
},
handleSelect(item) {
console.log(item);
},
submitForm(formName) {
//debugger;
......@@ -712,7 +710,6 @@ export default {
}
});
} else {
console.log("error submit!!");
return false;
}
});
......@@ -733,11 +730,9 @@ export default {
if (result.data && result.data.captchaKey) {
this.phoneForm.captchaKey = result.data.captchaKey;
} else {
console.log("error fetch verify code!!");
}
})
.catch((e) => {
console.log("error fetch verify code!!" + e);
});
},
calcuCaptchaWaitTime() {
......@@ -756,31 +751,6 @@ export default {
}
},
sendCaptchaCheck() {
/*getData(
"/user/existIphone?iphone=" +
this.phoneForm.iphone +
"&account=" +
this.loginForm.account +
"&password=" +
this.loginForm.password +
"&appCode=bme-dc-tom-service",
true
)
.then((result) => {
console.log(result.data);
if (result.msg == "访问成功") {
this.captchaSendStatus = true;
this.captchaWaitTime = 60;
this.$forceUpdate();
this.calcuCaptchaWaitTime();
this.sendCaptcha();
} else {
console.log(result.msg);
}
})
.catch((e) => {
console.log("error fetch verify code!!" + e);
});*/
this.captchaSendStatus = true;
this.captchaWaitTime = 60;
this.$forceUpdate();
......@@ -802,7 +772,6 @@ export default {
this.loginOldForm.captchaKey = captchaKey;
})
.catch((e) => {
console.log("error fetch verify code!!" + e);
});
},
handleLoginBefore() {
......@@ -857,10 +826,7 @@ export default {
this.store
.login(phoneFormOrigin)
.then((data) => {
console.log(
!bindIphones.includes(this.phoneForm.iphone) &&
this.phoneForm.captcha != "BME202288"
);
if (
!bindIphones.includes(this.phoneForm.iphone) &&
this.phoneForm.captcha != "BME202288"
......@@ -874,7 +840,6 @@ export default {
}
});
} else {
console.log(data);
this.getProfile(data);
}
})
......@@ -886,7 +851,6 @@ export default {
this.loading = false;
});
} else {
console.log("error submit!!");
return false;
}
});
......@@ -996,7 +960,6 @@ export default {
this.store
.captchaLogin(loginOldFormOrigin)
.then(() => {
console.log("登录成功");
this.getOldProfile();
})
.catch((data) => {
......@@ -1017,7 +980,6 @@ export default {
}
});
} else {
console.log("error submit!!");
return false;
}
});
......@@ -1082,13 +1044,9 @@ export default {
)
.then((result) => {
sessionStorage.setItem("menuList", JSON.stringify(result.data));
this.$router.push({
path: this.redirect || "/",
query: this.otherQuery,
});
this.$router.push('/intermediate');
})
.catch((e) => {
console.log("error fetch verify code!!" + e);
});
},
getPermissionData(userId) {
......
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