var spread2 = $('#ss').data('workbook');
var spreadNS = GC.Spread.Sheets;
spread2.options.highlightInvalidData = true;
var sheet = spread2.getSheet(0);
var dv1 = new spreadNS.DataValidation.createNumberValidator(0);
dv1.inputTitle('重复按行:');
dv1.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 0, dv1);
}
var dv2 = new spreadNS.DataValidation.createNumberValidator(0);
dv2.inputTitle('重复按行:');
dv2.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 1, dv2);
}
var dv3 = new spreadNS.DataValidation.createNumberValidator(0);
dv3.inputTitle('重复按行:');
dv3.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 3, dv3);
}
var dv4 = new spreadNS.DataValidation.createNumberValidator(0);
dv4.inputTitle('重复按行:');
dv4.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 5, dv4);
}
var dv5 = new spreadNS.DataValidation.createNumberValidator(0);
dv5.inputTitle('重复按行:');
dv5.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 6, dv5);
}
var dv6 = new spreadNS.DataValidation.createNumberValidator(0);
dv6.inputTitle('重复按行:');
dv6.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 7, dv6);
}
var dv7 = new spreadNS.DataValidation.createNumberValidator(0);
dv7.inputTitle('重复按行:');
dv7.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 8, dv7);
}
var dv8 = new spreadNS.DataValidation.createNumberValidator(0);
dv8.inputTitle('重复按行:');
dv8.inputMessage('请输入整数');
for (var i = 6; i < 20; i++) {
sheet.setDataValidator(i, 9, dv8);
}
var dv9 = new spreadNS.DataValidation.createNumberValidator(0);
dv9.inputTitle('单一:');
dv9.inputMessage('请输入整数');
sheet.setDataValidator(3, 3, dv9);
var dv10 = new spreadNS.DataValidation.createNumberValidator(0);
dv10.inputTitle('单一:');
dv10.inputMessage('请输入整数');
sheet.setDataValidator(9, 3, dv10);
var dv11 = new spreadNS.DataValidation.createNumberValidator(0);
dv11.inputTitle('单一:');
dv11.inputMessage('请输入整数');
sheet.setDataValidator(3, 4, dv11);
var dv12 = new spreadNS.DataValidation.createNumberValidator(0);
dv12.inputTitle('单一:');
dv12.inputMessage('请输入整数');
sheet.setDataValidator(6, 4, dv12);
var dv13 = new spreadNS.DataValidation.createNumberValidator(0);
dv13.inputTitle('单一:');
dv13.inputMessage('请输入整数');
sheet.setDataValidator(9, 4, dv13);
var dv14 = new spreadNS.DataValidation.createNumberValidator(0);
dv14.inputTitle('单一:');
dv14.inputMessage('请输入整数');
sheet.setDataValidator(2, 21, dv14);
var dv15 = new spreadNS.DataValidation.createNumberValidator(0);
dv15.inputTitle('单一:');
dv15.inputMessage('请输入整数');
sheet.setDataValidator(2, 24, dv15);
var dv16 = new spreadNS.DataValidation.createNumberValidator(0);
dv16.inputTitle('单一:');
dv16.inputMessage('请输入整数');
sheet.setDataValidator(4, 24, dv16);
var dv17 = new spreadNS.DataValidation.createNumberValidator(0);
dv17.inputTitle('单一:');
dv17.inputMessage('请输入整数');
sheet.setDataValidator(6, 24, dv17);
var dv18 = new spreadNS.DataValidation.createNumberValidator(0);
dv18.inputTitle('单一:');
dv18.inputMessage('请输入整数');
sheet.setDataValidator(8, 24, dv18);
var dv19 = new spreadNS.DataValidation.createNumberValidator(0);
dv19.inputTitle('单一:');
dv19.inputMessage('请输入整数');
sheet.setDataValidator(10, 24, dv19);
var dv20 = new spreadNS.DataValidation.createNumberValidator(0);
dv20.inputTitle('单一:');
dv20.inputMessage('请输入整数');
sheet.setDataValidator(2, 25, dv20);
var dv21 = new spreadNS.DataValidation.createNumberValidator(0);
dv21.inputTitle('单一:');
dv21.inputMessage('请输入整数');
sheet.setDataValidator(4, 25, dv21);
var dv22 = new spreadNS.DataValidation.createNumberValidator(0);
dv22.inputTitle('单一:');
dv22.inputMessage('请输入整数');
sheet.setDataValidator(6, 25, dv22);
var dv23 = new spreadNS.DataValidation.createNumberValidator(0);
dv23.inputTitle('单一:');
dv23.inputMessage('请输入整数');
sheet.setDataValidator(8, 25, dv23);
var dv24 = new spreadNS.DataValidation.createNumberValidator(0);
dv24.inputTitle('单一:');
dv24.inputMessage('请输入整数');
sheet.setDataValidator(10, 25, dv24);
如上代码为执行数据检查代码,在页面大约需执行30秒左右。。。有没有优化方法,请指点
|
|