曹冬冬 пре 5 година
родитељ
комит
bc044c0712

+ 5 - 2
src/api/editor.js

@@ -10,14 +10,17 @@ const getPageByThemeId = (id) => {
   return http.post('/testTheme/queryTestTheme', { id: id })
 }
 const saveTheme = (theme) => {
-  return http.post('/api/pages', theme)
+  return http.post('/testTheme/modifyTest', theme)
 }
 const delTheme = (theme) => {
   return http.del('/api/pages', theme)
 }
 const updateTheme = (theme) => {
-  return http.put('/api/pages/' + theme._id, theme)
+  return http.post('/testTheme/modifyTest', theme)
 }
+// const updateTheme = (theme) => {
+//   return http.put('/api/pages/' + theme._id, theme)
+// }
 
 const uploadPic = (data) => {
   return http.post('/api/upload', data)

+ 2 - 1
src/components/HeaderEdit.vue

@@ -61,7 +61,8 @@ import ShareSetting from "./ShareSetting";
 var time = null;
 export default {
   props: {
-    goback: Function
+    goback: Function,
+    save: Function
   },
   components: {
     ShareSetting

+ 1 - 0
src/views/cnctestlists/cncTestLists.vue

@@ -131,6 +131,7 @@ export default {
         ownHouseName: item.houseName,
         questionCount: item.questionCount,
         title: item.title,
+        testcaseId: item.testcaseId,
         jsonString:
           '{"pages":[{"elements":[]}],"createDate":1566357290066,"type":"h5","_id":"5d5cb72addd4fa1c047df1d5","title":"标题","description":"描述","canvasHeight":1334,"canvasWidth":750,"bgc":"#B1C096","btnColor":"#5f8a61","cover":"","animatedNameGlobal":"","bodyBackgroundColor":"rgba(255,255,255,0)","animatedNameBackgroundGlobal":"","backgroundAudio":"","loginId":"caodd@elab-plus.com","__v":0}'
       };

+ 13 - 6
src/views/h5editor/index.vue

@@ -2,7 +2,7 @@
   <div class="editor">
     <!-- 头部 -->
     <HeaderMain></HeaderMain>
-    <HeaderEdit :goback="dialogSave" @saveThemeSuccess="showPreView=true" />
+    <HeaderEdit :goback="dialogSave" :save="save" @saveThemeSuccess="showPreView=true" />
     <!-- 内容区域 -->
     <section class="section">
       <!-- 左侧图层 -->
@@ -497,7 +497,7 @@ export default {
       obj.top = document.getElementById("h5editor").scrollTop;
       obj["text"] = "请输入文本";
       obj["lineHeight"] = 1.5;
-   
+
       obj.left = 0;
       obj.width = ele.width;
       obj.height = ele.height;
@@ -617,13 +617,20 @@ export default {
           });
         }
       });
+      let param = {
+        coverImg: "",
+        id: this.itemId,
+        jsonString: JSON.stringify(this.$store.state.editor.editorTheme),
+        shareContent: "",
+        shareUrl: "",
+        updator: "admin"
+      };
+      console.log("参数", param);
       return this.$store
-        .dispatch(
-          "saveTheme",
-          tools.vue2json(this.$store.state.editor.editorTheme)
-        )
+        .dispatch("saveTheme", param)
         .then(() => {
           loading.close();
+          å;
           this.$message({
             message: "保存成功",
             type: "success"