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:
Lu Chaohai
2018-09-25 11:10:59 +08:00
3 changed files with 57 additions and 1 deletions

View File

@@ -1 +1 @@
b322c0027c15926f73f03ec142269e3512c5cc14
3c97ecdb32c4ce5031fe7b3341f49499ac9e47de

View File

@@ -4,9 +4,11 @@ export default `<template>
:columns="columns"
:data="data"
title="D2 CRUD"
add-mode
:rowHandle="rowHandle"
:form-template="formTemplate"
:form-options="formOptions"
@row-add="handleRowAdd"
@row-edit="handleRowEdit"
@dialog-cancel="handleDialogCancel"/>
</div>
@@ -92,6 +94,20 @@ export default {
address: {
title: '地址',
value: ''
},
forbidEdit: {
title: '禁用按钮',
value: false,
component: {
show: false
}
},
showEditButton: {
title: '显示按钮',
value: true,
component: {
show: false
}
}
},
formOptions: {
@@ -102,6 +118,18 @@ export default {
}
},
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) {
this.formOptions.saveLoading = true
setTimeout(() => {

View File

@@ -5,9 +5,11 @@
:columns="columns"
:data="data"
title="D2 CRUD"
add-mode
:rowHandle="rowHandle"
:form-template="formTemplate"
:form-options="formOptions"
@row-add="handleRowAdd"
@row-edit="handleRowEdit"
@dialog-cancel="handleDialogCancel">
</d2-crud>
@@ -108,6 +110,20 @@ export default {
address: {
title: '地址',
value: ''
},
forbidEdit: {
title: '禁用按钮',
value: false,
component: {
show: false
}
},
showEditButton: {
title: '显示按钮',
value: true,
component: {
show: false
}
}
},
formOptions: {
@@ -118,6 +134,18 @@ export default {
}
},
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) {
this.formOptions.saveLoading = true
setTimeout(() => {