fix:更新已知bug,优化代码

This commit is contained in:
Ying
2022-11-28 19:11:12 +08:00
parent f6aee95cfc
commit 9445b206a2
1378 changed files with 53759 additions and 20789 deletions

View File

@@ -1,14 +1,37 @@
/**
* SAPHP 前端CommonJS
* 前端CommonJS
* 默认提供一些基础的页面交互操作
* 注插件开发请勿直接将JS代码写入此文件
*/
layui.use(['jquery','form','upload'], function(){
layui.use(['jquery','form','upload','table','dropdown'], function(){
let $ = layui.$;
let form = layui.form;
let layer = layui.layer;
let table = layui.table;
let upload = layui.upload;
let dropdown = layui.dropdown;
/**
* 短消息下拉框
* @param count
*/
window.bellMessage = function (count) {
let msg = dropdown.render({
elem: '#notice'
, trigger: 'hover'
, align: 'center'
, data: [{
title: !count ? '暂无消息' : '您有<b class="msg">' + count + '</b>条未读消息'
}], ready: function (elemPanel, elem) {
}
, click: function (data, othis) {
let elem = $('.layui-nav-tree li [lay-href="/user/message"]');
$(elem).parents('.layui-nav-item').addClass('layui-nav-itemed');
$(elem).trigger('click');
}
});
}
// 注册为全局对象
window.Home = {
@@ -139,7 +162,7 @@ layui.use(['jquery','form','upload'], function(){
obj && obj.call(this, $(this));
});
var uploadURL = '/user/upload';
var uploadURL = '/index/user/upload';
layui.each($('*[lay-upload]'), function (index, elem) {
var that = $(this),
@@ -207,6 +230,7 @@ layui.use(['jquery','form','upload'], function(){
})
// 全局监听打开窗口
$(document).on('click',"*[lay-open]",function(){
let clickthis = $(this),
@@ -271,15 +295,9 @@ layui.use(['jquery','form','upload'], function(){
post.field, function(res){
if (res.code === 200) {
Home.event.closeDialog(that);
/**
* 当前这个页面,也需要写成是否重载
* 支持哪种重载方式,父页面 自身,还是其他。
*/
if ($(that).data('reload')) {
location.reload();
}
layer.msg(res.msg);
} else {
layer.msg(res.msg,'error');
@@ -294,6 +312,52 @@ layui.use(['jquery','form','upload'], function(){
})
})
$(document).on("click", "*[lay-batch]", function (obj) {
var othis = $(this)
, tableId = othis.data("table") || null
, fields = othis.data("field") || undefined
, list = table.checkStatus(tableId);
var field = ['id'];
if (typeof fields !== 'undefined') {
field = field.concat(fields.split(','));
}
if (list.data.length === 0) {
layer.msg('请勾选数据', 'error');
return false;
}
var data = {};
for (var n in field) {
var e = field[n];
field[e] = [];
for (var i in list.data) {
field[e].push(list.data[i][e]);
}
data[e] = field[e];
}
layer.confirm('确定执行批量操作', function (index) {
$.ajax({
url: othis.data("url"),
type: 'post',
data: data,
dataType: 'json',
success: function (res) {
if (res.code === 200) {
layer.msg(res.msg);
table.reload(tableId);
} else {
layer.msg(res.msg, 'error');
}
}
})
layer.close(index);
})
})
// 监听ajax操作
$(document).on("click","*[lay-ajax]",function(obj) {

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
/*!
* wordcloud2.js
* http://timdream.org/wordcloud2.js/
*
* Copyright 2011 - 2019 Tim Guan-tin Chien and contributors.
* Released under the MIT license
*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1926,12 +1926,10 @@ div[data-type=codeBlock] .token.inserted {
}
.cherry {
font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
font-size: 16px;
line-height: 27px;
line-height: 25px;
color: #3f4a56;
background: #f8fafb;
box-shadow: 0 0 10px rgba(128, 145, 165, 0.2);
}
.cherry .ch-icon {
vertical-align: middle;

View File

@@ -1 +1 @@
!function(){"use strict";var a=tinymce.util.Tools.resolve("tinymce.PluginManager"),t="图片本地化",e=function(a){var e=function(){const t=a.getDoc().getElementsByTagName("img");t.length>=1?void 0!==a.settings.download?function(a,t,e){var i=[],l=location.origin;if(a.length>=1){for(var n in a){var o=a[n].src;o&&-1!==(o=o.replace(l,"")).indexOf("://")&&i.push(a[n])}if(i.length>=1){var r=0,c=layui.layer.load(),s=function(a){var e=new FormData;e.append("url",a),layui.$.ajax({url:t,type:"post",data:e,contentType:!1,processData:!1,dataType:"json",success:function(a){200===a.code?(layui.$(i[r]).attr("src",a.url),layui.$(i[r]).attr("data-mce-src",a.url),layui.$(i[r]).each((function(){try{layui.$.each(this.attributes,(function(){-1===["src","alt","width","height","data-mce-src"].lastIndexOf(this.name)&&$(i[r]).removeAttr(this.name)}))}catch(a){}})),(r+=1)>=i.length?(layui.layer.close(c),layui.layer.msg("远程同步已完成")):s(i[r].src)):(layui.layer.close(c),layui.layer.msg(a.msg,"error"))},error:function(){layui.layer.close(c),layui.layer.msg("请求上传接口出现异常","info")}})};s(i[r].src)}else layui.layer.msg("无需同步或已完成");e.focus()}}(t,a.settings.download,a):layui.layer.msg("请配置前端同步地址","info"):layui.layer.info("暂无图片需要同步")};a.ui.registry.addButton("imagelocal",{icon:"imglocal",tooltip:t,onAction:e}),a.ui.registry.addMenuItem("imagelocal",{icon:"imglocal",text:t,onAction:e})};a.add("imagelocal",(function(a){return e(a),{}}))}();
!function(){"use strict";var a=tinymce.util.Tools.resolve("tinymce.PluginManager"),t="图片本地化",e=function(a){var e=function(){const t=a.getDoc().getElementsByTagName("img");t.length>=1?void 0!==a.settings.download?function(a,t,e){var i=[],l=location.origin;if(a.length>=1){for(var n in a){var o=a[n].src;o&&-1!==(o=o.replace(l,"")).indexOf("://")&&i.push(a[n])}if(i.length>=1){var r=0,c=layui.layer.load(),s=function(a){var e=new FormData;e.append("url",a),layui.$.ajax({url:t,type:"post",data:e,contentType:!1,processData:!1,dataType:"json",success:function(a){200===a.code?(layui.$(i[r]).attr("src",a.url),layui.$(i[r]).attr("data-mce-src",a.url),layui.$(i[r]).each((function(){try{layui.$.each(this.attributes,(function(){-1===["src","alt","width","height","data-mce-src"].lastIndexOf(this.name)&&$(i[r]).removeAttr(this.name)}))}catch(a){}})),(r+=1)>=i.length?(layui.layer.close(c),layui.layer.msg("远程同步已完成")):s(i[r].src)):(layui.layer.close(c),layui.layer.msg(a.msg,"error"))},error:function(){layui.layer.close(c),layui.layer.msg("请求上传接口出现异常")}})};s(i[r].src)}else layui.layer.msg("无需同步或已完成");e.focus()}}(t,a.settings.download,a):layui.layer.msg("请配置前端同步地址"):layui.layer.msg("暂无图片需要同步")};a.ui.registry.addButton("imagelocal",{icon:"imglocal",tooltip:t,onAction:e}),a.ui.registry.addMenuItem("imagelocal",{icon:"imglocal",text:t,onAction:e})};a.add("imagelocal",(function(a){return e(a),{}}))}();