移动端
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

main.js 5.6 KiB

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