87,922
社区成员
发帖
与我相关
我的任务
分享
//表单的每项置空
public Reset() {
for (let key in this.currentRow) {
this.currentRow[key]='';
}
}
currentRow: any = null;//行对象(从页面传来)
rowTemp: any = null;//行对象(中间变量,用于在编辑和添加来回反复切时)
currentRow: string='';//下拉框 默认值
public EditOrAddWindow(currentRow: any, wTitle: string, cName: string, conNameList: any) {
this.winTitle = wTitle;//窗体标题
this.conName = cName;//下拉默认值
this.currentRow = currentRow;
this.conNames = conNameList;//下拉 list
if (wTitle == '添加') {
if (this.currentRow.Id != ""){ //currentRow有数据时才赋给rowTemp
this.rowTemp = JSON.parse(JSON.stringify(this.currentRow));
}
this.Reset();
} else if (wTitle == '编辑' && this.currentRow.Id == "") {//编辑窗体 且 currentRow无内容时
this.currentRow = JSON.parse(JSON.stringify(this.rowTemp));
}
}
//表单的每项置空
public Reset() {
this.currentRow.Id="";//表PK 用它来判断currentRow是否为空
this.currentRow.DictName = "";
this.currentRow.DictAge = "";
this.currentRow.Title = "";
}