| | |
| | | |
| | | Vue.prototype.$request = request.service |
| | | Vue.prototype.$axiosRequest = request.reqServe |
| | | // Vue.prototype.$postRequest=request.reqServe1 |
| | | /** |
| | | * If you don't want to use mock-server |
| | | * you want to use MockJs for mock api |
| | |
| | | Vue.config.productionTip = false |
| | | Vue.prototype.$axios = axios |
| | | Vue.prototype.$Bus = Bus |
| | | |
| | | import JsonExcel from 'vue-json-excel' |
| | | Vue.component('downloadExcel', JsonExcel) |
| | | |
| | | function getServerConfig() { |
| | | return new Promise((resolve, reject) => { |
| | |
| | | }).$mount('#app') |
| | | } |
| | | |
| | | Vue.prototype.dateTypeFormat = function (fmt, date) { |
| | | let ret |
| | | const opt = { |
| | | 'Y+': date.getFullYear().toString(), // 年 |
| | | 'm+': (date.getMonth() + 1).toString(), // 月 |
| | | 'd+': date.getDate().toString(), // 日 |
| | | 'H+': date.getHours().toString(), // 时 |
| | | 'M+': date.getMinutes().toString(), // 分 |
| | | 'S+': date.getSeconds().toString() // 秒 |
| | | // 有其他格式化字符需求可以继续添加,必须转化成字符串 |
| | | } |
| | | for (const k in opt) { |
| | | ret = new RegExp('(' + k + ')').exec(fmt) |
| | | if (ret) { |
| | | fmt = fmt.replace(ret[1], (ret[1].length === 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0'))) |
| | | } |
| | | } |
| | | return fmt |
| | | } |
| | | |
| | | |
| | | init() |