lepu-test-platform-web/dist/static/js/11.8ccb9074dc9dc8086b2c.js

2 lines
9.5 KiB
JavaScript

webpackJsonp([11],{MKMz:function(e,t){},"q+hK":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:{versionName:"",itemName:"",pageNum:1,pageSize:10},itemlist:[],currpage:1,total:0,addDialogVisible:!1,editDialogVisible:!1,detailDialogVisible:!1,addForm:{versionName:"",comments:"",itemId:""},addFormRules:{itemName:[{required:!0,message:"请选择项目名称",trigger:"blur"}],versionName:[{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.getVersionList()},methods:{onSearch:function(){this.queryInfo.pageNum=1,this.getVersionList()},getVersionList:function(){var e=this;this.$api.version.queryAllVersion(o()(this.queryInfo)).then(function(t){e.loading=!1,localStorage.setItem("active",0),e.itemlist=t.data.data,e.total=t.data.count}).catch(function(){e.loading=!1})},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})},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getVersionList()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.getVersionList()},addDialogClose:function(){this.$refs.addFormRef.resetFields()},addItem:function(){var e=this;this.$refs.addFormRef.validate(function(t){t&&e.$api.version.addVersion(o()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.addDialogVisible=!1,e.$refs.addFormRef.resetFields(),e.getVersionList()}).catch(function(){e.loading=!1})})},editDialogClose:function(){this.$refs.editFormRef.resetFields()},showEditDialog:function(e){var t=this;this.editDialogVisible=!0,this.$api.version.queryVersionById(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.version.updateVersion(o()(e.editForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.editDialogVisible=!1,e.getVersionList()}).catch(function(){e.loading=!1})})},showDetailDialog:function(e){var t=this;this.detailDialogVisible=!0,this.$api.version.queryVersionById(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.version.deleteVersion(e).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.getVersionList(),t.getVersionNameList()}).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:"box"},[i("el-form",{staticClass:"item-form-inline",attrs:{inline:!0}},[i("el-form-item",{attrs:{label:"版本名称"}},[i("el-input",{attrs:{placeholder:"请输入关键字",clearable:""},model:{value:e.queryInfo.versionName,callback:function(t){e.$set(e.queryInfo,"versionName",t)},expression:"queryInfo.versionName"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"项目名称"}},[i("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.queryInfo.itemId,callback:function(t){e.$set(e.queryInfo,"itemId",t)},expression:"queryInfo.itemId"}},e._l(e.itemOptions,function(e){return i("el-option",{key:e.id,attrs:{label:e.itemName,value:e.id}})}),1)],1),e._v(" "),i("el-form-item",[i("el-button",{attrs:{type:"primary"},on:{click:e.onSearch}},[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){e.addDialogVisible=!0}}},[e._v("添加")])],1)],1),e._v(" "),i("el-table",{attrs:{data:e.itemlist,border:"",fit:!0}},[i("el-table-column",{attrs:{label:"序号",type:"index",align:"center",width:"80"}}),e._v(" "),i("el-table-column",{attrs:{label:"版本名称",prop:"versionName",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{label:"项目名称",prop:"itemName",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{label:"备注",prop:"comments",align:"center"}}),e._v(" "),i("el-table-column",{attrs:{label:"创建时间",prop:"createTime",align:"center",width:"170"}}),e._v(" "),i("el-table-column",{attrs:{label:"更新时间",prop:"updateTime",align:"center",width:"170"}}),e._v(" "),i("el-table-column",{attrs:{label:"操作",fixed:"right",align:"center",width:"180"},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(" "),i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){return e.delItem(t.row.id)}}},[e._v("删除")])]}}])})],1),e._v(" "),i("el-pagination",{attrs:{"current-page":e.queryInfo.pageNum,"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,"update:currentPage":function(t){return e.$set(e.queryInfo,"pageNum",t)},"update:current-page":function(t){return e.$set(e.queryInfo,"pageNum",t)}}}),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-form-item",{attrs:{label:"项目名称",prop:"itemId"}},[i("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.addForm.itemId,callback:function(t){e.$set(e.addForm,"itemId",t)},expression:"addForm.itemId"}},e._l(e.itemOptions,function(e){return i("el-option",{key:e.id,attrs:{label:e.itemName,value:e.id}})}),1)],1),e._v(" "),i("el-form-item",{attrs:{label:"版本名称",prop:"versionName"}},[i("el-input",{model:{value:e.addForm.versionName,callback:function(t){e.$set(e.addForm,"versionName",t)},expression:"addForm.versionName"}})],1),e._v(" "),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),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: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-form-item",{attrs:{label:"项目名称",prop:"itemId"}},[i("el-select",{attrs:{placeholder:"请选择"},model:{value:e.editForm.itemId,callback:function(t){e.$set(e.editForm,"itemId",t)},expression:"editForm.itemId"}},e._l(e.itemOptions,function(e){return i("el-option",{key:e.id,attrs:{label:e.itemName,value:e.id}})}),1)],1),e._v(" "),i("el-form-item",{attrs:{label:"版本名称",prop:"versionName"}},[i("el-input",{model:{value:e.editForm.versionName,callback:function(t){e.$set(e.editForm,"versionName",t)},expression:"editForm.versionName"}})],1),e._v(" "),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),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-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),e._v(" "),i("el-form-item",{attrs:{label:"版本名称",prop:"versionName"}},[i("el-input",{attrs:{disabled:""},model:{value:e.detailForm.versionName,callback:function(t){e.$set(e.detailForm,"versionName",t)},expression:"detailForm.versionName"}})],1),e._v(" "),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),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("MKMz")},"data-v-f9d406d2",null);t.default=r.exports}});
//# sourceMappingURL=11.8ccb9074dc9dc8086b2c.js.map