分支自 SuZhouGuanHong/TaiYuanTaiZhong

dengjunjie
2024-01-16 5884c9023393061afbe6d3d6e709e53e672ddde8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/* 禁止右键选择 */
document.oncontextmenu = function () { return true; }
document.onselectstart = function () { return true; }
 
/* 链接标题 */
$('a').each(function (index) { $('a').eq(index).attr('title', $(this).text()); });
 
/* 文本框自动内容 */
$('input[type="text"]').attr('placeholder', '请输入');
 
/* 导航菜单 */
$('.nav-content').first().show();
$('.nav-title').each(function (index) {
    $('.nav-title').eq(index).click(function () {
        $(this).addClass('current').siblings('.nav-title').removeClass('current');
 
        if (index >= 1) {
            $('.nav-content').eq(index - 1).slideDown('fast').siblings('.nav-content').hide();
            $('.nav-content').eq(index - 1).siblings('.nav-content').children('li').removeClass('current');
        } else {
            $('.nav-content').slideUp('fast');
           // parent.document.getElementById('mainFrame').src = 'Default.aspx'; //跳转到首页
        }
 
        $(this).find('.fa-angle-up').attr('class', 'fa fa-angle-down second-item');
        $(this).siblings('.nav-title').find('.fa-angle-down').attr('class', 'fa fa-angle-up second-item');
    });
});
 
$('.nav-content li').each(function (index) {
    $(this).click(function () {
        $(this).addClass('current').siblings('.nav-content li').removeClass('current');
    });
})
 
/* 下拉菜单 */
$('#user-login').mouseover(function() {
    $(this).find('.fa-angle-up').attr('class', 'fa fa-angle-down second-item');
}).mouseout(function() {
    $(this).find('.fa-angle-down').attr('class', 'fa fa-angle-up second-item');
});
 
/* 框架内页链接 */
function togglePage(page) { parent.document.getElementById('mainFrame').src = page ; }
 
/* 自动宽度 */
function autoSize() {
    //$('.table-container').css('width', screen.width-270 + 'px');
    $('#corel').css('width', document.body.clientWidth - 20 + 'px');
    $('.columns-half').each(function (index) {
        $('.columns-half').eq(index).css('width', (document.getElementById('corel').offsetWidth-20)/2 + 'px');
    });
}
 
autoSize();
 
$(window).resize(function() {
    autoSize();
});
 
/* 文件框 */
$('#file-upload').click(function () {
    $('#MyFile').click();
});
 
/* FlatUI表单实例化 */
$(':radio').radiocheck();
$(':checkbox').radiocheck();
$("select").select2({dropdownCssClass: 'dropdown-inverse'});
 
//alert($('.table-container ').css('width'));
 
/* 表格样式 */
function tableStyle(tableId) {
    //表格初始化
    function initTable(tableId) {
        $(tableId + ' tr').each(function(index) {
            $(tableId + ' .select-item').eq(index + 1).attr('checked', false);
 
            if(index >= 1 && index % 2 != 0) {
                $(tableId + ' tr').eq(index).attr('class', 'odd');
            } else if(index >= 1 && index % 2 != 1) {
                $(tableId + ' tr').eq(index).attr('class', 'even');
            }
        });
    }
 
    initTable(tableId);
 
 
    //单项选择
    function singleSelect(ele) {
        $(tableId + ' ' + ele).each(function (index) {
            $(tableId + ' ' + ele).eq(index + 1).click(function () {
                $(tableId + ' tr').eq(index + 1).toggleClass('current');
            });
        });
    }
 
    singleSelect('.select-item');
    singleSelect('.select-item2');
    singleSelect('.select-item3');
    singleSelect('.select-item4');
    singleSelect('.select-item5');
 
    //全选
    function allSelect(elea, eleb, elec) {
        $(tableId + ' ' + elea).click(function () {
            if ($(tableId + ' ' + eleb).prop('checked') == true) {
                $(tableId + ' ' + elec).each(function (index) {
                    if (index == $(tableId + ' ' + elec).size() - 1) {
                        return;
                    }
 
                    $(tableId + ' tr').eq(index + 1).attr('class', 'current');
                    $(tableId + ' ' + elec).eq(index + 1).attr('checked', true);
                });
            } else {
                initTable(tableId);
            }
        });
    }
 
    allSelect('.select-all', '.select-all:eq(0)', '.select-item');
    allSelect('.select-all2', '.select-all2:eq(0)', '.select-item2');
    allSelect('.select-all3', '.select-all3:eq(0)', '.select-item3');
    allSelect('.select-all4', '.select-all4:eq(0)', '.select-item4');
    allSelect('.select-all5', '.select-all5:eq(0)', '.select-item5');
}
 
