From 8f6271eca8eb12710a07ed1a1b82fc491dfd4a5a Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期三, 13 九月 2023 11:12:37 +0800
Subject: [PATCH] 发布管理添加发布状态

---
 src/views/datamanage/uploadmanage.vue |   90 +++++++++++++++++++++++++++++++++++++--------
 src/api/api.js                        |    4 ++
 2 files changed, 78 insertions(+), 16 deletions(-)

diff --git a/src/api/api.js b/src/api/api.js
index 0905f9d..9aa362a 100644
--- a/src/api/api.js
+++ b/src/api/api.js
@@ -1244,3 +1244,7 @@
 export function publish_selectSjColorTables(params) {
   return request.get("/publish/selectSjColorTables", { params: params });
 }
+//鏁版嵁绠$悊=>鏌ヨ鏁扮畝浠诲姟鐘舵��
+export function publish_selectSjMissionStatus(params) {
+  return request.get("/publish/selectSjMissionStatus", { params: params });
+}
diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue
index 4c22327..420c232 100644
--- a/src/views/datamanage/uploadmanage.vue
+++ b/src/views/datamanage/uploadmanage.vue
@@ -697,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>
@@ -720,7 +720,8 @@
   publish_deletesSjServices,
   publish_update,
   publish_insertSjService,
-  publish_selectSjColorTables
+  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';
@@ -805,7 +806,8 @@
         {
           value: 1,
           label: "鐩存柟鍥惧潎琛�",
-        }]
+        }],
+      loadingText: '鏁版嵁鍙戝竷涓�',
     }
   },
   methods: {
@@ -913,25 +915,32 @@
       var color2 = null;
       var level = null;
       var val_data = [];
-
-      for (var i in this.renderTypeOptions) {
-        if (this.renderTypeOptions[i].name == this.renderType.value) {
-          val_data.push(this.renderTypeOptions[i].content.levels);
+      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;
+        color1 = level.content.levels;
+        dataId = level.data_id;
       } else if (this.colorTableType == 1) {
-        color2 = level;
+        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,
@@ -943,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 + '%';
+
+          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) {
@@ -1512,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