From ce51d7719b4d908da5577751f0c840fab5d1a39e Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 19 四月 2024 17:45:54 +0800
Subject: [PATCH] 20240419

---
 src/views/fysp/scene/CompSceneImport.vue     |   39 +++++++++++++++++++
 src/views/fysp/scene/SceneInfo.vue           |   46 +++++++++++++----------
 src/components/table/FYTable.vue             |    3 +
 src/api/index.js                             |    2 
 src/components.d.ts                          |    2 +
 src/components/search-option/FYSearchBar.vue |    1 
 src/enum/location.js                         |   16 ++++++++
 7 files changed, 88 insertions(+), 21 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index 5ef36b4..538a451 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -1,7 +1,7 @@
 import axios from 'axios';
 import { ElMessage } from 'element-plus';
 
-const debug = false;
+const debug = true;
 
 let ip1 = 'http://47.100.191.150:9005/';
 let ip1_file = 'http://47.100.191.150:9005/';
diff --git a/src/components.d.ts b/src/components.d.ts
index 9692367..520db48 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -26,6 +26,7 @@
     ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
     ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
+    ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
     ElDropdown: typeof import('element-plus/es')['ElDropdown']
@@ -66,6 +67,7 @@
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTransfer: typeof import('element-plus/es')['ElTransfer']
     ElTree: typeof import('element-plus/es')['ElTree']
+    ElUpload: typeof import('element-plus/es')['ElUpload']
     Footer: typeof import('./components/core/Footer.vue')['default']
     FormCol: typeof import('./components/layout/FormCol.vue')['default']
     FYBgTaskCard: typeof import('./components/bg-task/FYBgTaskCard.vue')['default']
diff --git a/src/components/search-option/FYSearchBar.vue b/src/components/search-option/FYSearchBar.vue
index 76c4392..9fe8c2b 100644
--- a/src/components/search-option/FYSearchBar.vue
+++ b/src/components/search-option/FYSearchBar.vue
@@ -3,6 +3,7 @@
     <slot name="options"></slot>
     <el-form-item>
       <el-button icon="Search" type="primary" @click="search">{{ btnText }}</el-button>
+      <slot name="buttons"></slot>
     </el-form-item>
   </el-form>
 </template>
diff --git a/src/components/table/FYTable.vue b/src/components/table/FYTable.vue
index 66c53bf..e00929f 100644
--- a/src/components/table/FYTable.vue
+++ b/src/components/table/FYTable.vue
@@ -4,6 +4,9 @@
       <template #options>
         <slot name="options"></slot>
       </template>
+      <template #buttons>
+        <slot name="buttons"></slot>
+      </template>
     </FYSearchBar>
   </el-row>
   <el-row ref="expandRef">
