You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
36 KiB
1 lines
36 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7f4f4bba","chunk-2cb825d6"],{"07ac":function(t,e,a){var o=a("23e7"),i=a("6f53").values;o({target:"Object",stat:!0},{values:function(t){return i(t)}})},"26d2":function(t,e,a){"use strict";a("83b2")},5914:function(t,e,a){"use strict";a("a0b0")},"6f53":function(t,e,a){var o=a("83ab"),i=a("df75"),r=a("fc6a"),n=a("d1e7").f,s=function(t){return function(e){var a,s=r(e),l=i(s),c=l.length,u=0,d=[];while(c>u)a=l[u++],o&&!n.call(s,a)||d.push(t?[a,s[a]]:s[a]);return d}};t.exports={entries:s(!0),values:s(!1)}},"816b":function(t,e,a){"use strict";var o=a("365c");function i(t){var e="/module/index";return o["a"].get(e,t)}function r(t){var e="/module/save";return o["a"].post(e,t)}function n(t){var e="/module/update";return o["a"].post(e,t)}function s(t){var e="/module/delete";return o["a"].post(e,t)}function l(t){var e="/module/read";return o["a"].get(e,t)}function c(t){var e="/category/getModuleCate";return o["a"].get(e,t)}function u(t){var e="/moduleField/index";return o["a"].get(e,t)}function d(t){var e="/moduleField/save";return o["a"].post(e,t)}function m(t){var e="/moduleField/update";return o["a"].post(e,t)}function p(t){var e="/moduleField/delete";return o["a"].post(e,t)}function f(t){var e="/moduleField/read";return o["a"].get(e,t)}function h(t){var e="/module/all";return o["a"].get(e,t)}function b(t){var e="/module/field";return o["a"].get(e,t)}e["a"]={moduleList:i,moduleSave:r,moduleUpdate:n,moduleDelete:s,moduleInfo:l,fieldList:u,fieldSave:d,fieldUpdate:m,fieldDelete:p,fieldInfo:f,getModuleCate:c,moduleTable:h,moduleField:b}},"83b2":function(t,e,a){},a0b0:function(t,e,a){},ac57:function(t,e,a){"use strict";a("df21")},c6c2:function(t,e,a){var o={"./add.vue":["ca30"],"./components/approvalReject.vue":["cfaaa","chunk-77236ac8"],"./components/form.vue":["e2be"],"./components/updateForms.vue":["9531","chunk-07aeb0a0"],"./components/uploadFiles.vue":["0b9b","chunk-17d4821d"],"./content.vue":["99f5","chunk-75e6bd0a"],"./info.vue":["8e92","chunk-13bafb7b"],"./update.vue":["f874","chunk-b93609de"]};function i(t){if(!a.o(o,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=o[t],i=e[0];return Promise.all(e.slice(1).map(a.e)).then((function(){return a(i)}))}i.keys=function(){return Object.keys(o)},i.id="c6c2",t.exports=i},c98a:function(t,e,a){},ca30:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"main-box",attrs:{id:"addContent"}},[a("BaseTitle",{attrs:{title:t.$t("栏目内容管理")},scopedSlots:t._u([{key:"right",fn:function(){return[a("BackBtn",{attrs:{"back-funtion":t.prev}})]},proxy:!0}])}),a("el-form",{ref:"form",staticClass:"flexForm",attrs:{model:t.addForm,rules:t.rules,"label-position":"top"}},[a("div",{staticClass:"left"},[a("el-form",{ref:"searchForm",staticClass:"filter-form",attrs:{model:t.searchForm,rules:t.searchRules,"label-width":"top"}},[a("el-form-item",{attrs:{label:t.$t("站点"),prop:"site_id"}},[a("el-select",{attrs:{multiple:""},on:{change:t.webChange},model:{value:t.searchForm.site_id,callback:function(e){t.$set(t.searchForm,"site_id",e)},expression:"searchForm.site_id"}},t._l(t.webList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.domain,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:t.$t("主栏目"),prop:"category_id"}},[a("el-select",{attrs:{filterable:""},on:{change:t.handleChangeColumn},model:{value:t.searchForm.category_id,callback:function(e){t.$set(t.searchForm,"category_id",e)},expression:"searchForm.category_id"}},t._l(t.columnList,(function(e){return a("el-option-group",{key:e.id,attrs:{label:e.title}},t._l(e.category,(function(t){return a("el-option",{key:t.id,attrs:{label:0!=t.parent_id?""+t.title:t.title,value:t.id,disabled:t.disabled}})})),1)})),1)],1),a("el-form-item",{attrs:{label:t.$t("副栏目")}},[a("el-select",{attrs:{filterable:"",multiple:""},model:{value:t.searchForm.subColumnId,callback:function(e){t.$set(t.searchForm,"subColumnId",e)},expression:"searchForm.subColumnId"}},t._l(t.subColumnList,(function(e){return a("el-option-group",{key:e.id,attrs:{label:e.title}},t._l(e.category,(function(t){return a("el-option",{key:t.id,attrs:{label:t.title,value:t.id,disabled:t.disabled}})})),1)})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-upload2"},on:{click:t.batchUpload}},[t._v(" "+t._s(t.$t("批量上传"))+" ")])],1)],1),a("SubTitle",{attrs:{title:t.$t("基本信息")}}),a("el-form-item",{attrs:{prop:"sub_content.title",label:t.$t("标题")+":"}},[a("el-input",{attrs:{placeholder:t.$t("请输入标题")},model:{value:t.addForm.sub_content.title,callback:function(e){t.$set(t.addForm.sub_content,"title",e)},expression:"addForm.sub_content.title"}})],1),a("el-form-item",{attrs:{prop:"sub_content.sub_title",label:t.$t("副标题")+":"}},[a("el-input",{attrs:{placeholder:t.$t("请输入副标题")},model:{value:t.addForm.sub_content.sub_title,callback:function(e){t.$set(t.addForm.sub_content,"sub_title",e)},expression:"addForm.sub_content.sub_title"}})],1),a("el-form-item",{attrs:{prop:"sub_content.description",label:t.$t("简介")+":"}},[a("el-input",{attrs:{placeholder:t.$t("请输入简介"),type:"textarea",autosize:{minRows:4}},model:{value:t.addForm.sub_content.description,callback:function(e){t.$set(t.addForm.sub_content,"description",e)},expression:"addForm.sub_content.description"}})],1),a("el-form-item",{attrs:{label:t.$t("内容")+":"}},[a("div",[a("MyTinymce",{ref:"myTinymce",attrs:{"tinymce-html":t.content},on:{changeDescription:t.changeDescription}})],1)]),a("el-form-item",{attrs:{label:t.$t("标签")+":"}},[a("el-input",{attrs:{placeholder:t.$t("标签之间用逗号隔开")},model:{value:t.addForm.sub_content.tag,callback:function(e){t.$set(t.addForm.sub_content,"tag",e)},expression:"addForm.sub_content.tag"}})],1)],1),a("div",{staticClass:"right"},[a("SubTitle",{attrs:{title:t.$t("SEO设置")}}),a("el-form-item",{attrs:{prop:"seo_title",label:"Title:"}},[a("el-input",{attrs:{placeholder:t.$t("请输入seo标题")},model:{value:t.addForm.sub_content.seo_title,callback:function(e){t.$set(t.addForm.sub_content,"seo_title",e)},expression:"addForm.sub_content.seo_title"}})],1),a("el-form-item",{attrs:{prop:"seo_keyword",label:"Keyword:"}},[a("el-input",{attrs:{placeholder:t.$t("请输入seo关键词")},model:{value:t.addForm.sub_content.seo_keyword,callback:function(e){t.$set(t.addForm.sub_content,"seo_keyword",e)},expression:"addForm.sub_content.seo_keyword"}})],1),a("el-form-item",{attrs:{prop:"seo_description",label:"Description:"}},[a("el-input",{attrs:{type:"textarea",placeholder:t.$t("请输入seo描述"),autosize:{minRows:4}},model:{value:t.addForm.sub_content.seo_description,callback:function(e){t.$set(t.addForm.sub_content,"seo_description",e)},expression:"addForm.sub_content.seo_description"}})],1),a("SubTitle",{attrs:{title:t.$t("其他信息")}}),a("el-form-item",{attrs:{prop:"author",label:t.$t("作者")+":"}},[a("el-input",{attrs:{placeholder:t.$t("请输入作者名称")},model:{value:t.addForm.sub_content.author,callback:function(e){t.$set(t.addForm.sub_content,"author",e)},expression:"addForm.sub_content.author"}})],1),a("el-form-item",{attrs:{label:t.$t("模板")+":"}},[a("el-select",{model:{value:t.addForm.sub_content.detail_tpl,callback:function(e){t.$set(t.addForm.sub_content,"detail_tpl",e)},expression:"addForm.sub_content.detail_tpl"}},t._l(t.themeList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.file,value:t.file}})})),1)],1),a("el-form-item",{attrs:{prop:"url",label:t.$t("跳转链接")+":"}},[a("el-input",{attrs:{placeholder:t.$t("请输入跳转链接")},model:{value:t.addForm.sub_content.url,callback:function(e){t.$set(t.addForm.sub_content,"url",e)},expression:"addForm.sub_content.url"}})],1),a("el-form-item",{attrs:{label:t.$t("发布时间")+":",prop:"publish_time"}},[a("el-date-picker",{attrs:{type:"datetime",placeholder:t.$t("请选择发布时间"),"value-format":"yyyy-MM-dd HH:mm:ss",format:"yyyy-MM-dd HH:mm:ss"},model:{value:t.addForm.sub_content.publish_time,callback:function(e){t.$set(t.addForm.sub_content,"publish_time",e)},expression:"addForm.sub_content.publish_time"}})],1),a("el-form-item",{attrs:{prop:"hits",label:t.$t("浏览量")+":"}},[a("el-input",{attrs:{placeholder:t.$t("请输入浏览量")},model:{value:t.addForm.sub_content.hits,callback:function(e){t.$set(t.addForm.sub_content,"hits",e)},expression:"addForm.sub_content.hits"}})],1),a("el-form-item",{attrs:{prop:"sort",label:t.$t("排序")+":"}},[a("el-input",{attrs:{placeholder:t.$t("请输入排序")},model:{value:t.addForm.sub_content.sort,callback:function(e){t.$set(t.addForm.sub_content,"sort",e)},expression:"addForm.sub_content.sort"}})],1),a("el-form-item",{attrs:{prop:"status",label:t.$t("状态")+":"}},[a("el-switch",{attrs:{"active-text":t.$t("正常"),"inactive-text":t.$t("禁用"),"active-value":"1","inactive-value":"2","active-color":"var(--huocms-com-color-primary)","inactive-color":"rgba(0,0,0,0.2)"},model:{value:t.addForm.sub_content.status,callback:function(e){t.$set(t.addForm.sub_content,"status",e)},expression:"addForm.sub_content.status"}})],1),a("el-form-item",{attrs:{prop:"is_top",label:t.$t("是否置顶")+":"}},[a("el-switch",{attrs:{"active-text":t.$t("置顶"),"inactive-text":t.$t("否"),"active-value":"1","inactive-value":"2","active-color":"var(--huocms-com-color-primary)","inactive-color":"rgba(0,0,0,0.2)"},model:{value:t.addForm.sub_content.is_top,callback:function(e){t.$set(t.addForm.sub_content,"is_top",e)},expression:"addForm.sub_content.is_top"}})],1),a("el-form-item",{attrs:{prop:"is_recommend",label:t.$t("是否推荐")+":"}},[a("el-switch",{attrs:{"active-text":t.$t("推荐"),"inactive-text":t.$t("否"),"active-value":"1","inactive-value":"2","active-color":"var(--huocms-com-color-primary)","inactive-color":"rgba(0,0,0,0.2)"},model:{value:t.addForm.sub_content.is_recommend,callback:function(e){t.$set(t.addForm.sub_content,"is_recommend",e)},expression:"addForm.sub_content.is_recommend"}})],1),a("el-form-item",{attrs:{size:"small",label:t.$t("缩略图")+":"}},[a("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openList("thumbnail")}}},[t.addForm.sub_content.thumbnail?a("img",{staticClass:"attachmentImg",attrs:{src:t.thumbnailImg}}):a("i",{staticClass:"el-icon-camera"}),t.addForm.sub_content.thumbnail?a("span",{staticClass:"img-actions attachmentImg"},[a("span",{on:{click:function(e){return e.stopPropagation(),t.handleRemove(1)}}},[a("i",{staticClass:"el-icon-delete"})])]):t._e()]),a("Attachment",{ref:"attachment",attrs:{"dialog-show":t.dialogShow,"attachment-type":t.attachmentType},on:{"update:dialogShow":function(e){t.dialogShow=e},"update:dialog-show":function(e){t.dialogShow=e},func:t.getData}})],1),a("el-form-item",{attrs:{label:t.$t("详情页banner")+":"}},[a("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openList("cover")}}},[t.addForm.sub_content.cover?a("img",{staticClass:"attachmentImg",attrs:{src:t.coverImg}}):a("i",{staticClass:"el-icon-camera"}),t.addForm.sub_content.cover?a("span",{staticClass:"img-actions attachmentImg"},[a("span",{on:{click:function(e){return e.stopPropagation(),t.handleRemove(2)}}},[a("i",{staticClass:"el-icon-delete"})])]):t._e()])])],1)]),a("div",{staticStyle:{width:"100%"}},[a("SubTitle",{attrs:{title:t.$t("附加信息")}}),a("PublicForm",{ref:"PublicForm",attrs:{"form-obj":t.formObj,"form-data":t.formData,rules:t.mainRules}})],1),a("br"),a("div",{staticClass:"flexCenter"},[a("el-button",{staticClass:"tianBlue",attrs:{type:"primary"},on:{click:function(e){return t.onSubmit(3)}}},[t._v(" "+t._s(t.$t("暂存"))+" ")]),a("el-button",{attrs:{loading:t.loading,type:"primary"},on:{click:function(e){return t.onSubmit()}}},[t._v(" "+t._s(t.$t("提交"))+" ")])],1),a("BaseDialog",{attrs:{title:t.$t("批量上传"),"dialog-show":t.dialogShow2,width:"50%",footer:""},on:{"update:dialogShow":function(e){t.dialogShow2=e},"update:dialog-show":function(e){t.dialogShow2=e},submit:function(e){t.dialogShow2=!1}}},[a("el-form",{attrs:{"label-position":"top"}},[a("el-form-item",{attrs:{label:t.$t("文件")+":"}},[a("el-upload",{ref:"upload",staticClass:"bulkImort",attrs:{headers:t.myHeaders,action:t.$store.getters.updateURL+"content/articleUpload",data:t.bulkData,"show-file-list":!0,"on-success":t.bulkImportSuccess,"before-upload":t.beforeBulkImport,"on-change":t.bulkChange,multiple:!0}},[a("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-upload2"}},[t._v(" "+t._s(t.$t("批量上传"))+" ")])],1)],1),a("el-form-item",[a("el-checkbox",{on:{change:t.changePseudo},model:{value:t.pseudo,callback:function(e){t.pseudo=e},expression:"pseudo"}},[t._v(" "+t._s(t.$t("伪原创"))+" ")])],1)],1)],1)],1)},i=[],r=a("2909"),n=a("ade3"),s=a("1da1"),l=a("5530"),c=(a("96cf"),a("d3b7"),a("3ca3"),a("ddb0"),a("7db0"),a("159b"),a("4de4"),a("07ac"),a("ac1f"),a("1276"),a("a4d3"),a("e01a"),a("a434"),a("a15b"),a("99af"),a("7632")),u=a("816b"),d=a("12de"),m=a("e2be"),p=a("d28d"),f=a("37cb"),h=a("2f62"),b={name:"AddArticle",components:{PublicForm:m["default"]},data:function(){return{pseudo:!1,themeList:[],dialogShow2:!1,myHeaders:{Authorization:"Bearer ".concat(this.$store.getters.token)},bulkData:{},attachmentLimit:10,webList:[],type:"",dialogShow:!1,thumbnailImg:"",coverImg:"",attachmentData:[],content:"",html:"",formObj:[],formData:{},mainRules:[],searchForm:{model_id:"",category_id:[],site_id:[]},searchRules:{site_id:[{required:!0,message:this.$t("请选择站点"),trigger:"change"}],category_id:[{required:!0,message:this.$t("请选择栏目"),trigger:"change"}]},moduleList:[],columnList:[],subColumnList:[],currentModuleId:"",formTypeSource:{},website_id:"",headers:{},imageUrl:"",imgUrl:this.$store.getters.updateURL,checkList:[],tindata:"",ticShow:!1,options:[],value:"",pageLoading:!1,id:"",loading:!1,form:{label:"",title:"",cate_id:"",push_time:"",image_url:"",content:"",source:"词爪官方",is_hot:2},rules:{sub_content:{title:[{required:!0,message:this.$t("请选择文章标题"),trigger:"blur"}]},main_content:{title:[{required:!0,message:this.$t("请选择文章标题"),trigger:"blur"}]}},addForm:{website_id:"",category_id:"",sub_content:{title:"",sub_title:"",detail_tpl:"",description:"",thumbnail:"",cover:"",hits:"",author:"",status:"1",url:"",is_top:"",is_recommend:"",sort:"",seo_title:"",seo_keyword:"",seo_description:""},main_content:{title:""}},tagData:[],attachmentType:""}},computed:Object(l["a"])({},Object(h["b"])(["siteId"])),watch:{siteId:function(t,e){e&&this.$router.push({name:"Content"})}},created:function(){this.lang=this.$route.query.lang,this.bulkData={module_id:this.$route.query.module_id,category_id:this.$route.query.category_id,pseudo:this.pseudo?"1":"2"},this.getWebList(),this.siteId&&this.getList(),this.getTemp()},updated:function(){this.bulkData.pseudo=this.pseudo?"1":"2"},methods:{handleRemove:function(t){1==t?(this.addForm.sub_content.thumbnail="",this.thumbnailImg=""):(this.addForm.sub_content.cover="",this.coverImg="")},handleChangeColumn:function(t){this.getSubColumnList(t),this.searchForm.subColumnId=[]},changePseudo:function(){},getColumnList:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.searchForm.site_id.length){e.next=7;break}return e.next=3,u["a"].getModuleCate({lang:t.lang,site_id:t.searchForm.site_id});case 3:a=e.sent,t.columnList=a.data,e.next=8;break;case 7:t.columnList=[];case 8:case"end":return e.stop()}}),e)})))()},getSubColumnList:function(t){var e=this;this.searchForm.subColumnId=[];var a=[];this.columnList.find((function(a){var o=a.category.find((function(e){return e.id==t}));null!==o&&void 0!==o&&o.module_id&&(e.currentModuleId=o.module_id)})),this.columnList.forEach((function(o){a.push(Object(l["a"])(Object(l["a"])({},o),{},{category:o.category.filter((function(a){return a.module_id===e.currentModuleId&&a.id!==t}))}))})),this.subColumnList=a,this.getSubform()},getSubform:function(){var t=this;this.addForm.module_id=this.currentModuleId,this.addForm.category_id=this.searchForm.category_id,this.addForm.website_id=this.website_id,u["a"].fieldList({module_id:this.currentModuleId}).then((function(e){if(0==e.code){t.formObj=[];var a=Object.values(e.data);a.forEach((function(e){"checkbox"==e.form_type?t.$set(t.formData,e.table_field,[]):t.$set(t.formData,e.table_field,"");var a,o,i=[],r=[];if("require"==e.validate_rule)e.validate_rule=[{required:!0,message:t.$t("此内容为必填内容"),trigger:"blur"}],e.attach_data?(i=e.attach_data.split(","),i.forEach((function(t,e){r.push({label:t,value:e})})),t.formObj.push((a={},Object(n["a"])(a,e.form_type,!0),Object(n["a"])(a,"label",e.form_title),Object(n["a"])(a,"prop",e.table_field),Object(n["a"])(a,"rules",e.validate_rule),Object(n["a"])(a,"options",e.attach_data?r:[]),Object(n["a"])(a,"list",[]),Object(n["a"])(a,"id",e.id),a))):t.formObj.push((o={},Object(n["a"])(o,e.form_type,!0),Object(n["a"])(o,"label",e.form_title),Object(n["a"])(o,"prop",e.table_field),Object(n["a"])(o,"rules",e.validate_rule),Object(n["a"])(o,"list",[]),Object(n["a"])(o,"id",e.id),o));else if("date"==e.validate_rule||"time"==e.validate_rule){var s,l;if(e.validate_rule=[{required:!0,message:t.$t("请选择日期或时间"),trigger:"blur"}],e.attach_data)i=e.attach_data.split(","),i.forEach((function(t,e){r.push({label:t,value:e})})),t.formObj.push((s={},Object(n["a"])(s,e.form_type,!0),Object(n["a"])(s,"label",e.form_title),Object(n["a"])(s,"prop",e.table_field),Object(n["a"])(s,"rules",e.validate_rule),Object(n["a"])(s,"options",e.attach_data?r:[]),Object(n["a"])(s,"list",[]),Object(n["a"])(s,"id",e.id),s));else t.formObj.push((l={},Object(n["a"])(l,e.form_type,!0),Object(n["a"])(l,"label",e.form_title),Object(n["a"])(l,"prop",e.table_field),Object(n["a"])(l,"rules",e.validate_rule),Object(n["a"])(l,"list",[]),Object(n["a"])(l,"id",e.id),l))}else if("email"==e.validate_rule){var c,u;if(e.validate_rule=[{required:!0,message:t.$t("请输入邮箱"),trigger:"blur"}],e.attach_data)i=e.attach_data.split(","),i.forEach((function(t,e){r.push({label:t,value:e})})),t.formObj.push((c={},Object(n["a"])(c,e.form_type,!0),Object(n["a"])(c,"label",e.form_title),Object(n["a"])(c,"prop",e.table_field),Object(n["a"])(c,"rules",e.validate_rule),Object(n["a"])(c,"options",e.attach_data?r:[]),Object(n["a"])(c,"list",[]),Object(n["a"])(c,"id",e.id),c));else t.formObj.push((u={},Object(n["a"])(u,e.form_type,!0),Object(n["a"])(u,"label",e.form_title),Object(n["a"])(u,"prop",e.table_field),Object(n["a"])(u,"rules",e.validate_rule),Object(n["a"])(u,"list",[]),Object(n["a"])(u,"id",e.id),u))}else if("reference"==e.form_type){var d,m;if("has_one"==e.settings.relation||"belongs_to"==e.settings.relation)t.formObj.push((d={},Object(n["a"])(d,e.form_type,!0),Object(n["a"])(d,"label",e.form_title),Object(n["a"])(d,"prop",e.table_field),Object(n["a"])(d,"rules",""==e.validate_rule?[]:e.validate_rule),Object(n["a"])(d,"options",e.attach_data),Object(n["a"])(d,"list",[]),Object(n["a"])(d,"id",e.id),Object(n["a"])(d,"multiple",!1),Object(n["a"])(d,"relation_file",e.settings.foreign_key),d));else t.formObj.push((m={},Object(n["a"])(m,e.form_type,!0),Object(n["a"])(m,"label",e.form_title),Object(n["a"])(m,"prop",e.table_field),Object(n["a"])(m,"rules",""==e.validate_rule?[]:e.validate_rule),Object(n["a"])(m,"options",e.attach_data),Object(n["a"])(m,"list",[]),Object(n["a"])(m,"id",e.id),Object(n["a"])(m,"multiple",!0),Object(n["a"])(m,"relation_file",e.settings.foreign_key),m))}else{var p,f;if(e.validate_rule=[],e.attach_data)i=e.attach_data.split(","),i.forEach((function(t,e){r.push({label:t,value:e})})),t.formObj.push((p={},Object(n["a"])(p,e.form_type,!0),Object(n["a"])(p,"label",e.form_title),Object(n["a"])(p,"prop",e.table_field),Object(n["a"])(p,"rules",e.validate_rule),Object(n["a"])(p,"options",e.attach_data?r:[]),Object(n["a"])(p,"list",[]),Object(n["a"])(p,"id",e.id),p));else t.formObj.push((f={},Object(n["a"])(f,e.form_type,!0),Object(n["a"])(f,"label",e.form_title),Object(n["a"])(f,"prop",e.table_field),Object(n["a"])(f,"rules",e.validate_rule),Object(n["a"])(f,"list",[]),Object(n["a"])(f,"id",e.id),f))}}))}}))},getData:function(t){t.length>1?this.$message.error(this.$t(this.$t("最多只能选择一张图片"))):("thumbnail"==this.type?(this.addForm.sub_content.thumbnail=t[0].id,this.thumbnailImg=t[0].url):"cover"==this.type&&(this.addForm.sub_content.cover=t[0].id,this.coverImg=t[0].url),this.dialogShow=!1)},openList:function(t){var e=this;this.dialogShow=!0,this.attachmentType=2,this.$nextTick((function(){e.$refs.attachment.getAttachmentList(),e.$refs.attachment.$refs.AttachmentCate.getCateList(0)})),this.type=t},getTemp:function(){var t=this;d["a"].webTempList({website_id:this.siteId,lang:this.lang}).then((function(e){t.themeList=e.data}))},batchUpload:function(){var t=this;return 0==this.searchForm.site_id.length?(this.$message.error(this.$t("站点不能为空")),!1):this.searchForm.site_id.length>1?(this.$message.error(this.$t("只能选择一个站点下的栏目上传内容")),!1):(this.bulkData.category_id=this.searchForm.category_id,this.bulkData.website_id=this.searchForm.site_id[0],this.dialogShow2=!0,void this.$nextTick((function(e){t.$refs.upload.clearFiles()})))},changeDescription:function(t){this.addForm.sub_content.description=t},beforeBulkImport:function(t){var e="text/plain"===t.type;return e||this.$message.error(this.$t("批量上传仅支持txt")),e},bulkChange:function(t){t.length>1&&t.splice(0,1)},bulkImportSuccess:function(t,e){0==t.code&&this.$message.success(t.msg)},getList:function(){var t=this,e={limit:100,page:1,website_id:this.siteId,lang:this.lang};p["a"].tagList(e).then((function(e){t.tagData=e.data}))},getWebList:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,f["a"].websiteList();case 2:a=e.sent,t.getTreeData(a.data);case 4:case"end":return e.stop()}}),e)})))()},getTreeData:function(t){var e=this,a=[];function o(t){t.length&&t.forEach((function(t){a.push({id:t.id,domain:0!=t.parent_id?"--".concat(t.domain):t.domain,parent_id:t.parent_id}),t.children.length&&o(t.children)}))}o(t),this.webList=a,this.$nextTick((function(){e.siteId&&(e.searchForm.site_id=[+e.siteId]),e.getColumnList()}))},webChange:function(t){this.searchForm.site_id=t,this.searchForm.category_id=[],this.searchForm.subColumnId=[],this.getColumnList()},onSubmit:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.addForm.sub_content=Object(l["a"])(Object(l["a"])({},this.addForm.sub_content),{},{content:this.getTin(),category_id:this.searchForm.category_id,sub_category_ids:this.searchForm.subColumnId.join(","),status:e});var a=this.$refs.PublicForm.$refs.myTinymce;a&&a.forEach((function(e){t.formData[e.prop]=e.codeValue})),this.$refs.form.validate((function(e){if(e){var a={module_id:t.currentModuleId,category_id:[t.searchForm.category_id].concat(Object(r["a"])(t.searchForm.subColumnId)),lang:t.lang,main_content:t.formData,sub_content:t.addForm.sub_content};t.loading=!0,c["a"].contentSave(a).then((function(e){0==e.code&&(t.$message.success(e.msg),t.prev()),t.loading=!1})),t.loading=!1}else t.$message.warning(t.$t("请填写必要信息"))}))},getTin:function(){var t=this.$refs.myTinymce.codeValue;return t},prev:function(){this.$router.push({name:"Content",query:{category_id:this.searchForm.category_id,lang:this.lang}})}}},_=b,g=(a("d7f7"),a("5914"),a("2877")),v=Object(g["a"])(_,o,i,!1,null,"78f114a0",null);e["default"]=v.exports},d28d:function(t,e,a){"use strict";var o=a("365c");function i(t){var e="/tag/backendIndex";return o["a"].get(e,t)}function r(t){var e="/tag/save";return o["a"].post(e,t)}function n(t){var e="/tag/update";return o["a"].post(e,t)}function s(t){var e="/tag/delete";return o["a"].post(e,t)}e["a"]={tagList:i,tagSave:r,tagUpdate:n,tagDelete:s}},d7f7:function(t,e,a){"use strict";a("c98a")},df21:function(t,e,a){},e2be:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-form",{ref:"ruleForm",staticClass:"flexForm",attrs:{model:t.formData,"label-position":"top"}},[a("ContentAttachment",{ref:"attachment",attrs:{"dialog-show":t.dialogShow,"attachment-type":t.attachmentType},on:{"update:dialogShow":function(e){t.dialogShow=e},"update:dialog-show":function(e){t.dialogShow=e},func:t.getData}}),t._l(t.formObj,(function(e,o){return a("div",{directives:[{name:"show",rawName:"v-show",value:!e.notShow,expression:"!formobj.notShow"}],key:o,staticClass:"form-item"},[a("el-form-item",{attrs:{label:e.label,prop:e.prop,rules:e.rules}},[e.input?a("el-input",{attrs:{size:"small",placeholder:e.placeholder},on:{input:function(a){return t.inputINPUT(a,o,e.prop)},change:function(a){return t.inputChange(a,o,e.prop)}},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}}):t._e(),e.textarea?a("el-input",{attrs:{size:"small",type:"textarea",placeholder:e.placeholder},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}}):t._e(),e.reference?a("el-select",{attrs:{filterable:"",size:"small",placeholder:e.placeholder,multiple:e.multiple},on:{change:function(a){return t.selectChange(a,o,e.prop)}},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}},t._l(e.options,(function(t,o){return a("el-option",{key:o,attrs:{label:t.hc_main_title,value:t[e.relation_file]}})})),1):t._e(),e.select?a("el-select",{attrs:{size:"small",placeholder:e.placeholder},on:{change:function(a){return t.selectChange(a,o,e.prop)}},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}},t._l(e.options,(function(t,e){return a("el-option",{key:e,attrs:{label:t.label,value:t.label}})})),1):t._e(),e.multiSelect?a("el-select",{attrs:{size:"small",multiple:"",placeholder:e.placeholder},on:{change:function(a){return t.selectChange(a,o,e.prop)}},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}},t._l(e.options,(function(t,e){return a("el-option",{key:e,attrs:{label:t.label,value:t.label+""}})})),1):t._e(),e.date?a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",size:"small",placeholder:e.placeholder},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}}):t._e(),e.time?a("el-time-picker",{attrs:{"value-format":"HH:mm:ss",format:"HH:mm:ss",size:"small",placeholder:e.placeholder},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}}):t._e(),e.datetime?a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",size:"small",placeholder:e.placeholder},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}}):t._e(),e.dateTimeRange?a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",format:"yyyy-MM-dd HH:mm:ss",size:"small",type:"datetimerange","range-separator":t.$t("至"),"start-placeholder":t.$t("开始日期"),"end-placeholder":t.$t("结束日期")},on:{change:function(a){return t.chooseTime(a,e.prop)}},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}}):t._e(),e.switch?a("el-switch",{attrs:{size:"small","active-value":e.options[0].label,"inactive-value":e.options[1].label,"active-text":e.options[0].label,"inactive-text":e.options[1].label,"active-color":"var(--huocms-com-color-primary)","inactive-color":"rgba(0,0,0,0.2)"},on:{change:function(a){return t.formSwitchChange(a,o,e.prop)}},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}}):t._e(),e.radio?a("el-radio-group",{model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}},t._l(e.options,(function(t,e){return a("el-radio",{key:e,attrs:{label:t.label,value:t.value}})})),1):t._e(),e.checkbox?a("el-checkbox-group",{on:{change:function(a){return t.changeCheck(a,o,e.prop)}},model:{value:t.formData[e.prop],callback:function(a){t.$set(t.formData,e.prop,a)},expression:"formData[formobj.prop]"}},t._l(e.options,(function(t,e){return a("el-checkbox",{key:e,attrs:{label:t.label}})})),1):t._e(),e.image?a("div",{staticClass:"upload"},[a("div",{staticClass:"attachment_imgBox",on:{click:function(a){return t.openAttList(e.prop,e)}}},[t.formData[e.prop]?a("img",{staticClass:"attachmentImg",attrs:{src:e.IMGURL}}):a("i",{staticClass:"el-icon-camera"})])]):t._e(),e.multiImage?a("div",{staticClass:"attachmentBtn"},[t.formData[e.prop]?a("div",{staticClass:"multiBox"},[a("draggable",{attrs:{list:e.list},on:{end:function(a){return t.handleEnd(e.prop,e.list)}}},t._l(e.list,(function(o,i){return a("div",{key:i,staticClass:"multiBoxItem"},[a("img",{staticClass:"attachmentImg",attrs:{src:o.url}}),a("el-input",{attrs:{size:"mini",placeholder:t.$t("描述")},on:{change:function(e){return t.changeDesc(o)}},model:{value:o.description,callback:function(e){t.$set(o,"description",e)},expression:"item.description"}}),a("i",{staticClass:"el-icon-circle-close",attrs:{type:"text"},on:{click:function(a){return t.delMultiImg(e.prop,e,o.id,i)}}})],1)})),0)],1):t._e(),a("div",{staticClass:"attachment_imgBox",on:{click:function(a){return t.openAttList(e.prop,e)}}},[a("i",{staticClass:"el-icon-camera"})])]):t._e(),e.video?a("div",{staticClass:"attachmentBtn"},[t.formData[e.prop]?a("span",[t._v(t._s(e.name))]):t._e(),a("div",{staticStyle:{display:"inline-block"},on:{click:function(a){return t.openAttList(e.prop,e)}}},[t.formData[e.prop]?a("el-button",{staticClass:"blue",attrs:{type:"primary",size:"mini"}},[t._v(" "+t._s(t.$t("替换附件"))+" ")]):a("div",{staticClass:"attachment_imgBox"},[a("i",{staticClass:"el-icon-camera"})])],1)]):t._e(),e.file?a("div",{staticClass:"attachmentBtn"},[t.formData[e.prop]?a("span",[t._v(t._s(e.name))]):t._e(),a("div",{staticStyle:{display:"inline-block"},on:{click:function(a){return t.openAttList(e.prop,e)}}},[t.formData[e.prop]?a("el-button",{staticClass:"blue",attrs:{type:"primary",size:"mini"}},[t._v(" "+t._s(t.$t("替换附件"))+" ")]):a("div",{staticClass:"attachment_imgBox"},[a("i",{staticClass:"el-icon-document"})])],1)]):t._e(),e.multiVideo?a("div",{staticClass:"attachmentBtn"},[t.formData[e.prop]?a("div",{staticClass:"multiBox"},[a("draggable",{attrs:{list:e.list},on:{end:function(a){return t.handleEnd(e.prop,e.list)}}},t._l(e.list,(function(o,i){return a("div",{key:i,staticClass:"multiBoxItem"},[a("i",{staticClass:"el-icon-circle-close",attrs:{type:"text"},on:{click:function(a){return t.delMultiImg(e.prop,e,o.id,i)}}}),a("i",{staticClass:"el-icon-video-camera-solid"}),a("p",{staticClass:"fileName"},[t._v(t._s(o.name))])])})),0)],1):t._e(),a("div",{staticClass:"attachment_imgBox",on:{click:function(a){return t.openAttList(e.prop,e)}}},[a("i",{staticClass:"el-icon-camera"})])]):t._e(),e.multiFile?a("div",{staticClass:"attachmentBtn"},[t.formData[e.prop]?a("div",{staticClass:"multiBox"},[a("draggable",{attrs:{list:e.list},on:{end:function(a){return t.handleEnd(e.prop,e.list)}}},t._l(e.list,(function(o,i){return a("div",{key:i,staticClass:"multiBoxItem"},[a("i",{staticClass:"el-icon-circle-close",attrs:{type:"text"},on:{click:function(a){return t.delMultiImg(e.prop,e,o.id,i)}}}),a("i",{staticClass:"el-icon-tickets"}),a("p",{staticClass:"fileName"},[t._v(t._s(o.name))])])})),0)],1):t._e(),a("div",{staticClass:"attachment_imgBox",on:{click:function(a){return t.openAttList(e.prop,e)}}},[a("i",{staticClass:"el-icon-document"})])]):t._e(),e.richText?a("div",{ref:e.prop,refInFor:!0},[a("div",[a("MyTinymce",{ref:"myTinymce",refInFor:!0,attrs:{prop:e.prop,"tinymce-html":t.content},on:{onClick:function(a){return t.input(e.prop)}}})],1)]):t._e()],1)],1)}))],2)},i=[],r=a("1da1"),n=(a("96cf"),a("d81d"),a("d3b7"),a("159b"),a("b0c0"),a("a4d3"),a("e01a"),a("a434"),a("c740"),a("33fc")),s=a("1980"),l=a.n(s),c={components:{draggable:l.a},props:{formObj:{type:Array,required:!0},formData:{type:Object,required:!0}},data:function(){var t=this.$store.state.user.uploadFileUrl;return{loading:!1,is_one:!0,attachmentType:"",attachmentTotal:"",infiniteScroll:!1,attachmentLimit:10,dialogShow:!1,attachmentData:[],imagelist:[],content:"",text:[],tindata:"",myHeaders:{Authorization:"Bearer ".concat(this.$store.getters.token)},headers:{},imageUrl:"",imgUrl:this.$store.getters.updateURL,uploadUrl:t,image:"",images:"",dialogImageUrl:"",searchSelectLoading:!1,dialogVisible:!1,disabled:!1,uploadTitle:"",videos:[],text2:[],text3:[],tinType:"",prop:"",uploadType:""}},watch:{},created:function(){},methods:{handleEnd:function(t,e){this.formData[t]=e.map((function(t){return t.id}))},changeDesc:function(t){return Object(r["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,n["a"].attachmentUpdate(t);case 2:e.sent;case 3:case"end":return e.stop()}}),e)})))()},getData:function(t){var e=this;t.length>1&&this.is_one?this.$message.error(this.$t("最多只能选择一张图片")):("image"==this.uploadType?(this.formObj.forEach((function(a){a.prop==e.prop&&(a.IMGURL=t[0].url)})),this.formData[this.prop]=t[0].id):"multiImage"==this.uploadType?this.formObj.forEach((function(a){a.prop==e.prop&&(e.formData[e.prop].length<1&&(e.formData[e.prop]=[]),t.forEach((function(t){var o=t.id,i={name:t.name,url:t.url,description:t.description,id:t.id};e.formData[e.prop].push(o),a.list.push(i)})))})):"video"==this.uploadType||"file"==this.uploadType?(this.formObj.forEach((function(a){a.prop==e.prop&&(a.IMGURL=t[0].url,a.name=t[0].name)})),this.formData[this.prop]=t[0].id):"multiVideo"==this.uploadType?this.formObj.forEach((function(a){a.prop==e.prop&&(e.formData[e.prop].length<1&&(e.formData[e.prop]=[]),t.forEach((function(t){var o=t.id,i={name:t.name,description:t.description,url:t.url,id:t.id};e.formData[e.prop].push(o),a.list.push(i)})))})):"multiFile"==this.uploadType&&this.formObj.forEach((function(a){a.prop==e.prop&&(e.formData[e.prop].length<1&&(e.formData[e.prop]=[]),t.forEach((function(t){var o=t.id,i={name:t.name,url:t.url,description:t.description,id:t.id};e.formData[e.prop].push(o),a.list.push(i)})))})),this.dialogShow=!1)},delMultiImg:function(t,e,a,o){var i=this;e.list.forEach((function(r){a==r.id&&(e.list.splice(o,1),i.formData[t].splice(o,1))}))},openAttList:function(t,e,a){e.image||e.multiImage?(this.attachmentType=2,e.image?this.uploadType="image":(this.uploadType="multiImage",this.is_one=!1)):e.multiVideo||e.video?(this.attachmentType=3,e.video?this.uploadType="video":(this.uploadType="multiVideo",this.is_one=!1)):(this.attachmentType=0,e.file?this.uploadType="file":(this.uploadType="multiFile",this.is_one=!1)),this.dialogShow=!0,this.prop=t},input:function(t){this.tinType=t},changeCheck:function(t,e,a){this.formData[a]=t},chooseTime:function(t,e){this.formData[e]=t},selectChange:function(t,e,a){this.formData[a]=t},inputINPUT:function(t,e,a){this.$emit("inputINPUT",t,e,a)},inputChange:function(t,e,a){this.$emit("inputChange",t,e,a)},remoteMethod:function(t,e,a){var o=this;t?(this.searchSelectLoading=!0,this.$emit("querySelectValue",t,e,a),setTimeout((function(){o.formObj[e].options=o.searchSelectOptionsCb,o.searchSelectLoading=!1}),500)):this.searchSelectOptios=[]},formSwitchChange:function(t,e,a){this.$emit("formSwitchChange",t,e,a)},buttonClick:function(t,e){this.$emit("buttonClick",t,e)},getTin:function(t){if(this.$refs.myTinymce){var e=this.$refs.myTinymce[0].codeValue;return this.formData[this.tinType]=e,e}},setTin:function(t){this.$refs.tin.setContent(t)},changeImages:function(t,e){},uploadSuccess:function(t,e,a,o){if(0==e.code){var i=[];o.forEach((function(t){t.response?i.push(t.response.data.id):i.push(t.id)})),this.formData[t]=i}},removeSuccess:function(t,e,a,o){var i=[];a.length>0?(a.forEach((function(t){i.push(t.response.data.id)})),this.formData[t]=i.toString()):this.formData[t]=""},handleRemove:function(t,e,a,o,i){this.formObj[i].uploadObj.hideUpload=e.length==a,this.pushUpload(t,e,a,o)},handlePictureCardPreview:function(t){this.dialogImageUrl=t.url,this.dialogVisible=!0},submitForm:function(){var t=this,e=Boolean;return this.$refs.ruleForm.validate((function(a){a?e=!0:(t.$message.warning(t.$t("请把信息填写完整")),e=!1)})),e},resetForm:function(t){var e=this;if(this.$refs.ruleForm.resetFields(),t)for(var a=function(a){e.$refs[t[a]][0].clearFiles();var o=e.formObj.findIndex((function(e){return e.prop==t[a]}));e.formObj[o].uploadObj.hideUpload=!1},o=0;o<t.length;o++)a(o)},validateFieldProp:function(t){var e=Boolean;return this.$refs.ruleForm.validateField(t,(function(t){e=!t})),e},pushUpload:function(t,e,a,o){a.length}}},u=c,d=(a("ac57"),a("26d2"),a("2877")),m=Object(d["a"])(u,o,i,!1,null,"2f22aac9",null);e["default"]=m.exports}}]);
|