(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-47ffa454"],{"03a4":function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{"min-width":"1100px"}},[n("el-button",{staticStyle:{"margin-bottom":"20px"},attrs:{size:"mini"},on:{click:t.exportRep}},[n("i",{staticClass:"el-icon-download",staticStyle:{fontSize:"20px"}}),t._v(" 导出测试报告 ")]),n("CCard",[n("CCardHeader",[n("h5",{staticStyle:{display:"inline-block"}},[t._v(t._s(t.software.name))]),t.checkPerm("EDIT")?n("div",{staticClass:"card-header-actions"},[n("a",{staticClass:"card-header-action",attrs:{href:"javascript:;",rel:"noreferrer noopener"},on:{click:function(e){return t.editModalOpen()}}},[n("el-button",[t._v("编辑")])],1)]):t._e()]),n("CCardBody",[n("el-row",[n("el-col",{attrs:{span:3}},[n("strong",[t._v("项目类型:")]),t._v(" "+t._s(t.software.type))]),n("el-col",{attrs:{span:4}},[n("strong",[t._v("测试任务数量:")]),t._v(" "+t._s(t.software.task_num))]),n("el-col",{attrs:{span:4}},[n("strong",[t._v("测试用例数量:")]),t._v(" "+t._s(t.software.case_num))]),n("el-col",{attrs:{span:2}},[n("strong",[t._v("版本数:")]),t._v(" "+t._s(t.software.versions.length))]),n("el-col",{attrs:{span:5}},[n("strong",[t._v("更新时间:")]),t._v(" "+t._s(t._f("singleDateFilter")(t.software.update_time)))]),n("el-col",{attrs:{span:5}},[n("strong",[t._v("创建时间:")]),t._v(" "+t._s(t._f("singleDateFilter")(t.software.create_time)))])],1)],1)],1),n("CCard",[n("CCardHeader",[n("h5",{staticStyle:{display:"inline-block"}},[t._v("版本记录")]),t.checkPerm("CREATE")?n("CButton",{staticStyle:{width:"100px",float:"right"},attrs:{block:"",color:"primary"},on:{click:function(e){t.createVersionModal=!0}}},[t._v("+新建")]):t._e()],1),n("CCardBody",[n("CDataTable",{attrs:{items:t.software.versions,fields:t.iterationfields,"items-per-page":5,hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:t._u([{key:"operation_edit",fn:function(e){var r=e.item,o=e.index;return[t.checkPerm("EDIT")?n("td",{staticClass:"py-2"},[n("CButton",{staticStyle:{width:"50px"},attrs:{color:"warning",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.editVersionFirstStep(r,o)}}},[t._v(" 编辑 ")])],1):t._e()]}},{key:"operation_download",fn:function(e){var r=e.item,o=e.index;return[t.checkPerm("CHECK")?n("td",{staticClass:"py-2"},[n("CButton",{staticStyle:{width:"50px"},attrs:{color:"primary",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.downloadFile(r,o)}}},[t._v(" 下载 ")])],1):t._e()]}},{key:"operation_relation",fn:function(e){var r=e.item;return[t.checkPerm("CHECK")?n("td",{staticClass:"py-2"},[n("CButton",{staticStyle:{width:"50px"},attrs:{color:"info",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.goRelVersion(r)}}},[t._v(" 关联 ")])],1):t._e()]}},{key:"operation_delete",fn:function(e){var r=e.item,o=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.deleteVersionFirstStep(r,o)}}},[t._v(" 删除 ")])],1):t._e()]}}])})],1)],1),n("CCard",[n("CCardHeader",[n("h5",[t._v("测试计划")])]),n("CCardBody",[n("CDataTable",{attrs:{items:t.planList,fields:t.planFields,"items-per-page":8,tableFilter:{label:"搜索",placeholder:"输入任意信息检索"},noItemsView:{noResults:"无结果",noItems:"无测试计划"},cleaner:"",hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:t._u([{key:"state",fn:function(e){var r=e.item;return[n("td",[n("CBadge",{staticStyle:{fontSize:"14px",height:"25px","line-height":"20px"},attrs:{color:t.getBadge(r.state)}},[t._v(" "+t._s(t._f("planStateFilter")(r.state))+" ")])],1)]}},{key:"opt_details",fn:function(e){var r=e.item,o=e.index;return[t.checkPerm("CHECK")?n("td",{staticClass:"py-2"},[n("CButton",{staticStyle:{width:"50px"},attrs:{color:"success",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.gotoPlan(r,o)}}},[t._v(" 查看 ")])],1):t._e()]}},{key:"opt_copy",fn:function(e){var r=e.item,o=e.index;return[t.checkPerm("COPY")?n("td",{staticClass:"py-2"},[n("CButton",{staticStyle:{width:"50px"},attrs:{color:"primary",variant:"outline",square:"",size:"sm"},on:{click:function(e){return t.copyPlan(r,o)}}},[t._v(" 复制 ")])],1):t._e()]}},{key:"opt_delete",fn:function(e){var r=e.item,o=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.deletePlanFirstStep(r,o)}}},[t._v(" 删除 ")])],1):t._e()]}}])})],1)],1),n("CModal",{attrs:{show:t.editModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.editModal=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.editModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(e){t.editModal=!1}}},[t._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.editTarget}},[t._v("确定")])]},proxy:!0}])},[n("CInput",{attrs:{label:"名称",placeholder:"请输入测试项目名称"},model:{value:t.editName,callback:function(e){t.editName=e},expression:"editName"}}),n("CInput",{attrs:{label:"类型",placeholder:"请输入测试项目的类型"},model:{value:t.editType,callback:function(e){t.editType=e},expression:"editType"}})],1),n("CModal",{attrs:{show:t.editVersionModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.editVersionModal=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.editVersionModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(e){t.editVersionModal=!1}}},[t._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.editVersionNow}},[t._v("确定")])]},proxy:!0}])},[n("p",{staticStyle:{marginBottom:"6px"}},[t._v("请上传文件")]),n("el-upload",{ref:"editVersionUploader",staticClass:"upload-demo",attrs:{action:"","auto-upload":!1,limit:1,"file-list":t.fileList}},[n("el-button",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},attrs:{size:"small"}},[t._v("点击上传")])],1)],1),n("CModal",{attrs:{show:t.createVersionModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.createVersionModal=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.createVersionModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(e){t.createVersionModal=!1}}},[t._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.createNewVersion}},[t._v("新建")])]},proxy:!0}])},[n("CInput",{attrs:{label:"名称",placeholder:"请输入版本名称"},model:{value:t.createVersionName,callback:function(e){t.createVersionName=e},expression:"createVersionName"}}),n("p",{staticStyle:{marginBottom:"6px"}},[t._v("请选择文件")]),n("el-upload",{ref:"createVersionUploader",staticClass:"upload-demo",attrs:{action:"","auto-upload":!1,limit:1,"file-list":t.fileList}},[n("el-button",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},attrs:{size:"small"}},[t._v("点击上传")])],1)],1),n("CModal",{attrs:{show:t.deleteVersionModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"danger"},on:{"update:show":function(e){t.deleteVersionModal=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.deleteVersionModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(e){t.deleteVersionModal=!1}}},[t._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:function(e){return t.deleteVersionNow()}}},[t._v("删除")])]},proxy:!0}])},[n("h5",[t._v(" 你确定删除该版本目吗?删除后将无法查看该版本的相关信息!删除最后一个版本将会直接删除本项目! ")])]),n("CModal",{attrs:{show:t.relationModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(e){t.relationModal=e}},scopedSlots:t._u([{key:"header",fn:function(){return[n("h6",{staticClass:"modal-title"},[t._v("关联测试计划")])]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(e){t.relationModal=!1}}},[t._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:t.startBindVersionPlans}},[t._v("关联")])]},proxy:!0}])},[n("div",{staticClass:"modal-body",staticStyle:{display:"flex","justify-content":"center"}},[n("el-transfer",{attrs:{filterable:"","filter-method":t.filterMethod,"filter-placeholder":"请输入检索条件",titles:["可选计划","已选计划"],props:{key:"value",label:"desc"},data:t.planVersionList},model:{value:t.value,callback:function(e){t.value=e},expression:"value"}})],1)])],1)},o=[],a=n("1684"),i=n("1619"),s=n("b775");function l(t,e){return Object(s["a"])({url:"/api/v1/software/".concat(t,"/versions"),method:"POST",data:e})}function c(t,e){return Object(s["a"])({url:"/api/v1/software/".concat(t,"/versions"),method:"DELETE",params:{version_number:e}})}function d(t,e){return Object(s["a"])({url:"/api/v1/software/".concat(t,"/versions/edit"),method:"POST",data:e})}var u=n("e350"),f=n("3f13");function p(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=h(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},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 a,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,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function h(t,e){if(t){if("string"===typeof t)return m(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)?m(t,e):void 0}}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1}}},filters:{singleDateFilter:i["c"],targetDateFilter:i["d"],planStateFilter:i["b"]},mounted:function(){this.softwareId=localStorage.getItem("softwareId"),this.getSoftwareDetail(),this.getPlans(this.softwareId)},computed:{},watch:{},methods:{goRelVersion:function(t){this.versionSel=t.version;var e,n=p(this.planVersionList);try{for(n.s();!(e=n.n()).done;){var r=e.value;console.log(r),r.version==t.version?this.$set(r,"disabled",!0):this.$set(r,"disabled",!1)}}catch(o){n.e(o)}finally{n.f()}this.planVersionList=this.planVersionList.filter((function(t){return 1!=t.disabled})),this.relationModal=!0},startBindVersionPlans:function(){var t=this;console.log("开始绑定",this.value);var e=new FormData;e.append("version_number",this.versionSel);var n,r=[],o=p(this.value);try{for(o.s();!(n=o.n()).done;){var a=n.value;console.log("item",a),r.push(a)}}catch(i){o.e(i)}finally{o.f()}console.log("tmpplanlist",r),e.append("plan_ids",r),Object(f["a"])(this.softwareId,this.versionSel,r).then((function(e){console.log(e,"dddd"),t.$message.success("关联成功"),t.planVersionList=[],t.value=[],t.getSoftwareDetail()})),this.relationModal=!1},editTarget:function(){var t=this,e=new FormData;e.append("name",this.editName),e.append("type",this.editType),Object(a["d"])(this.softwareId,e).then((function(e){t.getSoftwareDetail(),t.editModal=!1}))},editModalOpen:function(){this.editModal=!0,this.editName=this.software.name,this.editType=this.software.type},getSoftwareDetail:function(){var t=this;Object(a["a"])(this.softwareId).then((function(e){t.software=e,t.software.versions=Object(i["d"])(t.software.versions)})),Object(f["h"])(localStorage.getItem("softwareId")).then((function(e){console.log(e,"获取绑定版本计划"),t.planVersionList=[],e.forEach((function(e){t.planVersionList.push({value:e.id,desc:e.title,version:e.version,disabled:!1})}))}))},deleteVersionFirstStep:function(t,e){this.deleteVersionModal=!0,this.versionSelected=t},deleteVersionNow:function(){var t=this;c(this.softwareId,this.versionSelected.version).then((function(e){t.getSoftwareDetail(),t.deleteVersionModal=!1}))},createNewVersion:function(){var t=this;if(""!=this.createVersionName)if(this.$refs["createVersionUploader"].uploadFiles.length<1)this.$message.warning("请上传文件!");else{var e;this.$refs["createVersionUploader"].uploadFiles.length>=1&&(e=this.$refs["createVersionUploader"].uploadFiles.pop());var n=new FormData;n.append("file",e.raw),n.append("version",this.createVersionName),l(this.softwareId,n).then((function(e){t.$message.success("新建版本成功"),t.createVersionModal=!1,t.createVersionName="",t.getSoftwareDetail()}))}else this.$message.warning("请完整填写版本名称!")},editVersionFirstStep:function(t,e){this.versionSelected=t,this.editVersionModal=!0},editVersionNow:function(){var t=this;if(this.$refs["editVersionUploader"].uploadFiles.length<1)this.$message.warning("请上传文件!");else{var e;this.$refs["editVersionUploader"].uploadFiles.length>=1&&(e=this.$refs["editVersionUploader"].uploadFiles.pop());var n=new FormData;n.append("file",e.raw),n.append("version_number",this.versionSelected.version),d(this.softwareId,n).then((function(e){t.getSoftwareDetail(),t.createVersionName="",t.editVersionModal=!1,t.$message.success("修改成功!")}))}},downloadFile:function(t){var e=t.file_url,n=document.createElement("a");n.style.display="none",n.href=e,n.target="_blank",n.click()},checkPerm:function(t){return Object(u["a"])(localStorage.getItem("identity"),t)},getPlans:function(){var t=this;Object(f["g"])("","","",this.softwareId,"").then((function(e){t.planList=Object(i["d"])(e)}))},getBadge:function(t){switch(t){case 0:return"success";case 1:return"secondary";default:}},gotoPlan:function(t,e){this.$router.push("/softwareTestPlanDetail/"+t.id)},exportRep:function(){var t=document.createElement("a");t.style.display="none",t.href="/api/v1/software/"+this.softwareId+"/report?executor_id="+localStorage.getItem("userId"),t.target="_blank",t.click()}}},y=v,w=(n("550b"),n("2877")),_=Object(w["a"])(y,r,o,!1,null,"7d86a5d2",null);e["default"]=_.exports},1619:function(t,e,n){"use strict";function r(t,e){var n="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,a=function(){};return{s:a,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:a}}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,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){l=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw i}}}}function o(t,e){if(t){if("string"===typeof t)return a(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)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1e3?Object(a["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(a["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},c1f7:function(t,e,n){},e350:function(t,e,n){"use strict";function r(t,e){var n=o[t];return n.includes(e)}n.d(e,"a",(function(){return r}));var o=[["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EXECUTE"]]}}]);