import Vue from 'vue';
import App from './App.vue';
import store from './store';
import router from './router';
import permission from './permission';
import '@/assets/styles/index.css';
import {
  parseTime,
  selectDictLabelu,
  selectDictLabel,
  selectDictLabels,
  CJ02BD,
  twoPointSum,
  parseTimeParagraph,
  Micrometer,
  weeklyTimeDivision,
  gcj02BD,
  verifyStoreType,
  validatePhone,
  formatChineseDate,
  shareVedioLinks,
  convertToChinese,
} from '@/utils/index';
import { toastLoading } from '@/utils/commonVant';
import '@vant/touch-emulator';
Vue.config.productionTip = false;
import Vant from 'vant';
import { Toast, Notify } from 'vant';
import 'vant/lib/index.css';
import ClipboardJS from 'clipboard';
Vue.use(Vant);
import ElTable from 'element-ui/lib/table';
import 'element-ui/lib/theme-chalk/table.css';
import 'element-ui/lib/theme-chalk/icon.css';
import ElTableColumn from 'element-ui/lib/table-column';
import ElPopover from 'element-ui/lib/popover';
import 'element-ui/lib/theme-chalk/table-column.css';
import 'element-ui/lib/theme-chalk/popover.css';
import Vconsole from 'vconsole';
import ElProgress from 'element-ui/lib/progress';
import 'element-ui/lib/theme-chalk/progress.css';
import ElDialog from 'element-ui/lib/dialog';
import 'element-ui/lib/theme-chalk/dialog.css';
import directive from './directive'; // directive
// import wx from 'weixin-js-sdk';
// jenkins 测试打包前先合并

Vue.use(ElTable);
Vue.use(ElTableColumn);
Vue.use(ElPopover);
Vue.use(ElProgress);
Vue.use(ElDialog);
Vue.config.productionTip = false;
Vue.prototype.parseTime = parseTime;
Vue.prototype.selectDictLabel = selectDictLabel;
Vue.prototype.selectDictLabels = selectDictLabels;
Vue.prototype.selectDictLabelu = selectDictLabelu;
Vue.prototype.weeklyTimeDivision = weeklyTimeDivision;
Vue.prototype.toastLoading = toastLoading;
Vue.prototype.CJ02BD = CJ02BD;
Vue.prototype.gcj02BD = gcj02BD;
Vue.prototype.twoPointSum = twoPointSum;
Vue.prototype.wx = wx;
Vue.prototype.parseTimeParagraph = parseTimeParagraph;
Vue.prototype.Micrometer = Micrometer;
Vue.prototype.verifyStoreType = verifyStoreType;
Vue.prototype.validatePhone = validatePhone;
Vue.prototype.formatChineseDate = formatChineseDate;
Vue.prototype.shareVedioLinks = shareVedioLinks;
Vue.prototype.convertToChinese = convertToChinese;
Vue.prototype.Toast = Toast;
Vue.prototype.notify = Notify;
var clipboard = new ClipboardJS('.btn');
clipboard.on('success', function (e) {
  Toast('编码复制成功！');
});

clipboard.on('error', function (e) {
  Toast('编码复制失败！');
});

const isProd = process.env.NODE_ENV !== 'production';
if (isProd) {
  const vConsole = new Vconsole();
  Vue.use(vConsole);
}

const locationOrigin = process.env.NODE_ENV === 'development' ? '/releaseMobile' : '/mobile';
Vue.prototype.locationOrigin = locationOrigin;

Vue.use(directive);

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app');
