|
@@ -35,9 +35,9 @@
|
|
|
<el-table-column prop="name" label="名称"></el-table-column>
|
|
<el-table-column prop="name" label="名称"></el-table-column>
|
|
|
<el-table-column width="80" align="center">
|
|
<el-table-column width="80" align="center">
|
|
|
<template v-slot="{ row, $index }">
|
|
<template v-slot="{ row, $index }">
|
|
|
- <el-button type="danger" plain @click="delCollection($index)" size="mini"
|
|
|
|
|
- >删除</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button type="danger" plain @click="delCollection($index)" size="mini">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -64,17 +64,7 @@
|
|
|
<el-dialog title="添加藏品" :visible.sync="showCollectionDialog" width="500px">
|
|
<el-dialog title="添加藏品" :visible.sync="showCollectionDialog" width="500px">
|
|
|
<el-form :model="{ collectionId }" ref="collectionForm" inline>
|
|
<el-form :model="{ collectionId }" ref="collectionForm" inline>
|
|
|
<el-form-item prop="collectionId" :rules="{ required: true, message: '请选择藏品' }">
|
|
<el-form-item prop="collectionId" :rules="{ required: true, message: '请选择藏品' }">
|
|
|
- <el-select v-model="collectionId" filterable :filter-method="filterCollection">
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in collectionOptions"
|
|
|
|
|
- :label="item.name"
|
|
|
|
|
- :value="item.id"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- >
|
|
|
|
|
- <span style="float: left">{{ item.name }}</span>
|
|
|
|
|
- <span style="float: right; color: #8492a6; font-size: 13px">#{{ item.id }}</span>
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <collection-search ref="collectionSearch" v-model="collectionId"> </collection-search>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer">
|
|
<div slot="footer">
|
|
@@ -100,19 +90,6 @@ export default {
|
|
|
this.$message.error(e.error);
|
|
this.$message.error(e.error);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- this.$http
|
|
|
|
|
- .post(
|
|
|
|
|
- '/collection/all',
|
|
|
|
|
- {
|
|
|
|
|
- size: 10000,
|
|
|
|
|
- sort: 'sort,desc;createdAt,desc',
|
|
|
|
|
- query: { del: false, source: 'OFFICIAL' }
|
|
|
|
|
- },
|
|
|
|
|
- { body: 'json' }
|
|
|
|
|
- )
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- this.collectionOptions = res.content;
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -163,7 +140,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
- collectionOptions: [],
|
|
|
|
|
collections: [],
|
|
collections: [],
|
|
|
showCollectionDialog: false,
|
|
showCollectionDialog: false,
|
|
|
collectionId: null
|
|
collectionId: null
|
|
@@ -229,17 +205,13 @@ export default {
|
|
|
.validate()
|
|
.validate()
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
if (!this.collections.find(i => i.id === this.collectionId)) {
|
|
if (!this.collections.find(i => i.id === this.collectionId)) {
|
|
|
- this.collections.push(this.collectionOptions.find(i => i.id === this.collectionId));
|
|
|
|
|
|
|
+ this.collections.push(this.$refs.collectionSearch.selected);
|
|
|
this.showCollectionDialog = false;
|
|
this.showCollectionDialog = false;
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error('请勿重复添加');
|
|
this.$message.error('请勿重复添加');
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
|
- },
|
|
|
|
|
- filterCollection(val) {
|
|
|
|
|
- console.log(val);
|
|
|
|
|
- return this.collectionOptions.filter(i => i.name.includes(val) || i.id == val);
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|