cmvr-wms/ruoyi-ui/src/main.js
lixiaolong ca1f5a27f9 feat(mobile): 优化移动端界面和功能
- 添加移动工作空间对话框全屏样式支持
- 更新应用主视图以支持桌面视口布局
- 重构Excel导入对话框增加预览和校验功能
- 在移动端主页增加生产与交付模块和项目借还功能
- 移动端库存列表显示项目名称和成品标识
- 增加入库记录批量操作和撤销功能
- 优化分页组件在桌面视口中的滚动行为
- 更新路由配置和数据库连接配置
- 调整仓库领域模型移除预期日期字段
- 优化智能代理服务的正则匹配和出库类型处理
2026-10-12 16:41:42 +08:00

92 lines
3.2 KiB
JavaScript

import Vue from 'vue'
import Cookies from 'js-cookie'
import Element from 'element-ui'
import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/app.scss'
import '@/assets/styles/viewport.scss'
import App from './App'
import store from './store'
import router from './router'
import { installAppNavigation } from '@/utils/app-navigation'
import directive from './directive' // directive
import plugins from './plugins' // plugins
import { download } from '@/utils/request'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data"
import { getConfigKey } from "@/api/system/config"
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/common"
// 分页组件
import Pagination from "@/components/Pagination"
// 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar"
import BusinessPageHeader from "@/components/BusinessPageHeader"
// 字典标签组件
import DictTag from '@/components/DictTag'
// 字典数据组件
import DictData from '@/components/DictData'
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.component('BusinessPageHeader', BusinessPageHeader)
// 非首屏重型组件按需加载,避免富文本和拖拽依赖阻塞系统启动。
Vue.component('Editor', () => import(/* webpackChunkName: "component-editor" */ '@/components/Editor'))
Vue.component('FileUpload', () => import(/* webpackChunkName: "component-upload" */ '@/components/FileUpload'))
Vue.component('ImageUpload', () => import(/* webpackChunkName: "component-upload" */ '@/components/ImageUpload'))
Vue.component('ImagePreview', () => import(/* webpackChunkName: "component-image-preview" */ '@/components/ImagePreview'))
Vue.use(directive)
Vue.use(plugins)
DictData.install()
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
*/
Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
})
Vue.config.productionTip = false
installAppNavigation(router)
// 应用成功启动后清理资源恢复标记,后续版本切换仍可自动恢复。
try {
window.sessionStorage.removeItem('cmvr_asset_recovery_time')
const currentUrl = new URL(window.location.href)
if (currentUrl.searchParams.has('_asset_retry')) {
currentUrl.searchParams.delete('_asset_retry')
window.history.replaceState(window.history.state, '', currentUrl.pathname + currentUrl.search + currentUrl.hash)
}
} catch (ignore) {}
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})