budgetSubspreadjsdemo.jsp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  5. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  6. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  7. <head>
  8. <meta name="spreadjs culture" content="zh-cn" />
  9. <meta charset="utf-8" />
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  11. <link rel="stylesheet" type="text/css" href="plug-in/SpreadJS/css/gc.spread.sheets.excel2016colorful.13.1.0.css">
  12. <script src="plug-in/SpreadJS/scripts/gc.spread.sheets.all.13.1.0.min.js" type="text/javascript"></script>
  13. <script src="plug-in/SpreadJS/scripts/resources/zh/gc.spread.sheets.resources.zh.13.1.0.min.js" type="text/javascript"></script>
  14. <script src = "webpage/cn/com/lzt/budget/tempsheet/hrDetail.js" type="text/javascript"></script>
  15. <script src="plug-in/SpreadJS/license.js" type="text/javascript"></script>
  16. <style>
  17. .sample-tutorial {
  18. position: relative;
  19. height: 100%;
  20. overflow: hidden;
  21. }
  22. .sample-spreadsheets {
  23. width: calc(100%);
  24. height: 100%;
  25. overflow: hidden;
  26. float: left;
  27. }
  28. .options-container {
  29. float: right;
  30. width: 40%;
  31. /* padding: 12px; */
  32. padding-left: 12px;
  33. padding-right: 12px;
  34. height: 100%;
  35. box-sizing: border-box;
  36. background: #fbfbfb;
  37. overflow: auto;
  38. }
  39. .option-row {
  40. font-size: 14px;
  41. margin-top: 10px;
  42. }
  43. label {
  44. margin-bottom: 6px;
  45. }
  46. input {
  47. padding: 4px 6px;
  48. }
  49. input[type=button] {
  50. margin-top: 6px;
  51. }
  52. .buttonStyle{
  53. width:240px;
  54. height:30px;
  55. }
  56. .colorPickerContent{
  57. width: 100%;
  58. background-color:white;
  59. }
  60. .colorDom{
  61. width: 14px;
  62. height: 14px;
  63. margin:0 0 0 6px;
  64. display: inline-block;
  65. border: solid 1px #333333;
  66. vertical-align: top;
  67. }
  68. body {
  69. position: absolute;
  70. top: 0;
  71. bottom: 0;
  72. left: 0;
  73. right: 0;
  74. }
  75. </style>
  76. </head>
  77. <body style="background:#FFFFFF">
  78. <div class="sample-tutorial" style="top: 20px;height: 500px;">
  79. <div id="ss" class="sample-spreadsheets" ></div>
  80. </div>
  81. </div>
  82. <script>
  83. var spreadNS = GC.Spread.Sheets;
  84. window.onload = function () {
  85. var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), {
  86. sheetCount: 1
  87. });
  88. var sd = detaildataSource;
  89. var sheet = spread.getActiveSheet();
  90. /* if (sd.length > 0) {
  91. sheet.setDataSource(sd);
  92. } */
  93. var table = sheet.tables.addFromDataSource("Table1", 0, 0, detaildataSource, spreadNS.Tables.TableThemes.medium2);
  94. table.showFooter(true);
  95. table.showHeader(true);
  96. table.highlightFirstColumn(true);
  97. table.highlightLastColumn(false);
  98. table.setColumnFormula(4, "=SUBTOTAL(109,[2020年度工时预算])");
  99. table.setColumnFormula(5, "=SUBTOTAL(109,[年度预留工时])");
  100. table.setColumnFormula(9, "=SUBTOTAL(109,[月平均成本])");
  101. table.setColumnValue(1, "合计");
  102. sheet.setColumnWidth(0, 80);
  103. sheet.setColumnWidth(1, 120);
  104. sheet.setColumnWidth(2, 120);
  105. sheet.setColumnWidth(3, 120);
  106. sheet.setColumnWidth(4, 120);
  107. sheet.setColumnWidth(5, 120);
  108. sheet.setColumnWidth(6, 120);
  109. sheet.setColumnWidth(7, 120);
  110. sheet.setColumnWidth(8, 120);
  111. sheet.setColumnWidth(9, 120);
  112. /* var border = new GC.Spread.Sheets.LineBorder();
  113. var styleInfo = new GC.Spread.Sheets.Tables.TableStyle('red', 'black', '10px arial', border, border, border, border, border, border);
  114. var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
  115. tableStyle.name('tableStyle1');
  116. tableStyle.headerRowStyle(styleInfo)
  117. var table = sheet.tables.add('table1', 0, 0, 4, 10, spreadNS.Tables.TableThemes.medium2); */
  118. };
  119. </script>
  120. </body>
  121. </html>