|
@@ -35,13 +35,14 @@
|
|
|
@node-contextmenu="createUpdate"
|
|
|
@node-click="clickFun"
|
|
|
/>
|
|
|
+ <div style="background: #fff; padding:15%; text-align: center;" icon="el-icon-circle-plus">新建文件夹</div>
|
|
|
</el-aside>
|
|
|
<el-container>
|
|
|
<el-header style="background:#ffffff;height:auto; width:94%;margin:3%; font-size:14px;border-radius:8px;">
|
|
|
<el-row>
|
|
|
<el-col style="white-space:nowrap; display: flex; justify-content: center; align-items: center;margin-top:1.3%;">
|
|
|
前置条件
|
|
|
- <el-input v-model="value" placeholder="请输入内容" style="margin-left:1%;" />
|
|
|
+ <el-input v-model="createParticipation.caseCondition" clearable placeholder="请输入内容" style="margin-left:1%;" />
|
|
|
<el-button style="margin-left:1%;" type="primary" @click="queryCaseData(createParticipation)">查询</el-button>
|
|
|
<el-button @click="createGetShow">新增</el-button>
|
|
|
</el-col>
|
|
@@ -49,7 +50,7 @@
|
|
|
<el-row>
|
|
|
<el-col style="white-space:nowrap; display: flex; justify-content: center; align-items: center;margin:1.3% 0;">
|
|
|
<div style="width:50%;white-space:nowrap; display: flex; justify-content: center; align-items: center;">
|
|
|
- 序 列 号 <el-input v-model="createParticipation.folderName" placeholder="用例名" clearable style="width: 40%;margin: 0 2.5% 0 2%;" class="filter-item" />
|
|
|
+ 序 列 号 <el-input v-model="createParticipation.id" placeholder="用例名" clearable style="width: 40%;margin: 0 2.5% 0 2%;" class="filter-item" />
|
|
|
优先级
|
|
|
<el-select v-model="createParticipation.casePriority" style="width: 40%;margin: 0 3% 0 3%;" clearable placeholder="优先级">
|
|
|
<el-option v-for="item in priorityStrings" :key="item.value" :label="item.name" :value="item.value" />
|
|
@@ -71,57 +72,48 @@
|
|
|
</el-row>
|
|
|
</el-header>
|
|
|
<el-main style="background:#ffffff; width:94%;margin:0% 3% 3% 3%; font-size:14px;border-radius:8px;">
|
|
|
- <el-button type="primary" style="margin-left:1%;width:15%;" @click="uploadFile()">导入</el-button>
|
|
|
- <el-button style="margin-left:2%;width:15%;" @click="exportExcel">导出</el-button>
|
|
|
- <el-button style="margin-left:2%;width:15%;" @click="exportExcel">导出模版</el-button>
|
|
|
+ <el-button type="primary" style="margin-left:1%;width:15%;" @click="uploadFile()">导入Excel/Xmind</el-button>
|
|
|
+ <el-button style="margin-left:2%;width:15%;" @click="exportExcel">导出Excel/Xmind</el-button>
|
|
|
+ <el-button style="margin-left:2%;width:15%;" @click="exportExcel">导出Excel模版</el-button>
|
|
|
<!-- 主页table -->
|
|
|
- <el-table :data="gridData" fit height="330vh" tooltip-effect="dark" style="width: 100%" @select-all="clickAllData" @selection-change="handleSelectionChange">
|
|
|
+ <el-table :data="gridData" style="width: 100%" @select-all="clickAllData" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" min-width="55" align="center" @change="clickAllData(gridData)" />
|
|
|
- <el-table-column prop="id" label="ID" min-width="60px" align="center">
|
|
|
+ <el-table-column prop="id" label="序列号" min-width="80px" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.id }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="caseName" label="用例名" min-width="150" align="center">
|
|
|
- <template slot-scope="scope">{{ scope.row.caseName }}</template>
|
|
|
+ <el-table-column prop="caseCondition" :show-overflow-tooltip="true" label="前置条件" min-width="150" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.caseCondition }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="expectedResult" label="期望结果" min-width="150" align="center">
|
|
|
- <template slot-scope="scope">{{ scope.row.expectedResult }}</template>
|
|
|
+ <el-table-column prop="api" :show-overflow-tooltip="true" label="API" min-width="150" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.api }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="casePriorityName" label="优先级" min-width="80" align="center">
|
|
|
- <template slot-scope="scope">{{ scope.row.casePriorityName }}</template>
|
|
|
+ <el-table-column prop="description" :show-overflow-tooltip="true" label="执行步骤" min-width="150" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.description }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="creatorName" label="创建人" min-width="100" align="center">
|
|
|
- <template slot-scope="scope">{{ scope.row.creatorName }}</template>
|
|
|
+ <el-table-column prop="casePriority" label="优先级" min-width="60" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.casePriority }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="modifierName" label="修改人" min-width="100" align="center">
|
|
|
- <template slot-scope="scope">{{ scope.row.modifierName }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="createTime" label="创建时间" min-width="200" align="center">
|
|
|
- <template slot-scope="scope">{{ scope.row.createTime }}</template>
|
|
|
+ <el-table-column prop="creatorName" label="操作人" min-width="100" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.modifier }}</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="queryGetShow(scope.row)">查看</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 v-show="false" id="out-table" :data="tableData" tooltip-effect="dark" style="width: 100%">
|
|
|
+ <el-table-column prop="id" label="序号" width="50" />
|
|
|
+ <el-table-column prop="caseCondition" 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="accessory" label="附件" />
|
|
|
+ <el-table-column prop="casePriority" 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="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
</el-main>
|
|
@@ -129,7 +121,7 @@
|
|
|
</el-container>
|
|
|
|
|
|
<!-- 新增-编辑 -->
|
|
|
- <el-dialog :title="titleName" :visible.sync="dialogFormVisibleUpdate" width="80%">
|
|
|
+ <!-- <el-dialog :title="titleName" :visible.sync="dialogFormVisibleUpdate" width="80%">
|
|
|
<el-form ref="caseData" :model="caseData" label-width="90pt" :rules="createFormData">
|
|
|
<div style="display:flex;">
|
|
|
<div style="flex:1;">
|
|
@@ -169,9 +161,9 @@
|
|
|
<el-button type="primary" @click="dialogFormVisibleUpdate = false">关 闭</el-button>
|
|
|
<el-button type="primary" @click="caseCreateCase(caseData, titleName)">确 定</el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog> -->
|
|
|
|
|
|
- <el-dialog title="查看" :visible.sync="dialogFormVisibleQuery" width="80%">
|
|
|
+ <!-- <el-dialog title="查看" :visible.sync="dialogFormVisibleQuery" width="80%">
|
|
|
<el-form ref="caseData" :model="caseData" label-width="90pt">
|
|
|
<div style="display:flex;">
|
|
|
<div style="flex:1;">
|
|
@@ -194,14 +186,14 @@
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="dialogFormVisibleQuery = false">关 闭</el-button>
|
|
|
</div>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { createFolderData, queryAllFolderData, queryCasesData, createCaseData, updateCaseData, deleteFolderData, deleteCaseData, settingQueryModuleInfoListData, updateFolderData } from '@/api/caseProject.js'
|
|
|
+import { createFolderData, queryAllFolderData, queryCasesData, deleteFolderData, deleteCaseData, settingQueryModuleInfoListData, updateFolderData } from '@/api/caseProject.js'
|
|
|
import { mockUrl } from '@/apiConfig/api'
|
|
|
import FileSaver from 'file-saver'
|
|
|
import axios from 'axios'
|
|
@@ -213,12 +205,12 @@ export default {
|
|
|
return {
|
|
|
value: '',
|
|
|
centerDialogVisible: false,
|
|
|
- dialogFormVisibleQuery: false,
|
|
|
+ // dialogFormVisibleQuery: false,
|
|
|
moduleTypeShow: false,
|
|
|
dataShow: true,
|
|
|
titleName: '',
|
|
|
createCaseCode: false,
|
|
|
- dialogFormVisibleUpdate: false,
|
|
|
+ // dialogFormVisibleUpdate: false,
|
|
|
priorityStrings: [{ name: 'p0', value: 0 }, { name: 'p1', value: 1 }, { name: 'p2', value: 2 }, { name: 'p3', value: 3 }],
|
|
|
projectTypeStrings: [{ name: 'B端', value: 1 }, { name: 'C端', value: 2 }],
|
|
|
taskTypeStrings: [{ name: '客户端', value: 1 }, { name: '服务端', value: 2 }],
|
|
@@ -254,6 +246,7 @@ export default {
|
|
|
},
|
|
|
createTimeData: '',
|
|
|
userData: '',
|
|
|
+ caseInfo: '',
|
|
|
pageSize: 5,
|
|
|
curIndex: 0,
|
|
|
startId: '',
|
|
@@ -262,15 +255,15 @@ export default {
|
|
|
moduleTypeStr: [],
|
|
|
gridData: [],
|
|
|
caseData: {},
|
|
|
- createFormData: {
|
|
|
- caseName: [{ required: true, message: '用例名不能为空', trigger: 'change' }],
|
|
|
- description: [{ required: true, message: '用例描述不能为空', trigger: 'change' }],
|
|
|
- expectedResult: [{ required: true, message: '期望结果不能为空', trigger: 'change' }],
|
|
|
- api: [{ required: true, message: '对应接口不能为空', trigger: 'change' }],
|
|
|
- projectType: [{ required: true, message: '项目类型不能为空', trigger: 'change' }],
|
|
|
- taskType: [{ required: true, message: '任务类型不能为空', trigger: 'change' }],
|
|
|
- casePriority: [{ required: true, message: '用例优先级不能为空', trigger: 'change' }]
|
|
|
- },
|
|
|
+ // createFormData: {
|
|
|
+ // caseName: [{ required: true, message: '用例名不能为空', trigger: 'change' }],
|
|
|
+ // description: [{ required: true, message: '用例描述不能为空', trigger: 'change' }],
|
|
|
+ // expectedResult: [{ required: true, message: '期望结果不能为空', trigger: 'change' }],
|
|
|
+ // api: [{ required: true, message: '对应接口不能为空', trigger: 'change' }],
|
|
|
+ // projectType: [{ required: true, message: '项目类型不能为空', trigger: 'change' }],
|
|
|
+ // taskType: [{ required: true, message: '任务类型不能为空', trigger: 'change' }],
|
|
|
+ // casePriority: [{ required: true, message: '用例优先级不能为空', trigger: 'change' }]
|
|
|
+ // },
|
|
|
dialogTableVisible: false,
|
|
|
formData: {},
|
|
|
formLabelWidth: '120px',
|
|
@@ -327,7 +320,6 @@ export default {
|
|
|
}
|
|
|
this.data1.push(arr)
|
|
|
}
|
|
|
- console.log(this.data1)
|
|
|
if (this.data1.length === 0) {
|
|
|
this.createCaseCode = true
|
|
|
this.dataShow = false
|
|
@@ -353,19 +345,12 @@ export default {
|
|
|
curIndex: this.curIndex,
|
|
|
caseFolderId: this.startId
|
|
|
}
|
|
|
+
|
|
|
queryCasesData(this.formData).then(res => {
|
|
|
- this.gridData = res.data
|
|
|
+ this.gridData = res.data.list
|
|
|
})
|
|
|
},
|
|
|
clickAllData(rows) {
|
|
|
- // if (rows) {
|
|
|
- // rows.forEach(row => {
|
|
|
- // this.$refs.multipleTable.toggleRowSelection(row)
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // this.$refs.multipleTable.clearSelection()
|
|
|
- // }
|
|
|
-
|
|
|
this.formData = {
|
|
|
caseFolderId: this.startId
|
|
|
}
|
|
@@ -373,99 +358,81 @@ export default {
|
|
|
this.tableData = res.data
|
|
|
})
|
|
|
},
|
|
|
- taskTypeChange(ele) {
|
|
|
- if (ele === 2) {
|
|
|
- this.moduleTypeShow = true
|
|
|
- } else {
|
|
|
- this.moduleTypeShow = false
|
|
|
- }
|
|
|
- },
|
|
|
+ // taskTypeChange(ele) {
|
|
|
+ // if (ele === 2) {
|
|
|
+ // this.moduleTypeShow = true
|
|
|
+ // } else {
|
|
|
+ // this.moduleTypeShow = false
|
|
|
+ // }
|
|
|
+ // },
|
|
|
// 新增
|
|
|
- caseCreateCase(vel, e) {
|
|
|
- if (e === '编辑') {
|
|
|
- updateCaseData(this.caseData).then(res => {
|
|
|
- this.successFun()
|
|
|
- this.dialogFormVisibleUpdate = false
|
|
|
- })
|
|
|
- }
|
|
|
- if (vel !== '' && e === '新增') {
|
|
|
- this.$refs['caseData'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.caseData = vel
|
|
|
- this.caseData.creator = this.userInformation
|
|
|
- this.caseData.creatorName = this.userNames
|
|
|
- this.caseData.modifier = this.userInformation
|
|
|
- this.caseData.pageSize = 5
|
|
|
- this.caseData.curIndex = 0
|
|
|
- this.caseData.caseFolderId = this.startId
|
|
|
- this.caseData.bizId = this.bizJson
|
|
|
- createCaseData(this.caseData).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.gridData = res.data
|
|
|
- this.successFun()
|
|
|
- this.dialogFormVisibleUpdate = false
|
|
|
- } else {
|
|
|
- this.$notify({ title: '提示', message: res.msg, duration: 2000 })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ // caseCreateCase(vel, e) {
|
|
|
+ // if (e === '编辑') {
|
|
|
+ // updateCaseData(this.caseData).then(res => {
|
|
|
+ // this.successFun()
|
|
|
+ // // this.dialogFormVisibleUpdate = false
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // if (vel !== '' && e === '新增') {
|
|
|
+ // this.$refs['caseData'].validate((valid) => {
|
|
|
+ // if (valid) {
|
|
|
+ // this.caseData = vel
|
|
|
+ // this.caseData.creator = this.userInformation
|
|
|
+ // this.caseData.creatorName = this.userNames
|
|
|
+ // this.caseData.modifier = this.userInformation
|
|
|
+ // this.caseData.pageSize = 5
|
|
|
+ // this.caseData.curIndex = 0
|
|
|
+ // this.caseData.caseFolderId = this.startId
|
|
|
+ // this.caseData.bizId = this.bizJson
|
|
|
+ // createCaseData(this.caseData).then(res => {
|
|
|
+ // if (res.code === 200) {
|
|
|
+ // this.gridData = res.data
|
|
|
+ // this.successFun()
|
|
|
+ // // this.dialogFormVisibleUpdate = false
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '提示, 请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
// 查询
|
|
|
queryCaseData(ele) {
|
|
|
if (this.createParticipation.caseName === '') return false
|
|
|
if (this.startId === '') {
|
|
|
- this.$notify({ title: '提示', message: '请选择目录', duration: 2000 })
|
|
|
+ this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
this.createParticipation = ele
|
|
|
this.createParticipation.caseFolderId = this.startId
|
|
|
- this.createParticipation.pageSize = this.pageSize
|
|
|
- this.createParticipation.curIndex = this.curIndex
|
|
|
queryCasesData(this.createParticipation).then(res => {
|
|
|
- this.gridData = res.data
|
|
|
+ this.gridData = res.data.list
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
// 查看
|
|
|
queryGetShow(ele) {
|
|
|
- if (this.startId === '') {
|
|
|
- this.$notify({ title: '提示', message: '请选择目录', duration: 2000 })
|
|
|
- } else {
|
|
|
- this.$router.push({ path: '/Platform/useCasePage/queryUse' })
|
|
|
- for (var vel of ele) {
|
|
|
- var obj = vel
|
|
|
- }
|
|
|
- if (obj.taskType === 2) { this.moduleTypeShow = true }
|
|
|
- this.dialogFormVisibleQuery = true
|
|
|
- this.caseData = {}
|
|
|
- this.caseData = obj
|
|
|
+ var data = {
|
|
|
+ id: ele.id,
|
|
|
+ caseFolderId: ele.caseFolderId
|
|
|
}
|
|
|
+ this.$router.push({ path: '/Platform/useCasePage/queryUse', query: { data: data }})
|
|
|
},
|
|
|
// 编辑
|
|
|
updateGetShow(ele) {
|
|
|
- this.titleName = '编辑'
|
|
|
- this.caseData = ele
|
|
|
if (this.startId === '') {
|
|
|
- this.$notify({ title: '提示', message: '请选择目录', duration: 2000 })
|
|
|
+ this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
- if (ele.taskType === 2) { this.moduleTypeShow = true }
|
|
|
- this.dialogFormVisibleUpdate = true
|
|
|
+ this.$router.push({ path: '/Platform/useCasePage/createUse', query: { id: this.startId }})
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 新增
|
|
|
createGetShow() {
|
|
|
- this.titleName = '新增'
|
|
|
if (this.startId === '') {
|
|
|
- this.$notify({ title: '提示', message: '请选择目录', duration: 2000 })
|
|
|
+ this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
- // this.$router.push({ name: '用例新增' })
|
|
|
- this.$router.push({ path: '/Platform/useCasePage/createUse' })
|
|
|
- this.moduleTypeShow = false
|
|
|
- // if (this.$refs['caseData'] !== undefined) {
|
|
|
- // this.$refs['caseData'].resetFields()
|
|
|
- // }
|
|
|
+ this.$router.push({ path: '/Platform/useCasePage/createUse', query: { data: this.startId }})
|
|
|
}
|
|
|
},
|
|
|
// 文件夹新增
|
|
@@ -592,7 +559,7 @@ export default {
|
|
|
},
|
|
|
deleteCaseData(e) {
|
|
|
if (this.startId === '') {
|
|
|
- this.$notify({ title: '提示', message: '请选择目录', duration: 2000 })
|
|
|
+ this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
this.$confirm('是否确认删除', '确认信息', {
|
|
|
distinguishCancelAndClose: true,
|
|
@@ -600,15 +567,19 @@ export default {
|
|
|
cancelButtonText: '取消'
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.formData = { id: e, modifier: this.userInformation }
|
|
|
- deleteCaseData(this.formData).then(res => {
|
|
|
+ this.caseInfo = { id: e, modifier: this.userInformation }
|
|
|
+ deleteCaseData(this.caseInfo).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- this.$message({ type: 'success', message: '已删除' })
|
|
|
this.data1 = []
|
|
|
this.AllQueryFolderData()
|
|
|
- this.createParticipation.caseFolderId = this.startId
|
|
|
- queryCasesData(this.createParticipation).then(res => {
|
|
|
- this.gridData = res.data
|
|
|
+ var data = {
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ curIndex: this.curIndex,
|
|
|
+ caseFolderId: this.startId
|
|
|
+ }
|
|
|
+ queryCasesData(data).then(res => {
|
|
|
+ this.gridData = res.data.list
|
|
|
+ this.$message({ type: 'success', message: '已删除' })
|
|
|
})
|
|
|
} else {
|
|
|
this.errorFun(res.msg)
|
|
@@ -626,7 +597,7 @@ export default {
|
|
|
},
|
|
|
exportExcel() {
|
|
|
if (this.startId === '') {
|
|
|
- this.$notify({ title: '提示', message: '请选择目录', duration: 2000 })
|
|
|
+ this.$message({ message: '提示,👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
/* generate workbook object from table */
|
|
|
var wb = XLSX.utils.table_to_book(document.querySelector('#out-table'))
|