Browse Source

日报样式及分页优化

qinzhipeng_v 5 years ago
parent
commit
9f3f618b41

+ 2 - 2
src/apiConfig/mock.js

@@ -1,4 +1,4 @@
 /*eslint-disable*/   //规避eslint的检查,如没有eslint可不写
-// export const mockUrl = 'http://10.179.88.110:8089' // stable
-export const mockUrl = 'http://mock.Intra.xiaojukeji.com' // 线上
+export const mockUrl = 'http://10.179.88.110:8089' // stable
+// export const mockUrl = 'http://mock.Intra.xiaojukeji.com' // 线上
 // export const mockUrl = 'http://10.179.101.226:8089' // test

+ 21 - 18
src/views/Platform/presentation/Assumptions.vue

@@ -4,11 +4,11 @@
       <!--提测报告-->
       <div style="margin: 2%; min-height: 73vh; font-size: 14px;">
         <div style="margin: 30px 0;">搜索
-          <el-input v-model="state" filterable placeholder="搜索" style="width:20%; margin: 0 10px;" @change="clickQuery(state)" />
-          <el-button type="primary" @click="getQueryData(), centerDialogVisible = true">新建提测报告</el-button>
+          <el-input v-model="state" size="medium" filterable placeholder="搜索" style="width:20%; margin: 0 10px;" @change="getList(state)" />
+          <el-button type="primary" plain size="medium" @click="getQueryData(), centerDialogVisible = true">新建提测报告</el-button>
         </div>
         <template>
-          <el-table :data="tableData" :header-cell-style="{ background: '#F2F3F6' }" fit border style="width: 100%">
+          <el-table :data="tableData" size="mini" :header-cell-style="{ background: '#F2F3F6' }" fit border style="width: 100%">
             <el-table-column label="报告名称" min-width="230" align="center">
               <template slot-scope="scope">
                 <a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(tableData, scope.row.id)">{{ scope.row.name }}</a>
@@ -25,9 +25,9 @@
             </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" min-width="230">
               <template slot-scope="scope">
-                <el-button size="mini" @click="queryPresentation(scope.row)">更新</el-button>
-                <el-tooltip content="功能正在实现中···" placement="top"><el-button type="primary" size="mini">权限</el-button></el-tooltip>
-                <el-button size="mini" type="danger" @click="delePresentation(scope.row.id)">删除</el-button>
+                <el-button size="mini" type="primary" plain @click="queryPresentation(scope.row)">更新</el-button>
+                <el-button size="mini" type="danger" plain @click="delePresentation(scope.row.id)">删除</el-button>
+                <el-tooltip content="功能正在实现中···" placement="top"><el-button type="info" plain size="mini">权限</el-button></el-tooltip>
               </template>
             </el-table-column>
           </el-table>
