insertUp: {
text: '插入',
visibleContext: 'ClickViewport',
commandName: '插入',
execute: async (context, propertyName, fontItalicChecked) => {
const spread = context.getWorkbook();
spread.suspendPaint();
const sheet = spread.getActiveSheet();
const sels = sheet.getSelections();
const info = sels[0]
if(info.row>=7){
sheet.addRows(info.row + 1, 1);
const materCode = sheet.getCell(info.row,8).value();
if(materCode!==null && materCode!=="" && materCode!==undefined){
sheet.copyTo(
info.row,
0,
info.row+1,
0,
1,
sheet.getColumnCount(),
GC.Spread.Sheets.CopyToOptions.all
);
}else{
sheet.copyTo(
info.row,
0,
info.row+1,
0,
1,
sheet.getColumnCount(),
GC.Spread.Sheets.CopyToOptions.formula|GC.Spread.Sheets.CopyToOptions.style
);
}
}
spread.resumePaint();
}
},
|