diff --git a/src/enum/location.js b/src/enum/location.js
index 6463c40..319f075 100644
--- a/src/enum/location.js
+++ b/src/enum/location.js
@@ -166,6 +166,22 @@
               ],
             },
             {
+              label: '闀垮畞鍖�',
+              value: ['310105', '闀垮畞鍖�'],
+              children: [
+                { label: '鍗庨槼璺閬�', value: ['310105001', '鍗庨槼璺閬�'] },
+                { label: '姹熻嫃璺閬�', value: ['310105002', '姹熻嫃璺閬�'] },
+                { label: '鏂板崕璺閬�', value: ['310105004', '鏂板崕璺閬�'] },
+                { label: '鍛ㄥ妗ヨ閬�', value: ['310105005', '鍛ㄥ妗ヨ閬�'] },
+                { label: '澶╁北璺閬�', value: ['310105006', '澶╁北璺閬�'] },
+                { label: '浠欓湠鏂版潙琛楅亾', value: ['310105008', '浠欓湠鏂版潙琛楅亾'] },
+                { label: '铏规ˉ琛楅亾', value: ['310105009', '铏规ˉ琛楅亾'] },
+                { label: '绋嬪妗ヨ閬�', value: ['310105010', '绋嬪妗ヨ閬�'] },
+                { label: '鍖楁柊娉捐閬�', value: ['310105011', '鍖楁柊娉捐閬�'] },
+                { label: '鏂版尘闀�', value: ['310105102', '鏂版尘闀�'] },
+              ],
+            },
+            {
               label: '瀹濆北鍖�',
               value: ['310113', '瀹濆北鍖�'],
               children: [],
diff --git a/src/views/fysp/scene/CompSceneImport.vue b/src/views/fysp/scene/CompSceneImport.vue
new file mode 100644
index 0000000..2bbc4bc
--- /dev/null
+++ b/src/views/fysp/scene/CompSceneImport.vue
@@ -0,0 +1,39 @@
+<template>
+  <el-button icon="Upload" type="success" @click="dialogVisible = true">鎵归噺瀵煎叆</el-button>
+  <el-dialog
+    v-model="dialogVisible"
+    title="鍦烘櫙淇℃伅鎵归噺瀵煎叆"
+    width="500"
+    :before-close="handleClose"
+  >
+    <el-upload
+      class="upload-demo"
+      drag
+      action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
+      multiple
+      accept=".xlsx"
+    >
+      <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+      <div class="el-upload__text">鎷栧姩鏂囦欢鎴�<em>鐐瑰嚮涓婁紶</em></div>
+      <template #tip>
+        <!-- <div class="el-upload__tip">jpg/png files with a size less than 500kb</div> -->
+      </template>
+    </el-upload>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button @click="dialogVisible = false">鍙栨秷</el-button>
+        <el-button type="primary" @click="dialogVisible = false">纭畾</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      dialogVisible: false
+    };
+  }
+};
+</script>
diff --git a/src/views/fysp/scene/SceneInfo.vue b/src/views/fysp/scene/SceneInfo.vue
index b3e7682..a207662 100644
--- a/src/views/fysp/scene/SceneInfo.vue
+++ b/src/views/fysp/scene/SceneInfo.vue
@@ -17,6 +17,10 @@
       ></FYOptionOnlineStatus>
     </template>
 
+    <template #buttons>
+      <CompSceneImport></CompSceneImport>
+    </template>
+
     <template #table-column>
       <el-table-column fixed="left" prop="name" label="鍚嶇О" width="400">
         <template #default="scope">
@@ -65,45 +69,47 @@
 import { useLoadingStore } from '@/stores/loadingStore';
 import { mapStores } from 'pinia';
 import { useMessageBoxTip } from '@/composables/messageBox';
+import CompSceneImport from "./CompSceneImport.vue";
 
 export default {
+  components: {
+    CompSceneImport,
+  },
   data() {
     return {
       formSearch: {
         _locations: {},
         scensetype: {},
-        online: {},
-      },
+        online: {}
+      }
     };
   },
   computed: {
-    ...mapStores(useLoadingStore),
+    ...mapStores(useLoadingStore)
   },
   methods: {
     onSearch(page, func) {
       const f = this.formSearch;
       const area = {};
       // 琛屾斂鍖哄垝
-      area.provincecode = f._locations.pCode
-      area.citycode = f._locations.cCode
-      area.districtcode = f._locations.dCode
-      area.towncode = f._locations.tCode
+      area.provincecode = f._locations.pCode;
+      area.citycode = f._locations.cCode;
+      area.districtcode = f._locations.dCode;
+      area.towncode = f._locations.tCode;
       // 鍦烘櫙绫诲瀷
       area.scensetypeid = f.scensetype.value;
       if (area.scensetypeid == '0') area.scensetypeid = null;
       // 涓婁笅绾跨姸鎬�
       area.online = f.online.value;
 
-      return sceneApi
-        .searchScene(area, page.currentPage, page.pageSize)
-        .then((res) => {
-          if (res.success) {
-            func({
-              data: res.data,
-              total: res.head.totalCount,
-            });
-          }
-        });
+      return sceneApi.searchScene(area, page.currentPage, page.pageSize).then((res) => {
+        if (res.success) {
+          func({
+            data: res.data,
+            total: res.head.totalCount
+          });
+        }
+      });
     },
     itemEdit(scope) {
       scope.row.loading1 = true;
@@ -130,10 +136,10 @@
             .finally(() => {
               scope.row.loading2 = false;
             });
-        },
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 

--
Gitblit v1.9.3