Sai Sudheer 2 лет назад
Родитель
Сommit
c407874e58
1 измененных файлов: 69 добавлений и 21 удалений
  1. 69
    21
      assets/js/list.index.js

+ 69
- 21
assets/js/list.index.js Просмотреть файл

3
 
3
 
4
 import {getData, getDataObj} from "./base.js";
4
 import {getData, getDataObj} from "./base.js";
5
 import {_serverUrl} from "./setting.js";
5
 import {_serverUrl} from "./setting.js";
6
+
6
 function createLoad(data) {
7
 function createLoad(data) {
7
   let html = "";
8
   let html = "";
8
   if (data.length != 0) {
9
   if (data.length != 0) {
26
     let pk_id = 0;
27
     let pk_id = 0;
27
     const cookie = getCookie("_idty");
28
     const cookie = getCookie("_idty");
28
     let fomrhtml = "";
29
     let fomrhtml = "";
30
+    let width = iFrmeWdth();
29
     if (cookie) {
31
     if (cookie) {
30
       const {unibaseId, tenantId, userId} = JSON.parse(cookie);
32
       const {unibaseId, tenantId, userId} = JSON.parse(cookie);
31
-      fomrhtml = `<div class="frm-ifre frm-ifre-${number}" id="frm-ifre-${number}">
32
-                  <ul class="m-0 p-0">
33
-                    <li class="frm-hdr">
34
-                      <div>${appName}</div>
35
-                      <div class="ctrl">
36
-                        <a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
37
-                        <a href="javascript:;" class="maximum" data-unid="${number}"><span><i class="la la-expand"></i></span></a>
38
-                        <a href="javascript:;" class="compress d-none" data-unid="${number}"><span><i class="las la-compress"></i></span></a>
39
-                        <a href="javascript:;" class="close" data-unid="${number}"><span><i class="la la-times"></i></span></a>
33
+
34
+      fomrhtml = `<div>
35
+                    <div class="frm-ifre frm-ifre-${number}" id="frm-ifre-${number}" style="right:${width}px">
36
+                      <div>
37
+                        <ul class="m-0 p-0">
38
+                          <li class="frm-hdr">
39
+                            <div class="app-title-ifrm">${appName}</div>
40
+                            <div class="ctrl">
41
+                              <a href="javascript:;" class="minimize" data-unid="${number}" data-ispopup="true"><span><i class="la la-minus"></i></span></a>
42
+                              <a href="javascript:;" class="maximum" data-unid="${number}"><span><i class="la la-expand"></i></span></a>
43
+                              <a href="javascript:;" class="compress d-none" data-unid="${number}"><span><i class="las la-compress"></i></span></a>
44
+                              <a href="javascript:;" class="close" data-unid="${number}"><span><i class="la la-times"></i></span></a>
45
+                            </div>
46
+                          </li>
47
+                          <li class="frm-bdy">
48
+                            <iframe class="ld-frm-src" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${formId}/${pk_id}/${appConfigurationId}/loadform"></iframe>
49
+                          </li>
50
+                          <li class="frm-ftr"></li>
51
+                        </ul>
40
                       </div>
52
                       </div>
41
-                    </li>
42
-                    <li class="frm-bdy">
43
-                      <iframe class="ld-frm-src" data-ispopup="false" src="${serverUrl}#/${unibaseId}/${tenantId}/${userId}/${installedAppId}/${formId}/${pk_id}/${appConfigurationId}/loadform"></iframe>
44
-                    </li>
45
-                    <li class="frm-ftr"></li>
46
-                  </ul>
47
-                </div>`;
53
+                    </div>
54
+                  </div>`;
48
     }
55
     }
49
-    $("#list-page").after(fomrhtml);
56
+    $("#list-page").append(fomrhtml);
50
     window.window.postMessage("ld-frm-ifrme", "*");
57
     window.window.postMessage("ld-frm-ifrme", "*");
51
     hdrCrtnClckEvnt(number);
58
     hdrCrtnClckEvnt(number);
52
   });
59
   });
53
 }
60
 }
