From 1a0d57124485fafb0b42a3ec3ecc121e50bb050f Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期二, 03 六月 2025 17:00:08 +0800
Subject: [PATCH] 1

---
 src/components/public/index.vue |  128 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 102 insertions(+), 26 deletions(-)

diff --git a/src/components/public/index.vue b/src/components/public/index.vue
index c1d8e31..9d11c4e 100644
--- a/src/components/public/index.vue
+++ b/src/components/public/index.vue
@@ -1,15 +1,27 @@
 <template>
   <div>
-    <el-dialog :title="title" :visible.sync="open" width="1080px" append-to-body>
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="1080px"
+      append-to-body
+    >
       <h3 v-if="fList.proResult">妫�娴嬮」鐩� :{{ fList.project.proName }}</h3>
       <h3 v-if="fList.proResult">
         妫�娴嬬粨鏋� :{{ fList.proResult }}{{ fList.project.proMetering }}
       </h3>
 
-      <h2 style="text-align: center;">{{ proName || '鏆傛棤椤圭洰鍚嶇О' }}</h2>
+      <h2 style="text-align: center">{{ proName || "鏆傛棤椤圭洰鍚嶇О" }}</h2>
       <div style="display: flex; width: 100%">
         <div style="width: 50%; margin-right: 40px">
-          <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"  @submit.native.prevent>
+          <el-form
+            :model="queryParams"
+            ref="queryForm"
+            size="small"
+            :inline="true"
+            label-width="68px"
+            @submit.native.prevent
+          >
             <!-- <el-form-item label="鐥呯鍚嶇О" prop="bingzhong">
           <el-input
             v-model="queryParams.bingzhong"
@@ -20,11 +32,22 @@
           />
         </el-form-item>-->
             <el-form-item label="妫�鏌ョ粨璁�" prop="ruleStr">
-              <el-input v-model="queryParams.ruleStr" placeholder="璇疯緭鍏ユ鏌ョ粨璁�" clearable @keyup.enter.native="getList"
-                style="width: 130px" />
+              <el-input
+                v-model="queryParams.ruleStr"
+                placeholder="璇疯緭鍏ユ鏌ョ粨璁�"
+                clearable
+                @keyup.enter.native="getList"
+                style="width: 130px"
+              />
             </el-form-item>
             <el-form-item>
-              <el-button type="primary" icon="el-icon-search" size="mini" @click="getList">鎼滅储</el-button>
+              <el-button
+                type="primary"
+                icon="el-icon-search"
+                size="mini"
+                @click="getList"
+                >鎼滅储</el-button
+              >
             </el-form-item>
             <!-- <el-form-item>
           <h3 >{{ queryParams.proName  || '鏆傛棤椤圭洰鍚嶇О'  }}</h3>
@@ -33,25 +56,48 @@
           <h3 style="margin-left: 160px">宸查�夐」鐩�</h3>
         </el-form-item> -->
           </el-form>
-          <el-table :data="dataList" ref="multipleTable" v-loading="loading" @selection-change="handleSelectionChange"
-            border height="480px">
+          <el-table
+            :data="dataList"
+            ref="multipleTable"
+            v-loading="loading"
+            @selection-change="handleSelectionChange"
+            border
+            height="480px"
+          >
             <el-table-column type="selection" width="40" align="center" />
-            <el-table-column label="搴忓彿" type="index" align="center" width="50px" />
+            <el-table-column
+              label="搴忓彿"
+              type="index"
+              align="center"
+              width="50px"
+            />
             <!-- <el-table-column label="瑙勫垯" align="center" prop="ruleStr" /> -->
             <el-table-column label="妫�鏌ユ墍瑙�" align="center" prop="yxbx" />
             <el-table-column label="妫�鏌ョ粨璁�" align="center" prop="ruleStr" />
           </el-table>
           <div class="pag">
             <div class="pag1" style="margin-left: 630px">
-              <pagination small v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
-                :limit.sync="queryParams.pageSize" @pagination="getList" />
+              <pagination
+                small
+                v-show="total > 0"
+                :total="total"
+                :page.sync="queryParams.pageNum"
+                :limit.sync="queryParams.pageSize"
+                @pagination="getList"
+              />
             </div>
           </div>
         </div>
 
         <div class="jianc">
           <!-- <h3 style="margin-top: -30px;">宸查�夐」鐩�</h3> -->
