当前位置:网站首页>Improve jpopup to realize dynamic control disable
Improve jpopup to realize dynamic control disable
2022-07-06 05:22:00 【OK_ boom】
Jeecg Of Jpopup Of disabled The attribute is written to death boolean type , So the idea of playing it is not good , So we need to add one function Type parameters determine the state in real time
modify Jpopup.vue
- increase props
stay props Add three attributes :
getDisabled:{
type: Function
},
row:{
type: Object
},
column:{
type:Object
}
- increase computed
/** * increase computeDisabled, Give priority to getDisabled Parameters * @returns {*} */
computeDisabled(){
return typeof this.getDisabled=='function'? this.getDisabled(this.row,this.column,this):this.disabled
}
- call
The original disabled='disabled’ Change it to disabled=“computeDisabled”
<a-input @click="openModal" :placeholder="placeholder" v-model="showText" readOnly :disabled="computeDisabled">
modify JVxePopupCell.vue
modify popupProps, add row,column The transfer
popupProps() {
const {innerValue, originColumn: col, caseId, cellProps,row} = this
return {
...cellProps,
value: innerValue,
field: col.field || col.key,
code: col.popupCode,
orgFields: col.orgFields,
destFields: col.destFields,
groupId: caseId,
param: col.param,
sorter: col.sorter,
row: row,
column:col
}
}
application
stay jvxetable The tools popup Type of column The definition of can be applied in this way :
{
title: ' materiel SQ',
key: 'prodSeq',
type: JVXETypes.popup,
fixed: 'left',
popupCode:"getProds",
field:"prod_seq",
orgFields:"id,prod_name,prod_seq,spec,fukuang,mazhong,unit",
destFields:"prodId,prodName,prodSeq,productInfo.spec,productInfo.fukuang,productInfo.mazhong,productInfo.unit",
width:"150px",
placeholder: ' Please enter ${title}',
defaultValue:'',
param: {
prod_cat:'B04A01'},
props:{
formType:this.type,
getDisabled: (row,column,ref)=>{
return !(!!row['clone']||ref.$attrs.formType=='edit')}
},
validateRules: [{
required: true, message: '${title} Can't be empty ' }],
}
because column Of props Development will be passed on to Jpopup, So join here getDisabled Connect with it ,getDisabled have 3 Parameters . Again because getDisabled It should also be based on the current vue Object's type To judge as a condition , Therefore, it is also the use of props The opening of new formType To pass on .
边栏推荐
- 用StopWatch 统计代码耗时
- Drive development - the first helloddk
- 【华为机试真题详解】统计射击比赛成绩
- [effective Objective-C] - memory management
- 剑指 Offer II 039. 直方图最大矩形面积
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- MySQL advanced learning summary 9: create index, delete index, descending index, and hide index
- Questions d'examen écrit classiques du pointeur
- In 2022, we must enter the big factory as soon as possible
- C# AES对字符串进行加密
猜你喜欢
随机推荐
【OSPF 和 ISIS 在多路访问网络中对掩码的要求】
Idea one key guide package
【华为机试真题详解】检查是否存在满足条件的数字组合
[mask requirements of OSPF and Isis in multi access network]
04. Project blog log
nacos-高可用seata之TC搭建(02)
Codeforces Round #804 (Div. 2) Editorial(A-B)
Pagoda configuration mongodb
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Mysql高级篇学习总结9:创建索引、删除索引、降序索引、隐藏索引
Easy to understand I2C protocol
pix2pix:使用条件对抗网络的图像到图像转换
Quelques conseils communs sur l'inspecteur de l'unit é, généralement pour les extensions d'éditeur ou d'autres
Jvxetable用slot植入j-popup
剑指 Offer II 039. 直方图最大矩形面积
[QNX Hypervisor 2.2用户手册]6.3.3 使用共享内存(shmem)虚拟设备
Vulhub vulnerability recurrence 71_ Unomi
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Hometown 20 years later (primary school exercises)
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example