qinzhipeng_v 5 жил өмнө
parent
commit
8f41b3543a

+ 1 - 1
src/router/index.js

@@ -94,7 +94,7 @@ export const constantRoutes = [
       {
       {
         path: 'useCasePage',
         path: 'useCasePage',
         name: 'useCasePage',
         name: 'useCasePage',
-        // hidden: true,
+        hidden: true,
         component: () => import('@/views/Platform/useCasePage'),
         component: () => import('@/views/Platform/useCasePage'),
         meta: { title: '用例管理' }
         meta: { title: '用例管理' }
       },
       },

+ 142 - 1
src/views/Platform/useCasePage.vue

@@ -1,5 +1,145 @@
 <template>
 <template>
-  <div>
+  <div style="background:#F2F3F6">
+    <el-container>
+      <el-header style="background:#ffffff;height:25vh;; width:94%;margin:3%; font-size:14px;">
+        <el-row>
+          <el-col :span="20" style="white-space:nowrap;">
+            前置条件
+            <el-input v-model="value" placeholder="请输入内容" style="margin-top:1.3%;" />
+            <el-button class="headerStyle" style="margin-left:1%;" type="primary" @click="queryCaseData(createParticipation)">查询</el-button>
+            <el-button type="primary" @click="createGetShow">新增</el-button>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="20" style="white-space:nowrap;">
+            <div class="headerStyle" style="margin:1% 0;">
+              <span>优先级</span>
+              <el-select v-model="createParticipation.casePriority" style="width: 20%;margin-right:5px;" clearable placeholder="优先级">
+                <el-option v-for="item in priorityStrings" :key="item.value" :label="item.name" :value="item.value" />
+              </el-select>
+              用例名
+              <el-input v-model="createParticipation.folderName" placeholder="用例名" clearable style="width: 20%;" class="filter-item" />
+              api接口 <el-input v-model="createParticipation.api" placeholder="api接口" clearable style="width: 50%;margin-right:5px;" class="filter-item" />
+
+            </div>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="20" style="white-space:nowrap;">
+            <div class="demonstration headerStyle">创建时间
+              <el-date-picker v-model="createParticipation.createTime" style="width:20%;margin-right:5px;" type="datetime" placeholder="开始日期" /> -
+              <el-date-picker v-model="createParticipation.modifyTime" style="width:20%;margin-right:5px;" type="datetime" placeholder="结束日期" />
+              创建人 <el-input v-model="createParticipation.creator" placeholder="创建人" clearable style="width: 50%;" class="filter-item" />
+              <input id="imFile" ref="imFile" type="file" style="display: none" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" @change="importFile(this)">
+
+            </div>
+          </el-col>
+        </el-row>
+      </el-header>
+      <el-container>
+        <el-aside width="150pt">
+          <el-dialog title="提示" :visible.sync="centerDialogVisible" width="30%" center>
+            <el-form :model="formData">
+              <el-form-item label="目录名称 :"><el-input v-model="formData.folderName" autocomplete="off" style="width: 280px" /></el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+              <el-button type="primary" @click="deleteCodeData(formData), centerDialogVisible = false">删除当前目录</el-button>
+              <el-button type="primary" @click="createCase(formData)">新 增</el-button>
+            </span>
+          </el-dialog>
+          <div v-show="createCaseCode" style="background: #E9EEF3; height:93vh; text-align:center; padding:50% 0;">
+            <p>请先创建任务,再继续·····</p>
+            <el-button type="primary" @click="changeStartId">新 增</el-button>
+          </div>
+          <el-tree
+            v-show="dataShow"
+            style="background: #fff; height:93vh; padding:15%;"
+            :data="data1"
+            node-key="id"
+            draggable
+            :allow-drop="allowDrop"
+            :allow-drag="allowDrag"
+            @node-drag-start="handleDragStart"
+            @node-drag-enter="handleDragEnter"
+            @node-drag-leave="handleDragLeave"
+            @node-drag-over="handleDragOver"
+            @node-drag-end="handleDragEnd"
+            @node-drop="handleDrop"
+            @node-contextmenu="createUpdate"
+            @node-click="clickFun"
+          />
+        </el-aside>
+        <el-main>
+          <el-button type="primary" style="margin-left:6%;" @click="uploadFile()">导入</el-button>
+          <el-button class="headerStyle" style="margin-left:6%;" type="primary" @click="exportExcel">导出</el-button>
+          <!-- 主页table -->
+          <el-table :data="gridData" fit height="570vh" tooltip-effect="dark" style="width: 100%" @select-all="clickAllData" @selection-change="handleSelectionChange">
+            <el-table-column type="selection" width="55" align="center" @change="clickAllData(gridData)" />
+            <el-table-column prop="id" label="ID" width="60px" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.id }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="caseName" label="用例名" width="150" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.caseName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="expectedResult" label="期望结果" width="150" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.expectedResult }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="casePriorityName" label="优先级" width="80" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.casePriorityName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="creatorName" label="创建人" width="100" align="center">
+              <template slot-scope="scope">
+                <el-tag type="success">{{ scope.row.creatorName }}</el-tag>
+                <!-- <span>{{ scope.row.creatorName }}</span> -->
+              </template>
+            </el-table-column>
+            <el-table-column prop="modifierName" label="修改人" width="100" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.modifierName }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column prop="createTime" label="创建时间" width="200" align="center">
+              <template slot-scope="scope">
+                <span>{{ scope.row.createTime }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" min-width="220px" align="center" fixed="right">
+              <template slot-scope="scope">
+                <el-button size="mini" type="primary" @click="queryGetShow(gridData)">查看</el-button>
+                <el-button size="mini" type="primary" @click="updateGetShow(scope.row)">编辑</el-button>
+                <el-button size="mini" type="primary" @click="deleteCaseData(scope.row.id)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <!-- 导出文件内容 -->
+          <el-table v-show="false" id="out-table" :data="tableData" fit height="570vh" tooltip-effect="dark" style="width: 100%">
+            <el-table-column type="index" prop="ids" label="序号" width="50" />
+            <!-- <el-table-column prop="ids" label="序号" /> -->
+            <el-table-column prop="caseName" label="用例名" />
+            <el-table-column prop="description" label="用例描述" />
+            <el-table-column prop="expectedResult" label="期望结果" />
+            <el-table-column prop="api" label="对应api" />
+            <el-table-column prop="projectTypeName" label="项目类型" />
+            <el-table-column prop="taskTypeName" label="平台类型" />
+            <el-table-column prop="casePriorityName" label="用例优先级" />
+            <el-table-column prop="moduleTypeName" label="模块名" />
+            <el-table-column prop="creatorName" label="创建人" />
+            <el-table-column prop="modifierName" label="修改人" />
+            <el-table-column prop="remark" label="备注" />
+            <el-table-column prop="createTime" label="创建时间" />
+          </el-table>
+          <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-main>
+      </el-container>
+    </el-container>
     <el-container>
     <el-container>
       <el-aside width="150pt">
       <el-aside width="150pt">
         <el-dialog title="提示" :visible.sync="centerDialogVisible" width="30%" center>
         <el-dialog title="提示" :visible.sync="centerDialogVisible" width="30%" center>
@@ -212,6 +352,7 @@ export default {
   name: 'UseCasePage',
   name: 'UseCasePage',
   data() {
   data() {
     return {
     return {
+      value: '',
       centerDialogVisible: false,
       centerDialogVisible: false,
       dialogFormVisibleQuery: false,
       dialogFormVisibleQuery: false,
       moduleTypeShow: false,
       moduleTypeShow: false,