diff --git a/MainWidget.cpp b/MainWidget.cpp
index b7a4d4e..69bac61 100644
--- a/MainWidget.cpp
+++ b/MainWidget.cpp
@@ -11,7 +11,7 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
 {
     ui->setupUi(this);
 
-    setWindowTitle(u8"OneLevelXmlOpr v1.2.5");
+    setWindowTitle(u8"OneLevelXmlOpr v1.2.6");
     setWindowIcon(QIcon("://resource/xml.ico"));
 
     setMinimumWidth(900);
@@ -68,7 +68,7 @@ void MainWidget::copy_key()
     }
     QClipboard* clip = QApplication::clipboard();
     clip->setText(QString(target->Attribute(keys_[0].c_str())));
-    //CUtil::msg(this, u8"已复制");
+    // CUtil::msg(this, u8"已复制");
 }
 
 void MainWidget::closeEvent(QCloseEvent* event)
@@ -301,7 +301,7 @@ void MainWidget::copy_select_line()
     }
     Element_t* newer = xml_.copy_element(target);
 
-    if (!edit_property(newer)) {
+    if (!edit_property(newer, cur_item->row())) {
         return;
     }
 
@@ -322,7 +322,7 @@ void MainWidget::copy_select_line()
 }
 
 // 返回 true 表示确认编辑了, false 表示取消编辑了。
-bool MainWidget::edit_property(Element_t* target)
+bool MainWidget::edit_property(Element_t* target, int row)
 {
     if (target == nullptr) {
         return false;
@@ -331,6 +331,8 @@ bool MainWidget::edit_property(Element_t* target)
     Property_t property;
     xml_.get_key_value(target, property);
 
+    // 检测key值是否变化
+    std::string value_pre = property[0].value;
     attri_edit_->set_attribute(property);
     attri_edit_->exec();
 
@@ -339,18 +341,35 @@ bool MainWidget::edit_property(Element_t* target)
     }
 
     attri_edit_->get_attribute(property);
-    while (xml_.check_key_exists(property)) {
-        CUtil::msg(attri_edit_, u8"不能有相同的key,请检查。");
-        attri_edit_->exec();
-        attri_edit_->get_attribute(property);
-        if (!attri_edit_->is_ok_) {
-            return false;
+    if (property[0].value != value_pre) {
+        while (xml_.check_key_exists(property)) {
+            CUtil::msg(attri_edit_, u8"不能有相同的key,请检查。");
+            attri_edit_->exec();
+            attri_edit_->get_attribute(property);
+            if (!attri_edit_->is_ok_) {
+                return false;
+            }
         }
     }
     xml_.key_value_to_element(target, property);
+
+    // 这里要同步到界面
+    ele_update_gui(target, row);
     return true;
 }
 
+void MainWidget::ele_update_gui(Element_t* target, int row)
+{
+    if (tab_widget_ == nullptr) {
+        return;
+    }
+    for (auto i = 0; i < keys_.size(); ++i) {
+        const char* v = target->Attribute(keys_[i].c_str());
+        auto*       qitem = tab_widget_->item(row, i);
+        qitem->setText(QString(v));
+    }
+}
+
 void MainWidget::init_menu()
 {
     context_menu_ = new QMenu();
@@ -365,8 +384,16 @@ void MainWidget::init_menu()
     context_menu_->addAction(ac_copy_key_);
 
     connect(ac_edit_property_, &QAction::triggered, this, [&]() {
-        Element_t* ele = get_current_select_key();
-        edit_property(ele);
+        QTableWidgetItem* cur_item = get_current_select_item();
+        if (cur_item == nullptr) {
+            return;
+        }
+
+        Element_t* target = get_element_bykey(cur_item->text());
+        if (target == nullptr) {
+            return;
+        }
+        edit_property(target, cur_item->row());
     });
     connect(ac_copy_curline_, &QAction::triggered, this, [&]() { copy_select_line(); });
     connect(ac_del_curline_, &QAction::triggered, this, [&]() { del_select_line(); });
diff --git a/MainWidget.h b/MainWidget.h
index fd9a2a7..cd1f357 100644
--- a/MainWidget.h
+++ b/MainWidget.h
@@ -40,8 +40,9 @@ private:
     void reset();
     void judge_btn_page();
     void copy_key();
-    bool edit_property(Element_t* target);
+    bool edit_property(Element_t* target, int row);
     void init_menu();
+    void ele_update_gui(Element_t* target, int row);
 
 protected:
     void closeEvent(QCloseEvent* event);
diff --git a/src/attribute_edit.cpp b/src/attribute_edit.cpp
index 682f1ae..8716ede 100644
--- a/src/attribute_edit.cpp
+++ b/src/attribute_edit.cpp
@@ -57,6 +57,8 @@ void CAttributeEdit::show_before()
 {
     init_table();
 
+    is_ok_ = false;
+
     for(auto i = 0; i < property_.size(); ++i) {
         int row = table_->rowCount();
         table_->insertRow(row);
diff --git a/src/attribute_edit.h b/src/attribute_edit.h
index 3b34f6a..abbe6e6 100644
--- a/src/attribute_edit.h
+++ b/src/attribute_edit.h
@@ -30,7 +30,7 @@ private:
     void handle_ok();
 
 public:
-    bool is_ok_{};
+    bool is_ok_{ false };
 
 private:
     Ui::CAttributeEdit* ui;