From 40b5d4f99fd9a1fe340f828e364b8b2834f8237c Mon Sep 17 00:00:00 2001 From: dev01 Date: Mon, 21 Nov 2022 10:52:10 +0800 Subject: [PATCH] =?UTF-8?q?[Frontend][=E5=B8=B3=E8=99=9F=E7=AE=A1=E7=90=86?= =?UTF-8?q?]=20=E5=B8=B3=E8=99=9F=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=B8=B2=E6=8E=A5=20=E9=A9=97=E8=AD=89?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=BB=BA=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_accountManagement.html | 241 +++++++++++++++++++++++++++++-- Frontend/css/site.css | 38 +++-- Frontend/index.html | 2 + Frontend/js/init.js | 9 ++ Frontend/js/site.js | 31 +++- Frontend/login.html | 4 +- 6 files changed, 295 insertions(+), 30 deletions(-) diff --git a/Frontend/_accountManagement.html b/Frontend/_accountManagement.html index b393da3..26483a0 100644 --- a/Frontend/_accountManagement.html +++ b/Frontend/_accountManagement.html @@ -35,9 +35,8 @@
搜尋
- + -
@@ -54,7 +53,6 @@
-
@@ -64,7 +62,6 @@
@@ -72,7 +69,6 @@
-
@@ -81,7 +77,197 @@ + + + + + + + diff --git a/Frontend/css/site.css b/Frontend/css/site.css index 9883cbf..a4c5944 100644 --- a/Frontend/css/site.css +++ b/Frontend/css/site.css @@ -1,20 +1,4 @@  -.mod-skin-dark:not(.mod-skin-light) .panel-hdr, .mod-skin-dark:not(.mod-skin-light) .card-header { - background: rgba(0, 0, 0, 0.03); -} - -.btn-sm-2 { - padding: 2px 19px; -} - -.table.dataTable td { - word-break:break-all; -} - -/* ================================================================ */ -/* 單一方法 */ -/* ================================================================ */ - :root { --yt-main-gray: #c2c7d0; --yt-main-black: #212529; @@ -31,6 +15,28 @@ --yt-yellow-1:#ffc902; } + +.mod-skin-dark:not(.mod-skin-light) .panel-hdr, .mod-skin-dark:not(.mod-skin-light) .card-header { + background: rgba(0, 0, 0, 0.03); +} + +.btn-sm-2 { + padding: 2px 19px; +} + +.table.dataTable td { + word-break:break-all; +} + +label[id$='-error'].error { + color: var(--yt-red-2); +} + +/* ================================================================ */ +/* 單一方法 */ +/* ================================================================ */ + + /* cursor */ .cur-def { cursor:default !important;} .cur-poi { cursor:pointer !important;} diff --git a/Frontend/index.html b/Frontend/index.html index 6a9123b..f7bd99e 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -2055,6 +2055,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li + + diff --git a/Frontend/js/init.js b/Frontend/js/init.js index 0cfa7bb..d64bf4e 100644 --- a/Frontend/js/init.js +++ b/Frontend/js/init.js @@ -6,6 +6,15 @@ var varApiUrl = "/api/"; //API路徑 var varPathImg = "/Upload/Images/"; var varPathFile = "/Upload/Files/"; var statusArr = { 1: "啟用", 0: "未啟用", 9: "刪除" }; +var common = { + AddSuc:"新增成功", + EditSuc:"編輯成功", + DelSuc:"刪除成功", + AddErr:"新增失敗,", + EditErr:"編輯失敗,", + DelErr: "刪除失敗,", + SysErr: "系統內部發生錯誤,請聯繫系統管理員" +} var objSendData = { Data: null }; //重新轉址 for Niagara4 diff --git a/Frontend/js/site.js b/Frontend/js/site.js index bbce83b..7f44ca7 100644 --- a/Frontend/js/site.js +++ b/Frontend/js/site.js @@ -19,6 +19,30 @@ $.fn.outerHtml = function () { return $(this).prop("outerHTML"); } +/** + * jquery validate 初始設定 | 輸出含原元素 html + */ +$.validator.setDefaults({ + onkeyup: function (element, event) { + $(element).valid(); + }, + //errorPlacement: function (error, element) { + // if (element.hasClass("removedTitle")) + // error.insertAfter(element.next("img")); + // else + // error.insertAfter(element); + //} +}); + +jQuery.validator.addMethod("phone", function (phoneNumber, element) { + phoneNumber = phoneNumber.replace(/\s+/g, ""); + return phoneNumber.match(/^[0-9]{9,10}$/); +}, "請輸入正確電話號碼格式"); + +jQuery.validator.addMethod("dbLimit", function (value, element,param) { + return value.length > param; +}, "超出輸入限制"); + /** * 設置 bootstrap dropdown 為下拉選單 * @param {any} menuEle .dropdown-menu element @@ -41,6 +65,10 @@ function setDropdownItem(menuEle) { }) } +onEvent("click", "[e-prevent]", function (e) { + e.preventDefault(); +}) + /** * 預設設備圖像 * @param {any} obj @@ -55,6 +83,7 @@ function dtAjaxResetSendData(table,sendData) { d = sendData; return JSON.stringify(d) } + table.ajax.reload(); } /** @@ -102,6 +131,6 @@ function creSelect(id = null, cls = [], name = null, data = {}, attr = {}, text } function creOption(text = null, value = null, data = {}, attr = {}, cls = [], name = null, id = null) { - attr = value != null ? attr.value = value : attr; + value != null ? attr.value = value : ""; return creEle("option", text, id, name, cls, data, attr); } \ No newline at end of file diff --git a/Frontend/login.html b/Frontend/login.html index 0a0456b..35bb7e4 100644 --- a/Frontend/login.html +++ b/Frontend/login.html @@ -177,8 +177,6 @@ contentType:"application/json; charset=UTF-8", dataType: 'json', success: function (rel) { - console.log(rel) - //rel = JSON.stringify(rel); if (rel.code != "0000") { toast_error(rel.msg || "系統內部發生錯誤,請聯絡系統管理員"); @@ -192,7 +190,7 @@ } }, error: function (xhr, textStatus, thrownError) { - alert(textStatus); + toast_error(textStatus); } }); }