瀏覽代碼

提交修改解决冲突

zhangwf 5 年之前
父節點
當前提交
2c2b449e16
共有 4 個文件被更改,包括 19 次插入9 次删除
  1. 5 2
      src/api/editor.js
  2. 2 1
      src/components/HeaderEdit.vue
  3. 1 0
      src/views/cnctestlists/cncTestLists.vue
  4. 11 6
      src/views/h5editor/index.vue

+ 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}'
       };

+ 11 - 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">
       <!-- 左侧图层 -->
@@ -348,7 +348,6 @@
         let ele = this.$store.state.editor.editorElement;
         let type = ele ? ele.type : "null";
         this.panelTabState = 0;
-
         var length = this.$store.state.editor.complexEditorElement.length;
         if (length > 1) {
           type = "group";
@@ -612,11 +611,17 @@
             });
           }
         });
+        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({