【专项任务】大连项目反馈行编辑问题处理 升级步骤 1.src/components/jeecg/JVxeTable/components/cells/JVxeSelectCell.vue 替换下面方法: ~~~ /** 用于搜索下拉框中的内容 */ handleSelectFilterOption(input, option) { let {allowSearch, allowInput} = this.originColumn if (allowSearch === true || allowInput === true) { return option.componentOptions.children[0].children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 } return true }, ~~~ 2.src/components/jeecg/JVxeTable/components/JVxeTable.js - 增加import:`import { getNoAuthCols } from "@/utils/authFilter"` - 增加props: ~~~ authPre: { type: String, required: false, default: '' }, ~~~ - 增加data: ~~~ //配置了但是没有授权的按钮和列 集合 excludeCode:[] ~~~ - 增加method: ~~~ loadExcludeCode(){ if(!this.authPre || this.authPre.length==0){ this.excludeCode = [] }else{ let pre = this.authPre if(!pre.endsWith(':')){ pre += ':' } this.excludeCode = getNoAuthCols(pre) } } ~~~ - 修改renderToolbar:`excludeCode: this.excludeCode,` ![](https://img.kancloud.cn/6f/48/6f48593f1c6b4267bdb2db7bb903d627_549x310.png) - 修改watch --> column ![](https://img.kancloud.cn/99/58/9958b6de5e991dbf1566ba1d6d94118d_656x527.png) 3.src/components/jeecg/JVxeTable/components/JVxeToolbar.vue - 增加props:`excludeCode: Array,` ![](https://img.kancloud.cn/be/7d/be7d34d57cba9312df4ea3d7b1ee33b1_399x204.png) - 修改 computed btns ~~~ btns() { let arr = this.toolbarConfig.btn || ['add', 'remove', 'clearSelection'] let exclude = [...this.excludeCode] // TODO 需要将remove替换batch_delete // 系统默认的批量删除编码配置为 batch_delete 此处需要转化一下 if(exclude.indexOf('batch_delete')>=0){ exclude.add('remove') } // 按钮权限 需要去掉不被授权的按钮 return arr.filter(item=>{ return exclude.indexOf(item)<0 }) }, ~~~ 4.src/utils/authFilter.js 修改方法 getNoAuthCols ![](https://img.kancloud.cn/77/b4/77b4c7b252ea86cf0f095b953c9634ed_714x255.png) ----- 权限配置 :参考 系统权限用法 使用: 在需要作权限控制的table上加个属性配置: ![](https://img.kancloud.cn/78/21/7821551375ba571e0ae3fb7af52ac988_799x362.png) auth-pre ,即权限配置的编码前缀 ,比如 在配置新增按钮的权限,设置编码为`jvxeauth:add` 那么此处属性auth-pre 的值为jvxeauth ![](https://img.kancloud.cn/d6/07/d607f08b9d1360174b30c7b04509125b_630x447.png)