From 17614db55cff6f0eefeb56f3409af88a6ed19d39 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期四, 14 九月 2023 10:36:17 +0800
Subject: [PATCH] 发布管理修改

---
 src/views/datamanage/uploadmanage.vue |  248 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 237 insertions(+), 11 deletions(-)

diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue
index 61d14b4..d4aef68 100644
--- a/src/views/datamanage/uploadmanage.vue
+++ b/src/views/datamanage/uploadmanage.vue
@@ -511,7 +511,7 @@
             </el-select>
 
           </el-form-item>
-          <!-- 鍧愭爣绯� -->
+          <!-- 鎷変几鍥犲瓙 -->
           <el-form-item
             v-show="insertLayer.showFactor"
             :label="$t('dataManage.vmobj.labe17')"
@@ -526,6 +526,58 @@
               style="width: 100%;"
             ></el-input-number>
           </el-form-item>
+
+          <el-form-item :label="$t('dataManage.vmobj.labe19')">
+            <el-select
+              size="small"
+              placeholder="璇烽�夋嫨棰滆壊琛�"
+              v-model="colorTableType"
+              style="width: 100%;"
+            >
+              <el-option
+                v-for="(item, i) in colorTableOptions"
+                :key="i"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+
+            </el-select>
+          </el-form-item>
+          <!-- 棰滆壊琛� -->
+          <el-form-item
+            v-show="colorTableType != 2"
+            :label="$t('dataManage.vmobj.labe18')"
+          >
+            <el-select
+              v-model="renderType"
+              placeholder="璇烽�夋嫨娓叉煋绫诲瀷"
+              size="small"
+              @change="changeSelection(renderType)"
+              ref="selectColor"
+              style="width: 100%;"
+              clearable
+            >
+              <el-option
+                v-for="(item, i) in renderTypeOptions"
+                :key="i"
+                :label="item.name"
+                :value="item.name"
+              >
+                <div
+                  style="
+                height: 30px;
+                width: 100%;
+                position: relative;
+                top: 50%;
+                left: 50%;
+                transform: translate(-50%, -50%);
+              "
+                  :style="item.domCss"
+                ></div>
+              </el-option>
+            </el-select>
+          </el-form-item>
+
           <!-- 鍧愭爣绯� -->
           <el-form-item :label="$t('dataManage.vmobj.labe16')">
             <el-select
@@ -645,7 +697,7 @@
       <div
         v-loading="true"
         element-loading-background="rgba(0, 0, 0, 0.0) "
-        element-loading-text="鏁版嵁鍙戝竷涓�"
+        :element-loading-text="loadingText"
         style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); "
       >
       </div>
@@ -668,10 +720,12 @@
   publish_deletesSjServices,
   publish_update,
   publish_insertSjService,
+  publish_selectSjColorTables,
+  publish_selectSjMissionStatus
 } from '../../api/api.js'
 import { conditions } from '../Archive/Archive';
 import { method_option, nodata_Option, server_option, system_Option, type_option } from './js/layerManage';
