当前位置:网站首页>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 .
边栏推荐
- February 12 relativelayout
- Easy to understand I2C protocol
- Figure database ongdb release v-1.0.3
- 关于Unity Inspector上的一些常用技巧,一般用于编辑器扩展或者其他
- First acquaintance with CDN
- C Advanced - data storage (Part 1)
- UCF (2022 summer team competition I)
- RT thread analysis log system RT_ Kprintf analysis
- Rce code and Command Execution Vulnerability
- 01. 开发博客项目之项目介绍
猜你喜欢
Idea one key guide package
Imperial cms7.5 imitation "D9 download station" software application download website source code
Vulhub vulnerability recurrence 67_ Supervisor
Unity Vector3. Use and calculation principle of reflect
RT thread analysis - object container implementation and function
Check the useful photo lossless magnification software on Apple computer
Safe mode on Windows
图数据库ONgDB Release v-1.0.3
从0到1建设智能灰度数据体系:以vivo游戏中心为例
01. 开发博客项目之项目介绍
随机推荐
Realize a binary read-write address book
Review of double pointer problems
Postman manage test cases
[leetcode daily question] number of enclaves
Postman pre script - global variables and environment variables
Postman test report
指針經典筆試題
[QNX Hypervisor 2.2用户手册]6.3.3 使用共享内存(shmem)虚拟设备
In 2022, we must enter the big factory as soon as possible
Notes, continuation, escape and other symbols
Postman assertion
Huawei equipment is configured with OSPF and BFD linkage
Excel转换为Lua的配置文件
Golang -- TCP implements concurrency (server and client)
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
Nacos TC setup of highly available Seata (02)
SQLite queries the maximum value and returns the whole row of data
flutter 实现一个有加载动画的按钮(loadingButton)
Easy to understand I2C protocol
Fuzzy -- basic application method of AFL