1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
webpackJsonp([12],{"9bBU":function(e,t,a){a("mClu");var n=a("FeBl").Object;e.exports=function(e,t,a){return n.defineProperty(e,t,a)}},C4MV:function(e,t,a){e.exports={default:a("9bBU"),__esModule:!0}},IF04:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("mvHQ"),r=a.n(n),i=a("Xxa5"),o=a.n(i),s=a("exGp"),l=a.n(s),c=a("bOdI"),u=a.n(c),d=a("W+Xz"),p=a("E4LH"),f={name:"softConfig",props:{},data:function(){var e;return e={dirName:"",temp:null,loading:!1,buttonLoading:!1,formLoading:!1,paths:{m:[],mat:[],sky:{},ao:"",a:[]},uploadFileStr:null,uploadDoc:[]},u()(e,"loading",!1),u()(e,"search",""),u()(e,"userStatus",!0),u()(e,"dialogSetVisible",!1),u()(e,"listQuery",{currentPage:1,pageSize:10}),u()(e,"total",0),u()(e,"editUserName",""),u()(e,"tableData",[]),u()(e,"rowData",{}),u()(e,"rules",{pubTitle:[{required:!0,message:"请输入标题",trigger:"blur"}],pubContent:[{required:!1,message:"请输入内容",trigger:"blur"}]}),e},computed:{},created:function(){this.init()},mounted:function(){},methods:{inputChangeFile:function(e){var t={},a=e.target.files;t.name=a[0].name,t.file=a;var n=this.userStatus?"edit":"save",r=new FormData;r.append("file",a[0]),r.append("dirName",this.dirName),r.append("flag",n),this.fileUploads(r,"file")},inputChangeDoc:function(e){var t={},a=e.target.files;if("image/png"==a[0].type||"image/jpeg"==a[0].type||"video/mp4"==a[0].type){t.name=a[0].name,t.file=a;var n=this.userStatus?"edit":"save",r=new FormData;r.append("file",a[0]),r.append("dirName",this.dirName),r.append("flag",n),console.log(r.get("file").size),console.log(r.get("flag")),this.fileUploads(r,"doc")}else this.$message({message:"请上传图片或者视频!",type:"warning"})},init:function(){this.listQuery.currentPage=1,this.getData()},fileUploads:function(e,t){var a=this;return l()(o.a.mark(function n(){var r,i;return o.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a.formLoading=!0,n.prev=1,n.next=4,Object(d.i)(e);case 4:200==(r=n.sent).code&&(a.$message({message:"上传成功!",type:"success"}),"file"==t?(a.rowData.uploadFileStr={},a.rowData.uploadFileStr.fileName=r.data.fileName,a.rowData.uploadFileStr.filePath=r.data.filePath,a.rowData.uploadFileStr.fileFlag="0"):((i={}).fileName=r.data.fileName,i.filePath=r.data.filePath,i.fileFlag="1",a.rowData.uploadDoc.push(i)),a.dirName||a.userStatus||(a.dirName=r.data.dirName)),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(1),console.log(n.t0);case 11:a.formLoading=!1;case 12:case"end":return n.stop()}},n,a,[[1,8]])}))()},getData:function(){var e=this;return l()(o.a.mark(function t(){var a,n;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.search.length||Object(p.c)(e.search)){t.next=5;break}return e.$message({message:"输入不合规!",type:"warning"}),e.tableData=[],e.total=0,t.abrupt("return");case 5:return e.loading=!0,a={currentPage:e.listQuery.currentPage,pageSize:e.listQuery.pageSize,pubTitle:e.search.trim()},t.prev=7,t.next=10,Object(d.k)(a);case 10:200==(n=t.sent).code&&n.data.pubTrendsConfigList&&(e.tableData=n.data.pubTrendsConfigList,e.total=n.data.count),t.next=17;break;case 14:t.prev=14,t.t0=t.catch(7),console.log(t.t0);case 17:e.loading=!1;case 18:case"end":return t.stop()}},t,e,[[7,14]])}))()},handleRemove:function(e,t){console.log(e,t)},handlePreview:function(e){console.log(e)},handleExceed:function(e,t){this.$message.warning("当前限制选择 3 个文件,本次选择了 "+e.length+" 个文件,共选择了 "+(e.length+t.length)+" 个文件")},beforeRemove:function(e,t){return this.$confirm("确定移除 "+e.name+"?")},deleteFile:function(){var e=this;this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.requestDelete("")}).catch(function(){e.$message({type:"info",message:"已取消删除"})})},requestDelete:function(e){var t=this;return l()(o.a.mark(function a(){var n,r;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n=t,t.formLoading=!0,r=void 0,a.prev=3,r=""===e?{filePath:t.rowData.uploadFileStr.path}:{filePath:t.rowData.uploadDoc[e].path},a.next=7,Object(d.g)(r);case 7:200==a.sent.code&&(""===e?n.rowData.uploadFileStr=null:n.rowData.uploadDoc.splice(e,1),n.$message({message:"删除成功!",type:"success"})),a.next=14;break;case 11:a.prev=11,a.t0=a.catch(3),console.log(a.t0);case 14:t.formLoading=!1;case 15:case"end":return a.stop()}},a,t,[[3,11]])}))()},deleteDoc:function(e){var t=this;this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.requestDelete(e)}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},addUser:function(){this.dirName="",this.rowData={pubTitle:"",pubContent:"",uploadDoc:[]},this.dialogSetVisible=!0,this.userStatus=!1},handleDetail:function(e){var t=this;return l()(o.a.mark(function a(){var n,r;return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t.formLoading=!0,t.dirName=e.pubTitle,a.prev=2,a.next=5,Object(d.m)({fkPubTrendsConfig:e.id});case 5:200==(n=a.sent).code&&([],r=[],n.data.length?(n.data=n.data.map(function(e){return delete e.time,e}),r=n.data.filter(function(e){return 1==e.fileFlag})):([],r=[]),t.rowData=e,t.rowData.uploadDoc=r,console.log("this.rowData",t.rowData),t.dialogSetVisible=!0,t.userStatus=!0),a.next=12;break;case 9:a.prev=9,a.t0=a.catch(2),console.log(a.t0);case 12:t.formLoading=!1;case 13:case"end":return a.stop()}},a,t,[[2,9]])}))()},deleteSetting:function(e){var t=this;this.$confirm("确认删除所选的吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(a){t.deleteUserGroup(e)})},confirm:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return console.log("error submit!!"),!1;console.log("rowData",t.rowData);var a=JSON.parse(r()(t.rowData.uploadDoc)),n={pubTrendsConfigFileStr:r()(a),pubTitle:t.rowData.pubTitle.trim(),pubContent:t.rowData.pubContent.trim()};console.log("data",n),t.userStatus?t.editSave(n):t.addSave(n)})},deleteUserGroup:function(e){var t=this;return l()(o.a.mark(function a(){return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t.loading=!0,a.prev=1,a.next=4,Object(d.a)({id:e.id});case 4:200==a.sent.code&&(t.$message({message:"删除成功!",type:"success"}),t.init()),a.next=11;break;case 8:a.prev=8,a.t0=a.catch(1),console.log(a.t0);case 11:t.loading=!1;case 12:case"end":return a.stop()}},a,t,[[1,8]])}))()},addSave:function(e){var t=this;return l()(o.a.mark(function a(){return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e.dirName=t.dirName,t.buttonLoading=!0,a.prev=2,a.next=5,Object(d.j)(e);case 5:200==a.sent.code&&(t.dialogSetVisible=!1,t.$message({message:"新增成功!",type:"success"}),t.init()),a.next=12;break;case 9:a.prev=9,a.t0=a.catch(2),console.log(a.t0);case 12:t.buttonLoading=!1;case 13:case"end":return a.stop()}},a,t,[[2,9]])}))()},editSave:function(e){var t=this;return l()(o.a.mark(function a(){return o.a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return e.id=t.rowData.id,t.buttonLoading=!0,a.prev=2,a.next=5,Object(d.h)(e);case 5:200==a.sent.code&&(t.dialogSetVisible=!1,t.$message({message:"修改成功!",type:"success"}),t.init()),a.next=12;break;case 9:a.prev=9,a.t0=a.catch(2),console.log(a.t0);case 12:t.buttonLoading=!1;case 13:case"end":return a.stop()}},a,t,[[2,9]])}))()},reset:function(){this.search=""},currentChange:function(e){this.listQuery.currentPage=e,this.getData()},handleSizeChange:function(e){this.listQuery.pageSize=e,this.getData()}}},g={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"containerBox faq bgf7f8fb"},[a("div",{staticClass:"tableContainer"},[a("div",{staticClass:"tableSearch"},[a("el-row",[a("el-col",{attrs:{span:6}},[e._v("\n 标题:\n "),a("el-input",{attrs:{placeholder:"请输入内容","suffix-icon":"el-icon-search"},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}})],1),e._v(" "),a("el-col",{staticStyle:{width:"20%"},attrs:{span:5}},[a("el-button",{attrs:{type:"primary"},on:{click:e.init}},[e._v("Search")]),e._v(" "),a("el-button",{on:{click:e.reset}},[e._v("重置")])],1),e._v(" "),a("el-col",{staticStyle:{float:"right"},attrs:{span:5}},[a("el-button",{staticStyle:{float:"right"},attrs:{type:"primary"},on:{click:e.addUser}},[a("i",{staticClass:"el-icon-plus"})])],1)],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{"header-cell-style":{backgroundColor:"#edeff3",color:"#333"},data:e.tableData,border:"",height:"534"}},[a("el-table-column",{attrs:{prop:"pubTitle",label:"发布动态标题",width:"400"}}),e._v(" "),a("el-table-column",{attrs:{prop:"pubContent",label:"发布动态内容"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作",width:"400"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("i",{staticClass:"el-icon-edit",on:{click:function(a){return e.handleDetail(t.row)}}}),e._v(" "),a("i",{staticClass:"el-icon-close",on:{click:function(a){return e.deleteSetting(t.row)}}})]}}])})],1),e._v(" "),a("el-pagination",{staticClass:"mt20",attrs:{background:"",layout:"total,sizes, prev, pager, next",total:e.total,"page-sizes":[10,20,30],"page-size":e.listQuery.pageSize,"current-page":e.listQuery.currentPage},on:{"update:currentPage":function(t){return e.$set(e.listQuery,"currentPage",t)},"update:current-page":function(t){return e.$set(e.listQuery,"currentPage",t)},"current-change":e.currentChange,"size-change":e.handleSizeChange}})],1),e._v(" "),e.dialogSetVisible?a("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.userStatus?"编辑":"新建",visible:e.dialogSetVisible,height:300,"append-to-body":!0,width:"800px"},on:{"update:visible":function(t){e.dialogSetVisible=t}}},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"rowObj",attrs:{rules:e.rules,model:e.rowData,"label-width":"24%"}},[a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"发布动态标题:",prop:"pubTitle"}},[a("el-input",{attrs:{autocomplete:"off",maxlength:"50"},model:{value:e.rowData.pubTitle,callback:function(t){e.$set(e.rowData,"pubTitle",t)},expression:"rowData.pubTitle"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"发布动态内容:",prop:"pubContent"}},[a("el-input",{attrs:{autocomplete:"off",type:"textarea",rows:4,maxlength:"500"},model:{value:e.rowData.pubContent,callback:function(t){e.$set(e.rowData,"pubContent",t)},expression:"rowData.pubContent"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"图片/视频上传:"}},[a("div",{staticClass:"fileBox"},[a("button",{staticClass:"fileButton"},[e._v("选择文件")]),e._v(" "),a("input",{staticClass:"file1",attrs:{type:"file"},on:{change:function(t){return e.inputChangeDoc(t)}}})]),e._v(" "),a("ul",{staticClass:"fileList"},e._l(e.rowData.uploadDoc,function(t,n){return a("li",{key:n},[a("h3",[e._v(e._s(t.fileName))]),e._v(" "),a("h4",{on:{click:function(t){return e.deleteDoc(n)}}},[e._v("x")])])}),0)])],1)],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dialogSetVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.buttonLoading,expression:"buttonLoading"}],attrs:{type:"primary"},on:{click:function(t){return e.confirm("rowObj")}}},[e._v("确 定")])],1)],1):e._e()],1)},staticRenderFns:[]};var m=a("VU/8")(f,g,!1,function(e){a("VXjS")},"data-v-5f587ee6",null);t.default=m.exports},VXjS:function(e,t){},bOdI:function(e,t,a){"use strict";t.__esModule=!0;var n,r=a("C4MV"),i=(n=r)&&n.__esModule?n:{default:n};t.default=function(e,t,a){return t in e?(0,i.default)(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}},mClu:function(e,t,a){var n=a("kM2E");n(n.S+n.F*!a("+E39"),"Object",{defineProperty:a("evD5").f})}}); |