-
+import server from '../../components/js/server.js'
 export default {
   components: {
     MyBread, mapview,
@@ -736,7 +790,24 @@
       serverOption: [],
       enhanceOption: [],
       epsgOption: [],
-      noDataOption: []
+      noDataOption: [],
+      renderType: null,
+      renderTypeOptions: [],
+      colorTableType: null,
+      colorTableOptions: [
+        {
+          value: 2,
+          label: "璇烽�夋嫨棰滆壊琛�",
+        },
+        {
+          value: 0,
+          label: "鏅�氶鑹茶〃",
+        },
+        {
+          value: 1,
+          label: "鐩存柟鍥惧潎琛�",
+        }],
+      loadingText: '鏁版嵁鍙戝竷涓�',
     }
   },
   methods: {
@@ -840,8 +911,36 @@
       for (var i in this.multipleSelection) {
         std.push(this.multipleSelection[i].id)
       }
+      var color1 = null;
+      var color2 = null;
+      var level = null;
+      var val_data = [];
+      var dataId = 0;
+      if (this.renderTypeOptions.length > 0) {
+        for (var i in this.renderTypeOptions) {
+          if (this.renderTypeOptions[i].name == this.renderType) {
+            val_data.push(this.renderTypeOptions[i]);
+          }
+        }
+      }
+
+      if (val_data.length > 0) {
+        level = val_data[0];
+      }
+      if (this.colorTableType == 0) {
+        color1 = level.content.levels;
+        dataId = level.data_id;
+      } else if (this.colorTableType == 1) {
+        color2 = level.content.levels;
+        dataId = level.data_id;
+      }
+
+
       var obj = {
+        colorTable: color1, // 鏅�氶鑹茶〃锛屽彲涓嶈
+        gradientColorTable: color2,
         dircode: this.formInline.dirid,
+        colorTableId: dataId,
         name: name,
         ids: std,
         enhanceType: this.insertLayer.enhanceType,
@@ -853,20 +952,69 @@
 
       this.loadDialogVisible = true
       this.insertDialogVisible = false;
-
+      this.loadDialogVisible = false
       const data = await publish_insertSjService(obj);
+      if (data.code == 200 && data.result && data.result > 0) {
+        this.loadDialogVisible = true
+        this.getLoadingMsg(data.result);
+      } else {
+        this.$message.error("鏁版嵁鍙戝竷澶辫触")
+        this.getTableData();
+      }
 
-      if (data.code == 200 && data.result > 0) {
+
+
+      // if (data.code == 200 && data.result > 0) {
+      //   this.$message({
+      //     message: '鏁版嵁鍙戝竷鎴愬姛',
+      //     type: 'success'
+      //   });
+      // } else {
+      //   this.$message.error("鏁版嵁鍙戝竷澶辫触")
+      // }
+
+      // 
+    },
+    async getLoadingMsg(res) {
+      if (!this.loadDialogVisible) return;
+      const data = await publish_selectSjMissionStatus({ id: res })
+
+
+      if (data.result.status == 3) {
         this.$message({
           message: '鏁版嵁鍙戝竷鎴愬姛',
           type: 'success'
         });
-      } else {
+        this.loadDialogVisible = false;
+        this.getTableData();
+      } else if (data.result.status == 5 || data.result.status == 4) {
         this.$message.error("鏁版嵁鍙戝竷澶辫触")
+        this.loadDialogVisible = false;
+        this.getTableData();
+      } else {
+        if (data.result.process == 100) {
+          this.$message({
+            message: '鏁版嵁鍙戝竷鎴愬姛',
+            type: 'success'
+          });
+          this.loadDialogVisible = false;
+          this.getTableData();
+        } else {
+          // this.loadingText = '鏁版嵁鍙戝竷涓紝宸插彂甯� ' + data.result.process + '%';
+          this.loadingText = '鏁版嵁鍙戝竷涓�...';
+          var that = this;
+          setTimeout(() => {
+            that.getLoadingMsg(res);
+          }, 3000);
+        }
+
       }
-      this.loadDialogVisible = false
-      this.getTableData();
+
+
     },
+
+
+
     setEnhanceTypeChange(res) {
       var val = this.enhanceOption.filter((res) => {
         if (res.value == this.insertLayer.enhanceType) {
@@ -904,6 +1052,9 @@
       } else {
         this.insertLayer.showFactor = false;
       }
+      this.colorTableType = 2;
+      this.renderType = null;
+      this.insertLayer.name = this.multipleSelection[0].name
       this.insertDialogVisible = true;
 
     },
@@ -999,8 +1150,14 @@
     //棰勮寮圭獥鎵撳紑
     setPreviewLayer(res) {
       this.$store.state.previewLayer = res;
+
       this.dialogVisible = true;
       this.showMapView = true;
+
+
+      setTimeout(() => {
+        server.setAddReleaseLayer(res)
+      }, 500);
     },
     //鏄惁涓哄叏灞忓嚱鏁�
     onFullscreen(fullscreen) {
@@ -1278,6 +1435,74 @@
         return father.pid == 0 // 杩斿洖涓�绾ц彍鍗�
       })
     },
+    async getColorJson() {
+      var dt = await publish_selectSjColorTables({
+        pageIndex: 1,
+        pageSize: 100000,
+      });
+
+      if (!dt.result) return
+      this.renderTypeOptions = dt.result.item_list;
+
+      this.renderTypeOptions.forEach((e) => {
+        let css = "";
+        let css1 = "";
+        e.content.levels.forEach((v) => {
+          if ("r_start" in v) {
+            css += `rgb(${v.r_start}, ${v.g_start}, ${v.b_start}),rgb(${v.r_end}, ${v.g_end}, ${v.b_end}),`;
+          } else if ("r" in v) {
+            css1 += `rgb(${v.r}, ${v.g}, ${v.b}),`;
+          }
+        });
+
+        let cssColor = `${css1}${css}`;
+        let cssStr = "";
+
+        if (cssColor.length == 19) {
+          cssStr = `background: ${cssColor.slice(0, -1)}`;
+        } else {
+          cssStr = `background-image:linear-gradient(to right, ${cssColor.slice(
+            0,
+            -1
+          )})`;
+        }
+        e.domCss = cssStr;
+      });
+    },
+    changeSelection(scope) {
+      // if (scope == "") {
+      //   this.$refs.selectColor.$el.children[0].children[0].removeAttribute("style");
+      //   this.$refs.selectColor.$el.children[0].children[0].children[0].removeAttribute(
+      //     "style"
+      //   );
+      //   this.$refs.selectColor.$el.children[0].children[0].children[0].children[0].removeAttribute(
+      //     "style"
+      //   );
+      //   return;
+      // }
+      // for (let index in this.renderTypeOptions) {
+      //   let obj = this.renderTypeOptions[index];
+      //   if (obj.name == scope) {
+      //     this.$refs.selectColor.$el.children[0].children[0].setAttribute(
+      //       "style",
+      //       `background-image: linear-gradient(to right,${obj.domCss});
+      //       width: 100%; height: 100%;
+      //       border: none;
+      //       height: 33px;`
+      //     );
+      //     this.$refs.selectColor.$el.children[0].children[0].children[0].setAttribute(
+      //       "style",
+      //       `display: flex;
+      //     justify-content: flex-end;
+      //     background:transparent;`
+      //     );
+      //     this.$refs.selectColor.$el.children[0].children[0].children[0].children[0].setAttribute(
+      //       "style",
+      //       `display: none;`
+      //     );
+      //   }
+      // }
+    }
   },
   mounted() {
     this.active = 'first';
@@ -1285,7 +1510,8 @@
     this.serverOption = server_option;
     this.epsgOption = system_Option;
     this.noDataOption = nodata_Option;
-    this.enhanceOption = method_option
+    this.enhanceOption = method_option;
+    this.getColorJson()
     this.setPageStart();
     this.setOptions();
 
@@ -1344,7 +1570,7 @@
   .loadBox {
     position: fixed;
     z-index: 2002;
-    background: rgba(0, 0, 0, 0.2);
+    background: rgba(0, 0, 0, 0.75);
     width: 100%;
     height: 100%;
     top: 0;

--
Gitblit v1.9.3