1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-61ad3c7e"],{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=a(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}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,o=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){c=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw i}}}}function a(t,e){if(t){if("string"===typeof t)return s(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)?s(t,e):void 0}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t){var e,n=[],a=r(t);try{for(a.s();!(e=a.n()).done;){var s=e.value,i=s.create_time.split("T")[0],o=s.create_time.split("T")[1].slice(0,8);s.create_time=i+" "+o;var c=s.update_time.split("T")[0],u=s.update_time.split("T")[1].slice(0,8);s.update_time=c+" "+u,n.push(s)}}catch(l){a.e(l)}finally{a.f()}return n}function o(t){var e=t.split("T")[0],n=(t.split("T")[1]+" ").slice(0,8);return e+" "+n}function c(t){switch(t){case 0:return"执行中";case 1:return"已归档";default:return"无"}}function u(t){switch(t){case 0:return"未执行";case 1:return"执行中";case 2:return"已完成";default:return"无"}}n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return u}))},"40fd":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",[n("CCard",[n("CCardHeader",[t._v(" 不合格项管理 ")]),n("CCardBody",[n("CTabs",{attrs:{"active-tab":0}},[n("CTab",{attrs:{title:"项目版本",active:""}},[n("CDataTable",{attrs:{items:t.versionList,fields:t.versionFields,sorter:!0,tableFilter:{label:"搜索",placeholder:"输入任意信息检索"},noItemsView:{noResults:"无结果",noItems:"无测试项目"},cleaner:"","items-per-page":5,hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:t._u([{key:"opt_details",fn:function(e){var r=e.item;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.exportVersionNopass(r)}}},[t._v(" 导出 ")])],1):t._e()]}}])})],1),n("CTab",{attrs:{title:"任务",active:""}},[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 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("taskStateFilter")(r.state))+" ")])],1)]}},{key:"opt_exportNoPass",fn:function(e){var r=e.item,a=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.downloadTaskNopa(r,a)}}},[t._v(" 导出 ")])],1):t._e()]}}])})],1)],1)],1)],1)],1)],1)],1)},a=[],s=n("1619"),i=n("90c2"),o=n("e350"),c=n("e3b5"),u={name:"TestNoPass",data:function(){return{taskList:[],taskFields:[{key:"title",label:"任务名称",_style:"min-width:300px"},{key:"description",label:"描述",_style:"min-width:200px"},{key:"software_name",label:"所属软件",_style:"min-width:200px"},{key:"version",label:"所属版本",_style:"min-width:100px"},{key:"plan_name",label:"所属计划",_style:"min-width:200px"},{key:"state",label:"状态",sorter:!1,filter:!1,_style:"min-width:100px;"},{key:"fail_num",label:"不合格项数量",_style:"min-width:150px;"},{key:"opt_exportNoPass",label:"不合格项",_style:"min-width:10px;"}],versionList:[],versionFields:[{key:"software_name",label:"软件名称",_style:"min-width:200px;"},{key:"version_number",label:"版本号",_style:"min-width:200px;"},{key:"fail_num",label:"不合格项数量",_style:"min-width:100px;"},{key:"opt_details",label:"不合格项",_style:"min-width:50px;",sorter:!1,filter:!1}]}},mounted:function(){this.getVersionNopass(),this.getTasks("","","","","")},filters:{taskStateFilter:s["d"]},computed:{},watch:{},methods:{getBadge:function(t){switch(t){case 0:return"secondary";case 1:return"success";case 2:return"primary";default:}},getTasks:function(t,e,n,r,a){var o=this;Object(i["f"])(t,e,n,r,a).then((function(t){o.taskList=Object(s["c"])(t)}))},checkPerm:function(t){return Object(o["a"])(localStorage.getItem("identity"),t)},exportNoPassReport:function(t,e){},getVersionNopass:function(){var t=this;Object(c["c"])("","").then((function(e){t.versionList=e}))},exportVersionNopass:function(t,e){Object(c["a"])(t.software_id,"2",t.version_number).then((function(e){window.open("/api/v1/software/".concat(t.software_id,"/versions?type=",2,"&version_number=").concat(t.version_number))}))},downloadTaskNopa:function(t){Object(c["b"])(t.id,"2").then((function(e){window.open("/api/v1/test-tasks/".concat(t.id,"/case-file?type=2"))}))}}},l=u,d=n("2877"),f=Object(d["a"])(l,r,a,!1,null,"aaaf3b86",null);e["default"]=f.exports},"90c2":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"f",(function(){return c})),n.d(e,"e",(function(){return u}));var r=n("b775");function a(t){return Object(r["a"])({url:"/v1/test-tasks/",method:"POST",data:t})}function s(t){return Object(r["a"])({url:"/v1/test-tasks/".concat(t),method:"GET"})}function i(t){return Object(r["a"])({url:"/v1/test-tasks/".concat(t),method:"DELETE"})}function o(t,e){return Object(r["a"])({url:"/v1/test-tasks/".concat(t,"/edit"),method:"POST",data:e})}function c(t,e,n,a,s){return Object(r["a"])({url:"/v1/test-tasks/",method:"GET",params:{executor_id:a,title:t,state:e,software_id:n,sort:s}})}function u(t,e){return Object(r["a"])({url:"/v1/test-tasks/".concat(t,"/case-file/execute"),method:"POST",data:e})}},b775:function(t,e,n){"use strict";var r=n("bc3a"),a=n.n(r),s=n("5c96");n("c0d6");a.a.defaults.withCredentials=!0;var i=a.a.create({baseURL:"/api",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(s["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(s["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},e350:function(t,e,n){"use strict";function r(t,e){var n=a[t];return n.includes(e)}n.d(e,"a",(function(){return r}));var a=[["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EXECUTE"]]},e3b5:function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return i}));var r=n("b775");function a(t,e){return Object(r["a"])({url:"/v1/software/versions",method:"GET",params:{software_name:t,sort:e}})}function s(t,e,n){return Object(r["a"])({url:"/v1/software/".concat(t,"/versions"),method:"GET",params:{type:e,version_number:n}})}function i(t,e){return Object(r["a"])({url:"/v1/test-tasks/".concat(t,"/case-file"),method:"GET",params:{type:e}})}}}]);
|