From dc9a330c08865f901f7527f98d4bcfcdf03ba93e Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 25 Nov 2024 09:35:34 +0800
Subject: [PATCH] 代码优化

---
 src/views/rt/components/box/dataContent.vue |   78 ++++++++++++--------------------------
 1 files changed, 25 insertions(+), 53 deletions(-)

diff --git a/src/views/rt/components/box/dataContent.vue b/src/views/rt/components/box/dataContent.vue
index eb93562..083443a 100644
--- a/src/views/rt/components/box/dataContent.vue
+++ b/src/views/rt/components/box/dataContent.vue
@@ -21,34 +21,20 @@
 let currentIndex = ref(0)
 // 园区 企业
 const tilteList = ref([
-  { label: "吉水化工园区", value: "0", id: "1" }
+  { label: "园区救援队伍", value: "0", id: "1" },
+  { label: "企业救援队伍", value: "0", id: "2" }
+
 ]);
 const pages = {
   page: 1,
-  pageSize: 13,
+  pageSize: 100,
   total: 0,
 };
 
 onMounted(() => {
-  getLists();
-  getCompanyPages();
+  getLists(formInline);
 });
 
-function getCompanyPages(param = {}) {
-  param.current = pages.page;
-  param.size = pages.pageSize;
-  getPage(param).then(res => {
-    let companyList = res.data.data.records
-    companyList.forEach(item => {
-      tilteList.value.push({
-        label: item.name,
-        value: item.id,
-        id: item.id
-      })
-    })
-  }).catch(err => {
-  })
-}
 
 function handleClick(item, index) {
   currentIndex.value = index
@@ -56,10 +42,8 @@
   pages.pageSize = 1000
   pages.total = 0
   if (item.id == 1) {
-    formInline.firmId = ''
     formInline.type = 1
   } else {
-    formInline.firmId = item.id
     formInline.type = 2
   }
   getLists(formInline);
@@ -78,7 +62,7 @@
 // 搜索条件
 const formInline = reactive({
   perInCha: "",
-  type: ''
+  type: '1'
 });
 
 // 提交查询
@@ -118,16 +102,7 @@
   getList(param)
     .then((res) => {
       const data = res.data.data;
-      // data.records.forEach((element) => {
-      //   if (element.type == 1) {
-      //     element.ownership = "园区";
-      //   } else {
-      //     element.ownership = "企业";
-      //   }
-      // });
       tableData.value = data.records;
-      // pages.total = data.total;
-      // loading.value = false;
     })
     .catch((err) => {
       loading.value = false;
@@ -140,21 +115,6 @@
   <public-content>
     <template #content>
       <div class="content_box">
-        <!-- <el-form :inline="true" :model="formInline" class="demo-form-inline">
-          <el-form-item label="姓名">
-            <el-input v-model="formInline.perInCha" placeholder="请输入姓名" clearable style="width: 120px" />
-          </el-form-item>
-          <el-form-item label="归属">
-            <el-select v-model="formInline.type" placeholder="请选择" clearable style="width: 120px">
-              <el-option label="园区" value="1" />
-              <el-option label="企业" value="2" />
-            </el-select>
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="onSubmit">查询</el-button>
-            <el-button type="" @click="clearBtn">重置</el-button>
-          </el-form-item>
-        </el-form> -->
 
         <div class="list_box">
           <ul>
@@ -167,12 +127,22 @@
 
         <div class="page_box">
 
-          <el-table :data="tableData" style="width: 100%" :header-cell-style="headerCellStyle"
-            :cell-style="tableCellStyle">
-            <el-table-column fixed prop="perInCha" label="责任人姓名" />
-            <el-table-column prop="perInChaPho" label="联系电话" />
+          <el-table border empty-text="" v-if="formInline.type == 1" :data="tableData" style="width: 100%"
+            :header-cell-style="headerCellStyle" :cell-style="tableCellStyle">
             <el-table-column prop="teamName" label="救援队伍组名称" />
             <el-table-column prop="teamJob" label="救援队伍组职务" />
+            <el-table-column prop="perInCha" label="责任人姓名" />
+            <el-table-column prop="job" label="园区职务" />
+            <el-table-column prop="perInChaPho" label="联系电话" />
+          </el-table>
+
+          <el-table border empty-text="" v-else :data="tableData" style="width: 100%" :header-cell-style="headerCellStyle"
+            :cell-style="tableCellStyle">
+            <el-table-column prop="firmName" label="企业名称" />
+            <el-table-column prop="perInCha" label="责任人姓名" />
+            <el-table-column prop="perInChaPho" label="联系电话" />
+            <el-table-column prop="perInChaTwo" label="责任人姓名" />
+            <el-table-column prop="perInChaPhoTwo" label="联系电话" />
           </el-table>
 
         </div>
@@ -196,7 +166,6 @@
 
 .list_box ul {
   display: flex;
-  /* 使用 Flexbox 布局 */
   padding: 0;
   margin: 0;
   list-style: none;
@@ -206,11 +175,14 @@
   padding: 10px;
   margin-right: 10px;
   cursor: pointer;
+  box-shadow: inset 0 0 40px #409eff;
+  border-radius: 10px;
+  margin-bottom: 5px;
 }
 
 .list_box li.active {
-  background-color: rgba(117, 116, 116, 0.3);
-  color: white;
+  // color: #409eff;
+  box-shadow: inset 0 0 100px #2a8ef1;
 }
 
 .page_box {

--
Gitblit v1.9.3