gemercheung 1 سال پیش
والد
کامیت
171c4cb92b

+ 1 - 1
packages/qjkankan-editor/.env

@@ -4,5 +4,5 @@ VUE_APP_CDN=https://4dkk.4dage.com
 VUE_APP_PROXY_URL_ROOT='https://www.4dkankan.com'
 VUE_APP_PROXY_URL='https://www.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
-
+VUE_APP_MEGA_LIST_URL='https://uat-laser.4dkankan.com/laser/init/list'
 VUE_APP_URL_FILL=

+ 2 - 1
packages/qjkankan-editor/.env.prod

@@ -8,4 +8,5 @@ VUE_APP_PROXY_URL='https://www.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=/qjkankan
 VUE_APP_DEBBUG_FLAG=1023-01
-VUE_APP_DEBBUG_NOTIFY=0
+VUE_APP_DEBBUG_NOTIFY=0
+VUE_APP_MEGA_LIST_URL='https://uat-laser.4dkankan.com/laser/init/list'

+ 3 - 2
packages/qjkankan-editor/.env.testdev

@@ -6,5 +6,6 @@ VUE_APP_PROXY_URL_ROOT='https://test.4dkankan.com'
 VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=
-VUE_APP_DEBBUG_FLAG=0425-02
-VUE_APP_DEBBUG_NOTIFY=0
+VUE_APP_DEBBUG_FLAG=0112-02
+VUE_APP_DEBBUG_NOTIFY=0
+VUE_APP_MEGA_LIST_URL='https://uat-laser.4dkankan.com/laser/init/list'

+ 2 - 1
packages/qjkankan-editor/.env.testprod

@@ -8,4 +8,5 @@ VUE_APP_PROXY_URL='https://test.4dkankan.com/qjkankan/'
 VUE_APP_ORIGIN=
 VUE_APP_URL_FILL=/qjkankan
 VUE_APP_DEBBUG_FLAG=010902
-VUE_APP_DEBBUG_NOTIFY=0
+VUE_APP_DEBBUG_NOTIFY=0
+VUE_APP_MEGA_LIST_URL='https://uat-laser.4dkankan.com/laser/init/list'

+ 98 - 16
packages/qjkankan-editor/src/api/index.js

@@ -208,21 +208,61 @@ export function get3DSceneList(data, ok) {
       isObj: 1,
     };
 
-    http.postJson(`/ucenter/user/scene/newList`, data).then((res) => {
-      ok({
-        code: 0,
-        data: {
-          list: res.data.pageInfo.list.map((item) => {
-            if (item.isFolder === 1) {
-              item.type = "dir";
-              item.sceneName = item.name;
-            }
-            return item;
-          }),
-          total: res.data.pageInfo.total,
-        },
+    if (tmpSceneSource === 4 || tmpSceneSource === 5) {
+      const MegaData = {
+        pageNum,
+        pageSize,
+        sceneSource: tmpSceneSource,
+        selectType: 1,
+        snCode: null,
+        title: "",
+        cooperationUserName: null,
+        // phone: "15915816041",
+        folderId: Number.isInteger(folderId) ? folderId : "",
+      };
+
+      const userInfo = JSON.parse(localStorage.getItem("info"));
+      let headers = {};
+      const token = localStorage.getItem("token");
+      headers["Fdtoken"] = token;
+      http
+        .postJsonWithHeader(
+          process.env.VUE_APP_MEGA_LIST_URL,
+          MegaData,
+          headers
+        )
+        .then((res) => {
+          ok({
+            code: 0,
+            data: {
+              list: res.data.pageInfo.list.map((item) => {
+                if (item.isFolder === 1) {
+                  item.type = "dir";
+                  item.sceneName = item.name;
+                }
+                return item;
+              }),
+              total: res.data.pageInfo.total,
+            },
+          });
+        });
+    } else {
+      http.postJson(`/ucenter/user/scene/newList`, data).then((res) => {
+        ok({
+          code: 0,
+          data: {
+            list: res.data.pageInfo.list.map((item) => {
+              if (item.isFolder === 1) {
+                item.type = "dir";
+                item.sceneName = item.name;
+              }
+              return item;
+            }),
+            total: res.data.pageInfo.total,
+          },
+        });
       });
-    });
+    }
   }
 }
 
