当前位置:网站首页>改善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来传递。
边栏推荐
- Huawei equipment is configured with OSPF and BFD linkage
- Postman Association
- 毕业设计游戏商城
- Lepton 无损压缩原理及性能分析
- JS quick start (II)
- Talking about the type and function of lens filter
- Steady, 35K, byte business data analysis post
- Implementing fuzzy query with dataframe
- Acwing week 58
- [classic example] binary tree recursive structure classic topic collection @ binary tree
猜你喜欢

GAMES202-WebGL中shader的编译和连接(了解向)

F12 solve the problem that web pages cannot be copied

Graduation design game mall

Lepton 无损压缩原理及性能分析

毕业设计游戏商城

flutter 实现一个有加载动画的按钮(loadingButton)

Unity Vector3. Use and calculation principle of reflect
![[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

Talking about the type and function of lens filter

Vulhub vulnerability recurrence 69_ Tiki Wiki
随机推荐
Cuda11.1 online installation
Can the feelings of Xi'an version of "Coca Cola" and Bingfeng beverage rush for IPO continue?
關於Unity Inspector上的一些常用技巧,一般用於編輯器擴展或者其他
Huawei equipment is configured with OSPF and BFD linkage
Tetris
SQLite add index
HAC集群修改管理员用户密码
Extension of graph theory
01. 开发博客项目之项目介绍
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
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
nacos-高可用seata之TC搭建(02)
C进阶-数据的存储(上)
Three methods of Oracle two table Association update
Unity gets the width and height of Sprite
Notes, continuation, escape and other symbols
C# AES对字符串进行加密
Steady, 35K, byte business data analysis post
Pointer classic written test questions
Some common skills on unity inspector are generally used for editor extension or others