diff --git a/package.json b/package.json index 09eeab9..5f6a084 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "element-ui": "^2.15.7", "js-cookie": "^3.0.0", "jsencrypt": "^3.2.1", + "mars3d": "3.3.15", "mockjs": "^1.1.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -44,6 +45,7 @@ "babel-plugin-dynamic-import-node": "^2.3.3", "chalk": "^4.1.2", "chokidar": "^3.5.2", + "copy-webpack-plugin": "^6.4.1", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/package.json b/package.json index 09eeab9..5f6a084 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "element-ui": "^2.15.7", "js-cookie": "^3.0.0", "jsencrypt": "^3.2.1", + "mars3d": "3.3.15", "mockjs": "^1.1.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -44,6 +45,7 @@ "babel-plugin-dynamic-import-node": "^2.3.3", "chalk": "^4.1.2", "chokidar": "^3.5.2", + "copy-webpack-plugin": "^6.4.1", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/public/config/project.config.json b/public/config/project.config.json index e515b64..1b2796d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -1,5 +1,5 @@ { - "title": "智能窨井管理系统", + "title": "管网运行监测系统", "subtitle": "", "theme":"blue", "baseUrl": "https://38911d91v5.zicp.fun/", diff --git a/package.json b/package.json index 09eeab9..5f6a084 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "element-ui": "^2.15.7", "js-cookie": "^3.0.0", "jsencrypt": "^3.2.1", + "mars3d": "3.3.15", "mockjs": "^1.1.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -44,6 +45,7 @@ "babel-plugin-dynamic-import-node": "^2.3.3", "chalk": "^4.1.2", "chokidar": "^3.5.2", + "copy-webpack-plugin": "^6.4.1", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/public/config/project.config.json b/public/config/project.config.json index e515b64..1b2796d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -1,5 +1,5 @@ { - "title": "智能窨井管理系统", + "title": "管网运行监测系统", "subtitle": "", "theme":"blue", "baseUrl": "https://38911d91v5.zicp.fun/", diff --git a/src/icons/svg/icon-globe.svg b/src/icons/svg/icon-globe.svg new file mode 100644 index 0000000..e5f2fc1 --- /dev/null +++ b/src/icons/svg/icon-globe.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/package.json b/package.json index 09eeab9..5f6a084 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "element-ui": "^2.15.7", "js-cookie": "^3.0.0", "jsencrypt": "^3.2.1", + "mars3d": "3.3.15", "mockjs": "^1.1.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -44,6 +45,7 @@ "babel-plugin-dynamic-import-node": "^2.3.3", "chalk": "^4.1.2", "chokidar": "^3.5.2", + "copy-webpack-plugin": "^6.4.1", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/public/config/project.config.json b/public/config/project.config.json index e515b64..1b2796d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -1,5 +1,5 @@ { - "title": "智能窨井管理系统", + "title": "管网运行监测系统", "subtitle": "", "theme":"blue", "baseUrl": "https://38911d91v5.zicp.fun/", diff --git a/src/icons/svg/icon-globe.svg b/src/icons/svg/icon-globe.svg new file mode 100644 index 0000000..e5f2fc1 --- /dev/null +++ b/src/icons/svg/icon-globe.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 7496fad..36cc531 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -20,6 +20,24 @@ ] }, { + path: 'overview3D', + component: Layout, + redirect: '/overview3d', + meta: { + title: '管网运行总览', + icon: 'icon-globe', // 图标 + permission: ['/overview/3d']// 权限名称 + }, + children: [ + { + path: '/overview3d', + component: () => import('@/views/overview/overview3d'), + name: 'overview3d', + meta: { title: '管网运行总览', icon: 'icon-config', permission: ['/overview/3d'] } + } + ] + }, + { path: 'alarmManage', component: Layout, redirect: '/alarmNow', diff --git a/package.json b/package.json index 09eeab9..5f6a084 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "element-ui": "^2.15.7", "js-cookie": "^3.0.0", "jsencrypt": "^3.2.1", + "mars3d": "3.3.15", "mockjs": "^1.1.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -44,6 +45,7 @@ "babel-plugin-dynamic-import-node": "^2.3.3", "chalk": "^4.1.2", "chokidar": "^3.5.2", + "copy-webpack-plugin": "^6.4.1", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/public/config/project.config.json b/public/config/project.config.json index e515b64..1b2796d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -1,5 +1,5 @@ { - "title": "智能窨井管理系统", + "title": "管网运行监测系统", "subtitle": "", "theme":"blue", "baseUrl": "https://38911d91v5.zicp.fun/", diff --git a/src/icons/svg/icon-globe.svg b/src/icons/svg/icon-globe.svg new file mode 100644 index 0000000..e5f2fc1 --- /dev/null +++ b/src/icons/svg/icon-globe.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 7496fad..36cc531 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -20,6 +20,24 @@ ] }, { + path: 'overview3D', + component: Layout, + redirect: '/overview3d', + meta: { + title: '管网运行总览', + icon: 'icon-globe', // 图标 + permission: ['/overview/3d']// 权限名称 + }, + children: [ + { + path: '/overview3d', + component: () => import('@/views/overview/overview3d'), + name: 'overview3d', + meta: { title: '管网运行总览', icon: 'icon-config', permission: ['/overview/3d'] } + } + ] + }, + { path: 'alarmManage', component: Layout, redirect: '/alarmNow', diff --git a/src/utils/maputils.js b/src/utils/maputils.js new file mode 100644 index 0000000..741ac08 --- /dev/null +++ b/src/utils/maputils.js @@ -0,0 +1,5 @@ +export function getDayTime(nowTime) { + const nowTimeDate = new Date(nowTime) + nowTimeDate.setHours(0, 0, 0, 0) + return new Date(nowTimeDate) +} diff --git a/package.json b/package.json index 09eeab9..5f6a084 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "element-ui": "^2.15.7", "js-cookie": "^3.0.0", "jsencrypt": "^3.2.1", + "mars3d": "3.3.15", "mockjs": "^1.1.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -44,6 +45,7 @@ "babel-plugin-dynamic-import-node": "^2.3.3", "chalk": "^4.1.2", "chokidar": "^3.5.2", + "copy-webpack-plugin": "^6.4.1", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/public/config/project.config.json b/public/config/project.config.json index e515b64..1b2796d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -1,5 +1,5 @@ { - "title": "智能窨井管理系统", + "title": "管网运行监测系统", "subtitle": "", "theme":"blue", "baseUrl": "https://38911d91v5.zicp.fun/", diff --git a/src/icons/svg/icon-globe.svg b/src/icons/svg/icon-globe.svg new file mode 100644 index 0000000..e5f2fc1 --- /dev/null +++ b/src/icons/svg/icon-globe.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 7496fad..36cc531 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -20,6 +20,24 @@ ] }, { + path: 'overview3D', + component: Layout, + redirect: '/overview3d', + meta: { + title: '管网运行总览', + icon: 'icon-globe', // 图标 + permission: ['/overview/3d']// 权限名称 + }, + children: [ + { + path: '/overview3d', + component: () => import('@/views/overview/overview3d'), + name: 'overview3d', + meta: { title: '管网运行总览', icon: 'icon-config', permission: ['/overview/3d'] } + } + ] + }, + { path: 'alarmManage', component: Layout, redirect: '/alarmNow', diff --git a/src/utils/maputils.js b/src/utils/maputils.js new file mode 100644 index 0000000..741ac08 --- /dev/null +++ b/src/utils/maputils.js @@ -0,0 +1,5 @@ +export function getDayTime(nowTime) { + const nowTimeDate = new Date(nowTime) + nowTimeDate.setHours(0, 0, 0, 0) + return new Date(nowTimeDate) +} diff --git a/src/views/overview/overview3d.vue b/src/views/overview/overview3d.vue new file mode 100644 index 0000000..0a67a95 --- /dev/null +++ b/src/views/overview/overview3d.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/package.json b/package.json index 09eeab9..5f6a084 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "element-ui": "^2.15.7", "js-cookie": "^3.0.0", "jsencrypt": "^3.2.1", + "mars3d": "3.3.15", "mockjs": "^1.1.0", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", @@ -44,6 +45,7 @@ "babel-plugin-dynamic-import-node": "^2.3.3", "chalk": "^4.1.2", "chokidar": "^3.5.2", + "copy-webpack-plugin": "^6.4.1", "eslint": "^6.7.2", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/public/config/project.config.json b/public/config/project.config.json index e515b64..1b2796d 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -1,5 +1,5 @@ { - "title": "智能窨井管理系统", + "title": "管网运行监测系统", "subtitle": "", "theme":"blue", "baseUrl": "https://38911d91v5.zicp.fun/", diff --git a/src/icons/svg/icon-globe.svg b/src/icons/svg/icon-globe.svg new file mode 100644 index 0000000..e5f2fc1 --- /dev/null +++ b/src/icons/svg/icon-globe.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/router/modules/well.js b/src/router/modules/well.js index 7496fad..36cc531 100644 --- a/src/router/modules/well.js +++ b/src/router/modules/well.js @@ -20,6 +20,24 @@ ] }, { + path: 'overview3D', + component: Layout, + redirect: '/overview3d', + meta: { + title: '管网运行总览', + icon: 'icon-globe', // 图标 + permission: ['/overview/3d']// 权限名称 + }, + children: [ + { + path: '/overview3d', + component: () => import('@/views/overview/overview3d'), + name: 'overview3d', + meta: { title: '管网运行总览', icon: 'icon-config', permission: ['/overview/3d'] } + } + ] + }, + { path: 'alarmManage', component: Layout, redirect: '/alarmNow', diff --git a/src/utils/maputils.js b/src/utils/maputils.js new file mode 100644 index 0000000..741ac08 --- /dev/null +++ b/src/utils/maputils.js @@ -0,0 +1,5 @@ +export function getDayTime(nowTime) { + const nowTimeDate = new Date(nowTime) + nowTimeDate.setHours(0, 0, 0, 0) + return new Date(nowTimeDate) +} diff --git a/src/views/overview/overview3d.vue b/src/views/overview/overview3d.vue new file mode 100644 index 0000000..0a67a95 --- /dev/null +++ b/src/views/overview/overview3d.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/vue.config.js b/vue.config.js index 3f98e33..a2ba57f 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,4 +1,6 @@ 'use strict' +const webpack = require('webpack') +const CopyWebpackPlugin = require('copy-webpack-plugin') const path = require('path') const defaultSettings = require('./public/config/project.config') @@ -6,7 +8,7 @@ return path.join(__dirname, dir) } -const name = defaultSettings.title || '智能窨井管理系统' // page title +const name = defaultSettings.title || '管网运行监测系统' // page title // If your port is set to 80, // use administrator privileges to execute the command line. @@ -27,12 +29,12 @@ publicPath: './', outputDir: 'dist', assetsDir: 'static', - lintOnSave: process.env.NODE_ENV === 'development', // set to 'default' or 'error' may cause the compilation to failed - productionSourceMap: false, // speed up production builds + lintOnSave: process.env.NODE_ENV === 'development', // 是否开启eslint + productionSourceMap: false, // 不需要生产环境的sourcemap devServer: { // development server config // host: 'localhost', - port: port, - open: true, + port: port, // 端口号 + open: true, // 配置自动启动浏览器 overlay: { warnings: false, errors: true @@ -40,17 +42,37 @@ before: require('./mock/mock-server.js') }, // webpack config, if value is an object, it well be merge to final config using webpack-merge - configureWebpack: { - // provide the app's title in webpack's name field, so that - // it can be accessed in index.html to inject the correct title. - name: name, - resolve: { - alias: { - '@': resolve('src') - } - }, - externals: { - 'AMap': 'AMap' + configureWebpack: (config) => { + const cesiumSourcePath = 'node_modules/mars3d-cesium/Build/Cesium/' // cesium库安装目录 + const cesiumRunPath = './mars3d-cesium/' // cesium运行时路径 + + const plugins = [ + // 标识cesium资源所在的主目录,cesium内部资源加载、多线程等处理时需要用到 + new webpack.DefinePlugin({ + CESIUM_BASE_URL: JSON.stringify(path.join(config.output.publicPath, cesiumRunPath)) + }), + // Cesium相关资源目录需要拷贝到系统目录下面(部分CopyWebpackPlugin版本的语法可能没有patterns) + new CopyWebpackPlugin({ + patterns: [ + { from: path.join(cesiumSourcePath, 'Workers'), to: path.join(config.output.path, cesiumRunPath, 'Workers') }, + { from: path.join(cesiumSourcePath, 'Assets'), to: path.join(config.output.path, cesiumRunPath, 'Assets') }, + { from: path.join(cesiumSourcePath, 'ThirdParty'), to: path.join(config.output.path, cesiumRunPath, 'ThirdParty') }, + { from: path.join(cesiumSourcePath, 'Widgets'), to: path.join(config.output.path, cesiumRunPath, 'Widgets') } + ] + }) + ] + return { + name: name, + resolve: { + alias: { + '@': resolve('src') + } + }, + externals: { + 'AMap': 'AMap' + }, + module: { unknownContextCritical: false }, // 配置加载的模块类型,cesium时必须配置 + plugins: plugins } }, // A function that well receive an instance of ChanableConfig powered by webpack-chain. Allows