-          <el-form :model="form" ref="queryForm" size="small" label-width="68px" :label-position="labelPosition">
+          <el-form
+            :model="form"
+            ref="queryForm"
+            size="small"
+            label-width="68px"
+            :label-position="labelPosition"
+          >
             <!--  :inline="true" -->
             <!-- <el-form-item>
               <el-input
@@ -61,10 +107,22 @@
               ></el-input>
             </el-form-item> -->
             <el-form-item label="妫�鏌ユ墍瑙�" prop="jcsj">
-              <el-input v-model="form.jcsj" clearable type="textarea" :autosize="{ minRows: 7 }" style="width: 380px" />
+              <el-input
+                v-model="form.jcsj"
+                clearable
+                type="textarea"
+                :autosize="{ minRows: 7 }"
+                style="width: 380px"
+              />
             </el-form-item>
             <el-form-item label="妫�鏌ョ粨璁�" prop="desc">
-              <el-input v-model="form.desc" clearable type="textarea" :autosize="{ minRows: 7 }" style="width: 380px" />
+              <el-input
+                v-model="form.desc"
+                clearable
+                type="textarea"
+                :autosize="{ minRows: 7 }"
+                style="width: 380px"
+              />
             </el-form-item>
           </el-form>
         </div>
@@ -109,7 +167,7 @@
       // 寮瑰嚭灞傛爣棰�
       title: "",
       yxbx: "",
-      proName: '',
+      proName: "",
       //   lastDesc: "",
       total: 0,
       dataList: [],
@@ -132,7 +190,7 @@
   },
   watch: {
     checkStatus(newValue) {
-      console.log(565658)
+      console.log(565658);
       if (newValue === "1") {
         this.updateData(this.proResult, this.conclusion);
       }
@@ -147,14 +205,14 @@
           const firstProject = newVal[0]; // 浣犱篃鍙互閬嶅巻鎵�鏈夐」鐩紝鐪嬩綘涓氬姟闇�姹�
           this.queryParams.proId = firstProject.proId; // 鍋囪椤圭洰涓彨 id
           // this.queryParams.proName = firstProject.proName;
-          this.proName = firstProject.proName
+          this.proName = firstProject.proName;
         }
       },
     },
   },
-  mounted() { },
+  mounted() {},
 
-  created() { },
+  created() {},
   methods: {
     async getList() {
       try {
@@ -201,9 +259,8 @@
     },
 
     updateData(proResult, conclusion) {
-      console.log(proResult, conclusion, 5658)
+      console.log(proResult, conclusion, 5658);
       if (this.checkStatus == 1) {
-
         this.form.jcsj = proResult; // 鏇存柊妫�鏌ユ墍瑙�
         this.form.desc = conclusion; // 鏇存柊妫�鏌ョ粨璁�
       } else {
@@ -212,12 +269,12 @@
       }
 
       if (this.list.length != 0) {
-        let desc = ""
+        let desc = "";
         desc += this.list
           .map((item) => item.bingzhong || item.ruleStr)
           .filter(Boolean)
           .join(",");
-        let jcsj = ""
+        let jcsj = "";
         jcsj += this.list
           .map((item) => item.yxbx)
           .filter(Boolean)
@@ -257,9 +314,28 @@
       //   .join(",");
     },
 
-    handleOk() {
+    /* handleOk() {
       if (!this.form.desc && !this.form.jcsj) {
         this.$message.warning("璇烽�夋嫨鏁版嵁");
+        return;
+      }
+
+      try {
+        this.$emit("add", this.form.desc, this.form.jcsj);
+        this.resetForm();
+        this.open = false;
+      } catch (error) {
+        console.error("澶勭悊鏁版嵁澶辫触:", error);
+        this.$message.error("鎿嶄綔澶辫触");
+      }
+    }, */
+
+    handleOk() {
+      const jcsjTrim = this.form.jcsj?.trim();
+      const descTrim = this.form.desc?.trim();
+
+      if (!jcsjTrim || !descTrim) {
+        this.$message.warning("妫�鏌ユ墍瑙佸拰妫�鏌ョ粨璁轰笉鑳戒负绌�");
         return;
       }
 
@@ -283,7 +359,7 @@
     },
     callcolos() {
       this.open = false;
-    }
+    },
   },
   computed: {
     isCheckMode() {
@@ -315,6 +391,6 @@
 .jianc {
   width: 100%;
   height: 600px;
-  padding-top: 40px
+  padding-top: 40px;
 }
 </style>
\ No newline at end of file

--
Gitblit v1.8.0