vue3
import { usePermission } from '/@/hooks/web/usePermission';
export const columns: BasicColumn[] = [
.....
.....
{
label: '',
field: '',
component: 'JDictSelectTag',
componentProps: {
dictCode: '',
},
colProps: { span: 6 },
ifShow: ({ values }) => hasPermission('123:456:789'),
},
];
export const searchFormSchema: FormSchema[] = [
.....
同上
.....
]
vue2
if (this.hasNotPerm('123:456:789')) {
this.useName = false;
this.columns = this.columns.filter((column) => column.dataIndex !== '1111');
}
参数传递
if(this.useName){
info.Func = info.id;
delete info.id;
}
export function Page(parameter,useNew) {
return axios({
url: useNew? api.oldUrl:api.newUrl,
method: 'post',
data: parameter
})
}
后台调整
<sql id="idSql">
<choose>
<when test="Func !=null and Func !=''">
func_id(id,NO) as
</when>
<when test="Func !=null and Func ==''">
func_id(id,NO) as
</when>
<otherwise>
id as
</otherwise>
</choose>
</sql>
SELECT id, ===> SELECT <include refid="idSql"/> id,