@@ -267,9 +307,51 @@ export function searchInAll3DScenes(data, ok) {
       searchKey,
       startTime: "",
     }),
+    http.postJsonWithHeader(
+      process.env.VUE_APP_MEGA_LIST_URL,
+      {
+        pageNum: 1,
+        pageSize: 999999,
+        sceneSource: "4",
+        selectType: 1,
+        snCode: null,
+        title: searchKey,
+        cooperationUserName: null,
+        folderId: "",
+      },
+      {
+        Fdtoken: getToken(),
+      }
+    ),
+    http.postJsonWithHeader(
+      process.env.VUE_APP_MEGA_LIST_URL,
+      {
+        pageNum: 1,
+        pageSize: 999999,
+        sceneSource: "5",
+        selectType: 1,
+        snCode: null,
+        title: searchKey,
+        cooperationUserName: null,
+        folderId: "",
+      },
+      {
+        Fdtoken: getToken(),
+      }
+    ),
   ]).then((res) => {
-    let total = res[0].data.total + res[1].data.total;
-    let list = [...res[0].data.list, ...res[1].data.list];
+    console.log(res);
+    let total =
+      res[0].data.total +
+      res[1].data.total +
+      res[2].data.sceneNum +
+      res[3].data.sceneNum;
+    let list = [
+      ...res[0].data.list,
+      ...res[1].data.list,
+      ...res[2].data.pageInfo.list,
+      ...res[3].data.pageInfo.list,
+    ];
     ok({
       code: 0,
       data: {

+ 91 - 71
packages/qjkankan-editor/src/utils/request.js

@@ -13,21 +13,20 @@ import { base64ToBlob } from "./file";
 import { checkLogin } from "@/api";
 import { LoginDetector } from "@/utils/starter";
 import { $alert, $confirm } from "@/components/shared/message";
-import {i18n} from '@/lang'
+import { i18n } from "@/lang";
 
 let vue = new Vue();
 
-
 // 空函数
-const noop = function() {};
+const noop = function () {};
 // 请求回调队列
 let postQueue = [];
 
 // 阻止多个弹窗
-let isDiglog = false
+let isDiglog = false;
 
 const statusCode = {
-  NEXT: '__not_important__', //继续执行
+  NEXT: "__not_important__", //继续执行
   SUCCESS: 0, //成功
 
   FAILURE_CODE_3001: 3001, // "对象不存在"
@@ -37,7 +36,6 @@ const statusCode = {
   FAILURE_CODE_3006: 3006, //作品已被删除,无法编辑
   FAILURE_CODE_3007: 3007, //素材已被引用,无法删除。
 
-
   // 301X -> 权限问题类
   FAILURE_CODE_3010: 3010, // "Token为空"
   FAILURE_CODE_3011: 3011, // "没有操作权限"
@@ -80,26 +78,29 @@ export const showLoginTips = () => {
   showLoginTips.__is_show = true;
 
   return $confirm({
-    title: i18n.t('tips_code.tips'),
-    content: i18n.t('tips_code.relogin'),
-    okText: i18n.t('tips_code.goto_login'),
-    noText: i18n.t('tips_code.login_success'),
+    title: i18n.t("tips_code.tips"),
+    content: i18n.t("tips_code.relogin"),
+    okText: i18n.t("tips_code.goto_login"),
+    noText: i18n.t("tips_code.login_success"),
     okLink: "/",
-    ok: function() {
+    ok: function () {
       showLoginTips.__is_show = false;
       return false;
     },
-    no: function() {
+    no: function () {
       checkLogin().then((response) => {
         if (response.code === statusCode.SUCCESS) {
           postQueue.length && postQueue.forEach((item) => item());
           postQueue = [];
           LoginDetector.valid();
-          location.reload()
-        } else if (response.code === statusCode.FAILURE_CODE_5001||response.code === statusCode.FAILURE_CODE_5002) {
+          location.reload();
+        } else if (
+          response.code === statusCode.FAILURE_CODE_5001 ||
+          response.code === statusCode.FAILURE_CODE_5002
+        ) {
           showLoginTips();
         }
-      })
+      });
       showLoginTips.__is_show = false;
     },
   });
@@ -115,107 +116,105 @@ function getCookie(objname) {
 }
 
 export function getToken() {
-  return (
-     localStorage.getItem("token") || getCookie("fdkankantoken") || ""
-  );
+  return localStorage.getItem("token") || getCookie("fdkankantoken") || "";
 }
 
 export function statusCodesHandler(result, callback) {
-  
-
   if (result.code == statusCode.FAILURE_CODE_3002) {
-    $alert({ content: i18n.t('tips_code.need_one') });
-    return false
+    $alert({ content: i18n.t("tips_code.need_one") });
+    return false;
   }
 
   if (result.code == statusCode.FAILURE_CODE_3003) {
-    $alert({ content: i18n.t('tips_code.not_less_than') })
-    return false
+    $alert({ content: i18n.t("tips_code.not_less_than") });
+    return false;
   }
 
   if (result.code == statusCode.FAILURE_CODE_3005) {
-    $alert({ content: i18n.t('tips_code.FAILURE_3011') });
-    return false
+    $alert({ content: i18n.t("tips_code.FAILURE_3011") });
+    return false;
   }
   if (result.code == statusCode.FAILURE_CODE_3011) {
-    $alert({ content: i18n.t('tips_code.FAILURE_3011') });
-    return false
+    $alert({ content: i18n.t("tips_code.FAILURE_3011") });
+    return false;
   }
-  
-  
+
   if (result.code == statusCode.FAILURE_CODE_3006) {
-    $alert({ content: i18n.t('tips_code.work_had_delete') });
-    return
+    $alert({ content: i18n.t("tips_code.work_had_delete") });
+    return;
   }
 
   if (result.code == statusCode.FAILURE_CODE_3007) {
-    $alert({ content: i18n.t('tips_code.material_can_not_delete') });
-    return
+    $alert({ content: i18n.t("tips_code.material_can_not_delete") });
+    return;
   }
 
   if (result.code == statusCode.FAILURE_CODE_3101) {
-    $alert({ content: i18n.t('tips_code.FAILURE_3101') });
-    return
+    $alert({ content: i18n.t("tips_code.FAILURE_3101") });
+    return;
   }
   if (result.code == statusCode.FAILURE_CODE_3104) {
-    $alert({ content: i18n.t('tips_code.FAILURE_3104') });
-    return
+    $alert({ content: i18n.t("tips_code.FAILURE_3104") });
+    return;
   }
 
-  if (result.code == statusCode.FAILURE_CODE_5001||result.code === statusCode.FAILURE_CODE_5002) {
+  if (
+    result.code == statusCode.FAILURE_CODE_5001 ||
+    result.code === statusCode.FAILURE_CODE_5002
+  ) {
     callback(result.code);
     showLoginTips();
-    return false
+    return false;
   }
 
   if (result.code == statusCode.FAILURE_CODE_5003) {
-    $alert({ content: i18n.t('tips_code.illegality_image') })
-    return false
+    $alert({ content: i18n.t("tips_code.illegality_image") });
+    return false;
   }
 
   if (result.code == statusCode.FAILURE_CODE_5004) {
-    vue.$msg.error(i18n.t('tips_code.password_error'));
-    return false
+    vue.$msg.error(i18n.t("tips_code.password_error"));
+    return false;
   }
 
   if (result.code == statusCode.FAILURE_CODE_3024) {
     if (!isDiglog) {
-      isDiglog = true
+      isDiglog = true;
       $alert({
-        content: i18n.t('tips_code.FAILURE_3024'),
+        content: i18n.t("tips_code.FAILURE_3024"),
         forceOK: true,
         ok: () => {
-          isDiglog = false
+          isDiglog = false;
         },
       });
     }
-    return false
+    return false;
   }
 
-  if (result.code != statusCode.SUCCESS) {
+  if (![statusCode.SUCCESS,200].includes(result.code) ) {
     console.log(result.msg);
     $alert({ content: `${result.msg}` });
-    return false
+    return false;
   }
   return statusCode.NEXT;
 }
 
 $.ajaxSetup({
   headers: {},
-  beforeSend: function(xhr) {
+  beforeSend: function (xhr) {
     const token = getToken();
     if (token) {
       xhr.setRequestHeader("token", token);
     }
   },
-  error: function() {
+  error: function () {
     // 出错时默认的处理函数
     if (__showNetworkError) {
       return;
     }
     __showNetworkError = true;
     $alert({
-      content: i18n.t('tips_code.FAILURE_error'),
+      content: i18n.t("tips_code.FAILURE_error"),
       forceOK: true,
       ok: () => {
         __showNetworkError = false;
@@ -223,9 +222,8 @@ $.ajaxSetup({
     });
     return;
   },
-  success: function() {},
-  complete: function(data) {
-  },
+  success: function () {},
+  complete: function (data) {},
 });
 
 export const http = {
@@ -239,25 +237,28 @@ export const http = {
     }
 
     xhr.done((result) => {
-      if (typeof result.code !== "undefined") { 
-        const flag = statusCodesHandler(result, function(code) {
+      if (typeof result.code !== "undefined") {
+        const flag = statusCodesHandler(result, function (code) {
           // 需要登录的状态
-          if (code == statusCode.FAILURE_CODE_5001||code === statusCode.FAILURE_CODE_5002) {
-            postQueue.push(function() {
+          if (
+            code == statusCode.FAILURE_CODE_5001 ||
+            code === statusCode.FAILURE_CODE_5002
+          ) {
+            postQueue.push(function () {
               http[method](url, data, done, fail);
             });
           }
         });
 
         if (!flag) {
-          fail(result)
+          fail(result);
         }
 
         if (flag === statusCode.NEXT) {
           done(result, result.code == 0);
         }
       } else {
-        console.log('ajax返回数据里没有code.')
+        console.log("ajax返回数据里没有code.");
         done(result);
       }
     });
@@ -384,6 +385,26 @@ export const http = {
       fail
     );
   },
+  postJsonWithHeader(url, data = {}, headers, done, fail) {
+    return this.__request(
+      $.ajax({
+        type: "POST",
+        url: url,
+        contentType: "application/json",
+        data: JSON.stringify(data),
+        headers: headers,
+        beforeSend: function (xhr) {
+          xhr.headers = null;
+          //  console.log(xhr.headers)
+        },
+      }),
+      "postJson",
+      url,
+      data,
+      done,
+      fail
+    );
+  },
   /**
    * Post 表单 支持文件上传
    * @param {String} url 请求地址
@@ -400,19 +421,18 @@ export const http = {
           processData: false,
           contentType: false,
           data: formData,
-          xhr: function() {
+          xhr: function () {
             const xhr = new XMLHttpRequest();
-            xhr.upload.addEventListener("progress", function(e) {
+            xhr.upload.addEventListener("progress", function (e) {
               onProgress(e.loaded / e.total);
             });
             xhr.onabort = () => {
-              console.log('xhr aborted.');
-            }
+              console.log("xhr aborted.");
+            };
             return xhr;
           },
           // 覆盖全局配置的失败回调。因为无论是上传子集失败还是用户取消了上传,都不需要弹窗。
-          error: function() {
-          },
+          error: function () {},
         }),
         "postForm",
         url,
@@ -454,13 +474,13 @@ export const http = {
         .fail(def.reject.bind(def));
     };
 
-    img.onerror = function() {
+    img.onerror = function () {
       retry > 0
         ? setTimeout(() => load(), 1e3)
-        : def.reject(`[${url}]${i18n.t('tips_code.loading_fail')}`);
+        : def.reject(`[${url}]${i18n.t("tips_code.loading_fail")}`);
     };
 
-    img.onload = function() {
+    img.onload = function () {
       def.resolve(img);
     };
 

+ 10 - 1
packages/qjkankan-editor/src/views/mask/setting.vue

@@ -272,6 +272,15 @@ export default {
       deep: true,
       immediate: true,
     },
+    "currentScene.id": {
+      handler(val, oldVal) {
+        if (val && val !== oldVal) {
+          this.isApplyEarthToAll = false;
+          this.isApplySkyToAll = false;
+        }
+      },
+      immediate: true,
+    },
   },
   mounted() {},
   methods: {
@@ -284,7 +293,7 @@ export default {
       this.sky.icon = "";
     },
     onClickCancelEarthLogo() {
-      this.handlePeakURL("static/template/skin/masking.png");
+      this.handleNadirURL("static/template/skin/masking.png");
       this.earth.fodderId = "";
       this.earth.icon = "";
     },