This commit is contained in:
caoqianming 2024-05-09 17:36:41 +08:00
commit e508d879e1
12 changed files with 2052 additions and 1320 deletions

View File

@ -111,6 +111,15 @@ export default {
);
}
},
mplogx: {
name: "测点采集数据",
req: async function(data){
return await http.get(
`${config.API_URL}/enm/mplogx/`,
data
);
}
},
enstat2: {
name: "全厂统计记录",
req: async function(data){

View File

@ -2372,7 +2372,7 @@ const routes = [
"name": "formula",
"path": "/enm_base/formula",
"meta": {
"title": "计算公式",
"title": "计算系数",
"icon": "el-icon-grid",
"perms": ["enm_base"]
},

View File

@ -6,11 +6,16 @@
<div class="logo-bar">
<!-- <img class="logo" src="img/bbmg.png"> -->
<!-- <span>{{ $CONFIG.APP_NAME }}</span> -->
<img class="logo" :src="baseLogo">
<img class="logo" :src="baseLogo" />
<span>{{ baseName }}</span>
</div>
<ul v-if="!ismobile" class="nav">
<li v-for="item in menu" :key="item" :class="pmenu.path == item.path ? 'active' : ''" @click="showMenu(item)">
<li
v-for="item in menu"
:key="item"
:class="pmenu.path == item.path ? 'active' : ''"
@click="showMenu(item)"
>
<el-icon>
<component :is="item.meta.icon || 'el-icon-menu'" />
</el-icon>
@ -23,21 +28,35 @@
</div>
</header>
<section class="aminui-wrapper">
<div v-if="!ismobile && nextMenu.length > 0 || !pmenu.component"
:class="menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'">
<div
v-if="(!ismobile && nextMenu.length > 0) || !pmenu.component"
:class="
menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'
"
>
<div v-if="!menuIsCollapse" class="adminui-side-top">
<h2>{{ pmenu.meta.title }}</h2>
</div>
<div class="adminui-side-scroll">
<el-scrollbar>
<el-menu :default-active="active" router :collapse="menuIsCollapse"
:unique-opened="$CONFIG.MENU_UNIQUE_OPENED">
<el-menu
:default-active="active"
router
:collapse="menuIsCollapse"
:unique-opened="$CONFIG.MENU_UNIQUE_OPENED"
>
<NavMenu :navMenus="nextMenu"></NavMenu>
</el-menu>
</el-scrollbar>
</div>
<div class="adminui-side-bottom" @click="$store.commit('TOGGLE_menuIsCollapse')">
<el-icon><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold v-else /></el-icon>
<div
class="adminui-side-bottom"
@click="$store.commit('TOGGLE_menuIsCollapse')"
>
<el-icon
><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold
v-else
/></el-icon>
</div>
</div>
<Side-m v-if="ismobile"></Side-m>
@ -46,8 +65,14 @@
<Tags v-if="!ismobile && layoutTags"></Tags>
<div class="adminui-main" id="adminui-main">
<router-view v-slot="{ Component }">
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
<component :is="Component" :key="$route.fullPath" v-if="$store.state.keepAlive.routeShow" />
<keep-alive
:include="this.$store.state.keepAlive.keepLiveRoute"
>
<component
:is="Component"
:key="$route.fullPath"
v-if="$store.state.keepAlive.routeShow"
/>
</keep-alive>
</router-view>
<iframe-view></iframe-view>
@ -60,8 +85,16 @@
<template v-else-if="layout == 'menu'">
<header class="adminui-header">
<div class="adminui-header-left">
<div class="logo-bar" style="width: 202px;background: #ffffff;margin-right: 10px;border-radius: 5px;">
<img class="logo" :src="baseLogo">
<div
class="logo-bar"
style="
width: 202px;
background: #ffffff;
margin-right: 10px;
border-radius: 5px;
"
>
<img class="logo" :src="baseLogo" />
<!-- <img class="logo" src="/img/bbmg.jpg"> -->
</div>
<div class="logo-bar">
@ -73,17 +106,32 @@
</div>
</header>
<section class="aminui-wrapper">
<div v-if="!ismobile" :class="menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'">
<div
v-if="!ismobile"
:class="
menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'
"
>
<div class="adminui-side-scroll">
<el-scrollbar>
<el-menu :default-active="active" router :collapse="menuIsCollapse"
:unique-opened="$CONFIG.MENU_UNIQUE_OPENED">
<el-menu
:default-active="active"
router
:collapse="menuIsCollapse"
:unique-opened="$CONFIG.MENU_UNIQUE_OPENED"
>
<NavMenu :navMenus="menu"></NavMenu>
</el-menu>
</el-scrollbar>
</div>
<div class="adminui-side-bottom" @click="$store.commit('TOGGLE_menuIsCollapse')">
<el-icon><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold v-else /></el-icon>
<div
class="adminui-side-bottom"
@click="$store.commit('TOGGLE_menuIsCollapse')"
>
<el-icon
><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold
v-else
/></el-icon>
</div>
</div>
<Side-m v-if="ismobile"></Side-m>
@ -92,8 +140,14 @@
<!-- <Tags v-if="!ismobile && layoutTags"></Tags> -->
<div class="adminui-main" id="adminui-main">
<router-view v-slot="{ Component }">
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
<component :is="Component" :key="$route.fullPath" v-if="$store.state.keepAlive.routeShow" />
<keep-alive
:include="this.$store.state.keepAlive.keepLiveRoute"
>
<component
:is="Component"
:key="$route.fullPath"
v-if="$store.state.keepAlive.routeShow"
/>
</keep-alive>
</router-view>
<iframe-view></iframe-view>
@ -107,14 +161,20 @@
<header class="adminui-header">
<div class="adminui-header-left">
<div class="logo-bar">
<img class="logo" src="img/bbmg.jpg">
<img class="logo" src="img/bbmg.jpg" />
<span>{{ $CONFIG.APP_NAME }}</span>
</div>
</div>
<div class="adminui-header-right">
<div v-if="!ismobile" class="adminui-header-menu">
<el-menu mode="horizontal" :default-active="active" router background-color="#222b45" text-color="#fff"
active-text-color="var(--el-color-primary)">
<el-menu
mode="horizontal"
:default-active="active"
router
background-color="#222b45"
text-color="#fff"
active-text-color="var(--el-color-primary)"
>
<NavMenu :navMenus="menu"></NavMenu>
</el-menu>
</div>
@ -127,8 +187,14 @@
<Tags v-if="!ismobile && layoutTags"></Tags>
<div class="adminui-main" id="adminui-main">
<router-view v-slot="{ Component }">
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
<component :is="Component" :key="$route.fullPath" v-if="$store.state.keepAlive.routeShow" />
<keep-alive
:include="this.$store.state.keepAlive.keepLiveRoute"
>
<component
:is="Component"
:key="$route.fullPath"
v-if="$store.state.keepAlive.routeShow"
/>
</keep-alive>
</router-view>
<iframe-view></iframe-view>
@ -143,16 +209,26 @@
<div v-if="!ismobile" class="aminui-side-split">
<div class="aminui-side-split-top">
<router-link :to="$CONFIG.DASHBOARD_URL">
<img class="logo" :title="$CONFIG.APP_NAME" src="img/logo-r.png">
<img
class="logo"
:title="$CONFIG.APP_NAME"
src="img/logo-r.png"
/>
</router-link>
</div>
<div class="adminui-side-split-scroll">
<el-scrollbar>
<ul>
<li v-for="item in menu" :key="item" :class="pmenu.path == item.path ? 'active' : ''"
@click="showMenu(item)">
<li
v-for="item in menu"
:key="item"
:class="pmenu.path == item.path ? 'active' : ''"
@click="showMenu(item)"
>
<el-icon>
<component :is="item.meta.icon || el-icon-menu" />
<component
:is="item.meta.icon || el - icon - menu"
/>
</el-icon>
<p>{{ item.meta.title }}</p>
</li>
@ -160,21 +236,35 @@
</el-scrollbar>
</div>
</div>
<div v-if="!ismobile && nextMenu.length > 0 || !pmenu.component"
:class="menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'">
<div
v-if="(!ismobile && nextMenu.length > 0) || !pmenu.component"
:class="
menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'
"
>
<div v-if="!menuIsCollapse" class="adminui-side-top">
<h2>{{ pmenu.meta.title }}</h2>
</div>
<div class="adminui-side-scroll">
<el-scrollbar>
<el-menu :default-active="active" router :collapse="menuIsCollapse"
:unique-opened="$CONFIG.MENU_UNIQUE_OPENED">
<el-menu
:default-active="active"
router
:collapse="menuIsCollapse"
:unique-opened="$CONFIG.MENU_UNIQUE_OPENED"
>
<NavMenu :navMenus="nextMenu"></NavMenu>
</el-menu>
</el-scrollbar>
</div>
<div class="adminui-side-bottom" @click="$store.commit('TOGGLE_menuIsCollapse')">
<el-icon><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold v-else /></el-icon>
<div
class="adminui-side-bottom"
@click="$store.commit('TOGGLE_menuIsCollapse')"
>
<el-icon
><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold
v-else
/></el-icon>
</div>
</div>
<Side-m v-if="ismobile"></Side-m>
@ -185,8 +275,14 @@
<Tags v-if="!ismobile && layoutTags"></Tags>
<div class="adminui-main" id="adminui-main">
<router-view v-slot="{ Component }">
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
<component :is="Component" :key="$route.fullPath" v-if="$store.state.keepAlive.routeShow" />
<keep-alive
:include="this.$store.state.keepAlive.keepLiveRoute"
>
<component
:is="Component"
:key="$route.fullPath"
v-if="$store.state.keepAlive.routeShow"
/>
</keep-alive>
</router-view>
<iframe-view></iframe-view>
@ -195,11 +291,19 @@
</section>
</template>
<div class="main-maximize-exit" @click="exitMaximize"><el-icon><el-icon-close /></el-icon></div>
<div class="main-maximize-exit" @click="exitMaximize">
<el-icon><el-icon-close /></el-icon>
</div>
<!-- <div class="layout-setting" @click="openSetting"><el-icon><el-icon-brush-filled /></el-icon></div> -->
<el-drawer title="布局实时演示" v-model="settingDialog" :size="400" append-to-body destroy-on-close>
<el-drawer
title="布局实时演示"
v-model="settingDialog"
:size="400"
append-to-body
destroy-on-close
>
<setting></setting>
</el-drawer>
@ -207,17 +311,17 @@
</template>
<script>
import SideM from './components/sideM.vue';
import Topbar from './components/topbar.vue';
import Tags from './components/tags.vue';
import NavMenu from './components/NavMenu.vue';
import userbar from './components/userbar.vue';
import setting from './components/setting.vue';
import iframeView from './components/iframeView.vue';
import autoExit from './other/autoExit.js';
import data from './../utils/baseJson';
import SideM from "./components/sideM.vue";
import Topbar from "./components/topbar.vue";
import Tags from "./components/tags.vue";
import NavMenu from "./components/NavMenu.vue";
import userbar from "./components/userbar.vue";
import setting from "./components/setting.vue";
import iframeView from "./components/iframeView.vue";
import autoExit from "./other/autoExit.js";
import data from "./../utils/baseJson";
export default {
name: 'index',
name: "index",
components: {
SideM,
Topbar,
@ -226,7 +330,7 @@ export default {
userbar,
setting,
iframeView,
autoExit
autoExit,
},
data() {
return {
@ -234,102 +338,136 @@ export default {
menu: [],
nextMenu: [],
pmenu: {},
active: ''
}
active: "",
};
},
computed: {
baseName() {
// let baseInFo = data[data.current];
let baseName = this.$TOOL.data.get("BASE_INFO") !== null ? this.$TOOL.data.get("BASE_INFO").base.base_name : '智能管理平台';
let baseName =
this.$TOOL.data.get("BASE_INFO") !== null
? this.$TOOL.data.get("BASE_INFO").base.base_name
: "智能管理平台";
// let baseName = baseInFo!==null?baseInFo.base.base_name:'';
return baseName;
},
baseLogo() {
// let baseInFo = data[data.current];
let base_logo = this.$TOOL.data.get("BASE_INFO") !== null ? this.$TOOL.data.get("BASE_INFO").base.base_logo : 'img/logo.png';
let base_logo =
this.$TOOL.data.get("BASE_INFO") !== null
? this.$TOOL.data.get("BASE_INFO").base.base_logo
: "img/logo.png";
// let base_logo = baseInFo!==null?baseInFo.base.base_logo:'img/logo.png';
return base_logo
return base_logo;
},
ismobile() {
return this.$store.state.global.ismobile
return this.$store.state.global.ismobile;
},
layout() {
return this.$store.state.global.layout
return this.$store.state.global.layout;
},
layoutTags() {
return this.$store.state.global.layoutTags
return this.$store.state.global.layoutTags;
},
menuIsCollapse() {
return this.$store.state.global.menuIsCollapse
}
return this.$store.state.global.menuIsCollapse;
},
},
created() {
document.title = this.$store.state.global.baseName
document.title = this.$store.state.global.baseName;
this.onLayoutResize();
window.addEventListener('resize', this.onLayoutResize);
window.addEventListener("resize", this.onLayoutResize);
var menu = this.$router.sc_getMenu();
// console.log("menu", menu);
this.menu = this.filterUrl(menu);
this.showThis()
// console.log("this.menu", this.menu);
this.showThis();
},
watch: {
$route() {
this.showThis()
this.showThis();
},
layout: {
handler(val) {
document.body.setAttribute('data-layout', val)
document.body.setAttribute("data-layout", val);
},
immediate: true,
}
},
},
methods: {
openSetting() {
this.settingDialog = true;
},
onLayoutResize() {
this.$store.commit("SET_ismobile", document.body.clientWidth < 992)
this.$store.commit("SET_ismobile", document.body.clientWidth < 992);
},
//
showThis() {
this.pmenu = this.$route.meta.breadcrumb ? this.$route.meta.breadcrumb[0] : {}
function hasPerm(perms_need, perms_have) {
let has = false;
for (var m = 0; m < perms_need.length; m++) {
if (perms_have.indexOf(perms_need[m]) > -1) {
has = true;
}
}
return has;
}
this.pmenu = this.$route.meta.breadcrumb
? this.$route.meta.breadcrumb[0]
: {};
let lists = this.pmenu.children;
let perms = this.$TOOL.data.get("PERMISSIONS") || [];
for (var i = 0; i < lists.length; i++) {
if (lists[i].meta && lists[i].meta.perms) {
let has = hasPerm(lists[i].meta.perms, perms);
if (!has) {
lists.splice(i, 1);
}
}
}
// console.log("this.pmenu.children", this.pmenu.children);
this.nextMenu = this.filterUrl(this.pmenu.children);
this.$nextTick(() => {
this.active = this.$route.meta.active || this.$route.fullPath;
})
});
},
//
showMenu(route) {
this.pmenu = route;
this.nextMenu = this.filterUrl(route.children);
if ((!route.children || route.children.length == 0) && route.component) {
this.$router.push({ path: route.path })
if (
(!route.children || route.children.length == 0) &&
route.component
) {
this.$router.push({ path: route.path });
}
},
//
filterUrl(map) {
var newMap = []
map && map.forEach(item => {
item.meta = item.meta ? item.meta : {};
//
if (item.meta.hidden || item.meta.type == "button") {
return false
}
//http
if (item.meta.type == 'iframe') {
item.path = `/i/${item.name}`;
}
//
if (item.children && item.children.length > 0) {
item.children = this.filterUrl(item.children)
}
newMap.push(item)
})
var newMap = [];
map &&
map.forEach((item) => {
item.meta = item.meta ? item.meta : {};
//
if (item.meta.hidden || item.meta.type == "button") {
return false;
}
//http
if (item.meta.type == "iframe") {
item.path = `/i/${item.name}`;
}
//
if (item.children && item.children.length > 0) {
item.children = this.filterUrl(item.children);
}
newMap.push(item);
});
return newMap;
},
//退
exitMaximize() {
document.getElementById('app').classList.remove('main-maximize')
}
}
}
document.getElementById("app").classList.remove("main-maximize");
},
},
};
</script>

View File

@ -398,6 +398,7 @@ import * as BABYLON from "babylonjs";
import * as BABYLON_GUI from "babylonjs-gui";
import * as BABYLON_GRID from "@/utils/gridMaterial";
import * as BABYLON_MATERIAL from "@/utils/babylonMaterial";
import config from "@/config";
BABYLON.DracoCompression.Configuration.decoder.wasmUrl =
"./draco_wasm_wrapper_gltf.js";
BABYLON.DracoCompression.Configuration.decoder.wasmBinaryUrl =

View File

@ -1,198 +1,413 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="table_add" v-auth="'mpoint.create'">新增</el-button>
<el-button type="warning" @click="king_sync" v-auth="'mpoint.create'">同步亚控测点</el-button>
<el-button type="primary" @click="batchUpdate" v-auth="'mpoint.update'">批量修改</el-button>
</div>
<div class="right-panel">
<el-select v-model="query.enabled" placeholder="是否启用" @change="handleQuery" clearable style="width:100px">
<el-option v-for="e in boolEnum.values" :key="e.key" :value="e.key"
:label="e.text"></el-option>
</el-select>
<el-select v-model="query.type" placeholder="测点类型" @change="handleQuery" clearable style="width:100px">
<el-option v-for="e in mpointTypeEnum.values" :key="e.key" :value="e.key"
:label="e.text"></el-option>
</el-select>
<el-select v-model="query.val_type" placeholder="值类型" @change="handleQuery" clearable style="width:100px">
<el-option v-for="e in valTypeEnum.values" :key="e.key" :value="e.key"
:label="e.text"></el-option>
</el-select>
<el-select v-model="query.need_display" placeholder="是否展示" @change="handleQuery" clearable style="width:100px">
<el-option v-for="e in boolEnum.values" :key="e.key" :value="e.key"
:label="e.text"></el-option>
</el-select>
<el-input
v-model="query.search"
placeholder="名称/代号"
style="width:200px"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" remoteSort @selection-change="selectionChange">
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="table_add"
v-auth="'mpoint.create'"
>新增</el-button
>
<el-button
type="warning"
@click="king_sync"
v-auth="'mpoint.create'"
>同步亚控测点</el-button
>
<el-button
type="primary"
@click="batchUpdate"
v-auth="'mpoint.update'"
>批量修改</el-button
>
</div>
<div class="right-panel">
<el-select
v-model="query.enabled"
placeholder="是否启用"
@change="handleQuery"
clearable
style="width: 100px"
>
<el-option
v-for="e in boolEnum.values"
:key="e.key"
:value="e.key"
:label="e.text"
></el-option>
</el-select>
<el-select
v-model="query.type"
placeholder="测点类型"
@change="handleQuery"
clearable
style="width: 100px"
>
<el-option
v-for="e in mpointTypeEnum.values"
:key="e.key"
:value="e.key"
:label="e.text"
></el-option>
</el-select>
<el-select
v-model="query.val_type"
placeholder="值类型"
@change="handleQuery"
clearable
style="width: 100px"
>
<el-option
v-for="e in valTypeEnum.values"
:key="e.key"
:value="e.key"
:label="e.text"
></el-option>
</el-select>
<el-select
v-model="query.need_display"
placeholder="是否展示"
@change="handleQuery"
clearable
style="width: 100px"
>
<el-option
v-for="e in boolEnum.values"
:key="e.key"
:value="e.key"
:label="e.text"
></el-option>
</el-select>
<el-input
v-model="query.search"
placeholder="名称/代号"
style="width: 200px"
clearable
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuery"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
remoteSort
:query="query"
:params="params"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50" />
<el-table-column label="名称" prop="name" width="200" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="别名" prop="nickname" width="120" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="代号" prop="code" width="130" show-overflow-tooltip sortable></el-table-column>
<el-table-column label="是否启用" width="80">
<template #default="scope">
<el-icon v-if="scope.row.enabled" color="green"
><CircleCheckFilled
/></el-icon>
<el-icon v-else color="red"><CircleCloseFilled /></el-icon>
</template>
</el-table-column>
<el-table-column label="采集状态" show-overflow-tooltip>
<template #default="scope">
<el-tag :type="mpointGatherStateEnum[scope.row.gather_state]?.type">{{
mpointGatherStateEnum[scope.row.gather_state]?.text }}</el-tag>
</template>
</el-table-column>
<el-table-column label="测点类型" width="80">
<template #default="scope">{{mpointTypeEnum[scope.row.type]?.text}}
</template>
</el-table-column>
<el-table-column label="采集间隔(s)" prop="interval" width="100"></el-table-column>
<el-table-column label="值类型" prop="val_type" width="80">
<template #default="scope">{{valTypeEnum[scope.row.val_type]?.text}}
</template>
</el-table-column>
<el-table-column label="单位" prop="unit" width="80"></el-table-column>
<el-table-column label="计量物料" prop="material_name" width="100"></el-table-column>
<el-table-column label="所属工段" prop="mgroup_name" width="100"></el-table-column>
<el-table-column label="是否展示" width="80">
<template #default="scope">
<el-icon v-if="scope.row.need_display" color="green"
><CircleCheckFilled
/></el-icon>
<el-icon v-else color="red"><CircleCloseFilled /></el-icon>
</template>
</el-table-column>
<el-table-column label="报告排序" prop="report_sortstr" width="100" sortable>
</el-table-column>
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip sortable width="160"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="140">
<el-table-column
label="名称"
prop="name"
width="200"
show-overflow-tooltip
sortable
></el-table-column>
<el-table-column
label="别名"
prop="nickname"
width="120"
show-overflow-tooltip
sortable
></el-table-column>
<el-table-column
label="代号"
prop="code"
width="130"
show-overflow-tooltip
sortable
></el-table-column>
<el-table-column label="是否启用" width="80">
<template #default="scope">
<el-button link size="small" @click="table_edit(scope.row)" v-auth="'mpoint.update'" type="primary">编辑</el-button>
<el-icon v-if="scope.row.enabled" color="green"
><CircleCheckFilled
/></el-icon>
<el-icon v-else color="red"
><CircleCloseFilled
/></el-icon>
</template>
</el-table-column>
<el-table-column label="采集状态" show-overflow-tooltip>
<template #default="scope">
<el-tag
:type="
mpointGatherStateEnum[scope.row.gather_state]
?.type
"
>{{
mpointGatherStateEnum[scope.row.gather_state]
?.text
}}</el-tag
>
</template>
</el-table-column>
<el-table-column label="测点类型" width="80">
<template #default="scope"
>{{ mpointTypeEnum[scope.row.type]?.text }}
</template>
</el-table-column>
<el-table-column
label="采集间隔(s)"
prop="interval"
width="100"
></el-table-column>
<el-table-column label="值类型" prop="val_type" width="80">
<template #default="scope"
>{{ valTypeEnum[scope.row.val_type]?.text }}
</template>
</el-table-column>
<el-table-column
label="单位"
prop="unit"
width="80"
></el-table-column>
<el-table-column
label="计量物料"
prop="material_name"
width="100"
></el-table-column>
<el-table-column
label="所属工段"
prop="mgroup_name"
width="100"
></el-table-column>
<el-table-column label="是否展示" width="80">
<template #default="scope">
<el-icon v-if="scope.row.need_display" color="green"
><CircleCheckFilled
/></el-icon>
<el-icon v-else color="red"
><CircleCloseFilled
/></el-icon>
</template>
</el-table-column>
<el-table-column
label="报告排序"
prop="report_sortstr"
width="100"
sortable
>
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
show-overflow-tooltip
sortable
width="160"
></el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="140"
>
<template #default="scope">
<el-button
link
size="small"
@click="mplog_record(scope.row)"
type="primary"
>原始记录</el-button
>
<el-divider direction="vertical"></el-divider>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<el-button
link
size="small"
@click="table_edit(scope.row)"
v-auth="'mpoint.update'"
type="primary"
>编辑</el-button
>
<el-divider direction="vertical"></el-divider>
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
>
<template #reference>
<el-button link size="small" v-auth="'mpoint.delete'" type="danger">删除</el-button>
<el-button
link
size="small"
v-auth="'mpoint.delete'"
type="danger"
>删除</el-button
>
</template>
</el-popconfirm>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-drawer
title="测点原始记录"
v-model="logShow"
:size="1000"
destroy-on-close
>
1111
</el-drawer>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
<el-drawer
title="测点原始记录"
v-model="logShow"
:size="1000"
destroy-on-close
>
<scTable ref="table" row-key="id" :data="mplogRecord">
<el-table-column type="selection" width="50" />
<el-table-column label="采集时间" prop="timex"></el-table-column>
<el-table-column label="采集数值">
<template #default="scope">
<span v-if="scope.row.val_int != null">{{
scope.row.val_int
}}</span>
<span v-else-if="scope.row.val_bool != null">{{
scope.row.val_bool
}}</span>
<span v-else-if="scope.row.val_str != null">{{
scope.row.val_str
}}</span>
<span v-else-if="scope.row.val_float != null">{{
scope.row.val_float
}}</span>
</template>
</el-table-column>
</scTable>
</el-drawer>
</template>
<script>
import saveDialog from "./mpoint_form.vue";
import { valTypeEnum, boolEnum, mpointTypeEnum, mpointGatherStateEnum } from "@/utils/enum.js";
import {
valTypeEnum,
boolEnum,
mpointTypeEnum,
mpointGatherStateEnum,
} from "@/utils/enum.js";
export default {
name: "rparty",
components: {
saveDialog,
},
data() {
return {
valTypeEnum,
boolEnum,
mpointTypeEnum,
mpointGatherStateEnum,
logShow:false,
dialog: {
save: false,
permission: false,
},
apiObj: this.$API.enm.mpoint.list,
query: {},
selection: []
};
},
methods: {
//
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
mplog(row){
this.logShow = true;
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
table_del(row) {
var id = row.id;
this.$API.enm.mpoint.delete.req(id).then(res=>{
if(res.err_msg){
this.$message.error(res.err_msg)
}else{
this.$refs.table.refresh();
this.$message.success("删除成功")
}
})
},
king_sync() {
const loading = this.$loading({text: '正在同步亚控测点...'});
this.$API.enm.mpoint.kingSync.req().then(res=>{
this.$refs.table.refresh();
}).finally(()=>{
loading.close()
})
},
//
handleSaveSuccess(data, mode) {
this.$refs.table.refresh();
},
handleQuery() {
this.$refs.table.queryData(this.query)
name: "rparty",
components: {
saveDialog,
},
data() {
return {
valTypeEnum,
boolEnum,
mpointTypeEnum,
mpointGatherStateEnum,
logShow: false,
dialog: {
save: false,
permission: false,
},
resetQuery() {
this.query = {};
},
selectionChange(rows){
console.log('m', rows)
}
},
apiObj: this.$API.enm.mpoint.list,
params: {},
query: {},
selection: [],
mplogRecord: [],
};
},
methods: {
//
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//
mplog_record(row) {
let that = this;
that.mplogRecord = [];
var nowDate = new Date();
let year = nowDate.getFullYear();
let month = nowDate.getMonth() + 1;
let day = nowDate.getDate();
let hour = nowDate.getHours();
month = month > 9 ? month : "0" + month;
day = day > 9 ? day : "0" + day;
if (hour > 0) {
hour = hour - 1;
hour = hour > 9 ? hour : "0" + hour;
} else {
hour = 23;
let timers = nowDate.getTime() - 1000 * 60 * 60; //
let useDate = new Date(timers);
year = useDate.getFullYear();
month = useDate.getMonth() + 1;
month = month > 9 ? month : "0" + month;
day = nowDate.getDate();
day = day > 9 ? day : "0" + day;
}
let obj = {};
obj.page = 0;
obj.mpoint = row.id;
obj.timex__gte =
year + "-" + month + "-" + day + " " + hour + ":00:00";
obj.timex__lte =
year + "-" + month + "-" + day + " " + hour + ":59:00";
that.$API.enm.mplogx.req(obj).then((res) => {
console.log("res", res);
that.mplogRecord = res;
that.logShow = true;
});
},
//
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//
table_del(row) {
var id = row.id;
this.$API.enm.mpoint.delete.req(id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("删除成功");
}
});
},
king_sync() {
const loading = this.$loading({ text: "正在同步亚控测点..." });
this.$API.enm.mpoint.kingSync
.req()
.then((res) => {
this.$refs.table.refresh();
})
.finally(() => {
loading.close();
});
},
//
handleSaveSuccess(data, mode) {
this.$refs.table.refresh();
},
handleQuery() {
// this.$refs.table.refresh();
this.$refs.table.queryData(this.query);
},
resetQuery() {
this.query = {};
},
selectionChange(rows) {
console.log("m", rows);
},
},
};
</script>
</script>

View File

@ -1,104 +1,61 @@
<template>
<el-container class="page-user">
<el-aside style="width: 240px">
<el-container>
<el-main class="nopadding">
<el-menu class="menu" :default-active="page">
<el-menu-item-group
v-for="group in menu"
:key="group.groupName"
:title="group.groupName"
>
<el-menu-item
v-for="item in group.list"
:key="item.component"
:index="item.component"
@click="openPage"
>
<el-icon v-if="item.icon"
><component :is="item.icon"
/></el-icon>
<template #title>
<span>{{ item.title }}</span>
</template>
</el-menu-item>
</el-menu-item-group>
</el-menu>
</el-main>
</el-container>
</el-aside>
<el-container>
<el-main>
<Suspense>
<template #default>
<component :is="page" />
</template>
<template #fallback>
<el-skeleton :rows="3" />
</template>
</Suspense>
<el-card header="计算系数" shadow="hover">
<el-form>
<el-form-item label="料号系数">
<el-input-number
v-model="form.enm_lhxs"
controls-position="right"
placeholder="料号系数"
></el-input-number>
</el-form-item>
<el-form-item style="float: right">
<el-button
type="primary"
:loading="saveLoading"
@click="submitForm"
>保存</el-button
>
</el-form-item>
</el-form>
</el-card>
</el-main>
</el-container>
</template>
<script>
import { defineAsyncComponent } from "vue";
export default {
name: "userCenter",
components: {
calculate: defineAsyncComponent(() =>
import("./settings/calculate.vue")
),
},
data() {
return {
form: {},
menu: [
{
groupName: "配置",
list: [
{
icon: "el-icon-platform",
title: "计算系数",
component: "calculate",
},
],
},
],
userData: {},
page: "calculate",
saveLoading: false,
form: {
enm_lhxs: "",
},
};
},
// from
beforeRouteEnter(to, from, next) {
next((vm) => {
if (from.is) {
//
delete from.is;
//
vm.$alert("路由跳转过来后含有特殊标识,做特殊处理", "提示", {
type: "success",
center: true,
})
.then(() => {})
.catch(() => {});
}
});
},
mounted() {
this.getSysConfig();
},
methods: {
openPage(item) {
this.page = item.index;
},
getSysConfig() {
this.$API.system.config.getInfo.req().then((res) => {
this.form = res.base;
this.form = res.enm;
});
},
submitForm() {
this.saveLoading = true;
let obj = {};
obj.enm = this.form;
this.$API.system.config.updateInfo
.req(obj)
.then((res) => {
this.saveLoading = false;
})
.catch((res) => {
this.saveLoading = false;
});
},
},
};
</script>
<style scoped></style>

View File

@ -1,52 +0,0 @@
<template>
<el-container>
<el-main>
<el-card header="计算系数" shadow="hover">
<el-form>
<el-form-item label="熟料料耗系数">
<el-input-number
v-model="form.enm_lhxs"
controls-position="right"
placeholder="熟料料耗系数"
></el-input-number>
</el-form-item>
<el-form-item style="float: right">
<el-button
type="primary"
:loading="saveLoading"
@click="submitForm"
>保存</el-button
>
</el-form-item>
</el-form>
</el-card>
</el-main>
</el-container>
</template>
<script>
export default {
data() {
return {
saveLoading: false,
form: {
enm_lhxs: "",
},
};
},
mounted() {},
methods: {
submitForm() {
this.saveLoading = true;
this.$API.system.config.update
.req(this.form)
.then((res) => {
this.saveLoading = false;
})
.catch((res) => {
this.saveLoading = false;
});
},
},
};
</script>

View File

@ -136,43 +136,13 @@ export default {
return {
year: "",
month: "",
days: "",
myChart: null,
search_date: "",
headerLength: 33,
itemVisible: false,
xAxisData: [],
tableDatas: [
["石灰石破碎", "破碎机", "kw.h"], //0
["石灰石破碎", "堆取料机", "kw.h"],
["石灰石破碎", "低压变压器柜", "kw.h"],
["石灰石破碎", "石灰石破碎合计", "kw.h"],
["原料磨", "循环风机", "kw.h"],
["原料磨", "辊压机", "kw.h"],
["原料磨", "调配变压器", "kw.h"],
["原料磨", "低压变压器柜器", "kw.h"],
["原料磨", "原料磨系统合计", "kw.h"],
["回转窑", "尾排风机", "kw.h"],
["回转窑", "高温风机", "kw.h"],
["回转窑", "头排风机", "kw.h"],
["回转窑", "低压变压器柜", "kw.h"],
["回转窑", "回转窑烧成系统合计", "kw.h"],
["煤磨", "煤磨主电机", "kw.h"],
["煤磨", "煤磨排风机", "kw.h"],
["煤磨", "低压变压器柜", "kw.h"],
["煤磨", "煤磨系统合计", "kw.h"],
["余热发电", "余热发电量", "kw.h"],
["余热发电", "余热发电自用电量", "kw.h"],
["余热发电", "余热供电量", "kw.h"],
["空压机", "1#空压机", "kw.h"],
["空压机", "2#空压机", "kw.h"],
["空压机", "3#空压机", "kw.h"],
["空压机", "4#空压机", "kw.h"],
["空压机", "空压机合计", "kw.h"],
["富氧燃烧系统", "富氧燃烧耗电设备", "kw.h"],
["生产总耗电量", "生产部分总耗电", "kw.h"],
["全厂进线", "全厂耗电量", "kw.h"],
],
mpointList: [],
tableDatas: [],
timeStamp: null,
tableWidth: "3300",
itemChartTitle: "",
@ -275,26 +245,20 @@ export default {
mounted() {
let that = this;
var nowDate = new Date();
that.year = nowDate.getFullYear();
that.month = nowDate.getMonth() + 1;
that.days = new Date(that.year, that.month, 0).getDate();
let year = nowDate.getFullYear();
let month = nowDate.getMonth() + 1;
month = month > 9 ? month : "0" + month;
that.search_date = year + "-" + month;
that.year = year;
that.month = month;
that.days = new Date(year, month, 0).getDate();
that.timeStamp = nowDate.getTime();
let month0 = that.month > 9 ? that.month : "0" + that.month;
that.search_date = that.year + "-" + month0;
that.headerLength = that.days + 4;
that.tableWidth = that.headerLength * 100 + "";
let tableDatas = that.tableDatas;
for (let i = 0; i < tableDatas.length; i++) {
for (let j = 0; j < that.days; j++) {
let k = 3 + j;
that.tableDatas[i][k] = 0;
this.$forceUpdate();
}
}
for (let n = 1; n <= that.days; n++) {
that.xAxisData.push(n + "日");
}
this.getData();
this.getMPoints();
},
methods: {
dateChange(e) {
@ -302,215 +266,263 @@ export default {
let arr = e.split("-");
that.year = Number(arr[0]);
that.month = Number(arr[1]);
for (let i = 0; i < that.tableDatas.length; i++) {
for (let j = 0; j < that.days + 1; j++) {
let k = 3 + j;
that.tableDatas[i][k] = 0;
this.$forceUpdate();
}
}
let nowDate = new Date();
that.timeStamp = nowDate.getTime();
this.getData();
this.dataLoop();
},
getData() {
getMPoints() {
let that = this;
function dataPush(name) {
let index = 0;
if (name == "破碎机") {
index = 0;
} else if (name == "堆取料机") {
index = 1;
} else if (name == "低压变压器柜") {
index = 2;
} else if (name == "循环风机") {
index = 4;
} else if (name == "调配变压器") {
index = 6;
} else if (name == "低压变压器柜器") {
index = 7;
} else if (name == "尾排风机") {
index = 9;
} else if (name == "高温风机") {
index = 10;
} else if (name == "头排风机") {
index = 11;
} else if (name == "煤磨主电机") {
index = 14;
} else if (name == "煤磨排风机") {
index = 15;
} else if (name == "低压变压器柜") {
index = 16;
} else if (name == "余热发电量") {
index = 18;
} else if (name == "余热发电自用电量") {
index = 19;
} else if (name == "1#空压机") {
index = 21;
} else if (name == "2#空压机") {
index = 22;
} else if (name == "3#空压机") {
index = 23;
} else if (name == "4#空压机") {
index = 24;
} else if (name == "富氧燃烧耗电设备") {
index = 26;
}
return index;
}
function sumNum(a, b, c, d) {
let sum = 0;
if (typeof a !== "undefined" && a !== "NaN") {
sum = sum + Number(a);
}
if (typeof b !== "undefined" && a !== "NaN") {
sum = sum + Number(b);
}
if (typeof c !== "undefined" && a !== "NaN") {
sum = sum + Number(c);
}
if (typeof d !== "undefined" && a !== "NaN") {
sum = sum + Number(d);
}
return sum;
}
let obj = {};
obj.type = "day_s";
obj.year_s = that.year;
obj.month_s = that.month;
obj.page = 0;
obj.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat
.req(obj)
.then((res) => {
let wrapArr = [],
innerArr = [];
res.forEach((item) => {
let day = item.day_s;
if (wrapArr[day]) {
wrapArr[day].push(item);
} else {
wrapArr[day] = [];
wrapArr[day].push(item);
}
});
wrapArr.forEach((inner, inde) => {
inner.forEach((item) => {
let i = dataPush(item.mpoint_name);
let k = 0;
if (
i == 0 ||
i == 4 ||
i == 9 ||
i == 14 ||
i == 18 ||
i == 21 ||
i == 26 ||
i == 27 ||
i == 28
) {
k = 3 + inde;
} else {
k = 2 + inde;
}
that.tableDatas[i][k] = item.val;
});
});
for (let k = 0; k < that.headerLength; k++) {
let m = k + 3;
let n = k + 1;
//
that.tableDatas[3][m] = sumNum(
that.tableDatas[0][m],
that.tableDatas[1][m],
that.tableDatas[2][m]
);
//
// that.tableDatas[5][m] = sumNum();
//
that.tableDatas[8][m] =
sumNum(
that.tableDatas[4][m],
// that.tableDatas[5][m],
that.tableDatas[6][m],
that.tableDatas[7][m]
) -
sumNum(
that.tableDatas[1][m],
that.tableDatas[2][m]
);
//
// that.tableDatas[12][m] = sumNum(
// that.tableDatas[9][m],
// that.tableDatas[10][m],
// that.tableDatas[11][m]
// );
//
that.tableDatas[13][m] =
typeof that.tableDatas[12][m] !== "undefined"
? sumNum(
that.tableDatas[9][m],
that.tableDatas[10][m],
that.tableDatas[11][m],
that.tableDatas[12][m]
)
: sumNum(
that.tableDatas[9][m],
that.tableDatas[10][m],
that.tableDatas[11][m]
);
//
let sum17 = sumNum(
that.tableDatas[14][m],
that.tableDatas[15][m],
that.tableDatas[16][m]
);
that.tableDatas[17][m] =
typeof that.tableDatas[21][m] !== "undefined"
? sum17 - that.tableDatas[21][m]
: sum17;
//
that.tableDatas[20][m] =
typeof that.tableDatas[19][m] !== "undefined"
? that.tableDatas[18][m] -
that.tableDatas[19][m]
: that.tableDatas[18][m];
//
that.tableDatas[25][m] = sumNum(
that.tableDatas[21][m],
that.tableDatas[22][m],
that.tableDatas[23][m],
that.tableDatas[24][m]
);
//
that.tableDatas[27][m] = sumNum(
that.tableDatas[3][m],
that.tableDatas[8][m],
that.tableDatas[13][m],
that.tableDatas[17][m],
that.tableDatas[18][m],
that.tableDatas[25][m],
that.tableDatas[26][m]
);
//
// that.tableDatas[28][m] = sumNum(
// that.tableDatas[27][m],
// that.tableDatas[26][m]
// );
}
that.tableDatas.forEach((inner, inde) => {
let sumlast = 0;
inner.forEach((num, ind) => {
if (ind > 2 && ind < that.headerLength) {
sumlast = sumlast + Number(num);
}
});
inner[that.headerLength] = sumlast;
});
that.$API.enm.mpoint.list
.req({
page: 0,
enabled: true,
need_display: true,
ordering: "report_sortstr",
mpoint__material__code: "elec",
})
.then(() => {});
.then((res) => {
let data = res.slice(3);
that.mpointList = data;
that.dataLoop();
});
},
dataLoop() {
let that = this;
that.tableDatas = [];
that.mpointList.forEach((item, index) => {
let arr = [];
arr[0] =
item.mgroup_name != null
? item.mgroup_name
: item.nickname != null
? item.nickname
: item.name;
arr[1] = item.nickname != null ? item.nickname : item.name;
arr[2] = item.unit;
for (let i = 0; i < that.days; i++) {
arr[i + 3] = 0;
}
that.tableDatas.push(arr);
that.getData(item.id, index);
});
},
getData(id, index) {
let that = this;
let obj = {};
obj.type = "day";
obj.year = that.year;
obj.month = that.month;
obj.mpoint__material__code = "elec";
obj.mpoint__need_display = 1;
obj.mpoint = id;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
console.log(res);
res.forEach((item) => {
let ind = item.day + 2;
that.tableDatas[index][ind] = item.val;
});
that.$forceUpdate();
});
},
// getData() {
// let that = this;
// function dataPush(name) {
// let index = 0;
// if (name == "") {
// index = 0;
// } else if (name == "") {
// index = 1;
// } else if (name == "") {
// index = 2;
// } else if (name == "") {
// index = 4;
// } else if (name == "") {
// index = 6;
// } else if (name == "") {
// index = 7;
// } else if (name == "") {
// index = 9;
// } else if (name == "") {
// index = 10;
// } else if (name == "") {
// index = 11;
// } else if (name == "") {
// index = 14;
// } else if (name == "") {
// index = 15;
// } else if (name == "") {
// index = 16;
// } else if (name == "") {
// index = 18;
// } else if (name == "") {
// index = 19;
// } else if (name == "1#") {
// index = 21;
// } else if (name == "2#") {
// index = 22;
// } else if (name == "3#") {
// index = 23;
// } else if (name == "4#") {
// index = 24;
// } else if (name == "") {
// index = 26;
// }
// return index;
// }
// function sumNum(a, b, c, d) {
// let sum = 0;
// if (typeof a !== "undefined" && a !== "NaN") {
// sum = sum + Number(a);
// }
// if (typeof b !== "undefined" && a !== "NaN") {
// sum = sum + Number(b);
// }
// if (typeof c !== "undefined" && a !== "NaN") {
// sum = sum + Number(c);
// }
// if (typeof d !== "undefined" && a !== "NaN") {
// sum = sum + Number(d);
// }
// return sum;
// }
// let obj = {};
// obj.type = "day_s";
// obj.year_s = that.year;
// obj.month_s = that.month;
// obj.page = 0;
// obj.mpoint__ep_monitored__power_kw__gte = 100;
// this.$API.enm.mpoint.stat
// .req(obj)
// .then((res) => {
// let wrapArr = [],
// innerArr = [];
// res.forEach((item) => {
// let day = item.day_s;
// if (wrapArr[day]) {
// wrapArr[day].push(item);
// } else {
// wrapArr[day] = [];
// wrapArr[day].push(item);
// }
// });
// wrapArr.forEach((inner, inde) => {
// inner.forEach((item) => {
// let i = dataPush(item.mpoint_name);
// let k = 0;
// if (
// i == 0 ||
// i == 4 ||
// i == 9 ||
// i == 14 ||
// i == 18 ||
// i == 21 ||
// i == 26 ||
// i == 27 ||
// i == 28
// ) {
// k = 3 + inde;
// } else {
// k = 2 + inde;
// }
// that.tableDatas[i][k] = item.val;
// });
// });
// for (let k = 0; k < that.headerLength; k++) {
// let m = k + 3;
// let n = k + 1;
// //
// that.tableDatas[3][m] = sumNum(
// that.tableDatas[0][m],
// that.tableDatas[1][m],
// that.tableDatas[2][m]
// );
// //
// // that.tableDatas[5][m] = sumNum();
// //
// that.tableDatas[8][m] =
// sumNum(
// that.tableDatas[4][m],
// // that.tableDatas[5][m],
// that.tableDatas[6][m],
// that.tableDatas[7][m]
// ) -
// sumNum(
// that.tableDatas[1][m],
// that.tableDatas[2][m]
// );
// //
// // that.tableDatas[12][m] = sumNum(
// // that.tableDatas[9][m],
// // that.tableDatas[10][m],
// // that.tableDatas[11][m]
// // );
// //
// that.tableDatas[13][m] =
// typeof that.tableDatas[12][m] !== "undefined"
// ? sumNum(
// that.tableDatas[9][m],
// that.tableDatas[10][m],
// that.tableDatas[11][m],
// that.tableDatas[12][m]
// )
// : sumNum(
// that.tableDatas[9][m],
// that.tableDatas[10][m],
// that.tableDatas[11][m]
// );
// //
// let sum17 = sumNum(
// that.tableDatas[14][m],
// that.tableDatas[15][m],
// that.tableDatas[16][m]
// );
// that.tableDatas[17][m] =
// typeof that.tableDatas[21][m] !== "undefined"
// ? sum17 - that.tableDatas[21][m]
// : sum17;
// //
// that.tableDatas[20][m] =
// typeof that.tableDatas[19][m] !== "undefined"
// ? that.tableDatas[18][m] -
// that.tableDatas[19][m]
// : that.tableDatas[18][m];
// //
// that.tableDatas[25][m] = sumNum(
// that.tableDatas[21][m],
// that.tableDatas[22][m],
// that.tableDatas[23][m],
// that.tableDatas[24][m]
// );
// //
// that.tableDatas[27][m] = sumNum(
// that.tableDatas[3][m],
// that.tableDatas[8][m],
// that.tableDatas[13][m],
// that.tableDatas[17][m],
// that.tableDatas[18][m],
// that.tableDatas[25][m],
// that.tableDatas[26][m]
// );
// //
// // that.tableDatas[28][m] = sumNum(
// // that.tableDatas[27][m],
// // that.tableDatas[26][m]
// // );
// }
// that.tableDatas.forEach((inner, inde) => {
// let sumlast = 0;
// inner.forEach((num, ind) => {
// if (ind > 2 && ind < that.headerLength) {
// sumlast = sumlast + Number(num);
// }
// });
// inner[that.headerLength] = sumlast;
// });
// })
// .then(() => {});
// },
itemClick(item, index) {
let that = this;
let lineData = that.tableDatas[index].slice(3, that.headerLength);

View File

@ -46,7 +46,7 @@
<th>设备</th>
<th>单位</th>
<th v-for="item in 24" :key="item">
{{ item }}
{{ item - 1 }}
</th>
<th>本日合计</th>
</tr>
@ -135,11 +135,11 @@ export default {
},
data() {
return {
day: "",
year: "",
month: "",
day: "",
search_date: "",
tableDatas: [
tableDatas1: [
["石灰石破碎", "破碎机", "kw.h"], //0
["石灰石破碎", "堆取料机", "kw.h"],
["石灰石破碎", "低压变压器柜", "kw.h"],
@ -170,10 +170,30 @@ export default {
["生产总耗电量", "生产部分总耗电", "kw.h"],
["全厂进线", "全厂耗电量", "kw.h"],
],
mpointList: [],
tableDatas: [],
hours: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24,
],
mgroupList: [
"石灰石破碎",
"原料磨",
"回转窑",
"煤磨",
"余热发电",
"空压机",
"富氧燃烧系统",
"生产总耗电量",
"全厂进线",
],
mgroup: "石灰石破碎",
itemChartTitle: "",
itemChartData: [],
itemChartXData: [],
itemChartYData: [],
itemChartLegend: [],
itemChartSeries: [],
timeStamp: null,
itemVisible: false,
exportLoading: false,
@ -269,12 +289,16 @@ export default {
mounted() {
let that = this;
var nowDate = new Date();
that.year = nowDate.getFullYear();
that.month = nowDate.getMonth() + 1;
that.day = nowDate.getDate();
let year = nowDate.getFullYear();
let month = nowDate.getMonth() + 1;
let day = nowDate.getDate();
that.timeStamp = nowDate.getTime();
let month0 = that.month > 9 ? that.month : "0" + that.month;
that.search_date = that.year + "-" + month0 + "-" + that.day;
month = month > 9 ? month : "0" + month;
day = day > 9 ? day : "0" + day;
that.day = day;
that.year = year;
that.month = month;
that.search_date = year + "-" + month + "-" + day;
for (let i = 0; i < that.tableDatas.length; i++) {
for (let j = 0; j < 24; j++) {
let k = 3 + j;
@ -285,224 +309,292 @@ export default {
for (let n = 0; n < 24; n++) {
that.xAxisData.push(n + "时");
}
this.getData();
this.getMPoints();
},
methods: {
dateChange(e) {
let that = this;
let arr = e.split("-");
that.tableDatas = [];
let arr = that.search_date.split("-");
that.year = Number(arr[0]);
that.month = Number(arr[1]);
that.day = Number(arr[2]);
for (let i = 0; i < that.tableDatas.length; i++) {
for (let j = 0; j < 25; j++) {
let k = 3 + j;
that.tableDatas[i][k] = 0;
this.$forceUpdate();
}
}
// for (let i = 0; i < that.tableDatas.length; i++) {
// for (let j = 0; j < 25; j++) {
// let k = 3 + j;
// that.tableDatas[i][k] = 0;
// this.$forceUpdate();
// }
// }
let nowDate = new Date();
that.timeStamp = nowDate.getTime();
this.getData();
that.dataLoop();
},
getData() {
getMPoints() {
let that = this;
function dataPush(name) {
let index = 0;
if (name == "破碎机") {
index = 0;
} else if (name == "堆取料机") {
index = 1;
} else if (name == "低压变压器柜") {
index = 2;
} else if (name == "循环风机") {
index = 4;
} else if (name == "调配变压器") {
index = 6;
} else if (name == "低压变压器柜器") {
index = 7;
} else if (name == "尾排风机") {
index = 9;
} else if (name == "高温风机") {
index = 10;
} else if (name == "头排风机") {
index = 11;
} else if (name == "煤磨主电机") {
index = 14;
} else if (name == "煤磨排风机") {
index = 15;
} else if (name == "低压变压器柜") {
index = 16;
} else if (name == "余热发电量") {
index = 18;
} else if (name == "余热发电自用电量") {
index = 19;
} else if (name == "1#空压机") {
index = 21;
} else if (name == "2#空压机") {
index = 22;
} else if (name == "3#空压机") {
index = 23;
} else if (name == "4#空压机") {
index = 24;
} else if (name == "富氧燃烧耗电设备") {
index = 26;
}
return index;
}
function sumNum(a, b, c, d) {
let sum = 0;
if (typeof a !== "undefined" && a !== "NaN") {
sum = sum + Number(a);
}
if (typeof b !== "undefined" && a !== "NaN") {
sum = sum + Number(b);
}
if (typeof c !== "undefined" && a !== "NaN") {
sum = sum + Number(c);
}
if (typeof d !== "undefined" && a !== "NaN") {
sum = sum + Number(d);
}
return sum;
}
let obj = {};
obj.type = "hour_s";
obj.year_s = that.year;
obj.month_s = that.month;
obj.day_s = that.day;
obj.page = 0;
obj.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat
.req(obj)
.then((res) => {
let wrapArr = [],
innerArr = [];
res.forEach((item) => {
let hour = item.hour;
if (wrapArr[hour]) {
wrapArr[hour].push(item);
} else {
wrapArr[hour] = [];
wrapArr[hour].push(item);
}
});
wrapArr.forEach((inner, inde) => {
inner.forEach((item) => {
let i = dataPush(item.mpoint_name);
let k = 0;
if (
i == 0 ||
i == 4 ||
i == 9 ||
i == 14 ||
i == 18 ||
i == 21 ||
i == 26 ||
i == 27 ||
i == 28
) {
k = 3 + inde;
} else {
k = 2 + inde;
}
that.tableDatas[i][k] = item.val;
});
});
for (let k = 0; k < 24; k++) {
let m = k + 3;
let n = k + 1;
//
that.tableDatas[3][m] = sumNum(
that.tableDatas[0][m],
that.tableDatas[1][m],
that.tableDatas[2][m]
);
//
// that.tableDatas[5][m] = sumNum();
//
that.tableDatas[8][m] =
sumNum(
that.tableDatas[4][m],
// that.tableDatas[5][m],
that.tableDatas[6][m],
that.tableDatas[7][m]
) -
sumNum(
that.tableDatas[1][m],
that.tableDatas[2][m]
);
//
// that.tableDatas[12][m] = sumNum(
// that.tableDatas[9][m],
// that.tableDatas[10][m],
// that.tableDatas[11][m]
// );
//
that.tableDatas[13][m] =
typeof that.tableDatas[12][m] !== "undefined"
? sumNum(
that.tableDatas[9][m],
that.tableDatas[10][m],
that.tableDatas[11][m],
that.tableDatas[12][m]
)
: sumNum(
that.tableDatas[9][m],
that.tableDatas[10][m],
that.tableDatas[11][m]
);
//
let sum17 = sumNum(
that.tableDatas[14][m],
that.tableDatas[15][m],
that.tableDatas[16][m]
);
that.tableDatas[17][m] =
typeof that.tableDatas[21][m] !== "undefined"
? sum17 - that.tableDatas[21][m]
: sum17;
//
that.tableDatas[20][m] =
typeof that.tableDatas[19][m] !== "undefined"
? that.tableDatas[18][m] -
that.tableDatas[19][m]
: that.tableDatas[18][m];
//
that.tableDatas[25][m] = sumNum(
that.tableDatas[21][m],
that.tableDatas[22][m],
that.tableDatas[23][m],
that.tableDatas[24][m]
);
//
that.tableDatas[27][m] = sumNum(
that.tableDatas[3][m],
that.tableDatas[8][m],
that.tableDatas[13][m],
that.tableDatas[17][m],
that.tableDatas[18][m],
that.tableDatas[25][m],
that.tableDatas[26][m]
);
//
// that.tableDatas[28][m] = sumNum(
// that.tableDatas[27][m],
// that.tableDatas[26][m]
// );
}
that.tableDatas.forEach((inner, inde) => {
let sum27 = 0;
inner.forEach((num, ind) => {
if (ind > 2 && ind < 27) {
sum27 = sum27 + Number(num);
}
});
inner[27] = sum27;
});
that.$API.enm.mpoint.list
.req({
page: 0,
enabled: true,
need_display: true,
ordering: "report_sortstr",
mpoint__material__code: "elec",
})
.then(() => {});
.then((res) => {
let data = res.slice(3);
that.mpointList = data;
that.dataLoop();
});
},
dataLoop() {
let that = this;
that.tableDatas = [];
that.mpointList.forEach((item, index) => {
let arr = [];
arr[0] =
item.mgroup_name != null
? item.mgroup_name
: item.nickname != null
? item.nickname
: item.name;
arr[1] = item.nickname != null ? item.nickname : item.name;
arr[2] = item.unit;
for (let i = 0; i < 24; i++) {
arr[i + 3] = 0;
}
that.tableDatas.push(arr);
that.getData(item.id, index);
});
},
getData(id, index) {
let that = this;
let obj = {};
obj.type = "hour";
obj.year = that.year;
obj.month = that.month;
obj.day = that.day;
obj.mpoint__material__code = "elec";
obj.mpoint__need_display = 1;
obj.mpoint = id;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
console.log(res);
res.forEach((item) => {
let ind = item.hour + 3;
that.tableDatas[index][ind] = item.val;
});
that.$forceUpdate();
});
},
// getData(id) {
// let that = this;
// function dataPush(name) {
// let index = 0;
// if (name == "") {
// index = 0;
// } else if (name == "") {
// index = 1;
// } else if (name == "") {
// index = 2;
// } else if (name == "") {
// index = 4;
// } else if (name == "") {
// index = 6;
// } else if (name == "") {
// index = 7;
// } else if (name == "") {
// index = 9;
// } else if (name == "") {
// index = 10;
// } else if (name == "") {
// index = 11;
// } else if (name == "") {
// index = 14;
// } else if (name == "") {
// index = 15;
// } else if (name == "") {
// index = 16;
// } else if (name == "") {
// index = 18;
// } else if (name == "") {
// index = 19;
// } else if (name == "1#") {
// index = 21;
// } else if (name == "2#") {
// index = 22;
// } else if (name == "3#") {
// index = 23;
// } else if (name == "4#") {
// index = 24;
// } else if (name == "") {
// index = 26;
// }
// return index;
// }
// function sumNum(a, b, c, d) {
// let sum = 0;
// if (typeof a !== "undefined" && a !== "NaN") {
// sum = sum + Number(a);
// }
// if (typeof b !== "undefined" && a !== "NaN") {
// sum = sum + Number(b);
// }
// if (typeof c !== "undefined" && a !== "NaN") {
// sum = sum + Number(c);
// }
// if (typeof d !== "undefined" && a !== "NaN") {
// sum = sum + Number(d);
// }
// return sum;
// }
// let obj = {};
// obj.type = "hour_s";
// obj.year_s = that.year;
// obj.month_s = that.month;
// obj.day_s = that.day;
// obj.page = 0;
// obj.mpoint__ep_monitored__power_kw__gte = 100;
// this.$API.enm.mpoint.stat
// .req(obj)
// .then((res) => {
// let wrapArr = [],
// innerArr = [];
// res.forEach((item) => {
// let hour = item.hour;
// if (wrapArr[hour]) {
// wrapArr[hour].push(item);
// } else {
// wrapArr[hour] = [];
// wrapArr[hour].push(item);
// }
// });
// wrapArr.forEach((inner, inde) => {
// inner.forEach((item) => {
// let i = dataPush(item.mpoint_name);
// let k = 0;
// if (
// i == 0 ||
// i == 4 ||
// i == 9 ||
// i == 14 ||
// i == 18 ||
// i == 21 ||
// i == 26 ||
// i == 27 ||
// i == 28
// ) {
// k = 3 + inde;
// } else {
// k = 2 + inde;
// }
// that.tableDatas[i][k] = item.val;
// });
// });
// for (let k = 0; k < 24; k++) {
// let m = k + 3;
// let n = k + 1;
// //
// that.tableDatas[3][m] = sumNum(
// that.tableDatas[0][m],
// that.tableDatas[1][m],
// that.tableDatas[2][m]
// );
// //
// // that.tableDatas[5][m] = sumNum();
// //
// that.tableDatas[8][m] =
// sumNum(
// that.tableDatas[4][m],
// // that.tableDatas[5][m],
// that.tableDatas[6][m],
// that.tableDatas[7][m]
// ) -
// sumNum(
// that.tableDatas[1][m],
// that.tableDatas[2][m]
// );
// //
// // that.tableDatas[12][m] = sumNum(
// // that.tableDatas[9][m],
// // that.tableDatas[10][m],
// // that.tableDatas[11][m]
// // );
// //
// that.tableDatas[13][m] =
// typeof that.tableDatas[12][m] !== "undefined"
// ? sumNum(
// that.tableDatas[9][m],
// that.tableDatas[10][m],
// that.tableDatas[11][m],
// that.tableDatas[12][m]
// )
// : sumNum(
// that.tableDatas[9][m],
// that.tableDatas[10][m],
// that.tableDatas[11][m]
// );
// //
// let sum17 = sumNum(
// that.tableDatas[14][m],
// that.tableDatas[15][m],
// that.tableDatas[16][m]
// );
// that.tableDatas[17][m] =
// typeof that.tableDatas[21][m] !== "undefined"
// ? sum17 - that.tableDatas[21][m]
// : sum17;
// //
// that.tableDatas[20][m] =
// typeof that.tableDatas[19][m] !== "undefined"
// ? that.tableDatas[18][m] -
// that.tableDatas[19][m]
// : that.tableDatas[18][m];
// //
// that.tableDatas[25][m] = sumNum(
// that.tableDatas[21][m],
// that.tableDatas[22][m],
// that.tableDatas[23][m],
// that.tableDatas[24][m]
// );
// //
// that.tableDatas[27][m] = sumNum(
// that.tableDatas[3][m],
// that.tableDatas[8][m],
// that.tableDatas[13][m],
// that.tableDatas[17][m],
// that.tableDatas[18][m],
// that.tableDatas[25][m],
// that.tableDatas[26][m]
// );
// //
// // that.tableDatas[28][m] = sumNum(
// // that.tableDatas[27][m],
// // that.tableDatas[26][m]
// // );
// }
// that.tableDatas.forEach((inner, inde) => {
// let sum27 = 0;
// inner.forEach((num, ind) => {
// if (ind > 2 && ind < 27) {
// sum27 = sum27 + Number(num);
// }
// });
// inner[27] = sum27;
// });
// })
// .then(() => {});
// },
getHourData() {
let that = this;
let m = 0;
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
let hour = date.getHours();
let minute = date.getMinutes();
let second = date.getSeconds();
},
getTableData() {
for (let i = 0; i < this.tableDatas.length; i++) {

View File

@ -45,7 +45,7 @@
<th>工段</th>
<th>设备</th>
<th>单位</th>
<th v-for="item in 12" :key="item">
<th v-for="item in months" :key="item">
{{ item }}
</th>
<th>本年合计</th>
@ -135,40 +135,9 @@ export default {
data() {
return {
year: "",
month: "",
day: "",
search_date: "",
tableDatas: [
["石灰石破碎", "破碎机", "kw.h"], //0
["石灰石破碎", "堆取料机", "kw.h"],
["石灰石破碎", "低压变压器柜", "kw.h"],
["石灰石破碎", "石灰石破碎合计", "kw.h"],
["原料磨", "循环风机", "kw.h"],
["原料磨", "辊压机", "kw.h"],
["原料磨", "调配变压器", "kw.h"],
["原料磨", "低压变压器柜器", "kw.h"],
["原料磨", "原料磨系统合计", "kw.h"],
["回转窑", "尾排风机", "kw.h"],
["回转窑", "高温风机", "kw.h"],
["回转窑", "头排风机", "kw.h"],
["回转窑", "低压变压器柜", "kw.h"],
["回转窑", "回转窑烧成系统合计", "kw.h"],
["煤磨", "煤磨主电机", "kw.h"],
["煤磨", "煤磨排风机", "kw.h"],
["煤磨", "低压变压器柜", "kw.h"],
["煤磨", "煤磨系统合计", "kw.h"],
["余热发电", "余热发电量", "kw.h"],
["余热发电", "余热发电自用电量", "kw.h"],
["余热发电", "余热供电量", "kw.h"],
["空压机", "1#空压机", "kw.h"],
["空压机", "2#空压机", "kw.h"],
["空压机", "3#空压机", "kw.h"],
["空压机", "4#空压机", "kw.h"],
["空压机", "空压机合计", "kw.h"],
["富氧燃烧系统", "富氧燃烧耗电设备", "kw.h"],
["生产总耗电量", "生产部分总耗电", "kw.h"],
["全厂进线", "全厂耗电量", "kw.h"],
],
mpointList: [],
tableDatas: [],
timeStamp: null,
itemVisible: false,
months: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
@ -278,228 +247,72 @@ export default {
let that = this;
var nowDate = new Date();
that.year = nowDate.getFullYear();
that.search_date = that.year + "";
that.search_date = that.year;
that.timeStamp = nowDate.getTime();
let tableDatas = that.tableDatas;
for (let i = 0; i < tableDatas.length; i++) {
for (let j = 0; j < 12; j++) {
let k = 3 + j;
that.tableDatas[i][k] = 0;
this.$forceUpdate();
}
}
this.getData();
this.getMPoints();
},
methods: {
dateChange() {
let that = this;
for (let i = 0; i < that.tableDatas.length; i++) {
for (let j = 0; j < 13; j++) {
let k = 3 + j;
that.tableDatas[i][k] = 0;
this.$forceUpdate();
}
}
that.tableDatas = [];
that.year = that.search_date;
let nowDate = new Date();
that.timeStamp = nowDate.getTime();
this.getData();
that.dataLoop();
},
getData() {
getMPoints() {
let that = this;
function dataPush(name) {
let index = 0;
if (name == "破碎机") {
index = 0;
} else if (name == "堆取料机") {
index = 1;
} else if (name == "低压变压器柜") {
index = 2;
} else if (name == "循环风机") {
index = 4;
} else if (name == "调配变压器") {
index = 6;
} else if (name == "低压变压器柜器") {
index = 7;
} else if (name == "尾排风机") {
index = 9;
} else if (name == "高温风机") {
index = 10;
} else if (name == "头排风机") {
index = 11;
} else if (name == "煤磨主电机") {
index = 14;
} else if (name == "煤磨排风机") {
index = 15;
} else if (name == "低压变压器柜") {
index = 16;
} else if (name == "余热发电量") {
index = 18;
} else if (name == "余热发电自用电量") {
index = 19;
} else if (name == "1#空压机") {
index = 21;
} else if (name == "2#空压机") {
index = 22;
} else if (name == "3#空压机") {
index = 23;
} else if (name == "4#空压机") {
index = 24;
} else if (name == "富氧燃烧耗电设备") {
index = 26;
}
return index;
}
function sumNum(a, b, c, d) {
let sum = 0;
if (typeof a !== "undefined" && a !== "NaN") {
sum = sum + Number(a);
}
if (typeof b !== "undefined" && a !== "NaN") {
sum = sum + Number(b);
}
if (typeof c !== "undefined" && a !== "NaN") {
sum = sum + Number(c);
}
if (typeof d !== "undefined" && a !== "NaN") {
sum = sum + Number(d);
}
return sum;
}
let obj = {};
obj.type = "month_s";
obj.year_s = that.year;
obj.page = 0;
obj.mpoint__ep_monitored__power_kw__gte = 100;
this.$API.enm.mpoint.stat
.req(obj)
.then((res) => {
let wrapArr = [],
innerArr = [];
res.forEach((item) => {
let month = item.month;
if (wrapArr[month]) {
wrapArr[month].push(item);
} else {
wrapArr[month] = [];
wrapArr[month].push(item);
}
});
wrapArr.forEach((inner, inde) => {
inner.forEach((item) => {
let i = dataPush(item.mpoint_name);
let k = 0;
if (
i == 0 ||
i == 4 ||
i == 9 ||
i == 14 ||
i == 18 ||
i == 21 ||
i == 26 ||
i == 27 ||
i == 28
) {
k = 3 + inde;
} else {
k = 2 + inde;
}
that.tableDatas[i][k] = item.val;
});
});
for (let k = 0; k < 24; k++) {
let m = k + 3;
let n = k + 1;
//
that.tableDatas[3][m] = sumNum(
that.tableDatas[0][m],
that.tableDatas[1][m],
that.tableDatas[2][m]
);
//
// that.tableDatas[5][m] = sumNum();
//
that.tableDatas[8][m] =
sumNum(
that.tableDatas[4][m],
// that.tableDatas[5][m],
that.tableDatas[6][m],
that.tableDatas[7][m]
) -
sumNum(
that.tableDatas[1][m],
that.tableDatas[2][m]
);
//
// that.tableDatas[12][m] = sumNum(
// that.tableDatas[9][m],
// that.tableDatas[10][m],
// that.tableDatas[11][m]
// );
//
that.tableDatas[13][m] =
typeof that.tableDatas[12][m] !== "undefined"
? sumNum(
that.tableDatas[9][m],
that.tableDatas[10][m],
that.tableDatas[11][m],
that.tableDatas[12][m]
)
: sumNum(
that.tableDatas[9][m],
that.tableDatas[10][m],
that.tableDatas[11][m]
);
//
let sum17 = sumNum(
that.tableDatas[14][m],
that.tableDatas[15][m],
that.tableDatas[16][m]
);
that.tableDatas[17][m] =
typeof that.tableDatas[21][m] !== "undefined"
? sum17 - that.tableDatas[21][m]
: sum17;
//
that.tableDatas[20][m] =
typeof that.tableDatas[19][m] !== "undefined"
? that.tableDatas[18][m] -
that.tableDatas[19][m]
: that.tableDatas[18][m];
//
that.tableDatas[25][m] = sumNum(
that.tableDatas[21][m],
that.tableDatas[22][m],
that.tableDatas[23][m],
that.tableDatas[24][m]
);
//
that.tableDatas[27][m] = sumNum(
that.tableDatas[3][m],
that.tableDatas[8][m],
that.tableDatas[13][m],
that.tableDatas[17][m],
that.tableDatas[18][m],
that.tableDatas[25][m],
that.tableDatas[26][m]
);
//
// that.tableDatas[28][m] = sumNum(
// that.tableDatas[27][m],
// that.tableDatas[26][m]
// );
}
that.tableDatas.forEach((inner, inde) => {
let sum15 = 0;
inner.forEach((num, ind) => {
if (ind > 2 && ind < 15) {
sum15 = sum15 + Number(num);
}
});
inner[15] = sum15;
});
that.$API.enm.mpoint.list
.req({
page: 0,
enabled: true,
need_display: true,
ordering: "report_sortstr",
mpoint__material__code: "elec",
})
.then(() => {});
.then((res) => {
let data = res.slice(3);
that.mpointList = data;
that.dataLoop();
});
},
dataLoop() {
let that = this;
that.tableDatas = [];
that.mpointList.forEach((item, index) => {
let arr = [];
arr[0] =
item.mgroup_name != null
? item.mgroup_name
: item.nickname != null
? item.nickname
: item.name;
arr[1] = item.nickname != null ? item.nickname : item.name;
arr[2] = item.unit;
for (let i = 0; i < 12; i++) {
arr[i + 3] = 0;
}
that.tableDatas.push(arr);
that.getData(item.id, index);
});
},
getData(id, index) {
let that = this;
let obj = {};
obj.type = "month";
obj.year = that.year;
obj.mpoint__material__code = "elec";
obj.mpoint__need_display = 1;
obj.mpoint = id;
obj.page = 0;
this.$API.enm.mpoint.stat.req(obj).then((res) => {
console.log(res);
res.forEach((item) => {
let ind = item.month + 2;
that.tableDatas[index][ind] = item.val;
});
that.$forceUpdate();
});
},
itemClick(item, index) {
let that = this;

View File

@ -325,6 +325,10 @@
label="发生时间"
prop="start_time"
></el-table-column>
<el-table-column
label="结束时间"
prop="end_time"
></el-table-column>
<el-table-column
label="原因类别"
prop="cate"
@ -383,13 +387,27 @@
highlightCurrentRow
>
<el-table-column type="index" width="50" />
<el-table-column label="处理班组">
<el-table-column label="班组名称">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
scope.row.sflog_.shift_name
}}</span>
</template>
</el-table-column>
<el-table-column label="开始时间">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
scope.row.sflog_.start_time
}}</span>
</template>
</el-table-column>
<el-table-column label="结束时间">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
scope.row.sflog_.end_time
}}</span>
</template>
</el-table-column>
<el-table-column label="所在工段">
<template #default="scope">
<span v-if="scope.row.sflog_">{{
@ -550,11 +568,19 @@
</el-form>
<el-footer>
<el-button
v-if="sflogExpVisiable"
type="primary"
:loading="isSaveing"
@click="submit42"
>保存</el-button
>
<el-button
v-else
type="primary"
:loading="isSaveing"
@click="submit4"
>保存</el-button
>
<el-button @click="visible = false"
>取消</el-button
>
@ -715,7 +741,7 @@ export default {
getStlog() {
let obj = {};
obj.page = 0;
obj.sflog = this.form.id;
obj.mgroup = this.mgroupId;
this.$API.wpm.stlog.list.req(obj).then((res) => {
this.stlogList = res;
});
@ -735,18 +761,22 @@ export default {
this.stlogForm.handler = this.$TOOL.data.get("USER_INFO").id;
this.stlogForm.mgroup = this.mgroupId;
this.stlogTitle = "新增异常";
this.sflogExpVisiable = false;
this.visible = true;
},
//
editStlog(row) {
this.stlogTitle = "编辑异常";
this.stlogForm = row;
this.stlogForm.current_sflog = row.sflog;
this.sflogExpVisiable = false;
this.visible = true;
},
handleStlog() {
this.stlogTitle = "异常处理";
this.stlogForm = row;
this.visible = true;
this.sflogExpVisiable = true;
},
//
submit4() {
@ -767,6 +797,8 @@ export default {
that.isSaveing = false;
});
} else if (that.stlogTitle == "编辑异常") {
console.log("that.stlogForm", that.stlogForm);
console.log("that.stlogForm.id", that.stlogForm.id);
that.$API.wpm.stlog.update
.req(that.stlogForm.id, that.stlogForm)
.then((res) => {
@ -794,6 +826,7 @@ export default {
that.getSflogexp(that.clickItem.id);
})
.catch((res) => {
this.sflogExpVisiable = false;
that.isSaveing = false;
});
},
@ -818,7 +851,6 @@ export default {
console.log(row);
this.clickItem = row;
this.getSflogexp(row.id);
this.sflogExpVisiable = true;
},
getSflogexp(id) {
let obj = {};

File diff suppressed because it is too large Load Diff