|
|
@@ -13,6 +13,7 @@ import type { ReportBasic } from "@/types/report.types"
|
|
|
import { routeToReportEditor } from "@/router";
|
|
|
import SpinComponent from "@/components/SpinComponent.vue";
|
|
|
import TemplateSelect from "./components/TemplateSelect.vue";
|
|
|
+import { message } from "ant-design-vue";
|
|
|
|
|
|
const _componentName = 'ReportListView'
|
|
|
const logError = CompLog.logErr(_componentName)
|
|
|
@@ -116,6 +117,20 @@ function onFilterChange() {
|
|
|
fetchReports(companyIdSelected.value, currentPage.value)
|
|
|
}
|
|
|
|
|
|
+function onReportDelete(id: number) {
|
|
|
+ console.log('report id', id);
|
|
|
+ reportService.remove(id).then((ok) => {
|
|
|
+ if (ok) {
|
|
|
+ message.success('删除报告成功')
|
|
|
+ fetchReports()
|
|
|
+ } else {
|
|
|
+ message.success('删除报告失败')
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ message.success('删除报告失败')
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
fetchReports()
|
|
|
// 左侧企业名录统计
|
|
|
@@ -144,7 +159,7 @@ onMounted(() => {
|
|
|
<div class="filter-box-wrap">
|
|
|
<a-radio-group :options="reportStatus" v-model:value="status" @change="onFilterChange()"/>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<a-row class="main-content" :gutter="24">
|
|
|
<a-col :xxl="5" :xl="6" :lg="7" :span="8" class="company-filter-wrap">
|
|
|
<h3>我所服务的企业</h3>
|
|
|
@@ -152,7 +167,13 @@ onMounted(() => {
|
|
|
</a-col>
|
|
|
<a-col :xxl="19" :xl="18" :lg="17" :span="16">
|
|
|
<SpinComponent :spinning="spinning">
|
|
|
- <ReportItem v-for="(report, index) in reports" :data="report" :key="index" class="report-item" />
|
|
|
+ <ReportItem
|
|
|
+ v-for="(report, index) in reports"
|
|
|
+ :data="report"
|
|
|
+ :key="index"
|
|
|
+ class="report-item"
|
|
|
+ @delete="onReportDelete"
|
|
|
+ />
|
|
|
</SpinComponent>
|
|
|
</a-col>
|
|
|
</a-row>
|