移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

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