2 lines
9.5 KiB
JavaScript
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("
|
||
|
//# sourceMappingURL=11.8ccb9074dc9dc8086b2c.js.map
|