import Vue from 'vue'
|
import App from './App.vue'
|
|
import './assets/common.less'
|
import './assets/tailwind.css'
|
import dataV from '@jiaminghi/data-view'
|
import router from './router'
|
import store from './store'
|
import TitleComponents from './components/TitleComponents'
|
Vue.component('TitleComponents', TitleComponents)
|
|
import axios from './utils/request';
|
Vue.prototype.$axios = axios
|
Vue.filter('formatNumber', (num) => {
|
if (num && num >= 1000) {
|
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
} else {
|
return num || 0
|
}
|
})
|
|
import * as echarts from 'echarts';
|
Vue.prototype.$echarts = echarts
|
import 'echarts-gl';
|
Vue.prototype.$getFlex = (obj) => {
|
let num = 0;
|
if (obj.children.length) {
|
obj.children.map((item) => {
|
if (item.children.length) {
|
num = num + 1;
|
item.children.map((ite) => {
|
if (ite.children.length) {
|
num = num + 1;
|
ite.children.map((it) => {
|
if (it.children.length) {
|
num = num + 1;
|
it.children.map((t) => { });
|
}
|
});
|
}
|
});
|
}
|
});
|
}
|
if (num == 0) {
|
num = 1
|
}
|
return num;
|
}
|
Vue.prototype.$jiaNum = (val) => {
|
if (val == 1) {
|
localStorage.setItem('num', 0)
|
}
|
localStorage.setItem('num', localStorage.getItem('num') * 1 + 1)
|
return localStorage.getItem('num')
|
}
|
|
import animated from 'animate.css'
|
import 'vue2-animate/dist/vue2-animate.min.css';
|
|
import cookies from 'vue-cookies'
|
Vue.prototype.$cookies = cookies;
|
|
import moment from 'moment'
|
// 这是年月日时分秒的格式 dateTime这个是自己定义的
|
Vue.filter('dateTime', function (dataStr, pattern = 'YYYY.MM.DD HH:mm:ss') {
|
return moment(dataStr).format(pattern)
|
})
|
|
import {
|
Button,
|
Select,
|
Dialog,
|
Input,
|
Message,
|
Table,
|
TableColumn,
|
Progress,
|
Form,
|
FormItem,
|
DatePicker,
|
Option,
|
Row,
|
Col,
|
Icon,
|
Pagination,
|
Divider,
|
Statistic,
|
Tree,
|
Cascader
|
} from 'element-ui';
|
|
Vue.component(Statistic.name, Statistic);
|
Vue.component(Button.name, Button);
|
Vue.component(Select.name, Select);
|
Vue.component(Dialog.name, Dialog);
|
Vue.component(Input.name, Input);
|
Vue.component(Message.name, Message);
|
Vue.component(Table.name, Table);
|
Vue.component(TableColumn.name, TableColumn);
|
Vue.component(Progress.name, Progress);
|
Vue.component(Form.name, Form);
|
Vue.component(FormItem.name, FormItem);
|
Vue.component(DatePicker.name, DatePicker);
|
Vue.component(Option.name, Option);
|
Vue.component(Row.name, Row);
|
Vue.component(Col.name, Col);
|
Vue.component(Icon.name, Icon);
|
Vue.component(Pagination.name, Pagination);
|
Vue.component(Divider.name, Divider);
|
Vue.component(Tree.name, Tree);
|
Vue.component(Cascader.name, Cascader);
|
Vue.use(animated)
|
|
Vue.config.productionTip = false
|
|
Vue.use(dataV)
|
|
|
import './assets/font/font.css'
|
new Vue({
|
router,
|
store,
|
render: h => h(App)
|
}).$mount('#app')
|