$('table:not(.queryTable)').each(function(index) {
    tableStyle('#' + $(this).attr('id'));
});
 
/* 表格兼容浮动 */
$('.table-container').each(function(index) {
    if($(this).prop('scrollWidth') <= (screen.width-260)) {
        $(this).css('overflow-x', 'auto');
    } else {
        $(this).css('overflow-x', 'scroll');
    }
});
 
/* 数据删除提示 */
function delItem() {
    swal({
        title: '您确定要删除吗?',
        text: '删除后,将永远也看不到它了。',
        type: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#dd6b55',
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        closeOnConfirm: false
    }, function() {
        swal('成功信息', '已删除,您再也看不到它了。', 'success');
    });
}
 
/* 查询区域隐藏 */
var toggleQuery = 0;
$('#channel-title').click(function() {
    if (toggleQuery == 0) {
        $('#channel-title').css('background', '#3498db');
        $('#channel-title i').first().attr('class', 'fa fa-angle-double-down');
        $('#query-area').slideDown('fast');
        toggleQuery = 1;
} else {
    $('#channel-title').css('background', '#5dade2');
        $('#channel-title i').first().attr('class', 'fa fa-angle-double-up');
        $('#query-area').slideUp('fast');
        toggleQuery = 0;
    }
});
 
var toggleQueryAdd = 0;
$('#channel-titleAdd').click(function () {
    if (toggleQueryAdd == 0) {
        $('#channel-titleAdd').css('background', '#3498db');
        $('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-down');
        $('#query-areaAdd').slideDown('fast');
        toggleQueryAdd = 1;
    } else {
        $('#channel-titleAdd').css('background', '#5dade2');
        $('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-up');
        $('#query-areaAdd').slideUp('fast');
        toggleQueryAdd = 0;
    }
});
 
 
toggleQueryAddNew=0
$('#Button_AddNewCard').click(function () {
    if (toggleQueryAddNew == 0) {
        $('#channel-titleAdd').css('background', '#3498db');
        $('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-down');
        $('#query-areaAdd').slideDown('fast');
        toggleQueryAddNew = 1;
    } else {
        $('#channel-titleAdd').css('background', '#5dade2');
        $('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-up');
        $('#query-areaAdd').slideUp('fast');
        toggleQueryAddNew = 0;
    }
});
 
 
toggleUpdateAddNew = 0
$('#Button_Update').click(function () {
    if (toggleUpdateAddNew == 0) {
        $('#channel-titleAdd').css('background', '#3498db');
        $('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-down');
        $('#query-areaAdd').slideDown('fast');
        toggleUpdateAddNew = 1;
    } else {
        $('#channel-titleAdd').css('background', '#5dade2');
        $('#channel-titleAdd i').first().attr('class', 'fa fa-angle-double-up');
        $('#query-areaAdd').slideUp('fast');
        toggleUpdateAddNew = 0;
    }
});
 
/* 分页样式 */
$('a[title="上一页"]').attr('class', 'paginator page-btn');
$('a[title="下一页"]').attr('class', 'paginator page-btn');
$('a[title="首页"]').attr('class', 'paginator page-btn page-btn-home');
$('a[title="尾页"]').attr('class', 'paginator page-btn page-btn-last');
 
$('.paginator input[type="submit"]').val('跳转');
 
var x = true;
var i = 0;
$('#body_default').onmousemove(function () {
    alert("11");
    i = i + 1;
    x = true;
});
function test() {
    alert("22");
    setTimeout("test()", 2000);
    if (x == false) {
        //window.close();
        alert("11");
    }
    x = false;
}