Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zxtb_to_ssfwpt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Bugzilla
Bugzilla
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
卢世豪
zxtb_to_ssfwpt
Commits
a5913a1a
Commit
a5913a1a
authored
Mar 14, 2022
by
zqm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.解决bug28886,测试环境财务报表申报无法开表的问题
parent
813a9e56
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
424 additions
and
397 deletions
+424
-397
encapsulation.js
static/tools/js/encapsulation.js
+424
-397
No files found.
static/tools/js/encapsulation.js
View file @
a5913a1a
var
showLoading
,
hideLoading
,
myAlert
,
myConfirm
window
.
console
=
window
.
console
||
(
function
()
{
var
c
=
{};
c
.
log
=
c
.
warn
=
c
.
debug
=
c
.
info
=
c
.
error
=
c
.
time
=
c
.
dir
=
c
.
profile
=
c
.
clear
=
c
.
exception
=
c
.
trace
=
c
.
assert
=
function
()
{
};
window
.
console
=
window
.
console
||
(
function
()
{
var
c
=
{};
c
.
log
=
c
.
warn
=
c
.
debug
=
c
.
info
=
c
.
error
=
c
.
time
=
c
.
dir
=
c
.
profile
=
c
.
clear
=
c
.
exception
=
c
.
trace
=
c
.
assert
=
function
()
{
};
return
c
;
})();
function
getIEVersion
()
{
var
userAgent
=
navigator
.
userAgent
;
//取得浏览器的userAgent字符串
var
isIE
=
userAgent
.
indexOf
(
"compatible"
)
>
-
1
&&
userAgent
.
indexOf
(
"MSIE"
)
>
-
1
;
//判断是否IE<11浏览器
var
isEdge
=
userAgent
.
indexOf
(
"Edge"
)
>
-
1
&&
!
isIE
;
//判断是否IE的Edge浏览器
var
isIE11
=
userAgent
.
indexOf
(
'Trident'
)
>
-
1
&&
userAgent
.
indexOf
(
"rv:11.0"
)
>
-
1
;
if
(
isIE
)
{
var
reIE
=
new
RegExp
(
"MSIE (
\\
d+
\\
.
\\
d+);"
);
reIE
.
test
(
userAgent
);
var
fIEVersion
=
parseFloat
(
RegExp
[
"$1"
]);
if
(
fIEVersion
==
7
)
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
return
7
;
}
else
if
(
fIEVersion
==
8
)
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
return
8
;
}
else
if
(
fIEVersion
==
9
)
{
// alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
return
9
;
}
else
if
(
fIEVersion
==
10
)
{
return
10
;
}
else
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
return
6
;
//IE版本<=7
}
}
else
if
(
isEdge
)
{
return
'edge'
;
//edge
}
else
if
(
isIE11
)
{
return
11
;
//IE11
}
else
{
return
-
1
;
//不是ie浏览器
}
if
(
!
isEdge
)
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
}
var
userAgent
=
navigator
.
userAgent
;
//取得浏览器的userAgent字符串
var
isIE
=
userAgent
.
indexOf
(
"compatible"
)
>
-
1
&&
userAgent
.
indexOf
(
"MSIE"
)
>
-
1
;
//判断是否IE<11浏览器
var
isEdge
=
userAgent
.
indexOf
(
"Edge"
)
>
-
1
&&
!
isIE
;
//判断是否IE的Edge浏览器
var
isIE11
=
userAgent
.
indexOf
(
'Trident'
)
>
-
1
&&
userAgent
.
indexOf
(
"rv:11.0"
)
>
-
1
;
if
(
isIE
)
{
var
reIE
=
new
RegExp
(
"MSIE (
\\
d+
\\
.
\\
d+);"
);
reIE
.
test
(
userAgent
);
var
fIEVersion
=
parseFloat
(
RegExp
[
"$1"
]);
if
(
fIEVersion
==
7
)
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
return
7
;
}
else
if
(
fIEVersion
==
8
)
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
return
8
;
}
else
if
(
fIEVersion
==
9
)
{
// alert('您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式');
return
9
;
}
else
if
(
fIEVersion
==
10
)
{
return
10
;
}
else
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
return
6
;
//IE版本<=7
}
}
else
if
(
isEdge
)
{
return
'edge'
;
//edge
}
else
if
(
isIE11
)
{
return
11
;
//IE11
}
else
{
return
-
1
;
//不是ie浏览器
}
if
(
!
isEdge
)
{
alert
(
'您的浏览器版本过低,请使用IE9及以上浏览器或者使用浏览器极速模式'
);
}
}
//封装等待框
(
function
(
$
)
{
var
renderHtml
=
function
()
{
var
_html
=
'<div id="loadingDiv" style="display: none; cursor:progress;"><div id="over" style=" position: absolute;top: 0;left: 0; width: 100%;height: 100%; background-color: #f5f5f5;opacity:0.5;z-index: 9999991;"></div><div id="layout" style="position: absolute;top: 40%; left: 40%;width: 20%; height: 20%; z-index: 9999999;text-align:center;"><img id="showloading" src="../../static/tools/images/loading2.gif" /></div></div>'
;
$
(
"body"
).
append
(
_html
);
}
renderHtml
();
$
.
show
=
{
//显示等待框
showLoading
:
function
()
{
$
(
"#loadingDiv"
).
css
({
display
:
'block'
})
},
//隐藏等待框
hideLoading
:
function
()
{
$
(
"#loadingDiv"
).
css
({
display
:
'none'
})
},
(
function
(
$
)
{
var
renderHtml
=
function
()
{
var
_html
=
'<div id="loadingDiv" style="display: none; cursor:progress;"><div id="over" style=" position: absolute;top: 0;left: 0; width: 100%;height: 100%; background-color: #f5f5f5;opacity:0.5;z-index: 9999991;"></div><div id="layout" style="position: absolute;top: 40%; left: 40%;width: 20%; height: 20%; z-index: 9999999;text-align:center;"><img id="showloading" src="../../static/tools/images/loading2.gif" /></div></div>'
;
$
(
"body"
).
append
(
_html
);
}
renderHtml
();
$
.
show
=
{
//显示等待框
showLoading
:
function
()
{
$
(
"#loadingDiv"
).
css
({
display
:
'block'
})
},
//隐藏等待框
hideLoading
:
function
()
{
$
(
"#loadingDiv"
).
css
({
display
:
'none'
})
},
}
// 渲染等待框
}
// 渲染等待框
showLoading
=
function
()
{
$
.
show
.
showLoading
();
}
hideLoading
=
function
()
{
$
.
show
.
hideLoading
();
}
})(
jQuery
);
showLoading
=
function
()
{
$
.
show
.
showLoading
();
}
hideLoading
=
function
()
{
$
.
show
.
hideLoading
();
}
})(
jQuery
);
/**
* 重写确认框 fun:函数对象 params:参数列表, 可以是数组
*/
(
function
(
$
)
{
$
.
alerts
=
{
alert
:
function
(
title
,
message
,
btnOk
,
callback
)
{
if
(
title
==
null
)
title
=
'Alert'
;
$
.
alerts
.
_show
(
title
,
message
,
btnOk
,
null
,
null
,
'alert'
,
function
(
result
)
{
if
(
callback
)
callback
(
result
);
});
},
alert
:
function
(
title
,
message
,
btnOk
,
callback
)
{
if
(
title
==
null
)
title
=
'Alert'
;
$
.
alerts
.
_show
(
title
,
message
,
btnOk
,
null
,
null
,
'alert'
,
function
(
result
)
{
if
(
callback
)
callback
(
result
);
});
},
confirm
:
function
(
title
,
message
,
btnOk
,
btnNo
,
callback
)
{
if
(
title
==
null
)
title
=
'Confirm'
;
if
(
btnOk
==
null
||
btnOk
==
""
)
btnOk
=
'确定'
;
if
(
btnNo
==
null
||
btnNo
==
""
)
btnNo
=
'取消'
;
$
.
alerts
.
_show
(
title
,
message
,
btnOk
,
btnNo
,
null
,
'confirm'
,
function
(
result
)
{
if
(
callback
)
callback
(
result
);
});
},
_show
:
function
(
title
,
msg
,
btnOk
,
btnNo
,
value
,
type
,
callback
)
{
var
_html
=
""
;
_html
+=
'<div id="mb_box"></div><div id="mb_con"><span id="mb_tit">'
+
title
+
'</span>'
if
(
type
==
"confirm"
)
{
_html
+=
'<img id="mb_img" src="../../static/tools/images/close.png">'
;
_html
+=
'<div id="mb_msg">'
+
msg
+
'</div>'
;
}
if
(
type
==
"alert"
)
{
_html
+=
'<div id="mb_msg">'
+
msg
+
'</div>'
;
_html
+=
'<input id="mb_btn_ok" type="button" value='
+
btnOk
+
'>'
;
_html
+=
'</div>'
;
}
if
(
type
==
"confirm"
)
{
_html
+=
'<input id="mb_btn_ok" type="button" value='
+
btnOk
+
'>'
;
_html
+=
'<input id="mb_btn_no" type="button" value='
+
btnNo
+
'>'
;
//_html += '<input id="mb_btn_ok" type="button" value=' + btnOk + '>';
_html
+=
'</div>'
;
}
confirm
:
function
(
title
,
message
,
btnOk
,
btnNo
,
callback
)
{
if
(
title
==
null
)
title
=
'Confirm'
;
if
(
btnOk
==
null
||
btnOk
==
""
)
btnOk
=
'确定'
;
if
(
btnNo
==
null
||
btnNo
==
""
)
btnNo
=
'取消'
;
$
.
alerts
.
_show
(
title
,
message
,
btnOk
,
btnNo
,
null
,
'confirm'
,
function
(
result
)
{
if
(
callback
)
callback
(
result
);
});
},
_show
:
function
(
title
,
msg
,
btnOk
,
btnNo
,
value
,
type
,
callback
)
{
var
_html
=
""
;
_html
+=
'<div id="mb_box"></div><div id="mb_con"><span id="mb_tit">'
+
title
+
'</span>'
if
(
type
==
"confirm"
)
{
_html
+=
'<img id="mb_img" src="../../static/tools/images/close.png">'
;
_html
+=
'<div id="mb_msg">'
+
msg
+
'</div>'
;
}
if
(
type
==
"alert"
)
{
_html
+=
'<div id="mb_msg">'
+
msg
+
'</div>'
;
_html
+=
'<input id="mb_btn_ok" type="button" value='
+
btnOk
+
'>'
;
_html
+=
'</div>'
;
}
if
(
type
==
"confirm"
)
{
_html
+=
'<input id="mb_btn_ok" type="button" value='
+
btnOk
+
'>'
;
_html
+=
'<input id="mb_btn_no" type="button" value='
+
btnNo
+
'>'
;
//_html += '<input id="mb_btn_ok" type="button" value=' + btnOk + '>';
_html
+=
'</div>'
;
}
//必须先将_html添加到body,再设置Css样式
$
(
"body"
).
append
(
_html
);
GenerateCss
(
type
);
switch
(
type
)
{
case
'alert'
:
$
(
"#mb_btn_ok"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
callback
(
true
);
});
$
(
"#mb_btn_no"
).
focus
().
keypress
(
function
(
e
)
{
if
(
e
.
keyCode
==
13
||
e
.
keyCode
==
27
)
$
(
"#mb_btn_no"
).
trigger
(
'click'
);
});
break
;
case
'confirm'
:
$
(
"#mb_btn_ok"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
if
(
callback
)
callback
(
true
);
});
$
(
"#mb_btn_no"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
//if (callback) callback(false);
});
$
(
"#mb_img"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
//if (callback) callback(false);
});
$
(
"#mb_btn_no"
).
focus
();
$
(
"#mb_btn_ok, #mb_btn_no"
).
keypress
(
function
(
e
)
{
if
(
e
.
keyCode
==
13
)
$
(
"#mb_btn_ok"
).
trigger
(
'click'
);
if
(
e
.
keyCode
==
27
)
$
(
"#mb_btn_no"
).
trigger
(
'click'
);
});
break
;
}
},
_hide
:
function
_hide
()
{
//必须先将_html添加到body,再设置Css样式
$
(
"body"
).
append
(
_html
);
GenerateCss
(
type
);
switch
(
type
)
{
case
'alert'
:
$
(
"#mb_btn_ok"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
callback
(
true
);
});
$
(
"#mb_btn_no"
).
focus
().
keypress
(
function
(
e
)
{
if
(
e
.
keyCode
==
13
||
e
.
keyCode
==
27
)
$
(
"#mb_btn_no"
).
trigger
(
'click'
);
});
break
;
case
'confirm'
:
$
(
"#mb_btn_ok"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
if
(
callback
)
callback
(
true
);
});
$
(
"#mb_btn_no"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
//if (callback) callback(false);
});
$
(
"#mb_img"
).
click
(
function
()
{
$
.
alerts
.
_hide
();
//if (callback) callback(false);
});
$
(
"#mb_btn_no"
).
focus
();
$
(
"#mb_btn_ok, #mb_btn_no"
).
keypress
(
function
(
e
)
{
if
(
e
.
keyCode
==
13
)
$
(
"#mb_btn_ok"
).
trigger
(
'click'
);
if
(
e
.
keyCode
==
27
)
$
(
"#mb_btn_no"
).
trigger
(
'click'
);
});
break
;
}
},
_hide
:
function
_hide
()
{
$
(
"#mb_box,#mb_con"
).
remove
();
}
// Shortuct functions
};
myAlert
=
function
myAlert
(
title
,
message
,
btnOk
,
callback
)
{
$
.
alerts
.
alert
(
title
,
message
,
btnOk
,
callback
);
};
};
myAlert
=
function
myAlert
(
title
,
message
,
btnOk
,
callback
)
{
$
.
alerts
.
alert
(
title
,
message
,
btnOk
,
callback
);
};
myConfirm
=
function
myConfirm
(
title
,
message
,
btnOk
,
btnNo
,
callback
)
{
$
.
alerts
.
confirm
(
title
,
message
,
btnOk
,
btnNo
,
callback
);
};
myConfirm
=
function
myConfirm
(
title
,
message
,
btnOk
,
btnNo
,
callback
)
{
$
.
alerts
.
confirm
(
title
,
message
,
btnOk
,
btnNo
,
callback
);
};
//生成Css
var
GenerateCss
=
function
GenerateCss
(
type
)
{
$
(
"#mb_box"
).
css
({
width
:
'100%'
,
height
:
'100%'
,
zIndex
:
'99999'
,
position
:
'fixed'
,
filter
:
'Alpha(opacity=40)'
,
backgroundColor
:
'black'
,
top
:
'0'
,
left
:
'0'
,
opacity
:
'0.4'
});
//生成Css
var
GenerateCss
=
function
GenerateCss
(
type
)
{
$
(
"#mb_box"
).
css
({
width
:
'100%'
,
height
:
'100%'
,
zIndex
:
'99999'
,
position
:
'fixed'
,
filter
:
'Alpha(opacity=40)'
,
backgroundColor
:
'black'
,
top
:
'0'
,
left
:
'0'
,
opacity
:
'0.4'
});
$
(
"#mb_box"
).
css
({
width
:
'100%'
,
height
:
'100%'
,
zIndex
:
'99999'
,
$
(
"#mb_box"
).
css
({
width
:
'100%'
,
height
:
'100%'
,
zIndex
:
'99999'
,
position
:
'fixed'
,
filter
:
'Alpha(opacity=40)'
,
backgroundColor
:
'black'
,
top
:
'0'
,
left
:
'0'
,
opacity
:
'0.4'
});
if
(
type
==
"alert"
)
{
$
(
"#mb_con"
).
css
({
zIndex
:
'999999'
,
width
:
'400px'
,
// height: '230px',
position
:
'fixed'
,
filter
:
'Alpha(opacity=40)'
,
backgroundColor
:
'black'
,
top
:
'0'
,
left
:
'0'
,
opacity
:
'0.4'
backgroundColor
:
'White'
,
borderRadius
:
'3px'
});
if
(
type
==
"alert"
)
{
$
(
"#mb_con"
).
css
({
zIndex
:
'999999'
,
width
:
'400px'
,
// height: '230px',
position
:
'fixed'
,
backgroundColor
:
'White'
,
borderRadius
:
'3px'
});
}
else
{
$
(
"#mb_con"
).
css
({
zIndex
:
'999999'
,
width
:
'400px'
,
// height: '200px',
position
:
'fixed'
,
backgroundColor
:
'White'
,
borderRadius
:
'3px'
});
}
$
(
"#mb_img"
).
css
({
width
:
'19px'
,
height
:
'20px'
,
top
:
'10px'
,
right
:
'10px'
,
position
:
'absolute'
}
else
{
$
(
"#mb_con"
).
css
({
zIndex
:
'999999'
,
width
:
'400px'
,
// height: '200px',
position
:
'fixed'
,
backgroundColor
:
'White'
,
borderRadius
:
'3px'
});
$
(
"#mb_img_span"
).
css
({
}
$
(
"#mb_img"
).
css
({
width
:
'19px'
,
height
:
'20px'
,
top
:
'10px'
,
right
:
'10px'
,
position
:
'absolute'
});
$
(
"#mb_img_span"
).
css
({
float
:
'left'
,
padding
:
'7.5px 15px'
,
width
:
'10%'
,
borderBottom
:
'1px solid #E6E6E6'
});
if
(
type
==
"alert"
)
{
$
(
"#mb_tit"
).
css
({
float
:
'left'
,
padding
:
'7.5px 15px'
,
width
:
'10%'
,
borderBottom
:
'1px solid #E6E6E6'
});
if
(
type
==
"alert"
)
{
$
(
"#mb_tit"
).
css
({
float
:
'left'
,
width
:
'100%'
,
display
:
'block'
,
fontSize
:
'16px'
,
color
:
'#444'
,
padding
:
'10px 15px'
,
backgroundColor
:
'#fff'
,
borderRadius
:
'15px 15px 0 0'
,
// fontWeight: 'bold',
borderBottom
:
'1px solid #E6E6E6'
,
boxSizing
:
'border-box'
});
}
else
{
$
(
"#mb_tit"
).
css
({
float
:
'left'
,
width
:
'100%'
,
display
:
'block'
,
fontSize
:
'14px'
,
color
:
'#444'
,
padding
:
'10px 15px'
,
backgroundColor
:
'#fff'
,
borderRadius
:
'15px 15px 0 0'
,
// fontWeight: 'bold',
borderBottom
:
'1px solid #E6E6E6'
,
boxSizing
:
'border-box'
});
}
$
(
"#mb_msg"
).
css
({
clear
:
'both'
,
padding
:
'20px 30px'
,
lineHeight
:
'30px'
,
textAlign
:
'left'
,
width
:
'100%'
,
display
:
'block'
,
fontSize
:
'16px'
,
color
:
'#4c4c4c'
,
marginBottom
:
'50px'
,
textIndent
:
'2em'
color
:
'#444'
,
padding
:
'10px 15px'
,
backgroundColor
:
'#fff'
,
borderRadius
:
'15px 15px 0 0'
,
// fontWeight: 'bold',
borderBottom
:
'1px solid #E6E6E6'
,
boxSizing
:
'border-box'
});
$
(
"#mb_ico"
).
css
({
}
else
{
$
(
"#mb_tit"
).
css
({
float
:
'left'
,
width
:
'100%'
,
display
:
'block'
,
position
:
'absolute'
,
right
:
'10px'
,
top
:
'9px'
,
border
:
'1px solid Gray'
,
width
:
'18px'
,
height
:
'18px'
,
textAlign
:
'center'
,
lineHeight
:
'16px'
,
cursor
:
'pointer'
,
borderRadius
:
'12px'
,
fontFamily
:
'微软雅黑'
fontSize
:
'14px'
,
color
:
'#444'
,
padding
:
'10px 15px'
,
backgroundColor
:
'#fff'
,
borderRadius
:
'15px 15px 0 0'
,
// fontWeight: 'bold',
borderBottom
:
'1px solid #E6E6E6'
,
boxSizing
:
'border-box'
});
}
$
(
"#mb_btnbox"
).
css
({
margin
:
'0px 20px 20px 0'
,
textAlign
:
'right'
});
if
(
type
==
"alert"
)
{
$
(
"#mb_btn_ok,#mb_btn_no"
).
css
({
width
:
'80px'
,
height
:
'30px'
,
color
:
'white'
,
border
:
'none'
,
borderRadius
:
'3px'
,
position
:
'absolute'
$
(
"#mb_msg"
).
css
({
clear
:
'both'
,
padding
:
'20px 30px'
,
lineHeight
:
'30px'
,
textAlign
:
'left'
,
fontSize
:
'16px'
,
color
:
'#4c4c4c'
,
marginBottom
:
'50px'
,
textIndent
:
'2em'
});
});
$
(
"#mb_btn_ok"
).
css
({
backgroundColor
:
'#53ACF3'
,
marginRight
:
'6px'
,
right
:
'15px'
,
bottom
:
'15px'
});
}
else
{
$
(
"#mb_btn_ok,#mb_btn_no"
).
css
({
width
:
'80px'
,
height
:
'30px'
,
color
:
'white'
,
border
:
'none'
,
borderRadius
:
'3px'
,
position
:
'absolute'
});
$
(
"#mb_btn_ok"
).
css
({
backgroundColor
:
'#53ACF3'
,
marginRight
:
'6px'
,
right
:
'105px'
,
bottom
:
'10px'
,
});
}
$
(
"#mb_btn_no"
).
css
({
border
:
'1px solid #CCCCCC'
,
backgroundColor
:
'#FFFFFF'
,
color
:
'black'
,
$
(
"#mb_ico"
).
css
({
display
:
'block'
,
position
:
'absolute'
,
right
:
'10px'
,
top
:
'9px'
,
border
:
'1px solid Gray'
,
width
:
'18px'
,
height
:
'18px'
,
textAlign
:
'center'
,
lineHeight
:
'16px'
,
cursor
:
'pointer'
,
borderRadius
:
'12px'
,
fontFamily
:
'微软雅黑'
});
$
(
"#mb_btnbox"
).
css
({
margin
:
'0px 20px 20px 0'
,
textAlign
:
'right'
});
if
(
type
==
"alert"
)
{
$
(
"#mb_btn_ok,#mb_btn_no"
).
css
({
width
:
'80px'
,
height
:
'30px'
,
color
:
'white'
,
border
:
'none'
,
borderRadius
:
'3px'
,
position
:
'absolute'
});
$
(
"#mb_btn_ok"
).
css
({
backgroundColor
:
'#53ACF3'
,
marginRight
:
'6px'
,
right
:
'15px'
,
bottom
:
'15px'
});
}
else
{
$
(
"#mb_btn_ok,#mb_btn_no"
).
css
({
width
:
'80px'
,
height
:
'30px'
,
color
:
'white'
,
border
:
'none'
,
borderRadius
:
'3px'
,
position
:
'absolute'
});
$
(
"#mb_btn_ok"
).
css
({
backgroundColor
:
'#53ACF3'
,
marginRight
:
'6px'
,
right
:
'105px'
,
bottom
:
'10px'
,
right
:
'20px'
,
});
}
$
(
"#mb_btn_no"
).
css
({
border
:
'1px solid #CCCCCC'
,
backgroundColor
:
'#FFFFFF'
,
color
:
'black'
,
bottom
:
'10px'
,
right
:
'20px'
,
});
//右上角关闭按钮hover样式
$
(
"#mb_ico"
).
hover
(
function
()
{
$
(
this
).
css
({
backgroundColor
:
'Red'
,
color
:
'White'
});
},
function
()
{
$
(
this
).
css
({
backgroundColor
:
'#DDD'
,
color
:
'black'
});
//右上角关闭按钮hover样式
$
(
"#mb_ico"
).
hover
(
function
()
{
$
(
this
).
css
({
backgroundColor
:
'Red'
,
color
:
'White'
});
},
function
()
{
$
(
this
).
css
({
backgroundColor
:
'#DDD'
,
color
:
'black'
});
});
var
_widht
=
document
.
documentElement
.
clientWidth
;
//屏幕宽
var
_height
=
document
.
documentElement
.
clientHeight
;
//屏幕高
var
_widht
=
document
.
documentElement
.
clientWidth
;
//屏幕宽
var
_height
=
document
.
documentElement
.
clientHeight
;
//屏幕高
var
boxWidth
=
$
(
"#mb_con"
).
width
();
var
boxHeight
=
$
(
"#mb_con"
).
height
();
var
boxWidth
=
$
(
"#mb_con"
).
width
();
var
boxHeight
=
$
(
"#mb_con"
).
height
();
//让提示框居中
$
(
"#mb_con"
).
css
({
top
:
(
_height
-
boxHeight
)
/
2
+
"px"
,
left
:
(
_widht
-
boxWidth
)
/
2
+
"px"
});
//让提示框居中
$
(
"#mb_con"
).
css
({
top
:
(
_height
-
boxHeight
)
/
2
+
"px"
,
left
:
(
_widht
-
boxWidth
)
/
2
+
"px"
});
}
...
...
@@ -442,8 +443,8 @@ function alertBoxHide() {
setTimeout
(
function
()
{
alertBox
(
alertBoxArr
[
0
].
type
,
alertBoxArr
[
0
].
msg
,
alertBoxArr
[
0
].
showTime
,
alertBoxArr
[
0
].
callBack
);
},
500
);
}
else
{
// window.close();
}
else
{
// window.close();
}
}
...
...
@@ -806,35 +807,35 @@ function box(jqObj) {
* 工具
*/
var
JSTOOL
=
function
()
{
this
.
getMonthBefore
=
function
(
date
){
var
nowdays
=
new
Date
(
date
);
var
year
=
nowdays
.
getFullYear
();
var
month
=
nowdays
.
getMonth
();
if
(
month
==
0
){
month
=
12
;
year
=
year
-
1
;
}
if
(
month
<
10
){
month
=
'0'
+
month
;
this
.
getMonthBefore
=
function
(
date
)
{
var
nowdays
=
new
Date
(
date
);
var
year
=
nowdays
.
getFullYear
();
var
month
=
nowdays
.
getMonth
();
if
(
month
==
0
)
{
month
=
12
;
year
=
year
-
1
;
}
if
(
month
<
10
)
{
month
=
'0'
+
month
;
}
var
myDate
=
new
Date
(
year
,
month
,
0
);
var
startDate
=
year
+
'-'
+
month
+
'-01'
;
// 上个月第一天
var
endDate
=
year
+
'-'
+
month
+
'-'
+
myDate
.
getDate
();
//上个月最后一天
return
startDate
+
'&&'
+
endDate
;
}
var
myDate
=
new
Date
(
year
,
month
,
0
);
var
startDate
=
year
+
'-'
+
month
+
'-01'
;
// 上个月第一天
var
endDate
=
year
+
'-'
+
month
+
'-'
+
myDate
.
getDate
();
//上个月最后一天
return
startDate
+
'&&'
+
endDate
;
}
/**
* 格式化日期
* 将000000格式化为0000-00-00
*/
/**
* 格式化日期
* 将000000格式化为0000-00-00
*/
this
.
formatDate
=
function
(
date
)
{
if
(
date
)
{
return
date
.
replace
(
/^
(\d{4})(\d{2})(\d{2})
$/
,
"$1-$2-$3"
);
}
else
{
return
""
}
if
(
date
)
{
return
date
.
replace
(
/^
(\d{4})(\d{2})(\d{2})
$/
,
"$1-$2-$3"
);
}
else
{
return
""
}
}
//字符串时间转时间戳用比较大小
}
//字符串时间转时间戳用比较大小
this
.
bijiaodata
=
function
(
data
,
data1
)
{
var
flag
=
false
;
if
(
this
.
dateTool
(
data
)
>
this
.
dateTool
(
data1
))
{
...
...
@@ -945,91 +946,107 @@ var JSTOOL = function() {
for
(
var
m
=
0
,
lenM
=
tableObj
.
buttonControlArr
.
length
;
m
<
lenM
;
m
++
)
{
$div
=
$
(
"<div></div>"
);
$div
.
addClass
(
tableObj
.
buttonControlArr
[
m
].
classA
);
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]);
if
(
commonJson
[
i
][
tableObj
.
onlyId
]
!=
null
)
{
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]);
}
else
{
$div
.
attr
(
"alt"
,
commonJson
[
i
].
zsxmDm
+
commonJson
[
i
].
bblxDm
+
commonJson
[
i
].
sksssjq
+
commonJson
[
i
].
sksssjz
);
}
$div
.
addClass
(
"btn btn-primary tdDong-btn"
);
$div
.
html
(
tableObj
.
buttonControlArr
[
m
].
html
);
$td
.
addClass
(
"tdDoing-contain"
);
$td
.
append
(
$div
);
}
}
else
{
/* @Author GyYu @Date 16:15 2020/11/20 @Description 应对小偷,加几个隐藏的按钮*/
for
(
var
ll
=
0
;
ll
<
3
;
ll
++
){
if
(
ll
==
1
){
if
(
tableObj
.
buttonHtml
==
""
)
{
if
(
json
[
i
].
do
.
indexOf
(
","
)
>
-
1
)
{
var
buttonHtmlArr
=
json
[
i
].
do
.
split
(
","
);
for
(
var
cxi
=
0
;
cxi
<
buttonHtmlArr
.
length
;
cxi
++
)
{
/* @Author GyYu @Date 16:15 2020/11/20 @Description 应对小偷,加几个隐藏的按钮*/
for
(
var
ll
=
0
;
ll
<
3
;
ll
++
)
{
if
(
ll
==
1
)
{
if
(
tableObj
.
buttonHtml
==
""
)
{
if
(
json
[
i
].
do
.
indexOf
(
","
)
>
-
1
)
{
var
buttonHtmlArr
=
json
[
i
].
do
.
split
(
","
);
for
(
var
cxi
=
0
;
cxi
<
buttonHtmlArr
.
length
;
cxi
++
)
{
var
div
=
document
.
createElement
(
"div"
);
$div
=
$
(
div
);
if
(
commonJson
[
i
][
tableObj
.
onlyId
]
!=
null
)
{
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]);
}
else
{
$div
.
attr
(
"alt"
,
commonJson
[
i
].
zsxmDm
+
commonJson
[
i
].
bblxDm
+
commonJson
[
i
].
sksssjq
+
commonJson
[
i
].
sksssjz
);
}
$div
.
addClass
(
"btn btn-primary tdDong-btn"
);
$div
.
html
(
buttonHtmlArr
[
cxi
]);
$td
.
addClass
(
"tdDoing-contain"
);
$td
.
append
(
div
);
}
}
else
{
var
div
=
document
.
createElement
(
"div"
);
$div
=
$
(
div
);
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]);
if
(
commonJson
[
i
][
tableObj
.
onlyId
]
!=
null
)
{
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]);
}
else
{
$div
.
attr
(
"alt"
,
commonJson
[
i
].
zsxmDm
+
commonJson
[
i
].
bblxDm
+
commonJson
[
i
].
sksssjq
+
commonJson
[
i
].
sksssjz
);
}
$div
.
addClass
(
"btn btn-primary tdDong-btn"
);
$div
.
html
(
buttonHtmlArr
[
cxi
]
);
$div
.
html
(
json
[
i
].
do
);
$td
.
addClass
(
"tdDoing-contain"
);
$td
.
append
(
div
);
}
}
else
{
// tableObj.jsonReady.forEach(function (item, index) {
// console.log('item.buttonHtml===', item.buttonHtml);
// if(json[i].pzzlMc === item.bblxMc) {
// if (item.buttonHtml.indexOf(",") > -1) {
// console.log('item.buttonHtml22222===', item.buttonHtml)
// var buttonHtmlArr = item.buttonHtml.split(",");
// for (var cxi=0; cxi<buttonHtmlArr.length; cxi++) {
// var div = document.createElement("div");
// $div = $(div);
// $div.attr("alt", commonJson[i][tableObj.onlyId]);
// if (buttonHtmlArr[cxi] == "填写并申报") {
// $div.addClass("btn tdDong-btn");
// } else {
// $div.addClass("btn btn-primary tdDong-btn");
// }
// $div.html(buttonHtmlArr[cxi]);
// $td.addClass("tdDoing-contain");
// $td.append(div);
// }
// }
// else {
// console.log('11111111')
// var div = document.createElement("div");
// $div = $(div);
// $div.attr("alt", commonJson[i][tableObj.onlyId]);
// $div.addClass("btn tdDong-btn");
// $div.html(item.buttonHtml);
// $td.addClass("tdDoing-contain");
// $td.append(div);
// console.log('$td=====', $td)
// }
// }
// })
}
else
{
var
div
=
document
.
createElement
(
"div"
);
$div
=
$
(
div
);
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]);
if
(
commonJson
[
i
][
tableObj
.
onlyId
]
!=
null
)
{
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]);
}
else
{
$div
.
attr
(
"alt"
,
commonJson
[
i
].
zsxmDm
+
commonJson
[
i
].
bblxDm
+
commonJson
[
i
].
sksssjq
+
commonJson
[
i
].
sksssjz
);
}
$div
.
addClass
(
"btn btn-primary tdDong-btn"
);
$div
.
html
(
json
[
i
].
do
);
$div
.
html
(
tableObj
.
buttonHtml
);
$td
.
addClass
(
"tdDoing-contain"
);
$td
.
append
(
div
);
}
// tableObj.jsonReady.forEach(function (item, index) {
// console.log('item.buttonHtml===', item.buttonHtml);
// if(json[i].pzzlMc === item.bblxMc) {
// if (item.buttonHtml.indexOf(",") > -1) {
// console.log('item.buttonHtml22222===', item.buttonHtml)
// var buttonHtmlArr = item.buttonHtml.split(",");
// for (var cxi=0; cxi<buttonHtmlArr.length; cxi++) {
// var div = document.createElement("div");
// $div = $(div);
// $div.attr("alt", commonJson[i][tableObj.onlyId]);
// if (buttonHtmlArr[cxi] == "填写并申报") {
// $div.addClass("btn tdDong-btn");
// } else {
// $div.addClass("btn btn-primary tdDong-btn");
// }
// $div.html(buttonHtmlArr[cxi]);
// $td.addClass("tdDoing-contain");
// $td.append(div);
// }
// }
// else {
// console.log('11111111')
// var div = document.createElement("div");
// $div = $(div);
// $div.attr("alt", commonJson[i][tableObj.onlyId]);
// $div.addClass("btn tdDong-btn");
// $div.html(item.buttonHtml);
// $td.addClass("tdDoing-contain");
// $td.append(div);
// console.log('$td=====', $td)
// }
// }
// })
}
else
{
var
div
=
document
.
createElement
(
"div"
);
$div
=
$
(
div
);
$div
.
attr
(
"alt"
,
commonJson
[
i
][
tableObj
.
onlyId
]
);
$div
.
addClass
(
"
btn btn-primary tdDong-btn
"
);
$div
.
html
(
tableObj
.
buttonHtml
);
$div
.
attr
(
"alt"
,
ll
+
'anniu'
);
$div
.
addClass
(
"
hiddBtn btn btn-primary tdDong-btn
"
);
$div
.
html
(
''
);
$td
.
addClass
(
"tdDoing-contain"
);
$td
.
append
(
div
);
}
}
else
{
var
div
=
document
.
createElement
(
"div"
);
$div
=
$
(
div
);
$div
.
attr
(
"alt"
,
ll
+
'anniu'
);
$div
.
addClass
(
"hiddBtn btn btn-primary tdDong-btn "
);
$div
.
html
(
''
);
$td
.
addClass
(
"tdDoing-contain"
);
$td
.
append
(
div
);
}
}
}
}
else
{
...
...
@@ -1085,10 +1102,10 @@ var JSTOOL = function() {
}
if
(
!
json
.
length
)
{
if
(
!
tableObj
.
promptStatement
)
{
if
(
!
tableObj
.
promptStatement
)
{
var
html
=
"<div class='notHasList'>暂无数据</div>"
;
}
else
{
var
html
=
"<div class='notHasList'>"
+
tableObj
.
promptStatement
+
"</div>"
;
}
else
{
var
html
=
"<div class='notHasList'>"
+
tableObj
.
promptStatement
+
"</div>"
;
}
$
(
mainId
+
' .tbody'
).
append
(
html
);
...
...
@@ -1109,7 +1126,7 @@ var JSTOOL = function() {
}
function
reSetScroll
()
{
if
(
tableObj
.
promptStatement
||
tableObj
.
jsonReady
.
length
<
1
)
{
if
(
tableObj
.
promptStatement
||
tableObj
.
jsonReady
.
length
<
1
)
{
tableObj
.
height
=
75
;
}
$
(
mainId
+
" .table-body-container"
).
css
(
"height"
,
tableObj
.
height
+
"px"
);
...
...
@@ -1141,7 +1158,12 @@ var JSTOOL = function() {
json
.
length
=
0
;
for
(
var
i
in
data
)
{
var
obj
=
{};
tableMap
[
data
[
i
][
tableObj
.
onlyId
]]
=
data
[
i
];
if
(
data
[
i
][
tableObj
.
onlyId
]
!=
null
)
{
tableMap
[
data
[
i
][
tableObj
.
onlyId
]]
=
data
[
i
];
}
else
{
var
onlyId
=
data
[
i
].
zsxmDm
+
data
[
i
].
bblxDm
+
data
[
i
].
sksssjq
+
data
[
i
].
sksssjz
tableMap
[
onlyId
]
=
data
[
i
];
}
for
(
var
r
=
0
,
len
=
sum
.
length
;
r
<
len
;
r
++
)
{
if
([
sum
[
r
]]
==
'do'
)
{
obj
[
sum
[
r
]]
=
data
[
i
].
buttonHtml
;
//yyx 操作里面的按钮赋值
...
...
@@ -1188,7 +1210,12 @@ var JSTOOL = function() {
json
.
length
=
0
;
for
(
var
i
in
data
)
{
var
obj
=
{};
tableMap
[
data
[
i
][
tableObj
.
onlyId
]]
=
data
[
i
];
if
(
data
[
i
][
tableObj
.
onlyId
]
!=
null
)
{
tableMap
[
data
[
i
][
tableObj
.
onlyId
]]
=
data
[
i
];
}
else
{
var
onlyId
=
data
[
i
].
zsxmDm
+
data
[
i
].
bblxDm
+
data
[
i
].
sksssjq
+
data
[
i
].
sksssjz
tableMap
[
onlyId
]
=
data
[
i
];
}
for
(
var
r
=
0
,
len
=
sum
.
length
;
r
<
len
;
r
++
)
{
obj
[
sum
[
r
]]
=
data
[
i
][
sum
[
r
]];
}
...
...
@@ -1619,4 +1646,4 @@ var tool = new JSTOOL();
return
$this
;
}
});
})(
jQuery
,
window
,
document
)
})(
jQuery
,
window
,
document
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment