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,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw i}}}}function a(e,t){if(e){if("string"===typeof e)return o(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)?o(e,t):void 0}}function o(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 i(e){var t,n=[],a=r(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 u=o.update_time.split("T")[0],c=o.update_time.split("T")[1].slice(0,8);o.update_time=u+" "+c,o.creator=(o.executor||{}).name,n.push(o)}}catch(l){a.e(l)}finally{a.f()}return n}function s(e){var t=e.split("T")[0],n=(e.split("T")[1]+" ").slice(0,8);return t+" "+n}function u(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 l(e){switch(e){case 0:return"管理员";case 1:return"管理员";case 2:return"工程师";default:return"工程师"}}n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"e",(function(){return c})),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 o})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"b",(function(){return u}));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 o(e){return Object(r["a"])({url:"/api/v1/software/".concat(e),method:"GET"})}function i(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 u(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))+" ")]):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()]}}],null,!1,4205079671)})],1)],1):e._e()],1)},a=[],o=n("8229"),i=n("1684"),s=n("1619"),u=n("e350"),c=n("c24f"),l={name:"software",components:{CTableWrapper:o["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;"}],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(i["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(c["c"])().then((function(t){console.log(t,"用户列表"),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(i["b"])(n).then((function(t){e.$message.success("新建成功"),e.darkModal=!1,e.getSList()}))}else this.$message.warning("请完整填写任务信息!")},checkPerm:function(e){return Object(u["a"])(localStorage.getItem("identity"),e)},exportUser:function(){Object(c["a"])().then((function(e){window.open("/api/v1/users/export")}))}}},d=l,f=n("2877"),p=Object(f["a"])(d,r,a,!1,null,"2944d014",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=[],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=n("2877"),u=Object(s["a"])(i,r,a,!1,null,null,null);t["a"]=u.exports},b775:function(e,t,n){"use strict";var r=n("bc3a"),a=n.n(r),o=n("5c96");n("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},c24f:function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"d",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"g",(function(){return s})),n.d(t,"f",(function(){return u})),n.d(t,"c",(function(){return c})),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 o(e){return Object(r["a"])({url:"/api/v1/group/user",method:"GET",params:{user_id:e}})}function i(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 u(e){return Object(r["a"])({url:"/api/v1/users/",method:"POST",data:e})}function c(){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"]]}}]);
|