main.js 4.8 KB

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