main.js 4.9 KB

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