@@ -56,6 +56,7 @@ export default {
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
       bizJson: localStorage.getItem('key'),
+      z_name: '',
       pageSize: 5,
       curIndex: 1,
       total: 0,
@@ -77,15 +78,17 @@ export default {
     }
   },
   created() {
-    this.getList(localStorage.getItem('key'))
+    this.getList()
   },
   mounted() {
     this.getQueryData()
   },
   methods: {
-    getList(e) {
+    getList(ele) {
+      this.z_name = ele
       this.indexPage = {
-        bizId: e,
+        name: ele,
+        bizId: localStorage.getItem('key'),
         pageSize: this.pageSize,
         curIndex: this.curIndex
       }
@@ -110,7 +113,7 @@ export default {
         .then(() => {
           this.userData = { id: '', ename: this.userInformation, name: this.userNames }
           launchTestDelete(this.userData, e).then(res => {
-            this.getList(localStorage.getItem('key'))
+            this.getList()
           })
           this.$message({ type: 'success', message: '已删除' })
         })
@@ -164,19 +167,19 @@ export default {
     handleSelect(event) {
       this.mun = event
     },
-    clickQuery(e) {
-      launchTestList({ name: e }).then(res => {
-        this.tableData = res.data
-        this.total = res.total
-      })
-    },
+    // clickQuery(e) {
+    //   launchTestList({ name: e }).then(res => {
+    //     this.tableData = res.data
+    //     this.total = res.total
+    //   })
+    // },
     handleSizeChange(size) {
       this.pageSize = size
-      this.getList(localStorage.getItem('key'))
+      this.getList(this.z_name)
     },
     handleCurrentChange(curIndex) {
       this.curIndex = curIndex
-      this.getList(localStorage.getItem('key'))
+      this.getList(this.z_name)
     },
     toReportView(ele, e) {
       for (var vel of ele) {

+ 14 - 25
src/views/Platform/presentation/ResultPage.vue

@@ -4,11 +4,11 @@
       <!--准出报告-->
       <div style="margin: 2%; min-height: 73vh; font-size: 14px;">
         <div style="margin: 30px 0;">搜索
-          <el-input v-model="state" filterable placeholder="搜索" style="width:20%; margin: 0 10px;" @change="clickQuery(state)" />
-          <el-button type="primary" @click="getQueryData(), centerDialogVisible = true">新建准出报告</el-button>
+          <el-input v-model="state" size="medium" filterable placeholder="搜索" style="width:20%; margin: 0 10px;" @change="getList(state)" />
+          <el-button type="primary" size="medium" plain @click="getQueryData(), centerDialogVisible = true">新建准出报告</el-button>
         </div>
         <template>
-          <el-table :data="tableData" :header-cell-style="{ background: '#F2F3F6' }" fit border style="width: 100%">
+          <el-table :data="tableData" size="mini" :header-cell-style="{ background: '#F2F3F6' }" fit border style="width: 100%">
             <el-table-column label="报告名称" min-width="150" align="center">
               <template slot-scope="scope">
                 <a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(tableData, scope.row.id)">{{ scope.row.reportName }}</a>
@@ -25,11 +25,11 @@
             </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" min-width="230">
               <template slot-scope="scope">
-                <el-button size="mini" @click="queryPresentation(scope.row)">更新</el-button>
+                <el-button size="mini" plain type="primary" @click="queryPresentation(scope.row)">更新</el-button>
+                <el-button size="mini" type="danger" plain @click="delePresentation(scope.row.id)">删除</el-button>
                 <el-tooltip content="功能正在实现中···" placement="top">
-                  <el-button size="mini" type="primary">权限</el-button>
+                  <el-button size="mini" type="info" plain>权限</el-button>
                 </el-tooltip>
-                <el-button size="mini" type="danger" @click="delePresentation(scope.row.id)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -57,7 +57,6 @@
 <script>
 import { projectTestReportList, projectTestReportDelete } from '@/api/ResultPage'
 import { taskListCreate } from '@/api/InterfaceReport'
-import Utils from '../../../util.js'
 
 export default {
   name: 'Assumptions',
@@ -73,6 +72,7 @@ export default {
       restaurants: [],
       centerDialogVisible: false,
       states: '',
+      z_name: '',
       indexPage: {
         pageSize: 5,
         curIndex: 1
@@ -81,19 +81,17 @@ export default {
     }
   },
   created() {
-    this.getList(localStorage.getItem('key'))
+    this.getList()
   },
   mounted() {
-    var that = this
-    Utils.$on('demo', function(msg) {
-      that.getList(msg)
-    })
     this.getQueryData()
   },
   methods: {
     getList(e) {
+      this.z_name = e
       this.indexPage = {
-        bizId: e,
+        reportName: e,
+        bizId: localStorage.getItem('key'),
         pageSize: this.pageSize,
         curIndex: this.curIndex
       }
@@ -125,7 +123,7 @@ export default {
         .then(() => {
           this.userData = { id: '', ename: this.userInformation, name: this.userNames }
           projectTestReportDelete(this.userData, e).then(res => {
-            this.getList(localStorage.getItem('key'))
+            this.getList()
           })
           this.$message({ type: 'success', message: '已删除' })
         })
@@ -208,22 +206,13 @@ export default {
         return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
       }
     },
-    clickQuery(e) {
-      projectTestReportList({ reportName: e }).then(res => {
-        this.tableData = res.data
-        this.total = res.total
-      })
-    },
     handleSizeChange(size) {
       this.pageSize = size
-      this.getList(localStorage.getItem('key'))
+      this.getList(this.z_name)
     },
     handleCurrentChange(curIndex) {
       this.curIndex = curIndex
-      this.getList(localStorage.getItem('key'))
-    },
-    errorFun() {
-      this.$notify({ title: 'Failed', message: 'Created Failed', type: 'error', duration: 2000 })
+      this.getList(this.z_name)
     }
   }
 }

+ 151 - 38
src/views/Platform/presentation/testPage.vue

@@ -6,13 +6,25 @@
       <div style="background:#F2F3F6;">
         <el-container>
           <el-aside width="15%" style=" background: #FFF;margin: 1% 0 1% 1%; border-radius:8px;">
-            <el-tree
-              v-show="dataShow"
-              :data="data1"
-              node-key="id"
-              @node-contextmenu="createUpdate"
-              @node-click="clickFun"
-            />
+            <div class="nav_Input" style="min-height:81vh;" @click="click_fa">
+              <br>
+              <p v-show="node_Data" style="color: #DCDFE6; margin: 100% 0;font-size:14px; text-align:center;">空空如也</p>
+              <el-tree
+                v-if="dataShow"
+                :data="data1"
+                :expand-on-click-node="true"
+                node-key="id"
+                @node-click="clickFun"
+              >
+                <span slot-scope="{ node, data }" style="width:100%;" class="custom-tree-node" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)">
+                  <span :title="data.label" class="span_el" @dblclick="dblclick(data)">{{ node.label }}</span>
+                  <el-input v-if="data.que" ref="get_Input" v-model="node_Name.name" size="mini" @blur="queryNodeName(node_Name.name, data)">输入框</el-input>
+                  <el-button v-show="data.del" type="text" size="mini" icon="el-icon-delete" @click="() => remove(node, data)" />
+                </span>
+              </el-tree>
+              <el-input v-if="Folder_Show" ref="input1" v-model="add_Folder" size="mini" placeholder="新建文件夹" @blur="hide_input(add_Folder)" />
+            </div>
+            <div style="padding: 0% 15% 15% 15%; text-align: center;"><el-button icon="el-icon-circle-plus" style="border:none;" @click="createFolder">新建文件夹</el-button></div>
           </el-aside>
           <el-container>
             <el-header style="background:#ffffff; height: auto; width: 98%; margin: 1%; font-size: 14px; border-radius: 8px;">
@@ -40,7 +52,7 @@
             </div>
             <el-main style="background:#ffffff; width:98%;margin:0% 1% 1% 1%; font-size:14px;border-radius:8px;">
               <!-- 主页table -->
-              <el-table :data="gridData" :header-cell-style="{ background: '#F0F2F4', color: '#333B4A' }" border tooltip-effect="dark" style="width: 100%" @select-all="clickAllData">
+              <el-table :data="gridData" :header-cell-style="{ background: '#F0F2F4', color: '#333B4A' }" border tooltip-effect="dark" style="width: 100%">
                 <el-table-column prop="id" label="序列号" min-width="80px" align="center">
                   <template slot-scope="scope">{{ scope.row.id }}</template>
                 </el-table-column>
@@ -75,7 +87,7 @@
               </el-table>
 
               <div align="center"> <!--分页-->
-                <el-pagination :current-page="curIndex" :page-sizes="[5, 10, 20]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="100" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
+                <el-pagination :current-page="curIndex" :page-sizes="[5, 10, 20]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="16" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
               </div>
 
             </el-main>
@@ -155,7 +167,7 @@
 
 <script>
 import { projectGetNameMap } from '@/api/testCaseProject.js'
-import { queryCasesData, createCaseData, updateCaseData, deleteCaseData, settingQueryModuleInfoListData } from '@/api/caseProject.js'
+import { queryCasesData, createCaseData, updateCaseData, deleteCaseData, settingQueryModuleInfoListData, caseUpdateFolderName, createFolderData, deleteFolderData } from '@/api/caseProject.js'
 export default {
   name: 'TestCaseProject',
   data() {
@@ -165,6 +177,8 @@ export default {
       dialogFormVisibleQuery: false,
       moduleTypeShow: false,
       dataShow: true,
+      Folder_Show: false,
+      node_Data: false,
       titleName: '',
       dialogFormVisibleUpdate: false,
       priorityStrings: [{ name: 'p0', value: 0 }, { name: 'p1', value: 1 }, { name: 'p2', value: 2 }, { name: 'p3', value: 3 }],
@@ -173,33 +187,6 @@ export default {
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
       bizJson: localStorage.getItem('key'),
-      pickerOptions: {
-        shortcuts: [{
-          text: '最近一周',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
-            picker.$emit('pick', [start, end])
-          }
-        }, {
-          text: '最近一个月',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
-            picker.$emit('pick', [start, end])
-          }
-        }, {
-          text: '最近三个月',
-          onClick(picker) {
-            const end = new Date()
-            const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
-            picker.$emit('pick', [start, end])
-          }
-        }]
-      },
       createTimeData: '',
       userData: '',
       pageSize: 5,
@@ -248,7 +235,7 @@ export default {
             num.id = b.id
             arr.push(num)
           }
-          // this.data1.push({ id: a.id, label: a.projectName, children: num })
+          this.data1.push({ id: a.id, label: a.projectName, children: num })
         }
       })
     },
@@ -257,6 +244,132 @@ export default {
         this.moduleTypeStr = res.data
       })
     },
+
+    dblclick(data) {
+      this.label = data.label// 当前选中的名称
+      this.id = data.id // 当前选中id
+      this.$set(data, 'label', '')
+      this.$set(data, 'que', true)
+      this.$set(data, 'del', false)
+      this.$set(this.node_Name, 'name', this.label)
+      setTimeout(() => { this.$refs.get_Input.focus() }, 100)
+      this.$nextTick(() => {
+        this.$refs.get_Input.focus()
+      })
+    },
+
+    // 新建文件夹
+    createFolder() {
+      this.Folder_Show = true
+      this.add_Folder = ''
+      this.node_Data = false
+      setTimeout(() => { this.$refs.input1.focus() }, 100)
+    },
+
+    // 显示隐藏删除图标
+    mouseenter(data) {
+      this.$set(data, 'del', true)
+    },
+    mouseleave(data) {
+      this.$set(data, 'del', false)
+    },
+
+    // 更新节点
+    queryNodeName(val, data) {
+      var mun = ''
+      for (var el of this.data1) { // 最外层id
+        if (data.id === el.id) { // 双击获取的ID和最外层的ID匹配
+          mun = '-1' // 有赋值为 -1
+        } else {
+          mun = '' // 没有赋值为点击的父元素
+        }
+      }
+      if (val === '') { // 判断用户是否有输入
+        val = this.label // 没有输入拿之前的label替代
+        this.end_Data = { parentFolderId: mun, folderName: val, xmindUrl: '', id: data.id, bizId: localStorage.getItem('key'), modifier: this.userInformation, creator: this.userInformation }
+      } else {
+        this.end_Data = { parentFolderId: mun, folderName: val, xmindUrl: '', id: data.id, bizId: localStorage.getItem('key'), modifier: this.userInformation, creator: this.userInformation }
+      }
+      this.$set(data, 'que', false) // 失去焦点隐藏input
+      this.$set(this.node_Name, 'name', '') // 清空input
+      caseUpdateFolderName(this.end_Data).then(res => {
+        if (res.code === 200) {
+          this.$message({ type: 'success', message: res.msg, duration: 1000 })
+          this.data1 = []
+          this.AllQueryFolderData(localStorage.getItem('key'))
+        } else {
+          this.$message({ type: 'error', message: res.msg, duration: 1000 })
+          this.data1 = []
+          this.AllQueryFolderData(localStorage.getItem('key'))
+        }
+      })
+    },
+
+    // 点击空白创建最外层nav
+    click_fa() {
+      this.created_id = '-1'
+    },
+
+    // input失去焦点新增(或取消)
+    hide_input(vel) {
+      if (vel !== '') {
+        this.created_id === '' ? this.created_id = '-1' : ''
+        this.formData = {
+          bizId: this.bizJson,
+          folderName: vel,
+          xmindUrl: '',
+          parentFolderId: this.created_id,
+          creator: this.userInformation,
+          modifier: this.userInformation
+        }
+        createFolderData(this.formData).then(res => {
+          if (res.code === 200) {
+            this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
+            // this.createCaseCode = false
+            this.dataShow = true
+            this.node_Data = false
+            this.data1 = []
+            this.AllQueryFolderData(this.bizJson)
+            this.created_id = ''
+          } else {
+            this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
+            this.created_id = ''
+          }
+        })
+        this.Folder_Show = false
+      } else {
+        this.$message({ message: '取消创建文件夹', type: 'success', duration: 1000, offset: 150 })
+        this.Folder_Show = false
+        this.node_Data = true
+      }
+    },
+    // 删除
+    remove(node, data) {
+      this.$confirm('是否确认删除', '确认信息', {
+        distinguishCancelAndClose: true,
+        confirmButtonText: '确定',
+        cancelButtonText: '取消'
+      })
+        .then(() => {
+          this.formData = {
+            id: node.data.id,
+            modifier: node.data.id
+          }
+          deleteFolderData(this.formData).then(res => {
+            if (res.code === 200) {
+              this.$message({ type: 'success', message: '已删除' })
+              this.data1 = []
+              this.AllQueryFolderData(localStorage.getItem('key'))
+            } else {
+              this.$message({ type: 'error', message: res.msg, duration: 1000 })
+            }
+          })
+        })
+        .catch(action => {
+          this.$message({ type: 'success', message: '已取消' })
+        })
+    },
+
     handleSizeChange(size) {
       this.pageSize = size
       this.pageIndex()

+ 14 - 17
src/views/Platform/presentation/testPresentation.vue

@@ -4,11 +4,11 @@
       <!--日报报告-->
       <div style="margin: 2%; min-height: 73vh; font-size: 14px;">
         <div style="margin: 30px 0;">搜索
-          <el-input v-model="state" size="medium" filterable placeholder="请搜索" style="width:20%;margin: 0 10px;" @change="clickQuery(state)" />
-          <el-button type="primary" size="medium" @click="centerDialogVisible = true">新建日报报告</el-button>
+          <el-input v-model="state" size="medium" filterable placeholder="请搜索" style="width:20%;margin: 0 10px;" @change="getList(state)" />
+          <el-button type="primary" size="medium" plain @click="centerDialogVisible = true">新建日报报告</el-button>
         </div>
         <template>
-          <el-table :data="tableData" :header-cell-style="{ background: '#F2F3F6' }" fit border style="width: 100%">
+          <el-table :data="tableData" size="mini" :header-cell-style="{ background: '#F2F3F6' }" fit border style="width: 100%">
             <el-table-column label="报告名称" min-width="280" align="center">
               <template slot-scope="scope">
                 <a href="javascript:void(0)" style="color:#20a0ff" @click="toReportView(scope.row.id)">{{ scope.row.reportName }}</a>
@@ -22,11 +22,11 @@
             </el-table-column>
             <el-table-column label="操作" align="center" fixed="right" min-width="230">
               <template slot-scope="scope">
-                <el-button size="mini" @click="queryPresentation(scope.row)">更新</el-button>
+                <el-button size="mini" type="primary" plain @click="queryPresentation(scope.row)">更新</el-button>
+                <el-button size="mini" type="danger" plain @click="delePresentation(scope.row.id)">删除</el-button>
                 <el-tooltip content="功能正在实现中···" placement="top">
-                  <el-button size="mini" type="primary">权限</el-button>
+                  <el-button size="mini" type="info" plain>权限</el-button>
                 </el-tooltip>
-                <el-button size="mini" type="danger" @click="delePresentation(scope.row.id)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -54,7 +54,6 @@
 <script>
 import { dailyReportList, dailyReportDelete } from '@/api/testPresentetion'
 import { taskListCreate } from '@/api/InterfaceReport'
-import Utils from '../../../util.js'
 
 export default {
   name: 'TestPresentation',
@@ -83,19 +82,17 @@ export default {
     }
   },
   created() {
-    this.getList(localStorage.getItem('key'))
+    this.getList()
   },
   mounted() {
-    var that = this
-    Utils.$on('demo', function(msg) {
-      that.getList(msg)
-    })
     this.getQueryData()
   },
   methods: {
     getList(e) {
+      this.z_name = e
       this.indexPage = {
-        bizId: e,
+        reportName: e,
+        bizId: localStorage.getItem('key'),
         pageSize: this.pageSize,
         curIndex: this.curIndex
       }
@@ -122,7 +119,7 @@ export default {
         .then(() => {
           this.userData = { id: '', ename: this.userInformation, name: this.userNames }
           dailyReportDelete(this.userData, e).then(res => {
-            this.getList(localStorage.getItem('key'))
+            this.getList()
           })
           this.$message({ type: 'success', message: '已删除' })
         })
@@ -189,18 +186,18 @@ export default {
       })
     },
     clickQuery(e) {
-      dailyReportList({ reportName: e }).then(res => {
+      dailyReportList({ reportName: e, pageSize: this.pageSize, curIndex: this.curIndex }).then(res => {
         this.tableData = res.data
         this.total = res.total
       })
     },
     handleSizeChange(size) {
       this.pageSize = size
-      this.getList(localStorage.getItem('key'))
+      this.getList(this.z_name)
     },
     handleCurrentChange(curIndex) {
       this.curIndex = curIndex
-      this.getList(localStorage.getItem('key'))
+      this.getList(this.z_name)
     }
   }
 }