setFormulaCondition.jsp
6.78 KB
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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
<style>
</style>
</head>
<body>
<div style="background: #505050;width: 100%;height: 100%;">
<div id="formular_box">
<div class="formular_header">
<div style="float: left;">函数参数</div>
<div style="float: right;" class="weaver-fnaMulit-formular-cancel">×</div>
</div>
<div id="formular_Content">
<div id="formular_SUM">
<div class="focus_box">
<div><span>number </span><input class="first_input_SUM" onchange="changeHidden_input('SUM')" readonly/></div>
</div>
</div>
<div id="formular_AVG">
<div class="focus_box">
<div><span>number </span><input class="first_input_AVG" onchange="changeHidden_input('AVG')" readonly/></div>
<!-- <div style="display: none;"><span>number2:</span><input class="second_input"/></div> -->
</div>
</div>
<div id="formular_MAX">
<div class="focus_box">
<div><span>number </span><input class="first_input_MAX" onchange="changeHidden_input('MAX')" readonly/></div>
<!-- <div style="display: none;"><span>number2:</span><input class="second_input"/></div> -->
</div>
</div>
<div id="formular_MIN">
<div class="focus_box">
<div><span>number </span><input class="first_input_MIN" onchange="changeHidden_input('MIN')" readonly/></div>
</div>
</div>
<!-- <div id="formular_IF">
<div><span>number1:</span><input class="first_input_IF"/></div>
</div> -->
</div>
<div class="custom_fna">
<!-- <span> </span><div onclick="showTopFormula()">自定义公式</div> -->
</div>
<div style="display: none;"><span>number2:</span><input class="hide_input"/></div>
<div class="formular_footer">
<button onClick="close()" id="weaver-fna-formular-sure">确 定</button>
<button class="weaver-fnaMulit-formular-cancel" id='boxCancel'>取消</button>
</div>
</div>
</div>
<script>
// jQuery(document).ready(function(){
// var cover = $('#_DialogBGDiv_setFormulaCondition_dialog',window.top.document)[0].style.display = 'none';
// // $('.first_input').focus();
// });
var window_url = getQueryString();
var parentWin = $('#_DialogFrame_'+window_url,window.top.document)[0].contentWindow;
const dialogCondition = window.top.getDialog(window);
function getQueryString(){
var subscript = window.location.search.lastIndexOf('=');
r = window.location.search.substr(parseInt(subscript)+1);
if(r!=null) return r; return null;
}
window.onload = function () {
var allHanshu = '';
var sheet = getCurrentSheet();
var sels = sheet.getSelections();
var weaver_fna_formular_sure = document.getElementById('weaver-fna-formular-sure');
weaver_fna_formular_sure.onclick = function (){
var weaver_fna_formular_sure = document.getElementById('weaver-fna-formular-sure');
$('#formular_box').css({"display":"none"});
}
var weaver_fnaMulit_formular_cancel = document.getElementsByClassName('weaver-fnaMulit-formular-cancel');
for(var i = 0;i<weaver_fnaMulit_formular_cancel.length;i++){
weaver_fnaMulit_formular_cancel[i].onclick = function (){
$('#formular_box').css({"display":"none"});
}
}
$("body").delegate(
".formular_header",{
mousedown: function (e) {
var el = $("#formular_box");
var os = el.offset(),
dx = e.pageX - os.left, dy = e.pageY - os.top;
$(document).on('mousemove.drag', function (e) {
el.offset({top: e.pageY - dy, left: e.pageX - dx});
});
},
mouseup: function (e) {
$(document).off('mousemove.drag');
}
}
);
// var formular_Content = document.getElementById('formular_Content');
// formular_Content.addEventListener('click',function(){
// console.log(111)
// },false)
}
function callBackFn(ref){
allHanshu = ref;
$('#formular_box #formular_Content > div').each(function(index,ele){
ele.style.display = 'none';
})
if(allHanshu == 'SUM'){
formular_SUM.style.display = 'block'
}else if(allHanshu == 'AVG'){
formular_AVG.style.display = 'block'
}else if(allHanshu == 'MAX'){
formular_MAX.style.display = 'block'
}else if(allHanshu == 'MIN'){
formular_MIN.style.display = 'block'
}else if(allHanshu == 'IF'){
formular_IF.style.display = 'block'
}
}
function changeHidden_input(type){
$('.hide_input').val($('.first_input_'+type).val());
parentWin.formula_fna_params['inputValue'] = $('.first_input_'+type).val();
// parentWin.inputChange($('.hide_input').val())
parentWin.baseOperate.inputChangeFace($('.first_input_'+type).val())
}
</script>
</body>
</html>