Browse Source

粉尘 色谱仪 束管根据文件名称查询

bobo04052021@163.com 3 months ago
parent
commit
4089c06356

+ 2 - 0
src/views/vent/bundle/bundleMonitorTable/bundle-table.api.ts

@@ -2,9 +2,11 @@ import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
   getBundleInfo = '/ventanaly-device/safety/reportLocalData/queryReportData',
+  getFileList = '/ventanaly-device/safety/reportLocalData/list',
 }
 /**
  *
  * @param params
  */
 export const getBundleInfoList = (params) => defHttp.post({ url: Api.getBundleInfo, params });
+export const getAllFileList = (params) => defHttp.get({ url: Api.getFileList, params });

+ 58 - 10
src/views/vent/bundle/bundleMonitorTable/index.vue

@@ -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%;

+ 2 - 0
src/views/vent/bundleSpy/bundleSpyTable/bundleSpy-table.api.ts

@@ -2,9 +2,11 @@ import { defHttp } from '/@/utils/http/axios';
 
 enum Api {
   getbunudleSpyInfo = '/ventanaly-device/safety/reportLocalData/queryReportData',
+  getFileList = '/ventanaly-device/safety/reportLocalData/list',
 }
 /**
  *
  * @param params
  */
 export const getbundleSpyInfoList = (params) => defHttp.post({ url: Api.getbunudleSpyInfo, params });
+export const getAllFileList = (params) => defHttp.get({ url: Api.getFileList, params });

+ 54 - 6
src/views/vent/bundleSpy/bundleSpyTable/index.vue

@@ -1,33 +1,81 @@
 <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"> </a-table>
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted } from 'vue';
+import { ref, onMounted, reactive } from 'vue';
 import { columns } from './bundleSpy-table.data';
-import { getbundleSpyInfoList } from './bundleSpy-table.api';
+import { getbundleSpyInfoList, getAllFileList } from './bundleSpy-table.api';
 import customHeader from '/@/components/vent/customHeader.vue';
+let selectList = ref<any[]>([]);
 
+let formSearch = reactive({
+  pageNum: 1,
+  pageSize: 1000,
+  fileId: '',
+  fileName: '',
+});
 let tableData = ref<any[]>([]);
-
-async function getTableList() {
-  let res = await getbundleSpyInfoList({ type: 'bundleSpy' });
+//获取色谱仪报表
+async function getTableList(params: any) {
+  let res = await getbundleSpyInfoList({ type: 'bundleSpy', ...params });
   const content = res.content;
   let contentArr = JSON.parse(content);
   tableData.value = contentArr;
 }
 
+//获取所有文件列表
+async function getAllFile() {
+  let res = await getAllFileList({ type: 'bundleSpy' });
+  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: 'bundleSpy' });
+  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%;

+ 0 - 8
src/views/vent/dust/dustMonitorTable/index.vue

@@ -60,14 +60,6 @@ onMounted(() => {
 <style lang="less" scoped>
 @import '/@/design/theme.less';
 
-.dustMonitor {
-  width: 100%;
-  height: 100%;
-  padding: 80px 10px 15px 10px;
-  box-sizing: border-box;
-  position: relative;
-}
-
 .select-container {
   display: flex;
   align-items: center;