📄 select.js
字号:
function passValue (openerId, switchButton, child, span){
document.getElementById("openerId").value=openerId;
document.getElementById("switchButton").value=switchButton;
document.getElementById("child").value=child;
document.getElementById("span").value=span;
}
function passParameter(openerId, openerName1, openerName2, openerName3, openerName4){
document.getElementById("openerId").value=openerId;
document.getElementById("openerName1").value=openerName1;
document.getElementById("openerName2").value=openerName2;
document.getElementById("openerName3").value=openerName3;
document.getElementById("openerName4").value=openerName4;
}
function showDiv(buttonImg, divId) {
display = divId.style.display;
if (display == "inline" || display == "") {
buttonImg.className = "closeButton"
divId.style.display = "none";
} else {
buttonImg.className = "openButton"
divId.style.display = "inline";
}
}
function selectChecked(objectId) {
var dialogParentWin = window.dialogArguments;
selector = document.getElementById(objectId);
openerId = dialogParentWin.document.getElementById("openerId").value;
var elementNames = dialogParentWin.document.getElementsByName(openerId);
for(i = 0; i < elementNames.length; i++) {
if (elementNames[i].checked) {
if (elementNames[i].value == selector.value) {
selector.checked = true;
}
}
}
}
function selectCheckBox(object) {
var dialogParentWin = window.dialogArguments;
openerId = dialogParentWin.document.getElementById("openerId").value;
switchButton = dialogParentWin.document.getElementById("switchButton").value;
span = dialogParentWin.document.getElementById("span").value;
child= dialogParentWin.document.getElementById("child").value;
var checkBoxIdArray = document.getElementsByName("checkBoxId");
var checkBoxNameArray = document.getElementsByName("checkBoxName");
checkboxString = "<table id='dataSelect' class='table001' cellspacing='1' cellpadding='3' >";
object.createList(openerId, checkBoxIdArray, checkBoxNameArray);
checkboxString = checkboxString + object.checkboxString + "</table>";
dialogParentWin.document.getElementById(switchButton).className = "openButton";
dialogParentWin.document.getElementById(child).style.display = "inline";
dialogParentWin.document.getElementById(span).innerHTML += checkboxString;
}
function getParentCheckBox() {
var dialogParentWin = window.dialogArguments;
openerId = dialogParentWin.document.getElementById("openerId").value;
var elementNames = dialogParentWin.document.getElementsByName(openerId);
return elementNames;
}
//General departmentList
function General() {
this.checkboxString = "";
}
General.prototype.createList = function(openerId, checkBoxIdArray, checkBoxNameArray){
for (i = 0; i < checkBoxIdArray.length; i++ ) {
if (checkBoxIdArray[i].checked) {
var elements = getParentCheckBox();
for(j = 0; j < elements.length; j++) {
if(elements[j].value == checkBoxIdArray[i].value){
checkBoxIdArray[i].checked = false;
break;
}
}
if (checkBoxIdArray[i].checked) {
this.checkboxString = this.checkboxString + '<li><input type="checkbox" dataType="非空复选框" dispName="复选框" minSelect="1" checked name="' + openerId + '" value="' + checkBoxIdArray[i].value + '"/>' + checkBoxNameArray[i].value + '</li>';
}
}
}
}
function ItemContent() {
this.checkboxString = "";
}
ItemContent.prototype.createList = function(openerId, checkBoxIdArray, checkBoxNameArray) {
var checkItemSnNameArray = document.getElementsByName("itemSnName");
var checkRepairItemNameArray = document.getElementsByName("repairItemName");
this.checkboxString = this.checkboxString + '<tr class="tableTitle">';
this.checkboxString = this.checkboxString + '<td align="center" width="10%"></td>';
this.checkboxString = this.checkboxString + '<td align="center" width="30%">人员姓名</td>';
this.checkboxString = this.checkboxString + '<td align="center" width="30%">所在部门</td>';
this.checkboxString = this.checkboxString + '<td align="center" width="30%">所在班组</td>';
this.checkboxString = this.checkboxString + '</tr>';
for (i = 0; i < checkBoxIdArray.length; i++) {
if (checkBoxIdArray[i].checked) {
this.checkboxString = this.checkboxString + '<tr class="tdcontent1">';
this.checkboxString = this.checkboxString + '<td align="left" width="10%"><input type="checkbox" dataType="非空复选框" dispName="复选框" minSelect="1" checked name="' + openerId + '" value="' + checkBoxIdArray[i].value + '"/></td>'
this.checkboxString = this.checkboxString + '<td align="left" width="30%">' + checkBoxNameArray[i].value + '</td>'
this.checkboxString = this.checkboxString + '<td align="left" width="30%">' + checkItemSnNameArray[i].value + '</td>';
this.checkboxString = this.checkboxString + '<td align="left" width="30%">' + checkRepairItemNameArray[i].value + '</td>';
this.checkboxString = this.checkboxString + '</tr>'
}
}
}
function getDynamicData(actionUrl) {
var dialogParentWin = window.dialogArguments;
iframeWin = dialogParentWin.frames["insertTemplateFrame"];
var archivesArray = dialogParentWin.document.getElementsByName("archivesId");
allCheckBoxes = document.getElementsByName("checkBoxId");
var checkBoxes = new Array();
for(i=0; i<allCheckBoxes.length; i++) {
if (allCheckBoxes[i].checked) {
if (archivesArray.length > 0) {
for(j=0; j<archivesArray.length; j++) {
if (archivesArray[j].value == allCheckBoxes[i].value) {
// alert("break---小窗口:" + (i+1) + "\n" + "父:" + (j+1));
break;
}
// alert("小窗口:" + (i+1) + "\n" + "父:" + (j+1));
if (j == archivesArray.length - 1) {
// alert("add:" + (i+1));
checkBoxes.push(allCheckBoxes[i]);
}
}
} else {
checkBoxes.push(allCheckBoxes[i]);
}
}
}
for(i=0; i<checkBoxes.length; i++) {
tempFlag = actionUrl.indexOf("?");
if (tempFlag == -1) {
actionUrl = actionUrl + "?";
} else {
actionUrl = actionUrl + "&";
}
actionUrl = actionUrl + "id=" + checkBoxes[i].value;
}
if (actionUrl.indexOf("id") != -1) {
iframeWin.document.location.href=actionUrl;
}
// iframeWin.document.forms[0].target="insertTemplateFrame";
}
function getArchives(defaultObjName,actionUrl) {
var defaultObj = new Array();
defaultObj = document.getElementsByName(defaultObjName);
iframeWin = window.frames["insertTemplateFrame"];
var defaultValues = new Array();
if(defaultObj.length){
for(i=0; i<defaultObj.length; i++) {
defaultValues.push(defaultObj[i].value);
}
}
var returnValues = openArchivesView(defaultValues);
var finalResults = new Array();
for(i=0; i<returnValues.length; i++) {
if (defaultValues.length > 0) {
for(var index=0; index<defaultValues.length; index++) {
if (defaultValues[index] == returnValues[i]['id']) {
break;
}
if (index == defaultValues.length - 1) {
finalResults.push(returnValues[i]['id']);
}
}
} else {
finalResults.push(returnValues[i]['id']);
}
}
for(i=0; i<finalResults.length; i++) {
tempFlag = actionUrl.indexOf("?");
if (tempFlag == -1) {
actionUrl = actionUrl + "?";
} else {
actionUrl = actionUrl + "&";
}
actionUrl = actionUrl + "id=" + finalResults[i];
}
// alert(actionUrl);
if (actionUrl.indexOf("id") != -1) {
iframeWin.document.location.href=actionUrl;
}
}
function getSkillArchives(defaultObjName,actionUrl) {
var defaultObj = new Array();
defaultObj = document.getElementsByName(defaultObjName);
iframeWin = window.frames["insertTemplateFrame"];
var defaultValues = new Array();
if(defaultObj.length){
for(i=0; i<defaultObj.length; i++) {
defaultValues.push(defaultObj[i].value);
}
}
var returnValues = openSkillArchivesView(defaultValues);
var finalResults = new Array();
for(i=0; i<returnValues.length; i++) {
if (defaultValues.length > 0) {
for(var index=0; index<defaultValues.length; index++) {
if (defaultValues[index] == returnValues[i]['id']) {
break;
}
if (index == defaultValues.length - 1) {
finalResults.push(returnValues[i]['id']);
}
}
} else {
finalResults.push(returnValues[i]['id']);
}
}
for(i=0; i<finalResults.length; i++) {
tempFlag = actionUrl.indexOf("?");
if (tempFlag == -1) {
actionUrl = actionUrl + "?";
} else {
actionUrl = actionUrl + "&";
}
actionUrl = actionUrl + "id=" + finalResults[i];
}
// alert(actionUrl);
if (actionUrl.indexOf("id") != -1) {
iframeWin.document.location.href=actionUrl;
}
}
function saveToWindow(obj, Url) {
obj.setAttribute("number","#");
var objArray = document.getElementsByName(obj.name);
for(i=0;i<objArray.length;i++) {
if (objArray[i].number) {
objArray[i].removeAttribute("number");
window.openerObjNumber = i;
// alert(window.openerObjNumber);
}
}
if (Url) {
popupWindow(Url, window);
}
}
function initClear(args,isArray) { //args type is array
for(i = 0; i < args.length; i++) {
if (window.openerObjNumber) {
obj = document.getElementsByName(args[i])[window.openerObjNumber];
} else {
obj = document.getElementById(args[i]);
}
obj.value="";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -