| | |
| | | module.exports = { |
| | | root: true, |
| | | env: { |
| | | node: true |
| | | node: true, |
| | | amd: true |
| | | }, |
| | | extends: [ |
| | | 'plugin:vue/essential', |
| | |
| | | "element-ui": "^2.14.1", |
| | | "jquery": "^3.5.1", |
| | | "js-cookie": "^2.2.0", |
| | | "leaflet": "^1.6.0", |
| | | "leaflet": "^1.7.1", |
| | | "leaflet-canvas-markers": "^1.0.6", |
| | | "leaflet.markercluster": "^1.4.1", |
| | | "lodash": "^4.17.10", |
| | |
| | | "@vue/eslint-config-standard": "^5.1.2", |
| | | "babel-eslint": "^10.1.0", |
| | | "babel-loader": "^8.2.2", |
| | | "babel-polyfill": "^6.26.0", |
| | | "cache-loader": "^4.1.0", |
| | | "css-loader": "^5.0.1", |
| | | "eslint": "^6.7.2", |
| | | "eslint-plugin-vue": "^6.2.2", |
| | | "eslint-plugin-import": "^2.20.2", |
| | | "eslint-plugin-node": "^11.1.0", |
| | | "eslint-plugin-promise": "^4.2.1", |
| | | "eslint-plugin-standard": "^4.0.0", |
| | | "mockjs": "^1.1.0", |
| | | "eslint-plugin-vue": "^6.2.2", |
| | | "less": "^3.13.0", |
| | | "less-loader": "^7.1.0", |
| | | "mockjs": "^1.1.0", |
| | | "vue-loader": "^15.9.5", |
| | | "vue-template-compiler": "^2.6.11" |
| | | }, |
| | |
| | | import * as mapUrl from './mapUrl' |
| | | |
| | | export default { |
| | | mapApi, |
| | | mapUrl |
| | | mapApi, |
| | | mapUrl |
| | | } |
| | |
| | | /** |
| | | * 该文件配置接口的URL地址 |
| | | */ |
| | | class ApiURLs{ |
| | | constructor(){ |
| | | this.APIURL_HELLOWORLD = 'http://www.baidu.com' |
| | | } |
| | | * 该文件配置接口的URL地址 |
| | | */ |
| | | class ApiURLs { |
| | | constructor () { |
| | | this.APIURL_HELLOWORLD = 'http://www.baidu.com' |
| | | } |
| | | } |
| | | |
| | | export default new ApiURLs() |
| | |
| | | * @param url |
| | | * @param item |
| | | */ |
| | | loadGeojsonLayer (url, item) { |
| | | async loadGeojsonLayer (url, item) { |
| | | var matches = this.regex.exec(url) |
| | | var matchValue = item[matches[1]] |
| | | var code = item.code |
| | | var newUrl = url.replace(this.regex, matchValue) |
| | | var that = this |
| | | if (!that.layerArray[code]) { |
| | | AjaxUtils.GetDataAsynByUrl(newUrl, {}, function (res) { |
| | | store.commit('addSewersDatas', res) |
| | | var layer = that.loadGeojson(res, item) |
| | | that.layerArray[code] = layer |
| | | }) |
| | | const res = await AjaxUtils.GetDataAsynByUrl(newUrl, {}) |
| | | if (res.data instanceof Object && Object.prototype.hasOwnProperty.call(res.data, 'features')) { |
| | | store.commit('addSewersDatas', res.data) |
| | | if (newUrl.indexOf('管网') !== -1 || newUrl.indexOf('四通') !== -1) { |
| | | var layer = that.loadGeojson(res.data, item) |
| | | that.layerArray[code] = layer |
| | | } |
| | | } |
| | | } else { |
| | | that.layerArray[code].addTo(that.map) |
| | | } |
| | |
| | | loadGeojson (res, opt) { |
| | | var that = this |
| | | var icon = opt.icon |
| | | const layergroup = that.L.featureGroup().addTo(that.map) |
| | | const geojson = that.L.geoJSON(res.features, { |
| | | style: function (feature) { |
| | | return { |
| | |
| | | } |
| | | }) |
| | | } |
| | | }).addTo(that.map) |
| | | // }).addTo(that.map) |
| | | }).addTo(layergroup) |
| | | store.commit('addSewersDatas', geojson) |
| | | if (Object.prototype.hasOwnProperty.call(res, 'features') && res.features.length > 0 && (res.features[0].geometry.type === 'LineString' || res.features[0].geometry.type === 'MultiLineString')) { |
| | | geojson.bringToBack() |
| | |
| | | // import 'babel-polyfill' |
| | | import 'babel-polyfill' |
| | | import Vue from 'vue' |
| | | import App from './App.vue' |
| | | import router from './router' |
| | |
| | | import 'leaflet/dist/leaflet.css' |
| | | import L from 'leaflet' |
| | | import 'leaflet.markercluster' |
| | | import 'leaflet-canvas-markers' |
| | | // import 'leaflet-canvas-markers' |
| | | import './components/plugin/Leaflet.GridLayer.FadeOut' |
| | | import './components/plugin/leaflet-canvas-markers' |
| | | Vue.config.productionTip = false |
| | | |
| | | Vue.use(ElementUI) |
| | |
| | | meta: { |
| | | title: '基础数据维护' |
| | | } |
| | | }, { |
| | | path: '/mapTemplate', |
| | | name: 'mapTemplate', |
| | | component: MapTemplate, |
| | | meta: { |
| | | title: '基础地图' |
| | | } |
| | | }] |
| | | }] |
| | | export const routes = [...mainRoutes, ...mapRoutes] |
| | |
| | | import $ from 'jquery' |
| | | |
| | | import axios from 'axios' |
| | | /** |
| | | * 对jquery的封装ajax的传数据方法 |
| | | * @param pUrl 请求的url |
| | |
| | | * @param pData 参数 |
| | | * @param pBackFun 成功回调 |
| | | */ |
| | | function get4JsonDataByUrl (pUrl, pData, pBackFun) { |
| | | $.ajax({ |
| | | type: 'get', |
| | | function get4JsonDataByUrl (oUrl, pData, pBackFun) { |
| | | const pUrl = encodeURI(oUrl) |
| | | axios({ |
| | | method: 'get', |
| | | url: pUrl, |
| | | dataType: 'json', |
| | | data: pData, |
| | | async: true, |
| | | success: function (datas, nnn) { |
| | | pBackFun(datas) |
| | | }, |
| | | error: function (err, nnnn) { |
| | | console.error('数据获取失败', err, pUrl) |
| | | } |
| | | data: pData |
| | | }).then(function (response) { |
| | | pBackFun(response) |
| | | }) |
| | | .catch(function (error) { |
| | | console.error('数据获取失败', error) |
| | | }) |
| | | } |
| | | |
| | | function GetDataAsynByUrl (pUrl, pData, pBackFun) { |
| | | $.ajax({ |
| | | type: 'GET', |
| | | const GetDataAsynByUrl = async (oUrl, pData) => { |
| | | const pUrl = encodeURI(oUrl) |
| | | const res = await axios({ |
| | | method: 'get', |
| | | url: pUrl, |
| | | data: pData, |
| | | timeout: 600000, |
| | | async: true, |
| | | success: function (datas, nnn) { |
| | | pBackFun(datas) |
| | | }, |
| | | error: function (e, nnnn) { |
| | | console.error('数据获取失败', pUrl) |
| | | } |
| | | data: pData |
| | | }).then((response) => { |
| | | return (response) |
| | | }) |
| | | .catch((error) => { |
| | | console.error('数据获取失败', error) |
| | | }) |
| | | return res |
| | | |
| | | // $.ajax({ |
| | | // type: 'GET', |
| | | // url: pUrl, |
| | | // data: pData, |
| | | // timeout: 600000, |
| | | // async: true, |
| | | // success: function (datas, nnn) { |
| | | // pBackFun(datas) |
| | | // }, |
| | | // error: function (e, nnnn) { |
| | | // console.error('数据获取失败', pUrl) |
| | | // } |
| | | // }) |
| | | } |
| | | function postDataAsynByUrl (pUrl, pData, pBackFun) { |
| | | $.ajax({ |