diff --git a/README-zh.md b/README-zh.md index 8ba0011..1792779 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,8 +1,7 @@ -# 协同办公子系统前端 +# 智慧城管系统基础子系统前端 -> 城管产品化协同办公子系统WEB前端. +> 智慧城管系统基础子系统WEB前端. -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 @@ -32,7 +31,7 @@ ```bash # 克隆项目 -git clone http://192.168.0.203:8080/gitbucket/root/smartwell_front +git clone http://111.198.10.15:12003/gitbucket/git/wangxiaoying/dcms_front.git # 安装依赖 npm install @@ -50,9 +49,35 @@ npm run build --report ``` -## 界面 +## 配置文件属性解释 -![demo](http://192.168.0.203:8080/gitbucket/root/BaseFrontEnd/tree/master/static/images/demo.gif) +static/project.config.json + +```` +{ + "title": "智慧城管平台", + "baseUrl": "http://111.198.10.15:11409/", + "sameWindow": true, + "city":"崇仁县", + "mapUrl":"https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "labelUrl":"https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "center":[27.75962, 116.06021], + "zoom":15 +} +```` +- title: 系统名称 +- baseUrl: 后台地址 +- sameWindow: 是否要在同一个窗口打开子系统,true为是,false为否,选择false将在新窗口打开子系统 +- city: 城市,暂无用处 +- mapUrl: 地图地址 +- labelUrl: 地图标注地址 +- center: 默认地图中心坐标 [纬度,经度] +- zoom: 默认缩放级别,数字 + + + + + ## 浏览器支持情况 diff --git a/README-zh.md b/README-zh.md index 8ba0011..1792779 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,8 +1,7 @@ -# 协同办公子系统前端 +# 智慧城管系统基础子系统前端 -> 城管产品化协同办公子系统WEB前端. +> 智慧城管系统基础子系统WEB前端. -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 @@ -32,7 +31,7 @@ ```bash # 克隆项目 -git clone http://192.168.0.203:8080/gitbucket/root/smartwell_front +git clone http://111.198.10.15:12003/gitbucket/git/wangxiaoying/dcms_front.git # 安装依赖 npm install @@ -50,9 +49,35 @@ npm run build --report ``` -## 界面 +## 配置文件属性解释 -![demo](http://192.168.0.203:8080/gitbucket/root/BaseFrontEnd/tree/master/static/images/demo.gif) +static/project.config.json + +```` +{ + "title": "智慧城管平台", + "baseUrl": "http://111.198.10.15:11409/", + "sameWindow": true, + "city":"崇仁县", + "mapUrl":"https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "labelUrl":"https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "center":[27.75962, 116.06021], + "zoom":15 +} +```` +- title: 系统名称 +- baseUrl: 后台地址 +- sameWindow: 是否要在同一个窗口打开子系统,true为是,false为否,选择false将在新窗口打开子系统 +- city: 城市,暂无用处 +- mapUrl: 地图地址 +- labelUrl: 地图标注地址 +- center: 默认地图中心坐标 [纬度,经度] +- zoom: 默认缩放级别,数字 + + + + + ## 浏览器支持情况 diff --git a/src/main.js b/src/main.js index f1c1c55..043a276 100644 --- a/src/main.js +++ b/src/main.js @@ -56,10 +56,22 @@ import VCharts from 'v-charts' Vue.use(VCharts) -new Vue({ - el: '#app', - router, - store, - render: h => h(App) +// 先加载配置文件后,new Vue +/* eslint-disable no-new */ +import axios from 'axios' +import service from '@/utils/request' +axios.get('./static/project.config.json').then((result) => { + console.log('get config') + Vue.prototype.baseConfig = result.data + document.title = result.data.title // 首先设置网页的title + service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + new Vue({ + el: '#app', + router, + store, + render: h => h(App) + }) +}).catch((error) => { + console.log('get baseConfig error...' + error) }) diff --git a/README-zh.md b/README-zh.md index 8ba0011..1792779 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,8 +1,7 @@ -# 协同办公子系统前端 +# 智慧城管系统基础子系统前端 -> 城管产品化协同办公子系统WEB前端. +> 智慧城管系统基础子系统WEB前端. -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 @@ -32,7 +31,7 @@ ```bash # 克隆项目 -git clone http://192.168.0.203:8080/gitbucket/root/smartwell_front +git clone http://111.198.10.15:12003/gitbucket/git/wangxiaoying/dcms_front.git # 安装依赖 npm install @@ -50,9 +49,35 @@ npm run build --report ``` -## 界面 +## 配置文件属性解释 -![demo](http://192.168.0.203:8080/gitbucket/root/BaseFrontEnd/tree/master/static/images/demo.gif) +static/project.config.json + +```` +{ + "title": "智慧城管平台", + "baseUrl": "http://111.198.10.15:11409/", + "sameWindow": true, + "city":"崇仁县", + "mapUrl":"https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "labelUrl":"https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "center":[27.75962, 116.06021], + "zoom":15 +} +```` +- title: 系统名称 +- baseUrl: 后台地址 +- sameWindow: 是否要在同一个窗口打开子系统,true为是,false为否,选择false将在新窗口打开子系统 +- city: 城市,暂无用处 +- mapUrl: 地图地址 +- labelUrl: 地图标注地址 +- center: 默认地图中心坐标 [纬度,经度] +- zoom: 默认缩放级别,数字 + + + + + ## 浏览器支持情况 diff --git a/src/main.js b/src/main.js index f1c1c55..043a276 100644 --- a/src/main.js +++ b/src/main.js @@ -56,10 +56,22 @@ import VCharts from 'v-charts' Vue.use(VCharts) -new Vue({ - el: '#app', - router, - store, - render: h => h(App) +// 先加载配置文件后,new Vue +/* eslint-disable no-new */ +import axios from 'axios' +import service from '@/utils/request' +axios.get('./static/project.config.json').then((result) => { + console.log('get config') + Vue.prototype.baseConfig = result.data + document.title = result.data.title // 首先设置网页的title + service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + new Vue({ + el: '#app', + router, + store, + render: h => h(App) + }) +}).catch((error) => { + console.log('get baseConfig error...' + error) }) diff --git a/src/views/baseSource/baseSource.vue b/src/views/baseSource/baseSource.vue index cd941b9..bd19789 100644 --- a/src/views/baseSource/baseSource.vue +++ b/src/views/baseSource/baseSource.vue @@ -27,8 +27,9 @@ const map = L.map(this.$refs.map, { minZoom: 3, maxZoom: 18, - center: [27.75962, 116.06021], - zoom: 15, + // center: [27.75962, 116.06021], + center: this.baseConfig.center, + zoom: this.baseConfig.zoom, zoomControl: false, attributionControl: false, crs: L.CRS.EPSG3857 @@ -36,11 +37,13 @@ this.map = map // data上需要挂载 window.map = map this.baselayer.push(L.tileLayer( - 'https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + // 'https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + this.baseConfig.mapUrl, { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } ).addTo(map)) this.baselayer.push(L.tileLayer( - 'https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + // 'https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + this.baseConfig.labelUrl, { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } ).addTo(map)) } diff --git a/README-zh.md b/README-zh.md index 8ba0011..1792779 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,8 +1,7 @@ -# 协同办公子系统前端 +# 智慧城管系统基础子系统前端 -> 城管产品化协同办公子系统WEB前端. +> 智慧城管系统基础子系统WEB前端. -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 @@ -32,7 +31,7 @@ ```bash # 克隆项目 -git clone http://192.168.0.203:8080/gitbucket/root/smartwell_front +git clone http://111.198.10.15:12003/gitbucket/git/wangxiaoying/dcms_front.git # 安装依赖 npm install @@ -50,9 +49,35 @@ npm run build --report ``` -## 界面 +## 配置文件属性解释 -![demo](http://192.168.0.203:8080/gitbucket/root/BaseFrontEnd/tree/master/static/images/demo.gif) +static/project.config.json + +```` +{ + "title": "智慧城管平台", + "baseUrl": "http://111.198.10.15:11409/", + "sameWindow": true, + "city":"崇仁县", + "mapUrl":"https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "labelUrl":"https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "center":[27.75962, 116.06021], + "zoom":15 +} +```` +- title: 系统名称 +- baseUrl: 后台地址 +- sameWindow: 是否要在同一个窗口打开子系统,true为是,false为否,选择false将在新窗口打开子系统 +- city: 城市,暂无用处 +- mapUrl: 地图地址 +- labelUrl: 地图标注地址 +- center: 默认地图中心坐标 [纬度,经度] +- zoom: 默认缩放级别,数字 + + + + + ## 浏览器支持情况 diff --git a/src/main.js b/src/main.js index f1c1c55..043a276 100644 --- a/src/main.js +++ b/src/main.js @@ -56,10 +56,22 @@ import VCharts from 'v-charts' Vue.use(VCharts) -new Vue({ - el: '#app', - router, - store, - render: h => h(App) +// 先加载配置文件后,new Vue +/* eslint-disable no-new */ +import axios from 'axios' +import service from '@/utils/request' +axios.get('./static/project.config.json').then((result) => { + console.log('get config') + Vue.prototype.baseConfig = result.data + document.title = result.data.title // 首先设置网页的title + service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + new Vue({ + el: '#app', + router, + store, + render: h => h(App) + }) +}).catch((error) => { + console.log('get baseConfig error...' + error) }) diff --git a/src/views/baseSource/baseSource.vue b/src/views/baseSource/baseSource.vue index cd941b9..bd19789 100644 --- a/src/views/baseSource/baseSource.vue +++ b/src/views/baseSource/baseSource.vue @@ -27,8 +27,9 @@ const map = L.map(this.$refs.map, { minZoom: 3, maxZoom: 18, - center: [27.75962, 116.06021], - zoom: 15, + // center: [27.75962, 116.06021], + center: this.baseConfig.center, + zoom: this.baseConfig.zoom, zoomControl: false, attributionControl: false, crs: L.CRS.EPSG3857 @@ -36,11 +37,13 @@ this.map = map // data上需要挂载 window.map = map this.baselayer.push(L.tileLayer( - 'https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + // 'https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + this.baseConfig.mapUrl, { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } ).addTo(map)) this.baselayer.push(L.tileLayer( - 'https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + // 'https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + this.baseConfig.labelUrl, { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } ).addTo(map)) } diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index b8c23d1..ca32433 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -76,8 +76,11 @@ if (system.url.indexOf('http') > -1) { // 取token const params = '?token=' + this.$store.getters.token - debugger - window.open(system.url + params, '_blank') + if (this.baseConfig.sameWindow) { + window.location.href = system.url + params + } else { + window.open(system.url + params, '_blank') + } } else { this.$router.push(system.url) } diff --git a/README-zh.md b/README-zh.md index 8ba0011..1792779 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,8 +1,7 @@ -# 协同办公子系统前端 +# 智慧城管系统基础子系统前端 -> 城管产品化协同办公子系统WEB前端. +> 智慧城管系统基础子系统WEB前端. -> 可作为后续前后端分离的管理系统的基础前端框架使用。 ## 相关项目 @@ -32,7 +31,7 @@ ```bash # 克隆项目 -git clone http://192.168.0.203:8080/gitbucket/root/smartwell_front +git clone http://111.198.10.15:12003/gitbucket/git/wangxiaoying/dcms_front.git # 安装依赖 npm install @@ -50,9 +49,35 @@ npm run build --report ``` -## 界面 +## 配置文件属性解释 -![demo](http://192.168.0.203:8080/gitbucket/root/BaseFrontEnd/tree/master/static/images/demo.gif) +static/project.config.json + +```` +{ + "title": "智慧城管平台", + "baseUrl": "http://111.198.10.15:11409/", + "sameWindow": true, + "city":"崇仁县", + "mapUrl":"https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "labelUrl":"https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8", + "center":[27.75962, 116.06021], + "zoom":15 +} +```` +- title: 系统名称 +- baseUrl: 后台地址 +- sameWindow: 是否要在同一个窗口打开子系统,true为是,false为否,选择false将在新窗口打开子系统 +- city: 城市,暂无用处 +- mapUrl: 地图地址 +- labelUrl: 地图标注地址 +- center: 默认地图中心坐标 [纬度,经度] +- zoom: 默认缩放级别,数字 + + + + + ## 浏览器支持情况 diff --git a/src/main.js b/src/main.js index f1c1c55..043a276 100644 --- a/src/main.js +++ b/src/main.js @@ -56,10 +56,22 @@ import VCharts from 'v-charts' Vue.use(VCharts) -new Vue({ - el: '#app', - router, - store, - render: h => h(App) +// 先加载配置文件后,new Vue +/* eslint-disable no-new */ +import axios from 'axios' +import service from '@/utils/request' +axios.get('./static/project.config.json').then((result) => { + console.log('get config') + Vue.prototype.baseConfig = result.data + document.title = result.data.title // 首先设置网页的title + service.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 + new Vue({ + el: '#app', + router, + store, + render: h => h(App) + }) +}).catch((error) => { + console.log('get baseConfig error...' + error) }) diff --git a/src/views/baseSource/baseSource.vue b/src/views/baseSource/baseSource.vue index cd941b9..bd19789 100644 --- a/src/views/baseSource/baseSource.vue +++ b/src/views/baseSource/baseSource.vue @@ -27,8 +27,9 @@ const map = L.map(this.$refs.map, { minZoom: 3, maxZoom: 18, - center: [27.75962, 116.06021], - zoom: 15, + // center: [27.75962, 116.06021], + center: this.baseConfig.center, + zoom: this.baseConfig.zoom, zoomControl: false, attributionControl: false, crs: L.CRS.EPSG3857 @@ -36,11 +37,13 @@ this.map = map // data上需要挂载 window.map = map this.baselayer.push(L.tileLayer( - 'https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + // 'https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + this.baseConfig.mapUrl, { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } ).addTo(map)) this.baselayer.push(L.tileLayer( - 'https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + // 'https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + this.baseConfig.labelUrl, { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } ).addTo(map)) } diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index b8c23d1..ca32433 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -76,8 +76,11 @@ if (system.url.indexOf('http') > -1) { // 取token const params = '?token=' + this.$store.getters.token - debugger - window.open(system.url + params, '_blank') + if (this.baseConfig.sameWindow) { + window.location.href = system.url + params + } else { + window.open(system.url + params, '_blank') + } } else { this.$router.push(system.url) } diff --git a/src/views/layout/components/AppHeader.vue b/src/views/layout/components/AppHeader.vue index 9bd7427..94f5769 100644 --- a/src/views/layout/components/AppHeader.vue +++ b/src/views/layout/components/AppHeader.vue @@ -1,6 +1,6 @@