From 193c02587585f85853352f5553a0f068d078696c Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期三, 22 三月 2023 08:18:50 +0800
Subject: [PATCH] 发布管理修改预览效果,一张图修改

---
 src/views/datamanage/uploadmanage.vue |  164 +++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 130 insertions(+), 34 deletions(-)

diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue
index 37c5a5b..69cb4da 100644
--- a/src/views/datamanage/uploadmanage.vue
+++ b/src/views/datamanage/uploadmanage.vue
@@ -284,15 +284,44 @@
     <!-- 鍦板潃棰勮 -->
     <el-dialog
       :title="$t('common.preview')"
+      :class="isFullscreen ? '' : 'dialogClass_his'"
+      custom-class="handleDialogClass"
+      width="73.4%"
+      :fullscreen="isFullscreen"
+      v-if="dialogVisible"
+      :visible.sync="dialogVisible"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <dialog-header
+        slot="title"
+        :dialog-tittle="$t('common.preview')"
+        :fullscreen="isFullscreen"
+        @handle-closed="handleClose"
+        @is-fullscreen="onFullscreen"
+      ></dialog-header>
+      <div :class="{'fullscreen1':isFullscreen}">
+        <mapview v-if="showMapView"></mapview>
+      </div>
+    </el-dialog>
+    <!-- <el-dialog
+      :title="$t('common.preview')"
       :visible.sync="dialogVisible"
       width="70%"
       :before-close="handleClose"
       top="13vh"
+      :lock-scroll="false"
+      :close-on-press-escape="false"
+      :close-on-click-modal="false"
+      v-el-drag-dialog
     >
-      <div style="width:100%;height:65vh">
-        <mapview v-if="showMapView"></mapview>
-      </div>
-    </el-dialog>
+      <div
+        id="MapDiv"
+        style="background:red;widht:100%;height:calc(100% - 10px)"
+      ></div>
+      <!-- 
+    </el-dialog> -->
     <!-- 淇敼鏁版嵁 -->
     <el-dialog
       :title="$t('common.update')"
@@ -389,6 +418,7 @@
       :visible.sync="insertDialogVisible"
       width="40%"
       :close-on-click-modal="false"
+      :show-close="false"
     >
       <div style="width:100%;height:30vh">
         <el-form
@@ -409,16 +439,42 @@
             ></el-input>
           </el-form-item>
           <el-form-item :label="$t('dataManage.vmobj.minLevel')">
-            <el-input
+            <!-- <el-input
               v-model="insertLayer.min"
               :placeholder="$t('dataManage.vmobj.labe11')"
-            ></el-input>
+            ></el-input> -->
+            <el-select
+              style="width:100%"
+              v-model="insertLayer.min"
+              :placeholder="$t('dataManage.vmobj.labe11')"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
           <el-form-item :label="$t('dataManage.vmobj.maxLevel')">
-            <el-input
+            <!-- <el-input
               v-model="insertLayer.max"
               :placeholder="$t('dataManage.vmobj.labe12')"
-            ></el-input>
+            ></el-input> -->
+            <el-select
+              style="width:100%"
+              v-model="insertLayer.max"
+              :placeholder="$t('dataManage.vmobj.labe12')"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
           </el-form-item>
           <el-form-item>
             <el-button
@@ -454,7 +510,6 @@
         element-loading-text="鏁版嵁鍙戝竷涓�"
         style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); "
       >
-
       </div>
     </div>
   </div>
@@ -462,6 +517,8 @@
 </template>
 
 <script>
