|
@@ -86,7 +86,7 @@ export default {
|
|
|
// 获取操作记录的主键字段
|
|
|
operationRecordkey: {
|
|
|
type: String,
|
|
|
- default: 'id'
|
|
|
+ default: ''
|
|
|
},
|
|
|
// 操作按钮单元格宽度
|
|
|
operationColumnWidth: {
|
|
@@ -97,6 +97,10 @@ export default {
|
|
|
cstomClumn: {
|
|
|
type: Function
|
|
|
},
|
|
|
+ // 结构数据钩子
|
|
|
+ fieldBeansHook: {
|
|
|
+ type: Function
|
|
|
+ },
|
|
|
// 菜单名称
|
|
|
customModuleName: {
|
|
|
type: String,
|
|
@@ -135,7 +139,8 @@ export default {
|
|
|
columnList: [],
|
|
|
showTable: false,
|
|
|
codeGather: {},
|
|
|
- frontCodes: []
|
|
|
+ frontCodes: [],
|
|
|
+ pk: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -164,7 +169,7 @@ export default {
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
onClick={() => {
|
|
|
- console.log(row[this.operationRecordkey])
|
|
|
+ console.log(row[this.operationRecordkey || this.pk || 'id'])
|
|
|
}}
|
|
|
>
|
|
|
操作记录
|
|
@@ -228,7 +233,13 @@ export default {
|
|
|
this.showTable = true
|
|
|
})
|
|
|
}
|
|
|
+ if (this.fieldBeansHook) {
|
|
|
+ res.fieldBeans = this.fieldBeansHook(res.fieldBeans) || res.fieldBeans
|
|
|
+ }
|
|
|
for (var item of res.fieldBeans) {
|
|
|
+ if (item.pk) {
|
|
|
+ this.pk = item.colName
|
|
|
+ }
|
|
|
if (item.frontCode && !~this.frontCodes.indexOf(item.frontCode)) {
|
|
|
this.frontCodes.push(item.frontCode)
|
|
|
}
|