完成删除主题的功能

pull/9/head
ruibaby 6 years ago
parent 5db6073634
commit 1cc799e505

@ -32,4 +32,11 @@ themeApi.active = theme => {
}) })
} }
themeApi.delete = key => {
return service({
url: `${baseUrl}/${key}`,
method: 'delete'
})
}
export default themeApi export default themeApi

@ -26,7 +26,13 @@
<a-button type="primary" v-if="activatedTheme == theme.key" disabled>已启用</a-button> <a-button type="primary" v-if="activatedTheme == theme.key" disabled>已启用</a-button>
<a-button type="primary" @click="activeTheme(theme.key)" v-else></a-button> <a-button type="primary" @click="activeTheme(theme.key)" v-else></a-button>
<a-button @click="optionModal(theme.key)" v-if="activatedTheme == theme.key"></a-button> <a-button @click="optionModal(theme.key)" v-if="activatedTheme == theme.key"></a-button>
<a-popconfirm :title="'确定删除【'+theme.properties.name+'】主题?'" @confirm="deleteTheme(theme.key)" okText="确定" cancelText="取消" v-else> <a-popconfirm
:title="'确定删除【' + theme.properties.name + '】主题?'"
@confirm="deleteTheme(theme.key)"
okText="确定"
cancelText="取消"
v-else
>
<a-button type="dashed">删除</a-button> <a-button type="dashed">删除</a-button>
</a-popconfirm> </a-popconfirm>
</a-button-group> </a-button-group>
@ -72,8 +78,11 @@ export default {
this.loadThemes() this.loadThemes()
}) })
}, },
deleteTheme(theme) { deleteTheme(key) {
this.$message.success('删除' + theme) themeApi.delete(key).then(response => {
this.$message.success('删除成功!')
this.loadThemes()
})
} }
} }
} }

Loading…
Cancel
Save