Ver código fonte

Merge branch 'developerB' into developer

xiebaomin 2 anos atrás
pai
commit
b848e34214

+ 10 - 0
src/main/resources/static/js/supplier-center/article/article-edit.js

@@ -174,6 +174,13 @@ var articleEdit = new Vue({
             this.onFocused()
             this.onBlured()
         },
+        changeVisible($event) {
+            if ($event) {
+                this.onFocused()
+            } else {
+                this.onBlured()
+            }
+        },
         // 设置表单初始数据
         setFormData: function setFormData(shopArticle) {
             for (var key in this.formData) {
@@ -217,6 +224,8 @@ var articleEdit = new Vue({
             if (this.chooseLabels.indexOf(this.addLabelName) > -1) return this.addLabelName = '';
             this.chooseLabels.push(this.addLabelName);
             this.addLabelName = '';
+            this.onFocused()
+            this.onBlured()
         },
         // 判断标签是否被选
         checkLabel: function checkLabel(index) {
@@ -234,6 +243,7 @@ var articleEdit = new Vue({
         handleImageRemove: function handleImageRemove(response, file, fileList) {
             this.formData.guidanceImage = "";
             this.articleImageList = [];
+            console.log('移除成功')
         },
         // 保存 提交表单
         handleSave: function handleSave() {

+ 4 - 2
src/main/resources/static/js/supplier-center/encyclopedia/components/content-edit/index.js

@@ -76,14 +76,16 @@ const contentEdit = {
         },
         // 失去焦点
         onBlur() {
+            this.$parent.$parent.$parent.onBlured && this.$parent.$parent.$parent.onBlured() // 调用父组件方法
             setTimeout(() => {
-                this.$parent.$parent.$parent.onBlured && this.$parent.$parent.$parent.onBlured() // 调用父组件方法
                 this.isFocus = false
             }, 200)
         },
         onFocus() {
-            this.isFocus = true
             this.$parent.$parent.$parent.onFocused() && this.$parent.$parent.$parent.onFocused() // 调用父组件方法
+            setTimeout(() => {
+                this.isFocus = true
+            }, 300)
         },
         // 工具栏点击
         handleToolBarClick() {

+ 10 - 6
src/main/resources/static/js/supplier-center/encyclopedia/edit.js

@@ -286,14 +286,18 @@ const edit = new Vue({
     },
     methods: {
         onFocused() {
-            this.validTime = null
-            console.log(111)
-            clearTimeout(this.validTime)
+            setTimeout(() => {
+                this.validTime = null
+                console.log(111)
+                clearTimeout(this.validTime)
+            }, 300)
         },
         onBlured() {
-            this.isFocus = true
-            this.validFormRule()
-            console.log(222)
+            setTimeout(() => {
+                this.isFocus = true
+                this.validFormRule()
+                console.log(222)
+            }, 200)
         },
         // 自动保存校验
         validFormRule() {

+ 5 - 3
src/main/resources/templates/supplier-center/article/article-edit.html

@@ -81,6 +81,7 @@
                                         reserve-keyword
                                         :remote-method="fetchQueryKeywordList"
                                         :loading="remoteLoading"
+                                        @visible-change="changeVisible"
                                 >
                                     <el-option v-for="item in labelList" :key="item.id" :label="item.keyword" :value="item.id"></el-option>
                                 </el-select>
@@ -102,13 +103,13 @@
                             </el-form-item>
                             <!-- 文章内容 -->
                             <el-form-item label="文章内容" prop="articleContent" class="mint-filter">
-                                <el-input v-model="formData.articleContent" v-show="false" @focus="onFocused" @blur="onBlured"></el-input>
-                                <editor v-model="formData.articleContent" placeholder="请输入文章内容" @focus="onFocused" @blur="onBlured"></editor>
+                                <el-input v-model="formData.articleContent" v-show="false"></el-input>
+                                <editor v-model="formData.articleContent" placeholder="请输入文章内容" @click.native="onFocused"></editor>
                                 <div class="mint-message" v-if="formValidate.articleContent">{{formValidate.articleContent}}</div>
                             </el-form-item>
                             <!-- 文章分类 -->
                             <el-form-item label="文章分类" prop="typeId">
-                                <el-select v-model="formData.typeId" class="max-width" @change="handlerTypeId">
+                                <el-select v-model="formData.typeId" class="max-width" @change="handlerTypeId" @click.native="onFocused">
                                     <template v-for="(typeInfo, index) in articleTypeList">
                                         <el-option :label="typeInfo.typeName" :value="typeInfo.typeId" :key="typeInfo.typeId"></el-option>
                                     </template>
@@ -125,6 +126,7 @@
                                         :on-remove="handleImageRemove"
                                         :file-list="articleImageList"
                                         :limit="1"
+                                        @click.native="onFocused"
                                 >
                                     <i class="el-icon-plus"></i>
                                     <div slot="tip" class="el-upload__tip">建议图片尺寸210px*210px,并上传白底图片</div>