const dateType = 0
const obj = new Map([
[0, { type: 'time', format: 'HH:mm:ss', label: '时间' }],
[1, { type: 'date', format: 'yyyy-MM-dd', label: '日期' }],
[2, { type: 'datetime', format: 'yyyy-MM-dd HH:mm:ss', label: '日期时间' }]
])
field.dateType = obj.get(0)
data() {
return {
buttonKeyMap: new Map([
[1, { fn: "setNewData", label: "新增" }],
[2, { fn: "editData", label: "编辑" }],
[3, { fn: "openDetail", label: "详情" }],
[4, { fn: "exportData", label: "导出" }],
[5, { fn: "deleteData", label: "删除数据" }],
[6, { fn: "handleSubmit", label: "保存数据" }],
[7, { fn: "cancleCreate", label: "关闭弹窗" }],
]),
props: ''
};
},
methods:{
this[this.buttonKeyMap.get(2).fn].(item)
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18