瀏覽代碼

修复字段问题

Shannon_mu 3 年之前
父節點
當前提交
a2a80a59ad

+ 28 - 69
operationSupport/src/components/Tinymce/index.vue

@@ -66,7 +66,8 @@ export default {
                 zh: 'zh_CN',
                 es: 'es_MX',
                 ja: 'ja'
-            }
+            },
+            thisImg: ''
         };
     },
     computed: {
@@ -122,33 +123,45 @@ export default {
             });
         },
         onPaste(event) {
+            const items = (event.clipboardData || window.clipboardData).items;
+            if (items[0].type.indexOf('image') !== -1) {
+                const file = items[0].getAsFile();
+                const formData = new FormData();
+                formData.append('file', file);
+                // 上传图片
+                this.$http.post('/sc-community/upload/uploadFile', formData).then((res) => {
+                    if (res.status == 0) {
+                        let content = window.tinymce.get(this.tinymceId).getContent();
+                        let newContent = content.replace(/<img *src="data.*?\/>/g, `<img src='${res.data}' />`);
+                        window.tinymce.get(this.tinymceId).setContent(newContent);
+                        resolve && resolve();
+                    } else {
+                        this.$message.error(res.msg);
+                    }
+                });
+            } else {
+                this.$message({type:'warning',message:'只能复制纯文本或图片',duration:3000});
+            }
+
+            return;
             new Promise((resolve) => {
                 const items = (event.clipboardData || window.clipboardData).items;
                 if (items[0].type.indexOf('image') !== -1) {
-                    console.log('粘贴的是图片类型');
                     const file = items[0].getAsFile();
                     const formData = new FormData();
                     formData.append('file', file);
-                    console.log('formData======', formData);
                     // 上传图片
-                    this.$http.post('/sc-community-web/upload/uploadFile', formData).then((res) => {
-                        console.log('onPaste', res);
+                    this.$http.post('/sc-community/upload/uploadFile', formData).then((res) => {
                         if (res.status === 0) {
-                            // 放到内容当中
                             let img = `<img class="wscnph" src="${res.data}" />`;
-                            // let img = `<div class="wscnph" id="${res.data}" >[图片]</div>`;
                             window.tinymce.get(this.tinymceId).insertContent(img);
-                            // window.tinymce.get(this.tinymceId).insertContent(`<img class="wscnph" src="${res.data}" />`);
-                            // let content = window.tinymce.get(this.tinymceId).getContent();
-                            // let newContent = content.replace(/<img \s*class="wscnph"\s*src="[\s\S]*"\/>/g, '2');
-                            // window.tinymce.get(this.tinymceId).setContent(newContent);
                             resolve && resolve();
                         } else {
                             this.$message.error(res.msg);
                         }
                     });
                 } else {
-                    console.log('粘贴的不是图片,不能上传');
+                    this.$message.error('只能复制文字图片,样式无法复制请手动排版');
                 }
             }).then(() => {
                 let content = window.tinymce.get(this.tinymceId).getContent();
@@ -172,13 +185,13 @@ export default {
                 toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
                 menubar: false,
                 plugins: plugins,
+                //只保留img标签
+                valid_elements: 'img[src]',
+                extended_valid_elements: 'img[src]',
                 end_container_on_empty_block: true,
                 powerpaste_word_import: 'clean',
                 code_dialog_height: 450,
                 code_dialog_width: '100%',
-                // advlist_bullet_styles: 'square',
-                // advlist_number_styles: 'default',
-                // imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
                 default_link_target: '_blank',
                 link_title: false,
                 init_instance_callback: (editor) => {
@@ -193,7 +206,6 @@ export default {
                         this.$emit('input', editor.getContent());
                     });
                     editor.on('paste', (evt) => {
-                        console.log('粘贴paste');
                         // 监听粘贴事件
                         this.onPaste(evt);
                     });
@@ -203,62 +215,9 @@ export default {
                         _this.fullscreen = e.state;
                     });
                 },
-                // it will try to keep these URLs intact
-                // https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/
-                // https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions
                 convert_urls: false,
                 paste_data_images: false // 粘贴的同时能把内容里的图片自动上传
-                // 整合七牛上传
-                // images_dataimg_filter(img) {
-                //     setTimeout(() => {
-                //         const $image = $(img);
-                //         $image.removeAttr('width');
-                //         $image.removeAttr('height');
-                //         if ($image[0].height && $image[0].width) {
-                //             $image.attr('data-wscntype', 'image');
-                //             $image.attr('data-wscnh', $image[0].height);
-                //             $image.attr('data-wscnw', $image[0].width);
-                //             $image.addClass('wscnph');
-                //         }
-                //     }, 0);
-                //     console.log(' images_dataimg_filter', img);
-                //     return img;
-                // }
                 // images_upload_handler(blobInfo, success, failure, progress) {
-                //     // progress(0);
-                //     // console.log('images_upload_handler========', blobInfo, success, failure, progress);
-                //     // const formData = new FormData();
-                //     // formData = formData.append('file', blobInfo.blob(), blobInfo.filename());
-                //     // this.$http
-                //     //     .post('/sc-community-web/upload/uploadFile', formData)
-                //     //     .then((res) => {
-                //     //         success(url);
-                //     //         progress(100);
-                //     //         console.log('====================================');
-                //     //         console.log('res', res);
-                //     //         console.log('====================================');
-                //     //     })
-                //     //     .catch((err) => {
-                //     //         failure('出现未知问题,刷新页面,或者联系程序员');
-                //     //         console.log(err);
-                //     //     });
-                //     // const token = _this.$store.getters.token;
-                //     // getToken(token)
-                //     //     .then((response) => {
-                //     //         const url = '/sc-community-web/upload/uploadFile';
-                //     //         const formData = new FormData();
-                //     //         formData.append('token', response.data.qiniu_token);
-                //     //         formData.append('key', response.data.qiniu_key);
-                //     //         formData.append('file', blobInfo.blob(), url);
-                //     //         upload(formData).then(() => {
-                //     //             success(url);
-                //     //             progress(100);
-                //     //         });
-                //     //     })
-                //     //     .catch((err) => {
-                //     //         failure('出现未知问题,刷新页面,或者联系程序员');
-                //     //         console.log(err);
-                //     //     });
                 // }
             });
         },

+ 22 - 22
operationSupport/src/views/assetManagement/housingManagement/saveEdits.vue

@@ -25,10 +25,13 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item label="房屋号" prop="roomNumber">
-                        <el-input v-model="ruleForm.roomNumber"></el-input>
+                        <el-input v-model="ruleForm.roomNumber" placeholder="请输入房屋号"></el-input>
+                    </el-form-item>
+                    <el-form-item label="房屋编号">
+                        <el-input v-model="ruleForm.assetNumber" placeholder="请输入房屋编号"></el-input>
                     </el-form-item>
                     <el-form-item label="使用面积">
-                        <el-input v-model="ruleForm.useArea"></el-input>
+                        <el-input v-model="ruleForm.useArea" placeholder="请输入使用面积"></el-input>
                     </el-form-item>
                     <el-form-item label="房屋朝向">
                         <el-select v-model="ruleForm.orientationOfRoom" placeholder="请选择房屋朝向" class="width100">
@@ -43,9 +46,10 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item label="房屋户型">
-                        <el-input v-model="housingType.roomNumber" style="width: 80px; margin-right: 10px"></el-input>室
-                        <el-input v-model="housingType.officeNumber" style="width: 80px; margin: 0 10px"></el-input>厅
-                        <el-input v-model="housingType.guardNumber" style="width: 80px; margin: 0 10px"></el-input>卫
+                        <el-input v-model="housingType.roomNumber" placeholder="请输入" style="width: 80px; margin-right: 10px"></el-input
+                        >室
+                        <el-input v-model="housingType.officeNumber" placeholder="请输入" style="width: 80px; margin: 0 10px"></el-input>厅
+                        <el-input v-model="housingType.guardNumber" placeholder="请输入" style="width: 80px; margin: 0 10px"></el-input>卫
                     </el-form-item>
                 </div>
                 <div class="formContent-item">
@@ -76,10 +80,10 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item label="建筑面积">
-                        <el-input v-model="ruleForm.buildingArea"></el-input>
+                        <el-input v-model="ruleForm.buildingArea" placeholder="请输入建筑面积"></el-input>
                     </el-form-item>
                     <el-form-item label="公摊面积">
-                        <el-input v-model="ruleForm.publicArea"></el-input>
+                        <el-input v-model="ruleForm.publicArea" placeholder="请输入公摊面积"></el-input>
                     </el-form-item>
                     <el-form-item label="装修性质">
                         <el-select v-model="ruleForm.decorateProperties" placeholder="请选择装修性质" class="width100">
@@ -90,18 +94,19 @@
                             <el-option label="豪华装修" :value="5"></el-option>
                         </el-select>
                     </el-form-item>
-                </div>
-            </div>
-            <el-row>
-                <el-col :span="24">
                     <el-form-item label="备注信息">
-                        <el-input type="textarea" :rows="4" v-model="ruleForm.remarks" maxlength="300"> </el-input>
-                        <span style="position: absolute; bottom: 0; right: 10px" v-if="ruleForm.remarks"
-                            >{{ ruleForm.remarks.length }}/300</span
+                        <el-input
+                            type="textarea"
+                            :rows="4"
+                            placeholder="请输入备注信息"
+                            v-model="ruleForm.remarks"
+                            maxlength="300"
+                            show-word-limit
                         >
+                        </el-input>
                     </el-form-item>
-                </el-col>
-            </el-row>
+                </div>
+            </div>
         </el-form>
         <div style="text-align: right">
             <el-button @click="cancelSaving">取消</el-button>
@@ -137,6 +142,7 @@ export default {
                 unitName: '', //单元
                 floorNumber: '', //单元楼层
                 roomNumber: '', //房屋号
+                assetNumber: '',
                 buildingType: 1, //房屋类型
                 useArea: '', //使用面积
                 buildingArea: '', //建筑面积
@@ -166,22 +172,16 @@ export default {
         'ruleForm.communityId'(newValue, oldValue) {
             if (newValue !== oldValue) {
                 this.buildingNameList();
-                // this.ruleForm.buildingId = '';
-                // this.ruleForm.unitName = '';
-                // this.ruleForm.floorNumber = '';
             }
         },
         'ruleForm.buildingId'(newValue, oldValue) {
             if (newValue !== oldValue) {
                 this.unitNameList();
-                // this.ruleForm.unitName = '';
-                // this.ruleForm.floorNumber = '';
             }
         },
         'ruleForm.unitName'(newValue, oldValue) {
             if (newValue !== oldValue) {
                 this.unitChoice(newValue);
-                // this.ruleForm.floorNumber = '';
             }
         },
         unitList(val) {

+ 1 - 1
operationSupport/src/views/ownerManagement/stepPage/newAdd.vue

@@ -397,7 +397,7 @@ export default {
             ],
             formRules: {
                 name: [this.$valid.selectRequired('填写姓名')],
-                phone: [this.$valid.selectRequired('填写手机号')],
+                phone: [this.$valid.patternPhone('填写手机号')],
                 householdType: [this.$valid.selectRequired('填写类型')]
             },
             communityArr: [],

+ 17 - 14
operationSupport/src/views/propertyManagement/inform.vue

@@ -813,27 +813,30 @@ export default {
                         let arr1 = this.selectDataHouseTreeData.userList;
                         let arr2 = this.selectDataPeopleTreeData.userList;
                         let treeData = [];
+                        const dedupe = (array) => {
+                            return Array.from(new Set(array));
+                        };
                         treeData[0] = JSON.stringify(this.selectDataHouseTreeData.userID);
                         treeData[1] = JSON.stringify(arr2);
                         if (arr1.length > 0) {
-                            for (let index = 0; index < arr1.length; index++) {
-                                let element = arr1[index];
-                                let obj = {};
-                                obj.noticeId = '';
-                                obj.userId = element;
-                                obj.userType = 0;
+                            dedupe(arr1).map((item, index) => {
+                                let obj = {
+                                    noticeId: '',
+                                    userId: item,
+                                    userType: 0
+                                };
                                 userVos.push(obj);
-                            }
+                            });
                         }
                         if (arr2.length > 0) {
-                            for (let index = 0; index < arr2.length; index++) {
-                                let obj = {};
-                                let element = arr2[index];
-                                obj.noticeId = '';
-                                obj.userId = element;
-                                obj.userType = 1;
+                            dedupe(arr2).map((item, index) => {
+                                let obj = {
+                                    noticeId: '',
+                                    userId: item,
+                                    userType: 1
+                                };
                                 userVos.push(obj);
-                            }
+                            });
                         }
 
                         let query = {

+ 2 - 2
operationSupport/src/views/workOrders/popups/details.vue

@@ -97,7 +97,7 @@
                         <div>
                             <i
                                 class="el-icon-star-on"
-                                style="color: #ffca3b; font-size: 26px; margin-right: 10px"
+                                style="color: #ffca3b; font-size: 26px; margin-right: 5px"
                                 v-for="(item, index) in thisItem.evaluation"
                                 :key="index"
                             ></i>
@@ -313,7 +313,7 @@ export default {
 .grate {
     margin-left: 30px;
     .grate-rate {
-        display: flex;
+        display: -webkit-box;
         align-items: center;
         font-size: 12px;
         color: #303133;