曹冬冬 5 tahun lalu
induk
melakukan
d5e16257fe
2 mengubah file dengan 35 tambahan dan 4 penghapusan
  1. 33 4
      src/components/HeaderEdit.vue
  2. 2 0
      src/views/myHistoryTest/myHistoryTest.scss

+ 33 - 4
src/components/HeaderEdit.vue

@@ -1,6 +1,7 @@
 <template>
   <header class="header">
-    <button class="reset-btn" @click="goback"><i class="el-icon-arrow-left"></i>{{title || '返回作品'}}</button>
+    <button class="reset-btn"><i class="el-icon-arrow-left" @click="goback"></i>{{title || '返回作品'}}<i
+        class="el-icon-edit edit-title" @click="editTitle"></i></button>
     <div class="tools">
       <div class="next_return">
         <div class="return" title="撤销" @click="revocation" :style="`opacity:${operationList.length>1?'1':'.3'}`">
@@ -127,6 +128,31 @@ export default {
     }
   },
   methods: {
+    editTitle() {
+      console.log("编辑标题");
+      this.$prompt("请输入测试标题", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/,
+        inputErrorMessage: "测试标题不为空",
+        inputValue: this.title
+      })
+        .then(({ value }) => {
+          let param = {
+            id: this.shareModel.id,
+            title: value
+          };
+          api.saveTheme(this.shareModel).then(res => {
+            if (res.success) {
+              this.$message.success("保存成功");
+              this.title = value;
+            } else {
+              this.$message.error("数据加载失败,请重试");
+            }
+          });
+        })
+        .catch(() => {});
+    },
     notempty(arrays) {
       for (var i = 0; i < arrays.length; i++) {
         if (
@@ -301,6 +327,9 @@ export default {
     padding-right: 15px;
     flex-direction: row-reverse;
   }
+  .edit-title {
+    padding-left: 10px;
+  }
   .tools {
     width: 100%;
     height: 60px;
@@ -320,9 +349,9 @@ export default {
         font-size: 16px;
         color: rgba(100, 107, 129, 1);
         .retutn_icon {
-          width: 24px;
-          height: 21px;
-          margin-bottom: 5px;
+          width: 17px;
+          height: 14px;
+          margin-bottom: 8px;
         }
       }
     }

+ 2 - 0
src/views/myHistoryTest/myHistoryTest.scss

@@ -14,6 +14,7 @@
   justify-content: space-between;
   align-items:center;
   .left {
+    margin-left: 8px;
     .el-button{
       padding: 7px 20px;
       position: relative
@@ -37,6 +38,7 @@
     }
   }
   .right {
+    margin-right: 14px;
     .el-button{
       padding: 6px 20px;
     }