Explorar o código

环境动态配置+文字调整

wangtao hai 1 ano
pai
achega
25f69a608e

+ 14 - 11
.env.development

@@ -1,11 +1,14 @@
-# 页面标题
-VUE_APP_TITLE = 中国东信智慧楼宇
-
-# 开发环境配置
-ENV = 'development'
-
-# 东信智慧运营中心/开发环境
-VUE_APP_BASE_API = ''
-
-# 路由懒加载
-VUE_CLI_BABEL_TRANSPILE_MODULES = true
+# 页面标题
+VUE_APP_TITLE = 中国东信智慧楼宇
+
+# 开发环境配置
+ENV = 'development'
+
+# 东信智慧运营中心/开发环境
+VUE_APP_BASE_API = 'https://smartpark.caih.com/'
+
+#中国东信智慧楼宇
+VUE_APP_OUTLINK_API = 'http://10.21.39.1:8185/#/'
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 8 - 8
.env.production

@@ -1,8 +1,8 @@
-# 页面标题
-VUE_APP_TITLE = 中国东信智慧楼宇
-
-# 生产环境配置
-ENV = 'production'
-
-# 管理系统/生产环境
-VUE_APP_BASE_API = ''
+# 页面标题
+VUE_APP_TITLE = 中国东信智慧楼宇
+
+# 生产环境配置
+ENV = 'production'
+
+# 管理系统/生产环境
+VUE_APP_BASE_API = 'https://smartpark.caih.com/'

+ 10 - 10
.env.staging

@@ -1,10 +1,10 @@
-# 页面标题
-VUE_APP_TITLE = 东信智慧运营中心
-
-NODE_ENV = production
-
-# 测试环境配置
-ENV = 'staging'
-
-# 管理系统/测试环境
-VUE_APP_BASE_API = '/stage-api'
+# 页面标题
+VUE_APP_TITLE = 东信智慧运营中心
+
+NODE_ENV = production
+
+# 测试环境配置
+ENV = 'staging'
+
+# 管理系统/测试环境
+VUE_APP_BASE_API = 'https://smartpark.caih.com/'

+ 0 - 7
src/assets/images4/js/common.js

@@ -1,7 +0,0 @@
-function BASEPATH() {
-    return "https://smartpark.caih.com/dmapi/archive/";
-}
-
-export {
-    BASEPATH
-}

+ 0 - 7
src/assets/js/common.js

@@ -1,7 +0,0 @@
-function BASEPATH() {
-    return "https://smartpark.caih.com/dmapi/archive/";
-}
-
-export {
-    BASEPATH
-}

+ 1 - 1
src/components4/middleWrap/saveEnergy/index.vue

@@ -3,7 +3,7 @@
         <div class="topText">
             <span class="biao"></span>
             <span class="topT">节能策略</span>
-            <div class="bottomT">结合好能监控及楼内环境传感器数据,制定指定话节能策略,实现节能降耗。</div>
+            <div class="bottomT">综合耗能监控及楼内环境传感器数据,制定指定话节能策略,实现节能降耗。</div>
         </div>
         <div class="botm">
             <div class="botmLeft">

+ 2 - 1
src/components4/seHeader/index.vue

@@ -13,7 +13,7 @@
     element-loading-background="rgba(28,33,41,1)"
   >
     <el-col :span="6">
-      <el-col :span="24" class="time"><a href="http://10.21.39.1:8185/#/">{{ date }}</a></el-col>
+      <el-col :span="24" class="time"><a :href="outLink">{{ date }}</a></el-col>
     </el-col>
     <el-col :span="12">
       <el-col :span="24" class="title" style="font-weight: 700;">中国东信智慧楼宇运营概况</el-col>
