licailing пре 3 година
родитељ
комит
66d74fb1bc

+ 0 - 1
src/main/java/com/izouma/nineth/domain/CompanyCollection.java

@@ -5,7 +5,6 @@ import com.izouma.nineth.converter.FileObjectConverter;
 import com.izouma.nineth.converter.FileObjectListConverter;
 import com.izouma.nineth.converter.PrivilegeListConverter;
 import com.izouma.nineth.converter.PropertyListConverter;
-import com.izouma.nineth.enums.AuthStatus;
 import com.izouma.nineth.enums.CollectionStatus;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;

+ 1 - 1
src/main/java/com/izouma/nineth/domain/Showroom.java

@@ -61,7 +61,7 @@ public class Showroom extends BaseEntity {
     @ApiModelProperty("拒绝理由")
     private String reason;
 
-    @Column(columnDefinition = "bit default false")
+    @Column(columnDefinition = "tinyint unsigned")
     private int sort;
 
     private Long settingId;

+ 9 - 2
src/main/vue/src/components/ModelUpload.vue

@@ -10,8 +10,9 @@
         :on-preview="onPreview"
         :accept="accept || '*/*'"
         ref="upload"
+        :disabled="isDisabled"
     >
-        <el-button type="primary" size="mini" slot="trigger"> 点击上传 </el-button>
+        <el-button type="primary" size="mini" slot="trigger" :disabled="isDisabled"> 点击上传 </el-button>
         <div class="file-list-item" slot="file" slot-scope="{ file }">
             <div class="file-name">
                 <i class="status-icon el-icon-warning-outline danger" v-if="file.status === 'fail'"></i>
@@ -65,7 +66,13 @@ export default {
             default: 'string'
         },
         customUrl: {},
-        accept: {}
+        accept: {},
+        isDisabled: {
+            type: Boolean,
+            default() {
+                return false;
+            }
+        }
     },
     data() {
         return {

+ 4 - 2
src/main/vue/src/views/CompanyCollFailList.vue

@@ -30,6 +30,7 @@
             >
                 <el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
             </el-input>
+            <el-input class="filter-item" placeholder="搜索企业ID" v-model="userId" @keyup.enter.native="getData"></el-input>
         </div>
         <el-table
             :data="tableData"
@@ -137,7 +138,8 @@ export default {
             denyRules: {
                 reason: [{ required: true, message: '请填写理由' }]
             },
-            showReasonDialog: false
+            showReasonDialog: false,
+            userId: ''
         };
     },
     computed: {
@@ -161,7 +163,7 @@ export default {
             return '';
         },
         beforeGetData() {
-            return { search: this.search, query: { del: false, status: 'FAIL' } };
+            return { search: this.search, query: { del: false, status: 'FAIL', userId: this.userId } };
         },
         toggleMultipleMode(multipleMode) {
             this.multipleMode = multipleMode;

+ 42 - 9
src/main/vue/src/views/CompanyCollectionList.vue

@@ -22,7 +22,7 @@
         </page-title>
         <div class="filters-container">
             <el-input
-                placeholder="搜索..."
+                placeholder="搜索名称..."
                 v-model="search"
                 clearable
                 class="filter-item search"
@@ -30,6 +30,12 @@
             >
                 <el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
             </el-input>
+            <el-input
+                class="filter-item"
+                placeholder="搜索企业ID"
+                v-model="userId"
+                @keyup.enter.native="getData"
+            ></el-input>
         </div>
         <el-table
             :data="tableData"
@@ -74,10 +80,24 @@
                 <template slot-scope="{ row }">
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>查看</el-button>
                     <!-- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button> -->
-                    <el-button @click="pass(row)" type="success" size="mini" plain v-if="row.status === 'PENDING'">
+                    <el-button
+                        @click="pass(row)"
+                        type="success"
+                        size="mini"
+                        plain
+                        v-if="row.status === 'PENDING'"
+                        :loading="row.saving"
+                    >
                         通过
                     </el-button>
-                    <el-button @click="deny(row)" type="danger" size="mini" plain v-if="row.status === 'PENDING'">
+                    <el-button
+                        @click="deny(row)"
+                        type="danger"
+                        size="mini"
+                        plain
+                        v-if="row.status === 'PENDING'"
+                        :loading="row.saving"
+                    >
                         拒绝
                     </el-button>
                 </template>
@@ -145,7 +165,8 @@ export default {
             denyRules: {
                 reason: [{ required: true, message: '请填写理由' }]
             },
-            showReasonDialog: false
+            showReasonDialog: false,
+            userId: ''
         };
     },
     computed: {
@@ -169,7 +190,7 @@ export default {
             return '';
         },
         beforeGetData() {
-            return { search: this.search, query: { del: false, status: 'PENDING' } };
+            return { search: this.search, query: { del: false, status: 'PENDING', userId: this.userId } };
         },
         toggleMultipleMode(multipleMode) {
             this.multipleMode = multipleMode;
@@ -242,31 +263,43 @@ export default {
                 });
         },
         pass(row) {
+            this.$set(row, 'saving', true);
             this.$confirm('确定通过?')
                 .then(res => {
                     return this.$http.post('/companyCollection/pass', { id: row.id });
                 })
                 .then(res => {
                     this.$message.success('成功');
+                    this.$set(row, 'saving', false);
                     this.getData();
                 })
-                .catch(e => {});
+                .catch(e => {
+                    this.$set(row, 'saving', false);
+                });
         },
-        deny(row) {
+        deny(row, index) {
             this.showReasonDialog = true;
             this.denyForm.id = row.id;
+            this.denyForm.index = index;
         },
         saveReason() {
+            this.tableData[this.denyForm.index].saving = true;
             this.$confirm('确定拒绝?')
                 .then(res => {
-                    return this.$http.post('/companyCollection/deny', { id: this.denyForm.id, reason: this.denyForm.reason });
+                    return this.$http.post('/companyCollection/deny', {
+                        id: this.denyForm.id,
+                        reason: this.denyForm.reason
+                    });
                 })
                 .then(res => {
                     this.$message.success('成功');
                     this.showReasonDialog = false;
+                    this.tableData[this.denyForm.index].saving = false;
                     this.getData();
                 })
-                .catch(e => {});
+                .catch(e => {
+                    this.tableData[this.denyForm.index].saving = false;
+                });
         }
     }
 };

+ 4 - 6
src/main/vue/src/views/CompanyList.vue

@@ -4,9 +4,9 @@
             <el-button @click="addRow" type="primary" icon="el-icon-plus" :loading="downloading" class="filter-item">
                 新增
             </el-button>
-            <el-button @click="download" icon="el-icon-upload2" :loading="downloading" class="filter-item">
+            <!-- <el-button @click="download" icon="el-icon-upload2" :loading="downloading" class="filter-item">
                 导出
-            </el-button>
+            </el-button> -->
         </page-title>
         <div class="filters-container">
             <el-input placeholder="搜索..." v-model="search" clearable class="filter-item search">
@@ -174,7 +174,7 @@ export default {
                 type: 'warning'
             })
                 .then(() => {
-                    this.$http.post('/showroom/create', { userId: row.id });
+                    return this.$http.post('/showroom/create', { userId: row.id });
                 })
                 .then(() => {
                     this.saving = false;
@@ -184,9 +184,7 @@ export default {
                 .catch(e => {
                     console.log(e);
                     this.saving = false;
-                    if (e === 'cancel') {
-                        this.$message.error('已取消发布');
-                    } else {
+                    if (e !== 'cancel') {
                         this.$message.error(e.error);
                     }
                 });

+ 21 - 10
src/main/vue/src/views/ShowroomEdit.vue

@@ -11,7 +11,7 @@
                     :model="formData"
                     :rules="rules"
                     ref="form"
-                    label-width="125px"
+                    label-width="110px"
                     label-position="right"
                     size="small"
                     style="max-width: 750px"
@@ -25,7 +25,16 @@
                             disabled
                         ></el-input>
                     </el-form-item>
-
+                    <el-form-item prop="sort" label="排序" v-if="formData.status == 'SUCCESS'">
+                        <el-input-number v-model="formData.sort" :min="0"></el-input-number>
+                        <div class="tip">数字越大排序越靠前,相同数值按创建时间倒序排列</div>
+                    </el-form-item>
+                    <el-form-item prop="maxCollection" label="最多藏品数量">
+                        <el-input-number
+                            type="number"
+                            v-model="formData.maxCollection"
+                        ></el-input-number>
+                    </el-form-item>
                     <el-form-item prop="userId" label="用户ID">
                         <el-input-number
                             type="number"
@@ -37,14 +46,6 @@
                     <el-form-item prop="nickname" label="昵称">
                         <el-input v-model="formData.nickname" style="width: 280px" disabled></el-input>
                     </el-form-item>
-                    <el-form-item prop="maxCollection" label="最多可放藏品数量">
-                        <el-input-number
-                            type="number"
-                            v-model="formData.maxCollection"
-                            style="width: 280px"
-                            disabled
-                        ></el-input-number>
-                    </el-form-item>
                     <el-form-item prop="pic" label="logo">
                         <single-upload v-model="formData.pic" :disabled="true"></single-upload>
                     </el-form-item>
@@ -187,4 +188,14 @@ export default {
 /deep/.el-textarea.is-disabled .el-textarea__inner {
     color: #7c7e7e;
 }
+.inline-wrapper {
+    .el-form-item {
+        display: inline-block;
+    }
+}
+.tip {
+    font-size: 12px;
+    color: @text3;
+    margin-top: 5px;
+}
 </style>

+ 40 - 8
src/main/vue/src/views/ShowroomList.vue

@@ -91,13 +91,27 @@
             </el-table-column> -->
             <el-table-column prop="status" label="状态" :formatter="statusFormatter"> </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" width="210">
-                <template slot-scope="{ row }">
+                <template slot-scope="{ row, $index }">
                     <el-button @click="editRow(row)" type="primary" size="mini" plain>查看</el-button>
                     <!-- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button> -->
-                    <el-button @click="pass(row)" type="success" size="mini" plain v-if="row.status === 'PENDING'">
+                    <el-button
+                        @click="pass(row, $index)"
+                        type="success"
+                        size="mini"
+                        plain
+                        v-if="row.status === 'PENDING'"
+                        :loading="row.saving"
+                    >
                         通过
                     </el-button>
-                    <el-button @click="deny(row)" type="danger" size="mini" plain v-if="row.status === 'PENDING'">
+                    <el-button
+                        @click="deny(row, $index)"
+                        type="danger"
+                        size="mini"
+                        plain
+                        v-if="row.status === 'PENDING'"
+                        :loading="row.saving"
+                    >
                         拒绝
                     </el-button>
                 </template>
@@ -162,7 +176,8 @@ export default {
             denyRules: {
                 reason: [{ required: true, message: '请填写理由' }]
             },
-            status: 'PENDING'
+            status: 'PENDING',
+            saving: false
         };
     },
     computed: {
@@ -171,6 +186,14 @@ export default {
         }
     },
     methods: {
+        afterGetData(res) {
+            this.tableData = res.content.map(item => {
+                return {
+                    ...item,
+                    saving: false
+                };
+            });
+        },
         statusFormatter(row, column, cellValue, index) {
             let selectedOption = this.statusOptions.find(i => i.value === cellValue);
             if (selectedOption) {
@@ -251,22 +274,28 @@ export default {
                     }
                 });
         },
-        pass(row) {
+        pass(row, index) {
+            this.tableData[index].saving = true;
             this.$confirm('确定通过?')
                 .then(res => {
                     return this.$http.post('/showroom/pass', { id: row.id });
                 })
                 .then(res => {
                     this.$message.success('成功');
+                    this.tableData[index].saving = false;
                     this.getData();
                 })
-                .catch(e => {});
+                .catch(e => {
+                    this.tableData[index].saving = false;
+                });
         },
-        deny(row) {
+        deny(row, index) {
             this.showReasonDialog = true;
             this.denyForm.id = row.id;
+            this.denyForm.index = index;
         },
         saveReason() {
+            this.tableData[this.denyForm.index].saving = true;
             this.$confirm('确定拒绝?')
                 .then(res => {
                     return this.$http.post('/showroom/deny', {
@@ -277,9 +306,12 @@ export default {
                 .then(res => {
                     this.$message.success('成功');
                     this.showReasonDialog = false;
+                    this.tableData[this.denyForm.index].saving = false;
                     this.getData();
                 })
-                .catch(e => {});
+                .catch(e => {
+                    this.tableData[this.denyForm.index].saving = false;
+                });
         }
     }
 };

+ 1 - 0
src/main/vue/src/views/company/CompanyCollectionShelf.vue

@@ -45,6 +45,7 @@
                             accept="application/zip"
                             format="json"
                             single
+                            :isDisabled="true"
                         ></model-upload>
                         <div class="tip">请将FBX文件与贴图打包成zip压缩包上传</div>
                     </el-form-item>

+ 7 - 5
src/main/vue/src/views/company/CompanyRoomEdit.vue

@@ -61,7 +61,7 @@
                             ></el-option>
                         </el-select>
                     </el-form-item>
-                    <el-form-item prop="headBg" label="背景">
+                    <el-form-item prop="headBg" label="背景" v-if="formData.settingId">
                         <el-image :src="formData.headBg" style="height: 170px"></el-image>
                         <el-image :src="formData.showroomBg" style="height: 170px"></el-image>
                     </el-form-item>
@@ -85,10 +85,10 @@
                         </el-table>
                         <el-button @click="addCollection" size="mini">添加</el-button>
                     </el-form-item>
-                    <el-form-item prop="publish" label="发布" v-if="formData.status == 'SUCCESS'">
+                    <!-- <el-form-item prop="publish" label="发布" v-if="formData.status == 'SUCCESS'">
                         <el-radio v-model="formData.publish" :label="true">是</el-radio>
                         <el-radio v-model="formData.publish" :label="false">否</el-radio>
-                    </el-form-item>
+                    </el-form-item> -->
 
                     <el-form-item class="form-submit">
                         <el-button @click="onSave" :loading="saving" type="primary"> 保存 </el-button>
@@ -262,13 +262,15 @@ export default {
                             this.formData.collections.push({
                                 showroomId: this.formData.id,
                                 collectionId: data.id,
-                                pic: data.pic[0].thumb
+                                pic: data.pic[0].thumb,
+                                name: data.name
                             });
                         } else {
                             this.formData.collections.push({
                                 showroomId: this.formData.id,
                                 collectionId: data.id,
-                                pic: data.pic[0].url
+                                pic: data.pic[0].url,
+                                name: data.name
                             });
                         }
                         this.showCollectionDialog = false;