From f3a8b27eb23c940dcd67bd459b76b0457fcb8b46 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Thu, 13 Jun 2024 13:29:49 +0800 Subject: [PATCH] fix: 样式修改 --- src/main.js | 103 ++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 72 insertions(+), 31 deletions(-) diff --git a/src/main.js b/src/main.js index 2457020..2e04d03 100644 --- a/src/main.js +++ b/src/main.js @@ -20,31 +20,16 @@ import '@/permission' // permission control // clipboard������������������������������������������������JS������ import clipboard from 'clipboard' -// ���������vue��������� -Vue.prototype.$clipboard = clipboard // ������������ import AMap from 'vue-amap' -Vue.use(AMap) -AMap.initAMapApiLoader({ - key: 'be57d4add7dc10fb7f7924763a2179ae', - plugin: ['AMap.moveAnimation', 'AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', - 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', - 'AMap.DistrictSearch'], - // ������������ sdk ��������� 1.4.4 - v: '1.4.4' -}) - -Vue.prototype.$AMap = AMap // crypto������ import { Encrypt } from '@/utils/AES.js' import { getToken } from '@/utils/auth' import request from '@/utils/request' - -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 @@ -54,11 +39,41 @@ * please remove it before going online! ! ! */ import { mockXHR } from '../mock' + +import echarts from 'echarts' + +import JsonExcel from 'vue-json-excel' +// ���������vue��������� +Vue.prototype.$clipboard = clipboard +Vue.use(AMap) +AMap.initAMapApiLoader({ + key: 'c4e73f2c6972766d6a54dffd2f501cac', + plugin: [ + 'AMap.moveAnimation', + 'AMap.Autocomplete', + 'AMap.PlaceSearch', + 'AMap.Scale', + 'AMap.OverView', + 'AMap.ToolBar', + 'AMap.MapType', + 'AMap.PolyEditor', + 'AMap.CircleEditor', + 'AMap.DistrictSearch', + 'AMap.Geolocation' + ], + // ������������ sdk ��������� 1.4.4 + v: '1.4.4' +}) +window._AMapSecurityConfig = { + securityJsCode: '20fcbbc1782d2853f433831e61fab769' +} +Vue.prototype.$AMap = AMap + +Vue.prototype.$request = request.service +Vue.prototype.$axiosRequest = request.reqServe if (process.env.NODE_ENV === 'production') { mockXHR() } - -import echarts from 'echarts' Vue.prototype.$Cookies = Cookies @@ -71,22 +86,26 @@ Vue.config.productionTip = false Vue.prototype.$axios = axios Vue.prototype.$Bus = Bus +Vue.component('DownloadExcel', JsonExcel) function getServerConfig() { return new Promise((resolve, reject) => { - axios.get('/serverConfig.json').then((result) => { - // console.log(result) // ������������������������ - const config = result.data - for (const key in config) { - Vue.prototype[key] = config[key] - } - // ������������������������������������Vue��� - // console.log(Vue.prototype.BASE_ADDR) - resolve() - }).catch((error) => { - console.log(error) - reject() - }) + axios + .get('/serverConfig.json') + .then(result => { + // console.log(result) // ������������������������ + const config = result.data + for (const key in config) { + Vue.prototype[key] = config[key] + } + // ������������������������������������Vue��� + // console.log(Vue.prototype.BASE_ADDR) + resolve() + }) + .catch(error => { + console.log(error) + reject() + }) }) } @@ -100,5 +119,27 @@ render: h => h(App) }).$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() -- Gitblit v1.8.0