当前位置:网站首页>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 .
边栏推荐
- Leetcode dynamic planning day 16
- Modbus协议通信异常
- 2022 half year summary
- A little knowledge of CPU, disk and memory
- Vulhub vulnerability recurrence 71_ Unomi
- Mongodb basic knowledge summary
- Collection + interview questions
- [classic example] binary tree recursive structure classic topic collection @ binary tree
- February 12 relativelayout
- RT thread analysis log system RT_ Kprintf analysis
猜你喜欢

idea一键导包

Postman manage test cases

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

Idea one key guide package

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

Vulhub vulnerability recurrence 69_ Tiki Wiki

Imperial cms7.5 imitation "D9 download station" software application download website source code

Simple understanding of interpreters and compilers

pix2pix:使用条件对抗网络的图像到图像转换

毕业设计游戏商城
随机推荐
js Array 列表 实战使用总结
Oracle deletes duplicate data, leaving only one
[leetcode] 18. Sum of four numbers
Biscuits (examination version)
F12 solve the problem that web pages cannot be copied
【OSPF 和 ISIS 在多路访问网络中对掩码的要求】
01. 开发博客项目之项目介绍
Vulhub vulnerability recurrence 68_ ThinkPHP
C# AES对字符串进行加密
[noip2008 improvement group] stupid monkey
Yolov5 tensorrt acceleration
Nacos - TC Construction of High available seata (02)
Easy to understand I2C protocol
指針經典筆試題
Sword finger offer II 039 Maximum rectangular area of histogram
UCF(暑期团队赛二)
Oracle query table index, unique constraint, field
February 12 relativelayout
2022半年总结
05. 博客项目之安全