123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- // The Vue build version to load with the `import` command
- // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
- import Vue from 'vue';
- import App from '@/components/App.vue';
- // include
- import '@/config/include.js';
- // 通用store
- import store from '@/store/index.js';
- // router
- import router from './router/index.js';
- import VueApollo from 'vue-apollo'
- import apollo from '@/config/apolloConfig.js'
- import Print from 'vue-print-nb';
- Vue.use(Print);
- import 'xe-utils'
- import VXETable from 'vxe-table'
- import 'vxe-table/lib/style.css'
- Vue.use(VXETable)
- Vue.prototype.$XModal = VXETable.modal
- import AMap from 'vue-amap';
- Vue.use(AMap);
- AMap.initAMapApiLoader({
- key: 'eed46ea40bbcadbf8a9cdd5dc1a94642',
- plugin: [
- "AMap.Autocomplete", // 输入提示插件
- "AMap.PlaceSearch", // POI搜索插件
- "AMap.Scale", // 右下角缩略图插件 比例尺
- "AMap.OverView", // 地图鹰眼插件
- "AMap.ToolBar", // 地图工具条
- "AMap.MapType", // 类别切换控件,实现默认图层与卫星图、实施交通图层之间切换的控制
- "AMap.PolyEditor", // 编辑 折线多,边形
- "AMap.CircleEditor", // 圆形编辑器插件
- "AMap.Geolocation", // 定位控件,用来获取和展示用户主机所在的经纬度位置
- "AMap.ControlBar" // 缩放、尺寸控制器
- ],
- // 默认高德 sdk 版本为 1.4.4
- v: '1.4.15',
- uiVersion: '1.1.1'
- });
- import Share from 'vue-social-share'
- Vue.use(Share);
- import 'view-design/dist/styles/iview.css';
- import ViewUI from 'view-design';
- Vue.use(ViewUI);
- // import VueAMap from 'vue-amap'
-
- // Vue.use(VueAMap)
-
- // VueAMap.initAMapApiLoader({
- // key: 'eed46ea40bbcadbf8a9cdd5dc1a94642',
- // plugin: [//高德地图扩展插件(按需添加)
- // 'AMap.Autocomplete', // 输入提示插件
- // 'AMap.PlaceSearch', // POI搜索插件
- // 'AMap.Scale', // 右下角缩略图插件 比例尺
- // 'AMap.OverView', // 地图鹰眼插件
- // 'AMap.ToolBar', // 地图工具条
- // 'AMap.MapType', // 类别切换控件,实现默认图层与卫星图、实施交通图层之间切换的控制
- // 'AMap.PolyEditor', // 编辑 折线多,边形
- // 'AMap.CircleEditor', // 圆形编辑器插件
- // 'AMap.Geolocation' // 定位控件,用来获取和展示用户主机所在的经纬度位置
- // ],
- // uiVersion: '1.1', // ui库版本,不配置不加载,
- // v: '2.0'
- // })
- // 关闭生产模式下给出的提示
- Vue.config.productionTip = false;
- Vue.use(VueApollo)
- // 注册表格的全局组件
- import DilCommonUI from "@/components/DilCommonUI";
- Vue.use(DilCommonUI);
- const apolloProvider = new VueApollo({
- defaultClient: apollo
- })
- //把时间戳改为正常可读的时间
- export function renderTime(date) {
- if(date !== null){
- let dateee = new Date(date).toJSON();
- return new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, " ").replace(/\.[\d]{3}Z/, "");
- }
- return null;
- }
- //把毫秒数转换分
- export function getDuration(my_time) {
- if(my_time !== null){
- return Math.floor(my_time / 1000 / 60);
- }
- return null;
- }
- export function sjTime(orderPlanInTime) {
- var stringTime = renderTime(orderPlanInTime);
- var timestamp1 = stringTime.replace(/-/g, "/");
- return new Date(timestamp1).getTime();
- }
- //验证电话号码
- export function VerifyPhoneNumber(Phone) {
- var myreg=/^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
- if (!myreg.test(Phone)) {
- return false;
- } else {
- return true;
- }
- }
- export function isNumber(value) {
- //验证是否为数字
- var patrn = /^(-)?\d+(\.\d+)?$/;
- if (patrn.exec(value) == null || value == "") {
- return false;
- } else {
- return true;
- }
- }
- export function isIntegerNumber(value) {
- //验证是否为整数
- var patrn = /^\+?[1-9][0-9]*$/g;
- if (patrn.exec(value) == null || value == "") {
- return false;
- } else {
- return true;
- }
- }
- /* eslint-disable no-new */
- new Vue({
- el: '#app',
- router,
- store,
- components: { App },
- provide: apolloProvider.provide(),
- template: '<App/>'
- });
|