perf: pam update

This commit is contained in:
ibuler
2024-12-02 14:24:28 +08:00
parent 2ee139c92b
commit 6fb3b552eb
4 changed files with 78 additions and 10 deletions

View File

@@ -0,0 +1,62 @@
<template>
<Dialog
:visible="iVisible"
title="Processing"
width="300"
>
<div id="load">
<div class="spinner" />
</div>
</Dialog>
</template>
<script>
import Dialog from './index.vue'
export default {
name: 'ProcessingDialog',
components: { Dialog },
props: {
visible: {
type: Boolean,
default: false
}
},
data() {
return {}
},
computed: {
iVisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
}
}
</script>
<style lang="scss" scoped>
.spinner {
width: 50px;
height: 50px;
border: 5px solid rgba(0, 0, 0, 0.1);
border-radius: 50%;
border-top-color: #3498db;
animation: spin 1s infinite linear;
}
#load {
display: flex;
justify-content: center;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<span class="conform-td">
<span v-if="iValue === 'pending'">
<span v-if="iValue === '0'">
<el-dropdown trigger="click" @command="handleRisk">
<el-button class="confirm action" size="mini">
<i class="fa fa-check" />
@@ -18,21 +18,25 @@
</el-tooltip>
</span>
<el-tooltip v-else :content="iLabel" :open-delay="400" class="platform-status">
<span v-if="iValue === 'confirmed' ">
<span v-if="iValue === '1' ">
<i class="fa fa-check color-primary" />
</span>
<span v-else>
{{ iValue }}
<svg-icon icon-class="ignore" />
</span>
</el-tooltip>
<ProcessingDialog :visible="processing" />
</span>
</template>
<script>
import BaseFormatter from './base.vue'
import ProcessingDialog from '@/components/Dialog/ProcessingDialog.vue'
export default {
name: 'ConfirmOrIgnoreFormatter',
components: { ProcessingDialog },
extends: BaseFormatter,
props: {
formatterArgsDefault: {
@@ -52,7 +56,8 @@ export default {
},
data() {
return {
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs)
formatterArgs: Object.assign(this.formatterArgsDefault, this.col.formatterArgs),
processing: false
}
},
computed: {
@@ -85,12 +90,16 @@ export default {
action: cmd,
risk: ''
}
this.processing = true
this.$axios.post(`/api/v1/accounts/account-risks/handle/`, data).then(() => {
console.log('cmd: ', cmd)
if (cmd === 'add_account') {
this.row.present = true
}
this.row.status = 'confirmed'
this.row.status = { 'value': '0' }
}).finally(() => {
setTimeout(() => {
this.processing = false
}, 500)
})
},
getActions() {

View File

@@ -39,11 +39,9 @@ export const gatherAccountTableConfig = (vm, url) => {
showOverflowTooltip: true
},
present: {
label: '已同步',
width: '120px'
},
remote_present: {
label: '远端存在',
width: '120px'
},
date_updated: {
@@ -55,7 +53,6 @@ export const gatherAccountTableConfig = (vm, url) => {
width: '150px'
},
status: {
label: vm.$t('Pending'),
formatter: DiscoverConfirmFormatter,
width: '100px',
formatterArgs: {

View File

@@ -1,6 +1,6 @@
<template>
<span>
<span v-if="iValue === 'pending'" class="risk-handler">
<span v-if="iValue === '0'" class="risk-handler">
<el-dropdown trigger="click" @command="handleRisk">
<el-button class="confirm action" size="mini">
<i class="fa fa-check" />
@@ -18,7 +18,7 @@
</el-tooltip>
</span>
<el-tooltip v-else :content="iLabel" :open-delay="400" class="platform-status">
<span v-if="iValue === 'confirmed' ">
<span v-if="iValue === '1'">
<i class="fa fa-check color-primary" />
</span>
<span v-else>