Files
scrq-hd/.svn/pristine/a2/a2eb4fd647e81394a535bbcc3a1a2c209a369e71.svn-base
2025-07-03 10:34:04 +08:00

130 lines
3.5 KiB
Plaintext

import Vue from './vue-Init'
import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { listUser } from "@/api/system/user";
import { parseTime, resetForm, addDateRange, selectDictLabel, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
import "./assets/icon/iconfont.js"
import "./assets/icon/icon.css"
import echarts from 'echarts'
import layer from 'vue-layer'
import 'vue-layer/lib/vue-layer.css';
import plugins from './components/mes/plugins'
//质量模块组件
import FormMaking from './../lib/vue-form-making'
import './../lib/vue-form-making/dist/FormMaking.css'
//lodop打印
import { getLodop } from "./assets/js/LodopFuncs";
console.log(FormMaking)
Vue.use(FormMaking)
Vue.use(plugins);
import '@/assets/css/common.css';
//质量模块组件
// import FormMaking from './../lib/vue-form-making'
// import './../lib/vue-form-making/dist/FormMaking.css'
// console.log(FormMaking)
// Vue.use(FormMaking)
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.listUser = listUser
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.$layer = layer(Vue);
Vue.prototype.getLodop = getLodop;
//打印机驱动
import Print from 'vue-print-nb'
Vue.use(Print);
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });
}
Vue.prototype.msgError = function (msg) {
this.$message({ showClose: true, message: msg, type: "error" });
}
Vue.prototype.msgInfo = function (msg) {
this.$message.info(msg);
}
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.use(permission)
import parseDict from "./utils/dict"
Vue.use(parseDict)
/**
* 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
})
/**
* 处理xhr请求后的返回值
* @param res { any }
* @param callback { (data) => void }
* @param message { string } 成功消息
*/
Vue.prototype.handleRes = (res, callback, message= '') => {
if (res.code === 200) {
callback && callback(res.data)
message && Element.Message.success(message)
} else if (res.data && res.data.code === 200) {
callback && callback(res.data.data)
message && Element.Message.success(message)
} else {
const errorMessage = res.msg || res.message || res.data.msg || res.data.message
errorMessage && Element.Message.error(errorMessage)
}
}
Vue.config.productionTip = false
Vue.config.devtools = true
window.VueApp=new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(Viewer)