Shannon_mu 2 rokov pred
rodič
commit
da2c98939f

+ 16 - 1
commandCenter/src/views/commandDispatch/index.vue

@@ -4,7 +4,7 @@
             class="img-content"
             :class="{ mouseStyle: openCur == 1 }"
             ref="divImg"
-            :style="`backgroundImage:url(${imgUrl});backgroundSize: 100% 100%;`"
+            :style="`backgroundImage:url(${modelPictureUrl});backgroundSize: 100% 100%;`"
             @click="openCur == 1 ? paintingPoint($event) : null"
         ></div>
         <div class="point" :style="`left:${item.xcoordinate}%;top:${item.ycoordinate}%`" v-for="(item, index) in points" :key="index">
@@ -60,6 +60,7 @@ export default {
             showChart: true,
             loadding: true,
             openCur: null,
+            modelPictureUrl: '',
             deviceArr: [
                 {
                     type: 1,
@@ -119,6 +120,7 @@ export default {
             try {
                 this.mixins_query.communityId = val;
                 this.getData();
+                this.getImg();
             } catch {}
         }
     },
@@ -232,11 +234,24 @@ export default {
                     loading.close();
                 })
                 .catch(() => {});
+        },
+        getImg() {
+            this.$http
+                .get('/sc-community/assets/community/find/' + this.mixins_query.communityId)
+                .then(({ status, data, msg }) => {
+                    if (status == 0 && !!data) {
+                        this.modelPictureUrl = data.modelPictureUrl;
+                    } else {
+                        this.$message.error(msg);
+                    }
+                })
+                .catch(() => {});
         }
     },
 
     created() {
         if (!!this.mixins_query.communityId) {
+            this.getImg();
             this.getData();
         }
     }

+ 44 - 0
operationSupport/src/views/communityManagement/pageJump/AddOrEdit.vue

@@ -82,6 +82,31 @@
                         </el-upload>
                     </div>
                 </el-form-item>
+
+                <el-form-item label="社区模型">
+                    <el-radio v-model="ruleForm.model" :label="1">3D图</el-radio>
+                    <el-radio v-model="ruleForm.model" :label="2">数字孪生</el-radio>
+                    <div class="clickUpload">
+                        <div class="clickUpText">
+                            <img class="dataImg" v-if="!!ruleForm.modelPictureUrl" :src="ruleForm.modelPictureUrl" />
+                            <template v-else>
+                                <div class="addImg"><i class="el-icon-plus"></i></div>
+                            </template>
+                        </div>
+                        <el-upload
+                            v-if="!islooks"
+                            :headers="token"
+                            ref="uploadPic"
+                            limit="1"
+                            action="/sc-community/upload/uploadFile"
+                            :on-success="uploadsuccess2"
+                            :before-upload="beforeAvatarUpload2"
+                            :auto-upload="true"
+                            name="file"
+                        >
+                        </el-upload>
+                    </div>
+                </el-form-item>
             </div>
             <div class="formContent-item">
                 <div class="formContent-item_title">负责人</div>
@@ -145,6 +170,8 @@ export default {
                 parkingArea: '', //车位面积
                 phone: '', //负责人手机号
                 pictureUrl: '', //社区图片
+                modelPictureUrl: '',
+                model: 1,
                 provinceId: '',
                 regionId: '', //所在地区
                 remarks: '', //备注
@@ -230,7 +257,24 @@ export default {
                 }
             });
         },
+        uploadsuccess2(response) {
+            this.$refs.uploadPic.clearFiles();
+            if (0 === response.status) {
+                this.ruleForm.modelPictureUrl = response.data;
+            }
+        },
+        beforeAvatarUpload2(file) {
+            const isJPG = file.type == 'image/jpg' || file.type == 'image/png' || 'image/jpeg';
+            const isLt2M = file.size / 1024 / 1024 < 2;
 
+            if (!isJPG) {
+                this.$message.error('上传图片只能是 JPG PNG JPEG格式!');
+            }
+            // if (!isLt2M) {
+            //     this.$message.error('上传头像图片大小不能超过 2MB!');
+            // }
+            return isJPG;
+        },
         uploadsuccess(response, file, fileList) {
             this.$refs.uploaduserlogo.clearFiles();
             if (0 === response.status) {