Browse Source

fix:消毒记录不可删除

master
白凤吉 5 days ago
parent
commit
982dcc36e2
  1. 64
      src/components/audit/History.vue

64
src/components/audit/History.vue

@ -1,14 +1,14 @@
<script lang="ts" setup>
// import { useSettingStore } from '@/stores/settingStore'
import { syncSendCmd } from 'apis/system'
import { ElLoading, ElMessageBox } from 'element-plus'
import { ElLoading } from 'element-plus'
import { FtMessage } from 'libs/message'
import { useSystemStore } from 'stores/systemStore'
import { computed, onMounted, ref } from 'vue'
import { onMounted, ref } from 'vue'
import HistoryDetail from '../setting/HistoryDetail.vue'
// const settingStore = useSettingStore()
const systemStore = useSystemStore()
// const systemStore = useSystemStore()
const tableData = ref<string[]>([])
const selectedRecords = ref<Setting.History[]>([])
const visible = ref(false)
@ -61,31 +61,31 @@ const printDetail = (historyItem: Setting.History) => {
FtMessage.success('正在打印中!')
})
}
const onDelHistory = () => {
if (!selectedRecords.value.length) {
FtMessage.warning('请选择要删除的数据')
return
}
ElMessageBox.confirm('请确认是否删除?', '删除', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
const delParams = {
className: 'DisinfectionLogsService',
fnName: 'deleteReports',
params: {
logNames: selectedRecords.value.map(item => item.name),
},
}
syncSendCmd(delParams).then((res) => {
if (res.ackcode === 0) {
FtMessage.success('删除成功')
getRecord()
}
})
})
}
// const onDelHistory = () => {
// if (!selectedRecords.value.length) {
// FtMessage.warning('')
// return
// }
// ElMessageBox.confirm('?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// }).then(() => {
// const delParams = {
// className: 'DisinfectionLogsService',
// fnName: 'deleteReports',
// params: {
// logNames: selectedRecords.value.map(item => item.name),
// },
// }
// syncSendCmd(delParams).then((res) => {
// if (res.ackcode === 0) {
// FtMessage.success('')
// getRecord()
// }
// })
// })
// }
const onExportHistory = () => {
if (!selectedRecords.value.length) {
FtMessage.warning('请选择要导出的数据')
@ -124,16 +124,16 @@ const handleSelectionChange = (rows: Setting.History[]) => {
const onClose = () => {
visible.value = false
}
const deleteBtnVisible = computed(() => {
return systemStore.systemUser?.name === 'admin'
})
// const deleteBtnVisible = computed(() => {
// return systemStore.systemUser?.name === 'admin'
// })
</script>
<template>
<div>
<div class="history-export">
<bt-button type="primary" button-text="导出" @click="onExportHistory" />
<bt-button v-if="deleteBtnVisible" type="primary" button-text="删除" @click="onDelHistory" />
<!-- <bt-button v-if="deleteBtnVisible" type="primary" button-text="删除" @click="onDelHistory" /> -->
</div>
<div class="history-table">
<el-table :data="tableData" style="width: 100%" height="100%" @selection-change="handleSelectionChange">

Loading…
Cancel
Save