|
|
@@ -1,17 +1,52 @@
|
|
|
<!-- 会员机构管理-机构管理-风控个性化设置-删除 -->
|
|
|
<template>
|
|
|
- <app-drawer title="删除" width="900" v-model:show="show" :loading="loading" :refresh="refresh">
|
|
|
+ <app-drawer :title="t('common.alert')" v-model:show="show" :loading="loading" :refresh="refresh">
|
|
|
+ <div class="g-text-message">确认删除该配置?</div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit">{{ t('operation.confirm') }}</el-button>
|
|
|
+ </template>
|
|
|
</app-drawer>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, PropType, defineAsyncComponent } from 'vue'
|
|
|
-import { i18n } from '@/stores'
|
|
|
+import { shallowRef, PropType } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { deleteAccountRiskConfig } from '@/services/api/member'
|
|
|
import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
+import { i18n } from '@/stores'
|
|
|
|
|
|
-const { global: { t } } = i18n
|
|
|
+const props = defineProps({
|
|
|
+ record: {
|
|
|
+ type: Object as PropType<Model.AccountRiskConfigRsp>,
|
|
|
+ required: true
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
+const { global: { t } } = i18n
|
|
|
const show = shallowRef(true)
|
|
|
const refresh = shallowRef(false)
|
|
|
const loading = shallowRef(false)
|
|
|
+
|
|
|
+const onCancel = (isRefresh = false) => {
|
|
|
+ show.value = false
|
|
|
+ refresh.value = isRefresh
|
|
|
+}
|
|
|
+
|
|
|
+const onSubmit = () => {
|
|
|
+ loading.value = true
|
|
|
+ deleteAccountRiskConfig({
|
|
|
+ data: {
|
|
|
+ accountid: props.record.accountid
|
|
|
+ }
|
|
|
+ }).then(() => {
|
|
|
+ ElMessage.success(t('common.tips5'))
|
|
|
+ onCancel(true)
|
|
|
+ }).catch((err) => {
|
|
|
+ ElMessage.error(t('common.tips6') + err)
|
|
|
+ onCancel()
|
|
|
+ }).finally(() => {
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|