import { Component } from 'vue-property-decorator';
import { AppGridBase, VueLifeCycleProcessing } from '@ibizstudio-ex/template-vue';

/**
 * 表格默认选中插件类
 *
 * @export
 * @class DefaultSelect
 * @extends {Vue}
 */
@Component({})
@VueLifeCycleProcessing()
export class DefaultSelect extends AppGridBase {
  /**
   * 监听动态参数变化
   *
   * @param {*} newVal
   * @param {*} oldVal
   * @memberof GridControlBase
   */
  onDynamicPropsChange(newVal: any, oldVal: any) {
    super.onDynamicPropsChange(newVal, oldVal);
    if (newVal.viewparams.selectedData) {
      this.selectedData = JSON.stringify(newVal.viewparams.selectedData);
      this.onSelectedDataValueChange(newVal.selectedData);
    }
  }
}
