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
38 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7754bbbe","chunk-2cb825d6"],{"07ac":function(t,e,a){"use strict";var o=a("23e7"),i=a("6f53").values;o({target:"Object",stat:!0},{values:function(t){return i(t)}})},1930:function(t,e,a){},2309:function(t,e,a){},2508:function(t,e,a){"use strict";a("2dc0")},"2a0a":function(t,e,a){"use strict";a("1930")},"2dc0":function(t,e,a){},"6f53":function(t,e,a){"use strict";var o=a("83ab"),i=a("d039"),r=a("e330"),n=a("e163"),s=a("df75"),l=a("fc6a"),c=a("d1e7").f,u=r(c),d=r([].push),m=o&&i((function(){var t=Object.create(null);return t[2]=2,!u(t,2)})),p=function(t){return function(e){var a,i=l(e),r=s(i),c=m&&null===n(i),p=r.length,h=0,f=[];while(p>h)a=r[h++],o&&!(c?a in i:u(i,a))||d(f,t?[a,i[a]]:i[a]);return f}};t.exports={entries:p(!0),values:p(!1)}},7117:function(t,e,a){"use strict";a("acdd")},"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 h(t){var e="/moduleField/read";return o["a"].get(e,t)}function f(t){var e="/module/all";return o["a"].get(e,t)}function b(t){var e="/module/field";return o["a"].get(e,t)}function _(t){var e="/preview";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:h,getModuleCate:c,moduleTable:f,moduleField:b,preview:_}},9039:function(t,e,a){"use strict";a("2309")},acdd:function(t,e,a){},c6c2:function(t,e,a){var o={"./add.vue":["ca30"],"./components/approvalReject.vue":["cfaa","chunk-2d222cb9"],"./components/form.vue":["e2be"],"./components/importButton.vue":["9aa0","chunk-2d0f022d"],"./components/updateForms.vue":["9531","chunk-fc0c35e0"],"./components/uploadFiles.vue":["0b9b","chunk-5f494878"],"./content.vue":["99f5","chunk-993e1072"],"./info.vue":["8e92","chunk-d28c4884"],"./update.vue":["f874","chunk-fc0c35e0","chunk-0c271982"]};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},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:"",disabled:t.is_customContent},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)],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("提交"))+" ")]),a("el-button",{attrs:{loading:t.loading,type:"primary"},on:{click:function(e){return t.onSubmit(1,"back")}}},[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("c7eb"),l=a("1da1"),c=a("5530"),u=(a("14d9"),a("d3b7"),a("3ca3"),a("ddb0"),a("7db0"),a("159b"),a("4de4"),a("07ac"),a("a4d3"),a("e01a"),a("a434"),a("a15b"),a("99af"),a("7632")),d=a("816b"),m=a("12de"),p=a("e2be"),h=a("d28d"),f=a("37cb"),b=a("2f62"),_={name:"AddArticle",components:{PublicForm:p["default"]},inject:["reload"],data:function(){return{is_customContent:!1,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(c["a"])({},Object(b["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()},mounted:function(){},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(l["a"])(Object(s["a"])().mark((function e(){var a;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t.searchForm.site_id.length){e.next=8;break}return e.next=3,d["a"].getModuleCate({lang:t.lang,site_id:t.searchForm.site_id});case 3:a=e.sent,t.columnList=a.data,t.$route.query.category_id&&(t.searchForm.category_id=+t.$route.query.category_id,t.getSubColumnList(t.$route.query.category_id),t.searchForm.subColumnId=[],t.is_customContent=!0),e.next=9;break;case 8:t.columnList=[];case 9: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(c["a"])(Object(c["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,d["a"].fieldList({module_id:this.currentModuleId,lang:this.lang}).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=[];"require"==e.validate_rule?(e.validate_rule=[{required:!0,message:t.$t("此内容为必填内容"),trigger:"blur"}],e.attach_data?(a=e.attach_data.split(","),a.forEach((function(t,e){o.push({label:t,value:e})})),t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"options",e.attach_data?o:[]),"list",[]),"id",e.id))):t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"list",[]),"id",e.id))):"date"==e.validate_rule||"time"==e.validate_rule?(e.validate_rule=[{required:!0,message:t.$t("请选择日期或时间"),trigger:"blur"}],e.attach_data?(a=e.attach_data.split(","),a.forEach((function(t,e){o.push({label:t,value:e})})),t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"options",e.attach_data?o:[]),"list",[]),"id",e.id))):t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"list",[]),"id",e.id))):"email"==e.validate_rule?(e.validate_rule=[{required:!0,message:t.$t("请输入邮箱"),trigger:"blur"}],e.attach_data?(a=e.attach_data.split(","),a.forEach((function(t,e){o.push({label:t,value:e})})),t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"options",e.attach_data?o:[]),"list",[]),"id",e.id))):t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"list",[]),"id",e.id))):"reference"==e.form_type?"has_one"==e.settings.relation||"belongs_to"==e.settings.relation?t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",""==e.validate_rule?[]:e.validate_rule),"options",e.attach_data),"list",[]),"id",e.id),"multiple",!1),"relation_file",e.settings.foreign_key)):t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",""==e.validate_rule?[]:e.validate_rule),"options",e.attach_data),"list",[]),"id",e.id),"multiple",!0),"relation_file",e.settings.foreign_key)):(e.validate_rule=[],e.attach_data?(a=e.attach_data.split(","),a.forEach((function(t,e){o.push({label:t,value:e})})),t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"options",e.attach_data?o:[]),"list",[]),"id",e.id))):t.formObj.push(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])(Object(n["a"])({},e.form_type,!0),"label",e.form_title),"prop",e.table_field),"rules",e.validate_rule),"list",[]),"id",e.id)))}))}}))},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;m["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};h["a"].tagList(e).then((function(e){t.tagData=e.data}))},getWebList:function(){var t=this;return Object(l["a"])(Object(s["a"])().mark((function e(){var a;return Object(s["a"])().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,a=arguments.length>1?arguments[1]:void 0;this.addForm.sub_content=Object(c["a"])(Object(c["a"])({},this.addForm.sub_content),{},{content:this.getTin(),category_id:this.searchForm.category_id,sub_category_ids:this.searchForm.subColumnId.join(","),status:e});var o=this.$refs.PublicForm.$refs.myTinymce;o&&o.forEach((function(e){t.formData[e.prop]=e.codeValue})),this.$refs.form.validate((function(e){if(e){var o={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,u["a"].contentSave(o).then((function(e){0==e.code&&(t.$message.success(e.msg),a?t.reload():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.is_customContent?this.$router.push("/content/index/"+this.$route.query.category_id):this.$router.push({name:"Content",query:{category_id:this.searchForm.category_id,lang:this.lang}})}}},g=_,v=(a("9039"),a("2508"),a("2877")),y=Object(v["a"])(g,o,i,!1,null,"6bb5c7d2",null);e["default"]=y.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}},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}}):t._e(),t.formData[e.prop]?a("div",{staticClass:"delete-box"},[a("i",{staticClass:"el-icon-delete",on:{click:function(a){return a.stopPropagation(),t.handleDeleteImg(e.prop)}}})]):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("div",{staticClass:"file-box"},[a("span",{staticClass:"file-name",on:{click:function(a){return t.handleDownloadFile(e)}}},[t._v(" "+t._s(e.name)+" ")]),a("i",{staticClass:"iconfont icon-shanchu",on:{click:function(a){return t.handleDeleteFile(e.prop)}}})]):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-video-camera-solid"})])],1)]):t._e(),e.file?a("div",{staticClass:"attachmentBtn"},[t.formData[e.prop]?a("div",{staticClass:"file-box"},[a("span",{staticClass:"file-name",on:{click:function(a){return t.handleDownloadFile(e)}}},[t._v(" "+t._s(e.name)+" ")]),a("i",{staticClass:"iconfont icon-shanchu",on:{click:function(a){return t.handleDeleteFile(e.prop)}}})]):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:"multi-file-box"},[a("div",{staticClass:"multiBoxItem multi-file"},[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",on:{click:function(a){return t.handleDownloadFile(e,i)}}},[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-video-camera-solid"})])]):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:"multi-file-box"},[a("div",{staticClass:"multiBoxItem multi-file"},[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",on:{click:function(a){return t.handleDownloadFile(e,i)}}},[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("c7eb"),n=a("1da1"),s=(a("d81d"),a("d3b7"),a("159b"),a("b0c0"),a("a4d3"),a("e01a"),a("14d9"),a("a434"),a("25f0"),a("c740"),a("33fc")),l=a("1980"),c=a.n(l),u={components:{draggable:c.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:{handleDownloadFile:function(t){window.open(t.IMGURL)},handleEnd:function(t,e){this.formData[t]=e.map((function(t){return t.id}))},changeDesc:function(t){return Object(n["a"])(Object(r["a"])().mark((function e(){return Object(r["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,s["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},handleDeleteFile:function(t){this.formData[t]=""},handleDeleteImg:function(t){this.formData[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}}},d=u,m=(a("7117"),a("2a0a"),a("2877")),p=Object(m["a"])(d,o,i,!1,null,"2e53fb4f",null);e["default"]=p.exports}}]);