Merge branch 'develop' of https://github.com/d2-projects/d2-admin into develop
Former-commit-id: 72a21b4a2dbe255bbafb047ace2b58deead9ac45 [formerly 72a21b4a2dbe255bbafb047ace2b58deead9ac45 [formerly 72a21b4a2dbe255bbafb047ace2b58deead9ac45 [formerly 72a21b4a2dbe255bbafb047ace2b58deead9ac45 [formerly 87d9e7fcbfc6082cbeaaaa8ca27fda1cdc62f21b [formerly 0e37b994bbc29bedcccad347e6fb2c1cb615eba4]]]]] Former-commit-id: 8cd9a54da3d640d0c659a769ca03a10d8c22ffbf Former-commit-id: 1a62a3e203f76b1a8b5b3d6bd6425216409bf29d Former-commit-id: ce908180ed2f364f8f025bdeace0f8c73bd5e0c4 [formerly 77a128308141d2e25d0f3d2ff23f4173d0a54228] Former-commit-id: c900d987daf7448ffdd5f3e788ef6529d3527fe1 Former-commit-id: 2d0dce3592057efaf48b55b8ff5df97f09eb4a99 Former-commit-id: d3264169085a7230a18cf277cefc9c3112626ba1 Former-commit-id: f17bed94dbe6b8bd5d402bcaa8e3b3cdf171a58f Former-commit-id: afb6e622ecaec0e5c517c34828311070c38796eb
This commit is contained in:
@@ -1 +1 @@
|
|||||||
b322c0027c15926f73f03ec142269e3512c5cc14
|
3c97ecdb32c4ce5031fe7b3341f49499ac9e47de
|
||||||
@@ -4,9 +4,11 @@ export default `<template>
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="data"
|
:data="data"
|
||||||
title="D2 CRUD"
|
title="D2 CRUD"
|
||||||
|
add-mode
|
||||||
:rowHandle="rowHandle"
|
:rowHandle="rowHandle"
|
||||||
:form-template="formTemplate"
|
:form-template="formTemplate"
|
||||||
:form-options="formOptions"
|
:form-options="formOptions"
|
||||||
|
@row-add="handleRowAdd"
|
||||||
@row-edit="handleRowEdit"
|
@row-edit="handleRowEdit"
|
||||||
@dialog-cancel="handleDialogCancel"/>
|
@dialog-cancel="handleDialogCancel"/>
|
||||||
</div>
|
</div>
|
||||||
@@ -92,6 +94,20 @@ export default {
|
|||||||
address: {
|
address: {
|
||||||
title: '地址',
|
title: '地址',
|
||||||
value: ''
|
value: ''
|
||||||
|
},
|
||||||
|
forbidEdit: {
|
||||||
|
title: '禁用按钮',
|
||||||
|
value: false,
|
||||||
|
component: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showEditButton: {
|
||||||
|
title: '显示按钮',
|
||||||
|
value: true,
|
||||||
|
component: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formOptions: {
|
formOptions: {
|
||||||
@@ -102,6 +118,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleRowAdd (row, done) {
|
||||||
|
this.formOptions.saveLoading = true
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log(row)
|
||||||
|
this.$message({
|
||||||
|
message: '保存成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
done()
|
||||||
|
this.formOptions.saveLoading = false
|
||||||
|
}, 300)
|
||||||
|
},
|
||||||
handleRowEdit ({index, row}, done) {
|
handleRowEdit ({index, row}, done) {
|
||||||
this.formOptions.saveLoading = true
|
this.formOptions.saveLoading = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="data"
|
:data="data"
|
||||||
title="D2 CRUD"
|
title="D2 CRUD"
|
||||||
|
add-mode
|
||||||
:rowHandle="rowHandle"
|
:rowHandle="rowHandle"
|
||||||
:form-template="formTemplate"
|
:form-template="formTemplate"
|
||||||
:form-options="formOptions"
|
:form-options="formOptions"
|
||||||
|
@row-add="handleRowAdd"
|
||||||
@row-edit="handleRowEdit"
|
@row-edit="handleRowEdit"
|
||||||
@dialog-cancel="handleDialogCancel">
|
@dialog-cancel="handleDialogCancel">
|
||||||
</d2-crud>
|
</d2-crud>
|
||||||
@@ -108,6 +110,20 @@ export default {
|
|||||||
address: {
|
address: {
|
||||||
title: '地址',
|
title: '地址',
|
||||||
value: ''
|
value: ''
|
||||||
|
},
|
||||||
|
forbidEdit: {
|
||||||
|
title: '禁用按钮',
|
||||||
|
value: false,
|
||||||
|
component: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showEditButton: {
|
||||||
|
title: '显示按钮',
|
||||||
|
value: true,
|
||||||
|
component: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formOptions: {
|
formOptions: {
|
||||||
@@ -118,6 +134,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleRowAdd (row, done) {
|
||||||
|
this.formOptions.saveLoading = true
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log(row)
|
||||||
|
this.$message({
|
||||||
|
message: '保存成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
done()
|
||||||
|
this.formOptions.saveLoading = false
|
||||||
|
}, 300)
|
||||||
|
},
|
||||||
handleRowEdit ({ index, row }, done) {
|
handleRowEdit ({ index, row }, done) {
|
||||||
this.formOptions.saveLoading = true
|
this.formOptions.saveLoading = true
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user