当前位置:网站首页>改善Jpopup以实现动态控制disable
改善Jpopup以实现动态控制disable
2022-07-06 05:18:00 【OK_boom】
Jeecg的Jpopup的disabled属性写死了要boolean类型,所以打它的主意是不行的,所以需要增加一个function类型的参数又实时确定状态
修改Jpopup.vue
- 增加props
在props增加三个属性:
getDisabled:{
type: Function
},
row:{
type: Object
},
column:{
type:Object
}
- 增加computed
/** * 增加computeDisabled,优先考虑getDisabled参数 * @returns {*} */
computeDisabled(){
return typeof this.getDisabled=='function'? this.getDisabled(this.row,this.column,this):this.disabled
}
- 调用
将原disabled='disabled’改为disabled=“computeDisabled”
<a-input @click="openModal" :placeholder="placeholder" v-model="showText" readOnly :disabled="computeDisabled">
修改JVxePopupCell.vue
修改popupProps,加上row,column的传递
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
}
}
应用
在jvxetable的具popup类型的column的定义可以这样应用:
{
title: '物料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: '请输入${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}不能为空' }],
}
因为column的props发展会悉数传给Jpopup,所以在这里加入getDisabled与之对接,getDisabled具3个参数。又因为getDisabled里面还要根据当前vue对象的type作为条件判断,所以亦是利用props新开formType来传递。
边栏推荐
- pix2pix:使用条件对抗网络的图像到图像转换
- Oracle deletes duplicate data, leaving only one
- Nacos - TC Construction of High available seata (02)
- 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
- 集合详解之 Map + 面试题
- 驱动开发——HelloWDM驱动
- UCF(暑期团队赛二)
- Cuda11.1 online installation
- What are the advantages of the industry private network over the public network? What specific requirements can be met?
- Postman manage test cases
猜你喜欢

Steady, 35K, byte business data analysis post

CUDA11.1在线安装

Talking about the type and function of lens filter

注释、接续、转义等符号
![[classic example] binary tree recursive structure classic topic collection @ binary tree](/img/39/0319c4be43716f927b9d98d89f7655.jpg)
[classic example] binary tree recursive structure classic topic collection @ binary tree

Ora-01779: the column corresponding to the non key value saving table cannot be modified

Modbus协议通信异常

Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example

RT thread analysis - object container implementation and function

GAMES202-WebGL中shader的编译和连接(了解向)
随机推荐
Solution of QT TCP packet sticking
Codeforces Round #804 (Div. 2) Editorial(A-B)
Acwing week 58
Force buckle 1189 Maximum number of "balloons"
Extension of graph theory
Leetcode dynamic planning day 16
Safe mode on Windows
Microblogging hot search stock selection strategy
Knowledge points of circular structure
MySQL time processing
SQLite queries the maximum value and returns the whole row of data
CUDA11.1在线安装
Realize a binary read-write address book
Compilation et connexion de shader dans games202 - webgl (comprendre la direction)
Principle and performance analysis of lepton lossless compression
[mask requirements of OSPF and Isis in multi access network]
Unity Vector3. Use and calculation principle of reflect
Simple understanding of interpreters and compilers
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
Figure database ongdb release v-1.0.3