Commit b1268f19 authored by 吕兵川's avatar 吕兵川

[dev]提交项目

parents
Pipeline #33 canceled with stages
@charset "UTF-8";
/**
** created By 潘正龙 2019-01-10 version:1.0.0
**/
* { margin:0; padding:0; list-style:none; line-height:inherit; }
:focus { outline:0; text-decoration:none; }
span,i,em,big,small { font-size:inherit; font-weight:normal; font-style:normal; }
.clear { clear:both; }
/**更换全局字体**/
pgy-list grid[gridOptions],label-flex,.ag-theme-material .ag-header-cell-label .ag-header-cell-text,.ag-cell.ag-cell-not-inline-editing.ag-cell-with-height.ag-cell-value.ng-scope,.totalNumber,body { font-family:Helvetica,STHeiti STXihei,Microsoft JhengHei,Microsoft YaHei,sans-serif !important; }
/**基础布局flex**/
.flex { position:relative; display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:center; justify-content:center; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; }
.lflex { position:relative; display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:flex-start; justify-content:flex-start; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; }
.rflex { position:relative; display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:flex-end; justify-content:flex-end; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; }
.mflex { position:relative; display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:center; justify-content:center; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; flex-direction:column; -webkit-flex-direction:column; text-align:center; }
/**样式回写**/
.ag-root-wrapper { background:#fff; }
/**agGrid**/
#reset-agGrid { }
#reset-agGrid pgy-select .ui-select-multiple.ui-select-bootstrap,#reset-agGrid pgy-select .label-flex .div-element, .label-flex .div-label { text-align:left; }
#reset-agGrid pgy-select { position:relative; }
#reset-agGrid pgy-search-tool { position:relative; top:-2px; }
#reset-agGrid .ag-theme-material { font-size:12px; }
#reset-agGrid .ag-theme-material .ag-header .ag-header-cell { height:100%; padding:5px !important; }
#reset-agGrid .ag-theme-material .ag-header .ag-grid-checkbox-header { left:0 !important; }
#reset-agGrid .ag-theme-material .ag-header .ag-header-cell .ng-scope { height:100%; width:100%; position:relative; display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:center; justify-content:center; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; }
#reset-agGrid .ag-theme-material .ag-header .ag-header-cell .ng-scope span { width:16px; height:16px; }
#reset-agGrid .ag-theme-material .ag-header .ag-header-cell-resize { top:8px; bottom:8px; right:0 !important; width:1px; height:auto; background:#e0dede; }
#reset-agGrid .ag-theme-material .ag-header .ag-header-cell-resize:after { display:none; }
#reset-agGrid .ag-theme-material .ag-header .ag-cell-label-container { padding:0; height:100%; }
#reset-agGrid .ag-theme-material .ag-header .ag-header-cell-label { height:100%; padding: 0; }
#reset-agGrid .ag-theme-material .ag-header .ag-header-cell-text { height:100%; width:100%; position:relative; display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:center; justify-content:center; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; }
#reset-agGrid .ag-theme-material .ag-body .ag-row { display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:center; justify-content:center; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; }
#reset-agGrid .ag-theme-material .ag-body .ag-cell { padding:0 !important; height:100% !important; display:-webkit-box; display:-ms-flexbox; display:-webkit-flex; display:flex; -webkit-box-pack:center; -ms-flex-pack:center; -webkit-justify-content:center; justify-content:center; -webkit-box-align:center; -ms-flex-align:center; -webkit-align-items:center; align-items:center; }
/**自定义table**/
.main-content #container .ng-scope[ui-view], .main-content #container .ng-scope[ui-view] pgy-row { display:block; width:100%; height:100%; }
.main-content #container .ng-scope[ui-view] .row { height:100%; }
.main-content #container .ng-scope[ui-view] form { display:block; }
.main-content #container .ng-scope[ui-view] form.toolbarTrue { width:100%; height:calc(100% - 40px); margin:0 0 40px !important; }
.main-content #container .ng-scope[ui-view] pgy-form { display:block; width:100%; height:100%; }
.main-content #container .ng-scope[ui-view] form pgy-row { height:auto; }
.main-content #container .ng-scope[ui-view] pgy-form > div { width:100%; height:100%; }
.common_table { }
.common_table > div,.common_table pgy-cols { height:100%; }
.common_table table { width:100%; border-collapse:collapse; font-size:12px; height:100%; background:#fff; position:relative; }
.common_table .tt,.common_table .tb,.common_table .tm { position:relative; width:100%; }
.common_table .tm { }
.common_table th { background:#91c5ca; color:#fff; font-weight:normal; padding:5px 2px; text-align:center; position:relative; box-sizing:content-box; }
.common_table th:before { position:absolute; right:0; top:6px; bottom:6px; width:1px; content:''; background:#fff; z-index:1; }
.common_table tr th:last-child:before { display:none; }
.common_table td { padding:5px 2px; text-align:center; }
.common_table tr:nth-child(2n+1) { background:#f9f9f9; }
.common_table tr:hover { background:#ffebd8; }
/*
.ag-root-wrapper .ag-root-wrapper-body { display:block; overflow:auto; }
*/
#preTaxDetail.common_table { width:1600px; }
#preTaxDetail.common_table tr td:first-child { width:160px; }
#preTaxDetail.common_table tr td:nth-child(2) { width:85px; }
#preTaxDetail.common_table tr td:nth-child(3) { width:60px; }
#preTaxDetail.common_table tr td:nth-child(4) { width:126px; }
#preTaxDetail.common_table tr td:nth-child(5),#preTaxDetail.common_table tr td:nth-child(6){ width:30px; }
#preTaxDetail.common_table tr td:nth-child(7) { width:30px; },#preTaxDetail.common_table tr td:nth-child(8),#preTaxDetail.common_table tr td:nth-child(9) { width:60px; }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
** Modified By 潘正龙 2019-01-07 15:01:00 version:1.0.2,新定义无AJAX数据请求办法,带入回调
**/
vm.$$.Ajax = function (callBack, RequestAsync, RequestType, URL, Params) {
vm.$$.doAjaxResult(RequestAsync, RequestType,vm.$$.HostUrl + URL, do_result, Params);
function do_result(data){
return callBack(data);
}
}
vm.$$.doAjaxResult = function(RequestAsync, RequestType, URL, do_result, Params){
var c = new XMLHttpRequest() || new ActiveXObject('Msxml2.XMLHTTP') || new ActiveXObject('Microsoft.XMLHTTP'), e = new Date().valueOf();
if (URL.indexOf('?') != -1) {
URL = URL + '&t=' + e
}else{
URL = URL + '?t=' + e
}
c.open(RequestType, URL, RequestAsync); // true异步模式,false同步模式
c.onreadystatechavme = function (){
if(c.readyState == 4) {
if (c.status == 200) {
if (typeof c.responseText == 'strivm') {
try {
var obj = JSON.parse(c.responseText);
if(typeof obj == 'object' && obj ){
do_result(JSON.parse(c.responseText))
}else{
do_result(c.responseText)
}
} catch(e) {
do_result(c.responseText)
}
}
}
}
}
if(RequestType == 'PUT'){ // 浏览器原生支持Content-Type
c.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
c.send(JSON.strivmify(Params))
}else if (RequestType == 'GET') {
c.send(null)
}else if(RequestType == 'POST') {
c.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
c.send(JSON.strivmify(Params))
}
}
\ No newline at end of file
/**
** Created By 潘正龙 2019-01-07 15:14:00 version:1.0.0
**/
ng.$$.$FormatDate = function (date, fmt) { //this.Format(this.TempList[i].createTime,'yyyy-MM-dd hh:mm:ss')
var o = {
"M+": new Date(date).getMonth() + 1, //月份
"d+": new Date(date).getDate(), //日
"h+": new Date(date).getHours(), //小时
"m+": new Date(date).getMinutes(), //分
"s+": new Date(date).getSeconds(), //秒
"q+": Math.floor((new Date(date).getMonth() + 3) / 3), //季度
"S": new Date(date).getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (new Date(date).getFullYear() + "").substr(4 - RegExp.$1.length))
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)))
return fmt
}
\ No newline at end of file
This diff is collapsed.
body, html { font-size: 100%; padding: 0; margin: 0;}
/* Reset */
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* Clearfix hack by Nicolas Gallagher: http://nicolasgallagher.com/micro-clearfix-hack/ */
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
body{
background: #f9f7f6;
color: #404d5b;
font-weight: 500;
font-size: 1.05em;
font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", "FontAwesome", sans-serif;
}
a{color: #2fa0ec;text-decoration: none;outline: none;}
a:hover,a:focus{color:#74777b;}
.htmleaf-container{
margin: 0 auto;
text-align: center;
overflow: hidden;
}
.htmleaf-content {
font-size: 150%;
padding: 1em 0;
}
.htmleaf-content h2 {
margin: 0 0 2em;
opacity: 0.1;
}
.htmleaf-content p {
margin: 1em 0;
padding: 5em 0 0 0;
font-size: 0.65em;
}
.bgcolor-1 { background: #f0efee; }
.bgcolor-2 { background: #f9f9f9; }
.bgcolor-3 { background: #e8e8e8; }/*light grey*/
.bgcolor-4 { background: #2f3238; color: #fff; }/*Dark grey*/
.bgcolor-5 { background: #df6659; color: #521e18; }/*pink1*/
.bgcolor-6 { background: #2fa8ec; }/*sky blue*/
.bgcolor-7 { background: #d0d6d6; }/*White tea*/
.bgcolor-8 { background: #3d4444; color: #fff; }/*Dark grey2*/
.bgcolor-9 { background: #ef3f52; color: #fff;}/*pink2*/
.bgcolor-10{ background: #64448f; color: #fff;}/*Violet*/
.bgcolor-11{ background: #3755ad; color: #fff;}/*dark blue*/
.bgcolor-12{ background: #3498DB; color: #fff;}/*light blue*/
/* Header */
.htmleaf-header{
padding: 1em 190px 1em;
letter-spacing: -1px;
text-align: center;
}
.htmleaf-header h1 {
font-weight: 600;
font-size: 2em;
line-height: 1;
margin-bottom: 0;
font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", "FontAwesome", sans-serif;
}
.htmleaf-header h1 span {
font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", "FontAwesome", sans-serif;
display: block;
font-size: 60%;
font-weight: 400;
padding: 0.8em 0 0.5em 0;
color: #c3c8cd;
}
/*nav*/
.htmleaf-demo a{color: #1d7db1;text-decoration: none;}
.htmleaf-demo{width: 100%;padding-bottom: 1.2em;}
.htmleaf-demo a{display: inline-block;margin: 0.5em;padding: 0.6em 1em;border: 3px solid #1d7db1;font-weight: 700;}
.htmleaf-demo a:hover{opacity: 0.6;}
.htmleaf-demo a.current{background:#1d7db1;color: #fff; }
.btn{
display: inline-block;margin: 0.5em;padding: 0.6em 1em;border: 3px solid #1d7db1;font-weight: 700;background:#1d7db1;color: #fff;text-decoration: none;
}
a.btn:hover{opacity: 0.6;color: #fff;}
a.btn:focus{opacity: 1;color: #fff;}
/* Top Navigation Style */
.htmleaf-links {
position: relative;
display: inline-block;
white-space: nowrap;
font-size: 1.5em;
text-align: center;
}
.htmleaf-links::after {
position: absolute;
top: 0;
left: 50%;
margin-left: -1px;
width: 2px;
height: 100%;
background: #dbdbdb;
content: '';
-webkit-transform: rotate3d(0,0,1,22.5deg);
transform: rotate3d(0,0,1,22.5deg);
}
.htmleaf-icon {
display: inline-block;
margin: 0.5em;
padding: 0em 0;
width: 1.5em;
text-decoration: none;
}
.htmleaf-icon span {
display: none;
}
.htmleaf-icon:before {
margin: 0 5px;
text-transform: none;
font-weight: normal;
font-style: normal;
font-variant: normal;
font-family: 'icomoon';
line-height: 1;
speak: none;
-webkit-font-smoothing: antialiased;
}
/* footer */
.htmleaf-footer{width: 100%;padding-top: 10px;}
.htmleaf-small{font-size: 0.8em;}
.center{text-align: center;}
/****/
.related {
color: #fff;
background: #333;
text-align: center;
font-size: 1.25em;
padding: 0.5em 0;
margin-top: 10px;
overflow: hidden;
}
.related > a {
vertical-align: top;
width: calc(100% - 20px);
max-width: 340px;
display: inline-block;
text-align: center;
margin: 20px 10px;
padding: 25px;
font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", "FontAwesome", sans-serif;
}
.related a {
display: inline-block;
text-align: left;
margin: 20px auto;
padding: 10px 20px;
opacity: 0.8;
-webkit-transition: opacity 0.3s;
transition: opacity 0.3s;
-webkit-backface-visibility: hidden;
}
.related a:hover,
.related a:active {
opacity: 1;
}
.related a img {
max-width: 100%;
opacity: 0.8;
border-radius: 4px;
}
.related a:hover img,
.related a:active img {
opacity: 1;
}
.related h3{font-family: "Microsoft YaHei", sans-serif;}
.related a h3 {
font-weight: 300;
margin-top: 0.15em;
color: #fff;
}
/* icomoon */
.icon-htmleaf-home-outline:before {
content: "\e5000";
}
.icon-htmleaf-arrow-forward-outline:before {
content: "\e5001";
}
@media screen and (max-width: 50em) {
.htmleaf-header {
padding: 3em 10% 4em;
}
.htmleaf-header h1 {
font-size:2em;
}
}
@media screen and (max-width: 40em) {
.htmleaf-header h1 {
font-size: 1.5em;
}
}
@media screen and (max-width: 30em) {
.htmleaf-header h1 {
font-size:1.2em;
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>纯javascript简单实用的仪表盘插件</title>
<link rel="stylesheet" type="text/css" href="normalize.css" />
<link rel="stylesheet" type="text/css" href="default.css">
<style>
.container {
width: 450px;
margin: 0 auto;
text-align: center;
}
.gauge {
width: 450px;
height: 450px;
}
a:link.button,
a:active.button,
a:visited.button,
a:hover.button {
margin: 30px 5px 0 2px;
padding: 7px 13px;
}
</style>
</head>
<body>
<div class="htmleaf-container">
<div class="container">
<div class="gg1" class="gauge"></div>
<a href="#" id="gg1_refresh" class="btn">Random Refresh</a>
</div>
</div>
<script src="gauge.min.js"></script>
<script src="justgage.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var gg1 = new $Gauge({
dom: ".gg1",
value: 72,
min: 0,
max: 100,
donut: true,
gaugeWidthScale: 0.6,
counter: true,
symbol:'%'
});
document.getElementById('gg1_refresh').addEventListener('click', function() {
gg1.refresh(getRandomInt(0, 100));
});
});
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}dfn{font-style:italic;}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}mark{background:#ff0;color:#000;}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em;}pre{white-space:pre-wrap;}q{quotes:"\201C" "\201D" "\2018" "\2019";}small{font-size:80%;}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}sup{top:-0.5em;}sub{bottom:-0.25em;}img{border:0;}svg:not(:root){overflow:hidden;}figure{margin:0;}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}legend{border:0;padding:0;}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}button,input{line-height:normal;}button,select{text-transform:none;}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}button[disabled],html input[disabled]{cursor:default;}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}textarea{overflow:auto;vertical-align:top;}table{border-collapse:collapse;border-spacing:0;}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
ng.$systemService.URL = function($state){
$state = $state || ng.$state;
let name = $state.current.name;
if(name.indexOf("my")>-1){
return "personal";
}else if(name.indexOf("team")>-1){
return "team";
}else{
return "all";
}
}
\ No newline at end of file
ng.$systemService.addDom = function(obj, node, position){
let dom = document.createElement(node || "div");
for (var p in obj) {
p === "style" ? (dom[p].cssText = obj[p]) : (dom[p] = obj[p])
}
return (position || document.body).insertBefore(dom, (position || document.body).firstChild)
}
\ No newline at end of file
ng.$systemService.callBackUrl = function($state){
if(JSON.stringify($state) === '{}'){
window.location.href = window.location.href;
}else{
if(sessionStorage.redirect_param){
$state.go(sessionStorage.redirect_url,JSON.parse(sessionStorage.redirect_param));
}else{
$state.go(sessionStorage.redirect_url);
}
sessionStorage.removeItem('redirect_url');
sessionStorage.removeItem('redirect_param');
}
}
\ No newline at end of file
ng.$systemService.convertFilter = function(list){
function getSearchConditionTime(list) {
list.sort();
return list.join(',')
}
let obj = {};
if(list.length>0){
obj.exp = {
field:list[0][0],
value:((typeof list[0][1]==='object')&&list[0][1].constructor===Array)?getSearchConditionTime(list[0][1]):list[0][1],
op:list[0][2]===undefined?"EQ":list[0][2]
}
}
if(list.length>1){
obj.subConds = [];
ng.angular.forEach(list,function (item,index) {
if(index>0){
obj.subConds.push({
cond:{
exp:{
field:item[0],
value:((typeof item[1]==='object')&&item[1].constructor===Array)?getSearchConditionTime(item[1]):item[1],
op:item[2]===undefined?"EQ":item[2]
}
},
lop:item[3]===undefined?"AND":item[3]
});
}
});
}
if(JSON.stringify(obj) === "{}"){
return '';
}else{
return encodeURIComponent(JSON.stringify(obj));
}
}
\ No newline at end of file
ng.$systemService.convertOrder = function(params, defaultSort, $filter){
$filter = $filter || ng.$filter;
let sortObj = {};
if(defaultSort){
ng.angular.copy(defaultSort,sortObj);
}
if(params.sortModel.length>0){
sortObj={
"field":params.sortModel[0].colId,
"direction":$filter('uppercase')(params.sortModel[0].sort)
};
return encodeURIComponent(JSON.stringify([sortObj]));
}else{
return defaultSort!==undefined?encodeURIComponent(JSON.stringify([sortObj])):undefined;
}
}
\ No newline at end of file
ng.$systemService.fillZero = function(number, digits){
number = String(number);
let length = number.length;
if (number.length < digits) {
for (let i = 0; i < digits - length; i++) {
number = "0" + number;
}
}
return number;
}
\ No newline at end of file
ng.$systemService.formatDay = function(day){
var map = {
1: '星期一',
2: '星期二',
3: '星期三',
4: '星期四',
5: '星期五',
6: '星期六',
0: '星期日',
};
return map[day]
}
\ No newline at end of file
ng.$systemService.getCurrentNode = function(url, options, $scope, sub, systemService){
systemService = systemService || ng.$systemService;
let data = [];
if(sub){
data = options;
}else{
data = options.my_data;
}
let flag = false;
for(let i=0;i<data.length;i++){
if(data[i].url===url){
$scope.__selectNode=data[i];
flag=true;
break;
}else {
if(data[i].children && data[i].children.length){
for(let j=0;j<data[i].children.length;j++){
if(data[i].children[j].url === url){
$scope.__selectNode = data[i].children[j];
flag = true;
break;
}
}
if(flag){
break;
}
}
}
}
setTimeout(function () {
systemService.loadMyCtrl(flag, options, $scope, systemService);
},200);
}
\ No newline at end of file
ng.$systemService.getCurrentUrl = function($state){
$state = $state || ng.$state;
let currentRounter;
if($state.current.name.split('.').length===2){
currentRounter=$state.current.name
}else {
let routerList=$state.current.name.split('.');
routerList.splice(2,1);
currentRounter=routerList.join('.')
}
return currentRounter;
}
\ No newline at end of file
ng.$systemService.getKeyByObj = function(key, obj){
var has;
obj = JSON.stringify(obj);
if(obj.indexOf(key) > -1){
obj = obj.substr(obj.indexOf(key), obj.length);
has = obj.split(',')[0].split(':')[1].replace(/\s+|\}|\{|\[|\]|\'|\"/g, '');
}else{
has = false
}
return has;
}
\ No newline at end of file
ng.$systemService.getLoginUser = function($state){
$state = $state || ng.$state;
if(!sessionStorage.login_user){
if(ng.$$.MY_SSO.enabled){
window.location.href = ng.$$.MY_SSO.casUrl + encodeURIComponent(ng.$$.MY_SSO.loginApi);
}else{
$state.go('page.login', {action: 'logout'});
}
return undefined;
}else{
return JSON.parse(sessionStorage.login_user);
}
}
\ No newline at end of file
ng.$systemService.getMenuRouter = function(config, $state, systemService){
$state = $state || ng.$state;
systemService = systemService || ng.$systemService;
let currentRouter = systemService.getParentRouter();
if(config.router[config.currentUrl]){
$state.go(currentRouter+"."+config.currentUrl, config.params);
}
}
\ No newline at end of file
ng.$systemService.getMonthDay = function(date){
let daysOfMonth = [];
let fullYear = date.getFullYear();
let month = date.getMonth() + 1;
let lastDayOfMonth = new Date(fullYear, month, 0).getDate();
for (let i = 1; i <= lastDayOfMonth; i++) {
daysOfMonth.push(dateParse(fullYear + '-' + month + '-' + i));
}
return daysOfMonth;
}
\ No newline at end of file
ng.$systemService.getNextMonthDay = function(date){
var fullYear = date.getFullYear();
var month = date.getMonth() + 1;
return ng.$systemService.getMonthDay(new Date(fullYear,month,1))
}
\ No newline at end of file
ng.$systemService.getParentRouter = function($state){
$state = $state || ng.$state;
let currentRouter;
if($state.current.name.split('.').length===2){
currentRouter= $state.current.name
}else {
let routerList=$state.current.name.split('.');
routerList.splice(2,1);
currentRouter=routerList.join('.')
}
return currentRouter;
}
\ No newline at end of file
ng.$systemService.getPreMonthDay = function(date){
var fullYear = date.getFullYear();
var month = date.getMonth() - 1;
return ng.$systemService.getMonthDay(new Date(fullYear,month,1));
}
\ No newline at end of file
ng.$systemService.getUserSession = function(systemService,$state){
systemService = systemService || ng.$systemService;
$state = $state || ng.$state;
if(!sessionStorage.login_user){
if(ng.$$.MY_SSO.enabled){
window.location.href = ng.$$.MY_SSO.casUrl+encodeURIComponent(ng.$$.MY_SSO.loginApi);
}else{
systemService.checkLogin().then(function (data) {
if (data.status === 'SUCCESS' && data.content) {
console.log('进来了');
systemService.setUserSession(data.content);
}
});
$state.go('page.login', {action: 'logout'});
}
return undefined;
}else{
if(sessionStorage.inDelegation === 'true'){
return JSON.parse(sessionStorage.proxy_user);
}else{
return JSON.parse(sessionStorage.login_user);
}
}
}
\ No newline at end of file
ng.$systemService.guid = function(){
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
let r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);
return v.toString(16);
});
}
\ No newline at end of file
ng.$systemService.loadCss = function(url){
let ele = document.createElement('link');
ele.href = url;
ele.rel = 'stylesheet';
if (ele.onload === null) {
ele.onload = function() {
};
}else {
ele.onreadystatechange = function() {};
}
ng.angular.element(ng.$$.$('body')).prepend(ele);
}
\ No newline at end of file
ng.$systemService.loadMyCtrl = function(flag, options, $scope, systemService){
systemService = systemService || ng.$systemService;
if(options.my_ctrl){
options.my_ctrl.expand_all();
if(flag){
options.my_ctrl.select_branch($scope.__selectNode);
}else{
options.my_ctrl.select_branch(options.my_data[0]);
}
}else{
setTimeout(function () {
systemService.loadMyCtrl(flag, options, $scope, systemService);
},100);
}
}
\ No newline at end of file
ng.$systemService.loadScript = function(url, callback){
let head = ng.$$.$('head');
let script = document.createElement("script");
script.setAttribute("type", "text/javascript");
script.setAttribute("src", url);
script.setAttribute("async", true);
script.setAttribute("defer", true);
head.appendChild(script);
if (document.all) { /**IE**/
script.onreadystatechange = function() {
let state = this.readyState;
if (state === 'loaded' || state === 'complete') {
callback && callback();
}
}
}else { /**firefox, chrome**/
script.onload = function() {
callback && callback();
}
}
}
\ No newline at end of file
ng.$systemService.regObj = function(name, value, disabled, $filter){
$filter = $filter || ng.$filter;
if(!disabled){
let obj;
switch (name) {
case 'mobile':
obj= {reg:/^1([0-9])\d{9}$/, msg:$filter('translate')('form.ERROR_PATTERN_MOBILE')};
break;
case 'phone':
obj= {reg:/^$|(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/, msg:$filter('translate')('form.ERROR_PATTERN_PHONE')};
break;
case 'email':
obj= {reg:/^[a-zA-Z0-9_+.-]+\@([a-zA-Z0-9-]+\.)+[a-zA-Z0-9]{2,10}$/, msg:$filter('translate')('form.ERROR_PATTERN_EMAIL')};
break;
case 'money':
obj= {reg:/^\d+(\.\d{1,2})?$/, msg:$filter('translate')('form.ERROR_PATTERN_MONEY')};
break;
case 'moneyAllowNegative':
obj= {reg:/^(\-|\+)?\d+(\.\d{1,2})?$/, msg:$filter('translate')('form.ERROR_PATTERN_MONEY')};
break;
case 'integer':
obj= {reg:/^\d+?$/, msg:$filter('translate')('form.ERROR_PATTERN_INTEGER')};
break;
default:
return false;
}
let validity = obj.reg.test(value);
if(value&&!validity){
return {
error:true,
msg:obj.msg
}
}
}
}
\ No newline at end of file
ng.$systemService.search = function(originalData,filterList){
let original = [];
ng.angular.copy(originalData,original);
let list = [];
if(filterList.length>0){
ng.angular.forEach(filterList,function (field,ind) {
ng.angular.forEach(original,function (data,index) {
for(var p in data){
if(p===field.field){
if(data[p].toLowerCase().indexOf(field.value.toLowerCase())>-1){
list.push(data);
}
}
}
});
if(ind!==filterList.length-1){
ng.angular.copy(list,original);
list = [];
}
});
}else {
list = original;
}
return list;
}
\ No newline at end of file
ng.$systemService.setUserSession = function(user, $rootScope){
$rootScope = $rootScope || ng.$rootScope || {};
if(!user){
return false;
}else{
user = user[0] || user;
}
console.log('进入user',user);
$rootScope.user = {id:user.id,login_name: user.login_name, head_img: 'images/media-user.png',proxy:user.inDelegation};
if(user.inDelegation){ /**用户已代理**/
$rootScope.user.proxy_name = '代 '+user.name;
sessionStorage.proxy_user = JSON.stringify(user);
let login = JSON.parse(sessionStorage.login_user);
login.inDelegation = true;
localStorage.inDelegation = true;
$rootScope.user.login_name = login.name;
localStorage.login_user = JSON.stringify(login);
}else{ /**用户未代理**/
user.inDelegation=false;
sessionStorage.login_user = JSON.stringify(user);
localStorage.inDelegation = false;
$rootScope.user.proxy_name = '被代办人';
$rootScope.user.login_name = user.name;
localStorage.login_user = JSON.stringify(user);
}
}
\ No newline at end of file
ng.$systemService.translate = function(key, $filter){
$filter = $filter || ng.$filter;
return $filter('translate')(key);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment