This commit is contained in:
2022-11-07 14:54:47 +08:00
commit 8cfe73aaef
1227 changed files with 194899 additions and 0 deletions

View File

@@ -0,0 +1,145 @@
<!--
* @Author: gtz
* @Date: 2022-01-19 15:58:17
* @LastEditors: zhp
* @LastEditTime: 2022-01-24 09:18:01
* @Description: file content
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
-->
<template>
<div class="base-container" :style="{height: height * beilv + 'px', fontSize: 12 * beilv + 'px'}">
<div class="line" />
<div class="line line-vertical" />
<div class="line line-right" />
<div class="line line-right-vertical" />
<div class="line line-bottom" />
<div class="line line-bottom-vertical" />
<div class="line line-bottom-right" />
<div class="line line-bottom-right-vertical" />
<div class="bar-item">
<div v-if="title" class="bar-title">
<span>
<svg-icon :icon-class="titleIcon" style="font-size: 1.5em; position: relative; top: .08em" />
{{ title }}
</span>
</div>
<div class="bar-content">
<slot />
</div>
</div>
</div>
</template>
<script>
export default {
name: 'BaseContainer',
props: {
title: {
type: String,
default: ''
},
titleIcon: {
type: String,
default: ''
},
height: {
type: Number,
default: 200
},
baseSize: {
type: Number,
default: 12
},
beilv: {
type: Number,
default: 1
}
},
data() {
return {
curIndex: 0
}
},
mounted() {
},
methods: {
changeTab(num) {
this.curIndex = num
this.$emit('tabSelect', num)
}
}
}
</script>
<style lang="scss" scoped>
.base-container {
color: #fff;
width: 100%;
background-color: rgba($color: #061027, $alpha: 0.15);
position: relative;
border: 2px solid;
border-image: linear-gradient(90deg, rgba(82, 255, 241, 0.6), rgba(95, 190, 249, 0), rgba(82, 255, 241, 0.6)) 2 2;
box-shadow: inset 0px 0px 20px 0px rgba(255,255,255,0.15);
.line {
position: absolute;
border-top: 4px solid #52FFF1;
width: 2em;
top: -.25em;
left: -.25em;
&-vertical {
top: calc(-5em / 12);
left: calc(-1em / 12);
transform: rotate(90deg);
transform-origin: left;
}
&-right {
top: -.25em;
right: -.25em;
left: inherit;
}
&-right-vertical {
top: calc(-5em / 12);
right: calc(-1em / 12);
left: inherit;
transform: rotate(-90deg);
transform-origin: right;
}
&-bottom {
top: inherit;
left: -.25em;
bottom: -.25em;
}
&-bottom-vertical {
top: inherit;
left: calc(-1em / 12);
bottom: calc(-5em / 12);
transform: rotate(-90deg);
transform-origin: left;
}
&-bottom-right {
top: inherit;
left: inherit;
right: -.25em;
bottom: -.25em;
}
&-bottom-right-vertical {
top: inherit;
left: inherit;
right: calc(-1em / 12);
bottom: calc(-5em / 12);
transform: rotate(90deg);
transform-origin: right;
}
}
.bar-title {
width: 100%;
color: #52FFF1;
font-size: 1.5em;
padding: .67em;
}
// .bar-content{
// padding: 1em;
// }
}
</style>

View File

@@ -0,0 +1,176 @@
<!--
* @Date: 2020-12-14 09:07:03
* @LastEditors: gtz
* @LastEditTime: 2022-06-14 11:12:39
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseTable.vue
* @Description:
-->
<template>
<div class="visual-base-table-container">
<el-table
v-loading="isLoading"
:header-cell-style="{background:'rgba(79,114,136,0.29)',color:'#fff',height: 28 * beilv + 'px',lineHeight: 28 * beilv + 'px',padding: 0,fontSize: 12 * beilv + 'px'}"
:row-style="setRowStyle"
:data="renderData"
border
style="width: 100%; background: transparent"
>
<el-table-column v-if="page && limit && showIndex" prop="_pageIndex" :label="'tableHeader.index' | i18nFilter" :width="70 * beilv" align="center" />
<el-table-column
v-for="item in renderTableHeadList"
:key="item.prop"
:show-overflow-tooltip="showOverflow"
v-bind="item"
>
<template slot-scope="scope">
<component :is="item.subcomponent" v-if="item.subcomponent" :inject-data="{...scope.row, ...item}" @emitData="emitData" />
<span v-else>{{ scope.row[item.prop] | commonFilter(item.filter) }}</span>
</template>
</el-table-column>
<slot name="content" />
</el-table>
</div>
</template>
<script>
import { isObject, isString } from 'lodash'
export default {
name: 'BaseTable',
filters: {
commonFilter: (source, filterType = a => a) => {
return filterType(source)
}
},
props: {
tableData: {
type: Array,
required: true,
validator: val => val.filter(item => !isObject(item)).length === 0
},
tableConfig: {
type: Array,
required: true,
validator: val => val.filter(item => !isString(item.prop) || !isString(item.label)).length === 0
},
isLoading: {
type: Boolean,
required: false
},
page: {
type: Number,
required: false,
default: 1
},
limit: {
type: Number,
required: false,
default: 5
},
beilv: {
type: Number,
default: 1
},
showOverflow: {
type: Boolean,
default: true
},
showIndex: {
type: Boolean,
default: true
}
},
data() {
return {
tableConfigBak: [],
selectedBox: new Array(100).fill(true)
}
},
computed: {
renderData() {
if (this.tableData.length && !this.tableData[0]._pageIndex) {
this.tableData.forEach((item, index) => {
item._pageIndex = (this.page - 1) * this.limit + index + 1
})
}
return this.tableData.slice((this.page - 1) * this.limit, this.page * this.limit)
},
renderTableHeadList() {
return this.tableConfig.filter((item, index) => {
return this.selectedBox[index]
})
}
},
beforeMount() {
this.selectedBox = new Array(100).fill(true)
},
methods: {
emitData(val) {
this.$emit('emitFun', val)
},
setRowStyle(v) {
if (v.rowIndex % 2 === 0) {
return {
background: 'rgba(76,97,123,0.2)',
color: 'rgba(255,255,255,0.5)',
height: 26 * this.beilv + 'px',
lineHeight: 26 * this.beilv + 'px',
padding: 0,
fontSize: 12 * this.beilv + 'px'
}
} else {
return {
background: 'rgba(79,114,136,0.29)',
color: 'rgba(255,255,255,0.5)',
height: 26 * this.beilv + 'px',
lineHeight: 26 * this.beilv + 'px',
padding: 0,
fontSize: 12 * this.beilv + 'px'
}
}
},
setCellStyle(v) {
return {
lineHeight: 23 * this.beilv + 'px'
}
}
}
}
</script>
<style lang="scss">
@import "~@/styles/index.scss";
.visual-base-table-container {
.el-table {
border: 0;
}
.el-table::before,.el-table--border::after {
background-color: transparent;
}
.el-table th,td{
border-color: #0D1728 !important;
padding: 0;
}
.el-table tr {
background: transparent;
}
.el-table__row:hover > td {
background-color: rgba(79,114,136,0.29) !important;
}
.el-table__row--striped:hover > td {
background-color: rgba(79,114,136,0.29) !important;
}
}
.setting {
text-align: right;
padding: 15px;
.setting-box {
width: 100px;
}
i {
color: #aaa;
@extend .pointer;
}
}
</style>

View File

@@ -0,0 +1,57 @@
<template>
<div :style="{ padding: 8 * beilv + 'px ' + 24 * beilv + 'px '+ 24 * beilv + 'px' }" class="box">
<div v-for="(item, i) in bomMsg" :key="i" class="bom-box" :style="{ marginBottom: 11 * beilv + 'px'}">
<img src="./../../../../assets/img/cockpit/bom.png" alt="" :width="355 * beilv + 'px'" :height="280 * beilv + 'px'">
<p class="bom-name" :style="{ bottom: 10 * beilv + 'px', fontSize: 16 * beilv + 'px'}">
<span class="leftTriangle" />
<span>{{ item.name }}</span>
<span class="rightTriangle" />
</p>
</div>
</div>
</template>
<script>
export default {
name: 'BomList',
props: {
bomMsg: {
type: Array,
default: () => []
},
beilv: {
type: Number,
default: 1
}
}
}
</script>
<style lang="scss" scoped>
.box {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
.bom-box {
position: relative;
.bom-name {
position: absolute;
width: 100%;
text-align: center;
.leftTriangle,
.rightTriangle {
display: inline-block;
width: 0px;
height: 0px;
border: 5px solid transparent;
}
.leftTriangle {
border-right-color: #fff;
margin-right: 10px;
}
.rightTriangle {
border-left-color: #fff;
margin-left: 10px;
}
}
}
}
</style>

View File

@@ -0,0 +1,276 @@
<template>
<div id="container" ref="container" class="visual-container material-cockpit">
<el-row
class="container-title"
:style="{
height: beilv * 88 + 'px',
lineHeight: beilv * 88 + 'px',
fontSize: beilv * 30 + 'px'
}"
>
<div :style="{ paddingLeft: 645 * beilv + 'px' }">
<img src="../../../assets/img/logo.png" style="width:1.1em;position:relative;top:.4em" alt="">
合肥新能源数字工厂物料管理驾驶舱
</div>
<el-button
type="text"
class="title-button"
:style="{ right: 33 * beilv + 'px', top: 37 * beilv + 'px' }"
@click="changeFullScreen"
>
<svg-icon v-if="isFullScreen" icon-class="unFullScreenView" />
<svg-icon v-else icon-class="fullScreenView" />
</el-button>
</el-row>
<el-row class="container-main" :style="{ padding: '0 ' + 16 * beilv + 'px' }" :gutter="16 * beilv">
<!-- -->
<el-col :span="10" :style="{ margin: 16 * beilv + 'px' + ' 0' }">
<base-container :beilv="beilv" :height="958" :title="'BOM清单管理'" :title-icon="'cockpit_2_1'">
<bom-list :beilv="beilv" :bom-msg="bomMsg" />
</base-container>
</el-col>
<el-col :span="14">
<!-- 右上 -->
<el-row>
<el-col :style="{ marginTop: 16 * beilv + 'px' }">
<base-container :beilv="beilv" :height="470" :title="'在途原片'" :title-icon="'cockpit_2_2'">
<div class="box-padding specil-table1">
<base-table
:page="1"
:limit="14"
:show-index="false"
:beilv="beilv"
:table-config="originalFilm"
:table-data="originalFilmList"
/>
</div>
</base-container>
</el-col>
</el-row>
<!-- 右下 -->
<el-row>
<el-col :style="{ margin: 16 * beilv + 'px' + ' 0' }">
<base-container :beilv="beilv" :height="470" :title="'在途辅料'" :title-icon="'cockpit_2_3'">
<div class="box-padding specil-table1">
<base-table
:page="1"
:limit="14"
:show-index="false"
:beilv="beilv"
:table-config="material"
:table-data="materialList"
/>
</div>
</base-container>
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</template>
<script>
import baseContainer from './components/baseContainer'
import screenfull from 'screenfull'
import BaseTable from './components/baseTable.vue'
import moment from 'moment'
import bomList from './components/bomList.vue'
const originalFilm = [
{
prop: 'time',
label: '上线时间',
minWidth: 35
},
{
prop: 'productLine',
label: '产线',
minWidth: 33
},
{
prop: 'spec',
label: '原片规格',
minWidth: 32.4
},
{
prop: 'batch',
label: '批次',
minWidth: 35
},
{
prop: 'num',
label: '数量',
minWidth: 28
}
]
const material = [
{
prop: 'time',
label: '上线时间',
minWidth: 35
},
{
prop: 'eqName',
label: '设备名称',
minWidth: 33
},
{
prop: 'spec',
label: '辅料规格',
minWidth: 32.4
},
{
prop: 'batch',
label: '批次',
minWidth: 35
},
{
prop: 'num',
label: '数量',
minWidth: 28
}
]
export default {
name: 'Cockpit',
components: {
baseContainer,
BaseTable,
bomList
},
data() {
return {
beilv: 1,
isFullScreen: false,
originalFilm,
originalFilmList: [],
material,
materialList: [],
bomMsg: []
}
},
watch: {
isFullScreen: function(val) {
if (val) {
this.beilv = document.body.offsetWidth / 1920
} else {
this.beilv = document.getElementById('container').offsetWidth / 1920
}
},
'sidebar.opened': function(val) {
console.log(val)
if (!this.isFullScreen) {
setTimeout(() => {
this.beilv = document.getElementById('container').offsetWidth / 1920
}, 300)
}
}
},
mounted() {
this.beilv = document.getElementById('container').offsetWidth / 1920
window.addEventListener('resize', () => {
if (this.isFullScreen) {
this.beilv = document.body.offsetWidth / 1920
} else {
this.beilv = document.getElementById('container').offsetWidth / 1920
}
})
this.getMsg()
},
methods: {
getMsg() {
const arr = []
const temp = []
for (let i = 0; i < 20; i++) {
const obj = {}
const sj = parseInt(Math.random() * 200)
obj.time = moment().add(sj, 'days').add(sj, 'hours').add(sj, 'minute').add(sj, 'second').format('YYYY-MM-DD HH:mm:ss')
obj.productLine = '产线A'
obj.spec = '光伏玻璃2.0'
obj.batch = moment().subtract(sj, 'days').format('YYYYMMDD') + '0000' + parseInt(Math.random() * 89 + 10)
obj.num = parseInt(Math.random() * 800 + 100)
arr.push(obj)
}
this.originalFilmList = arr
const eqList = ['清洗机', 'A1一次冷却机', 'A1下片机', 'A1一次固化机', 'A1一次镀膜机', 'A1二次固化机', 'A1二次镀膜机', 'A1磨边机', 'A1磨边清洗机', 'A1预热机', 'A2一次冷却机', 'A2一次固化机', 'A2一次镀膜机', 'A2下片机', 'A2二次固化机', 'A2磨边机', 'A2磨边清洗机', 'A储片机206']
const spcList = ['200*231*0.5', '100*120*0.2', '70*80', '100*100']
for (let i = 0; i < 20; i++) {
const obj = {}
const sj = parseInt(Math.random() * 200)
obj.time = moment().add(sj, 'days').add(sj, 'hours').add(sj, 'minute').add(sj, 'second').format('YYYY-MM-DD HH:mm:ss')
obj.eqName = eqList[parseInt(Math.random() * eqList.length)]
obj.spec = spcList[parseInt(Math.random() * spcList.length)]
obj.batch = moment().subtract(sj, 'days').format('YYYYMMDD') + '0000' + parseInt(Math.random() * 89 + 10)
obj.num = parseInt(Math.random() * 800 + 100)
temp.push(obj)
}
this.materialList = temp
this.bomMsg = [
{ name: '隔离纸' },
{ name: '异丙醇' },
{ name: '镀膜液' },
{ name: '磨轮' },
{ name: '包装辅材' },
{ name: '网板' }
]
},
change() {
this.isFullScreen = screenfull.isFullscreen
},
init() {
if (screenfull.enabled) {
screenfull.on('change', this.change)
}
},
destroy() {
if (screenfull.enabled) {
screenfull.off('change', this.change)
}
},
changeFullScreen() {
if (!screenfull.enabled) {
this.$message({
message: 'you browser can not work',
type: 'warning'
})
return false
}
this.isFullScreen = !this.isFullScreen
screenfull.toggle(this.$refs.container)
}
}
}
</script>
<style lang="scss" scoped>
.visual-container {
width: 100%;
min-width: 960px;
background: url('../../../assets/img/cockpit/cockpit-back.png') no-repeat;
background-size: cover;
.container-title {
width: 100%;
background: url('../../../assets/img/cockpit/title.png') no-repeat;
background-size: 100% 100%;
color: #fff;
.title-button {
color: #00fff0;
font-size: 20px;
position: absolute;
}
}
.box-padding {
padding: 0 16px;
}
}
</style>
<style lang="scss">
.material-cockpit {
.specil-table1 {
.el-table .cell {
padding-left: 40px;
padding-right: 40px;
}
.el-table--border th:first-child .cell,
.el-table--border td:first-child .cell {
padding-left: 40px;
}
}
}
</style>