1
This commit is contained in:
@@ -45,6 +45,16 @@
|
||||
v-hasPermi="['jarvis:wecom:inboundTrace:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-delete-solid"
|
||||
size="mini"
|
||||
@click="openCleanDialog"
|
||||
v-hasPermi="['jarvis:wecom:inboundTrace:remove']"
|
||||
>清空测试数据</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" border @selection-change="handleSelectionChange">
|
||||
@@ -91,6 +101,19 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog title="清空测试数据" :visible.sync="cleanOpen" width="520px" append-to-body @close="resetCleanForm">
|
||||
<p style="color:#E6A23C;margin:0 0 12px 0;">将按下方勾选删除数据,生产环境请谨慎操作。</p>
|
||||
<el-checkbox v-model="cleanOptions.clearTraceTable">消息追踪表(wecom_inbound_trace 全部行)</el-checkbox>
|
||||
<br><br>
|
||||
<el-checkbox v-model="cleanOptions.clearWecomSessions">企微多轮会话 Redis(interaction_state:wecom:*)</el-checkbox>
|
||||
<br><br>
|
||||
<el-checkbox v-model="cleanOptions.clearAdhocQueue">分享链待扫描队列(logistics:adhoc:pending:queue)</el-checkbox>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cleanOpen = false">取 消</el-button>
|
||||
<el-button type="danger" @click="submitClean">确 定清理</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="消息详情" :visible.sync="detailOpen" width="720px" append-to-body>
|
||||
<el-descriptions :column="1" border size="small" v-if="detail">
|
||||
<el-descriptions-item label="MsgId">{{ detail.msgId || '—' }}</el-descriptions-item>
|
||||
@@ -115,7 +138,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listWecomInboundTrace, delWecomInboundTrace, getWecomInboundTrace } from '@/api/jarvis/wecomInboundTrace'
|
||||
import { listWecomInboundTrace, delWecomInboundTrace, getWecomInboundTrace, cleanWecomInboundTraceTestData } from '@/api/jarvis/wecomInboundTrace'
|
||||
|
||||
export default {
|
||||
name: 'WecomInboundTrace',
|
||||
@@ -130,6 +153,12 @@ export default {
|
||||
dateRange: [],
|
||||
detailOpen: false,
|
||||
detail: null,
|
||||
cleanOpen: false,
|
||||
cleanOptions: {
|
||||
clearTraceTable: true,
|
||||
clearWecomSessions: true,
|
||||
clearAdhocQueue: true
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
@@ -184,6 +213,35 @@ export default {
|
||||
this.detail = res.data
|
||||
this.detailOpen = true
|
||||
})
|
||||
},
|
||||
openCleanDialog() {
|
||||
this.resetCleanForm()
|
||||
this.cleanOpen = true
|
||||
},
|
||||
resetCleanForm() {
|
||||
this.cleanOptions = {
|
||||
clearTraceTable: true,
|
||||
clearWecomSessions: true,
|
||||
clearAdhocQueue: true
|
||||
}
|
||||
},
|
||||
submitClean() {
|
||||
if (!this.cleanOptions.clearTraceTable && !this.cleanOptions.clearWecomSessions && !this.cleanOptions.clearAdhocQueue) {
|
||||
this.$modal.msgWarning('请至少勾选一项')
|
||||
return
|
||||
}
|
||||
this.$modal.confirm('确认按勾选项清理测试数据?此操作不可恢复。').then(() => {
|
||||
return cleanWecomInboundTraceTestData(this.cleanOptions)
|
||||
}).then(res => {
|
||||
this.cleanOpen = false
|
||||
this.getList()
|
||||
const d = res.data || {}
|
||||
const parts = []
|
||||
if (d.traceRowsDeleted != null) parts.push('追踪表删除 ' + d.traceRowsDeleted + ' 行')
|
||||
if (d.wecomSessionKeysDeleted != null) parts.push('会话键 ' + d.wecomSessionKeysDeleted + ' 个')
|
||||
if (d.adhocQueueCleared) parts.push('adhoc 队列已删')
|
||||
this.$modal.msgSuccess(parts.length ? parts.join(';') : '已执行')
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user