“5f951508c5676bd87eae4cbf7dc2ceea15d30355”上不存在“...resources/v1alpha3/statefulset/statefulsets_test.go”
提交 27d567d7 编写于 作者: Skyeye云's avatar Skyeye云

加载图片插件优化

上级 f3a16004
...@@ -630,7 +630,6 @@ function getUserStaffHtmlMationByStaffId(staffId){ ...@@ -630,7 +630,6 @@ function getUserStaffHtmlMationByStaffId(staffId){
* @type {{}} * @type {{}}
*/ */
var stringManipulation = { var stringManipulation = {
textAreaShow: function(str){ textAreaShow: function(str){
// IE7-8、IE9、FF、chrome。解决textarea中输入的文字,输出到div中文字不换自动换行的问题 // IE7-8、IE9、FF、chrome。解决textarea中输入的文字,输出到div中文字不换自动换行的问题
return str.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>'); return str.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
...@@ -757,58 +756,25 @@ function getStateNameByState(state, stateName){ ...@@ -757,58 +756,25 @@ function getStateNameByState(state, stateName){
} }
function returnModel(lang){ function returnModel(lang){
var mode = ''; var type = {
switch (lang) { 'Java': 'text/x-java',
case 'Java': 'C/C++': 'text/x-c++src',
mode = 'text/x-java'; 'Objective-C': '',
break; 'Scala': 'text/x-scala',
case 'C/C++': 'Kotlin': 'text/x-kotlin',
mode = 'text/x-c++src'; 'Ceylon': 'text/x-ceylon',
break; 'xml': 'xml',
case 'Objective-C': 'html': 'xml',
mode = ''; 'css': 'text/css',
break; 'htmlmixed': 'htmlmixed',
case 'Scala': 'htmlhh': 'htmlmixed',
mode = 'text/x-scala'; 'javascript': 'text/javascript',
break; 'nginx': 'text/x-nginx-conf',
case 'Kotlin': 'solr': 'text/x-solr',
mode = 'text/x-kotlin'; 'sql': 'text/x-sql',
break; 'vue': 'text/x-vue'
case 'Ceylon': };
mode = 'text/x-ceylon'; return type[lang];
break;
case 'xml':
mode = 'xml';
break;
case 'html':
mode = 'xml';
break;
case 'css':
mode = 'text/css';
break;
case 'htmlmixed':
mode = 'htmlmixed';
break;
case 'htmlhh':
mode = 'htmlmixed';
break;
case 'javascript':
mode = 'text/javascript';
break;
case 'nginx':
mode = 'text/x-nginx-conf';
break;
case 'solr':
mode = 'text/x-solr';
break;
case 'sql':
mode = 'text/x-sql';
break;
case 'vue':
mode = 'text/x-vue';
break;
}
return mode;
} }
/** /**
......
...@@ -69,96 +69,59 @@ var systemCommonUtil = { ...@@ -69,96 +69,59 @@ var systemCommonUtil = {
* @param src 图片地址 * @param src 图片地址
*/ */
showPicImg: function (src){ showPicImg: function (src){
var pageWidth = systemCommonUtil.pageWidth(); var imagesList = [];
var imgWidth = pageWidth * 0.8; imagesList.push({
var left = pageWidth * 0.1; "alt": "",
var str = '<div id="sysShowPicBox" style="position: absolute; left: ' + left + 'px; top: 80px">' + "pid": "skyeye", //图片id
'<img id="sysShowPicImg" src="' + src + '" style="width: ' + imgWidth + 'px;" /></div>'; "src": src, //原图地址
layer.open({ "thumb": "" //缩略图地址
type: 1,
title: false,
closeBtn: 1,
skin: 'pic-show-bg',
area: ['100vw', '100vh'],
shadeClose: true,
content: str,
scrollbar: false
}); });
$("#sysShowPicImg").on('click', function (e){ layer.photos({
e.stopPropagation(); photos: {
}); "title": "", //相册标题
var myimage = document.getElementById("sysShowPicImg"); "id": 123, //相册id
systemCommonUtil.drag($("#sysShowPicBox")); "start": 0, //初始显示的图片序号,默认0
myimage.addEventListener("DOMMouseScroll", MouseWheelHandler, false); "data": imagesList
myimage.attachEvent ? myimage.attachEvent("onmousewheel", MouseWheelHandler) },
: myimage.addEventListener("mousewheel", MouseWheelHandler, false); anim: 5, //0-6的选择,指定弹出图片动画类型,默认随机
function MouseWheelHandler(e) { tab: function () {
// cross-browser wheel delta var num = 0;
var e = window.event || e; // old IE support $("#layui-layer-photos").parent().append('<div class="skyeye-image-operator">' +
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail))); '<button id="xuanzhuan" type="button" class="layui-btn layui-btn-normal layui-btn-xs">旋转</button>' +
myimage.style.width = Math.max(50, Math.min(3600, myimage.width + (30 * delta))) + "px"; '</div>');
return false;
}
},
/**
* 对象拖动
*
* @param obj
*/
drag: function(obj) {
obj.bind("mousedown", start);
function start(event) {
if (event.button == 0) { //判断是否点击鼠标左键
/*
* clientX和clientY代表鼠标当前的横纵坐标
* offset()该方法返回的对象包含两个整型属性:top 和 left,以像素计。此方法只对可见元素有效。
* bind()绑定事件,同样unbind解绑定,此效果的实现最后必须要解绑定,否则鼠标松开后拖拽效果依然存在
* getX获取当前鼠标横坐标和对象离屏幕左侧距离之差(也就是left)值,
* getY和getX同样道理,这两个差值就是鼠标相对于对象的定位,因为拖拽后鼠标和拖拽对象的相对位置是不变的
*/
gapX = event.clientX - obj.offset().left;
gapY = event.clientY - 80;
// mousemove事件必须绑定到$(document)上,鼠标移动是在整个屏幕上的
$(document).bind("mousemove", move);
// 此处的$(document)可以改为obj
$(document).bind("mouseup", stop);
}
return false; //阻止默认事件或冒泡
}
function move(event) { $(document).on("click", "#xuanzhuan", function(e) {
obj.css({ num = (num + 45) % 360;
"left": (event.clientX - gapX) + "px", $("#layui-layer-photos").css('transform', 'rotate(' + num + 'deg)');
"top": (event.clientY - gapY) + "px" });
});
return false; //阻止默认事件或冒泡
}
function stop() { $(document).on("mousewheel DOMMouseScroll", ".layui-layer-phimg", function (e) {
// 解绑定,这一步很必要,前面有解释 var delta = (e.originalEvent.wheelDelta && (e.originalEvent.wheelDelta > 0 ? 1 : -1)) || // chrome & ie
$(document).unbind("mousemove", move); (e.originalEvent.detail && (e.originalEvent.detail > 0 ? -1 : 1)); // firefox
$(document).unbind("mouseup", stop); var imagep = $(".layui-layer-phimg").parent().parent();
} var image = $(".layui-layer-phimg").parent();
}, var h = image.height();
var w = image.width();
/** if (delta > 0) {
* 获取当前页面的高度 if (h < (window.innerHeight)) {
* @returns {(function())|number|*|number} h = h * 1.05;
*/ w = w * 1.05;
pageHeight: function (){ }
return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight : } else if (delta < 0) {
document.body.clientHeight; if (h > 100) {
}, h = h * 0.95;
w = w * 0.95;
/** }
* 获取当前页面的宽度 }
* imagep.css("top", (window.innerHeight - h) / 2);
* @returns {(function())|number|*|number} imagep.css("left", (window.innerWidth - w) / 2);
*/ image.height(h);
pageWidth: function (){ image.width(w);
return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth : imagep.height(h);
document.body.clientWidth; imagep.width(w);
});
}
});
}, },
/** /**
......
/*********第一套样式开始**********/
.white-1995dc .tradition-left{
border-right: 2px solid #F2F2F2 !important;
}
.white-1995dc .tradition-left-center ul,
.white-1995dc .tradition-left-bottom,
.white-1995dc .tradition-right-top .layui-layout-right .adropdown caption,
.white-1995dc .tradition-right-top .layui-layout-right .adropdown tbody{
background-color: white !important;
}
.white-1995dc .tradition-left-center ul .layui-nav-child dd{
background: #F2F2F2 !important;
}
.white-1995dc .tradition-left-center ul i,
.white-1995dc .tradition-left-center ul cite,
.white-1995dc .tradition-left-bottom i,
.white-1995dc .tradition-left-bottom font{
color: #555555 !important;
}
.white-1995dc .tradition-left-top,
.white-1995dc .tradition-right-top,
.white-1995dc .tradition-right-top .layui-layout-left,
.white-1995dc .tradition-right-top .layui-layout-right,
.white-1995dc .tradition-right-top .layui-layout-right .adropdown,
.white-1995dc .tradition-right-top .layui-layout-right .layui-input-search,
.white-1995dc .tradition-right-top .desktop-menu-box li{
background-color: #1995dc !important;
}
.white-1995dc .tradition-right-top .layui-layout-right .layui-input-search,
.white-1995dc .tradition-right-top .layui-layout-right .layui-input-search::-webkit-input-placeholder{
color: white !important;
}
.white-1995dc .tradition-right-top .desktop-menu-box .select{
background-color: #178acc !important;
}
.white-1995dc .tradition-left-top span,
.white-1995dc .tradition-right-top span,
.white-1995dc .tradition-right-top .layui-layout-left i,
.white-1995dc .tradition-right-top .layui-layout-right .layui-nav-item>a>i,
.white-1995dc .tradition-right-top .layui-layout-right font{
color: white !important;
}
.white-1995dc .tradition-right-top .layui-layout-right .layui-nav-more{
border-top-color: white !important;
}
.white-1995dc .tradition-right-top .layui-layout-right .layui-nav-mored{
border-bottom-color: white !important;
border-top-color: #178acc !important;
}
.white-1995dc .tradition-left-center .layui-nav-item>.menu-box-none:HOVER,
.white-1995dc .tradition-left-center .layui-nav-item .page-item-click:HOVER{
background-color: #F5F5F5 !important;
}
.white-1995dc .tradition-left-center ul .layui-nav-itemed .layui-nav-more{
border-bottom-color: #555555 !important;
border-top-color: white;
}
.white-1995dc .tradition-left-center ul .layui-nav-more{
border-top-color: #555555;
}
/*********第一套样式结束**********/
\ No newline at end of file
 
/*系统样式文件*/
@import "customer/systemStyle.css";
html, html,
body { body {
height: 100%; height: 100%;
...@@ -12398,81 +12401,6 @@ select[multiple]+.layui-form-select .layui-form-checkbox[lay-skin=primary] i{ po ...@@ -12398,81 +12401,6 @@ select[multiple]+.layui-form-select .layui-form-checkbox[lay-skin=primary] i{ po
/*******************************************自定义样式end********************************************/ /*******************************************自定义样式end********************************************/
/*********第一套样式开始**********/
.white-1995dc .tradition-left{
border-right: 2px solid #F2F2F2 !important;
}
.white-1995dc .tradition-left-center ul,
.white-1995dc .tradition-left-bottom,
.white-1995dc .tradition-right-top .layui-layout-right .adropdown caption,
.white-1995dc .tradition-right-top .layui-layout-right .adropdown tbody{
background-color: white !important;
}
.white-1995dc .tradition-left-center ul .layui-nav-child dd{
background: #F2F2F2 !important;
}
.white-1995dc .tradition-left-center ul i,
.white-1995dc .tradition-left-center ul cite,
.white-1995dc .tradition-left-bottom i,
.white-1995dc .tradition-left-bottom font{
color: #555555 !important;
}
.white-1995dc .tradition-left-top,
.white-1995dc .tradition-right-top,
.white-1995dc .tradition-right-top .layui-layout-left,
.white-1995dc .tradition-right-top .layui-layout-right,
.white-1995dc .tradition-right-top .layui-layout-right .adropdown,
.white-1995dc .tradition-right-top .layui-layout-right .layui-input-search,
.white-1995dc .tradition-right-top .desktop-menu-box li{
background-color: #1995dc !important;
}
.white-1995dc .tradition-right-top .layui-layout-right .layui-input-search,
.white-1995dc .tradition-right-top .layui-layout-right .layui-input-search::-webkit-input-placeholder{
color: white !important;
}
.white-1995dc .tradition-right-top .desktop-menu-box .select{
background-color: #178acc !important;
}
.white-1995dc .tradition-left-top span,
.white-1995dc .tradition-right-top span,
.white-1995dc .tradition-right-top .layui-layout-left i,
.white-1995dc .tradition-right-top .layui-layout-right .layui-nav-item>a>i,
.white-1995dc .tradition-right-top .layui-layout-right font{
color: white !important;
}
.white-1995dc .tradition-right-top .layui-layout-right .layui-nav-more{
border-top-color: white !important;
}
.white-1995dc .tradition-right-top .layui-layout-right .layui-nav-mored{
border-bottom-color: white !important;
border-top-color: #178acc !important;
}
.white-1995dc .tradition-left-center .layui-nav-item>.menu-box-none:HOVER,
.white-1995dc .tradition-left-center .layui-nav-item .page-item-click:HOVER{
background-color: #F5F5F5 !important;
}
.white-1995dc .tradition-left-center ul .layui-nav-itemed .layui-nav-more{
border-bottom-color: #555555 !important;
border-top-color: white;
}
.white-1995dc .tradition-left-center ul .layui-nav-more{
border-top-color: #555555;
}
/*********第一套样式结束**********/
.act-model-li{ .act-model-li{
text-align: center; text-align: center;
padding: 15px 0px; padding: 15px 0px;
...@@ -12491,4 +12419,15 @@ select[multiple]+.layui-form-select .layui-form-checkbox[lay-skin=primary] i{ po ...@@ -12491,4 +12419,15 @@ select[multiple]+.layui-form-select .layui-form-checkbox[lay-skin=primary] i{ po
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
}
.skyeye-image-operator{
position: fixed;
width: 100%;
text-align: center;
cursor: pointer;
bottom: 0px;
left: 0px;
background-color: rgba(190,190,190,0.3);
box-shadow: 0 0 10px rgb(0 0 0 / 20%);
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册