瀏覽代碼

日报报告页面优化(编辑时调用接口获取数据,不从主页表格携带数据)

qinzhipeng_v 5 年之前
父節點
當前提交
c0b6b7f19d

+ 9 - 46
src/views/Platform/presentation/DailyNewsAdded.vue

@@ -15,15 +15,6 @@
         <!-- 富文本 -->
         <!-- 富文本 -->
         <div id="editor" name="editor" style="width:50px;" />
         <div id="editor" name="editor" style="width:50px;" />
 
 
-        <!-- <div class="backStyle">一. 进度和风险</div>
-        <div id="projectProgress" class="toolbar" />
-        <div id="projectProgress1" class="text" style="text-align:left" />
-
-        <div class="backStyle">二. 测试情况</div>
-
-        <div id="TestProgress" class="toolbar" />
-        <div id="TestProgress1" class="text" style="text-align:left;" /> -->
-
         <div class="backStyle">三. bug情况</div>
         <div class="backStyle">三. bug情况</div>
 
 
         <div style="border: 1px,solid #ccc;">
         <div style="border: 1px,solid #ccc;">
@@ -53,7 +44,7 @@
 // import E from 'wangeditor'
 // import E from 'wangeditor'
 import echarts from 'echarts'
 import echarts from 'echarts'
 import Jodit from 'jodit'
 import Jodit from 'jodit'
-import { dailyReportCreate, dailyReportUpdate, bugDailyList } from '@/api/testPresentetion'
+import { dailyReportCreate, dailyReportUpdate, bugDailyList, dailyReport } from '@/api/testPresentetion'
 
 
 export default {
 export default {
   name: 'DailyNewsAdded',
   name: 'DailyNewsAdded',
@@ -115,44 +106,27 @@ export default {
       'showXPathInStatusbar': false
       'showXPathInStatusbar': false
     })
     })
     this.editor.value = '<br><h2>一. 进度和风险</h2><br><p>1,项目整体进度</p><br><br><p>2,项目风险与问题</p><br><table width="100%"><colgroup><col width="8%"><col width="8%"><col width="8%"><col width="8%"></colgroup><thead><tr><th>风险等级</th><th>风险项</th><th>当前状态</th><th>跟进人</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><br><h2>二. 测试情况</h2><br><p>1,测试进展</p><br><table width="100%"><colgroup><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"></colgroup><thead><tr><th>标题1</th><th>标题2</th><th>标题3</th><th>标题4</th><th>标题5</th><th>标题6</th><th>标题7</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><br><p>2,测试说明</p><br><br>'
     this.editor.value = '<br><h2>一. 进度和风险</h2><br><p>1,项目整体进度</p><br><br><p>2,项目风险与问题</p><br><table width="100%"><colgroup><col width="8%"><col width="8%"><col width="8%"><col width="8%"></colgroup><thead><tr><th>风险等级</th><th>风险项</th><th>当前状态</th><th>跟进人</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><br><h2>二. 测试情况</h2><br><p>1,测试进展</p><br><table width="100%"><colgroup><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"></colgroup><thead><tr><th>标题1</th><th>标题2</th><th>标题3</th><th>标题4</th><th>标题5</th><th>标题6</th><th>标题7</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><br><p>2,测试说明</p><br><br>'
-    // this.TestProgress = new E('#TestProgress', '#TestProgress1')
-    // this.projectProgress = new E('#projectProgress', '#projectProgress1')
-
-    // this.TestProgress.customConfig.zIndex = 110
-    // this.projectProgress.customConfig.zIndex = 110
-
-    // this.TestProgress.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify', 'table']
-    // this.projectProgress.customConfig.menus = ['bold', 'italic', 'underline', 'link', 'list', 'justify', 'table']
-
-    // this.TestProgress.customConfig.onchange = (html) => { this.TestProgress = html }
-    // this.projectProgress.customConfig.onchange = (html) => { this.projectProgress = html }
-
-    // this.TestProgress.create()
-    // this.projectProgress.create()
-
-    // this.TestProgress.txt.html(`<p>1,测试进展</p><br><table width="100%"><colgroup><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"><col width="8%"></colgroup><thead><tr><th>标题1</th><th>标题2</th><th>标题3</th><th>标题4</th><th>标题5</th><th>标题6</th><th>标题7</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><br><p>2,测试说明</p><br><br>`)
-    // this.projectProgress.txt.html(`<br><p>1,项目整体进度</p><br><br><p>2,项目风险与问题</p><br><table width="100%"><colgroup><col width="8%"><col width="8%"><col width="8%"><col width="8%"></colgroup><thead><tr><th>风险等级</th><th>风险项</th><th>当前状态</th><th>跟进人</th></tr></thead><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table><br>`)
-    this.getRouterData1()
   },
   },
   methods: {
   methods: {
     getRouterData() {
     getRouterData() {
-      if (this.$route.query.data) {
+      if (this.$route.query.data) { // 主页面编辑
         this.fromCreateData = {}
         this.fromCreateData = {}
-        this.fromCreateData = this.$route.query.data
         this.showButton1 = true
         this.showButton1 = true
         this.showButton = false
         this.showButton = false
-        this.pro = this.$route.query.data
+        dailyReport({ id: this.$route.query.id }).then((res) => {
+          this.fromCreateData = res.data
+          this.editor.value = this.fromCreateData.testExplain
+        })
+        this.pro = { projectId: this.$route.query.projectId, taskId: this.$route.query.taskId }
       }
       }
       if (this.$route.query.state1) { // 项目主页面新建
       if (this.$route.query.state1) { // 项目主页面新建
         this.fromCreateData = {}
         this.fromCreateData = {}
         this.showButton1 = false
         this.showButton1 = false
         this.showButton = true
         this.showButton = true
-        console.log(this.$route.query.projectId)
         this.$route.query.projectId ? this.projectId = this.$route.query.projectId : ''
         this.$route.query.projectId ? this.projectId = this.$route.query.projectId : ''
         this.$route.query.taskId ? this.taskId = this.$route.query.taskId : ''
         this.$route.query.taskId ? this.taskId = this.$route.query.taskId : ''
         this.bizIdCode = this.$route.query.state1.bizId
         this.bizIdCode = this.$route.query.state1.bizId
         this.pro = { projectId: this.projectId, taskId: this.taskId }
         this.pro = { projectId: this.projectId, taskId: this.taskId }
-        console.log(this.pro)
       }
       }
       if (this.$route.query.task) { // 任务页面
       if (this.$route.query.task) { // 任务页面
         this.fromCreateData = {}
         this.fromCreateData = {}
@@ -200,9 +174,6 @@ export default {
         })
         })
       })
       })
     },
     },
-    getRouterData1() {
-      this.editor.value = this.fromCreateData.testExplain
-    },
 
 
     // 返回
     // 返回
     open(ele) {
     open(ele) {
@@ -220,10 +191,7 @@ export default {
       this.$refs['fromCreateData'].validate((valid) => {
       this.$refs['fromCreateData'].validate((valid) => {
         if (valid) {
         if (valid) {
           this.fromCreateData = ele
           this.fromCreateData = ele
-          // typeof (this.TestProgress) === 'string' ? this.fromCreateData.testExplain = this.TestProgress : ''
           this.fromCreateData.testExplain = this.editor.editor.innerHTML
           this.fromCreateData.testExplain = this.editor.editor.innerHTML
-          // typeof (this.projectProgress) === 'string' ? this.fromCreateData.problemRisks = this.projectProgress : ''
-          // this.fromCreateData.taskId !== '' ? this.fromCreateData.taskId = this.idCode : this.fromCreateData.projectId = this.idCode
           if (this.$route.query.task) { // 任务页面
           if (this.$route.query.task) { // 任务页面
             this.fromCreateData.taskId = this.idCode
             this.fromCreateData.taskId = this.idCode
             this.fromCreateData.bizId = this.bizIdCode
             this.fromCreateData.bizId = this.bizIdCode
@@ -263,7 +231,6 @@ export default {
       this.fromCreateData = ele
       this.fromCreateData = ele
       this.fromCreateData.taskId === 0 ? this.fromCreateData.taskId = '' : ''
       this.fromCreateData.taskId === 0 ? this.fromCreateData.taskId = '' : ''
       this.fromCreateData.projectId === 0 ? this.fromCreateData.projectId = '' : ''
       this.fromCreateData.projectId === 0 ? this.fromCreateData.projectId = '' : ''
-      // typeof (this.TestProgress) === 'string' ? this.fromCreateData.testExplain = this.testExplain : ''
       this.fromCreateData.testExplain = this.editor.editor.innerHTML
       this.fromCreateData.testExplain = this.editor.editor.innerHTML
       this.userData = { id: '', ename: this.userInformation, name: this.userNames }
       this.userData = { id: '', ename: this.userInformation, name: this.userNames }
       this.objData = { dailyTestReport: this.fromCreateData, user: this.userData }
       this.objData = { dailyTestReport: this.fromCreateData, user: this.userData }
@@ -279,7 +246,8 @@ export default {
 
 
     // 预览跳转
     // 预览跳转
     clickPreview(ele) {
     clickPreview(ele) {
-      this.$router.push({ path: '/Platform/presentation/testPresenyL', query: { data: ele }})
+      console.log(ele)
+      this.$router.push({ path: '/Platform/presentation/testPresenyL', query: { id: ele }})
     },
     },
 
 
     deleteProject(e) {
     deleteProject(e) {
@@ -290,9 +258,6 @@ export default {
         this.showbut1 = false
         this.showbut1 = false
         this.showbut = '2'
         this.showbut = '2'
       }
       }
-    },
-    createDateNode() {
-
     }
     }
   }
   }
 }
 }
@@ -316,11 +281,9 @@ export default {
     border: none;
     border: none;
   }
   }
   .toolbar {
   .toolbar {
-    /* width: 86vw; */
     border: 1px solid #DEE2E7;
     border: 1px solid #DEE2E7;
   }
   }
   .text {
   .text {
-    /* width: 86vw; */
     border: 1px solid #DEE2E7;
     border: 1px solid #DEE2E7;
     height: auto;
     height: auto;
     font-size: 15px;
     font-size: 15px;

+ 1 - 2
src/views/Platform/presentation/testPresentation.vue

@@ -134,7 +134,6 @@ export default {
             var type = ele
             var type = ele
           }
           }
         }
         }
-        console.log(type)
         this.queryData.state = ''
         this.queryData.state = ''
         this.centerDialogVisible = false
         this.centerDialogVisible = false
         this.$router.push({ path: '/Platform/presentation/DailyNewsAdded', query: { state1: type, taskId: type.taskId, projectId: type.projectId }})
         this.$router.push({ path: '/Platform/presentation/DailyNewsAdded', query: { state1: type, taskId: type.taskId, projectId: type.projectId }})
@@ -153,7 +152,7 @@ export default {
 
 
     // 日报编辑
     // 日报编辑
     queryPresentation(data) {
     queryPresentation(data) {
-      this.$router.push({ path: '/Platform/presentation/DailyNewsAdded', query: { data: data }})
+      this.$router.push({ path: '/Platform/presentation/DailyNewsAdded', query: { data: data, taskId: data.taskId, projectId: data.projectId, id: data.id }})
     },
     },
     // 切换项目任务
     // 切换项目任务
     getQueryData(e) {
     getQueryData(e) {