tujidelv 1 рік тому
батько
коміт
d71251b334

+ 1 - 1
src/main/resources/env/dev/redisson.yml

@@ -10,7 +10,7 @@ singleServerConfig:
   password: foobared
   subscriptionsPerConnection: 5
   clientName: null
-  address: "redis://204.13.154.148:6379"
+  address: "redis://34.97.253.204:6379"
   subscriptionConnectionMinimumIdleSize: 1
   subscriptionConnectionPoolSize: 50
   connectionMinimumIdleSize: 50

+ 19 - 0
src/main/resources/static/coin.html

@@ -11,6 +11,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
     <link rel="shortcut icon" href="cover/bitcoin.ico" type="image/x-icon">
     <link rel="stylesheet" href="css/my-av.css" type="text/css">
+    <link rel="stylesheet" href="css/my-popup.css" type="text/css">
     <script src="js/jquery-3.6.0.min.js"></script>
     <script type="text/javascript" src="js/login.js"></script>
     <script type="text/javascript" src="js/my-coin.js"></script>
@@ -293,6 +294,7 @@
         <div id="apis-quiet-div" style="height: 24px;margin-right: 10px;">
             <button class="apis-quiet-div-button1" slideDiv="apis-quiet-content">展开</button>
             <button class="apis-quiet-div-button2" slideDiv="apis-quiet-content">查询</button>
+            <button class="apis-quiet-div-button3" slideDiv="apis-quiet-pop">新增</button>
         </div>
         <div id="apis-quiet-div-watchlist" style="display: none;">
             <button class="apis-quiet-div-button3" slideDiv="apis-quiet-content" pageO="prev">上一页</button>
@@ -658,5 +660,22 @@
     </div>
     <div class="musicpreview-content"></div>
 </div>
+
+<div class="popup" id="draggable-popup">
+    <button class="close-btn">&times;</button>
+    <h2>表单弹窗</h2>
+    <form id="popup-form">
+        <!-- 表单内容容器 -->
+        <div id="form-container">
+
+        </div>
+        <!-- 按钮容器 -->
+        <div class="form-buttons">
+            <button type="submit">提交</button>
+            <button type="reset" id="reset-button">重置</button>
+        </div>
+    </form>
+</div>
+
 </body>
 </html>

+ 115 - 0
src/main/resources/static/css/my-popup.css

@@ -0,0 +1,115 @@
+/* 弹窗的基础样式 */
+.popup {
+    display: none;
+    position: fixed;
+    top: 20%;
+    left: 30%;
+    width: 400px; /* 设置宽度适当的弹窗 */
+    background: #fff;
+    border: 1px solid #ccc;
+    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
+    padding: 20px;
+    z-index: 1000;
+    cursor: move;
+    overflow: hidden;
+}
+
+.popup h2 {
+    margin: 0 0 10px;
+    text-align: center;
+    cursor: move;
+}
+
+.popup form {
+    display: flex;
+    flex-direction: column;
+    gap: 15px;
+}
+
+.popup form .form-item {
+    display: flex;
+    align-items: center;
+    gap: 10px;
+    width: 100%;
+    margin-bottom: 10px; /* 调整每个表单项之间的垂直间距 */
+}
+
+.popup form label {
+    flex: 0 0 30%;  /* 标签占据容器的 30% 宽度 */
+    font-size: 14px;
+    text-align: right;
+    margin-right: 10px; /* 标签和输入框之间的间距 */
+    white-space: nowrap;  /* 防止标签文本换行 */
+    overflow: hidden;
+    text-overflow: ellipsis;  /* 标签文本过长时显示省略号 */
+}
+
+.popup form select {
+    flex: 1; /* 下拉框占据剩余的空间 */
+    padding: 8px;
+    font-size: 14px;
+    width: 100%;  /* 使下拉框自适应填充容器 */
+}
+
+.popup form input {
+    flex: 1; /* 让输入框自适应宽度 */
+    padding: 8px;
+    font-size: 14px;
+    width: 100%;
+}
+
+.popup form button {
+    padding: 10px;
+    font-size: 14px;
+    background-color: #007bff;
+    color: #fff;
+    border: none;
+    cursor: pointer;
+}
+
+.popup form button:hover {
+    background-color: #0056b3;
+}
+
+.close-btn {
+    background: none;
+    border: none;
+    font-size: 16px;
+    color: #555;
+    cursor: pointer;
+    position: absolute;
+    top: 10px;
+    right: 10px;
+}
+
+@keyframes spin {
+    0% { transform: rotate(0deg); }
+    100% { transform: rotate(360deg); }
+}
+
+/* 按钮容器样式 */
+.form-buttons {
+    display: flex;
+    justify-content: space-between;
+    margin-top: 20px;
+}
+
+.form-buttons button {
+    width: 48%;
+}
+
+/* 动态内容容器样式 */
+#form-container {
+    margin-top: 10px;
+}
+
+.form-item.dynamic {
+    display: flex;
+    align-items: center;
+    gap: 10px;
+    margin-bottom: 10px;
+}
+
+.form-item.dynamic input {
+    flex: 1;
+}

+ 113 - 0
src/main/resources/static/js/my-coin.js

@@ -99,6 +99,8 @@ function initOther() {
         mainSearch(url, nameEn, slideDiv, typetype,"2");
     });
 
