|
@@ -4,17 +4,18 @@
|
|
|
<div style="position: absolute;width: 100%;">
|
|
|
<div style="background:#F2F3F6;">
|
|
|
<el-container>
|
|
|
- <el-aside width="15%" style="margin:2.5% 0 2.5% 2.5%; border-radius:8px;">
|
|
|
- <div v-show="createCaseCode" style="background: #FFF; height:78vh; text-align:center; padding:50% 0;">
|
|
|
- <p>空空如也</p>
|
|
|
- <el-input v-show="Folder_Show" ref="input1" v-model="add_Folder" size="mini" placeholder="新建文件夹" @blur="hide_input(add_Folder)" />
|
|
|
- </div>
|
|
|
- <div v-show="dataShow" class="nav_Input" style="background: #fff; min-height:78vh;border-radius:8px;" @click="click_fa" @mouseout="blues">
|
|
|
+ <el-aside width="15%" style=" background: #FFF;margin: 1% 0 1% 1%; border-radius:8px;">
|
|
|
+ <div class="nav_Input" style="min-height:81vh;" @click="click_fa" @mouseout="blues">
|
|
|
+ <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"
|
|
|
node-key="id"
|
|
|
draggable
|
|
|
:expand-on-click-node="true"
|
|
|
+ :default-expanded-keys="[1]"
|
|
|
+ :default-checked-keys="[5]"
|
|
|
@node-drag-start="handleDragStart"
|
|
|
@node-drag-enter="handleDragEnter"
|
|
|
@node-drag-leave="handleDragLeave"
|
|
@@ -29,18 +30,18 @@
|
|
|
<el-button v-show="data.del" type="text" size="mini" icon="el-icon-delete" @click="() => remove(node, data)" />
|
|
|
</span>
|
|
|
</el-tree>
|
|
|
- <el-input v-show="Folder_Show" ref="input1" v-model="add_Folder" size="mini" placeholder="新建文件夹" @blur="hide_input(add_Folder)" />
|
|
|
+ <el-input v-if="Folder_Show" ref="input1" v-model="add_Folder" size="mini" placeholder="新建文件夹" @blur="hide_input(add_Folder)" />
|
|
|
</div>
|
|
|
- <div style="background: #fff; padding: 0% 15% 15% 15%; text-align: center;"><el-button icon="el-icon-circle-plus" style="border:none;" @click="createFolder">新建文件夹</el-button></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:94%;margin:3%; font-size:13px; border-radius:8px;">
|
|
|
+ <el-header style="background:#ffffff;height:auto; width:98%;margin: 1%; font-size:13px; 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="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-button @click="queryUpdateCreatd('', 3)">新增</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
@@ -67,12 +68,13 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</el-header>
|
|
|
- <el-main style="background:#ffffff; width:94%;margin:0% 3% 3% 3%; font-size:14px;border-radius:8px;">
|
|
|
+ <el-main style="background:#ffffff; width:98%;margin:0% 1% 1% 1%; font-size:14px;border-radius:8px;">
|
|
|
<el-button type="primary" style="margin-left:1%;width:10%;" @click="uploadFile()">导入</el-button>
|
|
|
- <el-button style="margin-left:2%;width:10%;" @click="exportExcel">导出</el-button>
|
|
|
- <el-button style="margin-left:2%;width:10%;" @click="exportExcel">导出模版</el-button>
|
|
|
+ <el-tooltip class="item" effect="light" content="导出勾选项,没有勾选将导出模版" placement="top">
|
|
|
+ <el-button style="margin-left:2%;width:10%;" @click="exportExcel">导出</el-button>
|
|
|
+ </el-tooltip>
|
|
|
<!-- 主页table -->
|
|
|
- <el-table :data="gridData" :header-cell-style="{ background: '#EBEEF5' }" style="width: 100%; font-size:13px;margin-top:1%;" border @select-all="clickAllData" @selection-change="handleSelectionChange">
|
|
|
+ <el-table :data="gridData" :header-cell-style="{ background: '#F0F2F4', color: '#333B4A' }" style="width: 100%; font-size:13px;margin-top:1%;" border @select-all="clickAllData" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" min-width="50" align="center" @change="clickAllData(gridData)" />
|
|
|
<el-table-column prop="id" label="序列号" min-width="80" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.id }}</template>
|
|
@@ -94,9 +96,9 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" min-width="220px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <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>
|
|
|
+ <el-button size="mini" class="btn_query" plain @click="queryUpdateCreatd(scope.row, 1)">查看</el-button>
|
|
|
+ <el-button size="mini" type="primary" plain @click="queryUpdateCreatd(scope.row, 2)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="danger" plain @click="deleteCaseData(scope.row.id)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -111,7 +113,9 @@
|
|
|
<el-table-column prop="casePriority" label="用例优先级" />
|
|
|
<el-table-column prop="remark" label="备注" />
|
|
|
</el-table>
|
|
|
- <el-pagination :current-page="curIndex" :page-sizes="[5]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
+ <div align="center">
|
|
|
+ <el-pagination :current-page="curIndex" :page-sizes="[5]" :page-size="pageSize" layout="total, prev, pager, next" :total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
+ </div>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
</el-container>
|
|
@@ -126,6 +130,7 @@ import { mockUrl } from '@/apiConfig/api'
|
|
|
import FileSaver from 'file-saver'
|
|
|
import axios from 'axios'
|
|
|
import XLSX from 'xlsx'
|
|
|
+import Utils from '../../util.js'
|
|
|
|
|
|
export default {
|
|
|
name: 'UseCasePage',
|
|
@@ -145,17 +150,12 @@ export default {
|
|
|
node_Name: {},
|
|
|
Folder_Show: false,
|
|
|
add_Folder: '',
|
|
|
- moduleTypeShow: false,
|
|
|
+ node_Data: false,
|
|
|
dataShow: true,
|
|
|
- titleName: '',
|
|
|
- createCaseCode: 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 }],
|
|
|
userInformation: localStorage.getItem('username'),
|
|
|
userNames: localStorage.getItem('realname'),
|
|
|
bizJson: localStorage.getItem('key'),
|
|
|
- createTimeData: '',
|
|
|
userData: '',
|
|
|
caseInfo: '',
|
|
|
pageSize: 5,
|
|
@@ -167,11 +167,9 @@ export default {
|
|
|
createParticipation: {},
|
|
|
moduleTypeStr: [],
|
|
|
gridData: [],
|
|
|
- caseData: {},
|
|
|
formData: {},
|
|
|
data1: [],
|
|
|
tableData: [],
|
|
|
- excelData: [],
|
|
|
imFile: '',
|
|
|
failNum: '',
|
|
|
successNum: '',
|
|
@@ -181,14 +179,78 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.AllQueryFolderData()
|
|
|
this.moduleTypeArr()
|
|
|
},
|
|
|
mounted() {
|
|
|
+ var that = this
|
|
|
+ Utils.$on('demo', function(msg) {
|
|
|
+ that.AllQueryFolderData(msg)
|
|
|
+ })
|
|
|
this.imFile = document.getElementById('imFile')
|
|
|
this.initWindow()
|
|
|
+ this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 左侧导航栏
|
|
|
+ AllQueryFolderData(e) {
|
|
|
+ if (e !== '') {
|
|
|
+ this.gridData = []
|
|
|
+ this.data1 = []
|
|
|
+ this.formData = { bizId: e }
|
|
|
+ queryAllFolderData(this.formData).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ for (var ele of res.data) {
|
|
|
+ var arr = {}
|
|
|
+ arr.id = ele.id
|
|
|
+ arr.label = ele.folderName
|
|
|
+ arr.children = []
|
|
|
+ if (ele.subCaseFolderInfos !== null) {
|
|
|
+ for (var vel of ele.subCaseFolderInfos) {
|
|
|
+ var add = {}
|
|
|
+ add.id = vel.id
|
|
|
+ add.label = vel.folderName
|
|
|
+ add.children = []
|
|
|
+ if (vel.subCaseFolderInfos !== null) {
|
|
|
+ for (var v of vel.subCaseFolderInfos) {
|
|
|
+ var as = {}
|
|
|
+ as.id = v.id
|
|
|
+ as.label = v.folderName
|
|
|
+ as.children = []
|
|
|
+ if (v.subCaseFolderInfos != null) {
|
|
|
+ for (var a of v.subCaseFolderInfos) {
|
|
|
+ var add4 = {}
|
|
|
+ add4.id = a.id
|
|
|
+ add4.label = a.folderName
|
|
|
+ as.children.push(add4)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ add.children.push(as)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ arr.children.push(add)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.data1.push(arr)
|
|
|
+ }
|
|
|
+ if (this.data1.length === 0) {
|
|
|
+ this.node_Data = true
|
|
|
+ this.dataShow = false
|
|
|
+ } else {
|
|
|
+ this.node_Data = false
|
|
|
+ this.dataShow = true
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.dataShow = false
|
|
|
+ this.node_Data = true
|
|
|
+ this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.dataShow = false
|
|
|
+ this.node_Data = true
|
|
|
+ this.$message({ message: '请先选择业务线', type: 'error', duration: 1000, offset: 150 })
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
blues() {
|
|
|
console.log('blue')
|
|
@@ -201,6 +263,7 @@ export default {
|
|
|
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()
|
|
@@ -219,9 +282,9 @@ export default {
|
|
|
}
|
|
|
if (val === '') { // 判断用户是否有输入
|
|
|
val = this.label // 没有输入拿之前的label替代
|
|
|
- this.end_Data = { parentFolderId: mun, folderName: val, xmindUrl: '', id: data.id, bizId: this.bizJson, modifier: this.userInformation, creator: this.userInformation }
|
|
|
+ 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: this.bizJson, modifier: this.userInformation, creator: this.userInformation }
|
|
|
+ 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
|
|
@@ -229,11 +292,11 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({ type: 'success', message: res.msg, duration: 1000 })
|
|
|
this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
+ this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
} else {
|
|
|
this.$message({ type: 'error', message: res.msg, duration: 1000 })
|
|
|
this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
+ this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -254,50 +317,6 @@ export default {
|
|
|
document.getElementById('init-window').parentNode.style.overflow = 'hidden'
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
- // 左侧导航栏
|
|
|
- AllQueryFolderData() {
|
|
|
- this.formData = { bizId: this.bizJson }
|
|
|
- queryAllFolderData(this.formData).then(res => {
|
|
|
- for (var ele of res.data) {
|
|
|
- var arr = {}
|
|
|
- arr.id = ele.id
|
|
|
- arr.label = ele.folderName
|
|
|
- arr.children = []
|
|
|
- if (ele.subCaseFolderInfos !== null) {
|
|
|
- for (var vel of ele.subCaseFolderInfos) {
|
|
|
- var add = {}
|
|
|
- add.id = vel.id
|
|
|
- add.label = vel.folderName
|
|
|
- add.children = []
|
|
|
- if (vel.subCaseFolderInfos !== null) {
|
|
|
- for (var v of vel.subCaseFolderInfos) {
|
|
|
- var as = {}
|
|
|
- as.id = v.id
|
|
|
- as.label = v.folderName
|
|
|
- as.children = []
|
|
|
- if (v.subCaseFolderInfos != null) {
|
|
|
- for (var a of v.subCaseFolderInfos) {
|
|
|
- var add4 = {}
|
|
|
- add4.id = a.id
|
|
|
- add4.label = a.folderName
|
|
|
- as.children.push(add4)
|
|
|
- }
|
|
|
- }
|
|
|
- add.children.push(as)
|
|
|
- }
|
|
|
- }
|
|
|
- arr.children.push(add)
|
|
|
- }
|
|
|
- }
|
|
|
- this.data1.push(arr)
|
|
|
- }
|
|
|
- if (this.data1.length === 0) {
|
|
|
- this.createCaseCode = true
|
|
|
- this.dataShow = false
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
moduleTypeArr() {
|
|
|
settingQueryModuleInfoListData(this.formData).then(res => {
|
|
|
this.moduleTypeStr = res.data
|
|
@@ -340,6 +359,7 @@ export default {
|
|
|
createFolder() {
|
|
|
this.Folder_Show = true
|
|
|
this.add_Folder = ''
|
|
|
+ this.node_Data = false
|
|
|
setTimeout(() => { this.$refs.input1.focus() }, 100)
|
|
|
},
|
|
|
|
|
@@ -358,10 +378,11 @@ export default {
|
|
|
createFolderData(this.formData).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
|
|
|
- this.createCaseCode = false
|
|
|
+ // this.createCaseCode = false
|
|
|
this.dataShow = true
|
|
|
+ this.node_Data = false
|
|
|
this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
+ this.AllQueryFolderData(this.bizJson)
|
|
|
this.created_id = ''
|
|
|
} else {
|
|
|
this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
|
|
@@ -372,6 +393,7 @@ export default {
|
|
|
} else {
|
|
|
this.$message({ message: '取消创建文件夹', type: 'success', duration: 1000, offset: 150 })
|
|
|
this.Folder_Show = false
|
|
|
+ this.node_Data = true
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -383,34 +405,29 @@ export default {
|
|
|
} 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.list
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- // 查看
|
|
|
- queryGetShow(ele) {
|
|
|
- var data = {
|
|
|
- id: ele.id,
|
|
|
- caseFolderId: ele.caseFolderId
|
|
|
- }
|
|
|
- this.$router.push({ path: '/Platform/useCasePage/queryUse', query: { data: data }})
|
|
|
- },
|
|
|
- // 编辑
|
|
|
- updateGetShow(ele) {
|
|
|
- if (this.startId === '') {
|
|
|
- this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
- } else {
|
|
|
- this.$router.push({ path: '/Platform/useCasePage/createUse', query: { id: this.startId }})
|
|
|
- }
|
|
|
- },
|
|
|
|
|
|
- // 新增
|
|
|
- createGetShow() {
|
|
|
+ queryUpdateCreatd(ele, e) {
|
|
|
if (this.startId === '') {
|
|
|
this.$message({ message: '提示, 👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
- this.$router.push({ path: '/Platform/useCasePage/createUse', query: { data: this.startId }})
|
|
|
+ switch (e) {
|
|
|
+ case 1: // 查看
|
|
|
+ this.$router.push({ path: '/Platform/useCasePage/queryUse', query: { id: ele.id, caseFolderId: ele.caseFolderId }})
|
|
|
+ break
|
|
|
+ case 2: // 编辑
|
|
|
+ this.$router.push({ path: '/Platform/useCasePage/createUse', query: { id: this.startId }})
|
|
|
+ break
|
|
|
+ case 3: // 新增
|
|
|
+ this.$router.push({ path: '/Platform/useCasePage/createUse', query: { data: this.startId }})
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
@@ -436,19 +453,20 @@ export default {
|
|
|
},
|
|
|
handleDrop(draggingNode, dropNode, dropType, ev) {
|
|
|
console.log('拖拽成功完成时触发的事件', dropNode.key, dropType)
|
|
|
+ var startEnd = { parentFolderId: dropNode.key, id: this.startKey, bizId: localStorage.getItem('key'), modifier: this.userInformation, creator: this.userInformation, xmindUrl: '' }
|
|
|
+ this.ConfirmSubmission(startEnd)
|
|
|
},
|
|
|
|
|
|
ConfirmSubmission(vel) {
|
|
|
- // var startEnd = { parentFolderId: vel, id: this.startKey, bizId: this.bizJson, modifier: this.userInformation, creator: this.userInformation, xmindUrl: '' }
|
|
|
updateFolderData(vel).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({ type: 'success', message: res.msg, duration: 1000 })
|
|
|
this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
+ this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
} else {
|
|
|
this.$message({ type: 'error', message: res.msg, duration: 1000 })
|
|
|
this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
+ this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -468,7 +486,7 @@ export default {
|
|
|
if (res.code === 200) {
|
|
|
this.$message({ type: 'success', message: '已删除' })
|
|
|
this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
+ this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
} else {
|
|
|
this.$message({ type: 'error', message: res.msg, duration: 1000 })
|
|
|
}
|
|
@@ -479,7 +497,6 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
clickFun(e) {
|
|
|
- console.log(e)
|
|
|
this.startId = e.id
|
|
|
this.created_id = e.id
|
|
|
this.formData = {
|
|
@@ -506,7 +523,7 @@ export default {
|
|
|
deleteCaseData(this.caseInfo).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
+ this.AllQueryFolderData(localStorage.getItem('key'))
|
|
|
var data = {
|
|
|
pageSize: this.pageSize,
|
|
|
curIndex: this.curIndex,
|
|
@@ -587,9 +604,9 @@ export default {
|
|
|
},
|
|
|
uploadFile() { // 按钮导入
|
|
|
if (this.startId === '') {
|
|
|
- this.$notify({ title: '提示', message: '请选择目录', duration: 2000 })
|
|
|
+ this.$message({ message: '提示,👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
|
} else {
|
|
|
- this.$refs.imFile.click() // this.imFile.click()
|
|
|
+ this.$refs.imFile.click()
|
|
|
}
|
|
|
},
|
|
|
updateCaseListData() {
|
|
@@ -621,6 +638,13 @@ export default {
|
|
|
/* white-space: nowrap; */
|
|
|
text-overflow: ellipsis;
|
|
|
}
|
|
|
- .block >>> th{ background-color: #F0F2F4 !important;}
|
|
|
-
|
|
|
+ .btn_query .el-button--primary.is-plain {
|
|
|
+ color: #000000 !important;
|
|
|
+ background: #F9F9FA !important;
|
|
|
+ border-color: #F9F9FA !important;
|
|
|
+ }
|
|
|
+ .button_query :hover{
|
|
|
+ background: #409EFF;
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
</style>
|