cuiqian2004
2024-07-05 37ff5e49c0e7c5b63e7e8e137058366244f826c1
pages/index/index.vue
@@ -1,54 +1,5 @@
<style>
   .content {
      /* display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center; */
      width: 100vw;
      min-height: 100vh;
      background: #EAEAEA;
      padding: 1rpx 0rpx;
   }
   .v-area{
      border-radius: 12rpx;
      margin: 30rpx;
      padding: 10rpx;
      background: #FFFFFF;
   }
   .areaList{
      padding: 0;
   }
   .areaList li{
      /* border: 1px solid #0062CC; */
      list-style: none;
      /* width: 120rpx; */
      display: inline-block;
      padding: 30rpx 10rpx 16rpx 10rpx;
      text-align: center;
      font-size: 14px;
      width: 100px;
      vertical-align: text-top;
   }
   .logo {
      height: 120rpx;
      width: 120rpx;
      border-radius: 20rpx;
      display: inline-block;
      text-align: center;
      padding: 18rpx;
      color: #000000;
      border: 0px solid rgb(221, 221, 221);
   }
   .logo i{
      color: #000000;
      font-size: 40px;
      line-height: 53px;
   }
</style>
<template>
   <view class="content">
   <view class="uni-page-index">
      <view class="v-area" v-for="(area,index) in data">
         <p :data-key="area.ID?area.ID:area.id">{{ area.Name?area.Name:area.name }}</p>
         <ul class="areaList">
@@ -61,22 +12,16 @@
            </li>
            <!-- Mobox3 -->
            <li v-for="(app,key) in area.app_list">
               <a @tap="appCreate(app)" class="logo" :style="{'background-color':app.bk_color,'color':app.bk_color}">
               <a @tap="appCreate(app)" class="logo"
                  :style="{'background-color':app.bk_color,'color':app.bk_color}">
                  <i :class="app.img_font_style" :style="{'color':app.txt_color}"></i>
               </a>
               <p :data-key="app.id">{{ app.name }}</p>
               <p :data-key="app.id">{{ app.name || app.list_name}}</p>
            </li>
            
         </ul>
      </view>
      
      <!-- <image class="logo" src="/static/logo.png"></image>
      <view class="text-area">
         <text class="title">{{title}}</text>
      </view>
      <view class="" v-for="(v,index) in data">
         <input type="text" :value="v" @focus="ontap" :data-key="index"  :key="index"/>
      </view> -->
   </view>
</template> 
@@ -110,6 +55,7 @@
      onLoad(options) {
         console.log(options);
         // 获取所有AppType="MES",ClientType="2"(PDA)的引用领域功能点信息
         if(this.$store.state.areaFunc)
            this.data = this.$store.state.areaFunc.data;
         else
@@ -125,25 +71,23 @@
                     });
                  }
               }else{
                  uni.showModal({title:"错误",content:success.msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title:this.translateSys("error"),
                     content: success.msg,
                     showCancel: false,
                     confirmText:this.translateSys("cancel")
                  });
               }
            }).catch(ex=>{
               // console.log(ex);
               uni.showModal({title:"错误",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: this.translateSys("error"),
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText:this.translateSys("cancel")
               });
            });
         
         // var data = {
         //       in1:"ll1",
         //       in2:"ll2",
         //       in3:"ll3",
         //       in4:"ll4",
         //       in5:"ll5",
         //       in6:"ll6",
         //    };
         // for(var i in data)
         //    this.$data.keys.push(i)
         // this.$data.data = data;
         // console.log(this.$data.keys);
      },
      methods: {
         async GetFuncTree(index,area){ //Mobox3获取应用领域的功能点
@@ -158,20 +102,33 @@
            this.$store.dispatch('GetFuncTree',json).then(success=>{
               // console.log(success);
               if (success.err_code == 0) {
                  if ((success.result || []).length > 0) {
                  $this.data.push(success.result[0]);
                  this.$store.commit("areaFunc", $this.data);
                  }
               }else{
                  uni.showModal({title:"错误",content:success.msg,showCancel:false,confirmText:"取消"});
                  uni.showModal({
                     title:this.translateSys("error"),
                     content: success.msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex=>{
               // console.log(ex);
               uni.showModal({title:"错误",content:ex.errMsg,showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: this.translateSys("error"),
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
            });
         },
         appCreate(app){ //点击功能点跳转页面
            console.log(app);
            var paramStr = this.$store.state.OIMoboxSAPI?app.param:app.Param;
            var appName = this.$store.state.OIMoboxSAPI?app.name:app.Name;
            var appName = this.$store.state.OIMoboxSAPI ? (app.name || app.list_name) : app.Name;
            var defCode = this.$store.state.OIMoboxSAPI?app.def_code:app.DefCode;
            var param = "";
            if(paramStr){
@@ -182,7 +139,12 @@
            }
                    
            if(!param){
               uni.showModal({title:"提示",content:"该功能点未配置参数,请重新配置参数!",showCancel:false,confirmText:"取消"});
               uni.showModal({
                  title: this.translateSys("tip"),
                  content:this.translate('tip_no_app_param'),
                  showCancel: false,
                  confirmText:this.translateSys("cancel")
               });
               return;
            }
            if(defCode == '3018'){
@@ -249,8 +211,66 @@
               // console.log(result.decodedata);
               this.$data.data[e.target.dataset['key']]=result.decodedata;
            })
         }
         },
         translate(t) {
            if (typeof this.$t == "function") return this.$t(`page.${t}`)
            else return t;
         },
         translateSys(t) {
            if (typeof this.$t == "function") return this.$t(`sys.${t}`)
            else return t;
         },
      }
   }
</script>
<style lang="scss">
   .uni-page-index {
      width: 100vw;
      min-height: 100vh;
      background: #EAEAEA;
      padding: 1rpx 0rpx;
      .v-area {
         border-radius: 12rpx;
         margin: 30rpx;
         padding: 10rpx;
         background: #FFFFFF;
      }
      .areaList {
         padding: 0;
      }
      .areaList li {
         /* border: 1px solid #0062CC; */
         list-style: none;
         /* width: 120rpx; */
         display: inline-block;
         padding: 30rpx 10rpx 16rpx 10rpx;
         text-align: center;
         font-size: 14px;
         width: 100px;
         vertical-align: text-top;
      }
      .logo {
         height: 120rpx;
         width: 120rpx;
         border-radius: 20rpx;
         display: inline-block;
         text-align: center;
         padding: 18rpx;
         color: #000000;
         border: 0px solid rgb(221, 221, 221);
      }
      .logo i {
         color: #000000;
         font-size: 40px;
         line-height: 53px;
      }
   }
</style>