From f0d048fa2cba4f52066e14d1d31e4f7a2c7a9530 Mon Sep 17 00:00:00 2001
From: hdy <1105738590@qq.com>
Date: 星期三, 12 三月 2025 09:05:57 +0800
Subject: [PATCH] 新增导入功能

---
 billion-ui/src/views/main/sc/opcConf/index.vue |  105 +++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 79 insertions(+), 26 deletions(-)

diff --git a/billion-ui/src/views/main/sc/opcConf/index.vue b/billion-ui/src/views/main/sc/opcConf/index.vue
index 9589179..24edab3 100644
--- a/billion-ui/src/views/main/sc/opcConf/index.vue
+++ b/billion-ui/src/views/main/sc/opcConf/index.vue
@@ -1,6 +1,14 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="宸ヤ綅缂栧彿" prop="locationCode">
+        <el-input
+          v-model="queryParams.locationCode"
+          placeholder="璇疯緭鍏ュ伐浣嶇紪鍙�"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="宸ヤ綅鍚嶇О" prop="locationName">
         <el-input
           v-model="queryParams.locationName"
@@ -17,9 +25,32 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item>
+      <el-form-item label="閲囬泦绫诲瀷" prop="type">
+        <el-select v-model="queryParams.type" placeholder="璇烽�夋嫨璁㈤槄鐘舵��" clearable>
+          <el-option
+            v-for="dict in dict.type.collection_type"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="璁㈤槄" prop="subscribe">
+        <el-select v-model="queryParams.subscribe" placeholder="璇烽�夋嫨璁㈤槄鐘舵��" clearable>
+          <el-option
+            v-for="dict in dict.type.sys_yes_no"
+            :key="dict.value"
+            :label="dict.label"
+            :value="dict.value"
+          />
+        </el-select>
+      </el-form-item>
+
+      <el-form-item style="float: right" >
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
+<!--        <el-button icon="el-icon-setting" size="mini" @click="toggleAdvancedSearch">楂樼骇鏌ヨ</el-button>-->
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+
       </el-form-item>
     </el-form>
 
@@ -66,33 +97,21 @@
           v-hasPermi="['sc:opcConf:export']"
         >瀵煎嚭</el-button>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="opcConfList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" border :data="opcConfList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="涓婚敭id" align="center" prop="id" />
       <el-table-column label="宸ヤ綅缂栫爜" align="center" prop="locationCode" />
       <el-table-column label="宸ヤ綅鍚嶇О" align="center" prop="locationName" />
       <el-table-column label="鍦板潃" align="center" prop="node" />
-      <el-table-column label="閲囬泦绫诲瀷" align="center" prop="type" />
-      <el-table-column label="鏄惁璁㈤槄" align="center" prop="subscribe" />
-      <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="閲囬泦绫诲瀷" align="center" prop="type" >
         <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['sc:opcConf:edit']"
-          >淇敼</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['sc:opcConf:remove']"
-          >鍒犻櫎</el-button>
+          <dict-tag :options="dict.type.collection_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="鏄惁璁㈤槄" align="center" prop="subscribe" >
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.subscribe"/>
         </template>
       </el-table-column>
     </el-table>
@@ -106,10 +125,10 @@
     />
 
     <!-- 娣诲姞鎴栦慨鏀筄PC浜や簰閰嶇疆瀵硅瘽妗� -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body >
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="宸ヤ綅缂栫爜" prop="locationCode">
-          <el-input v-model="form.locationCode" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
+          <el-input v-model="form.locationCode"  placeholder="璇疯緭鍏ュ唴瀹�" />
         </el-form-item>
         <el-form-item label="宸ヤ綅鍚嶇О" prop="locationName">
           <el-input v-model="form.locationName" placeholder="璇疯緭鍏ュ伐浣嶅悕绉�" />
@@ -117,9 +136,25 @@
         <el-form-item label="鍦板潃" prop="node">
           <el-input v-model="form.node" placeholder="璇疯緭鍏ュ湴鍧�" />
         </el-form-item>
-<!--        <el-form-item label="鍒犻櫎鏍囧織" prop="delFlag">-->
-<!--          <el-input v-model="form.delFlag" placeholder="璇疯緭鍏ュ垹闄ゆ爣蹇�" />-->
-<!--        </el-form-item>-->
+        <el-form-item label="閲囬泦绫诲瀷" prop="type">
+          <el-select v-model="form.type" placeholder="璇烽�夋嫨閲囬泦绫诲瀷" >
+            <el-option
+              v-for="dict in dict.type.collection_type"
+              :key="dict.value"
+              :label="dict.label"
+              :value="dict.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="鏄惁璁㈤槄" prop="subscribe">
+          <el-radio-group v-model="form.subscribe">
+            <el-radio
+              v-for="dict in dict.type.sys_yes_no"
+              :key="dict.value"
+              :label="dict.value"
+            >{{dict.label}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
@@ -134,8 +169,10 @@
 
 export default {
   name: "OpcConf",
+  dicts: ['sys_yes_no','collection_type'],
   data() {
     return {
+      advancedSearchVisible: false,
       // 閬僵灞�
       loading: true,
       // 閫変腑鏁扮粍
@@ -168,6 +205,19 @@
       form: {},
       // 琛ㄥ崟鏍¢獙
       rules: {
+        locationCode: [
+          { required: true, message: "宸ヤ綅缂栫爜涓嶈兘涓虹┖", trigger: "blur" },
+          { pattern: /^[a-zA-Z0-9]*$/, message: "鎬绘垚搴忓垪鍙蜂笉鑳藉寘鍚腑鏂囧瓧绗�", trigger: "blur" }
+        ],
+        locationName: [
+          { required: true, message: "宸ヤ綅鍚嶇О涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        subscribe: [
+          { required: true, message: "璁㈤槄涓嶈兘涓虹┖", trigger: "blur" },
+        ],
+        node: [
+          { required: true, message: "鍦板潃涓嶈兘涓虹┖", trigger: "blur" },
+        ],
       }
     };
   },
@@ -175,6 +225,9 @@
     this.getList();
   },
   methods: {
+    toggleAdvancedSearch() {
+      this.advancedSearchVisible = !this.advancedSearchVisible;
+    },
     /** 鏌ヨOPC浜や簰閰嶇疆鍒楄〃 */
     getList() {
       this.loading = true;

--
Gitblit v1.9.3