Commit 55317571 authored by liuzhaoh's avatar liuzhaoh

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

parents 2c83b467 ec65a27d
This diff is collapsed.
......@@ -9,7 +9,7 @@ import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import { createPinia } from "pinia";
import moment from 'moment';
import { startPermissionCheck } from '@/utils/permissionChecker';
import { startPermissionCheck, stopPermissionCheck } from '@/utils/permissionChecker';
const app = createApp(App);
......@@ -23,7 +23,23 @@ app
.use(createPinia())
.mount("#app");
// 启动权限轮询检查,每5秒检查一次
// 监听路由变化,在登录页停止权限轮询,在其他页面启动权限轮询
router.beforeEach((to, from, next) => {
if (to.path === '/login') {
stopPermissionCheck();
}
next();
});
router.afterEach((to) => {
if (to.path !== '/login') {
startPermissionCheck(5000);
}
});
// 初始启动权限轮询检查
router.isReady().then(() => {
if (router.currentRoute.value.path !== '/login') {
startPermissionCheck(5000);
}
});
......@@ -86,6 +86,7 @@ const routes = [
meta: { title: 'BME布袋监测', icon: 'collectorList' },
},
{
name: 'alerts',
path: '/alerts',
component: () => import('../views/AboutView/AboutView.vue'),
meta: { title: '告警总览', icon: 'warnning' },
......
......@@ -7,9 +7,9 @@ let previousPermissionData = null;
/**
* 开始权限轮询检查
* @param {Number} interval - 轮询间隔,默认5000ms
* @param {Number} interval - 轮询间隔,默认10000ms
*/
export function startPermissionCheck(interval = 10000) {
export function startPermissionCheck(interval = 5000) {
// 如果已经存在轮询,先清除
if (permissionInterval) {
clearInterval(permissionInterval);
......
......@@ -107,6 +107,12 @@
:close-on-press-escape="false"
>
<div class="equd_body">
<el-form
ref="ruleFormRef"
:model="equSubmitInfo"
:rules="rules"
class="equd_form"
>
<span
>是否要对<span class="bold">{{ clickItem.name }}</span
>不再告警:</span
......@@ -117,26 +123,29 @@
<el-radio value="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="开始时间">
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
v-model="equSubmitInfo.startTime"
type="datetime"
placeholder="选择开始时间"
/>
</el-form-item>
<el-form-item label="结束时间">
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
v-model="equSubmitInfo.endTime"
type="datetime"
placeholder="选择结束时间"
/>
</el-form-item>
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="equDialog = false">取消</el-button>
<el-button type="primary" @click="equPending"> 确认 </el-button>
<el-button type="primary" @click="equPending(ruleFormRef)">
确认
</el-button>
</span>
</template>
</el-dialog>
......@@ -150,9 +159,9 @@ import { useRoute, useRouter } from "vue-router";
import { getDataFun, postDataJSON } from "@/request/method.js";
import moment from "moment";
const router = useRouter();
const route = useRoute();
const router = useRouter();
const formInline = ref({
eventName: "",
name: "",
......@@ -171,8 +180,6 @@ const formInline = ref({
: [],
});
const currentPage = ref(1);
const pageSize = ref(20);
const equDialog = ref(false);
......@@ -225,6 +232,17 @@ const tableColumns = ref([
},
]);
const ruleFormRef = ref(null);
const rules = {
startTime: [{ required: true, message: "请填写开始时间", trigger: "blur" }],
endTime: [
{
required: true,
message: "请填写结束时间",
},
],
};
const tableData = reactive({
list: [],
});
......@@ -264,7 +282,7 @@ const onReset = () => {
name: "",
dusterName: "",
deviceType: "",
suspendFlag: "2",
suspendFlag: "0",
date: [],
};
currentPage.value = 1;
......@@ -322,7 +340,8 @@ const equSubmitInfo = ref({
endTime: "",
});
const equPending = () => {
const equPending = async (formEl) => {
if (!formEl) return;
const url = "/alarm/suspendDevice";
const params = {
id: clickItem.value.id,
......@@ -338,15 +357,33 @@ const equPending = () => {
)
: "",
};
await formEl.validate((valid, fields) => {
if (valid) {
return getDataFun(url, params).then((res) => {
if (res && res.code == 1) {
equDialog.value = false;
getAlarmList();
}
});
} else {
}
});
};
onMounted(async () => {
if (route.query) {
const { deviceName, suspendStartTime, suspendEndTime } = route.query;
if (deviceName) {
formInline.value.dusterName = deviceName;
}
if (suspendStartTime) {
formInline.value.date[0] = suspendStartTime;
}
if (deviceName) {
formInline.value.date[1] = suspendEndTime;
}
}
getTypeList();
getAlarmList();
});
......@@ -553,10 +590,12 @@ onBeforeUnmount(() => {});
}
.equWarnDialog {
.equd_body {
.equd_form {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.bold {
font-weight: bold;
}
......
......@@ -8,15 +8,15 @@
<el-form-item label="发生位置:">
<el-input v-model="formInline.keyword" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="所属区域:">
<el-select v-model="formInline.branchFactoryIds"
<el-form-item label="所属工序:">
<el-select v-model="formInline.productionLineId"
placeholder="请选择"
style="width: 180px"
>
<el-option v-for="(item, index) in basicConfiguration.branchFactoryList"
:key="item.branchFactoryId"
:label="item.branchFactory"
:value="item.branchFactoryId"
<el-option v-for="(item, index) in basicConfiguration.productLineList"
:key="item.productionLineId"
:label="item.productionLineName"
:value="item.productionLineId"
/>
</el-select>
</el-form-item>
......@@ -135,9 +135,9 @@
<div class="label-title">告警信息</div>
<div class="alarm-content">
<div class="content-item">
<span class="name">所属区域:</span>
<span class="name">所属工序:</span>
<span class="value">{{
workSheetDetail?.branchFactory || "--"
workSheetDetail?.productionLine || "--"
}}</span>
</div>
<div class="content-item">
......@@ -601,9 +601,9 @@
<el-form-item label="第几行:">
<el-select v-model="bagRow" placeholder="请选择第几行" @change="getCol">
<el-option
v-for="item in rowList" :key="item.id"
:label="item.name"
:value="item.id"
v-for="item in rowList" :key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
......@@ -611,9 +611,9 @@
<el-form-item label="第几列:">
<el-select v-model="bagCol" placeholder="请选择第几列">
<el-option
v-for="item in colList" :key="item.id"
:label="item.name"
:value="item.id"
v-for="item in colList" :key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
......@@ -736,7 +736,7 @@ const getBagRowLine = (no) => {
const params = {
deviceNo: no
}
getDataFun((url,params).then(res => {
getDataFun(url,params).then(res => {
if (res.code === 1) {
rowLineMap.value = res.data;
res.data.forEach(item => {
......@@ -744,13 +744,12 @@ const getBagRowLine = (no) => {
});
}
})
)
}
const getCol = ()=>{
rowLineMap.value.forEach(item => {
if (item.row === bagRow.value) {
colList.value.push(item.columns);
colList.value = item.columns;
}
});
}
......@@ -819,7 +818,7 @@ const dispatchHandle = async (url,param) => {
const basicConfiguration = reactive({
ticketEventName: [{ name: '全部', id: '' }],
eventTypeList: [],
branchFactoryList: [{ branchFactory: '全部', branchFactoryId: '' }],
productLineList: [{productionLineName: '全部', productionLineId: ''}],
deviceList: []
});
......@@ -996,6 +995,11 @@ const changeBag = (data)=>{
const tableData = ref([]);
const tableColumns = ref([
{
prop: 'index',
label: '序号',
width: '6%'
},
{
prop: 'workTicketNo',
label: '编号',
......@@ -1017,7 +1021,7 @@ const tableColumns = ref([
width: '10%'
},
{
prop: 'deviceType',
prop: 'typeName',
label: '设备类型',
width: '10%'
},
......@@ -1027,11 +1031,11 @@ const tableColumns = ref([
width: '10%'
},
{
prop: 'branchFactory', label: '所属区域',width: '10%' },
prop: 'productionLine', label: '所属工序',width: '10%' },
{ prop: 'warnTypeName', label: '类型',width: '10%' },
{ prop: 'createTime', label: '发生时间',width: '10%' },
{ prop: 'desc', label: '闭环状态',width: '10%' },
{ prop: 'person', label: '处理人',width: '10%' },
{ prop: 'handleUser', label: '处理人',width: '10%' },
{ prop: 'level', label: '级别',width: '5%' },
{
prop: "operation",
......@@ -1040,33 +1044,8 @@ const tableColumns = ref([
},
]);
const permissionBranchFactory = JSON.parse(sessionStorage.getItem('branchFactoryList'))|| [];
const customerId = getToken('customerId');
const getBranchTypeList = ()=> {
const url = '/transaction/getBranchFactory';
const params = {
customerId
}
getDataFun(url,params).then(res => {
if (res && res.code === 1) {
const branchFactory = res.data;
if (permissionBranchFactory.length === 0) {
basicConfiguration.branchFactoryList = [];
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
basicConfiguration.branchFactoryList = basicConfiguration.branchFactoryList.concat(branchFactory);
} else {
basicConfiguration.branchFactoryList = branchFactory.filter((item) =>
permissionBranchFactory.includes(item.branchFactoryId)
);
basicConfiguration.branchFactoryList.unshift({ branchFactory: '全部', branchFactoryId: '' });
}
}
});
}
const getWarnAndTicketConfigMap = ()=> {
const url = '/system/getWarnAndTicketConfigMap';
const params = {
......@@ -1092,18 +1071,6 @@ let realBtn = '';
const searchData =()=> {
currentPage.value = 1;
pageSize.value = 20;
if (!formInline.value.branchFactoryIds) {
if (permissionBranchFactory.length === 0) {
realBtn = -1;
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
realBtn = '';
} else {
realBtn = permissionBranchFactory.join(',');
}
} else {
realBtn = formInline.value.branchFactoryIds;
}
getTableData();
}
......@@ -1120,7 +1087,7 @@ const getTableData = ()=> {
pageSize: pageSize.value,
handleState: 1,
belongTo: 1,
isDctom: 1,
isDcTom: 1,
deviceType: formInline.value.deviceType
}
tableData.value = [];
......@@ -1131,6 +1098,17 @@ const getTableData = ()=> {
total.value = res.data.total;
disposeType(list);
tableData.value = list;
tableData.value.forEach(item => {
item.handleUser = '';
item.handleUsers.forEach((ele,eIndex)=>{
if (eIndex > 0) {
item.handleUser += ',' + ele.userName;
} else {
item.handleUser += ele.userName;
}
});
});
}
});
}
......@@ -1215,7 +1193,7 @@ const disposeWorkSheetDetail = (obj)=> {
}
onMounted(()=>{
getBranchTypeList();
getProDuctLine();
getWarnAndTicketConfigMap();
getDeviceType();
searchData();
......@@ -1224,6 +1202,12 @@ onMounted(()=>{
const formModel = ref({
selectReason: [],
});
const getProDuctLine = ()=>{
const url = '/transaction/getProductionLine';
getData(url).then(res => {
basicConfiguration.productLineList = res.data;
});
}
const currentPage = ref(1);
......
......@@ -8,15 +8,15 @@
<el-form-item label="发生位置:">
<el-input v-model="formInline.keyword" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="所属区域:">
<el-select v-model="formInline.branchFactoryIds"
<el-form-item label="所属工序:">
<el-select v-model="formInline.productionLineId"
placeholder="请选择"
style="width: 180px"
>
<el-option v-for="(item, index) in basicConfiguration.branchFactoryList"
:key="item.branchFactoryId"
:label="item.branchFactory"
:value="item.branchFactoryId"
<el-option v-for="(item, index) in basicConfiguration.productLineList"
:key="item.productionLineId"
:label="item.productionLineName"
:value="item.productionLineId"
/>
</el-select>
</el-form-item>
......@@ -77,14 +77,14 @@
<span class="view-btn" @click="handleView(row)">
查看
</span>
<span class="table-btn">|</span>
<!-- <span class="table-btn">|</span>
<span class="view-btn" @click="handleReject(row)">
驳回
</span>
<span class="table-btn">|</span>
<span class="view-btn" @click="changeBag(row)">
更换布袋
</span>
</span>-->
</template>
</common-table>
</div>
......@@ -123,9 +123,9 @@
<div class="label-title">告警信息</div>
<div class="alarm-content">
<div class="content-item">
<span class="name">所属区域</span>
<span class="name">所属工序</span>
<span class="value">{{
workSheetDetail.branchFactory || "--"
workSheetDetail.productionLine || "--"
}}</span>
</div>
<div class="content-item">
......@@ -711,9 +711,9 @@
<el-form-item label="第几行:">
<el-select v-model="bagRow" placeholder="请选择第几行" @change="getCol">
<el-option
v-for="item in rowList" :key="item.id"
:label="item.name"
:value="item.id"
v-for="item in rowList" :key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
......@@ -721,9 +721,9 @@
<el-form-item label="第几列:">
<el-select v-model="bagCol" placeholder="请选择第几列">
<el-option
v-for="item in colList" :key="item.id"
:label="item.name"
:value="item.id"
v-for="item in colList" :key="item"
:label="item"
:value="item"
>
</el-option>
</el-select>
......@@ -817,7 +817,7 @@ const getBagRowLine = (no) => {
const params = {
deviceNo: no
}
getDataFun((url,params).then(res => {
getDataFun(url,params).then(res => {
if (res.code === 1) {
rowLineMap.value = res.data;
res.data.forEach(item => {
......@@ -825,13 +825,12 @@ const getBagRowLine = (no) => {
});
}
})
)
}
const getCol = ()=>{
rowLineMap.value.forEach(item => {
if (item.row === bagRow.value) {
colList.value.push(item.columns);
colList.value = item.columns;
}
});
}
......@@ -902,12 +901,19 @@ const getIndex = (index) => {
const basicConfiguration = reactive({
ticketEventName: [],
branchFactoryList: [{ branchFactory: "全部", branchFactoryId: "" }],
deviceList: []
deviceList: [],
productLineList: [{productionLineName: '全部', productionLineId: ''}],
});
const workSheetDetail = ref(null);
const getProDuctLine = ()=>{
const url = '/transaction/getProductionLine';
getData(url).then(res => {
basicConfiguration.productLineList = res.data;
});
}
const getColor = computed(()=>{
return (level) => {
if (level == 2) {
......@@ -1044,6 +1050,11 @@ const changeBag = (data)=>{
const tableData = ref([]);
const tableColumns = ref([
{
prop: 'index',
label: '序号',
width: '6%'
},
{
prop: 'workTicketNo',
label: '编号',
......@@ -1065,7 +1076,7 @@ const tableColumns = ref([
width: '10%'
},
{
prop: 'deviceType',
prop: 'typeName',
label: '设备类型',
width: '10%'
},
......@@ -1075,11 +1086,12 @@ const tableColumns = ref([
width: '10%'
},
{
prop: 'branchFactory', label: '所属区域',width: '10%' },
prop: 'productionLine', label: '所属工序',width: '10%' },
{ prop: 'warnTypeName', label: '类型',width: '10%' },
{ prop: 'createTime', label: '发生时间',width: '10%' },
{ prop: 'desc', label: '闭环状态',width: '10%' },
{ prop: 'person', label: '处理人',width: '10%' },
{ prop: 'handleUser', label: '处理人',width: '10%' },
{ prop: 'finishTime', label: '完成时间',width: '10%' },
{ prop: 'level', label: '级别',width: '5%' },
{
prop: "operation",
......@@ -1088,32 +1100,10 @@ const tableColumns = ref([
},
]);
const permissionBranchFactory = JSON.parse(sessionStorage.getItem('branchFactoryList'))|| [];
const customerId = getToken('customerId');
const getBranchTypeList = ()=> {
const url = '/transaction/getBranchFactory';
const params = {
customerId
}
getDataFun(url,params).then(res => {
if (res && res.code === 1) {
const branchFactory = res.data;
if (permissionBranchFactory.length === 0) {
basicConfiguration.branchFactoryList = [];
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
basicConfiguration.branchFactoryList = basicConfiguration.branchFactoryList.concat(branchFactory);
} else {
basicConfiguration.branchFactoryList = branchFactory.filter((item) =>
permissionBranchFactory.includes(item.branchFactoryId)
);
basicConfiguration.branchFactoryList.unshift({ branchFactory: '全部', branchFactoryId: '' });
}
}
const customerId = getToken('customerId');
});
}
const getWarnAndTicketConfigMap = ()=> {
const url = '/system/getWarnAndTicketConfigMap';
......@@ -1134,17 +1124,6 @@ const searchData = ()=>{
currentPage.value = 1;
pageSize.value = 20;
if (!formInline.value.branchFactoryIds) {
if (permissionBranchFactory.length === 0) {
realBtn = -1;
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
realBtn = '';
} else {
realBtn = permissionBranchFactory.join(',');
}
} else {
realBtn = formInline.value.branchFactoryIds;
}
getTableData();
}
......@@ -1163,7 +1142,7 @@ const getTableData = ()=> {
pageSize: pageSize.value,
handleState: 2,
belongTo: 1,
isDctom: 1,
isDcTom: 1,
deviceType: formInline.value.deviceType
}
tableData.value = [];
......@@ -1174,6 +1153,16 @@ const getTableData = ()=> {
total.value = res.data.total;
disposeType(list);
tableData.value = list;
tableData.value.forEach(item => {
item.handleUser = '';
item.handleUsers.forEach((ele,eIndex)=>{
if (eIndex > 0) {
item.handleUser += ',' + ele.userName;
} else {
item.handleUser += ele.userName;
}
});
});
}
});
}
......@@ -1225,7 +1214,7 @@ const getDeviceType =() => {
}
onMounted(() => {
getBranchTypeList();
getProDuctLine();
getWarnAndTicketConfigMap();
getDeviceType();
searchData();
......
......@@ -82,13 +82,13 @@
<el-dialog
class="dustListDialog"
v-model="dustLineisShow"
title="仓室数量设置"
title="更换周期分析"
width="1000px"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<div class="input-group">
<span>仓室编号</span>
<span>除尘器名称</span>
<el-select
v-model="selectDustNo"
@change="changeDust"
......@@ -149,12 +149,12 @@ const tableColumns = ref([
{
prop: "compart",
label: "仓室",
width: "8%",
width: "10%",
},
{
prop: "bagLocation",
label: "布袋位置(排/列)",
width: "8%",
width: "6%",
},
{
prop: "bagChangeNextTime",
......@@ -169,13 +169,13 @@ const tableColumns = ref([
{
prop: "bagChangeAuthor",
label: "更换人",
width: "8%",
},
{
prop: "dusterName",
label: "所属除尘器",
width: "8%",
width: "5%",
},
// {
// prop: "dusterName",
// label: "所属除尘器",
// width: "8%",
// },
{
prop: "bagChangePeriod",
label: "更换周期(与上次更换比)",
......
......@@ -341,8 +341,6 @@ const handleRoomSettingConfirm = (data) => {
ElMessage.success("更新仓室数量成功");
roomSettingVisible.value = false;
getData();
} else {
ElMessage.error(res.message);
}
});
};
......@@ -411,8 +409,6 @@ const setValveInfo = (data) => {
ElMessage.success("更新电磁阀数量成功");
valveSettingVisible.value = false;
getData();
} else {
ElMessage.error(res.message);
}
});
};
......@@ -432,12 +428,10 @@ const handleSaveDustCollector = (data) => {
isAddDustCollectorVisible.value = false;
currentEditingDustCollector.value = null;
getData();
} else {
ElMessage.error(res.message);
}
})
.catch((err) => {
ElMessage.error(err.message);
// ElMessage.error(err.message);
});
} else {
// 新增模式
......@@ -448,12 +442,10 @@ const handleSaveDustCollector = (data) => {
currentEditingDustCollector.value = null;
isAddDustCollectorVisible.value = false;
refreshData();
} else {
ElMessage.error(res.message);
}
})
.catch((err) => {
ElMessage.error(err.message);
// ElMessage.error(err.message);
});
}
};
......@@ -498,8 +490,6 @@ const getData = () => {
if (res.code == 1) {
tableData.value = res.data.records || [];
total.value = res.data.total || 0;
} else {
ElMessage.error(res.message);
}
});
};
......
......@@ -13,7 +13,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="设备类">
<el-form-item label="设备类">
<el-select v-model="formInline.deviceType" style="width: 200px">
<el-option
v-for="i in typeList.list"
......@@ -63,10 +63,8 @@
<template #index="{ $index }">
{{ getIndex($index) }}
</template>
<template #deviceName="{ row }">
<span class="health-score" @dblclick="openDialog(row.deviceName)">{{
row.deviceName
}}</span>
<template #operate="{ row }">
<span class="health-score" @click="linkTo(row)">挂起期间告警</span>
</template>
<!-- <template #operation="{ row }">
<span class="view-btn" @click="handleView(row)">详情</span>
......@@ -82,7 +80,9 @@
import { ref, onMounted, onBeforeUnmount, computed, reactive } from "vue";
import CommonTable from "@/components/commonTable/index.vue";
import { getDataFun, postDataJSON } from "@/request/method.js";
import { useRoute, useRouter } from "vue-router";
const router = useRouter();
const formInline = ref({
projectId: "",
deviceType: "",
......@@ -98,11 +98,11 @@ const tableColumns = ref([
label: "序号",
width: "5%",
},
{
prop: "projectName",
label: "项目名称",
width: "7%",
},
// {
// prop: "projectName",
// label: "项目名称",
// width: "7%",
// },
{
prop: "deviceNo",
label: "设备编号",
......@@ -159,7 +159,7 @@ const tableColumns = ref([
width: "7%",
},
{
prop: "lastAlarmTime",
prop: "operate",
label: "操作",
width: "8%",
},
......@@ -267,6 +267,17 @@ const getManagementList = () => {
});
};
const linkTo = (item) => {
router.push({
path: "/alerts",
query: {
deviceName: item.deviceName,
suspendStartTime: item.suspendStartTime,
suspendEndTime: item.suspendEndTime,
},
});
};
onMounted(async () => {
getNameList();
getTypeList();
......
......@@ -1086,7 +1086,6 @@ export default {
path: this.redirect || "/",
query: this.otherQuery,
});
startPermissionCheck();
})
.catch((e) => {
console.log("error fetch verify code!!" + e);
......
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