@@ -33,6 +33,7 @@ export default {
       loading: true,
       date: new Date(),
       logo: logo,
+      outLink:process.env.VUE_APP_OUTLINK_API
     };
   },
   mounted() {

+ 1 - 3
src/main.js

@@ -36,8 +36,7 @@ import VueMeta from 'vue-meta'
 // echarts
 import echarts from 'echarts'
 import {set } from 'nprogress'
-//公共变量
-// import { BASEPATH } from "@/assets/js/common.js";
+
 //创建自定义指令
 Vue.directive('down', {
         inserted: (el, binding) => {
@@ -71,7 +70,6 @@ Vue.prototype.download = download
 Vue.prototype.downloadBlob = downloadBlob
 Vue.prototype.handleTree = handleTree
 Vue.prototype.$echarts = echarts
-    // Vue.prototype.BASEPATH = BASEPATH
 
 Vue.prototype.msgSuccess = function(msg, time) {
     this.$message({ showClose: true, message: msg, type: "success", duration: time || 3000 });

+ 4 - 152
src/views/index.vue

@@ -79,7 +79,7 @@ export default {
 
     axios({
       method: "get",
-      url: "https://smartpark.caih.com/dxapi/system/config/configKey/largeV3-ZUOP.json.config",
+      url: process.env.VUE_APP_BASE_API+"/dxapi/system/config/configKey/largeV3-ZUOP.json.config",
       timeout: 10000,
     }).then((res) => {
       this.data = JSON.parse(res.data.data)
@@ -87,7 +87,7 @@ export default {
     setInterval(()=>{
       axios({
           method: 'get',
-          url: 'https://smartpark.caih.com/dxapi/system/config/configKey/largeV3-ZUOP.json.config',
+          url: process.env.VUE_APP_BASE_API+'/dxapi/system/config/configKey/largeV3-ZUOP.json.config',
           timeout: 10000,
       }).then(res =>{
         this.data = JSON.parse(res.data.data)
@@ -96,158 +96,10 @@ export default {
   },
   mounted() {
     let that = this;
-    // window.addEventListener(
-    //   "message",
-    //   function (event) {
-    //     let isDOM = typeof event.data === "object";
-    //     let data = event.data;
-    //     // console.log(data)
-    //     if (data.param) {
-    //       let name = data.param.name;
-    //       let id = data.param.id;
-    //       if (name == "会议室") {
-    //         that.springFrameState = true;
-    //         that.springFrameItem = {};
-    //         that.springFrameItem.hy = 1;
-    //       } else if (name == "打印机") {
-    //         that.springFrameState = true;
-    //         that.springFrameItem = {};
-    //         that.springFrameItem.dyj = 1;
-    //       } else {
-    //         axios({
-    //           method: "post",
-    //           url:
-    //             "http://10.21.39.1:8082/dhController/getLocalChannel?pageNo=1&pageSize=1&uniType=1&id=" +
-    //             id,
-    //           timeout: 3000,
-    //         })
-    //           .then((res) => {
-    //             if (res.data.data.pageList.length > 0) {
-    //               let resData = res.data.data.pageList[0];
-    //               that.springFrameState = true;
-    //               that.springFrameItem = {};
-    //               that.springFrameItem.video = resData;
-    //               that.springFrameItem.video.url =
-    //                 "http://" +
-    //                 resData.nvr_ip +
-    //                 ":" +
-    //                 resData.hls_port +
-    //                 "/live/cameraid/" +
-    //                 resData.deviceId +
-    //                 "%24" +
-    //                 resData.id.split("$")[resData.id.split("$").length - 1] +
-    //                 "/substream/1.m3u8";
-    //             }
-    //           })
-    //           .catch((err) => {});
-    //       }
-    //     }
-    //   },
-    //   false
-    // );
+
   },
   methods: {
-    // videoClick(row) {
-    //   //视频
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.video = row;
-    // },
-    // xgClick(row) {
-    //   //巡更
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.xg = row;
-    // },
-    // hyClick() {
-    //   //会议
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.hy = 1;
-    // },
-    // dyjClick() {
-    //   //打印机
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.dyj = 1;
-    // },
-    // canyinClick(id) {
-    //   //餐饮
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.canyin = id;
-    // },
-    // gjxxClick(row) {
-    //   //告警信息
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.gjxx = row;
-    // },
-    // rqgjClick(row) {
-    //   //入侵告警
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.rqgj = row;
-    // },
-    // xfgjClick(row) {
-    //   //消防告警
-    //   this.springFrameState = true;
-    //   this.springFrameItem = {};
-    //   this.springFrameItem.xfgj = row;
-    // },
-    // SpringFrameClose() {
-    //   this.springFrameState = false;
-    //   this.springFrameItem = {};
-    // },
-    // postMsg(value) {
-    //   var myframe = document.getElementById("iframe"); //获取iframe
-    //   myframe.contentWindow.postMessage({ name: value }, "*"); //childDomain是子页面的源(协议+主机+端口号)
-    // },
-    // postMsg2(value) {
-    //   //视频
-    //   if (value.unitType == "1") {
-    //     let that = this;
-    //     axios({
-    //       method: "post",
-    //       url:
-    //         "http://10.21.39.1:8082/dhController/getLocalChannel?pageNo=1&pageSize=1&uniType=1&id=" +
-    //         value.id,
-    //       timeout: 3000,
-    //     })
-    //       .then((res) => {
-    //         if (res.data.data.pageList.length > 0) {
-    //           let resData = res.data.data.pageList[0];
-    //           that.springFrameState = true;
-    //           that.springFrameItem = {};
-    //           that.springFrameItem.video = resData;
-    //           that.springFrameItem.video.url =
-    //             "http://" +
-    //             resData.nvr_ip +
-    //             ":" +
-    //             resData.hls_port +
-    //             "/live/cameraid/" +
-    //             resData.deviceId +
-    //             "%24" +
-    //             resData.id.split("$")[resData.id.split("$").length - 1] +
-    //             "/substream/1.m3u8";
-    //         }
-    //       })
-    //       .catch((err) => {});
-    //   } else if (value.unitType == "2") {
-    //     var myframe = document.getElementById("iframe"); //获取iframe
-    //     myframe.contentWindow.postMessage({ name: "打印机" }, "*"); //childDomain是子页面的源(协议+主机+端口号)
-    //   }
-    //   // var myframe = document.getElementById("iframe"); //获取iframe
-    //   // myframe.contentWindow.postMessage({  name: '摄像头',id:value.id }, "*"); //childDomain是子页面的源(协议+主机+端口号)
-    // },
-    // postMsg3() {
-    //   //视频测试
-    //   var myframe = document.getElementById("iframe"); //获取iframe
-    //   myframe.contentWindow.postMessage(
-    //     { name: "摄像头", id: "1000002$1$0$7" },
-    //     "*"
-    //   ); //childDomain是子页面的源(协议+主机+端口号)
-    // },
+
   },
 };
 </script>

+ 11 - 11
vue.config.js

@@ -30,17 +30,17 @@ module.exports = {
         host: '0.0.0.0',
         port: port,
         open: true,
-        proxy: {
-            // detail: https://cli.vuejs.org/config/#devserver-proxy
-            [process.env.VUE_APP_BASE_API]: {
-                //target: `http://172.16.120.104:8084/`, //本地
-                target: 'https://smartpark.caih.com/', //东信
-                changeOrigin: true,
-                pathRewrite: {
-                    ['^' + process.env.VUE_APP_BASE_API]: ''
-                }
-            }
-        },
+        // proxy: {
+        //     // detail: https://cli.vuejs.org/config/#devserver-proxy
+        //     [process.env.VUE_APP_BASE_API]: {
+        //         //target: ``, //
+        //         target: '', //
+        //         changeOrigin: true,
+        //         pathRewrite: {
+        //             ['^' + process.env.VUE_APP_BASE_API]: ''
+        //         }
+        //     }
+        // },
         disableHostCheck: true
     },
     configureWebpack: {

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 105 - 105
相关文档/20221020智慧楼宇-开发文件/20221019智慧楼宇/index.html


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio