当前位置:网站首页>Jvxetable用slot植入j-popup
Jvxetable用slot植入j-popup
2022-07-06 05:18:00 【OK_boom】
上一篇讲了如何根据当前记录确定jpopup field是否disabled(https://blog.csdn.net/rocklee/article/details/125581874?spm=1001.2014.3001.5501),这里讲一下如何利用slot插槽方式指定template为j-popup
<template #prodSeq="{row, rowIndex, $rowIndex, column}" >
<j-popup
v-model="row.prodSeq"
:code="column.popupCode"
:field="column.field"
:column="column"
:value="row[column.key]"
:renderOptions="{listeners:$listeners}"
:orgFields="column.orgFields"
:destFields="column.destFields"
:param="column.param"
:sorter="column.sorter"
:row="row"
:multi="false"
:disabled="!column.props.getDisabled(row,column)"
@input="(value,others,oldValue,row)=>updateMainMtRecord(value,others,oldValue,row,column,rowIndex)"
></j-popup>
</template>
slot里面的jpopup指定的参数
– param 浏览记录时指定的过滤参数
– row 带进去的当前记录
– disabled 动态判断是否禁用
– input 回调事件安插这个插槽
将某个字段的配置指定为slot:
{
title: '物料SQ',
key: 'prodSeq',
type: JVXETypes.slot,
slotName:'prodSeq',
fixed: 'left',
width:"150px",
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",
placeholder: '请输入${title}',
defaultValue:'',
param: {prod_cat:'B04A01'},
props:{
formType:this.type,
getDisabled: (row,column,ref)=>{return !(!!row['clone']||(this.formType||!!ref&&ref.$attrs.formType)=='edit')}
},
validateRules: [{ required: true, message: '${title}不能为空' }],
}
- Jpopup的修改
data()增加了oldValue:
data() {
return {
showText: '',
title: '',
oldValue:'',
avalid: true,
extendParam: {}
}
}
openModal() 要oldValue保存原值
openModal() {
if (this.disabled === false) {
this.oldValue=this.row[this.column.key]
this.$refs.jPopupOnlReport.show()
}
}
最后callback最后一句改为:
this.$emit('input', str, res,this.oldValue,this.row)
边栏推荐
- [leetcode daily question] number of enclaves
- Qt TCP 分包粘包的解决方法
- JS quick start (II)
- 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
- Sliding window problem review
- Class inheritance in yyds dry inventory C
- Vulhub vulnerability recurrence 68_ ThinkPHP
- 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
- ByteDance program yuan teaches you how to brush algorithm questions: I'm not afraid of the interviewer tearing the code
- Promotion hung up! The leader said it wasn't my poor skills
猜你喜欢
Postman Association
Leetcode dynamic planning day 16
Modbus协议通信异常
Compilation and connection of shader in games202 webgl (learn from)
[classic example] binary tree recursive structure classic topic collection @ binary tree
Safe mode on Windows
Pagoda configuration mongodb
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
01. 开发博客项目之项目介绍
剑指 Offer II 039. 直方图最大矩形面积
随机推荐
TCP three handshakes you need to know
初识CDN
UCF (summer team competition II)
驱动开发——第一个HelloDDK
Principle and performance analysis of lepton lossless compression
Cve-2019-11043 (PHP Remote Code Execution Vulnerability)
Promotion hung up! The leader said it wasn't my poor skills
Collection + interview questions
毕业设计游戏商城
02. 开发博客项目之数据存储
Tetris
浅谈镜头滤镜的类型及作用
Pointer classic written test questions
Sorting out the knowledge points of multicast and broadcasting
Summary of redis basic knowledge points
Modbus protocol communication exception
Nestjs配置文件上传, 配置中间件以及管道的使用
SQLite add index
[effective Objective-C] - memory management
04. 项目博客之日志