text.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <!DOCTYPE html>
  2. <html>
  3. <head lang='zh'>
  4. <meta charset='utf-8'>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="renderer" content="webkit" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=0" />
  8. <title>Luckysheet</title>
  9. <!-- <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/css/pluginsCss.css' />
  10. <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/plugins.css' />
  11. <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/css/luckysheet.css' />
  12. <link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/assets/iconfont/iconfont.css' />
  13. <script src="https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/js/plugin.js"></script>
  14. <script src="https://cdn.jsdelivr.net/npm/luckysheet/dist/luckysheet.umd.js"></script> -->
  15. <link rel='stylesheet' href='/static/js/luckysheet/plugins/css/pluginsCss.css' />
  16. <link rel='stylesheet' href='/static/js/luckysheet/plugins/plugins.css' />
  17. <link rel='stylesheet' href='/static/js/luckysheet/css/luckysheet.css' />
  18. <link rel='stylesheet' href='/static/js/luckysheet/assets/iconfont/iconfont.css' />
  19. <script src="/static/js/luckysheet/plugins/js/plugin.js"></script>
  20. <script src="/static/js/luckysheet/luckysheet.umd.js"></script>
  21. <script src="/static/js/api.config.js"></script>
  22. <script src="/static/js/util.js?v=1.0.0"></script>
  23. <script src="/static/js/url.js?v=1.0.0"></script>
  24. </script>
  25. </head>
  26. <style>
  27. * {
  28. padding: 0;
  29. margin: 0;
  30. }
  31. html,
  32. body {
  33. height: 100%;
  34. width: 100%;
  35. overflow-y: hidden;
  36. }
  37. /* .luckysheet-stat-area{
  38. display: none !important;
  39. } */
  40. </style>
  41. <body>
  42. <div id="luckysheet" style="width:99%;height:100%">
  43. </div>
  44. <script>
  45. var date = new Date();
  46. var month = date.getMonth()
  47. if (month >= 1 && month <= 9) {
  48. month = "0" + (month + 1);
  49. }
  50. var nowDate = date.getFullYear() + '-' + month
  51. $(function () {
  52. function receiveMessage(event) {
  53. if (event.data.module == 'aaa') {
  54. getData(event.data.month)
  55. }
  56. }
  57. window.addEventListener("message", receiveMessage, false)
  58. getData(nowDate)
  59. })
  60. function getData(nowDate) {
  61. util.ajaxJson("", ctx + '/market/keywork/load', {
  62. "id": '',
  63. "opMonth": nowDate,
  64. "sts": '0'
  65. }, function (data) {
  66. if (data.result == 0) {
  67. for (var i = 0; i < data.body[0].data.length; i++) {
  68. for (var j = 0; j < data.body[0].data[i].length; j++) {
  69. if (data.body[0].data[i][j] != null) {
  70. if (data.body[0].data[i][j].hasOwnProperty('complete') && data.body[0].data[i][j].hasOwnProperty('revoke') && data.body[0].data[i][j].revoke != '1') {
  71. data.body[0].data[i][j].bg = null
  72. } else if (data.body[0].data[i][j].hasOwnProperty('setup')) {
  73. } else {
  74. data.body[0].data[i][j].bg = null
  75. data.body[0].data[i][j].v = ''
  76. }
  77. }
  78. }
  79. }
  80. if (data.body[0].config.authority) {
  81. data.body[0].config.authority.hintText = '仅供查看、禁止编辑'
  82. }
  83. initExcel(data.body)
  84. }
  85. });
  86. }
  87. function initExcel(data) {
  88. luckysheet.create({
  89. container: 'luckysheet',
  90. data: data,
  91. allowEdit: false, // 是否允许前台编辑
  92. showtoolbar: false, // 是否显示工具栏
  93. showConfigWindowResize: false,
  94. showtoolbarConfig: { paintFormat: false, italic: true, },// 工具栏配置
  95. showtoolbar: false,
  96. showinfobar: false,
  97. allowUpdate: false,
  98. column: 12,
  99. title: data[0].fileName || '默认模板',
  100. row: 10,
  101. lang: 'zh',
  102. showsheetbar: false, // 底部sheet显示/隐藏
  103. showstatisticBar: false, // 底部计数
  104. myFolderUrl: false,
  105. showinfobar: true,
  106. showstatisticBarConfig: {
  107. count: false, // 计数栏
  108. view: false, // 打印视图
  109. zoom: false, // 缩放
  110. },
  111. cellRightClickConfig: {
  112. copy: false, // 复制
  113. copyAs: false, // 复制为
  114. paste: true, // 粘贴
  115. insertRow: true, // 插入行
  116. insertColumn: true, // 插入列
  117. deleteRow: true, // 删除选中行
  118. deleteColumn: true, // 删除选中列
  119. deleteCell: false, // 删除单元格
  120. hideRow: false, // 隐藏选中行和显示选中行
  121. hideColumn: false, // 隐藏选中列和显示选中列
  122. rowHeight: false, // 行高
  123. columnWidth: false, // 列宽
  124. clear: false, // 清除内容
  125. matrix: false, // 矩阵操作选区
  126. sort: false, // 排序选区
  127. filter: false, // 筛选选区
  128. chart: false, // 图表生成
  129. image: false, // 插入图片
  130. link: false, // 插入链接
  131. data: false, // 数据验证
  132. cellFormat: false, // 设置单元格格式
  133. isTrue: false
  134. },
  135. hook: {
  136. cellMousedown: function () {
  137. // window.top.$vm.$message({
  138. // message: '仅提供查看不可编辑',
  139. // type: 'info'
  140. // })
  141. },//绑定鼠标事件
  142. },
  143. })
  144. }
  145. </script>
  146. </body>
  147. </html>