cuiqian2004
2024-08-20 e01994d84332869ebad232af477a4ded68560c55
pages/index/index.vue
@@ -16,7 +16,7 @@
                  :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 || app.list_name}}</p>
               <p :data-key="app.id">{{ app.list_name||  app.name}}</p>
            </li>
         </ul>
@@ -27,6 +27,7 @@
<script>
   import Base64 from '../../components/js-base64/base64.js'
   import utils from "@/js/utils.js"
   export default {
      modules: {
         Base64,
@@ -58,24 +59,29 @@
         if (this.$store.state.areaFunc)
            this.data = this.$store.state.areaFunc.data;
         else
            this.$store.dispatch('areaFunc', {}).then(success => {
         else {
            const appType = utils.session.getValue('app_type') || "MES";
            this.$store.dispatch('areaFunc', {
               app_type: appType,
               need_ace:1,
            }).then(success => {
               // console.log(success);
               if (success.code == '00000' || success.err_code == 0) {
                  this.data = success.data;
                  if (success.err_code != undefined) { //判断是否是Mobox3
                     success.result.forEach(async (area, index) => {
                        if (area.client_type == 2) { //判断类型是否是PDA类型
                        area.app_type= appType
                           await this.GetFuncTree(index, area);
                        }
                     });
                  }
               } else {
                  uni.showModal({
                     title:this.translateSys("error"),
                     title: this.translateSys("error"),
                     content: success.msg,
                     showCancel: false,
                     confirmText:this.translateSys("cancel")
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex => {
@@ -84,32 +90,35 @@
                  title: this.translateSys("error"),
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText:this.translateSys("cancel")
                  confirmText: this.translateSys("cancel")
               });
            });
         }
      },
      methods: {
         async GetFuncTree(index, area) { //Mobox3获取应用领域的功能点
            this.data = [];
            var $this = this;
            var json = {
               app_type: "MES",
               app_type: area.app_type,
               area_id: area.id,
               area_client_type: area.client_type,
               need_ace: '0',
               need_ace:1,
            };
            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]);
                     console.log("onLoad", $this.data)
                     this.$store.commit("areaFunc", $this.data);
                  }
               } else {
                  uni.showModal({
                     title:this.translateSys("error"),
                     title: this.translateSys("error"),
                     content: success.msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
@@ -128,7 +137,7 @@
         appCreate(app) { //点击功能点跳转页面
            console.log(app);
            var paramStr = this.$store.state.OIMoboxSAPI ? app.param : app.Param;
            var appName = this.$store.state.OIMoboxSAPI ? (app.name || app.list_name) : app.Name;
            var appName = this.$store.state.OIMoboxSAPI ? (app.list_name || app.name) : app.Name;
            var defCode = this.$store.state.OIMoboxSAPI ? app.def_code : app.DefCode;
            var param = "";
            if (paramStr) {
@@ -141,9 +150,9 @@
            if (!param) {
               uni.showModal({
                  title: this.translateSys("tip"),
                  content:this.translate('tip_no_app_param'),
                  content: this.translate('tip_no_app_param'),
                  showCancel: false,
                  confirmText:this.translateSys("cancel")
                  confirmText: this.translateSys("cancel")
               });
               return;
            }