zoukankan      html  css  js  c++  java
  • vue随笔

    需要根据某个条件判断改变表格显示时,根据isZHAdmin进行判断。

    
    
    <el-table-column
                  v-for="col in getTableColsByUser()"
                  align="center"
                  :key="col.index"
                  :prop="col.index"
                  :min-width="col.width"
                  :label="col.name"
                >
                  <template slot-scope="scope">{{scope.row[col.index]}}</template>
                </el-table-column>

    getTableColsByUser() { let cols
    = [ { name: "工单名称", index: "wo_name", slot: "wo_name", edit: true, 150 }, { name: "执行时间", index: "execute_time", edit: true, 200 }, { name: "结束时间", index: "execute_end_time", 200 }, { name: "来源", index: "source_cn", 130 }, { name: "创建人", index: "realname", 130, edit: true }, { name: "审核人", index: "verify_user_real_name", 110, edit: true }, { name: "创建时间", index: "create_time", 200 } ]; if (this.isZHAdmin()) { cols.splice(0, 0, { name: "工单号", index: "boss_id", slot: "boss_id", edit: true, 150 }); } else { cols.splice(0, 0, { name: "总行工单号", index: "boss_id", slot: "boss_id", edit: true, 150 }); cols.splice(0, 0, { name: "BHC工单号", index: "bf_id", slot: "bf_id", edit: true, 150 }); cols.splice(0, 0, { name: "工单号", index: "wo_id", slot: "wo_id", 150 }); } return cols; }, isZHAdmin() { return this.loginUser.roleName == "总行用户"; },
  • 相关阅读:
    《c程序设计语言》读书笔记--大写转小写
    《c程序设计语言》读书笔记--字符串比较
    《c程序设计语言》读书笔记--反转字符串
    spring接收json字符串的两种方式
    logback的使用
    初识Vim
    Chrome控制台
    构造有层次的大纲
    让chrome浏览器快的不要不要的
    排序算法Java版
  • 原文地址:https://www.cnblogs.com/qcq0703/p/11722319.html
Copyright © 2011-2022 走看看