|
|
@@ -28,6 +28,7 @@
|
|
|
<ElButton @click="onEdit(row)" type="primary">编辑</ElButton>
|
|
|
<ElButton v-if="row.status === 'created'" @click="onInit(row)" type="primary">初始化</ElButton>
|
|
|
<ElButton v-if="row.status !== 'created'" @click="onPlay(row)" type="primary">详情</ElButton>
|
|
|
+ <ElButton v-if="row.status !== 'created'" @click="reset(row)" type="warning">重置</ElButton>
|
|
|
<ElButton @click="onDelete(row)" type="danger">删除</ElButton>
|
|
|
</template>
|
|
|
</ElTableColumn>
|
|
|
@@ -280,6 +281,29 @@ async function onActiveChange(e, row) {
|
|
|
}
|
|
|
loadingInstance.close()
|
|
|
}
|
|
|
+async function reset(row) {
|
|
|
+ ElMessageBox.confirm('确认重置?', '重置', {
|
|
|
+ type: 'warning',
|
|
|
+ beforeClose: (action, instance, done) => {
|
|
|
+ if (action === 'confirm') {
|
|
|
+ instance.confirmButtonLoading = true
|
|
|
+ instance.confirmButtonText = '执行中...'
|
|
|
+ http.post(`/game/${row.id}/reset`)
|
|
|
+ .then(() => {
|
|
|
+ ElMessage.success('重置成功')
|
|
|
+ table.value.refresh()
|
|
|
+ done()
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ ElMessage.error(error.message)
|
|
|
+ done()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ done()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
.charactor-form {
|