1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-140ff0e2"],{1619:function(e,t,r){"use strict";function n(e,t){var r="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=a(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw i}}}}function a(e,t){if(e){if("string"===typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){var t,r=[],a=n(e);try{for(a.s();!(t=a.n()).done;){var o=t.value,i=o.create_time.split("T")[0],s=o.create_time.split("T")[1].slice(0,8);o.create_time=i+" "+s;var l=o.update_time.split("T")[0],c=o.update_time.split("T")[1].slice(0,8);o.update_time=l+" "+c,o.creator=(o.executor||{}).name,r.push(o)}}catch(u){a.e(u)}finally{a.f()}return r}function s(e){var t=e.split("T")[0],r=(e.split("T")[1]+" ").slice(0,8);return t+" "+r}function l(e){switch(e){case 0:return"执行中";case 1:return"已归档";default:return"无"}}function c(e){switch(e){case 0:return"未执行";case 1:return"执行中";case 2:return"已完成";default:return"无"}}function u(e){switch(e){case 0:return"管理员";case 1:return"管理员";case 2:return"工程师";default:return"工程师"}}r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l})),r.d(t,"e",(function(){return c})),r.d(t,"a",(function(){return u}))},1684:function(e,t,r){"use strict";r.d(t,"e",(function(){return a})),r.d(t,"a",(function(){return o})),r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return l}));var n=r("b775");function a(e,t,r){return Object(n["a"])({url:"/api/v1/software/",method:"GET",params:{name:e,type:t,sort:r}})}function o(e){return Object(n["a"])({url:"/api/v1/software/".concat(e),method:"GET"})}function i(e,t){return Object(n["a"])({url:"/api/v1/software/".concat(e,"/edit"),method:"POST",data:t})}function s(e){return Object(n["a"])({url:"/api/v1/software/".concat(e),method:"DELETE"})}function l(e){return Object(n["a"])({url:"/api/v1/software/",method:"POST",data:e})}},5812:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("CCard",[r("CCardHeader",[e._v("测试项目管理")]),e.checkPerm("CREATE")?r("CCardBody",[r("CButton",{staticStyle:{width:"100px"},attrs:{block:"",color:"primary"},on:{click:function(t){e.darkModal=!0}}},[e._v("+新建")])],1):e._e()],1),r("CModal",{attrs:{show:e.darkModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"primary"},on:{"update:show":function(t){e.darkModal=t}},scopedSlots:e._u([{key:"header",fn:function(){return[r("h6",{staticClass:"modal-title"},[e._v("新建测试项目")]),r("CButtonClose",{staticClass:"text-white",on:{click:function(t){e.darkModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[r("CButton",{attrs:{color:"danger"},on:{click:function(t){e.darkModal=!1}}},[e._v("取消")]),r("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:e.createNewTarget}},[e._v("新建")])]},proxy:!0}])},[r("CInput",{attrs:{label:"名称",placeholder:"请输入测试项目名称"},model:{value:e.newTarget.name,callback:function(t){e.$set(e.newTarget,"name",t)},expression:"newTarget.name"}}),r("CInput",{attrs:{label:"类型",placeholder:"请输入测试项目的类型"},model:{value:e.newTarget.type,callback:function(t){e.$set(e.newTarget,"type",t)},expression:"newTarget.type"}}),r("CInput",{attrs:{label:"版本",placeholder:"请输入测试项目的版本"},model:{value:e.newTarget.version,callback:function(t){e.$set(e.newTarget,"version",t)},expression:"newTarget.version"}}),r("p",{staticStyle:{marginBottom:"6px"}},[e._v("请上传软件")]),r("el-upload",{ref:"newTargetUploader",staticClass:"upload-demo",attrs:{action:"","auto-upload":!1,"on-preview":e.handlePreview,"on-remove":e.handleRemove,"before-remove":e.beforeRemove,limit:1,"on-exceed":e.handleExceed,"file-list":e.fileList}},[r("el-button",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},attrs:{size:"small"}},[e._v("点击上传")])],1)],1),r("CCard",[r("CCardBody",[r("CDataTable",{attrs:{items:e.softwareList,fields:e.fields,sorter:!0,tableFilter:{label:"搜索",placeholder:"输入任意信息检索"},noItemsView:{noResults:"无结果",noItems:"无测试项目"},cleaner:"","items-per-page":5,hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:e._u([{key:"opt_details",fn:function(t){var n=t.item,a=t.index;return[e.checkPerm("CHECK")?r("td",{staticClass:"py-2"},[r("CButton",{staticStyle:{width:"50px"},attrs:{color:"success",variant:"outline",square:"",size:"sm"},on:{click:function(t){return e.gotoSoftware(n,a)}}},[e._v(" 查看 ")])],1):e._e()]}},{key:"opt_copy",fn:function(t){var n=t.item,a=t.index;return[e.checkPerm("COPY")?r("td",{staticClass:"py-2"},[r("CButton",{staticStyle:{width:"50px"},attrs:{color:"primary",variant:"outline",square:"",size:"sm"},on:{click:function(t){return e.copySoftware(n,a)}}},[e._v(" 复制 ")])],1):e._e()]}},{key:"opt_delete",fn:function(t){var n=t.item,a=t.index;return[e.checkPerm("DELETE")?r("td",{staticClass:"py-2"},[r("CButton",{staticStyle:{width:"50px"},attrs:{color:"danger",variant:"outline",square:"",size:"sm"},on:{click:function(t){return e.deleteFirstStep(n,a)}}},[e._v(" 删除 ")])],1):e._e()]}}])})],1)],1),r("CModal",{attrs:{show:e.deleteModal,"no-close-on-backdrop":!0,centered:!0,title:"Modal title 2",size:"lg",color:"danger"},on:{"update:show":function(t){e.deleteModal=t}},scopedSlots:e._u([{key:"header",fn:function(){return[r("h6",{staticClass:"modal-title"},[e._v("删除测试项目")]),r("CButtonClose",{staticClass:"text-white",on:{click:function(t){e.deleteModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[r("CButton",{attrs:{color:"danger"},on:{click:function(t){e.deleteModal=!1}}},[e._v("取消")]),r("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:function(t){return e.deleteTarget()}}},[e._v("删除")])]},proxy:!0}])},[r("h5",[e._v("你确定删除该项目吗?删除后将无法查看任何与该项目的相关信息!")])])],1)},a=[],o=r("8229"),i=r("1684"),s=r("1619"),l=r("e350"),c={name:"software",components:{CTableWrapper:o["a"]},data:function(){return{softwareList:[],fields:[{key:"name",label:"名称",_style:"min-width:200px;"},{key:"type",label:"类型",_style:"min-width:200px;"},{key:"create_time",label:"创建时间",_style:"min-width:100px;"},{key:"update_time",label:"更新时间",_style:"min-width:100px;"},{key:"opt_details",label:"",_style:"width:1%",sorter:!1,filter:!1},{key:"opt_copy",label:"",_style:"width:1%",sorter:!1,filter:!1},{key:"opt_delete",label:"",_style:"width:1%;",sorter:!1,filter:!1}],darkModal:!1,fileList:[],deleteModal:!1,deleteItem:{},newTarget:{},dd:!1}},computed:{},mounted:function(){this.getSList()},watch:{},methods:{shuffleArray:function(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e},getShuffledSoftwareData:function(){return this.softwareList.slice(0)},gotoSoftware:function(e,t){localStorage.setItem("softwareId",e.id),this.$router.push("/softwareInside/"+e.id)},deleteTarget:function(){var e=this;Object(i["c"])(this.deleteItem.id).then((function(t){e.deleteModal=!1,e.getSList()}))},copySoftware:function(e,t){},clickRow:function(e,t,r,n){this.$router.push("/softwareInside/"+e.id)},handleRemove:function(e,t){},handlePreview:function(e){},handleExceed:function(e,t){this.$message.warning("当前限制选择 1 个文件")},beforeRemove:function(e,t){return this.$confirm("确定移除 ".concat(e.name,"?"))},getSList:function(){var e=this;1==localStorage.getItem("identity")||0==localStorage.getItem("identity")?Object(i["e"])("","","").then((function(t){e.softwareList=Object(s["d"])(t),console.log(e.softwareList,"ddd")})):Object(i["e"])(localStorage.getItem("userName"),"","").then((function(t){console.log("普通",t,localStorage.getItem("userName"),localStorage.getItem("identity")),e.softwareList=Object(s["d"])(t),console.log(e.softwareList)}))},deleteFirstStep:function(e,t){this.deleteModal=!0,this.deleteItem=e},createNewTarget:function(){var e=this;if(""!=this.newTarget.name&&""!=this.newTarget.type&&""!=this.newTarget.version)if(this.$refs["newTargetUploader"].uploadFiles.length<1)this.$message.warning("请上传文件!");else{var t;this.$refs["newTargetUploader"].uploadFiles.length>=1&&(t=this.$refs["newTargetUploader"].uploadFiles.pop());var r=new FormData;t&&r.append("file",t.raw),r.append("version",this.newTarget.version),r.append("name",this.newTarget.name),r.append("type",this.newTarget.type),Object(i["b"])(r).then((function(t){e.$message.success("新建成功"),e.darkModal=!1,e.getSList()}))}else this.$message.warning("请完整填写任务信息!")},checkPerm:function(e){return Object(l["a"])(localStorage.getItem("identity"),e)}}},u=c,d=r("2877"),f=Object(d["a"])(u,n,a,!1,null,"75aa7f26",null);t["default"]=f.exports},8229:function(e,t,r){"use strict";var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("CCard",[r("CCardHeader",[e._t("header",(function(){return[r("CIcon",{attrs:{name:"cil-grid"}}),e._v(" "+e._s(e.caption)+" ")]}))],2),r("CCardBody",[r("CDataTable",{attrs:{hover:e.hover,striped:e.striped,border:e.border,small:e.small,fixed:e.fixed,items:e.items,fields:e.fields,"items-per-page":e.small?10:5,dark:e.dark,pagination:""},scopedSlots:e._u([{key:"status",fn:function(t){var n=t.item;return[r("td",[r("CBadge",{attrs:{color:e.getBadge(n.status)}},[e._v(e._s(n.status))])],1)]}}])})],1)],1)},a=[],o={name:"Table",props:{items:Array,fields:{type:Array,default:function(){return["username","registered","role","status"]}},caption:{type:String,default:"Table"},hover:Boolean,striped:Boolean,border:Boolean,small:Boolean,fixed:Boolean,dark:Boolean},methods:{getBadge:function(e){return"Active"===e?"success":"Inactive"===e?"secondary":"Pending"===e?"warning":"Banned"===e?"danger":"primary"}}},i=o,s=r("2877"),l=Object(s["a"])(i,n,a,!1,null,null,null);t["a"]=l.exports},b775:function(e,t,r){"use strict";var n=r("bc3a"),a=r.n(n),o=r("5c96");r("c0d6");a.a.defaults.withCredentials=!0;var i=a.a.create({withCredentials:!0,timeout:1e5});i.interceptors.response.use((function(e){var t=e.data;return t}),(function(e){return console.log("err"+e),e.response.data.length>1e3?Object(o["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(o["Message"])({message:e.response.data,type:"error",duration:2e4}),Promise.reject(e)})),i.interceptors.request.use((function(e){var t=window.localStorage.getItem("accessToken");return t?(e.headers.accessToken=t,e):e})),t["a"]=i},e350:function(e,t,r){"use strict";function n(e,t){var r=a[e];return r.includes(t)}r.d(t,"a",(function(){return n}));var a=[["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EXECUTE"]]}}]);
|