|
@@ -1,6 +1,13 @@
|
|
|
<template>
|
|
|
<div class="dustMonitor">
|
|
|
<customHeader>束管日报分析</customHeader>
|
|
|
+ <div class="select-container">
|
|
|
+ <span class="select-label">选择文件:</span>
|
|
|
+ <a-select v-model:value="formSearch.fileId" style="width: 220px" size="small" placeholder="请选择...">
|
|
|
+ <a-select-option v-for="item in selectList" :key="item.fileId">{{ item.fileName }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <a-button type="primary" style="margin-left: 10px" @click="getSearch">查询</a-button>
|
|
|
+ </div>
|
|
|
<a-table :columns="columns" :data-source="tableData" size="small" :scroll="{ y: 500 }" class="tableW">
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.dataIndex === 'action'">
|
|
@@ -15,36 +22,77 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, onMounted, shallowRef } from 'vue';
|
|
|
+import { ref, onMounted, shallowRef, reactive } from 'vue';
|
|
|
import { columns } from './bundle-table.data';
|
|
|
-import { getBundleInfoList } from './bundle-table.api';
|
|
|
+import { getBundleInfoList, getAllFileList } from './bundle-table.api';
|
|
|
import customHeader from '/@/components/vent/customHeader.vue';
|
|
|
// import { blastDelta } from './modal/blastDelta.vue';
|
|
|
import blastDelta from './modal/blastDelta.vue';
|
|
|
-
|
|
|
+let selectList = ref<any[]>([]);
|
|
|
+let formSearch = reactive({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 1000,
|
|
|
+ fileId: '',
|
|
|
+ fileName: '',
|
|
|
+});
|
|
|
let tableData = ref<any[]>([]);
|
|
|
let modalVisible = ref(false);
|
|
|
const posMonitor = shallowRef({});
|
|
|
-async function getTableList() {
|
|
|
- let res = await getBundleInfoList({ type: 'bundle' });
|
|
|
+
|
|
|
+function toDetail(record: any) {
|
|
|
+ posMonitor.value = record;
|
|
|
+ modalVisible.value = true;
|
|
|
+}
|
|
|
+
|
|
|
+//获取色谱仪报表
|
|
|
+async function getTableList(params: any) {
|
|
|
+ let res = await getBundleInfoList({ type: 'bundle', ...params });
|
|
|
const content = res.content;
|
|
|
let contentArr = JSON.parse(content);
|
|
|
tableData.value = contentArr;
|
|
|
}
|
|
|
|
|
|
-function toDetail(record: any) {
|
|
|
- posMonitor.value = record;
|
|
|
- console.log(posMonitor.value, 'posMonitor');
|
|
|
- modalVisible.value = true;
|
|
|
+//获取所有文件列表
|
|
|
+async function getAllFile() {
|
|
|
+ let res = await getAllFileList({ type: 'bundle' });
|
|
|
+ selectList.value = res.records.map((item: any) => ({
|
|
|
+ fileId: item.fileId,
|
|
|
+ fileName: item.fileName,
|
|
|
+ }));
|
|
|
+}
|
|
|
+//查询
|
|
|
+function getSearch() {
|
|
|
+ const selectedFile = selectList.value.find((item) => item.fileId === formSearch.fileId);
|
|
|
+ const params = {
|
|
|
+ fileId: formSearch.fileId,
|
|
|
+ fileName: selectedFile ? selectedFile.fileName : '',
|
|
|
+ };
|
|
|
+ getTableList(params);
|
|
|
}
|
|
|
onMounted(() => {
|
|
|
- getTableList();
|
|
|
+ getTableList({ type: 'bundle' });
|
|
|
+ getAllFile();
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
@import '/@/design/theme.less';
|
|
|
|
|
|
+.select-container {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.select-label {
|
|
|
+ margin-right: 10px;
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+
|
|
|
+.action-link {
|
|
|
+ color: #1890ff;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
.dustMonitor {
|
|
|
width: 100%;
|
|
|
height: 100%;
|