mirror of
https://github.com/ruilisi/fortune-sheet.git
synced 2025-01-07 03:16:50 +08:00
fixed: tsc, lint errors
This commit is contained in:
parent
f8885c5950
commit
f2d41934a7
@ -227,7 +227,8 @@ export function defaultContext(refs: RefValues): Context {
|
||||
defaultrowNum: 84,
|
||||
addDefaultRows: 50,
|
||||
fullscreenmode: true,
|
||||
devicePixelRatio: (typeof globalThis !== 'undefined' ? globalThis : window).devicePixelRatio,
|
||||
devicePixelRatio: (typeof globalThis !== "undefined" ? globalThis : window)
|
||||
.devicePixelRatio,
|
||||
|
||||
contextMenu: {},
|
||||
sheetTabContextMenu: {},
|
||||
|
@ -761,7 +761,11 @@ export function compute(ctx: Context, ruleArr: any, d: CellMatrix) {
|
||||
continue;
|
||||
}
|
||||
// 符合条件
|
||||
if (cell.v >= vSmall && cell.v <= vBig) {
|
||||
if (
|
||||
typeof cell.v === "number" &&
|
||||
cell.v >= vSmall &&
|
||||
cell.v <= vBig
|
||||
) {
|
||||
if (`${r}_${c}` in computeMap) {
|
||||
computeMap[`${r}_${c}`].textColor = textColor;
|
||||
computeMap[`${r}_${c}`].cellColor = cellColor;
|
||||
|
@ -32,7 +32,10 @@ export const FormatSearch: React.FC<{
|
||||
}),
|
||||
[currencyDetail, dateFmtList, numberFmtList]
|
||||
);
|
||||
const toolbarFormat = useMemo(
|
||||
|
||||
type toolbarFormatType = { name: string; pos?: string; value: string };
|
||||
|
||||
const toolbarFormat: toolbarFormatType[] = useMemo(
|
||||
() => toolbarFormatAll[type],
|
||||
[toolbarFormatAll, type]
|
||||
);
|
||||
@ -48,7 +51,11 @@ export const FormatSearch: React.FC<{
|
||||
const index = getSheetIndex(ctx, ctx.currentSheetId);
|
||||
if (_.isNil(index)) return;
|
||||
const selectedFormatVal = toolbarFormat[selectedFormatIndex].value;
|
||||
const selectedFormatPos = toolbarFormat[selectedFormatIndex].pos;
|
||||
|
||||
let selectedFormatPos: string;
|
||||
if ("pos" in toolbarFormat[selectedFormatIndex])
|
||||
selectedFormatPos = toolbarFormat[selectedFormatIndex].pos || "before";
|
||||
|
||||
_.forEach(ctx.luckysheet_select_save, (selection) => {
|
||||
for (let r = selection.row[0]; r <= selection.row[1]; r += 1) {
|
||||
for (let c = selection.column[0]; c <= selection.column[1]; c += 1) {
|
||||
|
@ -30,7 +30,9 @@ const Sheet: React.FC<Props> = ({ sheet }) => {
|
||||
if (!data) return;
|
||||
setContext((draftCtx) => {
|
||||
if (settings.devicePixelRatio === 0) {
|
||||
draftCtx.devicePixelRatio = (typeof globalThis !== 'undefined' ? globalThis : window).devicePixelRatio;
|
||||
draftCtx.devicePixelRatio = (
|
||||
typeof globalThis !== "undefined" ? globalThis : window
|
||||
).devicePixelRatio;
|
||||
}
|
||||
updateContextWithSheetData(draftCtx, data);
|
||||
updateContextWithCanvas(
|
||||
|
Loading…
Reference in New Issue
Block a user