chunk-28e0a0ac.f131deec.js 10 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-28e0a0ac"],{1619:function(e,t,n){"use strict";function r(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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,s=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw o}}}}function a(e,t){if(e){if("string"===typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t,n=[],a=r(e);try{for(a.s();!(t=a.n()).done;){var i=t.value,o=i.create_time.split("T")[0],s=i.create_time.split("T")[1].slice(0,8);i.create_time=o+" "+s;var c=i.update_time.split("T")[0],u=i.update_time.split("T")[1].slice(0,8);i.update_time=c+" "+u,i.creator=(i.executor||{}).name,n.push(i)}}catch(l){a.e(l)}finally{a.f()}return n}function s(e){var t=-1!=(e||"").indexOf("T")&&e.split("T")[0],n=-1!=(e||"").indexOf("T")&&(e.split("T")[1]+" ").slice(0,8);return t+" "+n}function c(e){switch(e){case 0:return"执行中";case 1:return"已归档";default:return"无"}}function u(e){switch(e){case 0:return"未执行";case 1:return"执行中";case 2:return"已完成";default:return"无"}}function l(e){switch(e){case 0:return"系统管理员";case 1:return"测试管理员";case 2:return"测试工程师";default:return"测试工程师"}}n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"e",(function(){return u})),n.d(t,"a",(function(){return l}))},1684:function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return c}));var r=n("b775");function a(e,t,n){return Object(r["a"])({url:"/api/v1/software/",method:"GET",params:{name:e,type:t,sort:n}})}function i(e){return Object(r["a"])({url:"/api/v1/software/".concat(e),method:"GET"})}function o(e,t){return Object(r["a"])({url:"/api/v1/software/".concat(e,"/edit"),method:"POST",data:t})}function s(e){return Object(r["a"])({url:"/api/v1/software/".concat(e),method:"DELETE"})}function c(e){return Object(r["a"])({url:"/api/v1/software/",method:"POST",data:e})}},"5ab8":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[e.checkPerm("CREATE")?n("CCard",[n("CCardHeader",[e._v("用户管理 "),n("el-button",{staticStyle:{float:"right"},on:{click:e.exportUser}},[e._v("导出用户")])],1)],1):e._e(),n("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[n("h6",{staticClass:"modal-title"},[e._v("新建测试项目")]),n("CButtonClose",{staticClass:"text-white",on:{click:function(t){e.darkModal=!1}}})]},proxy:!0},{key:"footer",fn:function(){return[n("CButton",{attrs:{color:"danger"},on:{click:function(t){e.darkModal=!1}}},[e._v("取消")]),n("CButton",{staticStyle:{backgroundColor:"rgb(50,31,219)",color:"white"},on:{click:e.createNewTarget}},[e._v("新建")])]},proxy:!0}])},[n("CInput",{attrs:{label:"名称",placeholder:"请输入测试项目名称"},model:{value:e.newTarget.name,callback:function(t){e.$set(e.newTarget,"name",t)},expression:"newTarget.name"}})],1),e.checkPerm("CREATE")?n("CCard",[n("CCardBody",[n("CDataTable",{attrs:{items:e.userList,fields:e.fields,sorter:!0,tableFilter:{label:"搜索",placeholder:"输入任意信息检索"},noItemsView:{noResults:"无结果",noItems:"无测试项目"},cleaner:"","items-per-page":10,hover:"",pagination:{doubleArrows:!0,align:"center"}},scopedSlots:e._u([{key:"identify",fn:function(t){var r=t.item;return[e.checkPerm("DELETE")?n("td",{staticClass:"py-2"},[e._v(" "+e._s(e._f("identityFilter")(r.identify))+" ")]):e._e()]}},{key:"name",fn:function(t){var r=t.item;return[e.checkPerm("DELETE")?n("td",{staticClass:"py-2"},[e._v(" "+e._s(""==r.name?"暂无":r.name)+" ")]):e._e()]}},{key:"tel",fn:function(t){var r=t.item;return[e.checkPerm("DELETE")?n("td",{staticClass:"py-2"},[e._v(" "+e._s(""==r.tel?"暂无":r.tel)+" ")]):e._e()]}},{key:"is_login",fn:function(t){var r=t.item;return[e.checkPerm("DELETE")?n("td",{staticClass:"py-2"},[e._v(" "+e._s(r.is_login?"在线":"离线")+" ")]):e._e()]}}],null,!1,3408507786)})],1)],1):e._e()],1)},a=[],i=n("8229"),o=n("1684"),s=n("1619"),c=n("e350"),u=n("c24f"),l={name:"software",components:{CTableWrapper:i["a"]},filters:{identityFilter:s["a"]},data:function(){return{userList:[],fields:[{key:"username",label:"用户名",_style:"min-width:200px;"},{key:"name",label:"企业",_style:"min-width:200px;"},{key:"tel",label:"手机",_style:"min-width:200px;"},{key:"identify",label:"系统角色",_style:"min-width:100px;"},{key:"is_login",label:"登录状态",_style:"min-width:100px;"},{key:"create_time",label:"创建时间",_style:"min-width:100px;"}],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 n=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[n],e[n]=r}return e},getShuffledSoftwareData:function(){return this.userList.slice(0)},gotoSoftware:function(e,t){localStorage.setItem("softwareId",e.id),this.$router.push("/softwareInside/"+e.id)},deleteTarget:function(){var e=this;Object(o["c"])(this.deleteItem.id).then((function(t){e.deleteModal=!1,e.getSList()}))},copySoftware:function(e,t){},clickRow:function(e,t,n,r){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;Object(u["c"])().then((function(t){console.log(t,"用户列表"),t.forEach((function(e,t,n){e.create_time=Object(s["c"])(e.create_time)})),e.userList=t}))},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 n=new FormData;t&&n.append("file",t.raw),n.append("version",this.newTarget.version),n.append("name",this.newTarget.name),n.append("type",this.newTarget.type),Object(o["b"])(n).then((function(t){e.$message.success("新建成功"),e.darkModal=!1,e.getSList()}))}else this.$message.warning("请完整填写任务信息!")},checkPerm:function(e){return Object(c["a"])(localStorage.getItem("identity"),e)},exportUser:function(){Object(u["a"])().then((function(e){window.open("/api/v1/users/export")}))}}},d=l,f=n("2877"),p=Object(f["a"])(d,r,a,!1,null,"42e580db",null);t["default"]=p.exports},8229:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CCard",[n("CCardHeader",[e._t("header",(function(){return[n("CIcon",{attrs:{name:"cil-grid"}}),e._v(" "+e._s(e.caption)+" ")]}))],2),n("CCardBody",[n("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 r=t.item;return[n("td",[n("CBadge",{attrs:{color:e.getBadge(r.status)}},[e._v(e._s(r.status))])],1)]}}])})],1)],1)},a=[],i={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"}}},o=i,s=n("2877"),c=Object(s["a"])(o,r,a,!1,null,null,null);t["a"]=c.exports},b775:function(e,t,n){"use strict";var r=n("bc3a"),a=n.n(r),i=n("5c96");n("c0d6");a.a.defaults.withCredentials=!0;var o=a.a.create({withCredentials:!0,timeout:1e5});o.interceptors.response.use((function(e){var t=e.data;return t}),(function(e){return console.log("err"+e),e.response.data.length>1e3?Object(i["Message"])({message:"服务器出错",type:"error",duration:3e3}):Object(i["Message"])({message:e.response.data,type:"error",duration:2e4}),Promise.reject(e)})),o.interceptors.request.use((function(e){var t=window.localStorage.getItem("accessToken");return t?(e.headers.accessToken=t,e):e})),t["a"]=o},c24f:function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"g",(function(){return s})),n.d(t,"f",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return l}));var r=n("b775");function a(e){return Object(r["a"])({url:"/api/v1/users/login",method:"POST",data:e})}function i(e){return Object(r["a"])({url:"/api/v1/group/user",method:"GET",params:{user_id:e}})}function o(e){return Object(r["a"])({url:"/api/v1/users/".concat(e),method:"GET"})}function s(e,t){return Object(r["a"])({url:"/api/v1/users/".concat(e,"/edit"),method:"POST",data:t})}function c(e){return Object(r["a"])({url:"/api/v1/users/",method:"POST",data:e})}function u(){return Object(r["a"])({url:"/api/v1/users/",method:"GET",params:{username:"",identify:"",is_login:"",sort:""}})}function l(){return Object(r["a"])({url:"/api/v1/users/export",method:"GET"})}},e350:function(e,t,n){"use strict";function r(e,t){var n=a[e];return n.includes(t)}n.d(t,"a",(function(){return r}));var a=[["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EDIT","DELETE","CREATE","EXECUTE","DELETE","CONFIRM","EXPORT"],["CHECK","EXECUTE"]]}}]);