main.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. import Vue from "vue";
  2. // import "vant/lib/index.css";
  3. import App from "./App.vue";
  4. import router from "./router/index";
  5. // import "@/assets/style/font/iconfont.css";
  6. import "@/assets/style/index.less";
  7. import $axios from "@/utils/request";
  8. import store from "./store/index";
  9. import axios from 'axios'; /* 引入axios进行地址访问*/
  10. Vue.prototype.$http = axios;
  11. import "@/components/Vant";
  12. import './components/Element.js'
  13. import { Form , Toast , Grid, GridItem , DatetimePicker , Popover,
  14. Picker , Dialog , NumberKeyboard , Sticky , Skeleton ,
  15. Panel , Divider , List , pullRefresh , SwipeCell, Checkbox,
  16. Search, Slider,Stepper,Tag, Calendar, Row, Col, RadioGroup, Radio,
  17. Loading ,DropdownMenu, DropdownItem, Button, ActionSheet, PullRefresh,Tabbar,
  18. TabbarItem,Uploader,Collapse, CollapseItem,Empty, CheckboxGroup, } from 'vant';
  19. Vue.use(Form).use(Toast).use(Grid).use(GridItem).use(DatetimePicker)
  20. .use(Picker).use(Dialog).use(NumberKeyboard).use(Sticky).use(Skeleton)
  21. .use(Panel).use(Divider).use(List).use(pullRefresh).use(SwipeCell)
  22. .use(Checkbox).use(Search).use(Slider).use(Stepper).use(Tag).use(Calendar).use(RadioGroup).use(Radio)
  23. .use(Row).use(Col).use(Loading).use(DropdownMenu).use(DropdownItem).use(Button).use(ActionSheet)
  24. .use(PullRefresh).use(Tabbar).use(TabbarItem).use(Popover).use(Uploader).use(Collapse).use(CollapseItem).use(Empty).use(CheckboxGroup);
  25. // rem
  26. import "amfe-flexible";
  27. import wx from 'weixin-js-sdk'
  28. Vue.prototype.wx = wx
  29. // 把变量挂载到vue的原型上
  30. axios.defaults.baseURL="http://localhost:10010"
  31. Vue.prototype.$axios = $axios;
  32. Vue.config.productionTip = false;
  33. import * as echarts from 'echarts';
  34. Vue.prototype.$echarts = echarts;
  35. // 富文本
  36. import 'font-awesome/css/font-awesome.css'
  37. import VueHtml5Editor from 'vue-html5-editor'
  38. Vue.use(VueHtml5Editor, {
  39. name: "vue-html5-editor",
  40. showModuleName: false,
  41. icons: {
  42. text: "fa fa-pencil",
  43. color: "fa fa-paint-brush",
  44. font: "fa fa-font",
  45. align: "fa fa-align-justify",
  46. list: "fa fa-list",
  47. link: "fa fa-chain",
  48. unlink: "fa fa-chain-broken",
  49. tabulation: "fa fa-table",
  50. image: "fa fa-file-image-o",
  51. hr: "fa fa-minus",
  52. eraser: "fa fa-eraser",
  53. undo: "fa-undo fa",
  54. "full-screen": "fa fa-arrows-alt",
  55. info: "fa fa-info",
  56. },
  57. image: {
  58. sizeLimit: 512 * 1024,
  59. upload: {
  60. url: null,
  61. headers: {},
  62. params: {},
  63. fieldName: {}
  64. },
  65. compress: {
  66. width: 1600,
  67. height: 1600,
  68. quality: 80
  69. },
  70. uploadHandler(responseText){
  71. var json = JSON.parse(responseText)
  72. if (!json.ok) {
  73. alert(json.msg)
  74. } else {
  75. return json.data
  76. }
  77. }
  78. },
  79. language: "zh-cn",
  80. i18n: {
  81. "zh-cn": {
  82. "align": "对齐方式",
  83. "image": "图片",
  84. "list": "列表",
  85. "link": "链接",
  86. "unlink": "去除链接",
  87. "table": "表格",
  88. "font": "文字",
  89. "full screen": "全屏",
  90. "text": "排版",
  91. "eraser": "格式清除",
  92. "info": "关于",
  93. "color": "颜色",
  94. "please enter a url": "请输入地址",
  95. "create link": "创建链接",
  96. "bold": "加粗",
  97. "italic": "倾斜",
  98. "underline": "下划线",
  99. "strike through": "删除线",
  100. "subscript": "上标",
  101. "superscript": "下标",
  102. "heading": "标题",
  103. "font name": "字体",
  104. "font size": "文字大小",
  105. "left justify": "左对齐",
  106. "center justify": "居中",
  107. "right justify": "右对齐",
  108. "ordered list": "有序列表",
  109. "unordered list": "无序列表",
  110. "fore color": "前景色",
  111. "background color": "背景色",
  112. "row count": "行数",
  113. "column count": "列数",
  114. "save": "确定",
  115. "upload": "上传",
  116. "progress": "进度",
  117. "unknown": "未知",
  118. "please wait": "请稍等",
  119. "error": "错误",
  120. "abort": "中断",
  121. "reset": "重置"
  122. }
  123. },
  124. hiddenModules: [],
  125. visibleModules: [
  126. "text",
  127. "color",
  128. "font",
  129. "align",
  130. "list",
  131. "link",
  132. "unlink",
  133. "tabulation",
  134. // "image",
  135. "hr",
  136. "eraser",
  137. "undo",
  138. "full-screen",
  139. "info",
  140. ],
  141. modules: {}
  142. })
  143. new Vue({
  144. store,
  145. router,
  146. render: h => h(App)
  147. }).$mount("#app");