main.js 4.6 KB

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