移动端
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

213 righe
6.2 KiB

  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from 'vue'
  4. import App from './App'
  5. import router from './router'
  6. // import FastClick from 'fastclick'
  7. Vue.config.productionTip = false
  8. // import 'lib-flexible/flexible.js'
  9. import 'amfe-flexible/index.js'
  10. import './config/flexible'
  11. import store from './store/'
  12. import './permission' // permission control
  13. import SearchTree from 'vue-search-tree'
  14. import VueHtml5Editor from 'vue-html5-editor'
  15. import "font-awesome/css/font-awesome.css"
  16. import VueCookies from 'vue-cookies'
  17. import "font-awesome/css/font-awesome.css"
  18. import initRichText from './utils/initHTMLEditor';
  19. initRichText();
  20. //引用百度地图
  21. import BaiduMap from 'vue-baidu-map'
  22. Vue.use(VueCookies);
  23. import global from '@/utils/global';
  24. import { getDicts ,getConfigKey } from "@/utils/data";
  25. import { houseGetDicts } from '@/utils/data';
  26. import { selectDictLabel , selectDictScheme , onClickLeft , getNowFormatDate , format , isBankCard } from "@/utils/utils";
  27. import vueEsign from 'vue-esign'
  28. Vue.use(vueEsign)
  29. //全局方法挂载
  30. Vue.prototype.getDicts = getDicts
  31. Vue.prototype.getConfigKey = getConfigKey
  32. Vue.prototype.houseGetDicts = houseGetDicts
  33. Vue.prototype.selectDictLabel = selectDictLabel
  34. Vue.prototype.selectDictScheme = selectDictScheme
  35. Vue.prototype.onClickLeft = onClickLeft
  36. Vue.prototype.getNowFormatDate = getNowFormatDate
  37. Vue.prototype.format = format
  38. Vue.prototype.global = global
  39. Vue.prototype.isBankCard = isBankCard
  40. // Vant 引用
  41. import Vant from 'vant';
  42. import 'vant/lib/index.css';
  43. Vue.use(Vant)
  44. Vue.use(SearchTree)
  45. Vue.use(BaiduMap, {
  46. /* Visit http://lbsyun.baidu.com/apiconsole/key for details about app key. */
  47. ak: 'XzwOBaO4CElCsPdl8LIFEvv5rTemG6w1'
  48. })
  49. Vue.use(VueHtml5Editor,{
  50. // 全局组件名称,使用new VueHtml5Editor(options)时该选项无效
  51. // global component name
  52. name: "vue-html5-editor",
  53. // 是否显示模块名称,开启的话会在工具栏的图标后台直接显示名称
  54. // if set true,will append module name to toolbar after icon
  55. showModuleName: false,
  56. // 自定义各个图标的class,默认使用的是font-awesome提供的图标
  57. // custom icon class of built-in modules,default using fonts-awesome
  58. icons: {
  59. text: "fa fa-pencil",
  60. color: "fa fa-paint-brush",
  61. font: "fa fa-fonts",
  62. align: "fa fa-align-justify",
  63. list: "fa fa-list",
  64. link: "fa fa-chain",
  65. unlink: "fa fa-chain-broken",
  66. tabulation: "fa fa-table",
  67. image: "fa fa-file-image-o",
  68. hr: "fa fa-minus",
  69. eraser: "fa fa-eraser",
  70. undo: "fa-undo fa",
  71. "full-screen": "fa fa-arrows-alt",
  72. info: "fa fa-info",
  73. },
  74. // 配置图片模块
  75. // config image module
  76. image: {
  77. // 文件最大体积,单位字节 max file size
  78. sizeLimit: 512 * 1024,
  79. // 上传参数,默认把图片转为base64而不上传
  80. // upload config,default null and convert image to base64
  81. upload: {
  82. url: null,
  83. headers: {},
  84. params: {},
  85. fieldName: {}
  86. },
  87. // 压缩参数,默认使用localResizeIMG进行压缩,设置为null禁止压缩
  88. // compression config,default resize image by localResizeIMG (https://github.com/think2011/localResizeIMG)
  89. // set null to disable compression
  90. compress: {
  91. width: 1600,
  92. height: 1600,
  93. quality: 80
  94. },
  95. // 响应数据处理,最终返回图片链接
  96. // handle response data,return image url
  97. uploadHandler(responseText){
  98. //default accept json data like {ok:false,msg:"unexpected"} or {ok:true,data:"image url"}
  99. var json = JSON.parse(responseText)
  100. if (!json.ok) {
  101. alert(json.msg)
  102. } else {
  103. return json.data
  104. }
  105. }
  106. },
  107. // 语言,内建的有英文(en-us)和中文(zh-cn)
  108. //default en-us, en-us and zh-cn are built-in
  109. language: "zh-cn",
  110. // 自定义语言
  111. i18n: {
  112. //specify your language here
  113. "zh-cn": {
  114. "align": "对齐方式",
  115. "image": "图片",
  116. "list": "列表",
  117. "link": "链接",
  118. "unlink": "去除链接",
  119. "table": "表格",
  120. "font": "文字",
  121. "full screen": "全屏",
  122. "text": "排版",
  123. "eraser": "格式清除",
  124. "info": "关于",
  125. "color": "颜色",
  126. "please enter a url": "请输入地址",
  127. "create link": "创建链接",
  128. "bold": "加粗",
  129. "italic": "倾斜",
  130. "underline": "下划线",
  131. "strike through": "删除线",
  132. "subscript": "上标",
  133. "superscript": "下标",
  134. "heading": "标题",
  135. "font name": "字体",
  136. "font size": "文字大小",
  137. "left justify": "左对齐",
  138. "center justify": "居中",
  139. "right justify": "右对齐",
  140. "ordered list": "有序列表",
  141. "unordered list": "无序列表",
  142. "fore color": "前景色",
  143. "background color": "背景色",
  144. "row count": "行数",
  145. "column count": "列数",
  146. "save": "确定",
  147. "upload": "上传",
  148. "progress": "进度",
  149. "unknown": "未知",
  150. "please wait": "请稍等",
  151. "error": "错误",
  152. "abort": "中断",
  153. "reset": "重置"
  154. }
  155. },
  156. // 隐藏不想要显示出来的模块
  157. // the modules you don't want
  158. hiddenModules: [],
  159. // 自定义要显示的模块,并控制顺序
  160. // keep only the modules you want and customize the order.
  161. // can be used with hiddenModules together
  162. visibleModules: [
  163. "text",
  164. "color",
  165. "font",
  166. "align",
  167. "list",
  168. "link",
  169. "unlink",
  170. "tabulation",
  171. "image",
  172. "hr",
  173. "eraser",
  174. "undo",
  175. "full-screen",
  176. "info",
  177. ],
  178. // 扩展模块,具体可以参考examples或查看源码
  179. // extended modules
  180. modules: {
  181. //omit,reference to source code of build-in modules
  182. }
  183. });
  184. /*解决手动点击与真正触发click事件会存在300ms的延迟*/
  185. // if ('addEventListener' in document) {
  186. // document.addEventListener('DOMContentLoaded', function () {
  187. // FastClick.attach(document.body);
  188. // }, false);
  189. // }
  190. //设置动态登录页
  191. router.beforeEach((to, from, next) => {
  192. if (to.meta.title) {
  193. document.title = to.meta.title
  194. }
  195. next()
  196. })
  197. /* eslint-disable no-new */
  198. new Vue({
  199. el: '#app',
  200. router,
  201. store,
  202. components: { App },
  203. template: '<App/>'
  204. })