|
|
@@ -64,6 +64,8 @@ $(document).ready(function() {
|
|
|
headRowHeight: [32],
|
|
|
defaultRowHeight: 21,
|
|
|
headColWidth: [25],
|
|
|
+ frozenColCount: 1,
|
|
|
+ frozenLineColor: '#d9d9d9',
|
|
|
headerFont: '12px 微软雅黑',
|
|
|
font: '12px 微软雅黑',
|
|
|
readOnly: false,
|
|
|
@@ -212,20 +214,16 @@ $(document).ready(function() {
|
|
|
* 根据目录区域宽度调整树表列宽,拖动分隔条时保持 SpreadJS 填满容器。
|
|
|
*/
|
|
|
resizeSpreadColumns() {
|
|
|
- const containerWidth = Math.floor($('#filing-spread').innerWidth() || 0);
|
|
|
- if (containerWidth <= 0) return;
|
|
|
-
|
|
|
- const rowHeaderWidth = 25;
|
|
|
- const fileCountWidth = 70;
|
|
|
- const scrollbarWidth = 18;
|
|
|
- const borderWidth = 2;
|
|
|
- const nameWidth = Math.max(
|
|
|
- containerWidth - rowHeaderWidth - fileCountWidth - scrollbarWidth - borderWidth,
|
|
|
- 60
|
|
|
- );
|
|
|
- this.sheet.setColumnWidth(0, nameWidth);
|
|
|
- this.sheet.setColumnWidth(1, fileCountWidth);
|
|
|
+ if (!this.spread.getHost().clientWidth) return;
|
|
|
this.spread.refresh();
|
|
|
+ const sheet = this.sheet;
|
|
|
+ // 分栏骤然变窄时,旧的冻结列可能占满视口;先缩小它,才能量到实际可用宽度。
|
|
|
+ if (sheet.getViewportWidth(1) === 0) sheet.setColumnWidth(0, 1);
|
|
|
+ const viewportWidth = sheet.getViewportWidth(0) + sheet.getViewportWidth(1);
|
|
|
+ const fileCountWidth = this.spreadSetting.cols[1].width;
|
|
|
+ const nameWidth = Math.max(1, Math.floor(viewportWidth / sheet.zoom()) - fileCountWidth);
|
|
|
+ if (sheet.getColumnWidth(0) !== nameWidth) sheet.setColumnWidth(0, nameWidth);
|
|
|
+ if (sheet.getColumnWidth(1) !== fileCountWidth) sheet.setColumnWidth(1, fileCountWidth);
|
|
|
}
|
|
|
|
|
|
/**
|