Browse Source

外部链接地址配置

Karsa 1 year ago
parent
commit
1a34f0edd5

+ 3 - 3
config/dev.env.js

@@ -6,9 +6,9 @@ module.exports = merge(prodEnv, {
   VUE_APP_API_ROOT:'"/adminapi"',  //
   Domain:'"brilliantstart.cn"',
   // Login:'"http://localhost:3030/login"',
-  CHART_LINK:'"https://charttest.hzinsights.com/chartshow"',
-  SHEET_LINK:'"https://charttest.hzinsights.com/sheetshow"',
-	REPORT_SHARE_LINK:'"http://rddpweb.brilliantstart.cn"',
+  // CHART_LINK:'"https://charttest.hzinsights.com/chartshow"',
+  // SHEET_LINK:'"https://charttest.hzinsights.com/sheetshow"',
+	// REPORT_SHARE_LINK:'"http://rddpweb.brilliantstart.cn"',
   VUE_APP_HR_MANAGEMENT_SYSTEM:'"http://8.136.199.33:8391/login"',
   VUE_APP_FINANCIAL_MANAGEMENT_SYSTEM:'"http://8.136.199.33:8618/login"',
   VUE_APP_CRM_SYSTEM:'"http://8.136.199.33:7777/temppage"',

+ 3 - 3
config/prod.env.js

@@ -3,9 +3,9 @@ module.exports = {
 	VUE_APP_API_ROOT:'"/adminapi"',  //生产环境
 	Domain:'"hzinsights.com"',
 	// Login:'"https://eta.hzinsights.com/login"',
-	CHART_LINK:'"https://chartlib.hzinsights.com/chartshow"',
-	SHEET_LINK:'"https://chartlib.hzinsights.com/sheetshow"',
-	REPORT_SHARE_LINK:'"https://ficc.hzinsights.com"',
+	// CHART_LINK:'"https://chartlib.hzinsights.com/chartshow"',
+	// SHEET_LINK:'"https://chartlib.hzinsights.com/sheetshow"',
+	// REPORT_SHARE_LINK:'"https://ficc.hzinsights.com"',
 	VUE_APP_HR_MANAGEMENT_SYSTEM:'"https://hr.hzinsights.com/login"',
 	VUE_APP_FINANCIAL_MANAGEMENT_SYSTEM:'"https://fms.hzinsights.com/login"',
 	VUE_APP_CRM_SYSTEM:'"https://admin.hzinsights.com/temppage"',

+ 3 - 3
config/prod.test.env.js

@@ -3,9 +3,9 @@ module.exports = {
 	VUE_APP_API_ROOT:'"/adminapi"',  //测试环境
 	Domain:'"brilliantstart.cn"',
 	// Login:'"http://8.136.199.33:7778/login"',
-	CHART_LINK:'"https://charttest.hzinsights.com/chartshow"',
-	SHEET_LINK:'"https://charttest.hzinsights.com/sheetshow"',
-	REPORT_SHARE_LINK:'"http://rddpweb.brilliantstart.cn"',
+	// CHART_LINK:'"https://charttest.hzinsights.com/chartshow"',
+	// SHEET_LINK:'"https://charttest.hzinsights.com/sheetshow"',
+	// REPORT_SHARE_LINK:'"http://rddpweb.brilliantstart.cn"',
 	VUE_APP_HR_MANAGEMENT_SYSTEM:'"http://8.136.199.33:8391/login"',
   VUE_APP_FINANCIAL_MANAGEMENT_SYSTEM:'"http://8.136.199.33:8618/login"',
 	VUE_APP_CRM_SYSTEM:'"http://8.136.199.33:7777/temppage"',

+ 10 - 1
src/api/modules/oldApi.js

@@ -296,6 +296,14 @@ const getBusinessCode=params=>{
 	return http.get('/business_conf/code_encrypt',params)
 }
 
+/**
+ * 获取动态配配置 系统内部动态链接
+ * @param {*} params 
+ */
+const getPublicSettingsApi = params => {
+	return http.get('/system/config')
+}
+
 export {
 	userLogin,
 	modifyPwd,
@@ -366,5 +374,6 @@ export {
 	reportMessageSend,
 	weekReportValidAudio,
 	getUserUuid,
-	getBusinessCode
+	getBusinessCode,
+	getPublicSettingsApi
 }

+ 9 - 3
src/mixins/theme.js

@@ -1,3 +1,10 @@
+/* 
+一些动态配置和一些全局自定义东西 
+*/
+import  store  from '@/vuex'
+console.log(store)
+const { dynamicOutLinks } = store;
+
 
 export default {
 	name: '后台管理系统',
@@ -25,7 +32,6 @@ export default {
     },
   ],
   login_bg: require('@/assets/img/login_bg.png'),//登录页的大图
-  login_logo: require('@/assets/img/login_logo.png')
-  // g_logo: require('@/assets/img/home/logo.png'), //主页菜单栏logo
-  // g_mini_logo: require('@/assets/img/home/logo_mini.png'), //主页菜单栏mini-logo
+  login_logo: require('@/assets/img/login_logo.png'),
+  dynamicOutLinks//动态的外部链接
 }

+ 10 - 145
src/views/Home.vue

@@ -304,6 +304,7 @@ import {
   roadshowInterence,
   getBusinessCode,
 } from "api/api.js";
+import { getPublicSettingsApi } from '@/api/modules/oldApi';
 import PwdDlg from "@/components/pwdDlg.vue";
 import questionMsgDia from "@/components/questionMsgDia.vue";
 import EventBus from "@/api/bus.js";
@@ -463,6 +464,7 @@ export default {
     } else {
       this.getMenuList();
     }
+    this.getPublicSettings();
   },
   methods: {
     //判断是否为初始密码
@@ -710,152 +712,7 @@ export default {
         }
       });
     },
-    /* 待办事项列表 */
-    getNotice() {
-      customInterence.noticeList().then((res) => {
-        if (res.Ret === 200) {
-          res.Data.Company.List &&
-            res.Data.Company.List.forEach((item) => {
-              item.CreateTime = item.CreateTime.replace(/-/g, ".");
-            });
-          res.Data.Contract.List &&
-            res.Data.Contract.List.forEach((item) => {
-              item.CreateTime = item.CreateTime.replace(/-/g, ".");
-            });
-          res.Data.Seal.List &&
-            res.Data.Seal.List.forEach((item) => {
-              item.CreateTime = item.CreateTime.replace(/-/g, ".");
-            });
-          res.Data.EdbReplace.List &&
-            res.Data.EdbReplace.List.forEach(
-              (item) => (item.CreateTime = item.CreateTime.replace(/-/g, "."))
-            );
-          res.Data.BusinessTrip.List &&
-            res.Data.BusinessTrip.List.forEach(
-              (item) => (item.CreateTime = item.CreateTime.replace(/-/g, "."))
-            );
-
-          this.noticeList = res.Data;
-          this.noticeCount =
-            this.Role === "admin"
-              ? res.Data.EdbReplace.Total + res.Data.BusinessTrip.Total
-              : res.Data.Company.Total +
-                res.Data.Contract.Total +
-                res.Data.Seal.Total +
-                res.Data.EdbReplace.Total +
-                res.Data.BusinessTrip.Total;
-
-          this.noticeType = this.Role === "admin" ? "更新" : "客户";
-          // 默认显示客户
-          this.currentNoticeList =
-            this.Role === "admin"
-              ? res.Data.EdbReplace.List
-              : res.Data.Company.List;
-
-          // 检查是否有未读的
-          if (this.Role != "admin") {
-            this.flag1 = res.Data.Company.List.some((item) => {
-              return item.MessageStatus === 0;
-            });
-            this.flag2 = res.Data.Contract.List.some((item) => {
-              return item.MessageStatus === 0;
-            });
-            this.flag3 = res.Data.Seal.List.some((item) => {
-              return item.MessageStatus === 0;
-            });
-          }
 
-          this.flag5 = res.Data.ETATrial.List.some((item) => {
-            return item.MessageStatus === 0;
-          });
-          this.flag6 = res.Data.BusinessTrip.List.some((item) => {
-            return item.MessageStatus === 0;
-          });
-
-        }
-      });
-    },
-    /* 点击消息列表 跳转审批列表 */
-    noticeClick(item) {
-      customInterence
-        .readNotice({
-          Id: Number(item.Id),
-        })
-        .then((res) => {
-          if (res.Ret === 200) {
-            item.MessageStatus = 1;
-            if (this.noticeType === "客户") {
-              if (this.$route.path != "/approvalList") {
-                this.$router.push({
-                  path: "/approvalList",
-                });
-              } else {
-                window.location.reload();
-              }
-            } else if (this.noticeType === "合同") {
-              let Role = localStorage.getItem("Role");
-              // 主管跳转合同审批列表
-              if (Role === "ficc_admin" || Role === "rai_admin") {
-                if (this.$route.path != "/contractapprovallist") {
-                  this.$router.push({
-                    path: "/contractapprovallist",
-                  });
-                } else {
-                  window.location.reload();
-                }
-              } else {
-                if (this.$route.path != "/contractmanagelist") {
-                  this.$router.push({
-                    path: "/contractmanagelist",
-                  });
-                } else {
-                  window.location.reload();
-                }
-              }
-            } else if (this.noticeType === "用印") {
-              // 用印
-              if (this.$route.path != "/sealApprovalList") {
-                this.$router.push({
-                  path: "/sealApprovalList",
-                });
-              } else {
-                window.location.reload();
-              }
-            } else if (this.noticeType === "ETA试用") {
-              const path = this.$route.path;
-              let pushPath = "/etaApprovalList";
-              //非管理员:若通过跳转用户列表,若驳回跳转审批列表
-              //const etaApprovalListType = item.Content.includes('通过')?'approved':'all'
-              const etaApprovalListType =
-                item.Redirect === 1 ? "approved" : "all";
-              sessionStorage.setItem(
-                "etaApprovalListType",
-                etaApprovalListType
-              );
-              if (path == pushPath) {
-                window.location.reload();
-              } else {
-                this.$router.push(pushPath);
-              }
-            } else if (this.noticeType === "出差") {
-              const path = this.$route.path;
-              let pushPath;
-              if (item.ApprovalStatus != 1) {
-                // 跳到申请列表
-                pushPath = "/businessTripApplication";
-              } else {
-                // 跳到审批列表
-                pushPath = "/businessTripApproval";
-              }
-              if (path == pushPath) {
-                window.location.reload();
-              } else {
-                this.$router.push(pushPath);
-              }
-            }
-          }
-        });
-    },
     resetpwd() {
       //修改密码
       this.$router.push({ path: "/resetpsd" });
@@ -942,6 +799,14 @@ export default {
             }
         }
         this.linkSystems = linkArr
+    },
+
+    /* 获取动态配置 外部动态链接 */
+    async getPublicSettings() {
+      const res =  await getPublicSettingsApi();
+      if(res.Ret !== 200) return
+      
+      this.$store.commit('SET_DYNAMIC_LINK',res.Data)
     }
   },
 };

