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
commit e8d566e121
2 changed files with 921 additions and 965 deletions

View File

@ -56,207 +56,215 @@
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: 'Produce', name: 'Produce',
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: '',
} },
} },
], {
showItem: false name: 'Devconfig',
} title: '开发配置',
}, visible: false,
// computed:{ meta: {
// ...mapGetters(['sidebarRouters']) title: '',
// }, },
mounted() { },
this.getMsg() ],
this.boxReset = debounce(() => { showItem: false,
this.resetSize() };
}, 300) },
this.boxReset() // computed:{
window.addEventListener('resize', () => { // ...mapGetters(['sidebarRouters'])
this.boxReset() // },
}) mounted() {
}, this.getMsg();
methods: { this.boxReset = debounce(() => {
getMsg() { this.resetSize();
let menuList = this.$store.state.permission.sidebarRouters }, 300);
console.log('sss', menuList) 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('sss', menuList);
this.menuArr1[k].children = menuList[i].children console.log(menuList);
this.menuArr1[k].meta = menuList[i].meta if (menuList.length > 0) {
} for (let i = 0; i < menuList.length; i++) {
} for (let k = 0; k < 7; k++) {
for (let j = 0; j < 6; j++) { if (menuList[i].name === this.menuArr1[k].name) {
if (menuList[i].name === this.menuArr2[j].name) { this.menuArr1[k].visible = true;
this.menuArr2[j].visible = true this.menuArr1[k].id = menuList[i].id;
this.menuArr2[j].id = menuList[i].id this.menuArr1[k].choicepart = i;
this.menuArr2[j].choicepart = i this.menuArr1[k].children = menuList[i].children;
this.menuArr2[j].children = menuList[i].children this.menuArr1[k].meta = menuList[i].meta;
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;
console.log(this.menuArr1) this.menuArr2[j].id = menuList[i].id;
console.log(this.menuArr2) this.menuArr2[j].choicepart = i;
}, this.menuArr2[j].children = menuList[i].children;
handelClick(item, index) { this.menuArr2[j].meta = menuList[i].meta;
// this.$router.push({name: 'SystemUser'}) }
this.$store.dispatch('app/setChoicepart', index) }
this.toRouter(item) }
// if (item.meta.unuse) { }
// this.$message.warning(this.$t('')) console.log(this.menuArr1);
// } else { console.log(this.menuArr2);
// this.toRouter(item) },
// } handelClick(item, index) {
}, // this.$router.push({name: 'SystemUser'})
toRouter(item) { this.$store.dispatch('app/setChoicepart', index);
console.log(item) this.toRouter(item);
if (item.children) { // if (item.meta.unuse) {
this.toRouter(item.children[0]) // this.$message.warning(this.$t(''))
} else { // } else {
this.$router.push({ name: item.name }) // this.toRouter(item)
} // }
}, },
resetSize() { toRouter(item) {
let _this = this console.log(item);
_this.showItem = false if (item.children) {
_this.loading = true this.toRouter(item.children[0]);
let choicepartBox = document.querySelector('#choicepartBox') } else {
let rw = parseFloat(window.innerWidth) this.$router.push({ name: item.name });
let rh = parseFloat(window.innerHeight) }
let bw = parseFloat(choicepartBox.style.width) },
let bh = parseFloat(choicepartBox.style.height) resetSize() {
let wx = 0.82/(bw / rw) let _this = this;
let hx = 0.56/(bh / rh) _this.showItem = false;
_this.scale = wx > hx ? hx : wx _this.loading = true;
setTimeout(_this.showItemFun, 700) let choicepartBox = document.querySelector('#choicepartBox');
}, let rw = parseFloat(window.innerWidth);
showItemFun() { let rh = parseFloat(window.innerHeight);
this.loading = false let bw = parseFloat(choicepartBox.style.width);
this.showItem = true let bh = parseFloat(choicepartBox.style.height);
} let wx = 0.82 / (bw / rw);
}, let hx = 0.56 / (bh / rh);
beforeDestroy() { _this.scale = wx > hx ? hx : wx;
this.showItem = false setTimeout(_this.showItemFun, 700);
} },
} showItemFun() {
this.loading = false;
this.showItem = true;
},
},
beforeDestroy() {
this.showItem = false;
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.choicepart-container { .choicepart-container {

1476
yarn.lock

File diff suppressed because it is too large Load Diff