chunk-6fb66e82.ca2a02c3.js 18 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6fb66e82"],{1619:function(t,e,n){"use strict";function a(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=r(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var a=0,o=function(){};return{s:o,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw i}}}}function r(t,e){if(t){if("string"===typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function i(t){var e,n=[],r=a(t);try{for(r.s();!(e=r.n()).done;){var o=e.value,i=o.create_time.split("T")[0],s=o.create_time.split("T")[1].slice(0,8);o.create_time=i+" "+s;var c=o.update_time.split("T")[0],l=o.update_time.split("T")[1].slice(0,8);o.update_time=c+" "+l,o.creator=(o.executor||{}).name,n.push(o)}}catch(u){r.e(u)}finally{r.f()}return n}function s(t){var e=-1!=(t||"").indexOf("T")&&t.split("T")[0],n=-1!=(t||"").indexOf("T")&&(t.split("T")[1]+" ").slice(0,8);return e+" "+n}function c(t){switch(t){case 0:return"执行中";case 1:return"已归档";default:return"无"}}function l(t){switch(t){case 0:return"未执行";case 1:return"执行中";case 2:return"已完成";default:return"无"}}function u(t){switch(t){case 0:return"系统管理员";case 1:return"测试管理员";case 2:return"测试工程师";default:return"测试工程师"}}n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"a",(function(){return u}))},1684:function(t,e,n){"use strict";n.d(e,"e",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return c}));var a=n("b775");function r(t,e,n){return Object(a["a"])({url:"/api/v1/software/",method:"GET",params:{name:t,type:e,sort:n}})}function o(t){return Object(a["a"])({url:"/api/v1/software/".concat(t),method:"GET"})}function i(t,e){return Object(a["a"])({url:"/api/v1/software/".concat(t,"/edit"),method:"POST",data:e})}function s(t){return Object(a["a"])({url:"/api/v1/software/".concat(t),method:"DELETE"})}function c(t){return Object(a["a"])({url:"/api/v1/software/",method:"POST",data:t})}},"3f13":function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"e",(function(){return s})),n.d(e,"g",(function(){return c})),n.d(e,"f",(function(){return l})),n.d(e,"h",(function(){return u})),n.d(e,"a",(function(){return d}));var a=n("b775");function r(t){return Object(a["a"])({url:"/api/v1/test-plans/",method:"POST",data:t})}function o(t){return Object(a["a"])({url:"/api/v1/test-plans/".concat(t),method:"GET"})}function i(t){return Object(a["a"])({url:"/api/v1/test-plans/".concat(t),method:"DELETE"})}function s(t,e){return Object(a["a"])({url:"/api/v1/test-plans/".concat(t,"/edit"),method:"POST",data:e})}function c(t,e,n,r,o){return Object(a["a"])({url:"/api/v1/test-plans/",method:"GET",params:{creator_id:t,title:e,state:n,software_id:r,sort:o}})}function l(t,e){return Object(a["a"])({url:"/api/v1/test-plans/".concat(t,"/edit-type"),method:"POST",data:e})}function u(t){return Object(a["a"])({url:"/api/v1/software/".concat(t,"/plans"),method:"GET"})}function d(t,e,n){return Object(a["a"])({url:"/api/v1/software/".concat(t,"/versions/plan"),method:"POST",data:{version_number:e,plan_ids:n}})}},"5b16":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("CCard",[n("CCardHeader",[t._v("测试任务管理")]),t.checkPerm("CREATE")?n("CCardBody",[n("CButton",{staticStyle:{width:"100px"},attrs:{block:"",color:"primary"},on:{click:function(e){t.createTaskModal=!0}}},[t._v("+新建")])],1):t._e()],1),n("CModal",{attrs:{show:t.createTaskModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.createTaskModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[n("h6",{staticClass:"modal-title"},[t._v("新建测试任务")]),n("CButtonClose",{staticClass:"text-white",on:{click:function(e){t.createTaskModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(e){t.createTaskModal=!1}}},[t._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.createNewTask}},[t._v("新建")])]},proxy:!0}])},[n("CInput",{attrs:{label:"名称",placeholder:"请输入测试任务名称"},model:{value:t.newTask.title,callback:function(e){t.$set(t.newTask,"title",e)},expression:"newTask.title"}}),n("CInput",{attrs:{label:"描述",placeholder:"输入测试任务描述"},model:{value:t.newTask.description,callback:function(e){t.$set(t.newTask,"description",e)},expression:"newTask.description"}}),n("p",{staticStyle:{marginBottom:"10px",marginTop:"10px"}},[t._v("所属计划")]),n("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",placeholder:"请选择所属计划"},model:{value:t.newTask.plan,callback:function(e){t.$set(t.newTask,"plan",e)},expression:"newTask.plan"}},t._l(t.plans,(function(t){return n("el-option",{key:t.id,attrs:{label:t.title,value:t.id}})})),1),n("p",{staticStyle:{marginBottom:"10px",marginTop:"10px"}},[t._v("任务类型")]),n("el-select",{attrs:{placeholder:"请选择类型"},model:{value:t.newTask.type,callback:function(e){t.$set(t.newTask,"type",e)},expression:"newTask.type"}},t._l(t.taskType,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),n("p",{staticStyle:{marginBottom:"10px",marginTop:"10px"}},[t._v("负责人")]),n("el-tree",{attrs:{data:t.groupList,"show-checkbox":"","node-key":"userid","default-expand-all":"","expand-on-click-node":!1,props:t.defaultProps},on:{"check-change":t.handleCheckChange}}),n("p",{staticStyle:{marginBottom:"6px",marginTop:"10px"}},[t._v("请上传测试任务说明文档")]),n("el-upload",{ref:"newTaskUploader",staticClass:"upload-demo",attrs:{action:"","auto-upload":!1,multiple:!0,"file-list":t.fileList}},[n("el-button",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},attrs:{size:"small"}},[t._v("点击上传")])],1)],1),n("CCard",[n("CCardBody",[n("CDataTable",{attrs:{items:t.taskList,fields:t.taskFields,"items-per-page":8,tableFilter:{label:"搜索",placeholder:"输入任意信息检索"},noItemsView:{noResults:"无结果",noItems:"无测试任务"},hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:t._u([{key:"state",fn:function(e){var a=e.item;return[n("td",[n("CBadge",{staticStyle:{fontSize:"14px",height:"25px","line-height":"20px"},attrs:{color:t.getBadge(a.state)}},[t._v(" "+t._s(t._f("taskStateFilter")(a.state))+" ")])],1)]}},{key:"opt_details",fn:function(e){var a=e.item,r=e.index;return[t.checkPerm("CHECK")?n("td",{staticClass:"py-2"},[0!=a.state?n("CButton",{staticStyle:{width:"50px"},attrs:{color:"success",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.gotoTask(a,r)}}},[t._v(" 查看 ")]):t._e(),0==a.state?n("CButton",{staticStyle:{width:"50px"},attrs:{color:"primary",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.gotoTask(a,r)}}},[t._v(" 执行 ")]):t._e()],1):t._e()]}},{key:"opt_delete",fn:function(e){var a=e.item,r=e.index;return[t.checkPerm("DELETE")?n("td",{staticClass:"py-2"},[n("CButton",{staticStyle:{width:"50px"},attrs:{color:"danger",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.deleteTaskFirstStep(a,r)}}},[t._v(" 删除 ")])],1):t._e()]}}])})],1)],1),n("CModal",{attrs:{show:t.deleteTaskModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"danger"},on:{"update:show":function(e){t.deleteTaskModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[n("h6",{staticClass:"modal-title"},[t._v("删除测试任务")]),n("CButtonClose",{staticClass:"text-white",on:{click:function(e){t.deleteTaskModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(e){t.deleteTaskModal=!1}}},[t._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.deleteTaskNow}},[t._v("删除")])]},proxy:!0}])},[n("h5",[t._v("你确定删除该任务吗?删除后将无法查看任何与该任务的相关信息!")])])],1)},r=[],o=n("1619"),i=n("90c2"),s=n("1684"),c=n("3f13"),l=n("e350"),u=n("c24f");function d(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=f(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var a=0,r=function(){};return{s:r,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){s=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function f(t,e){if(t){if("string"===typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var h={name:"softwareTestTask",filters:{taskStateFilter:o["e"]},data:function(){return{createTaskModal:!1,deleteTaskModal:!1,newTask:{},taskList:[],taskFields:[{key:"title",label:"任务名称",_style:"min-width:100px"},{key:"description",label:"描述",_style:"min-width:200px"},{key:"software_name",label:"所属软件",_style:"min-width:100px"},{key:"version",label:"所属版本",_style:"min-width:100px"},{key:"plan_name",label:"所属计划",_style:"min-width:200px"},{key:"opt_details",label:"",_style:"min-width:10px;"},{key:"opt_delete",label:"",_style:"min-width:10px;"}],versions:[],softwareId:"",plans:[],softwareList:[],userList:[],fileList:[],checkedList:[],groupList:[],defaultProps:{children:"children",label:"label"},taskType:[{value:"GPS",label:"GPS"},{value:"北斗二代",label:"北斗二代"},{value:"伽利略",label:"伽利略"},{value:"GLONASS",label:"GLONASS"}],taskTValue:""}},mounted:function(){var t=this;this.softwareId=localStorage.getItem("softwareId"),this.getTasks("","",this.softwareId,localStorage.getItem("userId"),""),Object(s["e"])("","","").then((function(e){t.softwareList=e})),this.getPlans(),2!=localStorage.getItem("identity")&&Object(u["d"])(localStorage.getItem("userId")).then((function(e){console.log("获取人列表",e);var n=[];e.map((function(t){var e={};e.id=t.groupName,e.label=t.groupName,e.children=t.userList.map((function(t){return{id:t.userid,label:t.username,identify:t.identify}})),e.children=e.children.filter((function(t){return 2==t.identify})),n.push(e)})),t.groupList=n}))},computed:{},watch:{},methods:{getTasks:function(t,e,n,a,r){var o=this;2!=localStorage.getItem("identity")?(a="",Object(i["j"])("",n,"","").then((function(t){console.log("管理员 软件内 任务列表",t),o.taskList=t}))):Object(i["k"])("",a,"","","",n,"").then((function(t){console.log("工程师 软件内 任务列表",t),o.taskList=t}))},handleCheckChange:function(t,e,n){if(console.log(t,e,n),e)t.children||this.checkedList.includes(t.id)||(this.checkedList.push(t.id),console.log(this.checkedList,"push checkedList"));else if(!t.children&&this.checkedList.includes(t.id)){console.log("include this.checkedList",this.checkedList);var a=this.checkedList.indexOf(t.id);console.log(a,"index"),this.checkedList.splice(a,1),console.log(this.checkedList)}console.log(this.checkedList,"checkedList")},getBadge:function(t){switch(t){case 0:return"secondary";case 1:return"success";case 2:return"primary";default:}},gotoTask:function(t,e){var n=this;console.log("查看任务:",t),localStorage.setItem("softwareId",t.software_id),localStorage.setItem("taskId",t.id),localStorage.setItem("planId",t.plan_id),localStorage.setItem("taskName",t.title),0!=t.state&&2==localStorage.getItem("identity")?Object(i["h"])(t.id).then((function(e){t.result=e.task.result,localStorage.setItem("query",JSON.stringify(t)),n.$router.push({path:"/softwareTestTaskDetail/"+t.id,query:{taskItem:t}})})):(console.log("state是0000"),localStorage.setItem("query",JSON.stringify(t)),this.$router.push({path:"/softwareTestTaskDetail/"+t.id,query:{taskItem:t}}))},deleteTaskFirstStep:function(t,e){this.deleteTaskModal=!0,this.taskSelected=t},deleteTaskNow:function(){var t=this;this.deleteTaskModal=!1,Object(i["c"])(this.taskSelected.id).then((function(e){t.getTasks("","",t.softwareId,localStorage.getItem("userId"),"")}))},createNewTask:function(){var t=this;if(""!=this.newTask.title&&""!=this.newTask.description&&""!=this.newTask.softwareId&&""!=this.newTask.plan&&this.newTask.userList!=[]&&""!=this.newTask.type)if(console.log(this.newTask),this.$refs["newTaskUploader"].uploadFiles.length<1)this.$message.warning("文件数量至少为 1 !");else{var e,n=new FormData,a="",r=d(this.checkedList);try{for(r.s();!(e=r.n()).done;){var o=e.value;a+="&&"+o}}catch(s){r.e(s)}finally{r.f()}a=a.slice(2),n.append("executors",a),this.$refs["newTaskUploader"].uploadFiles.length>=1&&this.$refs["newTaskUploader"].uploadFiles.forEach((function(t,e){n.append("files",t.raw)})),n.append("task_name",this.newTask.title),n.append("description",this.newTask.description),n.append("plan_id",this.newTask.plan),n.append("type",this.newTask.type),console.log(this.newTask,"qian的this.newTask"),Object(i["b"])(n).then((function(e){for(var n in console.log("创建任务结果",e),t.createTaskModal=!1,console.log(t.$refs.newTaskUploader.clearFiles()),t.newTask)delete t.newTask[n];t.getTasks("","",t.softwareId,localStorage.getItem("userId"),"")}))}else this.$message.warning("请完整填写任务信息!")},checkTaskDetail:function(t){Object(i["a"])(t).then((function(t){console.log(t,"获取详情任务res")}))},getPlans:function(){var t=this;console.log(this.softwareId,"获取plan的软件id"),Object(c["g"])("","","",this.softwareId,"").then((function(e){t.plans=e,console.log("获取计划列表",e)}))},checkPerm:function(t){return Object(l["a"])(localStorage.getItem("identity"),t)}}},k=h,m=n("2877"),T=Object(m["a"])(k,a,r,!1,null,"b99475f6",null);e["default"]=T.exports},"90c2":function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return l})),n.d(e,"i",(function(){return u})),n.d(e,"j",(function(){return d})),n.d(e,"k",(function(){return f})),n.d(e,"g",(function(){return p})),n.d(e,"h",(function(){return h}));var a=n("b775");function r(t){return Object(a["a"])({url:"/api/v1/test-tasks/beidou",method:"POST",data:t})}function o(t){return Object(a["a"])({url:"/api/v1/test-tasks/".concat(t),method:"GET"})}function i(t){return Object(a["a"])({url:"/api/v1/test-tasks/".concat(t),method:"DELETE"})}function s(t){return Object(a["a"])({url:"api/v1/test-tasks/beidou/edit",method:"DELETE",data:t})}function c(t,e){return Object(a["a"])({url:"/api/v1/test-tasks/".concat(t,"/edit"),method:"POST",data:e})}function l(t,e){return Object(a["a"])({url:"/api/v1/test-tasks/beidou/edit",method:"POST",data:e})}function u(t,e,n,r,o){return Object(a["a"])({url:"/api/v1/test-tasks/",method:"GET",params:{executor_id:r,title:t,state:e,software_id:n,sort:o}})}function d(t,e,n,r){return Object(a["a"])({url:"/api/v1/test-tasks/beidou/list",method:"GET",params:{task_name:t,software_id:e,plan_id:n,sort:r}})}function f(t,e,n,r,o,i,s){return Object(a["a"])({url:"/api/v1/test-tasks/beidou/info",method:"GET",params:{task_name:t,executor_id:e,plan_id:n,state:r,sort:o,software_id:i,type:s}})}function p(t,e){return Object(a["a"])({url:"/api/v1/test-tasks/beidou/".concat(t,"/execute"),method:"POST",data:e})}function h(t){return Object(a["a"])({url:"/api/v1/test-tasks/beidou/".concat(t),method:"GET"})}},b775:function(t,e,n){"use strict";var a=n("bc3a"),r=n.n(a),o=n("5c96");n("c0d6");r.a.defaults.withCredentials=!0;var i=r.a.create({withCredentials:!0,timeout:1e5});i.interceptors.response.use((function(t){var e=t.data;return e}),(function(t){return console.log("err"+t),t.response.data.length>1e3?Object(o["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(o["Message"])({message:t.response.data,type:"error",duration:2e4}),Promise.reject(t)})),i.interceptors.request.use((function(t){var e=window.localStorage.getItem("accessToken");return e?(t.headers.accessToken=e,t):t})),e["a"]=i},c24f:function(t,e,n){"use strict";n.d(e,"e",(function(){return r})),n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return i})),n.d(e,"g",(function(){return s})),n.d(e,"f",(function(){return c})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return u}));var a=n("b775");function r(t){return Object(a["a"])({url:"/api/v1/users/login",method:"POST",data:t})}function o(t){return Object(a["a"])({url:"/api/v1/group/user",method:"GET",params:{user_id:t}})}function i(t){return Object(a["a"])({url:"/api/v1/users/".concat(t),method:"GET"})}function s(t,e){return Object(a["a"])({url:"/api/v1/users/".concat(t,"/edit"),method:"POST",data:e})}function c(t){return Object(a["a"])({url:"/api/v1/users/",method:"POST",data:t})}function l(){return Object(a["a"])({url:"/api/v1/users/",method:"GET",params:{username:"",identify:"",is_login:"",sort:""}})}function u(){return Object(a["a"])({url:"/api/v1/users/export",method:"GET"})}},e350:function(t,e,n){"use strict";function a(t,e){var n=r[t];return n.includes(e)}n.d(e,"a",(function(){return a}));var r=[["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EXECUTE"]]}}]);