|
@ -57,6 +57,53 @@ export const tableMixins = { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 主表-右侧操作列基础按钮
|
|
|
|
|
|
buttonOperationList_rightBase(data){ |
|
|
|
|
|
return [{ |
|
|
|
|
|
label:'编辑', |
|
|
|
|
|
name:'edit', |
|
|
|
|
|
},{ |
|
|
|
|
|
label:'删除', |
|
|
|
|
|
name:'delete', |
|
|
|
|
|
color:'red' |
|
|
|
|
|
}] |
|
|
|
|
|
}, |
|
|
|
|
|
// 主表-右侧操作列基础按钮操作
|
|
|
|
|
|
buttonOperationClick_right(row,item){ |
|
|
|
|
|
// 编辑
|
|
|
|
|
|
if (item.name == "edit") { |
|
|
|
|
|
this.formTitle = this.$route.meta.title + "编辑"; |
|
|
|
|
|
this.formReveal = false |
|
|
|
|
|
this.theEvent = "edit" |
|
|
|
|
|
const listAssign = (arr1, arr2) => { |
|
|
|
|
|
Object.keys(arr1).forEach(item => { |
|
|
|
|
|
arr1[item] = arr2[item] |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
listAssign(this.editFormData, row) |
|
|
|
|
|
this.displayDialog.editDialog = true |
|
|
|
|
|
} |
|
|
|
|
|
// 删除
|
|
|
|
|
|
else if (item.name == "delete"){ |
|
|
|
|
|
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
this.Loading.tableLoading = true |
|
|
|
|
|
let _url = this.URLOption_delete ? this.URLOption_delete : this.URLOption_base + '/delete-by-id' |
|
|
|
|
|
postDelete(row.id, _url).then(res => { |
|
|
|
|
|
this.$successMsg('删除成功!') |
|
|
|
|
|
this.Loading.tableLoading = false |
|
|
|
|
|
this.paging() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
this.Loading.tableLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.Loading.tableLoading = false |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
|
|
|
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
|
|
|
// initApiColumns(table,des,detailsTable,detailsPage){
|
|
|
// initApiColumns(table,des,detailsTable,detailsPage){
|
|
|
// // 赋值表头数据
|
|
|
// // 赋值表头数据
|
|
|