|
|
@@ -305,14 +305,17 @@
|
|
|
// 获取动态表头
|
|
|
getFieldModel() {
|
|
|
storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
|
|
|
- let newRes = res.map((m) => {
|
|
|
- return {
|
|
|
- prop: 'extField.' + m.prop,
|
|
|
- label: m.label,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- };
|
|
|
- });
|
|
|
+ let newRes = (Array.isArray(res) ? res : [])
|
|
|
+ .filter((m) => m && m.prop)
|
|
|
+ .map((m) => {
|
|
|
+ return {
|
|
|
+ prop: 'extField.' + m.prop,
|
|
|
+ columnKey: 'extField.' + m.prop,
|
|
|
+ label: m.label,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ };
|
|
|
+ });
|
|
|
this.newColumns = [...newRes];
|
|
|
});
|
|
|
},
|
|
|
@@ -322,7 +325,9 @@
|
|
|
/* 刷新表格 */
|
|
|
reload(where) {
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.multipleTable.reload({ page: 1, where });
|
|
|
+ if (this.$refs.multipleTable) {
|
|
|
+ this.$refs.multipleTable.reload({ page: 1, where: where || {} });
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
onConfirm() {
|
|
|
@@ -352,6 +357,9 @@
|
|
|
// this.multipleSelection = val;
|
|
|
// },
|
|
|
handleNodeClick(data) {
|
|
|
+ if (!data || !data.id) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
console.log('-----------------');
|
|
|
console.log(data);
|
|
|
this.classificationId = data.id;
|