Compare commits

..

No commits in common. "5a00db7dcd3f3f47081b66bf0423196ca021c700" and "87bca23d967f35bf1a1dd91dc45db02c7d7311cf" have entirely different histories.

24 changed files with 319 additions and 344 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -1,349 +1,324 @@
<template> <template>
<div class="choicepart-container"> <div class="choicepart-container">
<navbar /> <navbar />
<div class="choicepart-wrapper"> <div class="choicepart-wrapper">
<div <div class="choicepart-box" id="choicepartBox" :style="'transform:scale('+scale+');width:1574px;height:538px;'" v-show="showItem">
class="choicepart-box" <div class="choicepart-line1">
id="choicepartBox" <div
:style="'transform:scale(' + scale + ');width:1574px;height:538px;'" v-for="(item, index) in menuArr1"
v-show="showItem"> :key="index"
<div class="choicepart-line1"> class="choicepart-item"
<div @click="handelClick(item, item.choicepart)"
v-for="(item, index) in menuArr1" :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
:key="index" >
class="choicepart-item" <div>
@click="handelClick(item, item.choicepart)" <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
:style="{ </div>
opacity: item.visible ? 1 : 0.4, <div class="choicepart-item-title">{{item.meta.title}}</div>
pointerEvents: item.visible ? 'auto' : 'none', </div>
}"> </div>
<div> <div class="choicepart-line2">
<img <div
:src=" v-for="(item, index) in menuArr2"
require(`../../assets/images/choicepart/${item.name}.png`) :key="index"
" class="choicepart-item"
alt="" /> @click="handelClick(item, item.choicepart)"
</div> :style="{opacity: item.visible?1:0.4, pointerEvents:item.visible?'auto':'none'}"
<div class="choicepart-item-title">{{ item.meta.title }}</div> >
</div> <div>
</div> <img :src="require(`../../assets/images/choicepart/${item.name}.png`)" alt="">
<div class="choicepart-line2"> </div>
<div <div class="choicepart-item-title">{{item.meta.title}}</div>
v-for="(item, index) in menuArr2" </div>
:key="index" </div>
class="choicepart-item" </div>
@click="handelClick(item, item.choicepart)" </div>
:style="{ <div class="choicepart-footer">&copy; 中建材智能自动化研究院有限公司</div>
opacity: item.visible ? 1 : 0.4, </div>
pointerEvents: item.visible ? 'auto' : 'none',
}">
<div>
<img
:src="
require(`../../assets/images/choicepart/${item.name}.png`)
"
alt="" />
</div>
<div class="choicepart-item-title">{{ item.meta.title }}</div>
</div>
</div>
</div>
</div>
<div class="choicepart-footer">&copy; 中建材智能自动化研究院有限公司</div>
</div>
</template> </template>
<script> <script>
import Navbar from './components/Navbar'; import Navbar from './components/Navbar'
import { debounce } from '@/utils/debounce'; import { debounce } from '@/utils/debounce'
export default { export default {
components: { Navbar }, components: { Navbar },
name: 'choicePart', name: 'choicePart',
data() { data() {
return { return {
boxReset: '', boxReset: '',
scale: 1, scale: 1,
menuArr1: [ menuArr1: [
{ {
name: 'Core', name: 'Core',
title: '基础核心', title: '基础核心',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Order', name: 'Order',
title: '订单管理', title: '订单管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Equipment', name: 'Equipment',
title: '设备管理', title: '设备管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Group', name: 'Group',
title: '班组管理', title: '班组管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Quality', name: 'Quality',
title: '质量管理', title: '质量管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Warehouse', name: 'Warehouse',
title: '仓库管理', title: '仓库管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Energy', name: 'Energy',
title: '能源管理', title: '能源管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, }
], ],
menuArr2: [ menuArr2: [
{ {
name: 'Packaging', name: 'Packaging',
title: '包装管理', title: '包装管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Material', name: 'Material',
title: '物料管理', title: '物料管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Extend', name: 'Extend',
title: '工艺管理', title: '工艺管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Delivery', name: 'Delivery',
title: '成品发货', title: '成品发货',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'Report', name: 'Report',
title: '报表管理', title: '报表管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, },
{ {
name: 'System', name: 'System',
title: '系统管理', title: '系统管理',
visible: false, visible: false,
meta: { meta: {
title: '', title: ''
}, }
}, }
{ ],
name: 'Devconfig', showItem: false
title: '开发配置', }
visible: false, },
meta: { // computed:{
title: '', // ...mapGetters(['sidebarRouters'])
}, // },
}, mounted() {
], this.getMsg()
showItem: false, this.boxReset = debounce(() => {
}; this.resetSize()
}, }, 300)
// computed:{ this.boxReset()
// ...mapGetters(['sidebarRouters']) window.addEventListener('resize', () => {
// }, this.boxReset()
mounted() { })
this.getMsg(); },
this.boxReset = debounce(() => { methods: {
this.resetSize(); getMsg() {
}, 300); let menuList = this.$store.state.permission.sidebarRouters
this.boxReset(); console.log(menuList)
window.addEventListener('resize', () => { if (menuList.length > 0) {
this.boxReset(); for (let i = 0; i < menuList.length; i ++) {
}); for (let k = 0; k < 7; k++) {
}, if (menuList[i].name === this.menuArr1[k].name) {
methods: { this.menuArr1[k].visible = true
getMsg() { this.menuArr1[k].id = menuList[i].id
let menuList = this.$store.state.permission.sidebarRouters; this.menuArr1[k].choicepart = i
console.log(menuList); this.menuArr1[k].children = menuList[i].children
if (menuList.length > 0) { this.menuArr1[k].meta = menuList[i].meta
for (let i = 0; i < menuList.length; i++) { }
for (let k = 0; k < 7; k++) { }
if (menuList[i].name === this.menuArr1[k].name) { for (let j = 0; j < 6; j++) {
this.menuArr1[k].visible = true; if (menuList[i].name === this.menuArr2[j].name) {
this.menuArr1[k].id = menuList[i].id; this.menuArr2[j].visible = true
this.menuArr1[k].choicepart = i; this.menuArr2[j].id = menuList[i].id
this.menuArr1[k].children = menuList[i].children; this.menuArr2[j].choicepart = i
this.menuArr1[k].meta = menuList[i].meta; this.menuArr2[j].children = menuList[i].children
} this.menuArr2[j].meta = menuList[i].meta
} }
for (let j = 0; j < 7; j++) { }
if (menuList[i].name === this.menuArr2[j].name) { }
this.menuArr2[j].visible = true; }
this.menuArr2[j].id = menuList[i].id; console.log(this.menuArr1)
this.menuArr2[j].choicepart = i; console.log(this.menuArr2)
this.menuArr2[j].children = menuList[i].children; },
this.menuArr2[j].meta = menuList[i].meta; handelClick(item, index) {
} // this.$router.push({name: 'SystemUser'})
} this.$store.dispatch('app/setChoicepart', index)
} this.toRouter(item)
} // if (item.meta.unuse) {
console.log(this.menuArr1); // this.$message.warning(this.$t(''))
console.log(this.menuArr2); // } else {
}, // this.toRouter(item)
handelClick(item, index) { // }
// this.$router.push({name: 'SystemUser'}) },
this.$store.dispatch('app/setChoicepart', index); toRouter(item) {
this.toRouter(item); console.log(item)
// if (item.meta.unuse) { if (item.children) {
// this.$message.warning(this.$t('')) this.toRouter(item.children[0])
// } else { } else {
// this.toRouter(item) this.$router.push({ name: item.name })
// } }
}, },
toRouter(item) { resetSize() {
console.log(item); let _this = this
if (item.children) { _this.showItem = false
this.toRouter(item.children[0]); _this.loading = true
} else { let choicepartBox = document.querySelector('#choicepartBox')
this.$router.push({ name: item.name }); let rw = parseFloat(window.innerWidth)
} let rh = parseFloat(window.innerHeight)
}, let bw = parseFloat(choicepartBox.style.width)
resetSize() { let bh = parseFloat(choicepartBox.style.height)
let _this = this; let wx = 0.82/(bw / rw)
_this.showItem = false; let hx = 0.56/(bh / rh)
_this.loading = true; _this.scale = wx > hx ? hx : wx
let choicepartBox = document.querySelector('#choicepartBox'); setTimeout(_this.showItemFun, 700)
let rw = parseFloat(window.innerWidth); },
let rh = parseFloat(window.innerHeight); showItemFun() {
let bw = parseFloat(choicepartBox.style.width); this.loading = false
let bh = parseFloat(choicepartBox.style.height); this.showItem = true
let wx = 0.82 / (bw / rw); }
let hx = 0.56 / (bh / rh); },
_this.scale = wx > hx ? hx : wx; beforeDestroy() {
setTimeout(_this.showItemFun, 700); this.showItem = false
}, }
showItemFun() {
this.loading = false;
this.showItem = true;
},
},
beforeDestroy() {
this.showItem = false;
},
};
</script>
<style lang="scss" scoped>
.choicepart-container {
position: relative;
width: 100%;
height: 100%;
background: url('../../assets/images/choicepart/choicepart-back.png') repeat;
background-size: 100% 100%;
.choicepart-wrapper {
width: 100vw;
height: calc(100vh - 94px);
display: flex;
justify-content: center;
align-items: center;
}
.choicepart-box {
// transition: all 0.3s linear;
.choicepart-line1 {
width: 100%;
margin-bottom: 80px;
display: flex;
flex-flow: row nowrap;
}
.choicepart-line2 {
width: 100%;
display: flex;
flex-flow: row nowrap;
justify-content: center;
}
.choicepart-item {
width: 184px;
height: 224px;
background: url('../../assets/images/choicepart/choice-item-back.png')
no-repeat;
background-size: 100% 100%;
border-radius: 5px;
overflow: hidden;
cursor: pointer;
position: relative;
margin: 0 20px;
img {
width: 184px;
height: 224px;
}
.choicepart-item-title {
overflow: hidden;
padding: 0 10px;
text-overflow: ellipsis;
white-space: nowrap;
position: absolute;
bottom: 0;
left: 2px;
right: 2px;
text-align: center;
color: #fff;
font-size: 16px;
line-height: 40px;
height: 40px;
letter-spacing: 2px;
background-color: rgba($color: #0b58ff, $alpha: 0.45);
}
}
.choicepart-item:hover {
.choicepart-item-title {
background-color: rgba($color: #0b58ff, $alpha: 1);
}
}
}
.choicepart-footer {
position: absolute;
width: 100%;
color: #c7c7c7;
user-select: none;
font-size: 12px;
letter-spacing: 1px;
height: 30px;
display: grid;
place-content: center;
bottom: 0;
opacity: 0.5;
}
} }
</style> </script>
<style lang='scss' scoped>
.choicepart-container {
position: relative;
width: 100%;
height: 100%;
background: url('../../assets/images/choicepart/choicepart-back.png') repeat;
background-size: 100% 100%;
.choicepart-wrapper {
width: 100vw;
height: calc(100vh - 94px);
display: flex;
justify-content: center;
align-items: center;
}
.choicepart-box {
// transition: all 0.3s linear;
.choicepart-line1 {
width: 100%;
margin-bottom: 80px;
display: flex;
flex-flow: row nowrap;
}
.choicepart-line2 {
width: 100%;
display: flex;
flex-flow: row nowrap;
justify-content: center;
}
.choicepart-item {
width: 184px;
height: 224px;
background: url('../../assets/images/choicepart/choice-item-back.png') no-repeat;
background-size: 100% 100%;
border-radius: 5px;
overflow: hidden;
cursor: pointer;
position: relative;
margin: 0 20px;
img {
width: 184px;
height: 224px;
}
.choicepart-item-title {
overflow: hidden;
padding: 0 10px;
text-overflow: ellipsis;
white-space: nowrap;
position: absolute;
bottom: 0;
left: 2px;
right: 2px;
text-align: center;
color: #fff;
font-size: 16px;
line-height: 40px;
height: 40px;
letter-spacing: 2px;
background-color: rgba($color: #0b58ff, $alpha: 0.45);
}
}
.choicepart-item:hover {
.choicepart-item-title {
background-color: rgba($color: #0b58ff, $alpha: 1);
}
}
}
.choicepart-footer {
position: absolute;
width: 100%;
color: #C7C7C7;
user-select: none;
font-size: 12px;
letter-spacing: 1px;
height: 30px;
display: grid;
place-content: center;
bottom: 0;
opacity: 0.5;
}
}
</style>