psj 2 years ago
parent
commit
afcb7fd8fc

+ 2 - 1
src/role_button.js

@@ -17,7 +17,8 @@ export default function selectConfigModuleByRole(obj){
     //显示已经配置的按钮
     var buttons = $(".role_button");
     for(let i = 0 ; i <buttons.length ; i++ ){
-        if(tempConfigButtonMap[$(buttons[i]).attr("role_button_code")] == null){
+        if(tempConfigButtonMap[$(buttons[i]).attr("role_button_code")] == null || tempConfigButtonMap[$(buttons[i]).attr("role_button_code")] == undefined
+        || tempConfigButtonMap[$(buttons[i]).attr("role_button_code")] ==  "undefined"){
             $(buttons[i]).css("pointer-events","none");
             $(buttons[i]).css("color","#AEADAD");
         }

+ 5 - 5
src/views/electricCard/ElectricCard.vue

@@ -31,12 +31,12 @@
             <el-col :span="4">
               <el-form-item class="setSearch">
                 <el-button class="role_button" role_button_code="a7fbde48-0228-4896-8af2-3a47a1ba0c67" type="primary" @click="onSubmitSearch">查询</el-button>
-                <el-button class="role_button" role_button_code="7ac44236-79a2-4905-85e4-13e5cae09288"  v-if="eletricCurrentId=='1'||eletricCurrentId=='2'" @click="downloadModel()" type="primary">导入模板</el-button>
+                <el-button class="role_button" role_button_code="7ac44236-79a2-4905-85e4-13e5cae09288"  v-show="eletricCurrentId=='1'||eletricCurrentId=='2'" @click="downloadModel()" type="primary">导入模板</el-button>
 <!--                <el-button v-if="eletricCurrentId=='1'||eletricCurrentId=='2'" @click="uploadModel()" type="primary">-->
 <!--                  导入-->
 <!--                  <input  style="display: none" type="file" id="fileExport" @change="handleFileChange" ref="inputer">-->
 <!--                </el-button>-->
-                <el-upload v-if="eletricCurrentId=='1'||eletricCurrentId=='2'" style="display: inline-block;margin-left:8px"
+                <el-upload v-show="eletricCurrentId=='1'||eletricCurrentId=='2'" style="display: inline-block;margin-left:8px"
                            class="upload-demo"
                            action="http://10.81.66.9:9250/ywtb/ywtbLicense_upload"
                            :show-file-list="showList"
@@ -46,8 +46,8 @@
                            :file-list="fileList">
                   <el-button class="role_button" role_button_code="df9dcabf-872c-486c-a7a7-a82b8d3d5f55"   type="primary">点击上传</el-button>
                 </el-upload>
-                <el-button class="role_button" role_button_code="7ac44236-79a2-4905-85e4-13e5cae09288" v-if="eletricCurrentId=='3'" type="primary" @click="downloadModel()">导入模板</el-button>
-                <el-button class="role_button" role_button_code="df9dcabf-872c-486c-a7a7-a82b8d3d5f55" v-if="eletricCurrentId=='3'" type="primary" @click="openFileModel()">导入</el-button>
+                <el-button class="role_button" role_button_code="7ac44236-79a2-4905-85e4-13e5cae09288" v-show="eletricCurrentId=='3'" type="primary" @click="downloadModel()">导入模板</el-button>
+                <el-button class="role_button" role_button_code="df9dcabf-872c-486c-a7a7-a82b8d3d5f55" v-show="eletricCurrentId=='3'" type="primary" @click="openFileModel()">导入</el-button>
               </el-form-item>
             </el-col>
           </el-row>
@@ -256,7 +256,6 @@ export default {
     }
   },
   mounted() {
-    selectConfigModuleByRole(this);
     this.form.date1 = startTime();
     this.form.date2 = endTime();
     this.form.date1 = '';
@@ -573,6 +572,7 @@ export default {
         this.changeYearLabel();
         this.onSubmitSearch();
       }
+      selectConfigModuleByRole(this);
     },
     ...mapEletricCardMutations(['eletricCardCurrentId'])
   },

+ 1 - 1
src/views/matters_guidance/mian_body/MainBody.vue

@@ -42,7 +42,7 @@
             <el-col :span="4"><div class="grid-content bg-purple">
               <el-form-item>
                 <el-button type="primary" class="role_button" role_button_code="8f55b710-6f34-4722-9666-582f8f04ad01" @click="onSubmitSearch">查询</el-button>
-                <el-button class="role_button" role_button_code="8f55b710-6f34-4722-9666-582f8f04ad01" type="primary" @click="downloadModel()">导入模板</el-button>
+                <el-button class="role_button" role_button_code="4a2fbabd-45db-4408-8268-b3dbd5617b2a" type="primary" @click="downloadModel()">导入模板</el-button>
                 <el-upload  style="display: inline-block;margin-left:8px"
                            class="upload-demo"
                            action="http://10.81.66.9:9250/ywtb/ywtbMatter_upload"