@newview/ui 1.1.40 → 1.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/newview-ui.js +69 -39
- package/dist/newview-ui.umd.cjs +1 -1
- package/package.json +73 -72
- package/types/ComForm.d.ts +2 -0
package/README.md
CHANGED
package/dist/newview-ui.js
CHANGED
|
@@ -184167,6 +184167,8 @@ var HtmlCells$1 = (
|
|
|
184167
184167
|
HtmlCells2.prototype.setMerge = function(td, objValue) {
|
|
184168
184168
|
if (objValue.mc) {
|
|
184169
184169
|
td.isMerge = true;
|
|
184170
|
+
td.startRow = objValue.mc.r;
|
|
184171
|
+
td.startCol = objValue.mc.c;
|
|
184170
184172
|
if (objValue.mc.cs == void 0) {
|
|
184171
184173
|
td.isRender = false;
|
|
184172
184174
|
} else {
|
|
@@ -184362,21 +184364,14 @@ var HtmlCells$1 = (
|
|
|
184362
184364
|
if (!isMerge) {
|
|
184363
184365
|
tdBorders[key2].right = rightStyle ? rightStyle.borderNumber : 0;
|
|
184364
184366
|
this.setCss(style2, "border-right", rightStyle ? rightStyle.css : void 0);
|
|
184365
|
-
} else if (td.isRender) {
|
|
184366
|
-
var
|
|
184367
|
-
var
|
|
184368
|
-
var
|
|
184369
|
-
var
|
|
184370
|
-
|
|
184371
|
-
|
|
184372
|
-
|
|
184373
|
-
} else {
|
|
184374
|
-
this.startTds[endKey] = { startRowIndex: border.value.row_index, startColIndex: border.value.col_index };
|
|
184375
|
-
}
|
|
184376
|
-
} else {
|
|
184377
|
-
var startRowCol = this.startTds[key2];
|
|
184378
|
-
if (startRowCol != void 0) {
|
|
184379
|
-
var startKey = startRowCol.startRowIndex + "_" + startRowCol.startColIndex;
|
|
184367
|
+
} else if (!td.isRender) {
|
|
184368
|
+
var startRow = td.startRow;
|
|
184369
|
+
var startCol = td.startCol;
|
|
184370
|
+
var startKey = startRow + "_" + startCol;
|
|
184371
|
+
var startTd = this.tds[startKey];
|
|
184372
|
+
var endRow = startRow + startTd.rowspan - 1;
|
|
184373
|
+
var endCol = startCol + startTd.colspan - 1;
|
|
184374
|
+
if (endRow == border.value.row_index && endCol == border.value.col_index) {
|
|
184380
184375
|
tdBorders[startKey] = tdBorders[startKey] || {
|
|
184381
184376
|
style: {},
|
|
184382
184377
|
left: 0,
|
|
@@ -184387,8 +184382,6 @@ var HtmlCells$1 = (
|
|
|
184387
184382
|
var startStyle = tdBorders[startKey].style;
|
|
184388
184383
|
tdBorders[startKey].right = rightStyle ? rightStyle.borderNumber : 0;
|
|
184389
184384
|
this.setCss(startStyle, "border-right", rightStyle ? rightStyle.css : void 0);
|
|
184390
|
-
} else {
|
|
184391
|
-
this.endTdRightStyle[key2] = rightStyle;
|
|
184392
184385
|
}
|
|
184393
184386
|
}
|
|
184394
184387
|
};
|
|
@@ -184448,12 +184441,12 @@ var HtmlCells$1 = (
|
|
|
184448
184441
|
if (tdcell.isMerge) {
|
|
184449
184442
|
if (xcolwidth && tdcell.colspan) {
|
|
184450
184443
|
for (var i2 = Cindex; i2 < Cindex + tdcell.colspan; i2++) {
|
|
184451
|
-
cellwidth += Number(xcolwidth[i2]);
|
|
184444
|
+
cellwidth += xcolwidth[i2] == void 0 ? this.defaultColWidth : Number(xcolwidth[i2]);
|
|
184452
184445
|
}
|
|
184453
184446
|
}
|
|
184454
184447
|
if (yrowheight && tdcell.rowspan) {
|
|
184455
184448
|
for (var j2 = Rindex; j2 < Rindex + tdcell.rowspan; j2++) {
|
|
184456
|
-
cellheight += Number(yrowheight[j2]);
|
|
184449
|
+
cellheight += yrowheight[j2] == void 0 ? this.defaultRowHeight : Number(yrowheight[j2]);
|
|
184457
184450
|
}
|
|
184458
184451
|
}
|
|
184459
184452
|
} else {
|
|
@@ -184632,7 +184625,7 @@ var HtmlCells$1 = (
|
|
|
184632
184625
|
var td = cells.tds[key2];
|
|
184633
184626
|
var border = cells.borders[key2];
|
|
184634
184627
|
if (row == 0) {
|
|
184635
|
-
var width = this.sheet.config.columnlen ? this.sheet.config.columnlen[col_1] : this.defaultColWidth;
|
|
184628
|
+
var width = this.sheet.config.columnlen && this.sheet.config.columnlen[col_1] != void 0 ? this.sheet.config.columnlen[col_1] : this.defaultColWidth;
|
|
184636
184629
|
if (!border)
|
|
184637
184630
|
width++;
|
|
184638
184631
|
width = ishiddencol ? 0 : width;
|
|
@@ -184648,7 +184641,7 @@ var HtmlCells$1 = (
|
|
|
184648
184641
|
if (ishidenrow) {
|
|
184649
184642
|
rowHeight = 0;
|
|
184650
184643
|
} else {
|
|
184651
|
-
rowHeight = this.sheet.config.rowlen ? this.sheet.config.rowlen[row] : this.defaultRowHeight;
|
|
184644
|
+
rowHeight = this.sheet.config.rowlen && this.sheet.config.rowlen[row] != void 0 ? this.sheet.config.rowlen[row] : this.defaultRowHeight;
|
|
184652
184645
|
rowHeight = rowHeight || this.defaultRowHeight;
|
|
184653
184646
|
if (rowHeight < 5) {
|
|
184654
184647
|
rowHeight = 0;
|
|
@@ -187925,6 +187918,8 @@ class PrintApi extends BaseInstance {
|
|
|
187925
187918
|
const sheetHeight = this.reportApi.sheetApi.getSheetHeight(sheetHandle);
|
|
187926
187919
|
const countRow = this.reportApi.rowColApi.getRows(sheetHandle);
|
|
187927
187920
|
const countCol = this.reportApi.rowColApi.getCols(sheetHandle);
|
|
187921
|
+
console.log(countRow, countCol);
|
|
187922
|
+
console.log(sheetWidth, sheetHeight);
|
|
187928
187923
|
const dh = (a4Height - sheetHeight) / countRow;
|
|
187929
187924
|
for (let i2 = 0; i2 < countRow - 1; i2++) {
|
|
187930
187925
|
let height = this.reportApi.rowColApi.getRowHeight(i2, sheetHandle);
|
|
@@ -188088,7 +188083,8 @@ class RowColApi extends BaseInstance {
|
|
|
188088
188083
|
getColWidth(colIndex, sheetHandle) {
|
|
188089
188084
|
let cindex = this.utilities.isNull(sheetHandle) ? this.luckysheet.getSheet().order : Number(sheetHandle);
|
|
188090
188085
|
const sheet = this.luckysheet.getSheet({ order: cindex });
|
|
188091
|
-
let
|
|
188086
|
+
let defaultWidth = this.luckysheet.getDefaultColWidth({ order: cindex });
|
|
188087
|
+
let swidth = !this.utilities.isNull(sheet.config.columnlen[colIndex]) ? Number(sheet.config.columnlen[colIndex]) : defaultWidth;
|
|
188092
188088
|
return swidth;
|
|
188093
188089
|
}
|
|
188094
188090
|
/**
|
|
@@ -188115,7 +188111,8 @@ class RowColApi extends BaseInstance {
|
|
|
188115
188111
|
getRowHeight(rowIndex, sheetHandle) {
|
|
188116
188112
|
let cindex = this.utilities.isNull(sheetHandle) ? this.luckysheet.getSheet().order : Number(sheetHandle);
|
|
188117
188113
|
const sheet = this.luckysheet.getSheet({ order: cindex });
|
|
188118
|
-
let
|
|
188114
|
+
let defaultHeight = this.luckysheet.getDefaultRowHeight({ order: cindex });
|
|
188115
|
+
let sheight = !this.utilities.isNull(sheet.config.rowlen[rowIndex]) ? Number(sheet.config.rowlen[rowIndex]) : defaultHeight;
|
|
188119
188116
|
return sheight;
|
|
188120
188117
|
}
|
|
188121
188118
|
/**
|
|
@@ -188157,26 +188154,39 @@ class RowColApi extends BaseInstance {
|
|
|
188157
188154
|
* @param sheetHandle
|
|
188158
188155
|
*/
|
|
188159
188156
|
getRows(sheetHandle) {
|
|
188160
|
-
let
|
|
188161
|
-
|
|
188162
|
-
|
|
188163
|
-
|
|
188164
|
-
|
|
188165
|
-
|
|
188157
|
+
let cindex = this.utilities.isNull(sheetHandle) ? this.luckysheet.getSheet().order : Number(sheetHandle);
|
|
188158
|
+
const datas = this.luckysheet.getSheetData({ order: cindex });
|
|
188159
|
+
let length = 0;
|
|
188160
|
+
if (datas.length == 0) {
|
|
188161
|
+
return length;
|
|
188162
|
+
}
|
|
188163
|
+
console.log(datas.length);
|
|
188164
|
+
for (const row of datas) {
|
|
188165
|
+
const cell = row[0];
|
|
188166
|
+
if (!this.utilities.isNull(cell)) {
|
|
188167
|
+
length++;
|
|
188168
|
+
}
|
|
188166
188169
|
}
|
|
188170
|
+
return length;
|
|
188167
188171
|
}
|
|
188168
188172
|
/**
|
|
188169
188173
|
* 获取总列数
|
|
188170
188174
|
* @param sheetHandle
|
|
188171
188175
|
*/
|
|
188172
188176
|
getCols(sheetHandle) {
|
|
188173
|
-
let
|
|
188174
|
-
|
|
188175
|
-
|
|
188176
|
-
|
|
188177
|
-
|
|
188178
|
-
return 0;
|
|
188177
|
+
let cindex = this.utilities.isNull(sheetHandle) ? this.luckysheet.getSheet().order : Number(sheetHandle);
|
|
188178
|
+
const datas = this.luckysheet.getSheetData({ order: cindex });
|
|
188179
|
+
let length = 0;
|
|
188180
|
+
if (datas.length == 0) {
|
|
188181
|
+
return length;
|
|
188179
188182
|
}
|
|
188183
|
+
const row = datas[0];
|
|
188184
|
+
for (const cell of row) {
|
|
188185
|
+
if (!this.utilities.isNull(cell)) {
|
|
188186
|
+
length++;
|
|
188187
|
+
}
|
|
188188
|
+
}
|
|
188189
|
+
return length;
|
|
188180
188190
|
}
|
|
188181
188191
|
/**
|
|
188182
188192
|
* 删除行
|
|
@@ -188632,8 +188642,10 @@ class SheetApi extends BaseInstance {
|
|
|
188632
188642
|
let cindex = this.utilities.isNull(sheetHandle) ? this.luckysheet.getSheet().order : Number(sheetHandle);
|
|
188633
188643
|
let xsheet = this.luckysheet.getSheet({ order: cindex });
|
|
188634
188644
|
let swidth = 0;
|
|
188635
|
-
|
|
188636
|
-
|
|
188645
|
+
let defaultWidth = this.luckysheet.getDefaultColWidth({ order: cindex });
|
|
188646
|
+
const colCount = this.reportApi.rowColApi.getCols(cindex);
|
|
188647
|
+
for (let col = 0; col < colCount; col++) {
|
|
188648
|
+
swidth += xsheet.config.columnlen && xsheet.config.columnlen[col] != void 0 ? Number(xsheet.config.columnlen[col]) : defaultWidth;
|
|
188637
188649
|
}
|
|
188638
188650
|
return swidth + this.reportApi.rowColApi.getCols(cindex);
|
|
188639
188651
|
}
|
|
@@ -188644,8 +188656,10 @@ class SheetApi extends BaseInstance {
|
|
|
188644
188656
|
let cindex = this.utilities.isNull(sheetHandle) ? this.luckysheet.getSheet().order : Number(sheetHandle);
|
|
188645
188657
|
let xsheet = this.luckysheet.getSheet({ order: cindex });
|
|
188646
188658
|
let sheight = 0;
|
|
188647
|
-
|
|
188648
|
-
|
|
188659
|
+
let defaultHeight = this.luckysheet.getDefaultRowHeight({ order: cindex });
|
|
188660
|
+
const rowCount = this.reportApi.rowColApi.getRows(cindex);
|
|
188661
|
+
for (let row = 0; row < rowCount; row++) {
|
|
188662
|
+
sheight += xsheet.config.rowlen && xsheet.config.rowlen[row] != void 0 ? Number(xsheet.config.rowlen[row]) : defaultHeight;
|
|
188649
188663
|
}
|
|
188650
188664
|
return sheight + this.reportApi.rowColApi.getRows(cindex);
|
|
188651
188665
|
}
|
|
@@ -189901,6 +189915,11 @@ const propDefine$i = {
|
|
|
189901
189915
|
// 是否正在导入中
|
|
189902
189916
|
type: Boolean,
|
|
189903
189917
|
default: false
|
|
189918
|
+
},
|
|
189919
|
+
noImportBtn: {
|
|
189920
|
+
// 是否不显示导出按钮
|
|
189921
|
+
type: Boolean,
|
|
189922
|
+
default: false
|
|
189904
189923
|
}
|
|
189905
189924
|
};
|
|
189906
189925
|
const _sfc_main$8 = defineComponent({
|
|
@@ -190026,6 +190045,9 @@ let ExcelImportInstance$1 = class ExcelImportInstance2 extends BaseInstance {
|
|
|
190026
190045
|
this.selectedSheet.value = wsname;
|
|
190027
190046
|
this.messageInfo(`${file.name} 读取完成`);
|
|
190028
190047
|
this.selectedSheetIsLoading.value = false;
|
|
190048
|
+
if (this.props.noImportBtn) {
|
|
190049
|
+
this.doImportExcel();
|
|
190050
|
+
}
|
|
190029
190051
|
};
|
|
190030
190052
|
reader.readAsBinaryString(file);
|
|
190031
190053
|
}
|
|
@@ -215012,6 +215034,11 @@ const propDefine = {
|
|
|
215012
215034
|
// 是否正在导入中
|
|
215013
215035
|
type: Boolean,
|
|
215014
215036
|
default: false
|
|
215037
|
+
},
|
|
215038
|
+
noImportBtn: {
|
|
215039
|
+
// 是否不显示导出按钮
|
|
215040
|
+
type: Boolean,
|
|
215041
|
+
default: false
|
|
215015
215042
|
}
|
|
215016
215043
|
};
|
|
215017
215044
|
defineComponent({
|
|
@@ -215137,6 +215164,9 @@ class ExcelImportInstance extends BaseInstance {
|
|
|
215137
215164
|
this.selectedSheet.value = wsname;
|
|
215138
215165
|
this.messageInfo(`${file.name} 读取完成`);
|
|
215139
215166
|
this.selectedSheetIsLoading.value = false;
|
|
215167
|
+
if (this.props.noImportBtn) {
|
|
215168
|
+
this.doImportExcel();
|
|
215169
|
+
}
|
|
215140
215170
|
};
|
|
215141
215171
|
reader.readAsBinaryString(file);
|
|
215142
215172
|
}
|