licailing 3 лет назад
Родитель
Сommit
8a5ccd898e

+ 2 - 0
src/main/java/com/izouma/nineth/domain/ActivityCollection.java

@@ -46,4 +46,6 @@ public class ActivityCollection extends BaseEntity {
 
     @ApiModelProperty("领取藏品名称")
     private String awardCollectionName;
+
+    private int projectId;
 }

+ 1 - 1
src/main/vue/.env.development

@@ -1 +1 @@
-VUE_APP_BASE_URL=https://nfttest.9space.vip/
+VUE_APP_BASE_URL=http://localhost:8080/

+ 35 - 12
src/main/vue/src/views/ActivityCollectionEdit.vue

@@ -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 => {

+ 1 - 1
src/main/vue/src/views/ActivityCollectionList.vue

@@ -114,7 +114,7 @@ export default {
     },
     methods: {
         beforeGetData() {
-            return { search: this.search, query: { del: false } };
+            return { search: this.search, query: { del: false, projectId: this.$store.state.projectId } };
         },
         toggleMultipleMode(multipleMode) {
             this.multipleMode = multipleMode;