<%_ if (position === 'import') { _%>
<%_ } _%>
<%_ if (position === 'field') { _%>
  @Ref('itemListComponent') readonly itemListComponent: any;
<%_ } _%>

<%_ if (position === 'method') { _%>

  public save(): void {
    const that = this;
    this.updateForm
      .getData()
      .then(values => {
        Object.assign(that.commonCondition, values);
        this.isSaving = true;
        this.itemListComponent.saveAll();
        if (that.commonCondition.id) {
          this.commonConditionService()
            .update(that.commonCondition)
            .then(param => {
              that.isSaving = false;
              const message = this.$t('<%= frontendAppName%>.commonQueryCommonQuery.updated', { param: param.id }).toString();
              this.$message.info(message);
              this.$router.go(-1);
            });
        } else {
          this.commonConditionService()
            .create(that.commonCondition)
            .then(param => {
              that.isSaving = false;
              const message = this.$t('<%= frontendAppName%>.commonQueryCommonQuery.created', { param: param.id }).toString();
              this.$message.success(message);
              this.$router.go(-1);
            });
        }
      })
      .catch(error => {
        this.$message.error('数据获取失败！');
        console.log(error);
      });
  }
<%_ } _%>

<%_ if (position === 'vue') { _%>
<%_ } _%>
