2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
webpackJsonp([16],{CO08:function(e,t){},"bYW/":function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("mvHQ"),o=i.n(a),l={data:function(){return{itemOptions:[],detailForm:{},editForm:{},queryInfo:{itemName:"",pageNum:1,pageSize:10},jiraItemOptions:[],itemList:[],currpage:1,total:0,addDialogVisible:!1,editDialogVisible:!1,detailDialogVisible:!1,addForm:{itemName:"",comments:"",jiraItem:"",jiraItemKey:""},addFormRules:{itemName:[{required:!0,message:"请输入项目名",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],comments:[{required:!1,message:"请输入备注信息",trigger:"blur"},{min:0,max:200,message:"长度在 0 到 200 个字符",trigger:"blur"}]}}},mounted:function(){this.getItemNameList()},created:function(){this.getItemList()},methods:{addchangeJiraItem:function(e){var t=this;this.jiraItemOptions.forEach(function(i){i.pname==e&&(t.addForm.jiraItemKey=i.pkey)})},editchangeJiraItem:function(e){var t=this;this.jiraItemOptions.forEach(function(i){i.pname==e&&(t.editForm.jiraItemKey=i.pkey)})},placeOnFile:function(e){var t=this;this.$confirm("归档后,该项目中所有测试用例将无法展示,确认归档吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.item.placeOnFileItemById(e).then(function(e){t.getItemList()}).catch(function(){})}).catch(function(){})},placeOffFile:function(e){var t=this;this.$confirm("还原后,该项目中所有测试用例将被展示,确认还原吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.item.placeOffFileItemById(e).then(function(e){t.getItemList()}).catch(function(){})}).catch(function(){})},placeStatusFormat:function(e,t){return 1==e.placeStatus?"正常":"已归档"},getItemNameList:function(){var e=this;this.$api.item.queryAllItemIdAndItemName(this.queryInfo.itemName).then(function(t){e.loading=!1,localStorage.setItem("active",0),e.itemOptions=t.data.data}).catch(function(){e.loading=!1})},selectItemList:function(){this.queryInfo.pageNum=1,this.total=0,this.getItemList()},getItemList:function(){var e=this;this.$api.item.queryAllItem(o()(this.queryInfo)).then(function(t){e.loading=!1,e.itemList=t.data.data,e.total=t.data.count,e.queryInfo.pageNum=1}).catch(function(){e.loading=!1})},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getItemList()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.getItemList()},addDialogClose:function(){this.$refs.addFormRef.resetFields()},addItemDialog:function(){var e=this;this.addDialogVisible=!0,this.$api.jira.getProject().then(function(t){e.jiraItemOptions=t.data.data})},addItem:function(){var e=this;this.$refs.addFormRef.validate(function(t){t&&e.$api.item.addItem(o()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.addDialogVisible=!1,e.getItemList(),e.getItemNameList()}).catch(function(){e.loading=!1})})},editDialogClose:function(){this.$refs.editFormRef.resetFields()},showEditDialog:function(e){var t=this;this.editDialogVisible=!0,this.$api.jira.getProject().then(function(e){t.jiraItemOptions=e.data.data}),this.$api.item.queryItemById(e).then(function(e){t.loading=!1,t.editForm=e.data.data}).catch(function(){t.loading=!1})},editItem:function(){var e=this;this.$refs.editFormRef.validate(function(t){t&&e.$api.item.updateItem(o()(e.editForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.editDialogVisible=!1,e.getItemList(),e.getItemNameList()}).catch(function(){e.loading=!1})})},showDetailDialog:function(e){var t=this;this.detailDialogVisible=!0,this.$api.item.queryItemById(e).then(function(e){t.loading=!1,t.detailForm=e.data.data}).catch(function(){t.loading=!1})},delItem:function(e){var t=this;this.$confirm("确定删除该项目吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.item.deleteItem(e).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.getItemList(),t.getItemNameList()}).catch(function(){t.loading=!1})}).catch(function(){})}}},n={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"item-box"},[i("el-form",{staticClass:"item-form-inline",attrs:{inline:!0}},[i("el-form-item",{attrs:{label:"项目名称"}},[i("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.queryInfo.itemName,callback:function(t){e.$set(e.queryInfo,"itemName",t)},expression:"queryInfo.itemName"}},e._l(e.itemOptions,function(e){return i("el-option",{key:e.id,attrs:{label:e.itemName,value:e.itemName}})}),1)],1),e._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:e.selectItemList}},[e._v("查询")])],1)],1),e._v(" "),i("el-row",{staticClass:"add_button"},[i("el-col",{attrs:{span:2}},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.addItemDialog()}}},[e._v("添加")])],1)],1),e._v(" "),i("el-table",{attrs:{data:e.itemList.slice((e.currpage-1)*e.queryInfo.pageSize,e.currpage*e.queryInfo.pageSize),border:"",fit:!0}},[i("el-table-column",{attrs:{label:"序号",type:"index",align:"center",width:"80"}}),e._v(" "),i("el-table-column",{attrs:{label:"项目名称",prop:"itemName"}}),e._v(" "),i("el-table-column",{attrs:{label:"jira项目",prop:"jiraItem"}}),e._v(" "),i("el-table-column",{attrs:{label:"jiraKey",prop:"jiraItemKey"}}),e._v(" "),i("el-table-column",{attrs:{label:"状态",prop:"placeStatus",formatter:e.placeStatusFormat}}),e._v(" "),i("el-table-column",{attrs:{label:"备注",prop:"comments"}}),e._v(" "),i("el-table-column",{attrs:{label:"操作",fixed:"right",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){return e.showDetailDialog(t.row.id)}}},[e._v("查看")]),e._v(" "),i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){return e.showEditDialog(t.row.id)}}},[e._v("编辑")]),e._v(" "),1==t.row.placeStatus?i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){return e.placeOnFile(t.row.id)}}},[e._v("归档")]):e._e(),e._v(" "),2==t.row.placeStatus?i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){return e.placeOffFile(t.row.id)}}},[e._v("还原")]):e._e()]}}])})],1),e._v(" "),i("el-pagination",{attrs:{"current-page":e.currpage,"page-sizes":[5,10,20,30],"page-size":e.queryInfo.pageSize,layout:"prev, pager, next, sizes, total, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}),e._v(" "),i("el-dialog",{attrs:{title:"添加",visible:e.addDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.addDialogVisible=t},close:e.addDialogClose}},[i("el-form",{ref:"addFormRef",attrs:{model:e.addForm,rules:e.addFormRules,"label-width":"100px"}},[i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"项目名",prop:"itemName"}},[i("el-input",{model:{value:e.addForm.itemName,callback:function(t){e.$set(e.addForm,"itemName",t)},expression:"addForm.itemName"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"Jira项目",prop:"jiraItem"}},[i("el-select",{attrs:{placeholder:"请选择"},on:{change:e.addchangeJiraItem},model:{value:e.addForm.jiraItem,callback:function(t){e.$set(e.addForm,"jiraItem",t)},expression:"addForm.jiraItem"}},e._l(e.jiraItemOptions,function(e){return i("el-option",{key:e.pkey,attrs:{label:e.pname,value:e.pname}})}),1)],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"JiraKey",prop:"jiraItemKey"}},[i("el-input",{attrs:{disabled:""},model:{value:e.addForm.jiraItemKey,callback:function(t){e.$set(e.addForm,"jiraItemKey",t)},expression:"addForm.jiraItemKey"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"备注",prop:"comments"}},[i("el-input",{attrs:{type:"textarea"},model:{value:e.addForm.comments,callback:function(t){e.$set(e.addForm,"comments",t)},expression:"addForm.comments"}})],1)],1)],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.addDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.addItem()}}},[e._v("确 定")])],1)],1),e._v(" "),i("el-dialog",{attrs:{title:"修改",visible:e.editDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.editDialogVisible=t},close:e.editDialogClose}},[i("el-form",{ref:"editFormRef",attrs:{model:e.editForm,rules:e.addFormRules,"label-width":"100px"}},[i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"项目名",prop:"itemName"}},[i("el-input",{model:{value:e.editForm.itemName,callback:function(t){e.$set(e.editForm,"itemName",t)},expression:"editForm.itemName"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"Jira项目",prop:"jiraItem"}},[i("el-select",{attrs:{placeholder:"请选择"},on:{change:e.editchangeJiraItem},model:{value:e.editForm.jiraItem,callback:function(t){e.$set(e.editForm,"jiraItem",t)},expression:"editForm.jiraItem"}},e._l(e.jiraItemOptions,function(e){return i("el-option",{key:e.pkey,attrs:{label:e.pname,value:e.pname}})}),1)],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"JiraKey",prop:"jiraItemKey"}},[i("el-input",{attrs:{disabled:""},model:{value:e.editForm.jiraItemKey,callback:function(t){e.$set(e.editForm,"jiraItemKey",t)},expression:"editForm.jiraItemKey"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"备注",prop:"comments"}},[i("el-input",{attrs:{type:"textarea"},model:{value:e.editForm.comments,callback:function(t){e.$set(e.editForm,"comments",t)},expression:"editForm.comments"}})],1)],1)],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.editDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:e.editItem}},[e._v("确 定")])],1)],1),e._v(" "),i("el-dialog",{attrs:{title:"查看",visible:e.detailDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(t){e.detailDialogVisible=t}}},[i("el-form",{attrs:{model:e.detailForm,"label-width":"100px"}},[i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"项目名",prop:"itemName"}},[i("el-input",{attrs:{disabled:""},model:{value:e.detailForm.itemName,callback:function(t){e.$set(e.detailForm,"itemName",t)},expression:"detailForm.itemName"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"Jira项目",prop:"jiraItem"}},[i("el-select",{attrs:{disabled:""},model:{value:e.detailForm.jiraItem,callback:function(t){e.$set(e.detailForm,"jiraItem",t)},expression:"detailForm.jiraItem"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"JiraKey",prop:"jiraItemKey"}},[i("el-input",{attrs:{disabled:""},model:{value:e.detailForm.jiraItemKey,callback:function(t){e.$set(e.detailForm,"jiraItemKey",t)},expression:"detailForm.jiraItemKey"}})],1)],1)],1),e._v(" "),i("el-row",[i("el-col",[i("el-form-item",{attrs:{label:"备注",prop:"comments"}},[i("el-input",{attrs:{type:"textarea",disabled:""},model:{value:e.detailForm.comments,callback:function(t){e.$set(e.detailForm,"comments",t)},expression:"detailForm.comments"}})],1)],1)],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.detailDialogVisible=!1}}},[e._v("取 消")])],1)],1)],1)},staticRenderFns:[]};var r=i("VU/8")(l,n,!1,function(e){i("CO08")},"data-v-88894166",null);t.default=r.exports}});
|
|
//# sourceMappingURL=16.bd793ea4631de0145283.js.map
|