|
@@ -4,43 +4,36 @@
|
|
|
<div style="position: absolute;width: 100%;">
|
|
|
<div style="background:#F2F3F6;">
|
|
|
<el-container>
|
|
|
- <el-aside width="150pt" style="margin:2.5% 0 2.5% 2.5%; border-radius:8px;">
|
|
|
- <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="info" @click="createCase(formData)">新增</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
- <div v-show="createCaseCode" style="background: #E9EEF3; height:80vh; text-align:center; padding:50% 0;">
|
|
|
- <p>请先创建文件夹 ·····</p>
|
|
|
- <el-button type="primary" @click="changeStartId">新</el-button>
|
|
|
+ <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>
|
|
|
</div>
|
|
|
- <div style="background: #fff; height:73vh; padding:15% 0;">
|
|
|
+ <div v-show="dataShow" class="nav_Input" style="background: #fff; min-height:78vh;border-radius:8px;" @click="click_fa" @mouseout="blues">
|
|
|
<el-tree
|
|
|
- v-show="dataShow"
|
|
|
:data="data1"
|
|
|
node-key="id"
|
|
|
draggable
|
|
|
- :allow-drop="allowDrop"
|
|
|
- :allow-drag="allowDrag"
|
|
|
+ :expand-on-click-node="true"
|
|
|
@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-input v-show="Folder_Show" ref="input1" v-model="add_Folder" placeholder="新建文件夹" clearable @blur="hide_input(add_Folder)" />
|
|
|
+ >
|
|
|
+ <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 | ellipsis }}</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-show="Folder_Show" ref="input1" v-model="add_Folder" size="mini" placeholder="新建文件夹" @blur="hide_input(add_Folder)" />
|
|
|
</div>
|
|
|
- <div style="background: #fff; padding:15%; text-align: center;"><el-button icon="el-icon-circle-plus" style="border:none;" @click="createFolder">新建文件夹</el-button></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>
|
|
|
</el-aside>
|
|
|
<el-container>
|
|
|
- <el-header style="background:#ffffff;height:auto; width:94%;margin:3%; font-size:14px;border-radius:8px;">
|
|
|
+ <el-header style="background:#ffffff;height:auto; width:94%;margin:3%; 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%;">
|
|
|
前置条件
|
|
@@ -54,11 +47,11 @@
|
|
|
<div style="width:50%;white-space:nowrap; display: flex; justify-content: center; align-items: center;">
|
|
|
序 列 号 <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-select v-model="createParticipation.casePriority" style="width: 40%;margin: 0 4% 0 3%;" clearable placeholder="优先级">
|
|
|
<el-option v-for="item in priorityStrings" :key="item.value" :label="item.name" :value="item.value" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
- api接口<el-input v-model="createParticipation.api" placeholder="api接口" clearable style="width: 50%;margin-left:2.5%;" class="filter-item" />
|
|
|
+ api接口<el-input v-model="createParticipation.api" placeholder="api接口" clearable style="width: 50%;margin-left:1.8%;" class="filter-item" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
@@ -66,39 +59,39 @@
|
|
|
<div style="width:50%;white-space:nowrap; display: flex; justify-content: center; align-items: center;">
|
|
|
创建时间
|
|
|
<el-date-picker v-model="createParticipation.createTime" style="width:40%;margin: 0 4.5% 0 2%;" type="datetime" placeholder="开始日期" /><span style="margin: 0 1% 0 1% ;"> 一 </span>
|
|
|
- <el-date-picker v-model="createParticipation.modifyTime" style="width:40%;margin: 0 3.5% 0 4.5%;" type="datetime" placeholder="结束日期" />
|
|
|
+ <el-date-picker v-model="createParticipation.modifyTime" style="width:40%;margin: 0 4.5% 0 4.5%;" type="datetime" placeholder="结束日期" />
|
|
|
</div>
|
|
|
- 操作人 <el-input v-model="createParticipation.modifier" placeholder="创建人" clearable style="width: 50%;margin-left:2.5%;" class="filter-item" />
|
|
|
+ 操作人 <el-input v-model="createParticipation.modifier" placeholder="创建人" clearable style="width: 50%;margin-left:2%;" 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)">
|
|
|
</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-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: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>
|
|
|
<!-- 主页table -->
|
|
|
- <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="序列号" min-width="80px" align="center">
|
|
|
+ <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-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>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="caseCondition" :show-overflow-tooltip="true" label="前置条件" min-width="150" align="center">
|
|
|
+ <el-table-column prop="caseCondition" :show-overflow-tooltip="true" label="前置条件" min-width="140" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.caseCondition }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="api" :show-overflow-tooltip="true" label="API" min-width="150" align="center">
|
|
|
+ <el-table-column prop="api" :show-overflow-tooltip="true" label="API" min-width="140" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.api }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="description" :show-overflow-tooltip="true" label="执行步骤" min-width="150" align="center">
|
|
|
+ <el-table-column prop="description" :show-overflow-tooltip="true" label="执行步骤" min-width="140" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.description }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="casePriority" label="优先级" min-width="60" align="center">
|
|
|
- <template slot-scope="scope">{{ scope.row.casePriority }}</template>
|
|
|
+ <el-table-column prop="casePriority" label="优先级" min-width="80" align="center">
|
|
|
+ <template slot-scope="scope">{{ scope.row.casePriorityName }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="creatorName" label="操作人" min-width="100" align="center">
|
|
|
+ <el-table-column prop="creatorName" label="操作人" min-width="110" align="center">
|
|
|
<template slot-scope="scope">{{ scope.row.modifier }}</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" min-width="220px" align="center" fixed="right">
|
|
|
+ <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>
|
|
@@ -117,7 +110,7 @@
|
|
|
<el-table-column prop="casePriority" label="用例优先级" />
|
|
|
<el-table-column prop="remark" 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-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" />
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
</el-container>
|
|
@@ -127,7 +120,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { createFolderData, queryAllFolderData, queryCasesData, deleteFolderData, deleteCaseData, settingQueryModuleInfoListData, updateFolderData } from '@/api/caseProject.js'
|
|
|
+import { createFolderData, queryAllFolderData, queryCasesData, deleteFolderData, deleteCaseData, settingQueryModuleInfoListData, updateFolderData, caseUpdateFolderName } from '@/api/caseProject.js'
|
|
|
import { mockUrl } from '@/apiConfig/api'
|
|
|
import FileSaver from 'file-saver'
|
|
|
import axios from 'axios'
|
|
@@ -135,74 +128,46 @@ import XLSX from 'xlsx'
|
|
|
|
|
|
export default {
|
|
|
name: 'UseCasePage',
|
|
|
+ filters: {
|
|
|
+ ellipsis(value) {
|
|
|
+ if (!value) return ''
|
|
|
+ if (value.length > 9) {
|
|
|
+ return value.slice(0, 9) + '...'
|
|
|
+ }
|
|
|
+ return value
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- value: '',
|
|
|
+ id: '',
|
|
|
+ label: '',
|
|
|
+ node_Name: {},
|
|
|
Folder_Show: false,
|
|
|
add_Folder: '',
|
|
|
- centerDialogVisible: false,
|
|
|
- // dialogFormVisibleQuery: false,
|
|
|
moduleTypeShow: false,
|
|
|
dataShow: true,
|
|
|
titleName: '',
|
|
|
createCaseCode: 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 }],
|
|
|
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: '',
|
|
|
caseInfo: '',
|
|
|
pageSize: 5,
|
|
|
curIndex: 0,
|
|
|
startId: '',
|
|
|
+ created_id: '-1',
|
|
|
+ end: '',
|
|
|
total: 0,
|
|
|
createParticipation: {},
|
|
|
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' }]
|
|
|
- // },
|
|
|
- dialogTableVisible: false,
|
|
|
formData: {},
|
|
|
- formLabelWidth: '120px',
|
|
|
data1: [],
|
|
|
tableData: [],
|
|
|
excelData: [],
|
|
@@ -210,7 +175,8 @@ export default {
|
|
|
failNum: '',
|
|
|
successNum: '',
|
|
|
startKey: '',
|
|
|
- obj: ''
|
|
|
+ obj: '',
|
|
|
+ end_Data: ''
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -222,6 +188,64 @@ export default {
|
|
|
this.initWindow()
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
+ blues() {
|
|
|
+ console.log('blue')
|
|
|
+ },
|
|
|
+
|
|
|
+ // 双击编辑
|
|
|
+ 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)
|
|
|
+ setTimeout(() => { this.$refs.get_Input.focus() }, 100)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.get_Input.focus()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更新节点
|
|
|
+ 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: this.bizJson, 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.$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()
|
|
|
+ } else {
|
|
|
+ this.$message({ type: 'error', message: res.msg, duration: 1000 })
|
|
|
+ this.data1 = []
|
|
|
+ this.AllQueryFolderData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 显示隐藏删除图标
|
|
|
+ mouseenter(data) {
|
|
|
+ this.$set(data, 'del', true)
|
|
|
+ },
|
|
|
+ mouseleave(data) {
|
|
|
+ this.$set(data, 'del', false)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 隐藏主页样式
|
|
|
initWindow() {
|
|
|
if (!document.getElementById('window-judge')) {
|
|
|
document.getElementById('init-window').parentNode.style.overflow = 'auto'
|
|
@@ -229,6 +253,8 @@ export default {
|
|
|
document.getElementById('init-window').parentNode.style.overflow = 'hidden'
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ // 左侧导航栏
|
|
|
AllQueryFolderData() {
|
|
|
this.formData = { bizId: this.bizJson }
|
|
|
queryAllFolderData(this.formData).then(res => {
|
|
@@ -303,27 +329,42 @@ export default {
|
|
|
this.tableData = res.data
|
|
|
})
|
|
|
},
|
|
|
- // 隐藏input
|
|
|
+
|
|
|
+ // 点击空白创建最外层nav
|
|
|
+ click_fa() {
|
|
|
+ this.created_id = '-1'
|
|
|
+ },
|
|
|
+
|
|
|
+ // 新建文件夹
|
|
|
+ createFolder() {
|
|
|
+ this.Folder_Show = true
|
|
|
+ this.add_Folder = ''
|
|
|
+ setTimeout(() => { this.$refs.input1.focus() }, 100)
|
|
|
+ },
|
|
|
+
|
|
|
+ // input失去焦点新增(或取消)
|
|
|
hide_input(vel) {
|
|
|
if (vel !== '') {
|
|
|
- this.startId === '' ? this.startId = '-1' : ''
|
|
|
+ this.created_id === '' ? this.created_id = '-1' : ''
|
|
|
this.formData = {
|
|
|
bizId: this.bizJson,
|
|
|
folderName: vel,
|
|
|
xmindUrl: '',
|
|
|
- parentFolderId: this.startId,
|
|
|
+ parentFolderId: this.created_id,
|
|
|
creator: this.userInformation,
|
|
|
modifier: this.userInformation
|
|
|
}
|
|
|
createFolderData(this.formData).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- this.successFun(res.msg)
|
|
|
+ this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
|
|
|
this.createCaseCode = false
|
|
|
this.dataShow = true
|
|
|
this.data1 = []
|
|
|
this.AllQueryFolderData()
|
|
|
+ this.created_id = ''
|
|
|
} else {
|
|
|
- this.errorFun(res.msg)
|
|
|
+ this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
|
|
|
+ this.created_id = ''
|
|
|
}
|
|
|
})
|
|
|
this.Folder_Show = false
|
|
@@ -333,12 +374,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // 新建文件夹
|
|
|
- createFolder() {
|
|
|
- this.Folder_Show = true
|
|
|
- this.add_Folder = ''
|
|
|
- setTimeout(() => { this.$refs.input1.focus() }, 100)
|
|
|
- },
|
|
|
// 查询
|
|
|
queryCaseData(ele) {
|
|
|
if (this.createParticipation.caseName === '') return false
|
|
@@ -377,40 +412,13 @@ export default {
|
|
|
this.$router.push({ path: '/Platform/useCasePage/createUse', query: { data: this.startId }})
|
|
|
}
|
|
|
},
|
|
|
- // 文件夹新增
|
|
|
- createCase(vel) {
|
|
|
- if (vel.folderName !== '') {
|
|
|
- this.formData = {
|
|
|
- bizId: this.bizJson,
|
|
|
- folderName: vel.folderName,
|
|
|
- parentFolderId: this.startId,
|
|
|
- creator: this.userInformation,
|
|
|
- modifier: this.userInformation
|
|
|
- }
|
|
|
-
|
|
|
- createFolderData(this.formData).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.centerDialogVisible = false
|
|
|
- this.successFun()
|
|
|
- this.createCaseCode = false
|
|
|
- this.dataShow = true
|
|
|
- this.data1 = []
|
|
|
- this.AllQueryFolderData()
|
|
|
- } else {
|
|
|
- this.errorFun(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.errorFun('目录名称不能为空')
|
|
|
- this.centerDialogVisible = true
|
|
|
- }
|
|
|
- },
|
|
|
handleSelectionChange(val) {
|
|
|
this.tableData = val
|
|
|
},
|
|
|
+
|
|
|
+ // nav
|
|
|
handleDragStart(node, ev) {
|
|
|
- console.log('节点开始拖拽时触发的事件', node)
|
|
|
- console.log(node.key)
|
|
|
+ console.log('节点开始拖拽时触发的事件', node.key)
|
|
|
this.startKey = node.key
|
|
|
},
|
|
|
handleDragEnter(draggingNode, dropNode, ev) {
|
|
@@ -427,10 +435,11 @@ export default {
|
|
|
},
|
|
|
handleDrop(draggingNode, dropNode, dropType, ev) {
|
|
|
console.log('拖拽成功完成时触发的事件', dropNode.key, dropType)
|
|
|
- this.endKey = dropNode.key
|
|
|
- var startEnd = { xmindUrl: '', id: this.startKey, bizId: this.bizJson, modifier: this.userInformation, parentFolderId: this.endKey, creator: this.userInformation }
|
|
|
- console.log(startEnd)
|
|
|
- updateFolderData(startEnd).then(res => {
|
|
|
+ },
|
|
|
+
|
|
|
+ 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 = []
|
|
@@ -442,37 +451,8 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 拖拽时判定目标节点能否被放置
|
|
|
- allowDrop(draggingNode, dropNode, type) {
|
|
|
- if (dropNode.data.label === '二级 3-1') {
|
|
|
- return type !== 'inner'
|
|
|
- } else {
|
|
|
- return true
|
|
|
- }
|
|
|
- },
|
|
|
- // 判断节点能否被拖拽
|
|
|
- allowDrag(draggingNode) {
|
|
|
- return draggingNode.data.label.indexOf('三级 3-2-2') === -1
|
|
|
- },
|
|
|
- createUpdate(e, ele) {
|
|
|
- this.startId = ele.id
|
|
|
- this.codeId = ele.id
|
|
|
- this.formData = {}
|
|
|
- this.centerDialogVisible = true
|
|
|
- },
|
|
|
- clickFun(e) {
|
|
|
- this.startId = e.id
|
|
|
- this.formData = {
|
|
|
- pageSize: 5,
|
|
|
- curIndex: 0,
|
|
|
- caseFolderId: e.id
|
|
|
- }
|
|
|
- queryCasesData(this.formData).then(res => {
|
|
|
- this.gridData = res.data.list
|
|
|
- this.total = res.data.total
|
|
|
- })
|
|
|
- },
|
|
|
- deleteCodeData(vel) {
|
|
|
+ // 删除
|
|
|
+ remove(node, data) {
|
|
|
this.$confirm('是否确认删除', '确认信息', {
|
|
|
distinguishCancelAndClose: true,
|
|
|
confirmButtonText: '确定',
|
|
@@ -480,8 +460,8 @@ export default {
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.formData = {
|
|
|
- id: this.codeId,
|
|
|
- modifier: this.userInformation
|
|
|
+ id: node.data.id,
|
|
|
+ modifier: node.data.id
|
|
|
}
|
|
|
deleteFolderData(this.formData).then(res => {
|
|
|
if (res.code === 200) {
|
|
@@ -489,7 +469,7 @@ export default {
|
|
|
this.data1 = []
|
|
|
this.AllQueryFolderData()
|
|
|
} else {
|
|
|
- this.errorFun(res.msg)
|
|
|
+ this.$message({ type: 'error', message: res.msg, duration: 1000 })
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -497,9 +477,19 @@ export default {
|
|
|
this.$message({ type: 'success', message: '已取消' })
|
|
|
})
|
|
|
},
|
|
|
- changeStartId() {
|
|
|
- this.startId = '-1'
|
|
|
- this.centerDialogVisible = true
|
|
|
+ clickFun(e) {
|
|
|
+ console.log(e)
|
|
|
+ this.startId = e.id
|
|
|
+ this.created_id = e.id
|
|
|
+ this.formData = {
|
|
|
+ pageSize: 5,
|
|
|
+ curIndex: 0,
|
|
|
+ caseFolderId: e.id
|
|
|
+ }
|
|
|
+ queryCasesData(this.formData).then(res => {
|
|
|
+ this.gridData = res.data.list
|
|
|
+ this.total = res.data.total
|
|
|
+ })
|
|
|
},
|
|
|
deleteCaseData(e) {
|
|
|
if (this.startId === '') {
|
|
@@ -526,19 +516,13 @@ export default {
|
|
|
this.$message({ type: 'success', message: '已删除' })
|
|
|
})
|
|
|
} else {
|
|
|
- this.errorFun(res.msg)
|
|
|
+ this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
.catch(action => { this.$message({ type: 'success', message: '已取消' }) })
|
|
|
}
|
|
|
},
|
|
|
- successFun() {
|
|
|
- this.$notify({ title: 'Success', message: 'Created Successfully', type: 'success', duration: 2000 })
|
|
|
- },
|
|
|
- errorFun(e) {
|
|
|
- this.$notify({ title: 'Failed', message: e, type: 'error', duration: 2000 })
|
|
|
- },
|
|
|
exportExcel() {
|
|
|
if (this.startId === '') {
|
|
|
this.$message({ message: '提示,👈请选择目录', type: 'success', duration: 1000, offset: 150 })
|
|
@@ -611,7 +595,7 @@ export default {
|
|
|
this.createParticipation.caseFolderId = this.startId
|
|
|
queryCasesData(this.createParticipation).then(res => {
|
|
|
this.gridData = res.data
|
|
|
- this.successFun()
|
|
|
+ this.$message({ type: 'success', message: res.msg, duration: 1000 })
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -619,4 +603,23 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
+.custom-tree-node {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 14px;
|
|
|
+ padding-right: 8px;
|
|
|
+ }
|
|
|
+ .nav_Input .el-input--mini .el-input__inner {
|
|
|
+ height: 23px !important;
|
|
|
+ }
|
|
|
+ .span_el {
|
|
|
+ display: block;
|
|
|
+ overflow: hidden;
|
|
|
+ /* white-space: nowrap; */
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ .block >>> th{ background-color: #F0F2F4 !important;}
|
|
|
+
|
|
|
</style>
|