guoxiaohuan 4 年 前
コミット
d35e49cf2b

+ 2 - 0
src/components/Legend/src/legend.vue

@@ -379,7 +379,9 @@ export default {
                 this.isShow2()
             } else {
                 this.isShow2()
+                this.queryEditNum(this.editSwitch)
             }
+            this.show2 = true
         },
         addFloor() {
             this.isFloor = true

+ 9 - 3
src/components/editLengend.vue

@@ -25,7 +25,12 @@
                             <template slot-scope='{row}'>
                                 <div v-if='row.IsModify'>
                                     <div v-if='row.Num!=row.RealNum ' class='redData'>
-                                        <el-tooltip class='item' effect='dark' :content='`当前图例 ${row.Name} 与平面图中的不一致,平面图中为xx`' placement='top'>
+                                        <el-tooltip
+                                            class='item'
+                                            effect='dark'
+                                            :content='`当前图例 ${row.Name} 与平面图中的不一致,平面图中为${row.RealNum}`'
+                                            placement='top'
+                                        >
                                             <el-input @change='changeTable(row)' v-model='row.Num' size='mini'></el-input>
                                         </el-tooltip>
                                     </div>
@@ -104,7 +109,7 @@
             </div>
             <div class='legendFoot'>
                 <el-button size='mini' @click='cancel'>取消</el-button>
-                <el-button size='mini' v-if='editNum.length<=0' disabled type='primary'>保存</el-button>
+                <el-button size='mini' v-if='editNum.length==0' disabled type='primary'>保存</el-button>
                 <el-button size='mini' v-else @click='save' type='primary'>保存</el-button>
             </div>
         </div>
@@ -155,7 +160,8 @@ export default {
                         type: 'info',
                         message: '已放弃修改'
                     })
-                    this.$emit('saveNum')
+                    this.editNum = []
+                    this.$emit('saveNum', this.editNum)
                 })
         },
         init() {

+ 68 - 1
src/components/legendremarks.vue

@@ -5,7 +5,8 @@
 */
 <template>
     <div class='editModel'>
-        <a-modal v-model='visible' :title='title' @ok='handleOk' ok-text='保存' cancel-text='取消' :maskClosable='false' :width='648'>
+        <a-modal v-model='visible' :title='title' :closable='false' :maskClosable='false' :width='648' :footer='null'>
+            <div class='edit-x' @click='handlCancel'>X</div>
             <div class='edit_container' style='width:600px;height:156px'>
                 <quill-editor
                     v-model='remarksTexts'
@@ -17,6 +18,10 @@
                 ></quill-editor>
                 <p class='p1'>{{valLen||remarksText.length}}/200</p>
             </div>
+            <div class='edit-foot'>
+                <span @click='handlCancel'>取消</span>
+                <span @click='handleOk'>保存</span>
+            </div>
         </a-modal>
     </div>
 </template>
@@ -44,6 +49,28 @@ export default {
         ...mapGetters(['remarksText'])
     },
     methods: {
+        // 点击取消
+        handlCancel() {
+            if (this.remarksTexts != this.remarksText) {
+                this.$confirm('是否保存编辑后的备注?', '提示', {
+                    confirmButtonText: '保存',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                })
+                    .then(() => {
+                        this.handleOk()
+                    })
+                    .catch(() => {
+                        this.$message({
+                            type: 'info',
+                            message: '已取消保存'
+                        })
+                        this.visible = false
+                    })
+            } else {
+                this.visible = false
+            }
+        },
         // val为传过来的备注
         showModal() {
             this.visible = true
@@ -109,6 +136,17 @@ export default {
 }
 </style>
 <style lang="less" scoped>
+.editModel {
+}
+.edit-x {
+    position: absolute;
+    width: 9px;
+    height: 10px;
+    color: #000000;
+    right: 20px;
+    top: 20px;
+    cursor: pointer;
+}
 .edit_container {
     margin: 10px 0 0;
     .p1 {
@@ -118,6 +156,35 @@ export default {
         margin-bottom: 0;
     }
 }
+.edit-foot {
+    height: 30px;
+    width: 100%;
+    margin-top: 20px;
+    display: flex;
+    justify-content: flex-end;
+    padding-top: 10px;
+    span {
+        height: 32px;
+        line-height: 32px;
+        border-radius: 2px;
+        width: 65px;
+        text-align: center;
+        font-size: 14px;
+        font-family: PingFangSC-Regular, PingFang SC;
+        font-weight: 400;
+        cursor: pointer;
+    }
+    span:nth-of-type(1) {
+        background: rgba(255, 255, 255, 1);
+        border: 1px solid rgba(0, 0, 0, 0.15);
+        margin-right: 8px;
+        color: rgba(0, 0, 0, 0.65);
+    }
+    span:nth-of-type(2) {
+        color: rgba(255, 255, 255, 1);
+        background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+    }
+}
 .quill-editor {
     height: 130px;
 }