Merge pull request 'projects/mes-zjl' (#386) from projects/mes-zjl into projects/mes-test

Reviewed-on: #386
This commit is contained in:
朱菊兰 2024-07-29 16:54:44 +08:00
förälder 39571053f5 c3d6b87151
incheckning e8d566e121
2 ändrade filer med 921 tillägg och 965 borttagningar

Visa fil

@ -56,207 +56,215 @@
import Navbar from './components/Navbar';
import { debounce } from '@/utils/debounce';
export default {
components: { Navbar },
name: 'choicePart',
data() {
return {
boxReset: '',
scale: 1,
menuArr1: [
{
name: 'Core',
title: '基础核心',
visible: false,
meta: {
title: ''
}
},
{
name: 'Produce',
title: '生产管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Equipment',
title: '设备管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Group',
title: '班组管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Quality',
title: '质量管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Warehouse',
title: '仓库管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Energy',
title: '能源管理',
visible: false,
meta: {
title: ''
}
}
],
menuArr2: [
{
name: 'Packaging',
title: '包装管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Material',
title: '物料管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Extend',
title: '工艺管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'Delivery',
title: '成品发货',
visible: false,
meta: {
title: ''
}
},
{
name: 'Report',
title: '报表管理',
visible: false,
meta: {
title: ''
}
},
{
name: 'System',
title: '系统管理',
visible: false,
meta: {
title: ''
}
}
],
showItem: false
}
},
// computed:{
// ...mapGetters(['sidebarRouters'])
// },
mounted() {
this.getMsg()
this.boxReset = debounce(() => {
this.resetSize()
}, 300)
this.boxReset()
window.addEventListener('resize', () => {
this.boxReset()
})
},
methods: {
getMsg() {
let menuList = this.$store.state.permission.sidebarRouters
console.log('sss', menuList)
console.log(menuList)
if (menuList.length > 0) {
for (let i = 0; i < menuList.length; i ++) {
for (let k = 0; k < 7; k++) {
if (menuList[i].name === this.menuArr1[k].name) {
this.menuArr1[k].visible = true
this.menuArr1[k].id = menuList[i].id
this.menuArr1[k].choicepart = i
this.menuArr1[k].children = menuList[i].children
this.menuArr1[k].meta = menuList[i].meta
}
}
for (let j = 0; j < 6; j++) {
if (menuList[i].name === this.menuArr2[j].name) {
this.menuArr2[j].visible = true
this.menuArr2[j].id = menuList[i].id
this.menuArr2[j].choicepart = i
this.menuArr2[j].children = menuList[i].children
this.menuArr2[j].meta = menuList[i].meta
}
}
}
}
console.log(this.menuArr1)
console.log(this.menuArr2)
},
handelClick(item, index) {
// this.$router.push({name: 'SystemUser'})
this.$store.dispatch('app/setChoicepart', index)
this.toRouter(item)
// if (item.meta.unuse) {
// this.$message.warning(this.$t(''))
// } else {
// this.toRouter(item)
// }
},
toRouter(item) {
console.log(item)
if (item.children) {
this.toRouter(item.children[0])
} else {
this.$router.push({ name: item.name })
}
},
resetSize() {
let _this = this
_this.showItem = false
_this.loading = true
let choicepartBox = document.querySelector('#choicepartBox')
let rw = parseFloat(window.innerWidth)
let rh = parseFloat(window.innerHeight)
let bw = parseFloat(choicepartBox.style.width)
let bh = parseFloat(choicepartBox.style.height)
let wx = 0.82/(bw / rw)
let hx = 0.56/(bh / rh)
_this.scale = wx > hx ? hx : wx
setTimeout(_this.showItemFun, 700)
},
showItemFun() {
this.loading = false
this.showItem = true
}
},
beforeDestroy() {
this.showItem = false
}
}
components: { Navbar },
name: 'choicePart',
data() {
return {
boxReset: '',
scale: 1,
menuArr1: [
{
name: 'Core',
title: '基础核心',
visible: false,
meta: {
title: '',
},
},
{
name: 'Produce',
title: '生产管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Equipment',
title: '设备管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Group',
title: '班组管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Quality',
title: '质量管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Warehouse',
title: '仓库管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Energy',
title: '能源管理',
visible: false,
meta: {
title: '',
},
},
],
menuArr2: [
{
name: 'Packaging',
title: '包装管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Material',
title: '物料管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Extend',
title: '工艺管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Delivery',
title: '成品发货',
visible: false,
meta: {
title: '',
},
},
{
name: 'Report',
title: '报表管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'System',
title: '系统管理',
visible: false,
meta: {
title: '',
},
},
{
name: 'Devconfig',
title: '开发配置',
visible: false,
meta: {
title: '',
},
},
],
showItem: false,
};
},
// computed:{
// ...mapGetters(['sidebarRouters'])
// },
mounted() {
this.getMsg();
this.boxReset = debounce(() => {
this.resetSize();
}, 300);
this.boxReset();
window.addEventListener('resize', () => {
this.boxReset();
});
},
methods: {
getMsg() {
let menuList = this.$store.state.permission.sidebarRouters;
console.log('sss', menuList);
console.log(menuList);
if (menuList.length > 0) {
for (let i = 0; i < menuList.length; i++) {
for (let k = 0; k < 7; k++) {
if (menuList[i].name === this.menuArr1[k].name) {
this.menuArr1[k].visible = true;
this.menuArr1[k].id = menuList[i].id;
this.menuArr1[k].choicepart = i;
this.menuArr1[k].children = menuList[i].children;
this.menuArr1[k].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;
this.menuArr2[j].choicepart = i;
this.menuArr2[j].children = menuList[i].children;
this.menuArr2[j].meta = menuList[i].meta;
}
}
}
}
console.log(this.menuArr1);
console.log(this.menuArr2);
},
handelClick(item, index) {
// this.$router.push({name: 'SystemUser'})
this.$store.dispatch('app/setChoicepart', index);
this.toRouter(item);
// if (item.meta.unuse) {
// this.$message.warning(this.$t(''))
// } else {
// this.toRouter(item)
// }
},
toRouter(item) {
console.log(item);
if (item.children) {
this.toRouter(item.children[0]);
} else {
this.$router.push({ name: item.name });
}
},
resetSize() {
let _this = this;
_this.showItem = false;
_this.loading = true;
let choicepartBox = document.querySelector('#choicepartBox');
let rw = parseFloat(window.innerWidth);
let rh = parseFloat(window.innerHeight);
let bw = parseFloat(choicepartBox.style.width);
let bh = parseFloat(choicepartBox.style.height);
let wx = 0.82 / (bw / rw);
let hx = 0.56 / (bh / rh);
_this.scale = wx > hx ? hx : wx;
setTimeout(_this.showItemFun, 700);
},
showItemFun() {
this.loading = false;
this.showItem = true;
},
},
beforeDestroy() {
this.showItem = false;
},
};
</script>
<style lang="scss" scoped>
.choicepart-container {

1476
yarn.lock

Filskillnaden har hållits tillbaka eftersom den är för stor Load Diff