当前位置:网站首页>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 .
边栏推荐
- Knowledge points of circular structure
- 毕业设计游戏商城
- JS quick start (II)
- 02. Develop data storage of blog project
- Pix2pix: image to image conversion using conditional countermeasure networks
- Oracle deletes duplicate data, leaving only one
- 03. 开发博客项目之登录
- Mysql高级篇学习总结9:创建索引、删除索引、降序索引、隐藏索引
- Using stopwatch to count code time
- C Advanced - data storage (Part 1)
猜你喜欢
[leetcode16] the sum of the nearest three numbers (double pointer)
Pix2pix: image to image conversion using conditional countermeasure networks
Codeforces Round #804 (Div. 2) Editorial(A-B)
Postman manage test cases
idea一键导包
01. 开发博客项目之项目介绍
GAMES202-WebGL中shader的编译和连接(了解向)
[effective Objective-C] - memory management
Ora-01779: the column corresponding to the non key value saving table cannot be modified
Principle and performance analysis of lepton lossless compression
随机推荐
Excel转换为Lua的配置文件
SQLite queries the maximum value and returns the whole row of data
F12 solve the problem that web pages cannot be copied
Postman manage test cases
02. 开发博客项目之数据存储
Yolov5 tensorrt acceleration
剑指 Offer II 039. 直方图最大矩形面积
Huawei od computer test question 2
指针经典笔试题
Easy to understand I2C protocol
Lepton 无损压缩原理及性能分析
01. 开发博客项目之项目介绍
Hometown 20 years later (primary school exercises)
EditorUtility. The role and application of setdirty in untiy
Imperial cms7.5 imitation "D9 download station" software application download website source code
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
Pointer classic written test questions
【云原生】3.1 Kubernetes平台安装KubeSpher
算法-- 爬楼梯(Kotlin)
C进阶-数据的存储(上)