+    initOther4Popup();
+
     $(".apis-move-div-button3").click(function () {
         ownClearInterval();
     });
@@ -1082,4 +1084,115 @@ function insertOrUpdateWatchlistSubmit(){
             console.log("insertOrUpdateWatchlist-submit error," + data);
         }
     });
+}
+
+function initOther4Popup(){
+    // 打开弹窗
+    $(".apis-quiet-div-button3").on("click", function () {
+        var selectedOption = $("select#apis-quiet-select").find("option:selected");
+        var url = selectedOption.attr("url");
+        var typetype = selectedOption.attr("typetype");
+        var nameEn = selectedOption.attr("nameEn");
+        var slideDiv = $(this).attr("slideDiv");
+        quietPop(url, nameEn, slideDiv, typetype);
+
+        $(".popup").fadeIn();
+        centerPopup();  // 调用居中函数
+    });
+
+    // 关闭弹窗
+    $(".close-btn").on("click", function () {
+        $(".popup").fadeOut();
+    });
+
+    // 阻止表单默认提交行为
+    $(".popup form").on("submit", function (e) {
+        e.preventDefault();
+        alert("表单已提交!");
+        $(".popup").fadeOut();
+    });
+
+    // 实现拖动功能
+    let isDragging = false;
+    let offsetX, offsetY;
+
+    $("#draggable-popup").on("mousedown", function (e) {
+        isDragging = true;
+        offsetX = e.clientX - $(this).offset().left;
+        offsetY = e.clientY - $(this).offset().top;
+        $(this).css("cursor", "grabbing"); // 改变鼠标指针样式
+    });
+
+    $(document).on("mousemove", function (e) {
+        if (isDragging) {
+            const left = e.clientX - offsetX;
+            const top = e.clientY - offsetY;
+            $("#draggable-popup").css({
+                left: `${left}px`,
+                top: `${top}px`,
+            });
+        }
+    });
+
+    $(document).on("mouseup", function () {
+        isDragging = false;
+        $("#draggable-popup").css("cursor", "move"); // 恢复鼠标指针样式
+    });
+
+    // 重置按钮的功能
+    $("#reset-button").on("click", function () {
+        $(".progress-container").fadeOut();  // 重置时隐藏进度条
+        $(".loading-icon").fadeOut();  // 重置时隐藏加载图标
+    });
+}
+
+// 计算并设置弹窗居中位置
+function centerPopup() {
+    const popup = $("#draggable-popup");
+    const windowWidth = $(window).width();
+    const windowHeight = $(window).height();
+    const popupWidth = popup.outerWidth();
+    const popupHeight = popup.outerHeight();
+
+    // 计算弹窗的位置
+    const left = (windowWidth - popupWidth) / 2;
+    const top = (windowHeight - popupHeight) / 2;
+
+    // 设置弹窗的位置
+    popup.css({
+        left: `${left}px`,
+        top: `${top}px`,
+    });
+}
+
+/**
+ * quietPop
+ * @param pageNo
+ */
+function quietPop(url, nameEn, slideDiv, typetype) {
+    if (nameEn === 'currentPlan' || nameEn === 'orderMarginCoinCurrent') {
+    } else if (nameEn === 'monitorCurrency') {
+    } else if (nameEn === 'allPositionv2') {
+    } else if (nameEn === 'orderHistoryProductType') {
+    } else if (nameEn === 'traderList') {
+    } else if (nameEn === 'watchlist') {
+        let formContent = "";
+        formContent += '<div class="form-item"><label for="symbol">名称:</label><input type="text" id="symbol" placeholder="不可为空"></div>';
+        formContent += '<div class="form-item"><label for="trackCategory">赛道分类:</label><input type="text" id="trackCategory" placeholder="可为空"></div>';
+        formContent += '<div class="form-item"><label for="trackCategory2">赛道分类2:</label><input type="text" id="trackCategory2" placeholder="可为空"></div>';
+        formContent += '<div class="form-item"><label for="issuingDate">发行日期:</label><input type="text" id="issuingDate" placeholder="可为空"></div>';
+        formContent += '<div class="form-item"><label for="cmcId">cmcId:</label><input type="text" id="cmcId" placeholder="可为空"></div>';
+        formContent += '<div class="form-item"><label for="coingeckoId">coingeckoId:</label><input type="text" id="coingeckoId" placeholder="可为空"></div>';
+        formContent += '<div class="form-item"><label for="coingeckoUrl">coingeckoUrl:</label><input type="text" id="coingeckoUrl" placeholder="可为空"></div>';
+        formContent += '<div class="form-item"><label for="feixiaohaoUrl">feixiaohaoUrl:</label><input type="text" id="feixiaohaoUrl" placeholder="可为空"></div>';
+        formContent += '<div class="form-item"><label for="filterFlag">filterFlag:</label><input type="text" id="filterFlag" placeholder="不可为空"></div>';
+        formContent += '<div class="form-item"><label for="crudType">crudType:</label><input type="text" id="crudType" placeholder="不可为空"></div>';
+        $("#form-container").html(formContent);
+    $(".quietpop-content").html("");
+    } else if (nameEn === 'image') {
+    } else if (nameEn === 'cmcmap') {
+    } else if (nameEn === 'music') {
+    } else if (nameEn === 'currentHolding') {
+    } else if (nameEn === 'bookmark') {
+    }
 }