移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

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