From 5e7202951f1b444b2a3cacf40f7a6779de432340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?= <93301500+xushubieli@users.noreply.github.com> Date: Fri, 11 Nov 2022 14:51:51 +0800 Subject: [PATCH] Update main.js --- src/admin/js/main.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/admin/js/main.js b/src/admin/js/main.js index 2a9b0b4e..9fcabdc6 100644 --- a/src/admin/js/main.js +++ b/src/admin/js/main.js @@ -504,20 +504,20 @@ function getElementTop(element) { //Copyright 2020 The MuEMS Authors. All rights reserved. //license that can be found in the LICENSE file. //-----msgbox------------------------------------- -//生成一个随机ID +//生成一个随机id function guid() { function S4() { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); } return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); } -//函数会返回一个modalID,通过这个ID可自已定义一些方法,这里用到了一个展开语法https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax +//函数会返回一个modalID,通过这个id可自已定义一些方法,这里用到了一个展开语法https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax function ShowMsg(content, ...args) { title = "系统提示"; size = ""; if (typeof content == "undefined") content = ""; modalID = guid(); - var footer = ``; + var footer = ``; var noClose = false; if (args.length == 1) { //存在args参数 @@ -618,19 +618,19 @@ function uploadImage(litpicImgSrc) { method: 'POST', body: formData }) - .then(r => { - if (r.ok) { - return r.json() - } - throw new Error(errMsg); - }) - .then(d => { - if (d.code == 200) { - $("#picname").val(d.data.image_url); - } - }).catch((error) => { - alert("上传缩略图错误"); - }); + .then(r => { + if (r.ok) { + return r.json() + } + throw new Error(errMsg); + }) + .then(d => { + if (d.code == 200) { + $("#picname").val(d.data.image_url); + } + }).catch((error) => { + alert("上传缩略图错误"); + }); } $(document).ready(function () { $("#btnClearAll").click(function (event) { @@ -679,7 +679,7 @@ $(document).ready(function () {
`; mdlCropperID = ShowMsg( - '宽度:px,高度:px
' + optButton + '宽度:px,高度:px
' + optButton + '