123456 |
- /*!
- * build: Hopaheal
- * copyright: Mead
- * time: 2022-6-7 11:38:49
- */
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-672d027a"],{"00c1":function(e,t,i){"use strict";i("aa3e")},"095d":function(e,t,i){"use strict";i.r(t),i.d(t,"getList",(function(){return r})),i.d(t,"getCategoryList",(function(){return o})),i.d(t,"doAdd",(function(){return s})),i.d(t,"doEdit",(function(){return n}));var a=i("b775");function r(e){return Object(a["default"])({url:"/base/setting-tree",method:"get",params:e})}function o(e){return Object(a["default"])({url:"/base/setting-tree",method:"get",params:e})}function s(e){return Object(a["default"])({url:"/base/setting",method:"post",data:e})}function n(e){return Object(a["default"])({url:"/base/setting/"+e.id,method:"put",data:e})}},"10f8":function(e,t,i){"use strict";i("847c")},"584b":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{"append-to-body":"","before-close":e.handleClose,"close-on-click-modal":!1,title:e.title,visible:e.dialogFormVisible,width:"909px"},on:{"update:visible":function(t){e.dialogFormVisible=t}},scopedSlots:e._u([{key:"footer",fn:function(){return[i("div",{staticStyle:{position:"relative","padding-right":"15px","text-align":"right"}},[e.show?i("div",{staticStyle:{position:"absolute",top:"10px",left:"15px",color:"#999"}},[e._v(" 正在上传中... 当前上传成功数:"+e._s(e.imgSuccessNum)+"张 当前上传失败数:"+e._s(e.imgErrorNum)+"张 ")]):e._e(),i("el-button",{attrs:{type:"primary"},on:{click:e.handleClose}},[e._v("关闭")]),i("el-button",{staticStyle:{"margin-left":"10px"},attrs:{loading:e.loading,size:"small",type:"success"},on:{click:e.submitUpload}},[e._v(" 开始上传 ")])],1)]},proxy:!0}])},[i("div",{staticClass:"upload"},[i("el-alert",{attrs:{closable:!1,title:"支持jpg、jpeg、png格式,单次可最多选择"+e.limit+"张图片,每张不可大于"+e.size+"M,如果大于"+e.size+"M会自动为您过滤",type:"info"}}),i("el-upload",{ref:"upload",staticClass:"upload-content",attrs:{accept:"image/png, image/jpeg",action:e.action,"auto-upload":!1,"close-on-click-modal":!1,data:e.uploadData,"file-list":e.fileList,headers:e.headers,limit:e.limit,"list-type":"picture-card",multiple:!0,name:e.name,"on-change":e.handleChange,"on-error":e.handleError,"on-exceed":e.handleExceed,"on-preview":e.handlePreview,"on-progress":e.handleProgress,"on-remove":e.handleRemove,"on-success":e.handleSuccess},scopedSlots:e._u([{key:"trigger",fn:function(){return[i("i",{staticClass:"el-icon-plus"})]},proxy:!0}])},[i("el-dialog",{attrs:{"append-to-body":"",title:"查看大图",visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("div",[i("el-image",{attrs:{src:e.dialogImageUrl}})],1)])],1)],1)])},r=[],o=i("5530"),s=(i("a9e3"),i("4de4"),i("d3b7"),i("99af"),i("b0c0"),i("2ef0")),n=i.n(s),l=i("2f62"),c=i("f121"),u={name:"VabUpload",props:{name:{type:String,default:"file",required:!0},limit:{type:Number,default:50,required:!0},size:{type:Number,default:1,required:!0}},data:function(){return{show:!1,loading:!1,dialogVisible:!1,dialogImageUrl:"",action:c["baseURL"]+"/base/common/upload",uploadData:{file_type:"img",type:"article"},headers:{},fileList:[],picture:"picture",imgNum:0,imgSuccessNum:0,imgErrorNum:0,typeList:null,title:"上传",dialogFormVisible:!1,data:{}}},computed:Object(o["a"])(Object(o["a"])({},Object(l["c"])({token:"user/token"})),{},{percentage:function(){return 0===this.allImgNum?0:100*n.a.round(this.imgNum/this.allImgNum,2)}}),created:function(){this.headers["Authorization"]="Bearer ".concat(this.token)},methods:{submitUpload:function(){this.$refs.upload.submit()},handleProgress:function(){this.loading=!0,this.show=!0},handleChange:function(e,t){e.size>1048576*this.size?(t.filter((function(t){return t!==e})),this.fileList=t):this.allImgNum=t.length},handleSuccess:function(e,t,i){var a=this;this.imgNum=this.imgNum+1,this.imgSuccessNum=this.imgSuccessNum+1,i.length===this.imgNum&&setTimeout((function(){a.$baseMessage("上传完成! 共上传".concat(i.length,"张图片"),"success",!1,"vab-hey-message-success"),a.handleClose()}),1e3),console.log(e.data.url,"response"),this.$emit("img",e.data.url),setTimeout((function(){a.loading=!1,a.show=!1}),1e3)},handleError:function(e,t){var i=this;this.imgNum=this.imgNum+1,this.imgErrorNum=this.imgErrorNum+1,this.$baseMessage("文件[".concat(t.raw.name,"]上传失败,文件大小为").concat(n.a.round(t.raw.size/1024,0),"KB"),"error",!1,"vab-hey-message-error"),setTimeout((function(){i.loading=!1,i.show=!1}),1e3)},handleRemove:function(){this.imgNum=this.imgNum-1,this.allNum=this.allNum-1},handlePreview:function(e){this.dialogImageUrl=e.url,this.dialogVisible=!0},handleExceed:function(e){this.$baseMessage("当前限制选择 ".concat(this.limit," 个文件,本次选择了\n ").concat(e.length,"\n 个文件"),"error",!1,"vab-hey-message-error")},handleShow:function(e){this.title="上传",this.data=e,this.dialogFormVisible=!0},handleClose:function(){this.fileList=[],this.picture="picture",this.allImgNum=0,this.imgNum=0,this.imgSuccessNum=0,this.imgErrorNum=0,this.headers["Authorization"]="Bearer ".concat(this.token),this.dialogFormVisible=!1}}},d=u,m=(i("6534"),i("2877")),f=Object(m["a"])(d,a,r,!1,null,"8c81bda4",null);t["default"]=f.exports},"617b":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"40%"},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close},scopedSlots:e._u([{key:"footer",fn:function(){return[i("el-button",{on:{click:e.close}},[e._v("取 消")]),"编辑"==e.title?i("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v(" 确 定 ")]):e._e(),"添加"==e.title?i("el-button",{attrs:{type:"primary"},on:{click:e.add}},[e._v(" 添 加 ")]):e._e(),i("vab-upload",{ref:"vabUpload",attrs:{limit:50,name:"file",size:2},on:{img:e.img}})]},proxy:!0}])},[i("el-form",{ref:"form",attrs:{"label-width":"100px",model:e.form,rules:e.rules}},[i("el-form-item",{attrs:{label:"父级",prop:"parent_name"}},[i("el-select",{ref:"selectblur",staticStyle:{width:"100%"},attrs:{placeholder:"请选择上级"},on:{change:function(t){return e.$forceUpdate()}},model:{value:e.form.parent_name,callback:function(t){e.$set(e.form,"parent_name",t)},expression:"form.parent_name"}},[i("el-option",{staticStyle:{height:"auto",padding:"0"},attrs:{label:e.form.parent_name,value:e.form.parent_id}},[i("el-tree",{ref:"tree",attrs:{data:e.treeData,"default-expand-all":"",props:e.defaultProps},on:{"node-click":e.handleNodeClick}})],1)],1)],1),i("el-form-item",{attrs:{label:"标题:",prop:"name"}},[i("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),i("el-form-item",{attrs:{label:"key:",prop:"key"}},[i("el-input",{model:{value:e.form.key,callback:function(t){e.$set(e.form,"key",t)},expression:"form.key"}})],1),i("el-form-item",{attrs:{label:"类型:",prop:"type"}},[i("el-select",{staticStyle:{width:"100%"},attrs:{"default-first-option":"",placeholder:"请选择点击类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.type_list,(function(e){return i("el-option",{key:e.type,attrs:{label:e.name,value:e.type}})})),1)],1),i("div",{staticClass:"star"},[i("span",{staticClass:"xing"},[e._v("*")]),2==e.form.type?i("el-form-item",{attrs:{label:"配置内容:",prop:"value"}},[i("tiny-mce",{attrs:{content:e.form.value,"tiny-height":300},on:{childByValue:e.getTnyMac}})],1):e._e(),0==e.form.type?i("el-form-item",{attrs:{label:"配置内容:",prop:"value"}},[i("el-input",{model:{value:e.form.value,callback:function(t){e.$set(e.form,"value",t)},expression:"form.value"}})],1):e._e(),1==e.form.type?i("el-form-item",{attrs:{label:"配置内容:",prop:"value"}},[i("el-upload",{staticClass:"upload-demo",attrs:{action:e.action,data:e.uploadData,"file-list":e.fileList,limit:e.limit,"list-type":"picture",multiple:"","on-error":e.uploadErr,"on-success":e.uploadSuccess}},[i("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.clearFile}},[e._v(" "+e._s("添加"==e.title?"上传照片":"重新上传")+" ")]),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 只能上传jpg/png文件,且不超过500kb ")])],1)],1):e._e()],1),"编辑"==e.title&&e.imageUrl&&1==e.form.type?i("el-form-item",{attrs:{label:"",prop:"cover"}},[i("div",{staticClass:"ref-image"},[i("img",{attrs:{src:e.imageUrl}})])]):e._e(),i("el-form-item",{attrs:{label:"排序:",prop:"sort"}},[i("el-input",{attrs:{type:"number"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),i("el-form-item",{attrs:{label:"状态:",prop:"status"}},[i("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[i("el-radio",{attrs:{label:1}},[e._v("正常")]),i("el-radio",{attrs:{label:0}},[e._v("禁用")])],1)],1)],1)],1)},r=[],o=i("1da1"),s=(i("96cf"),i("b0c0"),i("99af"),i("095d")),n=i("f121"),l=i("584b"),c={name:"MenuManagementEdit",components:{VabUpload:l["default"]},data:function(){var e=this;return{form:{status:1,sort:0,type:2},type_list:[{type:0,name:"字符串"},{type:1,name:"图片"},{type:2,name:"文本"}],treeData:[],defaultProps:{children:"children",label:function(e){return e.name},leaf:!0},action:"",uploadShow:!0,uploadData:{file_type:"img",type:"cms_setting"},fileList:[],limit:1,imageUrl:"",rules:{name:[{required:!0,trigger:"blur",message:"请填写标题"}],key:[{required:!0,trigger:"blur",message:"请填写key"}],type:[{required:!0,trigger:"blur",message:"请选择类型"}],sort:[{required:!0,trigger:"blur",message:"请填写排序"}],status:[{required:!0,trigger:"change",message:"请选择状态"}]},title:"",dialogFormVisible:!1,options:{theme:"snow",bounds:document.body,debug:"warn",modules:{toolbar:{container:[["bold","italic","underline","strike"],[{header:[1,2,3,4,5,6,!1]}],[{size:["small",!1,"large","huge"]}],[{color:[]},{background:[]}],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{align:[]}],[{direction:"rtl"}],[{font:[]}],["clean"],["link","image"]],handlers:{image:function(){e.$refs["vabUpload"].handleShow()}}}},placeholder:"内容...",readOnly:!1}}},created:function(){this.action=n["baseURL"]+"/common/upload",this.fileList=[]},methods:{getTnyMac:function(e){this.form.value=e},showEdit:function(e){this.fetchData(),e?(this.title="编辑",this.form=Object.assign({},e),console.log(this.form,"cms/setting/delete"),1==this.form.type&&(this.imageUrl=this.form.body.url)):this.title="添加",this.dialogFormVisible=!0},uploadSuccess:function(e){console.log(e,"图片上传成功"),this.form.value=e.data.id,this.$refs.form.validateField("cover")},uploadErr:function(){this.$message.error("上传失败,请重新上传")},clearFile:function(){console.log("上传之前"),this.imageUrl=""},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},save:function(){var e=this;console.log(this.form.value,"value"),this.form.value?this.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(i){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!i){t.next=8;break}return t.next=3,Object(s["doEdit"])(e.form);case 3:a=t.sent,r=a.message,e.$baseMessage(r,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.close();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):this.$message.error("请填写配置内容")},fetchData:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var i,a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.treeData=[],i=[{id:0,name:"顶级部门"}],t.next=4,Object(s["getList"])();case 4:a=t.sent,r=a.data,console.log(r,"编辑hhhhhhhh"),e.treeData=i.concat(r),console.log(i,"arr"),console.log(e.treeData,"this.treeData");case 10:case"end":return t.stop()}}),t)})))()},handleNodeClick:function(e){console.log(e,"99999"),this.$refs.selectblur.blur(),this.form.parent_name=e.name,this.form.parent_id=e.id,this.$forceUpdate(),console.log(this.form,"form")},add:function(){var e=this;this.form.value?this.$refs["form"].validate(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(i){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!i){t.next=8;break}return t.next=3,Object(s["doAdd"])(e.form);case 3:a=t.sent,r=a.message,e.$baseMessage(r,"success",!1,"vab-hey-message-success"),e.$emit("fetch-data"),e.close();case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()):this.$message.error("请填写配置内容")},img:function(e){var t=this.$refs.myQuillEditor.Quill,i=t.selection.savedRange.index;t.insertEmbed(i,"image",e),t.setSelection(i+1)}}},u=c,d=(i("00c1"),i("2877")),m=Object(d["a"])(u,a,r,!1,null,"31577038",null);t["default"]=m.exports},6534:function(e,t,i){"use strict";i("de4f")},"79fa":function(e,t,i){"use strict";function a(e){return this.$te("vabI18n.".concat(e))?this.$t("vabI18n.".concat(e)):e}i.r(t),i.d(t,"translateTitle",(function(){return a}))},"847c":function(e,t,i){},aa3e:function(e,t,i){},d761:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"department-management-container"},[a("vab-query-form",[a("vab-query-form-left-panel",{attrs:{span:12}},[a("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 添加 ")])],1),a("vab-query-form-right-panel",{attrs:{span:12}},[a("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",[a("el-input",{attrs:{clearable:"",placeholder:"请输入名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData.apply(null,arguments)}},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name","string"===typeof t?t.trim():t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.list,"default-expand-all":"","row-key":"id","tree-props":{children:"children"}},on:{"selection-change":e.setSelectRows},scopedSlots:e._u([{key:"empty",fn:function(){return[a("el-image",{staticClass:"vab-data-empty",attrs:{src:i("f1f0")}})]},proxy:!0}])},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection"}}),a("el-table-column",{attrs:{label:"参数名","min-width":"120",prop:"name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"key","min-width":"120",prop:"key","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"状态","min-width":"80",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[1==i.status?a("el-tag",[e._v("正常")]):e._e(),0==i.status?a("el-tag",{attrs:{type:"danger"}},[e._v("禁用")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",label:"排序","min-width":"120",prop:"sort","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("div",{staticClass:"edit"},[e.editForm.id==i.id&&1==e.editStatus?a("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.cancelSort(i)}}}):e._e(),e.editForm.id!==i.id||0==e.editStatus?a("span",{staticClass:"sort-num"},[e._v(" "+e._s(i.sort)+" ")]):e._e(),e.editForm.id==i.id&&1==e.editStatus?a("el-input",{ref:"getFocus",staticClass:"input-sort",on:{input:e.inputSort},model:{value:i.sort,callback:function(t){e.$set(i,"sort",t)},expression:"row.sort"}}):e._e(),e.editForm.id!==i.id||0==e.editStatus?a("i",{staticClass:"el-icon-edit",on:{click:function(t){return e.changeSort(i)}}}):e._e(),e.editForm.id==i.id&&1==e.editStatus?a("i",{staticClass:"el-icon-circle-check",on:{click:function(t){return t.stopPropagation(),e.sureChange.apply(null,arguments)}}}):e._e()],1)]}}])}),a("el-table-column",{attrs:{align:"center",label:"创建时间","min-width":"120",prop:"created_at","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"操作",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleEdit(i)}}},[e._v("编辑")])]}}])})],1),a("edit",{ref:"edit",on:{"fetch-data":e.getList}})],1)},r=[],o=i("1da1"),s=(i("4e82"),i("96cf"),i("095d")),n=i("617b"),l=i("79fa"),c={name:"ConfigureManage",components:{Edit:n["default"]},data:function(){return{list:[],listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",total:0,selectRows:"",queryForm:{name:"",page:1,per_page:15},editForm:{},oldSort:0,editStatus:0,flag:!1}},created:function(){this.getList()},methods:{translateTitle:l["translateTitle"],queryData:function(){this.queryForm.page=1,this.getList()},getList:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var i,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(s["getCategoryList"])(e.queryForm);case 3:i=t.sent,a=i.data,console.log(a,"部门列表"),e.list=a,e.listLoading=!1;case 8:case"end":return t.stop()}}),t)})))()},changeSort:function(e){var t=this;return Object(o["a"])(regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:t.editStatus=1,t.editForm=e,t.oldSort=e.sort,t.$nextTick((function(){t.$refs["getFocus"].focus()}));case 4:case"end":return i.stop()}}),i)})))()},cancelSort:function(e){e.sort=this.oldSort,this.editStatus=0},inputSort:function(e){console.log(e,"000000000"),this.editForm.sort=e},sureChange:function(){var e=this;return Object(o["a"])(regeneratorRuntime.mark((function t(){var i,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(console.log("触发change事件"),e.editStatus=0,e.oldSort===e.editForm.sort){t.next=12;break}return t.next=5,Object(s["doEdit"])(e.editForm);case 5:i=t.sent,a=i.message,console.log(a,"message"),e.$baseMessage(a,"success",!1,"vab-hey-message-success"),e.getList(),t.next=13;break;case 12:return t.abrupt("return");case 13:case"end":return t.stop()}}),t)})))()},setSelectRows:function(e){this.selectRows=e},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},handleDelete:function(e){console.log(e)}}},u=c,d=(i("10f8"),i("2877")),m=Object(d["a"])(u,a,r,!1,null,"0e952c27",null);t["default"]=m.exports},de4f:function(e,t,i){},f1f0:function(e,t,i){e.exports=i.p+"static/img/data_empty.475a2a1e.png"}}]);
|