|
@ -1,14 +1,14 @@ |
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
// import { useSettingStore } from '@/stores/settingStore' |
|
|
// import { useSettingStore } from '@/stores/settingStore' |
|
|
import { syncSendCmd } from 'apis/system' |
|
|
import { syncSendCmd } from 'apis/system' |
|
|
import { ElLoading, ElMessageBox } from 'element-plus' |
|
|
|
|
|
|
|
|
import { ElLoading } from 'element-plus' |
|
|
import { FtMessage } from 'libs/message' |
|
|
import { FtMessage } from 'libs/message' |
|
|
import { useSystemStore } from 'stores/systemStore' |
|
|
import { useSystemStore } from 'stores/systemStore' |
|
|
import { computed, onMounted, ref } from 'vue' |
|
|
|
|
|
|
|
|
import { onMounted, ref } from 'vue' |
|
|
|
|
|
|
|
|
import HistoryDetail from '../setting/HistoryDetail.vue' |
|
|
import HistoryDetail from '../setting/HistoryDetail.vue' |
|
|
// const settingStore = useSettingStore() |
|
|
// const settingStore = useSettingStore() |
|
|
const systemStore = useSystemStore() |
|
|
|
|
|
|
|
|
// const systemStore = useSystemStore() |
|
|
const tableData = ref<string[]>([]) |
|
|
const tableData = ref<string[]>([]) |
|
|
const selectedRecords = ref<Setting.History[]>([]) |
|
|
const selectedRecords = ref<Setting.History[]>([]) |
|
|
const visible = ref(false) |
|
|
const visible = ref(false) |
|
@ -61,31 +61,31 @@ const printDetail = (historyItem: Setting.History) => { |
|
|
FtMessage.success('正在打印中!') |
|
|
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 = () => { |
|
|
const onExportHistory = () => { |
|
|
if (!selectedRecords.value.length) { |
|
|
if (!selectedRecords.value.length) { |
|
|
FtMessage.warning('请选择要导出的数据') |
|
|
FtMessage.warning('请选择要导出的数据') |
|
@ -124,16 +124,16 @@ const handleSelectionChange = (rows: Setting.History[]) => { |
|
|
const onClose = () => { |
|
|
const onClose = () => { |
|
|
visible.value = false |
|
|
visible.value = false |
|
|
} |
|
|
} |
|
|
const deleteBtnVisible = computed(() => { |
|
|
|
|
|
return systemStore.systemUser?.name === 'admin' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// const deleteBtnVisible = computed(() => { |
|
|
|
|
|
// return systemStore.systemUser?.name === 'admin' |
|
|
|
|
|
// }) |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div class="history-export"> |
|
|
<div class="history-export"> |
|
|
<bt-button type="primary" button-text="导出" @click="onExportHistory" /> |
|
|
<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> |
|
|
<div class="history-table"> |
|
|
<div class="history-table"> |
|
|
<el-table :data="tableData" style="width: 100%" height="100%" @selection-change="handleSelectionChange"> |
|
|
<el-table :data="tableData" style="width: 100%" height="100%" @selection-change="handleSelectionChange"> |
|
|