|
|
@@ -436,6 +436,7 @@ $(document).ready(() => {
|
|
|
if (!curTemplate) {
|
|
|
$('#detail-user-info').html('');
|
|
|
$('#detail-ctrl').hide();
|
|
|
+ detailObj.loadDetail(curTemplate);
|
|
|
} else {
|
|
|
$('#detail-ctrl').hide();
|
|
|
if (!curTemplate.col_set) await this.loadTemplateDetail(curTemplate);
|
|
|
@@ -790,12 +791,12 @@ $(document).ready(() => {
|
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, this.colSetData);
|
|
|
}
|
|
|
reset() {
|
|
|
- this.colSetData = JSON.parse(JSON.stringify(this.template.col_set));
|
|
|
+ this.colSetData = this.template ? JSON.parse(JSON.stringify(this.template.col_set)) : [];
|
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, this.colSetData);
|
|
|
}
|
|
|
loadDetail(template) {
|
|
|
this.template = template;
|
|
|
- this.readOnly = this.template.used_count > 0;
|
|
|
+ this.readOnly = this.template ? this.template.used_count > 0 : true;
|
|
|
if (!this.firstShowDone) {
|
|
|
this.spread.refresh();
|
|
|
this.firstShowDone = true;
|