首页 > 其他 > 详细

vue随笔

时间:2019-10-22 21:42:30      阅读:63      评论:0      收藏:0      [点我收藏+]

需要根据某个条件判断改变表格显示时,根据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, width: 150 }, { name: "执行时间", index: "execute_time", edit: true, width: 200 }, { name: "结束时间", index: "execute_end_time", width: 200 }, { name: "来源", index: "source_cn", width: 130 }, { name: "创建人", index: "realname", width: 130, edit: true }, { name: "审核人", index: "verify_user_real_name", width: 110, edit: true }, { name: "创建时间", index: "create_time", width: 200 } ]; if (this.isZHAdmin()) { cols.splice(0, 0, { name: "工单号", index: "boss_id", slot: "boss_id", edit: true, width: 150 }); } else { cols.splice(0, 0, { name: "总行工单号", index: "boss_id", slot: "boss_id", edit: true, width: 150 }); cols.splice(0, 0, { name: "BHC工单号", index: "bf_id", slot: "bf_id", edit: true, width: 150 }); cols.splice(0, 0, { name: "工单号", index: "wo_id", slot: "wo_id", width: 150 }); } return cols; }, isZHAdmin() { return this.loginUser.roleName == "总行用户"; },

 

vue随笔

原文:https://www.cnblogs.com/qcq0703/p/11722319.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!