فهرست منبع

Merge branch 'master' of http://8.136.199.33:3000/eta_front/eta_front

Karsa 1 سال پیش
والد
کامیت
f520689466

+ 1 - 1
.gitignore

@@ -17,4 +17,4 @@
 
 /static/dll.vendor.js
 /.idea
-/static/base_config.js
+#/static/base_config.js

+ 7 - 0
README.md

@@ -8,6 +8,13 @@
 ### branch
 - master  debug  sandbox
 
+### pack
+- 在static/下新建base_config.js
+- base_config.js用于导出正式环境加密用的key,`window.key='对应环境的密钥'`
+- 在index.html中引入
+- 在src/api/crypto.js中,将key替换成window.key
+- 打包完成后,发布不同环境,只需要更改base_config.js中的密钥
+
 ### link
 - http://8.136.199.33:7778 弘则测试
 - https://eta.hzinsights.com 弘则正式

+ 5 - 0
src/api/api.js

@@ -56,6 +56,8 @@ import interactiveInterface from './modules/interactive';
 // 共享网盘
 import cloudDiskInterface from './modules/cloudDisk';
 
+import homeInterface from './modules/home'
+
 //视频管理模块
 import videoInterface from './modules/videoApi'
 
@@ -105,6 +107,7 @@ export {
   baiinfoInterface,
   nationalInterface,
   cloudDiskInterface,
+  homeInterface,
   businessTripInterence,
   reportVarietyENInterence
 };