+ 1 - 1
src/views/chartRelevance_manage/fittingEquationList.vue

@@ -262,7 +262,7 @@ export default {
 	computed: {
 		/* 分享地址 */
     linkUrl() {
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share?&lang=${this.currentLang}`
     }
 	},

+ 1 - 1
src/views/chartRelevance_manage/list.vue

@@ -323,7 +323,7 @@ export default {
   computed: {
     /* 分享地址 */
     linkUrl() {
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share?&lang=${this.currentLang}`;
     },
   },

+ 1 - 1
src/views/chartRelevance_manage/statisticFeatureList.vue

@@ -247,7 +247,7 @@ export default {
 	computed: {
 		/* 分享地址 */
     linkUrl() {
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share?&lang=${this.currentLang}`
     }
 	},

+ 1 - 1
src/views/dataEntry_manage/chartSetting.vue

@@ -945,7 +945,7 @@ export default {
     },
     /* 分享地址 */
     linkUrl() {
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share&lang=${this.currentLang}`
     }
   },

+ 1 - 1
src/views/futures_manage/commodityChartBase.vue

@@ -273,7 +273,7 @@ export default {
 	computed: {
 		/* 分享地址 */
     linkUrl() {
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share?&lang=${this.currentLang}`
     }
 	},

+ 1 - 1
src/views/mychart_manage/components/chartDetailDia.vue

@@ -610,7 +610,7 @@ export default {
     },
     /* 分享地址 */
     linkUrl() {
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share?&lang=${this.currentLang}`
     }
   },

+ 2 - 2
src/views/ppt_manage/mixins/pptMixins.js

@@ -531,7 +531,7 @@ export default {
     //加载iframe
     initSheetIframe(idName,sheetId){
       console.log('init sheet iframe',idName)
-      const LINK_URL = process.env.SHEET_LINK;
+      const LINK_URL = this.$setting.ChartViewUrl+'/sheetshow';
       $(`#${idName}`).append(`<iframe 
           src='${LINK_URL}?code=${sheetId}' 
           width='100%'
@@ -543,7 +543,7 @@ export default {
     },
     //获取表格iframe的高度,用于ppt转报告
     reInitIframe(e) {
-      const LINK_URLS=[process.env.CHART_LINK,process.env.SHEET_LINK]
+      const LINK_URLS=[this.$setting.ChartViewUrl+'/chartshow',this.$setting.ChartViewUrl+'/sheetshow']
       if(!LINK_URLS.includes(e.origin)) return
       /* console.log('iframe加载完成',e.data) */
       const { height,code } = e.data;

+ 1 - 1
src/views/report_manage/addreportNew.vue

@@ -688,7 +688,7 @@ export default {
 			}
 			//插入内容
 			let htmlStr=''
-			const LINK_CHART_URL = process.env.CHART_LINK;
+			const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
 			
 			data.forEach(item=>{
 				const t=new Date().getTime()

+ 1 - 1
src/views/report_manage/editChapterReport.vue

@@ -744,7 +744,7 @@ export default {
       }
       //插入内容
       let htmlStr = "";
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
 
       data.forEach((item) => {
         const t = new Date().getTime();

+ 1 - 1
src/views/report_manage/editreportNew.vue

@@ -677,7 +677,7 @@ export default {
 			}
 			//插入内容
 			let htmlStr=''
-			const LINK_CHART_URL = process.env.CHART_LINK;
+			const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
 			
 			data.forEach(item=>{
 				const t=new Date().getTime()

+ 1 - 1
src/views/report_manage/mixins/editor.js

@@ -117,7 +117,7 @@ export default {
         selection.addRange(this.lastEditRange);
       }
       //插入内容
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       this.$nextTick(() => {
         this.editor.html.insert(
           `<p style='text-align:left; margin-top:10px;'>

+ 2 - 2
src/views/report_manage/mixins/reportMixin.js

@@ -202,7 +202,7 @@ export default {
       if (item.Disabled)
         return this.$message.warning("内部图表,不允许插入报告");
 
-      const LINK_CHART_URL = process.env.CHART_LINK;
+      const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
       let fromPage = this.$route.path === "/reportEnEditor" ? "en" : "";
       this.$nextTick(() => {
         this.editor.html.insert(
@@ -215,7 +215,7 @@ export default {
 
     /* 插入表格 */
     insertSheet(item) {
-      const LINK_URL = process.env.SHEET_LINK;
+      const LINK_URL = this.$setting.ChartViewUrl+'/sheetshow';
       this.$nextTick(() => {
         this.editor.html.insert(
           `<p style='text-align:left; margin-top:10px;'>

+ 1 - 1
src/views/report_manage/reportEn/reportEditor.vue

@@ -712,7 +712,7 @@ export default {
 			}
 			//插入内容
 			let htmlStr=''
-			const LINK_CHART_URL = process.env.CHART_LINK;
+			const LINK_CHART_URL = this.$setting.ChartViewUrl+'/chartshow';
 			let fromPage = this.$route.path === '/reportEnEditor' ? 'en' :'';
 			
 			data.forEach(item=>{

+ 1 - 1
src/views/report_manage/reportdtl.vue

@@ -75,7 +75,7 @@
 		computed: {
 			linkUrl(){
 				let str=''
-				const baseUrl=process.env.REPORT_SHARE_LINK;
+				const baseUrl= this.$setting.dynamicOutLinks.ReportViewUrl;
 				if(this.$route.query.code){
 					if(this.$route.query.fromPage == 'en'){
 						str=`${baseUrl}/reportshare_crm_report_en?code=${this.$route.query.code}`

+ 2 - 0
src/vuex/index.js

@@ -24,6 +24,8 @@ const state = {
   isCollapse: false,
 
   breadSelfName: '',//面包屑自定义当前页面name
+
+  dynamicOutLinks:{},//外部动态链接配置 iframe链接 研报详情分享link
 };
 
 export default {

+ 12 - 1
src/vuex/mutations.js

@@ -11,9 +11,20 @@ const mutations = {
   SET_COLLAPSE(state,bool) {
     state.isCollapse = bool;
   },
-  
+  //面包屑的二级动态name
   SET_TITLE(state,str) {
     state.breadSelfName = str;
+  },
+
+  //设置动态的外部链接
+  SET_DYNAMIC_LINK(state,obj) {
+    let filterObj = {};
+    obj.forEach(item => {
+        if(!filterObj[item.ConfKey]) {
+          filterObj[item.ConfKey] = item.ConfVal;
+        }
+    });
+    state.dynamicOutLinks = filterObj;
   }
 };