1 |
- {"ast":null,"code":"import \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.array.find.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.iterator.constructor.js\";\nimport \"core-js/modules/es.iterator.filter.js\";\nimport \"core-js/modules/es.iterator.find.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.includes.js\";\nexport default {\n name: 'App',\n data: function data() {\n return {\n searchQuery: '',\n showSidebar: false,\n windowWidth: window.innerWidth,\n showProcessTypeSelector: false,\n selectedProcessType: 'employee',\n menuItems: [{\n path: '/process/employee',\n title: '员工入职业务流程',\n icon: 'el-icon-user',\n showProcessSelector: true\n }, {\n path: '/process/x6',\n title: 'X6员工入职流程图',\n icon: 'el-icon-position',\n showProcessSelector: false\n }, {\n path: '/process/sales',\n title: '销售订单业务流程',\n icon: 'el-icon-goods',\n showProcessSelector: true\n }, {\n path: '/process/shipping',\n title: '发货业务流程',\n icon: 'el-icon-truck',\n showProcessSelector: true\n }]\n };\n },\n computed: {\n currentRoute: function currentRoute() {\n return this.$route.path;\n },\n filteredMenuItems: function filteredMenuItems() {\n var _this = this;\n return this.menuItems.filter(function (item) {\n return item.title.toLowerCase().includes(_this.searchQuery.toLowerCase());\n });\n },\n isMobile: function isMobile() {\n return this.windowWidth < 768;\n }\n },\n methods: {\n handleSearch: function handleSearch() {\n // 这里可以添加额外的搜索逻辑\n },\n handleResize: function handleResize() {\n this.windowWidth = window.innerWidth;\n },\n handleMobileMenuSelect: function handleMobileMenuSelect() {\n // 在移动端选择菜单项后关闭侧边栏\n this.showSidebar = false;\n },\n handleMenuItemClick: function handleMenuItemClick(item) {\n // 显示或隐藏流程类型选择器\n this.showProcessTypeSelector = item.showProcessSelector || false;\n\n // 根据当前路径设置默认选中的流程类型\n if (item.path.includes('employee')) {\n this.selectedProcessType = 'employee';\n } else if (item.path.includes('sales')) {\n this.selectedProcessType = 'sales';\n } else if (item.path.includes('shipping')) {\n this.selectedProcessType = 'shipping';\n }\n },\n handleProcessTypeChange: function handleProcessTypeChange(value) {\n // 通知流程组件更新流程类型\n this.$root.$emit('change-process-type', value);\n }\n },\n mounted: function mounted() {\n window.addEventListener('resize', this.handleResize);\n\n // 根据当前路径初始化\n var currentPath = this.$route.path;\n var currentItem = this.menuItems.find(function (item) {\n return item.path === currentPath;\n });\n if (currentItem) {\n this.showProcessTypeSelector = currentItem.showProcessSelector || false;\n }\n },\n beforeDestroy: function beforeDestroy() {\n window.removeEventListener('resize', this.handleResize);\n }\n};","map":{"version":3,"names":["name","data","searchQuery","showSidebar","windowWidth","window","innerWidth","showProcessTypeSelector","selectedProcessType","menuItems","path","title","icon","showProcessSelector","computed","currentRoute","$route","filteredMenuItems","_this","filter","item","toLowerCase","includes","isMobile","methods","handleSearch","handleResize","handleMobileMenuSelect","handleMenuItemClick","handleProcessTypeChange","value","$root","$emit","mounted","addEventListener","currentPath","currentItem","find","beforeDestroy","removeEventListener"],"sources":["src/App.vue"],"sourcesContent":["<template>\n <div id=\"app\">\n <el-container>\n <!-- 移动端显示的顶部栏 -->\n <el-header v-if=\"isMobile\" class=\"mobile-header\">\n <div class=\"mobile-header-content\">\n <i class=\"el-icon-s-platform\" style=\"font-size: 24px; color: #409EFF;\"></i>\n <h3 class=\"mobile-title\">业务流程管理</h3>\n <i class=\"el-icon-s-unfold\" @click=\"showSidebar = true\"></i>\n </div>\n </el-header>\n \n <!-- 侧边栏 - 在移动端作为抽屉显示 -->\n <el-drawer\n v-if=\"isMobile\"\n title=\"业务流程导航\"\n :visible.sync=\"showSidebar\"\n direction=\"ltr\"\n size=\"80%\">\n <div class=\"mobile-sidebar\">\n <div class=\"search-container\">\n <el-input\n v-model=\"searchQuery\"\n placeholder=\"搜索业务名称\"\n prefix-icon=\"el-icon-search\"\n clearable\n @input=\"handleSearch\">\n </el-input>\n </div>\n <el-menu\n :router=\"true\"\n :default-active=\"currentRoute\"\n @select=\"handleMobileMenuSelect\">\n <el-menu-item \n v-for=\"item in filteredMenuItems\" \n :key=\"item.path\"\n :index=\"item.path\">\n <i :class=\"item.icon\"></i>\n <span>{{ item.title }}</span>\n </el-menu-item>\n </el-menu>\n </div>\n </el-drawer>\n \n <!-- 桌面端的常规侧边栏 -->\n <el-aside v-if=\"!isMobile\" width=\"250px\">\n <div class=\"logo-container\">\n <!-- 使用 Element UI 图标临时替代 logo -->\n <i class=\"el-icon-s-platform\" style=\"font-size: 40px; color: #409EFF;\"></i>\n </div>\n <div class=\"search-container\">\n <el-input\n v-model=\"searchQuery\"\n placeholder=\"搜索业务名称\"\n prefix-icon=\"el-icon-search\"\n clearable\n @input=\"handleSearch\">\n </el-input>\n </div>\n \n <!-- 流程类型选择器 -->\n <div class=\"process-type-selector\" v-if=\"showProcessTypeSelector\">\n <h4>选择流程类型</h4>\n <el-radio-group v-model=\"selectedProcessType\" @change=\"handleProcessTypeChange\" size=\"small\">\n <el-radio-button label=\"employee\">员工入职流程</el-radio-button>\n <el-radio-button label=\"sales\">销售订单流程</el-radio-button>\n <el-radio-button label=\"shipping\">发货业务流程</el-radio-button>\n </el-radio-group>\n </div>\n \n <el-menu\n :router=\"true\"\n :default-active=\"currentRoute\"\n class=\"el-menu-vertical\">\n <el-menu-item \n v-for=\"item in filteredMenuItems\" \n :key=\"item.path\"\n :index=\"item.path\"\n @click=\"handleMenuItemClick(item)\">\n <i :class=\"item.icon\"></i>\n <span>{{ item.title }}</span>\n </el-menu-item>\n </el-menu>\n </el-aside>\n <el-main>\n <router-view></router-view>\n </el-main>\n </el-container>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'App',\n data() {\n return {\n searchQuery: '',\n showSidebar: false,\n windowWidth: window.innerWidth,\n showProcessTypeSelector: false,\n selectedProcessType: 'employee',\n menuItems: [\n { \n path: '/process/employee', \n title: '员工入职业务流程',\n icon: 'el-icon-user',\n showProcessSelector: true\n },\n { \n path: '/process/x6', \n title: 'X6员工入职流程图',\n icon: 'el-icon-position',\n showProcessSelector: false\n },\n { \n path: '/process/sales', \n title: '销售订单业务流程',\n icon: 'el-icon-goods',\n showProcessSelector: true\n },\n { \n path: '/process/shipping', \n title: '发货业务流程',\n icon: 'el-icon-truck',\n showProcessSelector: true\n }\n ]\n }\n },\n computed: {\n currentRoute() {\n return this.$route.path\n },\n filteredMenuItems() {\n return this.menuItems.filter(item => \n item.title.toLowerCase().includes(this.searchQuery.toLowerCase())\n )\n },\n isMobile() {\n return this.windowWidth < 768\n }\n },\n methods: {\n handleSearch() {\n // 这里可以添加额外的搜索逻辑\n },\n handleResize() {\n this.windowWidth = window.innerWidth\n },\n handleMobileMenuSelect() {\n // 在移动端选择菜单项后关闭侧边栏\n this.showSidebar = false\n },\n handleMenuItemClick(item) {\n // 显示或隐藏流程类型选择器\n this.showProcessTypeSelector = item.showProcessSelector || false\n \n // 根据当前路径设置默认选中的流程类型\n if (item.path.includes('employee')) {\n this.selectedProcessType = 'employee'\n } else if (item.path.includes('sales')) {\n this.selectedProcessType = 'sales'\n } else if (item.path.includes('shipping')) {\n this.selectedProcessType = 'shipping'\n }\n },\n handleProcessTypeChange(value) {\n // 通知流程组件更新流程类型\n this.$root.$emit('change-process-type', value)\n }\n },\n mounted() {\n window.addEventListener('resize', this.handleResize)\n \n // 根据当前路径初始化\n const currentPath = this.$route.path\n const currentItem = this.menuItems.find(item => item.path === currentPath)\n if (currentItem) {\n this.showProcessTypeSelector = currentItem.showProcessSelector || false\n }\n },\n beforeDestroy() {\n window.removeEventListener('resize', this.handleResize)\n }\n}\n</script>\n\n<style>\n#app {\n font-family: Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n height: 100vh;\n}\n\n.el-container {\n height: 100%;\n}\n\n.el-aside {\n background-color: #f8f9fa;\n border-right: 1px solid #e9ecef;\n}\n\n.logo-container {\n padding: 20px;\n text-align: center;\n}\n\n.search-container {\n padding: 0 20px 20px 20px;\n}\n\n/* 流程类型选择器样式 */\n.process-type-selector {\n margin: 0 20px 20px;\n padding: 15px;\n background-color: #f0f7ff;\n border-radius: 8px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);\n transition: all 0.3s ease;\n}\n\n.process-type-selector h4 {\n margin-top: 0;\n margin-bottom: 12px;\n color: #2c3e50;\n font-size: 16px;\n font-weight: 500;\n}\n\n.process-type-selector .el-radio-group {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n\n.process-type-selector .el-radio-button {\n margin-bottom: 5px;\n}\n\n.process-type-selector .el-radio-button__inner {\n width: 100%;\n text-align: left;\n padding: 8px 15px;\n border-radius: 4px !important;\n border-left: 1px solid #dcdfe6 !important;\n}\n\n.process-type-selector .el-radio-button:first-child .el-radio-button__inner {\n border-radius: 4px !important;\n}\n\n.process-type-selector .el-radio-button:last-child .el-radio-button__inner {\n border-radius: 4px !important;\n}\n\n.el-menu-vertical {\n border-right: none;\n}\n\n.el-main {\n padding: 20px;\n background-color: #fff;\n overflow-x: auto;\n}\n\n.el-menu-item {\n font-size: 16px;\n}\n\n.el-menu-item i {\n margin-right: 5px;\n font-size: 18px;\n}\n\n/* 移动端样式 */\n.mobile-header {\n background-color: #fff;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n padding: 0;\n}\n\n.mobile-header-content {\n height: 60px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 15px;\n}\n\n.mobile-title {\n margin: 0;\n font-size: 18px;\n color: #303133;\n}\n\n.mobile-sidebar {\n padding: 20px 0;\n}\n\n.el-drawer__body {\n padding: 0;\n}\n\n.el-drawer__header {\n margin-bottom: 0;\n padding: 15px 20px;\n border-bottom: 1px solid #ebeef5;\n}\n\n@media (max-width: 767px) {\n .el-main {\n padding: 15px;\n }\n \n .search-container {\n padding: 0 15px 15px 15px;\n }\n \n .process-type-selector {\n margin: 0 15px 15px;\n padding: 10px;\n }\n \n .process-type-selector .el-radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n }\n \n .process-type-selector .el-radio-button {\n margin-right: 5px;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