61
+
54
 function hdrCrtnClckEvnt(number) {
62
 function hdrCrtnClckEvnt(number) {
55
   $(`.frm-ifre-${number} .minimize`).on("click", function () {
63
   $(`.frm-ifre-${number} .minimize`).on("click", function () {
56
     let id = $(this).attr("data-unid");
64
     let id = $(this).attr("data-unid");
57
     let isPopUpState = $(this).attr("data-ispopup");
65
     let isPopUpState = $(this).attr("data-ispopup");
58
     let height = $(`.frm-ifre-${id}`).find(".frm-hdr").height();
66
     let height = $(`.frm-ifre-${id}`).find(".frm-hdr").height();
67
+    $(".list-page").css({filter: "unset", opacity: 1});
59
     $(`.frm-ifre-${id} .frm-bdy`).toggleClass("d-none");
68
     $(`.frm-ifre-${id} .frm-bdy`).toggleClass("d-none");
60
     if (isPopUpState == "true") {
69
     if (isPopUpState == "true") {
61
       // popup large
70
       // popup large
62
       $(this).attr("data-ispopup", "false");
71
       $(this).attr("data-ispopup", "false");
72
+      $(`.frm-ifre-${id} .maximum`).addClass("d-none");
73
+      $(`.frm-ifre-${id}`).parent().removeClass("wrap-iframe");
74
+      $(`.frm-ifre-${id}`).attr("data-ispop_up", "false");
63
       $(`.frm-ifre-${id}`).css({
75
       $(`.frm-ifre-${id}`).css({
64
-        width: "22%",
76
+        width: "20%",
65
         height: height,
77
         height: height,
66
         bottom: "0px",
78
         bottom: "0px",
67
       });
79
       });
68
     } else {
80
     } else {
69
       // popup small
81
       // popup small
70
       $(this).attr("data-ispopup", "true");
82
       $(this).attr("data-ispopup", "true");
83
+      $(`.frm-ifre-${id} .maximum`).removeClass("d-none");
84
+      $(`.frm-ifre-${id}`).attr("data-ispop_up", "true");
71
       $(`.frm-ifre-${id}`).css({
85
       $(`.frm-ifre-${id}`).css({
72
         width: "",
86
         width: "",
73
         height: "",
87
         height: "",
74
         bottom: "",
88
         bottom: "",
75
       });
89
       });
76
     }
90
     }
91
+    resetwidth();
77
   });
92
   });
78
   $(`.frm-ifre-${number} .maximum`).on("click", function () {
93
   $(`.frm-ifre-${number} .maximum`).on("click", function () {
79
     let id = $(this).attr("data-unid");
94
     let id = $(this).attr("data-unid");
80
     $(this).addClass("d-none");
95
     $(this).addClass("d-none");
81
     $(this).siblings(".compress").removeClass("d-none");
96
     $(this).siblings(".compress").removeClass("d-none");
82
     $(`.frm-ifre-${id}`).find(".ld-frm-src").attr("data-ispopup", "true");
97
     $(`.frm-ifre-${id}`).find(".ld-frm-src").attr("data-ispopup", "true");
83
-    $(`.frm-ifre-${id}`).css({width: "75%", height: "", bottom: "auto"});
98
+    $(`.frm-ifre-${id}`).parent().addClass("wrap-iframe");
99
+    $(`.frm-ifre-${id}`).css({width: "75%", position: "unset"});
84
     $(`.frm-ifre-${id} .ld-frm-src`).css({width: "100%"});
100
     $(`.frm-ifre-${id} .ld-frm-src`).css({width: "100%"});
85
     $(`.frm-ifre-${id} .frm-bdy`).removeClass("d-none");
101
     $(`.frm-ifre-${id} .frm-bdy`).removeClass("d-none");
86
     $("#list-page").css({filter: "blur(2px)", opacity: "0.5"});
102
     $("#list-page").css({filter: "blur(2px)", opacity: "0.5"});
103
+    $(`.frm-ifre-${id}`).find(".minimize").toggleClass("d-none");
87
   });
104
   });
88
   $(`.frm-ifre-${number} .compress`).on("click", function () {
105
   $(`.frm-ifre-${number} .compress`).on("click", function () {
89
     let id = $(this).attr("data-unid");
106
     let id = $(this).attr("data-unid");
90
     $(this).addClass("d-none");
107
     $(this).addClass("d-none");
91
     $(this).siblings(".maximum").removeClass("d-none");
108
     $(this).siblings(".maximum").removeClass("d-none");
92
-    $(`.frm-ifre-${id}`).css({width: "", bottom: ""});
109
+    $(`.frm-ifre-${id}`).parent().removeClass("wrap-iframe");
110
+    $(`.frm-ifre-${id}`).css({width: "", position: ""});
93
     $(`.frm-ifre-${id} .ld-frm-src`).css({width: ""});
111
     $(`.frm-ifre-${id} .ld-frm-src`).css({width: ""});
94
     $("#list-page").css({filter: "", opacity: ""});
112
     $("#list-page").css({filter: "", opacity: ""});
113
+    $(`.frm-ifre-${id}`).find(".minimize").toggleClass("d-none");
95
   });
114
   });
96
   $(`.frm-ifre-${number} .close`).on("click", function () {
115
   $(`.frm-ifre-${number} .close`).on("click", function () {
97
     let id = $(this).attr("data-unid");
116
     let id = $(this).attr("data-unid");
98
     $("#list-page").css({filter: "unset", opacity: "1"});
117
     $("#list-page").css({filter: "unset", opacity: "1"});
99
-    $(`.frm-ifre-${id}`).remove();
118
+    $(`.frm-ifre-${id}`).parent().remove();
119
+    resetwidth();
100
   });
120
   });
101
 }
121
 }
102
 function loadData() {
122
 function loadData() {
284
     });
304
     });
285
   });
305
   });
286
 }
306
 }
307
+function iFrmeWdth() {
308
+  let width = 0,
309
+    erwdth = 20;
310
+  $(".frm-ifre").each(function (i, e) {
311
+    if ($(this).length == 0) {
312
+      erwdth = 0;
313
+    }
314
+    if (window.innerWidth > width) {
315
+      width = width + $(this).width() + erwdth;
316
+    }
317
+  });
318
+  return width;
319
+}
320
+function resetwidth() {
321
+  let width = 0,
322
+    erwdth = 20;
323
+  $(".frm-ifre").each(function (i, e) {
324
+    if (i == 0) {
325
+      $(this).css("right", width + "px");
326
+    }
327
+    if (i != 0) {
328
+      $(this).css("right", width + "px");
329
+    }
330
+    if (window.innerWidth > width) {
331
+      width = width + $(this).width() + erwdth;
332
+    }
333
+  });
334
+}
287
 export function detailClick() {
335
 export function detailClick() {
288
   $(".detailBtn").click(function () {
336
   $(".detailBtn").click(function () {
289
     let serverUrl = _serverUrl();
337
     let serverUrl = _serverUrl();

Загрузка…
Отмена
Сохранить