|
|
@@ -134,14 +134,16 @@ export const indexMixin = {
|
|
|
if (isMustChooseFlag && name.indexOf('add') < 0 && name !== 'search' && name !== 'clear') {
|
|
|
// 新建不用校验
|
|
|
if (!chooseKeys || chooseKeys.length === 0) {
|
|
|
- // 查看当前行是否有数据
|
|
|
- let rows = this.$refs[tableRef].getCurrentRow();
|
|
|
- if (!rows) {
|
|
|
- this.$Message.warning(this.$t('W_013'))
|
|
|
- return;
|
|
|
- } else {
|
|
|
- chooseKeys = [rows[this.$refs[tableRef]._props.primaryKey]]
|
|
|
- chooseRows = [rows];
|
|
|
+ if(this.$refs[tableRef]){
|
|
|
+ // 查看当前行是否有数据
|
|
|
+ let rows = this.$refs[tableRef].getCurrentRow();
|
|
|
+ if (!rows) {
|
|
|
+ this.$Message.warning(this.$t('W_013'))
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ chooseKeys = [rows[this.$refs[tableRef]._props.primaryKey]]
|
|
|
+ chooseRows = [rows];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|