|
|
@@ -16,14 +16,20 @@
|
|
|
size="small"
|
|
|
style="max-width: 500px"
|
|
|
>
|
|
|
+ <el-form-item label="项目" prop="projectId">
|
|
|
+ <el-select v-model="formData.projectId" @change="changeProject" :disabled="!canEdit">
|
|
|
+ <el-option :value="0" label="第九空间"></el-option>
|
|
|
+ <el-option :value="1" label="cosmos art"></el-option>
|
|
|
+ <!-- <el-option :value="2" label="modern point"></el-option> -->
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item prop="name" label="活动名称">
|
|
|
- <el-input v-model="formData.name"></el-input>
|
|
|
+ <el-input v-model="formData.name" :disabled="!canEdit"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="pic" label="图片">
|
|
|
<single-upload v-model="formData.pic"></single-upload>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="collectionId" label="兑换藏品">
|
|
|
- <!-- <collection-search v-model="formData.collectionId" style="width: 300px"></collection-search> -->
|
|
|
<el-select
|
|
|
v-model="formData.collectionId"
|
|
|
filterable
|
|
|
@@ -45,19 +51,20 @@
|
|
|
<el-input-number type="number" v-model="formData.total" :disabled="!canEdit"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="awardCollectionId" label="获得藏品">
|
|
|
- <!-- <collection-search
|
|
|
- v-model="formData.awardCollectionId"
|
|
|
- style="width: 300px"
|
|
|
- ></collection-search> -->
|
|
|
<el-select
|
|
|
v-model="formData.awardCollectionId"
|
|
|
filterable
|
|
|
- :filter-method="filterCollection"
|
|
|
+ :filter-method="filterCollection1"
|
|
|
style="width: 100%"
|
|
|
@change="changAwardCollection"
|
|
|
:disabled="!canEdit"
|
|
|
>
|
|
|
- <el-option v-for="item in filterOptions" :label="item.name" :value="item.id" :key="item.id">
|
|
|
+ <el-option
|
|
|
+ v-for="item in filterOptions1"
|
|
|
+ :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>
|
|
|
@@ -101,13 +108,17 @@ export default {
|
|
|
{ body: 'json' }
|
|
|
)
|
|
|
.then(res => {
|
|
|
- this.filterOptions = this.options = res.content;
|
|
|
+ this.options = res.content;
|
|
|
+ this.filterOptions = this.options.filter(i => i.projectId == this.$store.state.projectId);
|
|
|
+ this.filterOptions1 = this.options.filter(i => i.projectId == this.$store.state.projectId);
|
|
|
});
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
saving: false,
|
|
|
- formData: {},
|
|
|
+ formData: {
|
|
|
+ projectId: this.$store.state.projectId
|
|
|
+ },
|
|
|
rules: {
|
|
|
name: [
|
|
|
{
|
|
|
@@ -153,7 +164,8 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
options: [],
|
|
|
- filterOptions: []
|
|
|
+ filterOptions: [],
|
|
|
+ filterOptions1: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -163,7 +175,18 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
filterCollection(val) {
|
|
|
- this.filterOptions = this.options.filter(i => i.name.includes(val) || i.id == val);
|
|
|
+ this.filterOptions = this.options.filter(
|
|
|
+ i => i.projectId == this.formData.projectId && (i => i.name.includes(val) || i.id == val)
|
|
|
+ );
|
|
|
+ },
|
|
|
+ filterCollection1(val) {
|
|
|
+ this.filterOptions1 = this.options.filter(
|
|
|
+ i => i.projectId == this.formData.projectId && (i.name.includes(val) || i.id == val)
|
|
|
+ );
|
|
|
+ },
|
|
|
+ changeProject(val) {
|
|
|
+ this.filterOptions = this.options.filter(i => i.projectId == val);
|
|
|
+ this.filterOptions1 = this.options.filter(i => i.projectId == val);
|
|
|
},
|
|
|
onSave() {
|
|
|
this.$refs.form.validate(valid => {
|