├── img └── toolbar.png ├── fonts ├── fontawesome-webfont.eot ├── fontawesome-webfont.ttf ├── fontawesome-webfont.woff └── fontawesome-webfont.woff2 ├── css ├── font-awesome.4.6.0.css ├── excel.css ├── main.css └── font-awesome.min.css ├── js ├── windowFun.js └── excel.js ├── README.md ├── README.en.md ├── index.html └── LICENSE /img/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyBeany/myExcel/HEAD/img/toolbar.png -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyBeany/myExcel/HEAD/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyBeany/myExcel/HEAD/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyBeany/myExcel/HEAD/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MyBeany/myExcel/HEAD/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /css/font-awesome.4.6.0.css: -------------------------------------------------------------------------------- 1 | /*-防止各大cdn公共库加载地址失效问题,此地址我们会时时监控,及调整-www.jq22.com为您服务*/ 2 | /*当前为百度 cdn公共库提供font-awesome-4.6.0 Css样式文件*/ 3 | @import url("font-awesome.min.css"); 4 | -------------------------------------------------------------------------------- /js/windowFun.js: -------------------------------------------------------------------------------- 1 | window.onbeforeunload = function (e) { 2 | e = e || window.event; 3 | if (e) { 4 | e.returnValue = '确定离开吗?'; 5 | } 6 | return '确定离开吗?'; 7 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # myExcel 2 | 3 | #### 介绍 4 | 基于jquery实现的web版excel。包含excel的基本功能 5 | 1. 支持合并单元格,拆分单元格 6 | 2. 支持插入单元格,删除单元格 7 | 3. 支持整行整列选择单元格 8 | 4. 自定义右键菜单,可以设置单元格数量 9 | 5. 支持鼠标左键拖动调整单元格宽高 10 | 6. 支持选中单元格输入文字,多个单元格设置字体,颜色,单元格背景色,水平位置,垂直位置,字体粗细,斜体,字体大小等样式 11 | 7. 单元格设置自动换行功能,默认为超出部分显示省略号 12 | 8. 支持表结构修改的撤回功能(待完善) 13 | 9. 支持单个单元格的样式复制 14 | 10. 支持选中单元格,鼠标左键选中复制。复制支持有规律的数字计算(等差数列) 15 | 11. 支持设置单元格线条样式,颜色 16 | 12. 选中单元格可以根据上下左右键来进行移动选择,回车键默认与右键功能相同 17 | 13. 支持保存excel的HTML结构和将保存的excel结构代码展示出来继续编辑 18 | 19 | #### 软件架构 20 | 使用jquery制作,其中使用了font-awesome作为字体图标 21 | 22 | 23 | #### 安装教程 24 | 25 | 下载后直接打开index.html运行即可 26 | 27 | #### 界面展示 28 | 29 | ![输入图片说明](https://gitee.com/uploads/images/2019/0406/145438_38e53dca_1325113.png "微信截图_20190406134820.png") 30 | ![输入图片说明](https://gitee.com/uploads/images/2019/0406/145450_73e79354_1325113.png "微信截图_20190406134906.png") 31 | ![输入图片说明](https://gitee.com/uploads/images/2019/0406/145509_c843888f_1325113.png "微信截图_20190406135056.png") 32 | -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # myExcel 2 | 3 | #### Description 4 | 基于jquery实现的web版excel。包含excel的基本功能 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) -------------------------------------------------------------------------------- /css/excel.css: -------------------------------------------------------------------------------- 1 | .excel-table { 2 | overflow: auto; 3 | } 4 | 5 | .excel { 6 | margin: 0 auto; 7 | width: 100%; 8 | height: 60%; 9 | position: relative 10 | } 11 | 12 | .excel-table table tr { 13 | /*line-height: 35px*/ 14 | } 15 | 16 | .excel-table table td { 17 | border: #ccc 1px solid; 18 | word-wrap: break-word; 19 | word-break: break-all; 20 | font-size: 12px; 21 | white-space: nowrap; 22 | overflow: hidden; 23 | text-overflow: ellipsis; 24 | width: 60px; 25 | font-family: 微软雅黑; 26 | } 27 | 28 | .excel-table table td:focus { 29 | outline: 0; 30 | border: 1px solid #5897fb; 31 | box-shadow: 0 0 5px rgba(73, 177, 249, .5) 32 | } 33 | 34 | .td-chosen-css { 35 | } 36 | 37 | .td-chosen-muli-css { 38 | background-color: rgba(0, 94, 255, 0.1); 39 | } 40 | 41 | .col-width-panel, .row-height-panel, .chosen-area-p, .rightmouse-panel-div, .chosen-area-p div { 42 | position: absolute 43 | } 44 | 45 | .col-width-panel div { 46 | width: 8px; 47 | position: absolute; 48 | cursor: col-resize; 49 | z-index: 999; 50 | } 51 | 52 | .row-height-panel div { 53 | height: 8px; 54 | position: absolute; 55 | cursor: row-resize; 56 | z-index: 999; 57 | } 58 | 59 | .drug-ele-td { 60 | background-color: #f0f0f0 !important; 61 | cursor: pointer 62 | } 63 | 64 | .rightmouse-panel-div { 65 | background-color: #fff; 66 | border: 1px solid #bbd8e5; 67 | border-radius: 4px; 68 | z-index: 9; 69 | -moz-user-select: none; /*火狐*/ 70 | -webkit-user-select: none; /*webkit浏览器*/ 71 | -ms-user-select: none; /*IE10*/ 72 | -khtml-user-select: none; /*早期浏览器*/ 73 | user-select: none; 74 | position: fixed; 75 | } 76 | 77 | .rightmouse-panel-div .wb { 78 | line-height: 24px; 79 | letter-spacing: 1px; 80 | font-size: 13px; 81 | padding-left: 7px; 82 | cursor: pointer; 83 | } 84 | 85 | .rightmouse-panel-div .wb:hover { 86 | background-color: #f0f8ff 87 | } 88 | 89 | .panel-div-left, .panel-div-right { 90 | float: left 91 | } 92 | 93 | .panel-div-left { 94 | border-right: 1px solid #bbd8e5 95 | } 96 | 97 | .excel-rightmomuse-icon-css { 98 | display: inline-block; 99 | width: 20px 100 | } 101 | 102 | .excel-rightmomuse-icon-next-css { 103 | margin-left: 33px; 104 | font-size: 18px; 105 | color: #795548 106 | } 107 | 108 | .setting .setting-text { 109 | color: #e91e63 110 | } 111 | 112 | .setting .setting-input { 113 | margin-left: 4px 114 | } 115 | 116 | .setting .setting-item { 117 | margin-right: 7px 118 | } 119 | 120 | .setting input { 121 | width: 35px 122 | } 123 | 124 | .chosen-area-p { 125 | background-color: #5292F7 126 | } 127 | 128 | .chosen-area-p-drug { 129 | cursor: crosshair 130 | } 131 | 132 | table { 133 | border-collapse: collapse; 134 | border-spacing: 0; 135 | margin: 0; 136 | border-width: 0; 137 | table-layout: fixed; 138 | width: 0; 139 | outline-width: 0; 140 | cursor: default; 141 | max-width: none; 142 | max-height: none; 143 | -webkit-user-select: none; 144 | -moz-user-select: none; 145 | -ms-user-select: none; 146 | user-select: none; 147 | } 148 | 149 | .buttonBgColor { 150 | background-color: #ddd !important; 151 | } 152 | 153 | .hr { 154 | width: 100%; 155 | height: 1px; 156 | border-bottom: 1px solid #ccc; 157 | } 158 | 159 | .selectTd { 160 | background-color: #fff; 161 | /*border: 1px solid #5292F7!important;*/ 162 | } 163 | 164 | .whiteSpaceTrue { 165 | white-space: normal !important; 166 | } 167 | 168 | .selectBorderStyle { 169 | position: absolute; 170 | top: 30px; 171 | background-color: #fff; 172 | display: none; 173 | z-index: 999; 174 | width: 100px; 175 | border: 1px solid #ccc; 176 | left: -40px; 177 | -webkit-user-select:none; 178 | -moz-user-select:none; 179 | -ms-user-select:none; 180 | user-select:none; 181 | border-radius: 3px; 182 | border-bottom: 0px; 183 | } 184 | 185 | .show { 186 | display: block; 187 | } 188 | .borderStyleOption{ 189 | padding: 5px 20px; 190 | border-bottom: 1px solid #ccc; 191 | cursor: pointer; 192 | } 193 | 194 | .thead :nth-child(1) { 195 | background-color:#fff !important; 196 | } 197 | .tableLeftTop{ 198 | position: fixed; 199 | top: 128px; 200 | width: 62px; 201 | height: 25px; 202 | z-index: 999; 203 | background: #fff; 204 | text-align: center; 205 | line-height: 25px; 206 | border-bottom: 1px solid #ccc; 207 | border-right: 1px solid #ccc; 208 | border-top: 1px solid #ccc; 209 | } 210 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | excel 6 | 7 | 8 | 9 | 10 | 11 | 12 | 28 | 29 | 30 | 31 |
32 |
33 |
34 |
35 | 43 | 58 |
59 |
60 | 63 | 66 | 69 | 72 | 75 | 76 | 79 | 80 |
81 |
82 |
字体
83 |
84 |
85 |
86 |
87 | 90 | 93 | 96 | 99 | 102 | 105 |
106 |
107 | 110 | 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 | 146 |
  • 147 |
148 |
149 | 150 |
151 |
单元格
152 | 153 |
154 |
155 |
156 |
157 |
158 | 159 |
160 |
161 | 162 |
163 |
164 |
165 |
编辑
166 |
167 |
168 | 169 |
170 | 171 |
172 |
173 |
174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /css/main.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | padding: 0px; 4 | margin: 0px; 5 | overflow: hidden; 6 | font-size: 12px; 7 | } 8 | 9 | .toolbars { 10 | height: 95px; 11 | border-top: 1px solid #ddd; 12 | border-bottom: 1px solid #ddd; 13 | padding: 5px 0px 5px 0px; 14 | } 15 | 16 | .toolbars .group { 17 | width: 100px; 18 | min-width: 100px; 19 | border-left: 1px solid #ddd; 20 | float: left; 21 | } 22 | 23 | .top-foot { 24 | height: 40px; 25 | padding-top: 8px; 26 | } 27 | 28 | .top-header>div { 29 | display: inline-block; 30 | float: left; 31 | } 32 | 33 | .top-header .logo { 34 | background-image: url(../img/logoNew.png); 35 | height: 36px; 36 | width: 36px; 37 | background-size: 80%; 38 | background-position: center; 39 | background-repeat: no-repeat; 40 | } 41 | 42 | .top-header .title { 43 | height: 36px; 44 | line-height: 36px; 45 | padding-left: 10px; 46 | } 47 | 48 | .showtable { 49 | height: 100%; 50 | width: 100%; 51 | } 52 | 53 | .toolbars .group.group_hidden .body, 54 | .toolbars .group.group_hidden .foot{ 55 | display: none; 56 | } 57 | .toolbars .group.group_hidden{ 58 | min-width:15px; 59 | width:15px; 60 | } 61 | .toolbars .group.group_hidden .bar_shrink{ 62 | background-image: url(../img/toolbar/open1-1.png); 63 | top: 70px; 64 | left: 2px; 65 | } 66 | .toolbars .group.group_hidden .bar_shrink:hover{ 67 | background-image: url(../img/toolbar/open1-2.png); 68 | } 69 | .bar_shrink{ 70 | background-image: url(../img/toolbar/close-1.png); 71 | width: 12px; 72 | height: 12px; 73 | position: relative; 74 | top: -20px; 75 | /* left: 110px; */ 76 | } 77 | .bar_shrink:hover{ 78 | background-image: url(../img/toolbar/close-2.png); 79 | } 80 | .group .body { 81 | width: 100%; 82 | text-align: center; 83 | height: 70px; 84 | } 85 | 86 | .group .body .sub { 87 | height: 34px; 88 | } 89 | 90 | .group .body .sub.sub-left { 91 | display: inline-block; 92 | float: left; 93 | height: 60px; 94 | width: 65px; 95 | } 96 | 97 | .group .body .sub.sub-right { 98 | display: inline-block; 99 | float: right; 100 | height: 60px; 101 | width: 65px; 102 | } 103 | 104 | .group .body .sub.sub-top { 105 | width: 100%; 106 | display: flex; 107 | flex-direction: row; 108 | flex-wrap: nowrap; 109 | justify-content: space-around; 110 | } 111 | 112 | .group .body .sub.sub-bottom { 113 | width: 97%; 114 | height: 26px; 115 | display: flex; 116 | flex-direction: row; 117 | flex-wrap: nowrap; 118 | justify-content: space-around; 119 | } 120 | 121 | .group .foot { 122 | height: 20px; 123 | position: relative; 124 | text-align: center; 125 | } 126 | 127 | .group .foot:after { 128 | /* content: " "; */ 129 | position: absolute; 130 | right: 0; 131 | bottom: 0; 132 | width: 7px; 133 | height: 7px; 134 | display: block; 135 | background: url(../img/toolbar.png) no-repeat -45px -64px; 136 | cursor: pointer; 137 | } 138 | 139 | .group.font { 140 | width: 230px; 141 | } 142 | 143 | .group.alignment { 144 | width: 204px; 145 | } 146 | 147 | .group.alignment .body .sub.sub-left { 148 | width: 80px; 149 | margin-left: 10px; 150 | border-right: 1px solid #ddd; 151 | padding-right: 6px; 152 | } 153 | 154 | .group.alignment .body .sub.sub-right { 155 | width: 90px; 156 | margin-right: 10px; 157 | } 158 | 159 | .group.cells .body .sub.sub-left { 160 | width: 85px; 161 | margin-left: 10px; 162 | padding-right: 6px; 163 | } 164 | 165 | .group.cells .body .sub.sub-right { 166 | width: 100px; 167 | } 168 | 169 | .group.edit .body .sub.sub-left { 170 | width: 45px; 171 | margin-left: 10px; 172 | padding-right: 6px; 173 | } 174 | 175 | .group.edit .body .sub.sub-right { 176 | width: 75px; 177 | padding-right: 10px; 178 | } 179 | 180 | .toolbars .group .tag-btn { 181 | width: 65px; 182 | border: none; 183 | outline: none; 184 | background-color: transparent; 185 | padding: 0px; 186 | height: 28px; 187 | text-align: left; 188 | display: inline-block; 189 | } 190 | 191 | .toolbars .group .tag-btn:hover { 192 | background-color: #ddd; 193 | } 194 | 195 | .toolbars .group .tag-btn.on { 196 | background-color: #ddd; 197 | } 198 | 199 | .group .tag-btn>span { 200 | display: inline-block; 201 | font-size: 12px; 202 | float: left; 203 | /* height: 28px; */ 204 | /* line-height: 28px; */ 205 | margin-left: 4px; 206 | } 207 | 208 | .group .input-group { 209 | width: 100%; 210 | height: 26px; 211 | line-height: 26px; 212 | margin-bottom: 4px; 213 | } 214 | 215 | .group .input-group label { 216 | width: 35%; 217 | float: left; 218 | } 219 | 220 | .group .input-group input { 221 | width: 77%; 222 | float: left; 223 | border-radius: 2px; 224 | border: 1px solid #ddd; 225 | height: 24px; 226 | padding: 0px; 227 | outline: none; 228 | } 229 | 230 | .group.font .tag-btn { 231 | width: 25px; 232 | height: 24px; 233 | text-align: center; 234 | } 235 | 236 | .group.alignment .tag-btn { 237 | width: 24px; 238 | height: 24px; 239 | text-align: center; 240 | } 241 | 242 | .group.alignment .tag-btn.merge-btn { 243 | width: 85px; 244 | height: 24px; 245 | } 246 | 247 | .group.alignment .tag-btn.split-btn { 248 | width: 85px; 249 | height: 24px; 250 | } 251 | 252 | .group.cells .tag-btn.wrap-btn { 253 | width: 85px; 254 | } 255 | 256 | 257 | .toolbars .group .tag { 258 | background-image: url(../img/toolbar.png); 259 | display: inline-block; 260 | text-indent: -99999px; 261 | overflow: hidden; 262 | background-repeat: no-repeat; 263 | width: 18px; 264 | height: 18px; 265 | margin-top: 0px; 266 | margin-left: 9px; 267 | margin-right: 0px; 268 | float: left; 269 | } 270 | 271 | .group.font .tag { 272 | margin-left: 3px; 273 | } 274 | 275 | .group.alignment .tag { 276 | margin-left: 3px; 277 | } 278 | 279 | .toolbars select { 280 | border: 1px solid #ddd; 281 | height: 24px; 282 | outline: none; 283 | } 284 | 285 | .toolbars .fontfamily { 286 | width: 130px; 287 | height: 26px; 288 | margin-left: 10px; 289 | } 290 | 291 | .toolbars .fontsize { 292 | width: 70px; 293 | height: 26px; 294 | margin-right: 10px; 295 | } 296 | 297 | .toolbars .tag.bold { 298 | background-position: -40px -39px; 299 | margin-left: 5px; 300 | } 301 | 302 | .toolbars .tag.italic { 303 | background-position: -58px -39px; 304 | margin-left: 4px; 305 | } 306 | 307 | .toolbars .tag.underline { 308 | background-position: -78px -39px; 309 | margin-left: 5px; 310 | } 311 | 312 | .toolbars .tag.strike { 313 | background-position: -96px -39px; 314 | } 315 | 316 | .toolbars .tag.bgColor { 317 | background-position: -115px -38px; 318 | height: 18px; 319 | width: 18px; 320 | } 321 | 322 | .toolbars .tag.fontColor { 323 | background-position: -133px -38px; 324 | height: 18px; 325 | width: 18px; 326 | } 327 | 328 | .toolbars .tag.topAlign { 329 | background-position: -153px -38px; 330 | width: 19px; 331 | } 332 | 333 | .toolbars .tag.velAlign { 334 | background-position: -172px -38px; 335 | width: 19px; 336 | } 337 | 338 | .toolbars .tag.bottomAlign { 339 | background-position: -190px -38px; 340 | width: 20px; 341 | } 342 | 343 | .toolbars .tag.leftAlign { 344 | background-position: -210px -38px; 345 | width: 19px; 346 | } 347 | 348 | .toolbars .tag.levelAlign { 349 | background-position: -229px -38px; 350 | width: 19px; 351 | } 352 | 353 | .toolbars .tag.rightAlign { 354 | background-position: -246px -38px; 355 | width: 19px; 356 | } 357 | 358 | .toolbars .tag.merge { 359 | background-position: -266px -38px; 360 | width: 19px; 361 | height: 19px; 362 | margin-left: 0px; 363 | } 364 | 365 | .toolbars .tag.split { 366 | background-position: -285px -38px; 367 | width: 19px; 368 | height: 19px; 369 | margin-left: 0px; 370 | } 371 | 372 | .toolbars .tag.wrap { 373 | background-position: -267px -77px; 374 | width: 19px; 375 | height: 19px; 376 | } 377 | .border-btn { 378 | display: inline-block; 379 | width: 100px; 380 | padding: 0; 381 | margin: 0; 382 | position: relative; 383 | } 384 | 385 | .border-btn li { 386 | list-style: none; 387 | float: left; 388 | width: 24px; 389 | height: 24px; 390 | text-align: center; 391 | } 392 | 393 | .toolbars .group .border-btn .tag { 394 | width: 18px; 395 | height: 18px; 396 | margin-left: 3px; 397 | margin-top: 3px; 398 | } 399 | 400 | .border-btn li .btn-borderLeft { 401 | background-position: -38px -76px 402 | } 403 | 404 | .border-btn li .btn-borderRight { 405 | background-position: -57px -76px 406 | } 407 | 408 | .border-btn li .btn-borderTop { 409 | background-position: -19px -76px 410 | } 411 | 412 | .border-btn li .btn-borderBottom { 413 | background-position: -0px -76px 414 | } 415 | 416 | .border-btn li .btn-borderOut { 417 | background-position: -76px -76px 418 | } 419 | 420 | .border-btn li .btn-borderIn { 421 | background-position: -95px -76px 422 | } 423 | 424 | .border-btn li .btn-borderAll { 425 | background-position: -133px -76px 426 | } 427 | 428 | .border-btn li .btn-borderNode { 429 | background-position: -114px -76px 430 | } 431 | 432 | .border-btn li:hover { 433 | background: #ddd; 434 | } 435 | 436 | 437 | .input-group { 438 | text-align: left; 439 | padding-left: 0px; 440 | padding-bottom: 6px; 441 | display: flex; 442 | } 443 | 444 | .toolbars .tag.borderColor{ 445 | background-position: 0px -114px; 446 | } 447 | .toolbars .tag.borderStyleIcon{ 448 | background-position: -18px -114px; 449 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /css/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot');src:url('../fonts/fontawesome-webfont.eot') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2') format('woff2'),url('../fonts/fontawesome-webfont.woff') format('woff'),url('../fonts/fontawesome-webfont.ttf') format('truetype'),url('../fonts/fontawesome-webfont.svg') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} 5 | -------------------------------------------------------------------------------- /js/excel.js: -------------------------------------------------------------------------------- 1 | (function ($) { 2 | //单击选中的单元格 3 | let selectTd; 4 | //当前复制的单元格样式 5 | let selectTdStyle = {}; 6 | $.fn.extend({ 7 | Excel: function (options) { 8 | var op = $.extend({}, options); 9 | initFun(); 10 | return this.each(function () { 11 | var t = $(this); 12 | t.addClass("excel-table"); 13 | if (op.data) { 14 | initTable(t, {data: op.data, type: 0}) 15 | } else if (op.setting) { 16 | op.setting.width = 0; 17 | op.setting.type = 1; 18 | initTable(t, op.setting) 19 | } else { 20 | initTable(t, {row: 11, col: 15, width: 0, type: 1}) 21 | } 22 | }) 23 | }, getExcelHtml: function () { 24 | var table = $(this).find("table").first(); 25 | if (table.length == 1) { 26 | var clone = table.clone(false); 27 | clone.find("tr:eq(0)").remove(); 28 | clone.find("tr").find("td:eq(0)").remove(); 29 | clone.find("td").removeClass("td-position-css").removeClass("td-chosen-css").removeClass("td-chosen-muli-css"); 30 | clone.find("td[class='']").removeAttr("class"); 31 | return clone.prop("outerHTML") 32 | } else { 33 | return "" 34 | } 35 | }, setExcelHtml: function (html) { 36 | initFun(); 37 | $(this).Excel({data: html}) 38 | } 39 | }); 40 | 41 | //初始化事件绑定 42 | function initFun() { 43 | $('body').on('input', '#selectTdValue', valueChange); 44 | $('body').on('change', '#fontfamily', setFontFamily); 45 | $('body').on('change', '#fontsize', setFontSize); 46 | $('body').on('click', '.btn-bold', setFontBold); 47 | $('body').on('click', '.btn-italic', setFontItalic); 48 | $('body').on('click', '.btn-underline', setUnderline); 49 | $('body').on('click', '.btn-strike', setFontStrike); 50 | $('body').on('click', '#bgColor', clickBgColor); 51 | $('body').on('click', '#fontColor', clickFontColor); 52 | $('body').on('change', '#bgColorSelect', setBgColor); 53 | $('body').on('change', '#fontColorSelect', setFontColor); 54 | $('body').on('click', '.btn-htTop', 'top', setValign); 55 | $('body').on('click', '.btn-htMiddle', 'middle', setValign); 56 | $('body').on('click', '.btn-htBottom', 'bottom', setValign); 57 | $('body').on('click', '.btn-htLeft', 'left', setAlign); 58 | $('body').on('click', '.btn-htCenter', 'center', setAlign); 59 | $('body').on('click', '.btn-htRight', 'right', setAlign); 60 | $('body').on('click', '.merge-btn', mergeBtn); 61 | $('body').on('click', '.split-btn', splitBtn); 62 | $('body').on('click', '.whiteSpace', whiteSpace); 63 | $('body').on('click', '.borderLeft', setBorderLeft); 64 | $('body').on('click', '.borderRight', setBorderRight); 65 | $('body').on('click', '.borderTop', setBorderTop); 66 | $('body').on('click', '.borderBottom', setBorderBottom); 67 | $('body').on('click', '.borderColor', clickBorderColor); 68 | $('body').on('click', '.borderStyle', showBorderStyleDiv); 69 | // $('body').on('change', '#borderColor', setBorderColor); 70 | $('body').on('change', '.cell-width', setCellWidth); 71 | $('body').on('change', '.cell-height', setCellHeight); 72 | $('body').on('click', '.borderAll', setBorderAll); 73 | $('body').on('click', '.borderSolid', 'solid', setBorderStyleOption); 74 | $('body').on('click', '.borderDashed', 'dashed', setBorderStyleOption); 75 | $('body').on('click', '.borderDouble', 'double', setBorderStyleOption); 76 | $('body').on('click', '.borderNone', 'none', setBorderStyleOption); 77 | tableScroll(); 78 | } 79 | 80 | function tableScroll() { 81 | var tableCont = document.querySelector('.excel'); 82 | 83 | function scrollHandle(e) { 84 | var scrollLeft = this.scrollLeft; 85 | var scrollTop = this.scrollTop; 86 | var d = $(this).data('slt'); 87 | if (scrollLeft != (d == undefined ? 0 : d.sl)) { 88 | $('.drug-ele-td-vertical').css('transform', 'translateX(' + scrollLeft + 'px)'); 89 | $('.row-height-panel-item').css('transform', 'translateX(' + scrollLeft + 'px)'); 90 | } 91 | if (scrollTop != (d == undefined ? 0 : d.st)) { 92 | $('.drug-ele-td-horizontal').css('transform', 'translateY(' + scrollTop + 'px)'); 93 | $('.col-width-panel-item').css('transform', 'translateY(' + scrollTop + 'px)'); 94 | } 95 | $(this).data('slt', {sl: scrollLeft, st: scrollTop}); 96 | } 97 | 98 | tableCont.addEventListener('scroll', scrollHandle) 99 | } 100 | 101 | //初始化table 102 | function initTable(t, setting) { 103 | t.empty(); 104 | var table; 105 | //回显用的 106 | if (setting.type == 0) { 107 | t.html(setting.data); 108 | table = t.find("table").first(); 109 | var fir = table.find("tr:eq(0)"); 110 | var clone = fir.clone(false).height(25).insertBefore(fir); 111 | clone.find("td").css("display", "").removeAttr("rowspan").removeAttr("colspan").html("").removeClass("td-chosen-css"); 112 | $("").insertBefore(table.find("tr").find("td:eq(0)")) 113 | } 114 | //生成table 115 | else if (setting.type == 1) { 116 | table = $("
").appendTo(t); 117 | for (var i = 0; i < setting.row; i++) { 118 | var tr = $("").height(25).appendTo(table); 119 | for (var j = 0; j < setting.col; j++) { 120 | $("").appendTo(tr) 121 | } 122 | } 123 | if (setting.width && setting.width > 0) { 124 | $('td').css('width', setting.width); 125 | } 126 | } 127 | drawDrugArea(table); 128 | eventBind(table, t); 129 | drugCell(table, t); 130 | //设置鼠标右键菜单的 131 | t.unbind("contextmenu"); 132 | t.on('contextmenu', function () { 133 | return false 134 | }) 135 | } 136 | 137 | function selectTable(table, t, e) { 138 | if (e.button == 2 && !$(e.target).hasClass("drug-ele-td")) { 139 | if (table.find(".td-chosen-css").length == 0) { 140 | $(e.target).addClass("td-chosen-css") 141 | } 142 | showRightPanel(table, t, e) 143 | } else { 144 | closeRightPanel(t); 145 | var ele = $(e.target); 146 | if (!ele.hasClass("drug-ele-td")) { 147 | clearPositionCss(table); 148 | if (!ele.is("table") && table.data("beg-td-ele") && table.data("beg-td-ele").is(ele)) { 149 | ele.addClass("td-chosen-css"); 150 | var posi = getTdPosition(ele); 151 | table.find("tr").find("td:eq(" + posi.col + ")").addClass("td-position-css"); 152 | table.find("tr:eq(" + posi.row + ")").find("td").addClass("td-position-css") 153 | } else { 154 | getChosenList(table, getTdPosition(table.data("beg-td-ele")), getTdPosition(ele)) 155 | } 156 | drawChosenArea(table, t) 157 | } 158 | } 159 | } 160 | 161 | function mouseMove(table, t) { 162 | table.mouseover(function (e) { 163 | table.find("td").removeClass("td-chosen-muli-css"); 164 | table.find("td").removeClass("td-chosen-css"); 165 | selectTable(table, t, e) 166 | }); 167 | } 168 | 169 | //赋值文本框 改变之后赋值到td内 170 | function setSelectTdValue(ele) { 171 | let val = $(ele).html(); 172 | let $input = $('#selectTdValue'); 173 | $input.val(val); 174 | setTimeout(function () { 175 | $input.select(); 176 | }, 10); 177 | } 178 | 179 | //赋值文本框 change事件 180 | function valueChange() { 181 | let val = $('#selectTdValue').val(); 182 | if (selectTd) { 183 | selectTd.html(val) 184 | } 185 | } 186 | 187 | //设置点击td时 赋值文本框的事件 188 | function settingInput(e) { 189 | setTimeout(function () { 190 | $('#selectTdValue').focus(); 191 | }, 100); 192 | let pos = getTdPosition($(e)); 193 | $('#coordinate').html('' + getChar(pos.col - 1) + pos.row + "") 194 | setSelectTdValue(e); 195 | } 196 | 197 | //判断元素是否有某属性 198 | function hasAttr(e, attr) { 199 | let Attr = e.attr(attr); 200 | if (typeof Attr !== typeof undefined && Attr !== false) { 201 | return true; 202 | } else { 203 | return false; 204 | } 205 | } 206 | 207 | //选择一行或一列时,设置选择框样式 208 | function selectWhole(table, addWidth, addHeight) { 209 | var coll = table.find(".td-chosen-css"); 210 | var first = coll.first(); 211 | var posi = getTdPosition(first); 212 | var width = 0, height = 0; 213 | coll.each(function () { 214 | var p = getTdPosition($(this)); 215 | if (p.row == posi.row) { 216 | width += this.offsetWidth 217 | } 218 | if (p.col == posi.col) { 219 | height += this.offsetHeight 220 | } 221 | }); 222 | if (addWidth === 0) { 223 | addWidth = width; 224 | } 225 | if (addHeight === 0) { 226 | addHeight = height; 227 | } 228 | setSelectBorder(table, addWidth, addHeight, first[0].offsetTop, first[0].offsetLeft); 229 | } 230 | 231 | //点击td 设置样式栏中各项的值 232 | function triggerStyle(e, table) { 233 | $('.sub-bottom').children().removeClass('buttonBgColor'); 234 | let ele = $(e); 235 | let fontFamily = ele.css('font-family'); 236 | $('#fontfamily').val(fontFamily); 237 | 238 | let fontSize = ele.css('font-size'); 239 | $('#fontsize').val(fontSize); 240 | 241 | let fontWeight = ele.css('font-weight'); 242 | if (fontWeight !== '400') { 243 | $('.btn-bold').addClass('buttonBgColor'); 244 | } 245 | 246 | let fontItalic = ele.css('font-style'); 247 | if (fontItalic !== 'normal') { 248 | $('.btn-italic').addClass('buttonBgColor'); 249 | } 250 | 251 | let underline = ele.css('text-decoration-line'); 252 | if (underline === 'underline') { 253 | $('.btn-underline').addClass('buttonBgColor'); 254 | } 255 | 256 | let fontStrike = ele.css('text-decoration-line'); 257 | if (fontStrike === 'line-through') { 258 | $('.btn-strike').addClass('buttonBgColor'); 259 | } 260 | 261 | let valign = ele.css('vertical-align'); 262 | $('.btn-av').removeClass('buttonBgColor'); 263 | if (valign === 'top') { 264 | $('.btn-htTop').addClass('buttonBgColor'); 265 | } else if (valign === 'middle') { 266 | $('.btn-htMiddle').addClass('buttonBgColor'); 267 | } else if (valign === 'bottom') { 268 | $('.btn-htBottom').addClass('buttonBgColor'); 269 | } 270 | 271 | let textAlign = ele.css('text-align'); 272 | $('.btn-ah').removeClass('buttonBgColor'); 273 | if (textAlign === 'left') { 274 | $('.btn-htLeft').addClass('buttonBgColor'); 275 | } else if (textAlign === 'center') { 276 | $('.btn-htCenter').addClass('buttonBgColor'); 277 | } else if (textAlign === 'right') { 278 | $('.btn-htRight').addClass('buttonBgColor'); 279 | } 280 | 281 | let whiteSpace = ele.css('whiteSpace'); 282 | if (whiteSpace !== 'nowrap') { 283 | $('.whiteSpace').addClass('buttonBgColor'); 284 | } else { 285 | $('.whiteSpace').removeClass('buttonBgColor'); 286 | } 287 | } 288 | 289 | function selectMoreCell(e, table, t) { 290 | let addWidth = 0; 291 | let addHeight = 0; 292 | table.find("td").removeClass("td-chosen-css").removeClass('td-chosen-muli-css'); 293 | if ($(e.target).index() === 0 && $(e.target).html() === '') { 294 | return 295 | } 296 | if ($(e.target).hasClass('drug-ele-td-vertical')) { 297 | selectTd = $(e.target).next(); 298 | $(e.target).nextAll().each(function (index, ele) { 299 | if ((!hasAttr($(this), 'colspan')) || index == 0) { 300 | $(this).addClass('td-chosen-css').addClass('td-chosen-muli-css'); 301 | } 302 | }) 303 | $(e.target).next().addClass('selectTd'); 304 | addWidth = $(table)[0].offsetWidth - 63; 305 | } else { 306 | let index = $(e.target).index(); 307 | table.find("tr").each(function (i, ele) { 308 | $td = $(this).children().eq(index); 309 | if ((!hasAttr($td, 'rowspan')) || i === 1) { 310 | $td.addClass('td-chosen-css').addClass('td-chosen-muli-css'); 311 | } 312 | if (i === 1) { 313 | $td.addClass('selectTd'); 314 | selectTd = $td; 315 | } 316 | }); 317 | 318 | $(e.target).removeClass("td-chosen-css").removeClass('td-chosen-muli-css'); 319 | addHeight = $(table)[0].offsetHeight - 25; 320 | } 321 | let pos = getTdPosition(selectTd); 322 | $('#coordinate').html('' + getChar(pos.col - 1) + pos.row + "") 323 | selectWhole(table, addWidth, addHeight); 324 | } 325 | 326 | function tdMousedown(e, table) { 327 | selectTd = $(e); 328 | table.find("td").removeClass("td-chosen-css"); 329 | table.removeData("beg-td-ele"); 330 | table.data("beg-td-ele", $(e)); 331 | $(e).addClass('selectTd'); 332 | } 333 | 334 | function clickTd(e, table, t) { 335 | table.find("td").removeClass('selectTd'); 336 | tdMousedown(e, table); 337 | closeRightPanel(t); 338 | clearPositionCss(table); 339 | e.addClass("td-chosen-css"); 340 | var posi = getTdPosition(e); 341 | table.find("tr").find("td:eq(" + posi.col + ")").addClass("td-position-css"); 342 | table.find("tr:eq(" + posi.row + ")").find("td").addClass("td-position-css") 343 | drawChosenArea(table, t); 344 | settingInput(e); 345 | triggerStyle(e, table); 346 | } 347 | 348 | function selectTdScroll() { 349 | let $node = $('.chosen-area-p-drug'); 350 | let windowH = $('.excel').height(), 351 | windowW = $('.excel').width(), 352 | $nodeOffsetH = parseInt($node.css('margin-top')), 353 | $nodeOffsetW = parseInt($node.css('margin-left')), 354 | $nodeInitLeft = selectTd.innerWidth() + selectTd.prevAll().last().innerWidth(), 355 | $nodeInitTop = selectTd.innerHeight() + selectTd.parent().prevAll().last().innerHeight() - 2; 356 | //备注 19为滚动条宽度 357 | if (($nodeOffsetW + 19 >= windowW) && ($nodeOffsetW - $('.excel').scrollLeft() + 19 >= windowW)) { 358 | $('.excel').scrollLeft(selectTd.width() + $('.excel').scrollLeft() + 4); 359 | } else if ($nodeInitLeft + $('.excel').scrollLeft() > $nodeOffsetW) { 360 | $('.excel').scrollLeft($('.excel').scrollLeft() - selectTd.width() - 4); 361 | } else if (($nodeOffsetH + 19 >= windowH) && ($nodeOffsetH - $('.excel').scrollTop() + 19 >= windowH)) { 362 | $('.excel').scrollTop(selectTd.height() + $('.excel').scrollTop() + 4); 363 | } else if ($nodeInitTop + $('.excel').scrollTop() > $nodeOffsetH) { 364 | $('.excel').scrollTop($('.excel').scrollTop() - selectTd.height() - 4); 365 | } 366 | } 367 | 368 | function tableKeyDown(e, table, t) { 369 | if (selectTd == undefined || $('.rightmouse-panel-div').length != 0) { 370 | return; 371 | } 372 | let eCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode; 373 | if (e.ctrlKey && eCode === 90) { 374 | chexiaoFunc(t) 375 | } else if (eCode === 13 || eCode === 39) { 376 | let $nextTd = selectTd.nextAll(':visible').first(); 377 | if ($nextTd.length > 0) { 378 | clickTd($nextTd, table, t); 379 | } 380 | } else if (eCode === 37) { 381 | let $prevTd = selectTd.prevAll(':visible').first(); 382 | if ($prevTd.prev().length > 0) { 383 | clickTd($prevTd, table, t); 384 | } 385 | } else if (eCode === 40) { 386 | let index = selectTd.index(); 387 | let $nextTd = {}; 388 | selectTd.parent().nextAll().each(function () { 389 | $nextTd = $(this).children().eq(index); 390 | if (!$nextTd.is(":hidden")) { 391 | return false; 392 | } 393 | }); 394 | if ($nextTd.length > 0) { 395 | clickTd($nextTd, table, t); 396 | } 397 | } else if (eCode === 38) { 398 | let index = selectTd.index(); 399 | let $prevTd = {}; 400 | selectTd.parent().prevAll().each(function () { 401 | $prevTd = $(this).children().eq(index); 402 | if (!$prevTd.is(":hidden")) { 403 | return false; 404 | } 405 | }); 406 | 407 | let $prevTdPrev = $prevTd.parent().prev(); 408 | if ($prevTdPrev.length > 0) { 409 | clickTd($prevTd, table, t); 410 | } 411 | } 412 | selectTdScroll(); 413 | } 414 | 415 | //为table绑定事件 416 | function eventBind(table, t) { 417 | table.mousedown(function (e) { 418 | if (e.button == 0) { 419 | table.find("td").removeClass('selectTd'); 420 | if (!$(e.target).hasClass("drug-ele-td")) { 421 | tdMousedown(e.target, table); 422 | settingInput(e.target); 423 | triggerStyle(e.target, table); 424 | } else { 425 | selectMoreCell(e, table, t) 426 | } 427 | mouseMove(table, t); 428 | } 429 | }).mouseup(function (e) { 430 | table.unbind('mouseover'); 431 | selectTable(table, t, e); 432 | }); 433 | $(document).unbind("keydown"); 434 | $(document).keydown(function (e) { 435 | tableKeyDown(e, table, t); 436 | }); 437 | } 438 | 439 | function getChosenList(table, begPosi, endPosi) { 440 | if (begPosi != undefined && endPosi != undefined) { 441 | for (var i = (begPosi.row > endPosi.row ? endPosi.row : begPosi.row); i <= (begPosi.row > endPosi.row ? begPosi.row : endPosi.row); i++) { 442 | var tr = table.find("tr:eq(" + i + ")"); 443 | for (var j = (begPosi.col > endPosi.col ? endPosi.col : begPosi.col); j <= (begPosi.col > endPosi.col ? begPosi.col : endPosi.col); j++) { 444 | var td = tr.find("td:eq(" + j + ")"); 445 | td.addClass("td-chosen-css"); 446 | } 447 | } 448 | var coll = table.find(".td-chosen-css"); 449 | var firstPosi = getTdPosition($(coll.get(0))); 450 | var beg_row = firstPosi.row; 451 | var beg_col = firstPosi.col; 452 | table.find("td").removeData("add-chosen-state").removeData("get-father-state"); 453 | while (true) { 454 | var end_row = 0; 455 | var end_col = 0; 456 | var con = false; 457 | coll.each(function () { 458 | var p = getTdPosition($(this)); 459 | var r = p.row + ($(this).attr("rowspan") == undefined ? 0 : (Number($(this).attr("rowspan")) - 1)); 460 | var c = p.col + ($(this).attr("colspan") == undefined ? 0 : (Number($(this).attr("colspan")) - 1)); 461 | end_row = end_row < r ? r : end_row; 462 | end_col = end_col < c ? c : end_col; 463 | beg_row = beg_row > p.row ? p.row : beg_row; 464 | beg_col = beg_col > p.col ? p.col : beg_col 465 | }); 466 | for (var i = beg_row; i <= end_row; i++) { 467 | var tr = table.find("tr:eq(" + i + ")"); 468 | for (var j = beg_col; j <= end_col; j++) { 469 | var dt = tr.find("td:eq(" + j + ")"); 470 | if (dt.is(":hidden") && dt.data("get-father-state") == undefined) { 471 | var p = getFatherCell(dt); 472 | dt.data("get-father-state", 0); 473 | if (p != null && p.length == 1) { 474 | p.data("add-chosen-state", 0); 475 | if (p != null && coll.index(p) == -1) { 476 | p.addClass("td-chosen-css"); 477 | coll = table.find(".td-chosen-css"); 478 | con = true 479 | } 480 | } 481 | } else { 482 | if (!dt.hasClass("td-chosen-css")) { 483 | dt.addClass("td-chosen-css"); 484 | coll = table.find(".td-chosen-css"); 485 | con = true 486 | } 487 | } 488 | } 489 | } 490 | if (!con) { 491 | break 492 | } 493 | } 494 | return coll 495 | } 496 | } 497 | 498 | function getTdPosition(td) { 499 | if (td != undefined && td.length == 1) { 500 | var table = td.closest("table"); 501 | var pos = {}; 502 | var tr = td.closest("tr"); 503 | pos.row = table.find("tr").index(tr); 504 | pos.col = tr.find("td").index(td); 505 | return pos 506 | } 507 | } 508 | 509 | function mergeCell(table) { 510 | if (table.length == 1) { 511 | var coll = table.find(".td-chosen-css"); 512 | if (coll.length > 1) { 513 | var fir = $(coll.get(0)); 514 | var posi = getTdPosition(fir); 515 | var r = 0, c = 0; 516 | if (fir.attr("rowspan") != undefined && fir.attr("colspan") != undefined) { 517 | r = Number(fir.attr("rowspan")) - 1; 518 | c = Number(fir.attr("colspan")) - 1 519 | } 520 | coll.each(function () { 521 | var p = getTdPosition($(this)); 522 | r = (p.row - posi.row) > r ? p.row - posi.row : r; 523 | c = (p.col - posi.col) > c ? (p.col - posi.col) : c; 524 | if (!$(this).is(fir)) { 525 | $(this).removeClass("td-chosen-css").css("display", "none"); 526 | if ($(this).attr("rowspan") != undefined && $(this).attr("colspan") != undefined) { 527 | r = (p.row + (Number($(this).attr("rowspan")) - 1) - posi.row) > r ? (p.row + (Number($(this).attr("rowspan")) - 1) - posi.row) : r; 528 | c = (p.col + (Number($(this).attr("colspan")) - 1) - posi.col) > c ? (p.col + (Number($(this).attr("colspan")) - 1) - posi.col) : c 529 | } 530 | } 531 | }); 532 | $(coll.get(0)).attr("rowspan", r + 1).attr("colspan", c + 1).css("display", "") 533 | } else if (coll.length == 1) { 534 | var fir = $(coll.get(0)); 535 | if (fir.attr("rowspan") != undefined && fir.attr("colspan") != undefined) { 536 | var posi = getTdPosition(fir); 537 | for (var i = posi.row; i <= (posi.row + (Number($(fir).attr("rowspan")) - 1)); i++) { 538 | var tr = table.find("tr:eq(" + i + ")"); 539 | for (var j = posi.col; j <= (posi.col + (Number($(fir).attr("colspan")) - 1)); j++) { 540 | var td = tr.find("td:eq(" + j + ")").css("display", "").addClass("td-chosen-css"); 541 | if (!td.is(fir)) { 542 | td.removeAttr("rowspan").removeAttr("colspan") 543 | } 544 | } 545 | } 546 | fir.removeAttr("rowspan").removeAttr("colspan") 547 | } 548 | } 549 | } 550 | } 551 | 552 | function getFatherCell(noneTd) { 553 | var table = noneTd.closest("table"); 554 | var fatherCell = []; 555 | table.find("td[rowspan][colspan]").each(function () { 556 | var posi = getTdPosition($(this)); 557 | var cell = $(this); 558 | var con = false; 559 | for (var i = posi.row; i <= (posi.row + (Number($(this).attr("rowspan")) - 1)); i++) { 560 | var tr = table.find("tr:eq(" + i + ")"); 561 | for (var j = posi.col; j <= (posi.col + (Number($(this).attr("colspan")) - 1)); j++) { 562 | var dt = tr.find("td:eq(" + j + ")"); 563 | if (noneTd.is(dt)) { 564 | fatherCell[fatherCell.length] = cell; 565 | con = true; 566 | break 567 | } 568 | } 569 | if (con) { 570 | break 571 | } 572 | } 573 | }); 574 | if (fatherCell.length == 1) { 575 | return fatherCell[0] 576 | } else { 577 | return null 578 | } 579 | } 580 | 581 | function panelItemMouseleave(ele, table, t) { 582 | ele.mouseleave(function (e) { 583 | clearDurgEle(table, t) 584 | }); 585 | } 586 | 587 | function drugCell(table, t) { 588 | var colTransform = $('.col-width-panel-item').eq(1).css('transform'); 589 | t.find(".col-width-panel,.row-height-panel").remove(); 590 | t.find(".chosen-area-p").remove(); 591 | var colWidthPanel = $("
"); 592 | var rowHeightPanel = $("
"); 593 | var left = 0, top = 0; 594 | var firstTr = table.find("tr").first(); 595 | colWidthPanel.insertBefore(table); 596 | rowHeightPanel.insertBefore(table); 597 | table.find("tr").first().find("td").each(function () { 598 | left = this.offsetLeft; 599 | let colWidthPanelItem = $("
"); 600 | colWidthPanelItem.attr("draggable", true).mousedown(function (e) { 601 | e.preventDefault && e.preventDefault(); 602 | var ele = $(e.target); 603 | if (ele.data("left") == undefined) { 604 | recordData(t); 605 | ele.data("left", ele.css("left")); 606 | ele.data("e-left", e.clientX); 607 | t.data("drug-ele", ele); 608 | } 609 | }).mouseup(function () { 610 | clearDurgEle(table, t) 611 | }).css("transform",colTransform).css("left", left +this.offsetWidth - 4).css("height", firstTr[0].offsetHeight).appendTo(colWidthPanel) 612 | }); 613 | table.find("tr").each(function () { 614 | top = this.offsetTop; 615 | $(this).height($(this).height()); 616 | let rowHeightPanelItem = $("
"); 617 | rowHeightPanelItem.attr("draggable", true).mousedown(function (e) { 618 | e.preventDefault && e.preventDefault(); 619 | var ele = $(e.target); 620 | if (ele.data("top") == undefined) { 621 | recordData(t); 622 | ele.data("top", ele.css("top")); 623 | ele.data("e-top", e.clientY); 624 | t.data("drug-ele", ele); 625 | } 626 | }).mouseup(function () { 627 | clearDurgEle(table, t); 628 | }).css("top", top + this.offsetHeight - 4).css("width", firstTr.find("td")[0].offsetWidth).appendTo(rowHeightPanel) 629 | }); 630 | colWidthPanel.find(".col-width-panel-item:first,.col-width-panel-item:last").css("display", "none"); 631 | rowHeightPanel.find(".row-height-panel-item:first,.row-height-panel-item:last").css("display", "none"); 632 | t.unbind("mouseup").unbind("mousemove").unbind("mousedown").unbind("mouseleave"); 633 | t.mousedown(function (e) { 634 | var ele = t.data("drug-ele"); 635 | if (ele !== undefined) { 636 | if (ele.hasClass("col-width-panel-item")) { 637 | panelItemMouseleave(colWidthPanel, table, t); 638 | } 639 | if (ele.hasClass("row-height-panel-item")) { 640 | panelItemMouseleave(rowHeightPanel, table, t); 641 | } 642 | } 643 | }).mouseup(function (e) { 644 | clearDurgEle(table, t); 645 | }).mousemove(function (e) { 646 | if (t.data("drug-ele") != undefined) { 647 | closeRightPanel(t); 648 | var ele = t.data("drug-ele"); 649 | if (ele.hasClass("col-width-panel-item") && ele.data("left") != undefined) { 650 | var left = parseInt(ele.data("left")) + (e.clientX - ele.data("e-left")); 651 | var ind = colWidthPanel.find(".col-width-panel-item").index(ele); 652 | var upLeft = 0; 653 | if (ind > 0) { 654 | upLeft = parseInt(ele.prev(".col-width-panel-item").css("left")) + 4 655 | } 656 | var now = table.find("tr").find("td:eq(" + ind + ")"); 657 | now.width(left - upLeft); 658 | //将负责调整宽度的元素加宽,以免出现鼠标滑动过快而导致调整失败 659 | ele.css("left", left-250).css("width",500); 660 | } 661 | if (ele.hasClass("row-height-panel-item") && ele.data("top") != undefined) { 662 | var top = parseInt(ele.data("top")) + (e.clientY - ele.data("e-top")); 663 | var ind = rowHeightPanel.find(".row-height-panel-item").index(ele); 664 | var upTop = 0; 665 | if (ind > 0) { 666 | upTop = parseInt(ele.prev(".row-height-panel-item").css("top")) + 4 667 | } 668 | if (top - upTop > 5) { 669 | var now = table.find("tr:eq(" + ind + ")"); 670 | now.height(top - upTop); 671 | ele.css("top", top-250).css("height",500); 672 | } 673 | } 674 | } 675 | }) 676 | } 677 | 678 | function clearDurgEle(table, t) { 679 | if (t.data("drug-ele") != undefined) { 680 | t.data("drug-ele").removeData("left").removeData("e-left").removeData("top").removeData("e-top"); 681 | t.removeData("drug-ele"); 682 | drugCell(table, t) 683 | } 684 | } 685 | 686 | function addRowCol(table, type, t) { 687 | var chosenColl = table.find(".td-chosen-css"); 688 | if (chosenColl.length == 1) { 689 | var chosen = chosenColl.first(); 690 | var tr = chosen.closest("tr"); 691 | var col = table.find("tr").find("td:eq(" + (tr.find("td").index(chosen)) + ")"); 692 | if (type == 0) { 693 | addRowColSpan(tr, type).insertBefore(tr) 694 | } else if (type == 1) { 695 | addRowColSpan(tr, type).insertAfter(tr) 696 | } else if (type == 4) { 697 | addRowColSpan(tr, type); 698 | tr.remove() 699 | } else if (type == 2) { 700 | addRowColSpan(col, type) 701 | } else if (type == 3) { 702 | addRowColSpan(col, type) 703 | } else if (type == 5) { 704 | addRowColSpan(col, type); 705 | col.remove() 706 | } 707 | } 708 | table.find("td[rowspan=1][colspan=1]").removeAttr("rowspan").removeAttr("colspan"); 709 | t.find(".chosen-area-p").remove(); 710 | clearDurgEle(table, t); 711 | drawDrugArea(table) 712 | } 713 | 714 | function addRowColSpan(list, ty) { 715 | var coll = []; 716 | if (ty == 0 || ty == 1 || ty == 4) { 717 | var tr = list; 718 | tr.find("td").each(function () { 719 | if ($(this).is(":hidden")) { 720 | var p = getFatherCell($(this)); 721 | var con = true; 722 | for (var i = 0; i < coll.length; i++) { 723 | if (coll[i].is(p)) { 724 | con = false; 725 | break 726 | } 727 | } 728 | if (con && p != null) { 729 | coll[coll.length] = p; 730 | p.attr("rowspan", spanNum(p.attr("rowspan"), ty == 4 ? -1 : 1)) 731 | } 732 | } else { 733 | if ($(this).attr("rowspan") && $(this).attr("colspan")) { 734 | coll[coll.length] = $(this); 735 | if (ty == 4) { 736 | var nextTr = tr.next("tr"); 737 | if (nextTr.length == 1 && Number($(this).attr("rowspan")) > 1) { 738 | var ind = tr.find("td").index($(this)); 739 | nextTr.find("td:eq(" + ind + ")").attr("rowspan", spanNum($(this).attr("rowspan"), -1)).attr("colspan", $(this).attr("colspan")).css("display", "") 740 | } 741 | } else { 742 | $(this).attr("rowspan", Number($(this).attr("rowspan")) + 1) 743 | } 744 | } 745 | } 746 | }); 747 | var clone = tr.clone(true); 748 | if (ty == 0) { 749 | tr.find("td[rowspan][colspan]").each(function () { 750 | $(this).removeAttr("rowspan").removeAttr("colspan").css("display", "none") 751 | }) 752 | } 753 | if (ty == 1) { 754 | clone.find("td[rowspan][colspan]").each(function () { 755 | $(this).removeAttr("rowspan").removeAttr("colspan").css("display", "none") 756 | }) 757 | } 758 | clone.height(25); 759 | clone.find("td").removeClass("td-chosen-css").html(""); 760 | return clone 761 | } else { 762 | var cloneLs = []; 763 | list.each(function () { 764 | if ($(this).is(":hidden")) { 765 | var p = getFatherCell($(this)); 766 | var con = true; 767 | for (var i = 0; i < coll.length; i++) { 768 | if (coll[i].is(p)) { 769 | con = false; 770 | break 771 | } 772 | } 773 | if (con && p != null) { 774 | coll[coll.length] = p; 775 | p.attr("colspan", spanNum(p.attr("colspan"), ty == 5 ? -1 : 1)) 776 | } 777 | } else { 778 | if ($(this).attr("rowspan") && $(this).attr("colspan")) { 779 | coll[coll.length] = $(this); 780 | if (ty == 5) { 781 | var nextTd = $(this).next("td"); 782 | if (nextTd.length == 1 && Number($(this).attr("colspan")) > 1) { 783 | nextTd.width($(this).width()).attr("rowspan", $(this).attr("rowspan")).attr("colspan", spanNum($(this).attr("colspan"), -1)).css("display", "") 784 | } 785 | } else { 786 | $(this).attr("colspan", Number($(this).attr("colspan")) + 1) 787 | } 788 | } 789 | } 790 | var clone = $(this).clone(true); 791 | clone.width($(this).width()); 792 | clone.removeClass("td-chosen-css").html(""); 793 | cloneLs[cloneLs.length] = clone 794 | }); 795 | for (var i = 0; i < cloneLs.length; i++) { 796 | if (ty == 2) { 797 | cloneLs[i].insertBefore($(list.get(i))); 798 | var t = $(list.get(i)); 799 | if (t.attr("rowspan") && t.attr("colspan")) { 800 | t.removeAttr("rowspan").removeAttr("colspan").css("display", "none") 801 | } 802 | } 803 | if (ty == 3) { 804 | cloneLs[i].insertAfter($(list.get(i))); 805 | var t = cloneLs[i]; 806 | if (t.attr("rowspan") && t.attr("colspan")) { 807 | t.removeAttr("rowspan").removeAttr("colspan").css("display", "none") 808 | } 809 | } 810 | } 811 | } 812 | } 813 | 814 | function spanNum(spanNum, n) { 815 | var num = Number(spanNum) + n; 816 | num = num < 1 ? 1 : num; 817 | return num 818 | } 819 | 820 | function drawChosenArea(table, t) { 821 | var coll = table.find(".td-chosen-css"); 822 | table.find("td").removeClass("td-chosen-muli-css"); 823 | if (coll.length > 0) { 824 | var first = coll.first(); 825 | var posi = getTdPosition(first); 826 | var width = 0, height = 0; 827 | var p = table.parent(); 828 | coll.each(function () { 829 | var p = getTdPosition($(this)); 830 | if (p.row == posi.row) { 831 | width += this.offsetWidth 832 | } 833 | if (p.col == posi.col) { 834 | height += this.offsetHeight 835 | } 836 | }); 837 | if (coll.length > 1) { 838 | coll.addClass("td-chosen-muli-css"); 839 | //复制值 840 | if (p.find(".chosen-area-p-drug").length === 1) { 841 | var con = false; 842 | var fir = coll.first(); 843 | if (p.find(".chosen-area-p-drug").data("text") !== undefined) { 844 | recordData(t); 845 | coll.html(p.find(".chosen-area-p-drug").data("text")); 846 | p.find(".chosen-area-p-drug").removeData("text"); 847 | con = true 848 | } 849 | if (p.find(".chosen-area-p-drug").data("textNum") !== undefined) { 850 | recordData(t); 851 | var n = p.find(".chosen-area-p-drug").data("textNum"); 852 | var v = Number($.trim(fir.text())); 853 | coll.each(function () { 854 | $(this).html(v); 855 | v += n 856 | }); 857 | p.find(".chosen-area-p-drug").removeData("textNum"); 858 | con = true 859 | } 860 | if (con) { 861 | if (fir.css("vertical-align") && fir.css("vertical-align") !== "") { 862 | coll.css("vertical-align", fir.css("vertical-align")) 863 | } 864 | if (fir.css("text-align") && fir.css("text-align") !== "") { 865 | coll.css("text-align", fir.css("text-align")) 866 | } 867 | } 868 | } 869 | } 870 | setSelectBorder(table, width, height, first[0].offsetTop, first[0].offsetLeft); 871 | } 872 | } 873 | 874 | function setSelectBorder(table, width, height, top, left) { 875 | var p = table.parent(); 876 | var coll = table.find(".td-chosen-css"); 877 | p.find(".chosen-area-p").remove(); 878 | $("
").width(1).height(height + 1).css("margin-top", top - 1).css("margin-left", left - 1).insertBefore(table); 879 | $("
").width(width + 1).height(1).css("margin-top", top - 1).css("margin-left", left - 1).insertBefore(table); 880 | $("
").width(1).height(height).css("margin-top", top - 1).css("margin-left", left + width - 1).insertBefore(table); 881 | $("
").width(width).height(1).css("margin-top", top + height - 1).css("margin-left", left - 1).insertBefore(table); 882 | $("
").mousedown(function () { 883 | //控制只有当选择一个的时候才能复制 884 | // if (coll.length === 1) { 885 | $(this).data("text", $.trim(coll.first().text())) 886 | // } 887 | if (coll.length === 2) { 888 | var reg = /^\d{1,9}$/; 889 | if (reg.test($.trim(coll.first().text())) && reg.test($.trim($(coll.get(1)).text()))) { 890 | $(this).data("textNum", Number($.trim($(coll.get(1)).text())) - Number($.trim(coll.first().text()))) 891 | } 892 | } 893 | }).width(3).height(3).css("padding", "2px").css("margin-top", top + height - 4).css("margin-left", left + width - 4).insertBefore(table) 894 | } 895 | 896 | function getChar(ind) { 897 | var char = String.fromCharCode(65 + ind); 898 | if (ind >= 26) { 899 | char = String.fromCharCode(65 + (parseInt(ind / 26) - 1)) + String.fromCharCode(65 + ind % 26) 900 | } 901 | return char; 902 | } 903 | 904 | //设置表头 905 | function drawDrugArea(table) { 906 | table.parent().append('
') 907 | var ind = 0; 908 | table.find("tr").first().addClass('thead') 909 | table.find("tr").first().find("td:gt(0)").unbind("click"); 910 | table.find("tr").find("td:eq(0)").unbind("click"); 911 | table.find("tr").first().find("td:gt(0)").each(function () { 912 | var char = getChar(ind); 913 | $(this).addClass("drug-ele-td drug-ele-td-horizontal ").css("text-align", "center").html(char); 914 | ind++ 915 | }); 916 | ind = 0; 917 | table.find("tr").find("td:eq(0)").each(function () { 918 | $(this).width(60).addClass("drug-ele-td drug-ele-td-vertical").css("text-align", "center").html(ind === 0 ? "" : ind); 919 | ind++ 920 | }); 921 | } 922 | 923 | function clearPositionCss(table) { 924 | table.find("td").removeClass("td-position-css") 925 | } 926 | 927 | function showRightPanel(table, t, e) { 928 | var coll = table.find(".td-chosen-css"); 929 | closeRightPanel(t); 930 | var rightMousePanel = $("
").css("left", e.clientX).css("top", e.clientY).insertBefore(table); 931 | var leftPanel = $("
").width(200).appendTo(rightMousePanel); 932 | var rightPanel = $("
").width(130).appendTo(rightMousePanel); 933 | $("
").html("对齐方式").appendTo(leftPanel); 934 | $("
").html("合并单元格").appendTo(leftPanel); 935 | $("
").html("复制单元格样式").appendTo(leftPanel); 936 | $("
").html("粘贴单元格样式").appendTo(leftPanel); 937 | $("
").appendTo(leftPanel); 938 | $("
").html("上方插入一行").appendTo(leftPanel); 939 | $("
").html("下方插入一行").appendTo(leftPanel); 940 | $("
").html("左边插入一列").appendTo(leftPanel); 941 | $("
").html("右边插入一列").appendTo(leftPanel); 942 | $("
").appendTo(leftPanel); 943 | $("
").html("删除行").appendTo(leftPanel); 944 | $("
").html("删除列").appendTo(leftPanel); 945 | $("
").html("撤销").appendTo(leftPanel); 946 | $("
").html("居中").appendTo(rightPanel); 947 | $("
").html("左对齐").appendTo(rightPanel); 948 | $("
").html("右对齐").appendTo(rightPanel); 949 | $("
").appendTo(rightPanel); 950 | $("
").html("垂直居中").appendTo(rightPanel); 951 | $("
").html("顶端对齐").appendTo(rightPanel); 952 | $("
").html("底部对齐").appendTo(rightPanel); 953 | var setting = $("
").html("").appendTo(leftPanel); 954 | leftPanel.mousemove(function (e) { 955 | var ele = $(e.target); 956 | if (ele.hasClass("duiqifangsi") || ele.closest(".duiqifangsi").length == 1) { 957 | rightPanel.css("display", "") 958 | } else { 959 | rightPanel.css("display", "none") 960 | } 961 | }); 962 | setting.find("input").keyup(function (e) { 963 | if (e.keyCode == 13) { 964 | var width = $.trim(setting.find("input[name='width']").val()); 965 | var row = $.trim(setting.find("input[name='row']").val()); 966 | var col = $.trim(setting.find("input[name='col']").val()); 967 | var reg = /^\d{1,4}$/; 968 | if (reg.test(row) && reg.test(col)) { 969 | width = reg.test(width) ? width : 0; 970 | initTable(t, {row: Number(row) + 1, col: Number(col) + 1, width: width, type: 1}) 971 | } 972 | } 973 | }); 974 | rightMousePanel.find(".wb").click(function () { 975 | var obj = $(this); 976 | if (!obj.hasClass("duiqifangsi") && !obj.hasClass("setting")) { 977 | if (!obj.hasClass("chexiao")) { 978 | recordData(t) 979 | } 980 | if (obj.hasClass("hebingdanyuange")) { 981 | mergeCell(table) 982 | } 983 | if (obj.hasClass("fuzhidanyuange")) { 984 | copydanyuange(table) 985 | } 986 | if (obj.hasClass("zhantiedanyuange")) { 987 | pastedanyuange(table) 988 | } 989 | if (obj.hasClass("shangchayihang")) { 990 | addRowCol(table, 0, t) 991 | } 992 | if (obj.hasClass("xiachayihang")) { 993 | addRowCol(table, 1, t) 994 | } 995 | if (obj.hasClass("zuochayilie")) { 996 | addRowCol(table, 2, t) 997 | } 998 | if (obj.hasClass("youchayilie")) { 999 | addRowCol(table, 3, t) 1000 | } 1001 | if (obj.hasClass("shanchuhang")) { 1002 | addRowCol(table, 4, t) 1003 | } 1004 | if (obj.hasClass("shanchulie")) { 1005 | addRowCol(table, 5, t) 1006 | } 1007 | if (obj.hasClass("chexiao")) { 1008 | chexiaoFunc(t) 1009 | } 1010 | if (obj.hasClass("juzhong")) { 1011 | coll.css("text-align", "center") 1012 | } 1013 | if (obj.hasClass("zuoduiqi")) { 1014 | coll.css("text-align", "left") 1015 | } 1016 | if (obj.hasClass("youduiqi")) { 1017 | coll.css("text-align", "right") 1018 | } 1019 | if (obj.hasClass("chuizhijuzhong")) { 1020 | coll.css("vertical-align", "middle") 1021 | } 1022 | if (obj.hasClass("dingduanduiqi")) { 1023 | coll.css("vertical-align", "top") 1024 | } 1025 | if (obj.hasClass("dibuduiqi")) { 1026 | coll.css("vertical-align", "bottom") 1027 | } 1028 | if (obj.hasClass("shangchayihang") || obj.hasClass("xiachayihang") || obj.hasClass("zuochayilie") || obj.hasClass("youchayilie") || obj.hasClass("shanchuhang") || obj.hasClass("shanchulie")) { 1029 | drugCell(table, t) 1030 | } 1031 | rightMousePanel.remove() 1032 | } 1033 | }); 1034 | if (!(t.data("record") != undefined && t.data("record").length > 0)) { 1035 | leftPanel.find(".chexiao").remove() 1036 | } 1037 | } 1038 | 1039 | function copydanyuange(table) { 1040 | if (hasAttr(selectTd, 'rowspan') || hasAttr(selectTd, 'colspan')) { 1041 | alert("合并后的单元格不允许复制样式"); 1042 | return; 1043 | } 1044 | selectTdStyle = selectTd.prop("outerHTML"); 1045 | } 1046 | 1047 | function pastedanyuange() { 1048 | selectTd.replaceWith(selectTdStyle); 1049 | selectTd = $(selectTdStyle) 1050 | setSelectTdValue(selectTd); 1051 | } 1052 | 1053 | function chexiaoFunc(t) { 1054 | if (t.data("record") != undefined) { 1055 | var record = t.data("record"); 1056 | if (record.length > 0) { 1057 | initTable(t, {data: record[record.length - 1], type: 0}); 1058 | record.splice(record.length - 1, 1) 1059 | } 1060 | } 1061 | } 1062 | 1063 | function closeRightPanel(t) { 1064 | t.find(".rightmouse-panel-div").remove() 1065 | } 1066 | 1067 | function recordData(t) { 1068 | var record = []; 1069 | if (t.data("record") != undefined) { 1070 | record = t.data("record") 1071 | } 1072 | record[record.length] = t.getExcelHtml(); 1073 | t.data("record", record) 1074 | } 1075 | 1076 | function setFontFamily() { 1077 | let fontFamily = $(this).val(); 1078 | let coll = $('table').first().find('.td-chosen-css'); 1079 | coll.css('font-family', fontFamily); 1080 | } 1081 | 1082 | function setFontSize() { 1083 | let fontSize = $(this).val(); 1084 | let coll = $('table').first().find('.td-chosen-css'); 1085 | coll.css('font-size', fontSize); 1086 | } 1087 | 1088 | function setFontBold() { 1089 | $(this).toggleClass("buttonBgColor"); 1090 | let coll = $('table').first().find('.td-chosen-css'); 1091 | let fontWeight = selectTd.css('font-weight'); 1092 | if (fontWeight === '400') { 1093 | coll.css('font-weight', '700'); 1094 | } else { 1095 | coll.css('font-weight', ''); 1096 | } 1097 | } 1098 | 1099 | function setFontItalic() { 1100 | $(this).toggleClass("buttonBgColor"); 1101 | let coll = $('table').first().find('.td-chosen-css'); 1102 | let fontItalic = selectTd.css('font-style'); 1103 | if (fontItalic === 'normal') { 1104 | coll.css('font-style', 'italic'); 1105 | } else { 1106 | coll.css('font-style', ''); 1107 | } 1108 | } 1109 | 1110 | function setUnderline() { 1111 | $('.btn-strike').removeClass('buttonBgColor'); 1112 | let coll = $('table').first().find('.td-chosen-css'); 1113 | let underline = selectTd.css('text-decoration-line'); 1114 | if (underline === 'none' || underline === 'line-through') { 1115 | coll.css('text-decoration-line', 'underline'); 1116 | $(this).addClass("buttonBgColor"); 1117 | } else { 1118 | coll.css('text-decoration-line', ''); 1119 | $(this).removeClass("buttonBgColor"); 1120 | } 1121 | 1122 | } 1123 | 1124 | function setFontStrike() { 1125 | $('.btn-underline').removeClass('buttonBgColor'); 1126 | let coll = $('table').first().find('.td-chosen-css'); 1127 | let fontStrike = selectTd.css('text-decoration-line'); 1128 | if (fontStrike === 'none' || fontStrike === 'underline') { 1129 | coll.css('text-decoration-line', 'line-through'); 1130 | $(this).addClass("buttonBgColor"); 1131 | } else { 1132 | coll.css('text-decoration-line', ''); 1133 | $(this).removeClass("buttonBgColor"); 1134 | } 1135 | } 1136 | 1137 | function clickBgColor() { 1138 | if (selectTd === undefined || selectTd === {}) { 1139 | alert("请选择需要设置的单元格"); 1140 | return; 1141 | } 1142 | $('#bgColorSelect').click(); 1143 | } 1144 | 1145 | function clickFontColor() { 1146 | if (selectTd === undefined || selectTd === {}) { 1147 | alert("请选择需要设置的单元格"); 1148 | return; 1149 | } 1150 | $('#fontColorSelect').click(); 1151 | } 1152 | 1153 | function setBgColor() { 1154 | let color = $("#bgColorSelect").val(); 1155 | let coll = $('table').first().find('.td-chosen-css'); 1156 | coll.css('background-color', color); 1157 | } 1158 | 1159 | function setFontColor() { 1160 | let color = $("#fontColorSelect").val(); 1161 | let coll = $('table').first().find('.td-chosen-css'); 1162 | coll.css('color', color); 1163 | } 1164 | 1165 | function setValign(event) { 1166 | $('.btn-av').removeClass('buttonBgColor'); 1167 | $(this).addClass("buttonBgColor"); 1168 | let coll = $('table').first().find('.td-chosen-css'); 1169 | coll.css("vertical-align", event.data); 1170 | } 1171 | 1172 | function setAlign(event) { 1173 | $('.btn-ah').removeClass('buttonBgColor'); 1174 | $(this).addClass("buttonBgColor"); 1175 | let coll = $('table').first().find('.td-chosen-css'); 1176 | coll.css("text-align", event.data); 1177 | } 1178 | 1179 | function mergeBtn() { 1180 | let table = $('.excel').find("table").first(); 1181 | var coll = table.find(".td-chosen-css"); 1182 | if (coll.length !== 1) { 1183 | mergeCell(table); 1184 | } 1185 | } 1186 | 1187 | function splitBtn() { 1188 | let table = $('.excel').find("table").first(); 1189 | var coll = table.find(".td-chosen-css"); 1190 | if (coll.length === 1) { 1191 | mergeCell(table); 1192 | } 1193 | } 1194 | 1195 | function whiteSpace() { 1196 | $(this).toggleClass('buttonBgColor'); 1197 | if (selectTd != null) { 1198 | if (selectTd.css('white-space') === 'nowrap') { 1199 | selectTd.css('white-space', 'normal') 1200 | } else { 1201 | selectTd.css('white-space', 'nowrap') 1202 | } 1203 | } 1204 | } 1205 | 1206 | function getBorderCssStr() { 1207 | let color = $("#borderColor").val(); 1208 | let style = $('.borderStyleOption option:selected').val(); 1209 | return getBorderWidthByStyle(style) + style + ' ' + color; 1210 | } 1211 | 1212 | function setBorderLeft() { 1213 | let coll = $('table').first().find('.td-chosen-css'); 1214 | let rowSpanNum = 0; 1215 | coll.parent().each(function (index) { 1216 | let $td = $(this).children('.td-chosen-css:visible').first(); 1217 | if (index > 0) { 1218 | let $tdrowspan = $td.attr('rowspan'); 1219 | let $parentTd = $td.parent().prev().children('.td-chosen-css[rowspan]'); 1220 | let rowspan = $parentTd.attr('rowspan'); 1221 | if (rowspan!= null && rowspan!== '' && rowspan!== 0) { 1222 | rowSpanNum = rowspan; 1223 | } 1224 | if (rowSpanNum !== 0) { 1225 | rowSpanNum--; 1226 | } 1227 | if (rowSpanNum === 0 ||($tdrowspan===undefined && $td.prev().css('display')!=='none')) { 1228 | $td.css('border-left', getBorderCssStr()); 1229 | } 1230 | } else { 1231 | $td.css('border-left', getBorderCssStr()); 1232 | } 1233 | }); 1234 | } 1235 | 1236 | function setBorderTop() { 1237 | let coll = $('table').first().find('.td-chosen-css'); 1238 | coll.parent().first().children('.td-chosen-css:visible').css('border-top', getBorderCssStr()) 1239 | } 1240 | 1241 | function setBorderRight() { 1242 | let coll = $('table').first().find('.td-chosen-css'); 1243 | let rowSpanNum = 0; 1244 | coll.parent().each(function (index) { 1245 | let $td = $(this).children('.td-chosen-css:visible').last(); 1246 | if (index > 0) { 1247 | let $tdrowspan = $td.attr('rowspan'); 1248 | let $parentTd = $td.parent().prev().children('.td-chosen-css[rowspan]'); 1249 | let rowspan = $parentTd.attr('rowspan'); 1250 | if (rowspan!= null && rowspan!== '' && rowspan!== 0) { 1251 | rowSpanNum = rowspan; 1252 | } 1253 | if (rowSpanNum !== 0) { 1254 | rowSpanNum--; 1255 | } 1256 | if (rowSpanNum === 0 ||($tdrowspan===null && $td.next().css('display')!=='none')) { 1257 | $td.css('border-right', getBorderCssStr()); 1258 | } 1259 | } else { 1260 | $td.css('border-right', getBorderCssStr()); 1261 | } 1262 | }); 1263 | } 1264 | 1265 | //寻找td上面的第一个td 1266 | function findPrevShowTd($td) { 1267 | let $prevTd = $td.parent().prev().children().eq($td.index()); 1268 | if($prevTd.css('display') === 'none'){ 1269 | return findPrevShowTd($prevTd); 1270 | }else{ 1271 | return $prevTd; 1272 | } 1273 | } 1274 | 1275 | function setBorderBottom() { 1276 | let coll = $('table').first().find('.td-chosen-css'); 1277 | let i = 0; 1278 | coll.parent().last().children('.td-chosen-css').each(function () { 1279 | if($(this).css('display') === 'none' && i === 0){ 1280 | i = 1; 1281 | findPrevShowTd($(this)).css('border-bottom', getBorderCssStr()); 1282 | }else{ 1283 | $(this).css('border-bottom', getBorderCssStr()) 1284 | } 1285 | }) 1286 | } 1287 | 1288 | function setBorderAll() { 1289 | let coll = $('table').first().find('.td-chosen-css'); 1290 | let style = $('.borderStyleOption option:selected').val(); 1291 | if (style === 'none') { 1292 | coll.css('border', '#ccc 1px solid') 1293 | } else { 1294 | coll.css('border', getBorderCssStr()) 1295 | } 1296 | } 1297 | 1298 | function clickBorderColor() { 1299 | $('#borderColor').click(); 1300 | } 1301 | 1302 | function setBorderColor() { 1303 | let color = $("#borderColor").val(); 1304 | if (selectTd !== undefined && selectTd !== {}) { 1305 | if (selectTd.css('border-right-color') !== 'rgb(204, 204, 204)') { 1306 | selectTd.css('border-right-color', color); 1307 | } 1308 | if (selectTd.css('border-top-color') !== 'rgb(204, 204, 204)') { 1309 | selectTd.css('border-top-color', color); 1310 | } 1311 | if (selectTd.css('border-bottom-color') !== 'rgb(204, 204, 204)') { 1312 | selectTd.css('border-bottom-color', color); 1313 | } 1314 | if (selectTd.css('border-left-color') !== 'rgb(204, 204, 204)') { 1315 | selectTd.css('border-left-color', color); 1316 | } 1317 | } 1318 | } 1319 | 1320 | function showBorderStyleDiv() { 1321 | $('.selectBorderStyle').toggleClass('show'); 1322 | } 1323 | 1324 | function setBorderStyleOption(event) { 1325 | let style = event.data; 1326 | $('.borderStyleOption').val(style); 1327 | } 1328 | 1329 | function setCellWidth() { 1330 | if (selectTd !== undefined && selectTd !== {}) { 1331 | let width = $('#cell-width').val(); 1332 | let index = selectTd.index(); 1333 | let oldWidth = selectTd.width(); 1334 | selectTd.parent().siblings().each(function (i, ele) { 1335 | $(this).children('td').eq(index).width(width); 1336 | }) 1337 | selectTd.width(width); 1338 | let left = $('.col-width-panel-item').eq(index).position().left; 1339 | let nowPanelItem = $('.col-width-panel-item').eq(index); 1340 | nowPanelItem.css('left', left + selectTd.width() - oldWidth); 1341 | nowPanelItem.nextAll().each(function (i, ele) { 1342 | let left = $(this).position().left 1343 | $(this).css('left', left + selectTd.width() - oldWidth); 1344 | }) 1345 | updateBorderLeft(oldWidth, selectTd.innerWidth); 1346 | } 1347 | } 1348 | 1349 | function updateBorderLeft(oldWidth, width) { 1350 | $('.chosen-area-p').eq(1).width($('.chosen-area-p').eq(1).width() - oldWidth + parseInt(width)) 1351 | let oldMarginLeft = parseInt($('.chosen-area-p').eq(2).css('margin-left')); 1352 | $('.chosen-area-p').eq(2).css('margin-left', oldMarginLeft - oldWidth + parseInt(width) - 1) 1353 | $('.chosen-area-p').eq(3).width($('.chosen-area-p').eq(3).width() - oldWidth + parseInt(width) - 1) 1354 | $('.chosen-area-p').eq(4).css('margin-left', oldMarginLeft - oldWidth + parseInt(width) - 3) 1355 | } 1356 | 1357 | function setCellHeight() { 1358 | if (selectTd !== undefined && selectTd !== {}) { 1359 | let index = selectTd.prevAll().last().html(); 1360 | let height = $('#cell-height').val(); 1361 | let oldHeight = selectTd.height(); 1362 | selectTd.parent().height(height); 1363 | let top = $('.row-height-panel-item').eq(index).position().top; 1364 | let nowPanelItem = $('.row-height-panel-item').eq(index); 1365 | nowPanelItem.css('top', top + selectTd.height() - oldHeight - 4); 1366 | nowPanelItem.nextAll().each(function (i, ele) { 1367 | let top = $(this).position().top 1368 | $(this).css('top', top + selectTd.height() - oldHeight - 4); 1369 | }) 1370 | updateBorderTop(selectTd.outerHeight(), oldHeight) 1371 | } 1372 | } 1373 | 1374 | function updateBorderTop(height, oldHeight) { 1375 | $('.chosen-area-p').eq(0).height($('.chosen-area-p').eq(0).height() - oldHeight + parseInt(height) - 4) 1376 | $('.chosen-area-p').eq(2).height($('.chosen-area-p').eq(2).height() - oldHeight + parseInt(height) - 4) 1377 | let oldMarginTop = parseInt($('.chosen-area-p').eq(3).css('margin-top')); 1378 | $('.chosen-area-p').eq(3).css('margin-top', oldMarginTop - oldHeight + parseInt(height) - 4) 1379 | $('.chosen-area-p').eq(4).css('margin-top', oldMarginTop - oldHeight + parseInt(height) - 7) 1380 | } 1381 | 1382 | function getBorderWidthByStyle(style) { 1383 | if (style === 'double') { 1384 | return '3px ' 1385 | } else { 1386 | return '2px '; 1387 | } 1388 | } 1389 | 1390 | } 1391 | 1392 | )(jQuery); 1393 | --------------------------------------------------------------------------------