You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							76 lines
						
					
					
						
							1.8 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							76 lines
						
					
					
						
							1.8 KiB
						
					
					
				
								import Vue from "vue";
							 | 
						|
								import App from "./App.vue";
							 | 
						|
								import router from "./router";
							 | 
						|
								import store from "./store";
							 | 
						|
								import ElementUI from "element-ui";
							 | 
						|
								import "element-ui/lib/theme-chalk/index.css";
							 | 
						|
								Vue.use(ElementUI);
							 | 
						|
								import axios from "axios";
							 | 
						|
								
							 | 
						|
								console.log('vue',Vue.prototype)
							 | 
						|
								Vue.prototype.$axios = axios;
							 | 
						|
								import JsonExcel from "vue-json-excel"; //vue全局导入导出excel
							 | 
						|
								import Print from "vue-print-nb";
							 | 
						|
								Vue.use(Print);
							 | 
						|
								Vue.component("downloadExcel", JsonExcel);
							 | 
						|
								Vue.config.productionTip = false;
							 | 
						|
								
							 | 
						|
								// Vue.filter('format', function (date) {
							 | 
						|
								//   var json_date = new Date(date).toJSON()
							 | 
						|
								//   return new Date(new Date(json_date) + 8 * 3600 * 1000).toISOString().replace(/t/g, '').replace(/\.[\d]{3}Z/, '')
							 | 
						|
								// })
							 | 
						|
								Vue.directive('focus', {
							 | 
						|
								  // 当被绑定的元素插入到 DOM 中时
							 | 
						|
								  inserted: function (el) {
							 | 
						|
								    // 聚焦元素
							 | 
						|
								    el.focus()
							 | 
						|
								  },
							 | 
						|
								  update: function (el) {
							 | 
						|
								    // 聚焦元素
							 | 
						|
								    el.focus()
							 | 
						|
								  }
							 | 
						|
								})
							 | 
						|
								Vue.filter("dateFormat", (dataStr) => {
							 | 
						|
								  var time = new Date(dataStr);
							 | 
						|
								
							 | 
						|
								  function timeAdd0(str) {
							 | 
						|
								    if (str < 10) {
							 | 
						|
								      str = "0" + str;
							 | 
						|
								    }
							 | 
						|
								    return str;
							 | 
						|
								  }
							 | 
						|
								  var y = time.getFullYear();
							 | 
						|
								  var m = time.getMonth() + 1;
							 | 
						|
								  var d = time.getDate();
							 | 
						|
								  var h = time.getHours();
							 | 
						|
								  var mm = time.getMinutes();
							 | 
						|
								  var s = time.getSeconds();
							 | 
						|
								  return (
							 | 
						|
								    y +
							 | 
						|
								    "-" +
							 | 
						|
								    timeAdd0(m) +
							 | 
						|
								    "-" +
							 | 
						|
								    timeAdd0(d) +
							 | 
						|
								    " " +
							 | 
						|
								    timeAdd0(h) +
							 | 
						|
								    ":" +
							 | 
						|
								    timeAdd0(mm) +
							 | 
						|
								    ":" +
							 | 
						|
								    timeAdd0(s)
							 | 
						|
								  );
							 | 
						|
								});
							 | 
						|
								new Vue({
							 | 
						|
								  router,
							 | 
						|
								  store,
							 | 
						|
								  render: (h) => h(App),
							 | 
						|
								}).$mount("#app");
							 | 
						|
								
							 | 
						|
								
							 | 
						|
								//监听页面大小改变
							 | 
						|
								window.addEventListener('resize', onResize);
							 | 
						|
								function onResize() {    
							 | 
						|
								    //console.log(document.body.clientHeight,'-document.body.clientHeight-',window.innerHeight)
							 | 
						|
								    store.commit('setData', { key: 'window.pageHeight', value: window.innerHeight})
							 | 
						|
								    store.commit('setData', { key: 'window.pageWidth', value: window.innerWidth})
							 | 
						|
								}
							 | 
						|
								onResize();
							 |