Bladeren bron

用例提交

qinzhipeng_v 5 jaren geleden
bovenliggende
commit
401d9eb0be

+ 7 - 0
src/api/caseProject.js

@@ -14,6 +14,13 @@ export function createFolderData(data) {
   })
 }
 
+export function caseUpdateFolderName(data) {
+  return request({
+    url: mockUrl + '/case/updateFolderName',
+    method: 'post',
+    data
+  })
+}
 // 修改文件夹位置或名称
 export function updateFolderData(data) {
   return request({

+ 2 - 2
src/api/projectTypePage.js

@@ -29,9 +29,9 @@ export function deleteModules(data) {
 }
 
 // 查看列表
-export function queryModuleInfoList(data) {
+export function queryModuleList(data) {
   return request({
-    url: mockUrl + `/setting/queryModuleInfoList`,
+    url: mockUrl + `/setting/queryModuleList`,
     method: 'post',
     data
   })

+ 11 - 0
src/api/settingQueryBizTypeList.js

@@ -0,0 +1,11 @@
+
+import request from '@/utils/request'
+import { mockUrl } from '@/apiConfig/api'
+// 业务线
+export function settingQueryBizTypeList(data) {
+  return request({
+    url: mockUrl + '/setting/queryBizTypeList',
+    method: 'post',
+    data
+  })
+}

+ 17 - 11
src/layout/components/Navbar.vue

@@ -26,9 +26,11 @@
       </el-dropdown>
     </div>
     <span>
-      <el-select v-model="bizShow" style="width: 200px; float: right; padding: 5px;" placeholder="业务线" @change="bizchnage(bizShow)">
-        <el-option v-for="item in bizOptions" :key="item.value" :label="item.name" :value="item.value" />
-      </el-select>
+      <el-form :model="bizShow">
+        <el-select v-model="bizShow.id" style="width: 200px; float: right; padding: 5px;" placeholder="业务线" @change="bizchnage(bizShow.id)">
+          <el-option v-for="item in bizOptions" :key="item.id" :label="item.bizName" :value="item.id" />
+        </el-select>
+      </el-form>
     </span>
   </div>
 </template>
@@ -38,7 +40,7 @@ import { mapGetters } from 'vuex'
 import Breadcrumb from '@/components/Breadcrumb'
 import Hamburger from '@/components/Hamburger'
 import navbarLogo from '@/icons/rabbit-logo.gif'
-
+import { settingQueryBizTypeList } from '@/api/settingQueryBizTypeList.js'
 export default {
   components: {
     Breadcrumb,
@@ -46,8 +48,10 @@ export default {
   },
   data() {
     return {
-      bizOptions: [{ name: '万象', value: '101' }, { name: '企业级', value: '100' }, { name: '滴滴代驾', value: '261' }, { name: 'prado', value: '330' }, { name: 'carbo', value: '331' }, { name: '海马', value: '309' }],
-      bizShow: '',
+      bizOptions: [],
+      bizShow: {
+        id: ''
+      },
       navbarLogo: {
         name: 'navbarLogo',
         src: navbarLogo
@@ -64,7 +68,7 @@ export default {
     }
   },
   created() {
-    this.getBizId()
+    this.get_bizArr()
   },
   methods: {
     toggleSideBar() {
@@ -82,12 +86,14 @@ export default {
           break
       }
     },
-    getBizId() {
-      this.bizShow = localStorage.getItem('key')
+    get_bizArr() {
+      settingQueryBizTypeList({}).then(res => {
+        this.bizOptions = res.data.list
+        this.bizShow.id = Number(localStorage.getItem('key'))
+      })
     },
     bizchnage(ele) {
-      this.bizShow = ele
-      localStorage.setItem('key', this.bizShow)
+      localStorage.setItem('key', ele)
       window.location.reload()
     }
   }

+ 1 - 1
src/router/index.js

@@ -330,7 +330,7 @@ export const constantRoutes = [
           {
             path: 'projectPage',
             name: '工程模块',
-            hidden: true,
+            // hidden: true,
             component: () => import('@/views/Platform/setUp/systemSetup/projectPage'),
             meta: { title: '工程模块' }
           }

+ 258 - 152
src/views/Platform/setUp/systemSetup/projectPage.vue

@@ -3,70 +3,86 @@
   <div class="set-background">
     <div class="block">
       <el-form :model="projectForm">
-        <div class="set-head">
-          工程模块<el-input v-model="projectForm.platformType" placeholder="请填写" style="margin-left:10px;width:14%;" /> &nbsp;&nbsp;
-          业务线<el-select v-model="projectForm.bizId" placeholder="请选择" filterable clearable style="margin-left:10px;width:14%;" @change="getPlat(projectForm.bizId)">
-            <el-option v-for="item in bizType" :key="item.code" :label="item.name" :value="item.code" />
+        <div class="set-head" style="display:flex;justify-content:space-evenly;align-items:center">
+          工程模块<el-input v-model="projectForm.moduleName" clearable placeholder="请填写" style="margin-left:8px;width:14%;" /> &nbsp;
+          业务线<el-select v-model="projectForm.bizId" placeholder="请选择" filterable clearable style="margin-left:8px;width:14%;" @clear="clearAll()" @change="getPlat(projectForm.bizId)">
+            <el-option v-for="item in bizType1" :key="item.code" :label="item.name" :value="item.code" />
+          </el-select>&nbsp;
+          平台类型<el-select v-model="projectForm.platId" placeholder="请选择" filterable clearable style="margin-left:8px;width:14%;" @clear="clearProgect()" @change="getProgect(projectForm.platId)">
+            <el-option v-for="item in platType1" :key="item.code" :label="item.name" :value="item.code" />
+          </el-select>&nbsp;
+          业务模块<el-select v-model="projectForm.bizModuleId" placeholder="请选择" filterable clearable style="margin-left:8px;width:14%;">
+            <el-option v-for="item in projectType1" :key="item.code" :label="item.name" :value="item.code" />
           </el-select>
-          平台类型<el-select v-model="projectForm.platId" placeholder="请选择" filterable clearable style="margin-left:10px;width:14%;" @change="getProgect(projectForm.platId)">
-            <el-option v-for="item in platType" :key="item.code" :label="item.name" :value="item.code" />
-          </el-select>
-          业务模块<el-select v-model="projectForm.id" placeholder="请选择" filterable clearable style="margin-left:10px;width:14%;">
-            <el-option v-for="item in projectType" :key="item.code" :label="item.name" :value="item.code" />
-          </el-select>
-          <div style="float:right">
-            <el-button type="primary">查询</el-button>
-            <el-button type="primary" plain @click="handleaddBiz()">新增</el-button>
+          <div style="margin-left:13px">
+            <el-button type="primary" @click="queryProjectList(projectForm)">查询</el-button>
+            <el-button type="primary" plain @click="handleaddProject()">新增</el-button>
           </div>
         </div>
       </el-form>
       <div class="set-locate">
         <el-table :key="tableKey" :data="projectData" fit highlight-current-row style="width: 100%;" border :header-cell-style="{background:'#F0F2F4',color:'#606266'}">
           <el-table-column label="序号" prop="id" min-width="40px" align="center" />
-          <el-table-column label="工程模块" prop="bizName" align="center" min-width="100">
-            <template slot-scope="scope"><a href="javascript:void(0)" style="color:#20a0ff">{{ scope.row.bizName }}</a></template>
+          <el-table-column label="工程模块" prop="moduleName" align="center" min-width="100">
+            <template slot-scope="scope"><a style="color:#20a0ff">{{ scope.row.moduleName }}</a></template>
           </el-table-column>
-          <el-table-column label="业务模块" prop="editor" min-width="70px" align="center" />
-          <el-table-column label="平台类型" prop="editor" min-width="70px" align="center" />
-          <el-table-column label="业务线" prop="editor" min-width="70px" align="center" />
-          <el-table-column label="端类型" prop="editor" min-width="70px" align="center" />
-          <el-table-column label="修改人" prop="editor" min-width="70px" align="center" />
+          <el-table-column label="业务模块" prop="bizModuleName" min-width="70px" align="center" />
+          <el-table-column label="平台类型" prop="platName" min-width="70px" align="center" />
+          <el-table-column label="业务线" prop="bizName" min-width="70px" align="center" />
+          <!-- <el-table-column label="端类型" prop="" min-width="70px" align="center" /> -->
+          <el-table-column label="操作人" prop="modifier" min-width="70px" align="center" />
           <el-table-column label="操作" align="center" min-width="150px" class-name="small-padding fixed-width">
-            <!-- <template slot-scope="{row}"> -->
-            <el-button type="primary" size="mini">编辑</el-button>
-            <el-button type="danger" size="mini" @click="dialogDeleteVisible=true">删除</el-button>
+            <template slot-scope="{row}">
+              <el-button type="primary" size="mini" @click="handelEditProject(row)">编辑</el-button>
+              <el-button type="danger" size="mini" @click="handelDeleteProject(row)">删除</el-button>
 
-            <!-- </template> -->
+            </template>
           </el-table-column>
         </el-table>
-        <el-dialog :visible.sync="dialogFormVisible" width="32%">
-          <div class="set-dialogfont" style="margin-left:25px;margin-top:-8px">
-            <b>工程模块</b><el-input placeholder="请填写" style="margin-left:10px;width:72%;" />
-          </div>
-          <div class="set-dialogfont" style="margin-left:35px;margin-top:10px">
-            <b>Git地址</b><el-input placeholder="请填写" style="margin-left:10px;width:74%;" />
-          </div>
-          <div class="set-dialogfont" style="margin-left:23px;margin-top:10px">
-            <b>业务模块</b><el-select v-model="projectForm.biz" placeholder="请选择业务模块" filterable clearable style="margin-left:13px;width:71.5%;">
-              <el-option v-for="item in bizType" :key="item.id" :label="item.name" :value="item.id" />
-            </el-select>
-          </div>
-          <div class="set-dialogfont" style="margin-left:35px;margin-top:10px">
-            <b>odin节点</b><el-input placeholder="请填写" style="margin-left:10px;width:74%;" />
+        <el-dialog :title="titleName" width="40%" :visible.sync="dialogFormVisible">
+          <div style="margin-left:75px">
+            <el-form ref="addProgectForms" :rules="addProgectRules" :model="addProgectForm">
+              <el-form-item label="工程模块" prop="moduleName">
+                <el-input v-model="addProgectForm.moduleName" clearable placeholder="请填写" style="margin-left:7px;width:60%;" />
+              </el-form-item>
+              <el-form-item label="Git地址" prop="gitAddress">
+                <el-input v-model="addProgectForm.gitAddress" clearable placeholder="请填写" style="margin-left:16px;width:60%;" />
+              </el-form-item>
+              <el-form-item label="业务线" prop="bizId">
+                <el-select v-model="addProgectForm.bizId" placeholder="请选择" filterable clearable style="margin-left:20px;width:60%;" @clear="clearAll1()" @change="getPlat1(addProgectForm.bizId)">
+                  <el-option v-for="item in bizType" :key="item.code" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="平台类型" prop="platId">
+                <el-select v-model="addProgectForm.platId" placeholder="请选择" filterable clearable style="margin-left:7px;width:60%;" @clear="clearProgect1()" @change="getProgect1(addProgectForm.platId)">
+                  <el-option v-for="item in platType" :key="item.code" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+
+              <el-form-item label="业务模块" prop="bizModuleId">
+                <el-select v-model="addProgectForm.bizModuleId" placeholder="请选择" filterable clearable style="margin-left:7px;width:60%;">
+                  <el-option v-for="item in projectType" :key="item.code" :label="item.name" :value="item.code" />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="Odin节点" prop="odinNode">
+                <el-input v-model="addProgectForm.odinNode" clearable placeholder="请填写" style="margin-left:5px;width:60%;" />
+              </el-form-item>
+
+            </el-form>
           </div>
-          <div align="center" style="margin-top:30px">
-            <el-button type="info" plain size="mini" @click="dialogFormVisible=false">确定</el-button>
-            <el-button type="danger" size="mini" @click="dialogFormVisible=false">取消</el-button>
-            <div style="margin-top:3%" />
+          <div align="center" style="margin-top:22px">
+            <el-button type="info" plain size="mini" @click="dialogFormVisible=false">取消</el-button>
+            <el-button type="primary" size="mini" @click="titleName === '新增' ? addModuleType(addProgectForm) :updateModuleType(addProgectForm)">确定</el-button>
           </div>
+          <div style="margin-top:6%" />
         </el-dialog>
 
         <el-dialog :visible.sync="dialogDeleteVisible" width="30%">
           <div align="center" style="margin-top:-6%">
             <b>确定要删除该工程模块吗?</b>
           </div>
-          <div align="center" style="margin-top:38px">
-            <el-button type="primary" size="mini" @click="dialogDeleteVisible=false">确定</el-button>
+          <div align="center" style="margin-top:40px">
+            <el-button type="primary" size="mini" @click="deleteProjectType()">确定</el-button>
             <el-button type="danger" size="mini" @click="dialogDeleteVisible=false">取消</el-button>
           </div>
           <div style="margin-top:4%" />
@@ -80,7 +96,7 @@
   </div></template>
 
 <script>
-import { getTypeMap, createModule } from '@/api/projectTypePage'
+import { getTypeMap, createModule, queryModuleList, deleteModules, updateModule } from '@/api/projectTypePage'
 //  updateModule, deleteModules, queryModuleInfoList, queryModuleInfoListByModuleName
 import waves from '@/directive/waves' // waves directive
 
@@ -112,6 +128,9 @@ export default {
       bizType: [],
       platType: [],
       projectType: [],
+      bizType1: [],
+      platType1: [],
+      projectType1: [],
       total: 0,
       titleName: '',
       projectForm: {
@@ -119,19 +138,28 @@ export default {
         platId: '',
         id: ''
       },
-      addBizData: {},
+      addProgectForm: {
+        platName: '',
+        bizModuleId: '',
+        bizModuleName: '',
+        platId: ''
+      },
       deleteData: {},
       currentBizData: [],
       tableKey: 0,
       curIndex: 0,
-      pageSize: 10,
+      pageSize: 5,
       listLoading: true,
       dialogFormVisible: false,
       dialogDeleteVisible: false,
       dialogName: '业务线名称',
-      addBizDataRules: {
-        id: [{ required: true, message: 'id不能为空', trigger: 'change' }],
-        bizName: [{ required: true, message: '业务线名称不能为空', trigger: 'change' }]
+      addProgectRules: {
+        moduleName: [{ required: true, message: '工程模块名称不能为空', trigger: 'change' }],
+        gitAddress: [{ required: true, message: 'git地址不能为空', trigger: 'change' }],
+        bizId: [{ required: true, message: '业务线不能为空', trigger: 'change' }],
+        platId: [{ required: true, message: '平台类型不能为空', trigger: 'change' }],
+        bizModuleId: [{ required: true, message: '业务模块不能为空', trigger: 'change' }],
+        odinNode: [{ required: true, message: 'Odin节点不能为空', trigger: 'change' }]
       }
 
     }
@@ -139,33 +167,41 @@ export default {
 
   created() {
     this.getBizTypeMap()
+    this.getList()
   },
   methods: {
     // 获取业务类型
     getBizTypeMap() {
       getTypeMap().then(response => {
+        this.bizType1 = response.data
         this.bizType = response.data
-        console.log(this.bizType)
         // this.lockSupplierList = response.data.supplierInfos
       })
     },
 
-    // 新增业务线
-    handleaddBiz() {
+    // 新增
+    handleaddProject() {
       this.titleName = '新增'
       this.dialogFormVisible = true
-      this.$refs.addBizForms.resetFields()
+      this.$nextTick(() => {
+        this.$refs['addProgectForms'].clearValidate()
+      })
+      // this.$refs.addProgectForms.resetFields()
+      this.$set(this.addProgectForm, 'moduleName', '')
+      this.$set(this.addProgectForm, 'gitAddress', '')
+      this.$set(this.addProgectForm, 'bizModuleId', '')
+      this.$set(this.addProgectForm, 'odinNode', '')
+      this.addProgectForm = {}
     },
     addModuleType(ele) {
-      this.$refs['addBizForms'].validate((valid) => {
+      this.$refs['addProgectForms'].validate((valid) => {
         if (valid) {
-          this.addBizData = ele
-          this.addBizData.creator = this.userInformation
-          this.addBizData.modifier = this.userInformation
+          this.addProgectForm = ele
+          this.addProgectForm.creator = this.userInformation
+          this.addProgectForm.modifier = this.userInformation
           // this.userData = { id: '', ename: this.userInformation, name: this.userNames }
           // this.bizTypeInfo = { bizTypeInfo: this.addBizData }
-          createModule(this.addBizData).then(response => {
-            console.log(response)
+          createModule(this.addProgectForm).then(response => {
             if (response.code === 200) {
               this.getList()
               this.successFun()
@@ -177,107 +213,177 @@ export default {
         }
       })
     },
+    // 首页选项
     getPlat(e) {
-      if (this.bizType.filter((value) => value.code === e)[0]) {
-        this.platType = this.bizType.filter((value) => value.code === e)[0].child
-        this.$set(this.projectForm, 'platId', '')
-        this.$set(this.projectForm, 'id', '')
+      if (this.bizType1.filter((value) => value.code === e)[0]) {
+        this.platType1 = this.bizType1.filter((value) => value.code === e)[0].child
+        this.platType1 = this.platType1.filter((value) => value.clientType === 1)
+        if (this.platType1.length === 1) {
+          this.projectForm.platId = this.platType1[0].code
+          this.projectType1 = this.platType1.filter((value) => value.code === this.platType1[0].code)[0].child
+          this.projectType1 = this.projectType1.filter((value) => value.clientType === 1)
+        } else {
+          this.$set(this.projectForm, 'platId', '')
+        }
+        this.$set(this.projectForm, 'bizModuleId', '')
       }
     },
+    clearAll() {
+      this.$set(this.projectForm, 'platId', '')
+      this.$set(this.projectForm, 'bizModuleId', '')
+    },
+    clearProgect() {
+      this.$set(this.projectForm, 'bizModuleId', '')
+      this.$set(this.projectForm, 'bizId', '')
+    },
+    clearAll1() {
+      this.$set(this.addProgectForm, 'platId', '')
+      this.$set(this.addProgectForm, 'bizModuleId', '')
+    },
+    clearProgect1() {
+      this.$set(this.addProgectForm, 'bizModuleId', '')
+      this.$set(this.addProgectForm, 'bizId', '')
+    },
     getProgect(e) {
-      console.log(e)
+      if (this.platType1.filter((value) => value.code === e)[0]) {
+        this.projectType1 = this.platType1.filter((value) => value.code === e)[0].child
+        this.projectType1 = this.projectType1.filter((value) => value.clientType === 1)
+        if (this.projectType1.length === 1) {
+          this.projectForm.bizModuleId = this.projectType1[0].code
+        } else {
+          this.$set(this.projectForm, 'bizModuleId', '')
+        }
+      }
+    },
+    // 修改选项
+    getPlat1(e) {
+      if (this.bizType.filter((value) => value.code === e)[0].child) {
+        this.platType = this.bizType.filter((value) => value.code === e)[0].child
+        this.platType = this.platType.filter((value) => value.clientType === 1)
+        if (this.platType.length === 1) {
+          // this.addProgectForm.platId = this.platType[0].code
+          this.$set(this.addProgectForm, 'platId', this.platType[0].code)
+          this.projectType = this.platType.filter((value) => value.code === this.platType[0].code)[0].child
+          this.projectType = this.projectType.filter((value) => value.clientType === 1)
+        } else {
+          this.$set(this.addProgectForm, 'platId', '')
+        }
+        this.$set(this.addProgectForm, 'platName', '')
+        this.$set(this.addProgectForm, 'bizModuleId', '')
+        this.$set(this.addProgectForm, 'bizModuleName', '')
+      } else {
+        this.$set(this.addProgectForm, 'platId', '')
+        this.$set(this.addProgectForm, 'platName', '')
+        this.$set(this.addProgectForm, 'bizModuleId', '')
+        this.$set(this.addProgectForm, 'bizModuleName', '')
+      }
+    },
+    getProgect1(e) {
       if (this.platType.filter((value) => value.code === e)[0]) {
         this.projectType = this.platType.filter((value) => value.code === e)[0].child
-        this.$set(this.projectForm, 'id', '')
+        this.projectType = this.projectType.filter((value) => value.clientType === 1)
+        if (this.projectType.length === 1) {
+          // this.addProgectForm.bizModuleId = this.projectType[0].code
+          this.$set(this.addProgectForm, 'bizModuleId', this.projectType[0].code)
+        } else {
+          this.$set(this.addProgectForm, 'bizModuleId', '')
+        }
+        this.$set(this.addProgectForm, 'bizModuleId', '')
+        this.$set(this.addProgectForm, 'bizModuleName', '')
       }
     },
-    // // 进首页
-    // getList() {
-    //   this.listLoading = true
-    //   this.indexPage = {
-    //     pageSize: this.pageSize,
-    //     curIndex: this.curIndex - 1
-    //   }
-    //   queryBizTypeList(this.indexPage).then(response => {
-    //     this.bizData = response.data.list
-    //     this.total = 10
-    //     this.listLoading = false
-    //   })
-    // },
-
-    // // 查看
-    // queryBizList(ele) {
-    //   this.bizForm.bizName = ele.bizName
-    //   // this.bizForm.pageSize = this.pageSize
-    //   this.bizForm.curIndex = this.curIndex - 1
-    //   // this.bizTypeInfo = { bizTypeInfo: this.bizForm }
-    //   console.log(ele)
-    //   queryBizTypeList(this.bizForm).then(response => {
-    //     if (response.code === 200) {
-    //       // this.getMyDevicesList()
-    //       this.bizData = response.data.list
-    //       this.dialogFormVisible = false
-    //     } else {
-    //       this.errorFun()
-    //     }
-    //   })
-    // },
-    // // 删除
-    // handelDeleteBiz(ele) {
-    //   this.addBizData = ele
-    //   this.dialogDeleteVisible = true
-    // },
-    // deleteBizType() {
-    //   console.log(typeof (this.addBizData.id))
-    //   var bizIds = [this.addBizData.id]
-    //   // bizIds.push(this.addBizData.id)
-    //   this.deleteData.modifier = this.userInformation
-    //   this.deleteData.bizIds = bizIds
-    //   deleteBiz(this.deleteData).then(response => {
-    //     if (response.code === 200) {
-    //       this.successFun()
-    //       this.dialogDeleteVisible = false
-    //       this.getList()
-    //       this.bizData = response.data.list
-    //     } else {
-    //       this.errorFun()
-    //       // this.dialogDeleteVisible = false
-    //     }
-    //   })
-    // },
-
-    // // 编辑
-    // handelEditBiz(ele) {
-    //   this.addBizData = ele
-    //   this.titleName = '编辑'
-    //   this.dialogFormVisible = true
-    //   this.$refs.addBizForms.resetFields()
-    //   console.log(ele)
-    // },
-    // editBizType(ele) {
-    //   this.$refs['addBizForms'].validate((valid) => {
-    //     if (valid) {
-    //       var myDate = new Date()
+    // 进首页
+    getList() {
+      this.listLoading = true
+      this.indexPage = {
+        pageSize: this.pageSize,
+        curIndex: this.curIndex - 1
+      }
+      queryModuleList(this.indexPage).then(response => {
+        this.projectData = response.data.list
+        this.total = response.data.total
+        this.listLoading = false
+      })
+    },
 
-    //       this.addBizData = ele
-    //       this.addBizData.modifyTime = myDate
-    //       this.addBizData.modifier = this.userInformation
-    //       // this.bizTypeInfo = { bizTypeInfo: this.addBizData }
-    //       updateBiz(this.addBizData).then(response => {
-    //         console.log(response)
-    //         if (response.code === 200) {
-    //           // this.getMyDevicesList()
-    //           this.successFun()
-    //           // this.$refs.addBizForms.resetFields()
-    //           this.dialogFormVisible = false
-    //         } else {
-    //           this.errorFun()
-    //           // this.$refs.addBizForms.resetFields()
-    //         }
-    //       })
-    //     }
-    //   })
-    // },
+    // 查看
+    queryProjectList(ele) {
+      this.projectForm = ele
+      this.projectForm.pageSize = this.pageSize
+      this.projectForm.curIndex = this.curIndex
+      queryModuleList(this.projectForm).then(response => {
+        if (response.code === 200) {
+          // this.getMyDevicesList()
+          this.projectData = response.data.list
+          this.total = response.data.total
+          this.dialogFormVisible = false
+        } else {
+          this.errorFun()
+        }
+      })
+    },
+    // 删除
+    handelDeleteProject(ele) {
+      this.dialogDeleteVisible = true
+      this.addProgectForm = ele
+    },
+    deleteProjectType() {
+      var moduleIds = [this.addProgectForm.id]
+      this.deleteData.modifier = this.userInformation
+      this.deleteData.moduleIds = moduleIds
+      deleteModules(this.deleteData).then(response => {
+        if (response.code === 200) {
+          this.successFun()
+          this.dialogDeleteVisible = false
+          this.getList()
+        } else {
+          this.errorFun()
+          // this.dialogDeleteVisible = false
+        }
+      })
+    },
+    // 编辑
+    handelEditProject(ele) {
+      // 不能直接赋值变量,使用Object.assign复制一级属性(注意Object.assign不算完全的深拷贝)
+      this.addProgectForm = Object.assign({}, ele)
+      // this.addModuleForm = JSON.parse(JSON.stringify(ele))
+      this.titleName = '编辑'
+      this.dialogFormVisible = true
+      if (this.bizType.filter((value) => value.code === this.addProgectForm.bizId)[0]) {
+        this.platType = this.bizType.filter((value) => value.code === this.addProgectForm.bizId)[0].child
+      }
+      if (this.platType.filter((value) => value.code === this.addProgectForm.platId)[0]) {
+        this.projectType = this.platType.filter((value) => value.code === this.addProgectForm.platId)[0].child
+      }
+      // this.$set(this.platType, [])
+      // this.$set(this.bizType, [])
+    },
+    updateModuleType(ele) {
+      this.$refs['addProgectForms'].validate((valid) => {
+        if (valid) {
+          var myDate = new Date()
+          this.addProgectForm = ele
+          // this.addProgectForm.bizId = ele.bizId
+          // this.addProgectForm.platId = ele.platId
+          // this.addProgectForm.moduleName = ele.platId
+          // this.addProgectForm.platId = ele.platId
+          // this.addModuleForm.platName = this.platData.filter((value) => value.code === ele.platId)
+          this.addProgectForm.modifyTime = myDate
+          this.addProgectForm.modifier = this.userInformation
+          // this.bizTypeInfo = { bizTypeInfo: this.addBizData }
+          updateModule(this.addProgectForm).then(response => {
+            // this.$set(this.platData, [])
+            if (response.code === 200) {
+              this.getList()
+              this.successFun()
+              this.dialogFormVisible = false
+            } else {
+              this.errorFun()
+            }
+          })
+        }
+      })
+    },
 
     handleSizeChange(size) {
       this.pageSize = size

+ 85 - 47
src/views/Platform/useCase/createUse.vue

@@ -25,36 +25,79 @@
         </el-form>
       </el-header>
       <el-main style="background:#ffffff;height:auto; width:94%;margin: 0 3% 3% 3%; font-size:14px;border-radius:8px;">
-        <!-- <div style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); margin-bottom:2%;"> -->
-        <el-form v-for="(item,index) in data" :key="index" label-width="80px" :model="item" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); margin-bottom:2%;">
+        <!-- 编辑 -->
+        <el-form v-show="form_Query" label-width="80px" :model="caseData" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); margin-bottom:2%;">
           <el-row>
             <el-col :span="20" style="margin:2% 0 0 0; white-space:nowrap;">
               <el-form-item label="执行步骤">
-                <el-input v-model="item.description" type="textarea" :rows="4" placeholder="请输入内容" />
-                <el-button v-show="plus" size="mini" type="primary" icon="el-icon-plus" style="margin-bottom: 6%;" @click="add" />
-                <el-button v-show="plus" size="mini" icon="el-icon-minus" @click="deleteData(index)" />
+                <el-input v-model="caseData.description" type="textarea" :rows="4" placeholder="请输入内容" />
               </el-form-item>
             </el-col>
           </el-row>
           <el-row>
             <el-col :span="22">
               <el-form-item label="预期结果">
-                <el-input v-model="item.expectedResult" placeholder="请输入内容" />
+                <el-input v-model="caseData.expectedResult" placeholder="请输入内容" />
               </el-form-item>
             </el-col>
           </el-row>
           <div style="display:flex;">
             <el-row style="flex:1;">
-              <!-- <el-col :span="22">
+              <el-col :span="22">
                 <el-form-item label="附件">
-                  <el-upload v-model="item.accessory" class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :on-success="handleAvatarSuccess" :on-progress="DisableButton">
+                  <el-upload class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :on-success="(response, file, fileList)=>{return constractSuccUpload(response, file, fileList )}" :on-progress="DisableButton">
                     <i class="el-icon-plus avatar-uploader-icon"> 添加图片 </i>
                   </el-upload>
                 </el-form-item>
-              </el-col> -->
+              </el-col>
+            </el-row>
+            <el-row style="flex:1;">
+              <el-col :span="20">
+                <el-form-item label="备注">
+                  <el-input v-model="caseData.remark" type="textarea" :rows="8" placeholder="请输入内容" />
+                </el-form-item>
+              </el-col>
+            </el-row>
+          </div>
+          <div v-show="btn_show" align="center" class="cla">
+            <el-table v-show="btn_show" :data="uptataKey" fit style="width: 90%;">
+              <el-table-column label="" min-width="150">
+                <template slot-scope="scope">{{ scope.row.name }}</template>
+              </el-table-column>
+              <el-table-column label="" min-width="300">
+                <template slot-scope="scope"><a :href="scope.row.url" style="color:blue;">{{ scope.row.url }}</a></template>
+              </el-table-column>
+              <el-table-column fixed="right" label="" width="50" align="center">
+                <template slot-scope="scope">
+                  <el-button class="deleteSty" @click="deleteURL(scope.row)"> x </el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </el-form>
+        <!-- 新增 -->
+        <el-form v-for="(item, index) in data" v-show="form_created" :key="index" label-width="80px" :model="item" style="box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04); margin-bottom:2%;">
+          <el-row>
+            <el-col :span="20" style="margin:2% 0 0 0; white-space:nowrap;">
+              <el-form-item label="执行步骤">
+                <el-input v-model="item.description" type="textarea" :rows="4" placeholder="请输入内容" />
+                <el-button v-show="plus" size="mini" type="primary" icon="el-icon-plus" style="margin-bottom: 6%;" @click="add" />
+                <el-button v-show="plus" size="mini" icon="el-icon-minus" @click="deleteData(index)" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="22">
+              <el-form-item label="预期结果">
+                <el-input v-model="item.expectedResult" placeholder="请输入内容" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <div style="display:flex;">
+            <el-row style="flex:1;">
               <el-col :span="22">
                 <el-form-item label="附件">
-                  <el-upload v-model="item.accessory" class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :on-success="(response, file, fileList)=>{return constractSuccUpload(response, file, fileList,index)}" :on-progress="DisableButton">
+                  <el-upload v-model="item.accessory" class="upload-demo" drag action="https://jsonplaceholder.typicode.com/posts/" multiple :on-success="trademrakRegistSuccess.bind(null, {'index':index,'data':item})" :on-progress="DisableButton">
                     <i class="el-icon-plus avatar-uploader-icon"> 添加图片 </i>
                   </el-upload>
                 </el-form-item>
@@ -88,7 +131,7 @@
         <el-row>
           <el-col :span="22" style="text-align:right; ">
             <el-button :disabled="dis" type="primary" @click="caseCreateCase(caseData, titleName)">保 存</el-button>
-            <el-button style="margin:9% 0 0 4%;" @click="Return">取 消</el-button>
+            <el-button style="margin:9% 0 0 4%;" @click="$router.go(-1)">取 消</el-button>
           </el-col>
         </el-row>
       </el-main>
@@ -104,13 +147,19 @@ export default {
   data() {
     return {
       data: [{ description: '', expectedResult: '', remark: '', accessory: '' }],
+      userNames: localStorage.getItem('realname'),
+      bizJson: localStorage.getItem('key'),
       startId: '',
       caseFolderId: '',
       caseData: {},
       btn_show: true,
       plus: true,
       dis: false,
+      form_Query: false,
+      form_created: false,
       id: '',
+      arry: [],
+      arr: [],
       tableList: [],
       titleName: '',
       uptataKey: [],
@@ -127,9 +176,18 @@ export default {
     this.initCode()
   },
   methods: {
+    trademrakRegistSuccess(obj, res, file) {
+      var obj_data = obj.data
+      this.arr.push(res.id)
+      obj_data.accessory = JSON.stringify(this.arr)
+      this.arry.push(obj_data)
+      this.dis = false
+      console.log(this.arry)
+    },
     initCode() {
       if (this.$route.query.data) { // 新增
         this.titleName = '新增'
+        this.form_created = true
         this.btn_show = false
         this.startId = this.$route.query.data
         if (this.$refs['caseData'] !== undefined) {
@@ -139,17 +197,19 @@ export default {
 
       if (this.$route.query.id) { // 编辑
         this.titleName = '编辑'
+        this.form_Query = true
         this.startId = this.$route.query.id
         this.plus = false
         queryCasesData({ caseFolderId: this.startId }).then(res => {
           for (var el of res.data.list) {
             el.caseFolderId === this.startId ? this.caseData = el : ''
-            var obj = JSON.parse(this.caseData.accessory.split('{}')[0])
-            for (var a of obj) {
-              this.uptataKey.push(a)
+            if (this.caseData.accessory !== '') {
+              var obj = JSON.parse(this.caseData.accessory.split('{}')[0])
+              for (var a of obj) {
+                this.uptataKey.push(a)
+              }
+              break
             }
-            console.log(this.uptataKey)
-            break
           }
         })
       }
@@ -170,81 +230,59 @@ export default {
             this.data1 = []
             this.AllQueryFolderData()
           } else {
-            this.errorFun(res.msg)
+            this.$message({ type: 'error', message: res.msg, duration: 1000 })
           }
         })
       }
     },
-    constractSuccUpload(response, file, fileList, index) {
+
+    // 图片上传成功的回调(编辑)
+    constractSuccUpload(response, file, fileList) {
       this.dis = false
       const fileUrl = { name: file.name, url: file.response.id }
-      console.log(fileUrl)
-      this.uptataKey[index]
+      this.uptataKey.push(fileUrl)
     },
-    // 图片上传成功的回调
-    // handleAvatarSuccess(res, file) {
-    //   this.dis = false
-    //   this.uptataKey.push({ name: file.name, url: file.response.id })
-    //   console.log(this.uptataKey)
-    //   // this.imageUrl = URL.createObjectURL(file.raw)
-    // },
 
-    // 返回
-    Return() {
-      this.$router.go(-1)
-    },
     // 添加事件
     add() {
       this.data.push({ description: '', expectedResult: '', remark: '', accessory: '' })
-      console.log(this.data)
     },
     deleteData(e) {
       this.data.splice(e, 1)
     },
 
     deleteURL(vel) {
-      console.log(vel)
-      console.log(this.uptataKey)
       for (var i = 0; i < this.uptataKey.length; i++) {
         if (this.uptataKey[i].name === vel.name) {
           this.uptataKey.splice(i, 1)
         }
       }
-      // this.uptataKey = this.uptataKey.filter((value) => value.url !== vel.url)
     },
 
     // 新建Data
     caseCreateCase(vel, e) {
       if (e === '编辑') {
         this.caseData = vel
-        // this.caseData.remark = ele.remark
-        // this.caseData.expectedResult = ele.expectedResult
-        // this.caseData.description = ele.description
         this.caseData.accessory = JSON.stringify(this.uptataKey)
         updateCaseData(this.caseData).then(res => {
           this.$message({ type: 'success', message: res.msg })
           this.$router.go(-1)
         })
       }
-      // var list = []
-      // var obj = { accessory: JSON.stringify(this.uptataKey), remark: ele.remark, expectedResult: ele.expectedResult, description: ele.description }
       if (e === '新增') {
         this.$refs['caseData'].validate((valid) => {
           if (valid) {
             this.caseData = vel
-            this.caseData.caseInfos = JSON.stringify(this.data)
-            this.caseData.accessory = JSON.stringify(this.uptataKey)
-            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.caseInfos = this.data
+            this.caseData.creator = this.userNames
+            this.caseData.modifier = this.userNames
             this.caseData.caseFolderId = this.startId
             this.caseData.bizId = this.bizJson
             createCaseData(this.caseData).then(res => {
               if (res.code === 200) {
                 this.gridData = res.data
                 this.$message({ type: 'success', message: res.msg, duration: 1000 })
+                this.$router.go('-1')
               } else {
                 this.$notify({ title: '提示', message: res.msg, duration: 1000 })
               }

+ 3 - 3
src/views/Platform/useCase/queryUse.vue

@@ -4,7 +4,7 @@
       <el-main style="background:#ffffff;height:auto; width:94%;margin:3%; font-size:14px;border-radius:8px;">
         <el-form label-position="left" label-width="100px" :model="formLabelAlign">
           <el-form-item label="用例优先级:">
-            {{ formLabelAlign.casePriority }}
+            {{ formLabelAlign.casePriorityName }}
           </el-form-item>
           <el-form-item label="API:">
             {{ formLabelAlign.api }}
@@ -17,7 +17,7 @@
           </el-form-item>
           <el-form-item label="附件:" />
           <el-table :data="uptataKey" fit border style="width: 70%; margin: 0% 0 2% 0;">
-            <el-table-column label="name" min-width="150">
+            <el-table-column label="文件名" min-width="150">
               <template slot-scope="scope">{{ scope.row.name }}</template>
             </el-table-column>
             <el-table-column label="URL" min-width="300">
@@ -28,7 +28,7 @@
             {{ formLabelAlign.remark }}
           </el-form-item>
           <el-form-item label="创建人:">
-            {{ formLabelAlign.creatorName }}
+            {{ formLabelAlign.creator }}
           </el-form-item>
           <el-form-item label="操作人:">
             {{ formLabelAlign.modifier }}

+ 177 - 174
src/views/Platform/useCasePage.vue

@@ -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;">
                     序 列 号 &nbsp;<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>