main.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 mixin from "./mixin/index";
  9. import store from "./store/index";
  10. import axios from 'axios'; /* 引入axios进行地址访问*/
  11. Vue.prototype.$http = axios;
  12. import "@/components/Vant";
  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} 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);
  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.mixin(mixin);
  33. // import wx from 'weixin-js-sdk'
  34. // Vue.prototype.$wx = wx
  35. Vue.config.productionTip = false;
  36. import * as echarts from 'echarts';
  37. Vue.prototype.$echarts = echarts;
  38. // 富文本
  39. import 'font-awesome/css/font-awesome.css'
  40. import VueHtml5Editor from 'vue-html5-editor'
  41. Vue.use(VueHtml5Editor, {
  42. name: "vue-html5-editor",
  43. showModuleName: false,
  44. icons: {
  45. text: "fa fa-pencil",
  46. color: "fa fa-paint-brush",
  47. font: "fa fa-font",
  48. align: "fa fa-align-justify",
  49. list: "fa fa-list",
  50. link: "fa fa-chain",
  51. unlink: "fa fa-chain-broken",
  52. tabulation: "fa fa-table",
  53. image: "fa fa-file-image-o",
  54. hr: "fa fa-minus",
  55. eraser: "fa fa-eraser",
  56. undo: "fa-undo fa",
  57. "full-screen": "fa fa-arrows-alt",
  58. info: "fa fa-info",
  59. },
  60. image: {
  61. sizeLimit: 512 * 1024,
  62. upload: {
  63. url: null,
  64. headers: {},
  65. params: {},
  66. fieldName: {}
  67. },
  68. compress: {
  69. width: 1600,
  70. height: 1600,
  71. quality: 80
  72. },
  73. uploadHandler(responseText){
  74. var json = JSON.parse(responseText)
  75. if (!json.ok) {
  76. alert(json.msg)
  77. } else {
  78. return json.data
  79. }
  80. }
  81. },
  82. language: "zh-cn",
  83. i18n: {
  84. "zh-cn": {
  85. "align": "对齐方式",
  86. "image": "图片",
  87. "list": "列表",
  88. "link": "链接",
  89. "unlink": "去除链接",
  90. "table": "表格",
  91. "font": "文字",
  92. "full screen": "全屏",
  93. "text": "排版",
  94. "eraser": "格式清除",
  95. "info": "关于",
  96. "color": "颜色",
  97. "please enter a url": "请输入地址",
  98. "create link": "创建链接",
  99. "bold": "加粗",
  100. "italic": "倾斜",
  101. "underline": "下划线",
  102. "strike through": "删除线",
  103. "subscript": "上标",
  104. "superscript": "下标",
  105. "heading": "标题",
  106. "font name": "字体",
  107. "font size": "文字大小",
  108. "left justify": "左对齐",
  109. "center justify": "居中",
  110. "right justify": "右对齐",
  111. "ordered list": "有序列表",
  112. "unordered list": "无序列表",
  113. "fore color": "前景色",
  114. "background color": "背景色",
  115. "row count": "行数",
  116. "column count": "列数",
  117. "save": "确定",
  118. "upload": "上传",
  119. "progress": "进度",
  120. "unknown": "未知",
  121. "please wait": "请稍等",
  122. "error": "错误",
  123. "abort": "中断",
  124. "reset": "重置"
  125. }
  126. },
  127. hiddenModules: [],
  128. visibleModules: [
  129. "text",
  130. "color",
  131. "font",
  132. "align",
  133. "list",
  134. "link",
  135. "unlink",
  136. "tabulation",
  137. // "image",
  138. "hr",
  139. "eraser",
  140. "undo",
  141. "full-screen",
  142. "info",
  143. ],
  144. modules: {}
  145. })
  146. new Vue({
  147. store,
  148. router,
  149. render: h => h(App)
  150. }).$mount("#app");