webpackJsonp([64],{LHBE:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=a("vLgD");var n={name:"storageSolution",data:function(){return{loading:!1,params:{page_no:1,page_size:10},tableData:"",storageForm:"",storageRules:{},dialogStorageVisible:!1}},mounted:function(){this.GET_StorageSolutiontList()},methods:{handlePageSizeChange:function(t){this.params.page_size=t,this.GET_StorageSolutiontList()},handlePageCurrentChange:function(t){this.params.page_no=t,this.GET_StorageSolutiontList()},handleOpenStorageSolution:function(t,e){var a,n=this;(a=e.bean,Object(o.a)({url:"admin/systems/uploaders/"+a+"/open",method:"put"})).then(function(t){n.$message.success("开启成功！"),n.GET_StorageSolutiontList()})},handleEditStorageSolution:function(t,e){this.storageForm=this.MixinClone(e),this.dialogStorageVisible=!0},submitStorageForm:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return e.$message.error("表单填写有误，请检查！"),!1;var a=e.storageForm.bean;(function(t,e){return Object(o.a)({url:"admin/systems/uploaders/"+t,method:"put",headers:{"Content-Type":"application/json"},data:e})})(a,e.storageForm).then(function(t){e.dialogStorageVisible=!1,e.MixinSetTableData(e.tableData,"bean",a,t),e.$message.success("修改成功！")})})},GET_StorageSolutiontList:function(){var t,e=this;this.loading=!0,(t=this.params,Object(o.a)({url:"admin/systems/uploaders",method:"get",loading:!1,params:t})).then(function(t){e.loading=!1,e.tableData=t}).catch(function(){return e.loading=!1})}}},l=a("XyMi"),i=Object(l.a)(n,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("en-table-layout",{attrs:{toolbar:!1,loading:t.loading,tableData:t.tableData.data}},[a("template",{slot:"table-columns"},[a("el-table-column",{attrs:{prop:"name",label:"储存方案名称"}}),t._v(" "),a("el-table-column",{attrs:{label:"启用状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n          "+t._s(1===e.row.open?"已开启":"已关闭")+"\n          "),0===e.row.open?a("el-button",{attrs:{type:"text"},on:{click:function(a){return t.handleOpenStorageSolution(e.$index,e.row)}}},[t._v("开启")]):t._e()]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return["localPlugin"!==e.row.bean&&t.checkPermission(["storageSolution:edit"])?a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(a){return t.handleEditStorageSolution(e.$index,e.row)}}},[t._v("修改")]):t._e()]}}])})],1),t._v(" "),t.tableData?a("el-pagination",{attrs:{slot:"pagination","current-page":t.tableData.page_no,"page-sizes":[10,20,50,100],"page-size":t.tableData.page_size,layout:"total, sizes, prev, pager, next, jumper",total:t.tableData.data_total},on:{"size-change":t.handlePageSizeChange,"current-change":t.handlePageCurrentChange},slot:"pagination"}):t._e()],2),t._v(" "),a("el-dialog",{attrs:{title:"修改储存方案 - "+t.storageForm.name,visible:t.dialogStorageVisible,width:"35%","modal-append-to-body":!1,"close-on-click-modal":!1,"close-on-press-escape":!1},on:{"update:visible":function(e){t.dialogStorageVisible=e}}},[a("el-form",{ref:"storageForm",attrs:{model:t.storageForm,rules:t.storageRules,"label-width":"140px"}},[t._l(t.storageForm.config_items,function(e,o){return[a("el-form-item",{attrs:{label:e.text}},["radio"===e.type?a("el-radio-group",{model:{value:e.value,callback:function(a){t.$set(e,"value",a)},expression:"config.value"}},[a("el-radio",{attrs:{label:"1"}},[t._v("支持")]),t._v(" "),a("el-radio",{attrs:{label:"0"}},[t._v("不支持")])],1):a("el-input",{attrs:{placeholder:"请输入内容",clearable:""},model:{value:e.value,callback:function(a){t.$set(e,"value",a)},expression:"config.value"}})],1)]})],2),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogStorageVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.submitStorageForm("storageForm")}}},[t._v("确 定")])],1)],1)],1)},[],!1,null,null,null);e.default=i.exports}});