@@ -116,6 +119,7 @@ const {
   userLogin,
   modifyPwd,
   checkPwd,
+  timeOnPage,
   reportlist,
   reportpublish,
   reportpublishcancle,
@@ -189,6 +193,7 @@ export {
   userLogin,
   modifyPwd,
   checkPwd,
+  timeOnPage,
   reportlist,
   reportpublish,
   reportpublishcancle,

+ 22 - 0
src/api/modules/home.js

@@ -0,0 +1,22 @@
+import http from "@/api/http.js"
+
+/* 首页请求的接口  */
+const homeInterface = {
+	/**
+	 * 问卷调查详情接口
+	 */
+	getQuestionnaireDetail: () => {
+		return http.get('/eta_trial/questionnaire/popup')
+	},
+  /**
+ * 问卷调查详情 - 提交答案
+ * List[index].QuestionnaireId  题目Id
+  List[index].integerOptions 答案 多选用 ~# 隔开
+  List[index].Type 问题类型
+ */
+	questionnaireSubmit: (params) => {
+		return http.post('/eta_trial/questionnaire/commit',params)
+	}
+}
+
+export default homeInterface

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

@@ -5,7 +5,9 @@ import http from "@/api/http.js"
 //  const modifyPwd = params => { return http.post('/modifyPwd',params); };  //修改密码
  const modifyPwd = params => { return http.post('/sysuser/modify/pwd',params); };  //修改密码
  const checkPwd = params => { return http.get('/sysuser/check_pwd'); };  //判断是否为初始密码
-
+ 
+	//用户累计停留时长 ActiveTime(s) Part
+ const timeOnPage = params =>{return http.post('/eta_trial/user/active',params)}
  const reportlist = params => { return http.get('/report/list',params); };  //获取报告列表
  const reportpublish = params => { return http.post('/report/publish',params); };  //批量发布报告
  const reportpublishcancle = params => { return http.post('/report/publish/cancle',params); };  //取消发布报告
@@ -308,6 +310,7 @@ export {
 	userLogin,
 	modifyPwd,
 	checkPwd,
+	timeOnPage,
 	reportlist,
 	reportpublish,
 	reportpublishcancle,

BIN
src/assets/img/home/login_logo.png


BIN
src/assets/img/questionnaire.png


+ 154 - 0
src/components/questionnaireDia.vue

@@ -0,0 +1,154 @@
+<template>
+  <div >
+    <el-dialog
+      title="问卷调查"
+      :visible.sync="dialogVisiblePwd"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @closed="handleClosed"
+      width="780px"
+      top="5vh"
+    >
+      <div style="padding: 10px 40px 0;" class="questionnaire-container" id="questionnaire-container">
+        <div class="questionnaire-title">
+          {{ questionList[0]&&questionList[0].Option?questionList[0].Option[0]:'尊敬的用户,感谢您使用系统,以下是对系统使用的调研问卷,我们期待您真实的反馈' }}
+        </div>
+        <el-form :model="quesitionForm" ref="questionRef" label-position="top" size="small">
+          <el-form-item :label="index+1+'.'+item.Question" :prop="item.QuestionnaireId+''" 
+          :rules="item.IsMust?{required:true,message:'该题为必答题',trigger:['blur','change']}:''"
+          v-for="(item,index) in questionList.slice(1)" :key="item.QuestionnaireId">
+            <el-radio-group v-model="quesitionForm[item.QuestionnaireId]" v-if="item.Type==1">
+              <el-radio :label="it" v-for="(it,ind) in item.Option" :key="it">{{ it }}</el-radio>
+            </el-radio-group>
+            <el-checkbox-group v-model="quesitionForm[item.QuestionnaireId]"
+            v-else-if="item.Type==2">
+              <el-checkbox  :label="it" v-for="(it,ind) in item.Option" :key="it">{{ it }}</el-checkbox>
+            </el-checkbox-group>
+            <el-input v-else rows="5" v-model="quesitionForm[item.QuestionnaireId]" type="textarea" placeholder="请输入文本"></el-input>
+          </el-form-item>
+        </el-form>
+        <div style="text-align: center;padding:40px 0 ;">
+          <el-button @click="submitQuestion(1)" type="primary" style="width: 120px;" size="40">提交</el-button>
+          <el-button @click="submitQuestion(0)" style="width: 120px;margin-left: 28px;" size="40">以后再填</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {  homeInterface } from "api/api.js";
+
+  export default {
+    name:'questionnaireDia',
+    data() {
+      return {
+        quesitionForm:{}
+      }
+    },
+    watch:{
+      questionList:{
+        handler:function(value,old){
+          // console.log(value);
+          // 初始化数据
+          value.map((item,index) =>{
+            if(index ==0)  return
+            if(item.Type==2){
+              this.$set(this.quesitionForm,item.QuestionnaireId,[])
+            }else{
+              this.$set(this.quesitionForm,item.QuestionnaireId,'')
+            }
+
+          })
+          console.log(this.quesitionForm);
+        },
+        deep:true,
+        immediate:true
+      }
+    },
+    props:{
+      dialogVisiblePwd: {
+        type: Boolean,
+        default: false,
+      },
+      questionList:{
+        type: Array,
+        default: () =>[],
+      }
+    },
+    methods:{
+      submitQuestion(isFill){
+        if(isFill!=1){
+          homeInterface.questionnaireSubmit({List:[],IsFill:isFill}).then(res=>{
+            if(res.Ret == 200){
+              this.$emit('update:dialogVisiblePwd',false)
+            }
+          })
+        }else{
+          this.$refs.questionRef.validate((valid)=>{
+            if(valid){
+              let paramList = this.questionList.map((item)=>{
+                if(item.Type==4 || this.quesitionForm[item.QuestionnaireId].length==0) return undefined
+                return {
+                  QuestionnaireId:item.QuestionnaireId,
+                  Options:Array.isArray(this.quesitionForm[item.QuestionnaireId])?
+                  this.quesitionForm[item.QuestionnaireId].join('~#'):this.quesitionForm[item.QuestionnaireId],
+                  Type:item.Type
+                }
+              }).filter(Boolean)
+              // console.log(paramList);
+              if(paramList.length==0){
+                this.$emit('update:dialogVisiblePwd',false)
+                return 
+              }
+              homeInterface.questionnaireSubmit({List:paramList,IsFill:isFill}).then(res=>{
+                if(res.Ret == 200){
+                  this.$message.success('提交成功')
+                  this.$emit('submitSuccess')
+                  this.$emit('update:dialogVisiblePwd',false)
+                }
+              })
+            }
+          })
+        }
+      },
+      handleClosed(){
+        this.$refs.questionRef.resetFields()
+        this.$emit('update:dialogVisiblePwd',false)
+      }
+    },
+    created(){
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+  .questionnaire-container{
+    .questionnaire-title{
+      font-weight: 500;
+      font-size: 16px;
+      color: #333333;
+      margin-bottom: 15px;
+    }
+
+  }
+</style>
+<style lang="scss">
+  #questionnaire-container{
+    .el-form-item__label{
+      font-weight: 5000;
+      font-size: 16px;
+      color: #333333;
+    }
+    .el-radio__label,.el-checkbox__label,.el-textarea__inner{
+      color: #666666;
+    }
+    .el-checkbox-group,.el-radio-group{
+      margin-left: -40px;
+    }
+    .el-radio,.el-checkbox{
+      margin-right: 0;
+      margin-left: 40px;
+    }
+  }
+</style>

+ 12 - 0
src/config/setting.js

@@ -0,0 +1,12 @@
+//全局配置
+export default {
+  name: '后台管理系统',
+  company_name: '**公司',
+  g_logo: require('@/assets/img/home/logo.png'), //主页菜单栏logo
+  g_mini_logo: require('@/assets/img/home/eta_mini.png'), //主页菜单栏mini-logo
+  theme_color: '',
+  menu_bg:'#FFFFFF',//菜单栏背景色
+  login_title: '',//登录页标题
+  login_logo: require('@/assets/img/home/login_logo.png'),//登录页logo
+  login_bg: require('@/assets/img/login_bg.png')
+}

+ 37 - 1
src/main.js

@@ -18,6 +18,22 @@ Vue.use(ElementUI);
 Vue.use(VueRouter);
 Vue.use(Vuex);
 
+import {
+  getBusinessCode
+} from "api/api.js";
+import global from '@/config/setting';
+import{endCalc,optionTimeCalc,doPageEventListener}from'@/utils/TimeOnPage.js';
+
+// 获取商家code
+getBusinessCode().then(res=>{
+  if(res.Ret!==200) return 
+  let bus_code = res.Data||''
+  if(stores.state.TRIAL_CODE == bus_code){
+    doPageEventListener()
+  }
+  stores.mutations.SET_BUSINESS_CODE(stores.state,bus_code) 
+})
+
 import setting from '@/mixins/theme.js'
 Vue.prototype.$setting = setting;
 
@@ -173,12 +189,32 @@ router.beforeEach(async(to, from, next) => {
   }
 });
 
+
 router.afterEach((to, from, next) => {
   // 改变页面标题
-  document.title = to.matched[to.matched.length - 1].name
+  if(stores.state.TRIAL_CODE == stores.state.businessCode){
+    // 试用ETA
+    document.title = to.matched[to.matched.length-1].name ?
+    `${global.company_name}-${to.matched[to.matched.length-1].name}`: global.name
+  }else{
+    document.title = to.matched[to.matched.length - 1].name
     ? `ETA-${to.matched[to.matched.length - 1].name}`
     : "ETA";
+  }
+
   window.scrollTo(0, 0);
+  
+  sessionStorage.setItem('preTitle',from.name||'')
+  const routerChangeType = sessionStorage.getItem('routerChangeType')
+  if(routerChangeType==='popstate'){
+    const IsActive = sessionStorage.getItem('IsActive')
+    if(IsActive=='1'){
+      endCalc('popstate',Number(sessionStorage.getItem('popStayTime')||0))
+    }
+    optionTimeCalc()
+    sessionStorage.removeItem('routerChangeType')
+    sessionStorage.removeItem('popStayTime')
+  }
 });
 
 Vue.config.devtools = true;

+ 2 - 0
src/mixins/theme.js

@@ -28,5 +28,7 @@ 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'),
+  g_mini_logo: require('@/assets/img/home/eta_mini.png'),
   dynamicOutLinks:{}//动态的外部link链接
 }

+ 200 - 0
src/utils/TimeOnPage.js

@@ -0,0 +1,200 @@
+//计算账号累计活跃时长
+import global from '@/config/setting';
+import {timeOnPage} from '@/api/api.js';
+//活跃时间间隔 (s)
+const TimeInterval = 60*10
+//页面停留时间 (s)
+let stayTime = 0
+
+
+
+let timer = null
+
+//打开计时器
+export const optionTimeCalc = ()=>{
+  const IsActive = sessionStorage.getItem('IsActive')
+  if(Number(IsActive)===0){
+    //console.log('打开计时器')
+    sessionStorage.setItem('IsActive',1)
+    timeStr = new Date().getTime()
+    startCalc()
+  }
+  
+}
+//开始计时
+export const startCalc = ()=>{
+  sessionStorage.setItem('preTitle',document.title)
+  timer = setInterval(()=>{
+    stayTime++
+    
+    if(stayTime>=TimeInterval){
+      endCalc('timeup',0)
+    }
+  },1000)
+}
+
+//结束计时
+export const endCalc = (type,intervalT)=>{
+  //console.log('关闭计时器')
+  clearInterval(timer)
+  const IsActive = sessionStorage.getItem('IsActive')
+  if(Number(IsActive)){
+     sendTOPInfo(type,intervalT)
+  }
+  stayTime = 0
+  /* if(type==='timeup'){
+    sessionStorage.setItem('IsActive',0)
+  } */
+  timeStr = new Date().getTime()
+  sessionStorage.setItem('IsActive',0)
+}
+
+
+//发送活跃时长数据
+export const sendTOPInfo = (type,intervalT)=>{
+  //获取上一个页面标题
+  const Title = sessionStorage.getItem('preTitle')
+  //console.log('发送活跃时长数据 ↓↓↓')
+  //获取计时间隔时间和页面名称
+  if(type==='timeup'){
+    console.table([{'停留时间(timeup)':stayTime+' s','停留页面':Title}])
+  }else{
+    console.table([{'停留时间(other)':Number(intervalT)/1000+' s','停留页面':Title,'触发类型':type}])
+  }
+  const Part = Title.split('-').length>1?Title.split('-')[1]:Title
+  const ActiveTime = type==='timeup'?stayTime:Number(intervalT)/1000
+  //发送数据
+  if(!Part.length||Part==global.name) return
+  if(ActiveTime>TimeInterval*12) return
+  console.log("ActiveTime:",ActiveTime,"Part:",Part)
+  timeOnPage({
+    ActiveTime:Math.round(ActiveTime),
+    Part:Part
+  }).then(res=>{
+    if(res.Ret!==200) return
+  })
+}
+
+//路由监听部分 
+//source https://juejin.cn/post/6905913200060366862#heading-2
+
+
+let timeStr=null
+let rewriteHis = function(type){
+  let origin = window.history[type]
+  return function(){
+    let rs = origin.apply(this, arguments)
+    let e = new Event(type.toLocaleLowerCase())
+    e.arguments = arguments
+    window.dispatchEvent(e)
+    return rs
+  }
+}
+
+
+export const doPageEventListener=function(){
+  window.history.pushState = rewriteHis('pushState')
+
+  window.history.replaceState = rewriteHis('replaceState')
+  
+  //刷新加载完成
+  window.addEventListener('load',(e)=>{
+    const unloadT = sessionStorage.getItem('unloadT')
+    const IsActive = sessionStorage.getItem('IsActive')
+    if(unloadT){
+      //console.log('刷新该页呆了时长',unloadT)
+      sessionStorage.removeItem('unloadT')
+      sessionStorage.setItem('preTitle',document.title)
+      if(Number(IsActive)){
+        endCalc('unload',unloadT)
+      }
+    }
+    console.log('onload')
+    timeStr = new Date().getTime()
+    optionTimeCalc()
+  })
+  //刷新离开页面
+  window.addEventListener('beforeunload',(e)=>{
+    console.log('unload')
+    let t = new Date().getTime() - timeStr
+    const IsActive = sessionStorage.getItem('IsActive')
+    if(Number(IsActive)){
+      sessionStorage.setItem('unloadT',t)
+    }
+  })
+  //popstate会在router.before/afterEach 之前触发,所以这里不对计时操作,操作放到before/afterEach
+  window.addEventListener('popstate',(e)=>{
+    //console.log('popState',e)
+    let t = new Date().getTime() - timeStr
+    timeStr = new Date().getTime()
+    //console.log('待了时长popstate:'+ t)
+    sessionStorage.setItem('routerChangeType','popstate')
+    sessionStorage.setItem('popStayTime',t)
+  })
+  
+  window.addEventListener('pushstate',()=>{
+    let t = new Date().getTime() - timeStr
+    timeStr = new Date().getTime()
+    //console.log('待了时长pushstate:'+ t)
+    const IsActive = sessionStorage.getItem('IsActive')
+    if(Number(IsActive)){
+      endCalc('pushstate',t)
+    }
+    optionTimeCalc()
+  })
+  
+  window.addEventListener('replacestate',()=>{
+    let t = new Date().getTime() - timeStr
+    timeStr = new Date().getTime()
+    //console.log('待了时长replacestate:'+ t)
+    const IsActive = sessionStorage.getItem('IsActive')
+    if(Number(IsActive)){
+      endCalc('replacestate',t)
+    }
+    optionTimeCalc()
+  })
+  
+  //页面监听
+  /* document.addEventListener('visibilitychange', function () {
+    // 用户离开了当前页面
+    if (document.visibilityState === 'hidden') {
+      console.log('hidden')
+      const IsActive = sessionStorage.getItem('IsActive')
+      if(Number(IsActive)){
+        let t = new Date().getTime() - timeStr
+        timeStr = new Date().getTime()
+        endCalc('hidden',t)
+      }
+    }
+  
+    // 用户打开或回到页面
+    if (document.visibilityState === 'visible') {
+      console.log('visible')
+      const IsActive = sessionStorage.getItem('IsActive')
+      if(IsActive==='0'){
+        timeStr = new Date().getTime()
+        optionTimeCalc()
+      }
+    }
+  }); */
+  document.addEventListener('click',(e)=>{
+    //console.log('click',e,e.composedPath())
+    //只计算displayMain 的click
+    const path = e.composedPath()
+    const contentIndex = path.findIndex((item)=>{return item.className==="content-container"})
+    if(contentIndex===-1) return 
+    //console.log('合法的click')
+    const IsActive = sessionStorage.getItem('IsActive')
+    if(Number(IsActive)===0){
+      optionTimeCalc()
+    }else{
+      //console.log('重置活跃计时')
+      //重置活跃时间
+      stayTime = 0
+    }
+  })
+}
+
+
+
+

+ 69 - 26
src/views/Home.vue

@@ -7,13 +7,13 @@
           <img
             class="logo"
             v-if="!isCollapse"
-            src="~@/assets/img/home/logo.png"
+            :src="isTrail?global.g_logo:$setting.g_logo"
           />
           <!-- 折叠侧边栏logo尺寸 -->
           <img
             class="logo_coll"
             v-else
-            src="~@/assets/img/home/eta_mini.png"
+            :src="isTrail?global.g_mini_logo:$setting.g_mini_logo"
           />
         </div>
         <div
@@ -23,7 +23,7 @@
           <aside class="menu-expanded">
             <!--导航菜单-->
             <el-menu
-              :background-color="$setting.menu_bg"
+              :background-color="isTrail?global.menu_bg:$setting.menu_bg"
               text-color="#333"
               :collapse-transition="false"
               :active-text-color="$setting.theme_color"
@@ -243,6 +243,10 @@
                     >
                   </el-dropdown-menu>
                 </el-dropdown>
+                <div class="userinfo-fingerpost">
+                  <img src="~@/assets/img/questionnaire.png" v-if="isQuestionShow" @click="showQuestionDia=true"
+                style="width: 84px;height: 24; cursor: pointer;" />
+                </div>
               </div>
 
               <el-dropdown trigger="click" style="width:130px;">
@@ -292,7 +296,9 @@
 
     <!-- //重置初始密码 -->
     <pwd-dlg :dialogVisiblePwd="dialogVisiblePwd" />
-    
+    <!-- 问卷调查弹窗 -->
+    <questionnaire-dia :dialogVisiblePwd.sync="showQuestionDia" @submitSuccess="questionSubmitSuccess"
+    :questionList="questionList"></questionnaire-dia>
   </div>
 </template>
 
@@ -303,15 +309,20 @@ import {
   customInterence,
   roadshowInterence,
   getBusinessCode,
+  homeInterface
 } from "api/api.js";
 import { getPublicSettingsApi } from '@/api/modules/oldApi';
 import PwdDlg from "@/components/pwdDlg.vue";
 import questionMsgDia from "@/components/questionMsgDia.vue";
+import questionnaireDia from "../components/questionnaireDia.vue";
 import EventBus from "@/api/bus.js";
+import global from '@/config/setting';
+
 export default {
   components: {
     PwdDlg,
     questionMsgDia,
+    questionnaireDia,
   },
   inject: ["reload"],
   filters: {
@@ -371,7 +382,11 @@ export default {
         return this.permissionBtn.checkPermissionBtn(
             this.permissionBtn.baseConfigPermission.sysJump_updateLog
         )
-    }
+    },
+		// 是否是eta试用
+    isTrail(){
+			return this.$store.state.businessCode == this.$store.state.TRIAL_CODE
+		}
   },
   data() {
     return {
@@ -415,7 +430,12 @@ export default {
       flag2: false, //显示合同提示红点
       flag3: false, //显示用印提示红点
       dialogVisiblePwd: false, //初始密码的弹框
-
+      //  ----------------问卷调查弹窗
+      showQuestionDia:false,
+      // 问卷调查icon是否展示
+      isQuestionShow:false,
+      // 问题列表
+      questionList:[],
       flag4: false,
       flag5: false, //显示ETA试用相关的红点
       flag6: false, //显示出差相关的红点
@@ -443,6 +463,8 @@ export default {
 
       //链接系统
       linkSystems: this.$setting.linkSystems,
+      bus_code:"",
+      global
     };
   },
   created() {
@@ -456,6 +478,9 @@ export default {
       this.isShowApprovalNotice = true;
     }
     this.resetLinkSys()
+    // this.getBusinessCodeFun()
+    
+    this.getQuestionStaus()
   },
   mounted() {
     if (sessionStorage.getItem("hasGetMenu")) {
@@ -467,6 +492,14 @@ export default {
     this.getPublicSettings();
   },
   methods: {
+    // 获取商家Code
+    // getBusinessCodeFun(){
+      // getBusinessCode().then(res=>{
+      //   if(res.Ret!==200) return 
+      //   this.bus_code = res.Data||''
+      //   this.$store.commit("SET_BUSINESS_CODE", this.bus_code);
+      // })
+    // },
     //判断是否为初始密码
     async isInitialPwd() {
       const res = await checkPwd();
@@ -637,7 +670,28 @@ export default {
         this.roadshowFeedbackList = Data;
       });
     },
-
+    // 获取用户的问卷调查状态
+    getQuestionStaus(){
+      if(!this.isTrail){
+        this.showQuestionDia=false
+        this.isQuestionShow=false
+        this.questionList=[]
+        return 
+      }
+      // console.log(this.isTrail,'isTrail');
+      homeInterface.getQuestionnaireDetail().then(res=>{
+        // console.log(res);
+        if(res.Ret == 200){
+          this.showQuestionDia=!!res.Data.IsPopup && (!!res.Data.IsShow)
+          this.isQuestionShow = !!res.Data.IsShow
+          this.questionList = res.Data.Question.List || []
+        }
+      })
+    },
+    // 问卷提交成功
+    questionSubmitSuccess(){
+      this.isQuestionShow=false
+    },
     // 操作指南的跳转
     toOperation() {
       // this.$router.replace({name: '/fingerpost', params: {id: 1}})
@@ -646,16 +700,11 @@ export default {
       //   query: { contractid: this.contractId },
       // });
       // window.open(href, "_blank");
-      // 获取商家
-      getBusinessCode().then(res=>{
-        if(res.Ret!==200) return 
-        const bus_code = res.Data||''
-        //打开帮助文档
-        const href = `${process.env.VUE_APP_ETA_HELP_DOCS}?bus_code=${bus_code}`
-        console.log(href);
-        // const href = `http://192.168.77.13:3033/help/index?bus_code=${bus_code}`
-        window.open(href, "_blank");
-      })
+      //打开帮助文档
+      const href = `${process.env.VUE_APP_ETA_HELP_DOCS}?bus_code=${this.$store.state.businessCode}`
+      // console.log(href);
+      // const href = `http://192.168.77.13:3033/help/index?bus_code=${this.bus_code}`
+      window.open(href, "_blank");
     },
     // 跳转去其他的系统
     async linkToOtherMS({path,key}) {
@@ -749,15 +798,9 @@ export default {
         .catch(() => {});
     },
     toDoc(){
-        //获取商家code
-        getBusinessCode().then(res=>{
-            if(res.Ret!==200) return 
-            const bus_code = res.Data||''
-            //打开更新日志项目
-            const href = `${process.env.VUE_APP_ETA_DOCS}?bus_code=${bus_code}`
-            window.open(href, "_blank");
-        })
-        
+      //打开更新日志项目
+      const href = `${process.env.VUE_APP_ETA_DOCS}?bus_code=${this.$store.state.businessCode}`
+      window.open(href, "_blank");
     },
     collapseHandle () {
       //折叠导航栏

+ 10 - 2
src/views/Login.vue

@@ -2,8 +2,8 @@
   <div id="login">
 		<div id="login_wrapper">
       
-			<img class="login-bg" :src="$setting.login_bg" alt />
-      <img class="login-icon" :src="$setting.login_logo">
+			<img class="login-bg" :src="isTrail?global.login_bg:$setting.login_bg" alt />
+      <img class="login-icon" :src="isTrail?global.login_logo:$setting.login_logo" v-if="isTrail?global.login_logo:$setting.login_logo">
 			<el-form
 				:model="ruleForm"
 				:rules="rules"
@@ -72,9 +72,11 @@
 import { userLogin, departInterence } from "@/api/api.js";
 import http from "@/api/http.js";
 import md5 from "@/utils/md5.js";
+import global from '@/config/setting'
 export default {
   data() {
     return {
+			global,
       b: new http.Base64(),
       logining: false, //登录loadding
       ruleForm: {
@@ -100,6 +102,12 @@ export default {
       checked: false, //是否保持登录状态
       visible: true, //密码输入类型
     };
+  },
+	computed: {
+		// 是否是eta试用
+    isTrail(){
+			return this.$store.state.businessCode == this.$store.state.TRIAL_CODE
+		}
   },
   created() {
     this.keyupSubmit(); //回车登录

+ 7 - 1
src/views/dataEntry_manage/databaseComponents/addTargetDiaBase.vue

@@ -110,9 +110,15 @@ export default {
 			search_company_txt: ''
 		};
 	},
+	computed: {
+		// 是否是eta试用
+    isTrail(){
+			return this.$store.state.businessCode == this.$store.state.TRIAL_CODE
+		}
+  },
 	methods: {
 		init() {
-			this.fromType = 'wind'
+			this.fromType = this.isTrail?'同花顺':'wind'
 			this.status = ''
 			this.tableData = []
 			this.dataList = []

+ 5 - 5
src/views/system_manage/components/addUserDialog.vue

@@ -9,7 +9,7 @@
         <el-form @submit.native.prevent :model="userForm" :rules="userRule" ref="userForm" label-width="100px"
             class="demo-ruleForm" style="marginTop:15px;">
             <el-form-item label="登录账号" prop="account">
-                <el-input v-model="userForm.account" placeholder="建议使用邮箱前缀或者手机号码" clearable>
+                <el-input v-model="userForm.account" placeholder="建议使用邮箱前缀或者手机号码" :disabled="userForm.disabledForm" clearable>
                 </el-input>
             </el-form-item>
             <el-form-item label="登录密码" prop="pwd" v-if="userForm.title == '添加用户'">
@@ -21,19 +21,19 @@
                 </el-input>
             </el-form-item>
             <el-form-item label="手机号码" prop="mobile">
-                <el-input v-model="userForm.mobile" placeholder="请输入手机号码" clearable>
+                <el-input v-model="userForm.mobile" placeholder="请输入手机号码" :disabled="userForm.disabledForm" clearable>
                 </el-input>
             </el-form-item>
             <el-form-item label="所属部门" prop="depart" v-if="userForm.title == '添加用户'">
                 <el-cascader :options="departArr" v-model="userForm.depart" :props="form_departProp"
-                    placeholder="请选择部门分组" clearable>
+                    placeholder="请选择部门分组" :disabled="userForm.disabledForm" clearable>
                 </el-cascader>
             </el-form-item>
             <el-form-item label="工号" prop="employeeNumber">
                 <el-input :disabled="hasEmployeeNo" v-model="userForm.employeeNumber" placeholder="请输入工号"></el-input>
             </el-form-item>
             <el-form-item label="分配角色" prop="role">
-                <el-select v-model="userForm.role" placeholder="分配角色" @change="roleChange">
+                <el-select v-model="userForm.role" placeholder="分配角色" :disabled="userForm.disabledForm" @change="roleChange">
                     <el-option v-for="item in roleArr" :key="item.RoleId" :label="item.RoleName" :value="item.RoleId">
                     </el-option>
                 </el-select>
@@ -54,7 +54,7 @@
                         @selected="selectRegion"/>
             </el-form-item>
             <el-form-item label="状态" prop="status">
-                <el-radio-group v-model="userForm.status">
+                <el-radio-group v-model="userForm.status" :disabled="userForm.disabledStatus">
                     <el-radio :label="1">启用</el-radio>
                     <el-radio :label="0">禁用</el-radio>
                 </el-radio-group>

+ 47 - 6
src/views/system_manage/departManage.vue

@@ -3,7 +3,7 @@
 		<div class="left_cont">
 			<div class="company_top" @click="initDepart">
 				<img src="~@/assets/img/set_m/home_ico.png" alt="" style="width:30px;height:30px;">
-				<span :class="!defaultGroup&&!defaultDepart?'act':''">弘则研究</span>
+				<span :class="!defaultGroup&&!defaultDepart?'act':''">{{isTrail?global.company_name:'弘则研究'}}</span>
 			</div>
 			<el-tree
 				ref="departTree"
@@ -23,9 +23,11 @@
 					<span>{{ node.label }}</span>
 					<span style="display:flex;alignItems:center;" v-show="act_node===data.unicodeKey">
                         <img src="~@/assets/img/data_m/move_ico.png" alt="" style="width:12px;height:12px;marginRight:10px;" @click.stop>
-						<img src="~@/assets/img/set_m/add.png" alt="" style="width:12px;height:12px;marginRight:10px;" @click.stop="addNode(data)" v-if="data.IsDepartment">
+						<img src="~@/assets/img/set_m/add.png" alt="" style="width:12px;height:12px;marginRight:10px;" @click.stop="addNode(data)" 
+						v-if="data.IsDepartment && (!isTrail || (isTrail && data.canEdit))">
 						<img src="~@/assets/img/set_m/add.png" alt="" style="width:12px;height:12px;marginRight:10px;" @click.stop="addNode(data)" v-if="data.IsGroup">
-						<img src="~@/assets/img/set_m/edit.png" alt="" style="width:12px;height:12px;marginRight:10px;" @click.stop="editNode(data)">
+						<img src="~@/assets/img/set_m/edit.png" alt="" style="width:12px;height:12px;marginRight:10px;" @click.stop="editNode(data)"
+						v-if="(!isTrail) || (data.canEdit||data.IsGroup)">
 						<el-popconfirm
 						@onConfirm="removeNode(node,data)"
 						confirmButtonText='删除'
@@ -34,7 +36,7 @@
 						icon="el-icon-info"
 						iconColor="red"
 						title="确定删除吗"
-						v-if="data.DepartmentId!=shareCustomDepartmentId"
+						v-if="data.DepartmentId!=shareCustomDepartmentId && (!isTrail || (isTrail && (data.canEdit || data.IsGroup)))"
 						>
 						<!-- 共享客户组不允许删除 -->
 							<img slot="reference" src="~@/assets/img/set_m/del.png" alt="" style="width:12px;height:12px;marginTop:4px">
@@ -109,7 +111,8 @@
 					<el-table-column label="操作" align="center" width="300">
 						<template slot-scope="scope">
 							<div style="color:#4099ef; font-size:24px;display: flex;gap:0 10px;">
-								<span v-permission="permissionBtn.sysDepartPermission.sysDepart_saveUser"
+								<span  v-permission="permissionBtn.sysDepartPermission.sysDepart_saveUser"
+								v-if="!isTrail || (!(scope.row.DepartmentGroup=='ETA试用客户'&&scope.row.Enabled===0))"
 									class="editsty" @click.stop="editUser(scope.row)">编辑</span>
 								<span v-permission="permissionBtn.sysDepartPermission.sysDepart_resetPass"
 									class="editsty" @click.stop="resetPassWord(scope.row)">重置密码</span>
@@ -503,6 +506,7 @@ import { departInterence } from '@/api/api.js';
 import http from '@/api/http.js'
 import md5 from '@/utils/md5.js';
 import mixin from './mixin/departManageMixin.js';
+import global from '@/config/setting'
 //自定义省市数据
 import{province_sorce,city_sorce} from '@/utils/distpicker'; 
 export default {
@@ -530,6 +534,7 @@ export default {
         }
 		}
 		return {
+			global,
 			isAddDepart:false,//添加部门弹窗
 			departForm:{
 				title:"添加部门",
@@ -593,6 +598,9 @@ export default {
 				mobile:'',
 				auth:0,
 				status:1,//状态 1启用 0禁用
+				disabledForm:false,//是否禁用表单的某些选项
+				disabledStatus:false,//是否禁用表单的状态项
+				departmentName:'',//所属一级部门名称
 			},//用户弹框表单
 			// 是否有工号
 			hasEmployeeNo:false,
@@ -690,6 +698,24 @@ export default {
 	watch: {
 		click_roleId() {
 			this.getAuth();
+		},
+		isAddUser(val){
+     	if(val&&this.userForm.title==="编辑用户"){
+				//检查编辑的是否是属于ETA试用客户部门的客户
+				if(this.userForm.departmentName==='ETA试用客户' && this.isTrail){
+					this.userForm.disabledForm = true
+					//若用户状态为启用,则允许编辑状态,若为禁用,则无法编辑状态
+          this.userForm.disabledStatus = this.userForm.status===0?true:false
+				}
+      }
+    }
+	},
+	computed:{
+		// 有些是试用平台独有的内容和判断
+		// 是否是eta试用
+		isTrail(){
+			// console.log(this.$store.state.businessCode,this.$store.state.TRIAL_CODE,'this.$store.state.businessCode == this.$store.state.TRIAL_CODE');
+			return this.$store.state.businessCode == this.$store.state.TRIAL_CODE
 		}
 	},
 	created() {
@@ -732,6 +758,18 @@ export default {
 			departInterence.getDepartList().then(res => {
 				if(res.Ret === 200) {
 					this.departArr = res.Data.List || []
+					if(this.isTrail){
+						this.departArr = this.departArr.map(item=>{
+							//如果部门为ETA试用客户,则屏蔽所有操作
+							if(item.DepartmentName==='ETA试用客户'){
+								item.disabled = true
+								item.canEdit = false
+							}else{
+								item.canEdit = true
+							}
+							return item
+						})
+					}
 					//给节点增加唯一key和parentkey
 					this.departArr = this.departArr.map(depart=>{
 						depart.unicodeKey='depart_'+depart.DepartmentId
@@ -1307,7 +1345,10 @@ export default {
 				mobile:item.Mobile,
 				auth:item.Authority,
 				status:item.Enabled,
-				direct:direct
+				direct:direct,
+				departmentName:item.DepartmentGroup,
+        disabledForm:false,
+				disabledStatus:false
 			}
 			this.hasEmployeeNo=!!item.EmployeeId
 			this.isAddUser = true;

+ 3 - 0
src/vuex/index.js

@@ -6,6 +6,7 @@ import ppt from "./modules/ppt";
 import edb from "./modules/edb";
 import permissionButton from "./modules/permissionButton";
 
+
 // 应用初始状态
 const state = {
   theme: "#409EFF",
@@ -26,6 +27,8 @@ const state = {
   breadSelfName: '',//面包屑自定义当前页面name
 
   dynamicOutLinks:{},//外部动态链接配置 iframe链接 研报详情分享link
+  businessCode:"", //商家code
+  TRIAL_CODE:"e069d0a024e09636a1225e72a964b4b6", //试用平台的 商家code
 };
 
 export default {

+ 4 - 0
src/vuex/mutations.js

@@ -29,6 +29,10 @@ const mutations = {
     state.dynamicOutLinks = filterObj; 
     setting.dynamicOutLinks = state.dynamicOutLinks;
 
+  },
+  //设置商家code
+  SET_BUSINESS_CODE(state,code) {
+    state.businessCode = code || ""
   }
 };
 

+ 1 - 0
static/base_config.js

@@ -0,0 +1 @@
+window.key = '6WpHp4vSvLVQK8SLioNZ7WMq'