chunk-cd006518.9209b760.js 13 KB

123456
  1. /*!
  2. * build: Hopaheal
  3. * copyright: Mead
  4. * time: 2022-6-7 11:38:49
  5. */
  6. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-cd006518"],{"41b4":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"form"},[r("el-page-header",{attrs:{content:e.title},on:{back:e.goBack}}),r("el-form",{ref:"form",staticClass:"form_form",staticStyle:{position:"relative",width:"60%"},attrs:{"label-width":"150px",model:e.form,rules:e.rules}},[r("el-form-item",{attrs:{label:"公告类型",prop:"category_name"}},[r("el-select",{ref:"selectblur",staticStyle:{width:"100%"},attrs:{disabled:e.flgCate,placeholder:"公告类型"},model:{value:e.form.category_name,callback:function(t){e.$set(e.form,"category_name",t)},expression:"form.category_name"}},[r("el-option",{staticStyle:{height:"auto",padding:"0"},attrs:{label:e.form.category_name,value:e.form.category_name}},[r("el-tree",{ref:"tree",attrs:{data:e.treeData,"default-expand-all":"",props:e.defaultProps},on:{"node-click":e.handleNodeClick}})],1)],1)],1),r("el-form-item",{attrs:{label:"公告名称",prop:"title"}},[r("el-input",{attrs:{placeholder:"公告名称"},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),r("el-form-item",{attrs:{label:"公告标签",prop:"tags"}},[r("el-select",{staticStyle:{width:"100%"},attrs:{"allow-create":"","default-first-option":"",filterable:"",multiple:"",placeholder:"请选择公告标签"},on:{change:e.detelerule},model:{value:e.form.tags,callback:function(t){e.$set(e.form,"tags",t)},expression:"form.tags"}},e._l(e.form.tags,(function(e){return r("el-option",{key:e,attrs:{label:e,value:e}})})),1)],1),r("el-form-item",{attrs:{label:"公告缩略图",prop:"cover"}},[r("el-upload",{staticClass:"upload-demo",attrs:{action:e.action,data:e.uploadData,"file-list":e.fileList,limit:e.limit,"list-type":"picture",multiple:"","on-remove":e.imgRemove,"on-success":e.uploadSuccess}},[r("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.clearFile}},[e._v(" "+e._s("添加"==e.title?"上传照片":"重新上传")+" ")]),r("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 只能上传jpg/png文件,且不超过500kb ")])],1)],1),"编辑"==e.title&&e.imageUrl?r("el-form-item",{attrs:{label:"",prop:"thumb"}},[r("div",{staticClass:"ref-image"},[r("img",{attrs:{src:e.imageUrl}})])]):e._e(),r("el-form-item",{attrs:{label:"公告简述",prop:"short_description"}},[r("el-input",{attrs:{autosize:"",placeholder:"请输入公告简述",type:"textarea"},model:{value:e.form.short_description,callback:function(t){e.$set(e.form,"short_description",t)},expression:"form.short_description"}})],1),r("el-form-item",{staticClass:"vab-quill-content",attrs:{label:"公告内容",required:""}},[r("tiny-mce",{attrs:{content:e.form.body,"tiny-height":300},on:{childByValue:e.getTnyMac}})],1),e.num_flag?r("el-form-item",{attrs:{label:"最大报名人数",prop:"max_sign_up_count"}},[r("el-input",{attrs:{placeholder:"最大报名人数",type:"number"},model:{value:e.form.max_sign_up_count,callback:function(t){e.$set(e.form,"max_sign_up_count",t)},expression:"form.max_sign_up_count"}})],1):e._e(),e._l(e.extra,(function(t,a){return r("el-form-item",{key:a,attrs:{label:t.name,required:1==t.is_must}},["字符串"==t.type?r("el-input",{attrs:{placeholder:t.name},model:{value:e.form.data[t.word],callback:function(r){e.$set(e.form.data,t.word,r)},expression:"form.data[item.word]"}}):e._e(),"数值"==t.type?r("el-input",{attrs:{placeholder:t.name,type:"number"},model:{value:e.form.data[t.word],callback:function(r){e.$set(e.form.data,t.word,r)},expression:"form.data[item.word]"}}):e._e(),"时间"==t.type?r("el-date-picker",{staticStyle:{width:"100%"},attrs:{format:"yyyy-MM-dd HH:mm",placeholder:t.name,type:"datetime","value-format":"yyyy-MM-dd HH:mm"},model:{value:e.form.data[t.word],callback:function(r){e.$set(e.form.data,t.word,r)},expression:"form.data[item.word]"}}):e._e()],1)})),r("el-form-item",{attrs:{label:"发布时间",prop:"published_at"}},[r("el-date-picker",{staticStyle:{width:"100%"},attrs:{format:"yyyy-MM-dd HH:mm",placeholder:"选择日期时间",type:"datetime","value-format":"yyyy-MM-dd HH:mm"},model:{value:e.form.published_at,callback:function(t){e.$set(e.form,"published_at",t)},expression:"form.published_at"}})],1),r("el-form-item",{attrs:{label:"公告排序",prop:"sort"}},[r("el-input",{attrs:{type:"number"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),r("el-form-item",{attrs:{label:"公告状态",prop:"status"}},[r("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},[r("el-radio",{attrs:{label:1}},[e._v("正常")]),r("el-radio",{attrs:{label:0}},[e._v("禁用")])],1)],1),r("div",{staticClass:"footer"},[r("el-button",{on:{click:e.close}},[e._v("取消")]),void 0!=e.form.id?r("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v(" "+e._s(2==e.role_id?"提交审核":"保存")+" ")]):r("el-button",{attrs:{type:"primary"},on:{click:e.add}},[e._v(" "+e._s(2==e.role_id?"提交审核":"添加")+" ")])],1)],2)],1)},o=[],i=r("1da1"),n=r("5530"),s=(r("96cf"),r("d3b7"),r("159b"),r("b0c0"),r("2f62")),l=r("9f2e"),c=r("ab6c"),u=r("8a70"),m=r("f121"),d={name:"NoticeAdd",data:function(){return{imageUrl:"",treeData:[],defaultProps:{children:"children",label:"name",leaf:!0},form:{is_message:1,status:1,body:"",sort:0,data:{}},action:"",uploadShow:!0,uploadData:{file_type:"img",type:"article"},fileList:[],limit:1,rules:{max_sign_up_count:[{required:!0,trigger:"blur",message:"请输入最大报名人数"}],category_name:[{required:!0,trigger:"blur",message:"请选择公告类型"}],title:[{required:!0,trigger:"blur",message:"请输入公告名称"}],tags:[{required:!0,trigger:"blur",message:"请输入公告标签"}],body:[{required:!0,trigger:"blur",message:"请输入公告内容"}],is_message:[{required:!0,trigger:"change",message:"请选择是否通知"}],sort:[{required:!0,trigger:"blur",message:"请输入公告排序"}]},title:"",dialogFormVisible:!1,num_flag:!1,type:"",extra:[],flgCate:!1}},computed:Object(n["a"])({},Object(s["c"])({role_id:"user/role_id"})),created:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getTree();case 2:r=e.$route,console.log(e.$route.query,"this.form"),void 0!=r.query.row?e.$nextTick((function(){e.form=r.query.row,e.title="编辑",e.flgCate=!0,e.form.type&&(2==e.form.type?e.num_flag=!0:e.num_flag=!1),console.log(e.form,"dangqianhang"),console.log(e.treeData,"..............."),e.treeData.forEach((function(t){t.id==e.form.category_id&&(e.extra=t.data),console.log(e.extra,"编辑extra")})),e.form.cover_resource&&(e.imageUrl=e.form.cover_resource.url,console.log(e.imageUrl,"========================")),e.rules={max_sign_up_count:[{required:!0,trigger:"blur",message:"请输入最大报名人数"}],category_name:[{required:!0,trigger:"blur",message:"请选择公告类型"}],title:[{required:!0,trigger:"blur",message:"请输入公告名称"}],tags:[{required:!0,trigger:"blur",message:"请输入公告标签"}],body:[{required:!0,trigger:"blur",message:"请输入公告内容"}],is_message:[{required:!0,trigger:"change",message:"请选择是否通知"}],sort:[{required:!0,trigger:"blur",message:"请输入公告排序"}],published_at:[{required:!0,trigger:"blur",message:"请选择发布时间"}]},console.log(e.form,"this.form1")})):e.title="添加",e.action=m["baseURL"]+"/base/common/upload",e.fileList=[];case 7:case"end":return t.stop()}}),t)})))()},methods:Object(n["a"])(Object(n["a"])({getTnyMac:function(e){this.form.body=e}},Object(s["b"])({delVisitedRoute:"tabs/delVisitedRoute"})),{},{goBack:function(){this.delVisitedRoute(Object(l["handleActivePath"])(this.$route,!0)),this.$router.push({path:"/notice/notice"})},uploadSuccess:function(e){console.log(e,"图片上传成功"),this.form.cover=e.data.id},imgRemove:function(){this.form.cover="",console.log("尴尬")},clearFile:function(){console.log("上传之前"),this.imageUrl=""},handleNodeClick:function(e){console.log(e,"node"),2==e.type?this.num_flag=!0:this.num_flag=!1,e.data&&(this.extra=e.data),this.type=e.type,this.$refs.selectblur.blur(),this.form.category_name=e.name,this.form.category_id=e.id,this.$refs.form.clearValidate("category_name"),this.$forceUpdate()},detelerule:function(){this.$refs.form.clearValidate("tags")},detelebody:function(e){console.log("1eeeeeeeeeeeee"),console.log(e,"eeeeeeeeeeeee"),this.$refs.form.clearValidate("body")},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.goBack(),this.fileList=[]},add:function(){var e,t=this;if(this.form.body){if(console.log(this.extra,"this.extrahahahahhahahahahahah"),this.extra)try{this.extra.forEach((function(r){var a=r.word;if(!(1!=r.is_must||t.form.data[a]&&""!=t.form.data[a]))throw e=!1,t.$message({message:"请输入"+r.name,type:"warning"});e=!0}))}catch(r){console.log(r,"3333333")}else e=!0;console.log(e,"2222"),this.form.type=this.type,console.log("111"),this.$refs["form"].validate(function(){var r=Object(i["a"])(regeneratorRuntime.mark((function r(a){var o,i;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(t.form.category_name&&t.$refs.form.clearValidate("category_name"),!a||!e){r.next=9;break}return r.next=4,Object(u["doAdd"])(t.form);case 4:o=r.sent,i=o.message,t.$baseMessage(i,"success",!1,"vab-hey-message-success"),t.close(),t.fileList=[];case 9:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}else this.$message({message:"请输入公告内容",type:"warning"})},save:function(){var e,t=this;console.log("a"),this.form.body?(console.log("b"),this.extra.forEach((function(r){console.log("b",e);var a=r.word;1!=r.is_must||t.form.data[a]&&""!=t.form.data[a]?e=!0:(t.$message({message:"请输入"+r.name,type:"warning"}),e=!1)})),console.log("c",e),e&&(console.log("e"),this.$refs["form"].validate(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(r){var a,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!r){e.next=8;break}return e.next=3,Object(u["doEdit"])(t.form);case 3:a=e.sent,o=a.message,t.$baseMessage(o,"success",!1,"vab-hey-message-success"),t.close(),t.fileList=[];case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),console.log("d")):this.$message({message:"请输入公告内容",type:"warning"})},getTree:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(c["getList"])({type:1});case 3:r=t.sent,a=r.data,e.treeData=a,console.log(e.treeData,"左侧的tree数据信息"),e.listLoading=!1;case 8:case"end":return t.stop()}}),t)})))()}})},f=d,g=(r("e7cf"),r("2877")),p=Object(g["a"])(f,a,o,!1,null,"5ad839d3",null);t["default"]=p.exports},"8a70":function(e,t,r){"use strict";r.r(t),r.d(t,"getLists",(function(){return o})),r.d(t,"getNotice",(function(){return i})),r.d(t,"doAdd",(function(){return n})),r.d(t,"doEdit",(function(){return s})),r.d(t,"getDetail",(function(){return l})),r.d(t,"doDelete",(function(){return c})),r.d(t,"doDeletes",(function(){return u})),r.d(t,"getRead",(function(){return m})),r.d(t,"getMessage",(function(){return d})),r.d(t,"clearRead",(function(){return f})),r.d(t,"checktOrder",(function(){return g}));var a=r("b775");function o(e){return Object(a["default"])({url:"/inform/information",method:"get",params:e})}function i(e){return Object(a["default"])({url:"/inform/information-user-messages",method:"get",params:e})}function n(e){return Object(a["default"])({url:"/inform/information",method:"post",data:e})}function s(e){return Object(a["default"])({url:"/inform/information/"+e.id,method:"put",data:e})}function l(e){return Object(a["default"])({url:"/inform/information/"+e,method:"get"})}function c(e){return Object(a["default"])({url:"/inform/information/"+e.ids,method:"delete"})}function u(e){return Object(a["default"])({url:"/inform/information/delete",method:"post",data:e})}function m(e){return Object(a["default"])({url:"/inform/information-user-messages",method:"get",params:e})}function d(e){return Object(a["default"])({url:"/inform/information-read-messages",method:"post",data:e})}function f(e){return Object(a["default"])({url:"/inform/information-read-messages",method:"post",data:e})}function g(e){return Object(a["default"])({url:"/inform/information-check",method:"post",data:e})}},"9ca2":function(e,t,r){},ab6c:function(e,t,r){"use strict";r.r(t),r.d(t,"getTree",(function(){return o})),r.d(t,"getList",(function(){return i})),r.d(t,"doAdd",(function(){return n})),r.d(t,"doEdit",(function(){return s})),r.d(t,"doDelete",(function(){return l})),r.d(t,"getNoList",(function(){return c}));var a=r("b775");function o(e){return Object(a["default"])({url:"/inform/category-user-tree",method:"get",params:e})}function i(e){return Object(a["default"])({url:"/inform/category-user-tree",method:"get",params:e})}function n(e){return Object(a["default"])({url:"/inform/category",method:"post",data:e})}function s(e){return Object(a["default"])({url:"/inform/category/"+e.id,method:"put",data:e})}function l(e){return Object(a["default"])({url:"/inform/category/"+e.ids,method:"delete"})}function c(e){return Object(a["default"])({url:"/base/role-lists",method:"get",params:e})}},e7cf:function(e,t,r){"use strict";r("9ca2")}}]);