+import axios from 'axios';
+import dialogHeader from './dialogHeader.vue'
 import mapview from '../../components/preview_map.vue'
 import MyBread from "../../components/MyBread.vue"
 import {
@@ -476,7 +533,10 @@
 } from '../../api/api.js'
 
 export default {
-  components: { MyBread, mapview },
+  components: {
+    MyBread, mapview,
+    'dialog-header': dialogHeader,
+  },
   data() {
     return {
       active: 'first',
@@ -528,17 +588,29 @@
       detailsDialogVisible: false,
       itemdetail: {},
       insertDialogVisible: false,
-      insertLayer: { name: '', number: null, min: 4, max: 8 },
-      loadDialogVisible: false
+      insertLayer: { name: '', number: null, min: 4, max: 18 },
+      loadDialogVisible: false,
+      options: [],
+      isFullscreen: false,
     }
   },
   methods: {
+    setOptions() {
+      var std = [];
+      for (var i = 0; i < 21; i++) {
+        std.push({
+          value: i,
+          label: i
+        })
+      }
+      this.options = std;
+    },
     setloadDialogVisible() {
       this.loadDialogVisible = false
     },
     setinsertLayerCancel() {
       this.insertDialogVisible = false;
-      this.insertLayer = { name: '', number: null, min: 4, max: 8 };
+      this.insertLayer = { name: '', number: null, min: 4, max: 18 };
     },
     //鍙戝竷鎻愪氦
     async setinsertLayerSubmit() {
@@ -574,7 +646,7 @@
       }
       var std = [];
       for (var i in this.multipleSelection) {
-        std.push(this.multipleSelection[i])
+        std.push(this.multipleSelection[i].id)
       }
       var obj = {
         dircode: this.formInline.dirid,
@@ -582,14 +654,14 @@
         min: min,
         max: max,
         name: name,
-        ids: std.toString(),
+        ids: std,
         type: this.formInline.type
       }
       this.loadDialogVisible = true
       this.insertDialogVisible = false;
 
       const data = await publish_insert(obj);
-      if (data.code != 200) {
+      if (data.code != 200 || data.count > 0) {
         this.$message.error("鏁版嵁鍙戝竷澶辫触")
 
       } else {
@@ -615,13 +687,13 @@
       } else {
         var std = [];
         for (var i in this.multipleSelection) {
-          std.push(this.multipleSelection[i])
+          std.push(this.multipleSelection[i].id)
         }
         var obj = {
           dircode: this.formInline.dirid,
           depcode: this.formInline.depid,
 
-          ids: std.toString(),
+          ids: std,
           type: this.formInline.type
         }
         this.loadDialogVisible = true
@@ -682,33 +754,46 @@
       this.editDialogVisible = true;
     },
     //鍒犻櫎
-    async setPageDelete() {
+    setPageDelete() {
       if (this.multipleSelection.length == 0) {
         return this.$message.error("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁")
       } else {
-        var std = [];
-        for (var i in this.multipleSelection) {
-          std.push(this.multipleSelection[i].id);
-        }
-        const data = await publish_deletes({ ids: std.toString() });
-        if (data.code != 200) {
-          this.$message.error("鍗曚綅鍒楄〃鑾峰彇澶辫触")
-          return
-        } else {
-          this.$message({
-            message: '鍒犻櫎鎴愬姛',
-            type: 'success'
+        var that = this
+        this.$confirm('纭畾鏄惁鍒犻櫎鎵�閫夊唴瀹�?')
+          .then(_ => {
+            done();
+          })
+          .catch(_ => {
+            that.deletePage()
           });
-          this.getTableData();
-        }
       }
-
+    },
+    async deletePage() {
+      var std = [];
+      for (var i in this.multipleSelection) {
+        std.push(this.multipleSelection[i].id);
+      }
+      const data = await publish_deletes({ ids: std.toString() });
+      if (data.code != 200) {
+        this.$message.error("鍗曚綅鍒楄〃鑾峰彇澶辫触")
+        return
+      } else {
+        this.$message({
+          message: '鍒犻櫎鎴愬姛',
+          type: 'success'
+        });
+        this.getTableData();
+      }
     },
     //棰勮寮圭獥鎵撳紑
     setPreviewLayer(res) {
       this.$store.state.previewLayer = res;
       this.dialogVisible = true;
       this.showMapView = true;
+    },
+    //鏄惁涓哄叏灞忓嚱鏁�
+    onFullscreen(fullscreen) {
+      this.isFullscreen = fullscreen;
     },
     //棰勮寮圭獥鍏抽棴
     handleClose() {
@@ -961,6 +1046,7 @@
   mounted() {
     this.active = 'first';
     this.setPageStart();
+    this.setOptions();
   }
 }
 </script>
@@ -1024,5 +1110,15 @@
       background: transparent !important;
     }
   }
+  .fullscreen1 {
+    width: 100%;
+    height: 92vh;
+  }
+  /deep/.el-dialog__body {
+    padding: 10px !important;
+  }
+  /deep/.el-dialog__header {
+    padding: 10px !important;
+  }
 }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3