移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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