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
1 lines
38 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1b3742af","chunk-69bf6520"],{"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)}})},"18d9":function(t,e,a){},"268e":function(t,e,a){"use strict";a("dec8")},"433e":function(t,e,a){},"4e82":function(t,e,a){"use strict";var o=a("23e7"),i=a("e330"),r=a("59ed"),n=a("7b0b"),s=a("07fa"),l=a("083a"),c=a("577e"),u=a("d039"),d=a("addb"),m=a("a640"),p=a("3f7e"),f=a("99f4"),h=a("1212"),b=a("ea83"),_=[],g=i(_.sort),v=i(_.push),y=u((function(){_.sort(void 0)})),$=u((function(){_.sort(null)})),j=m("sort"),k=!u((function(){if(h)return h<70;if(!(p&&p>3)){if(f)return!0;if(b)return b<603;var t,e,a,o,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:a=3;break;case 68:case 71:a=4;break;default:a=2}for(o=0;o<47;o++)_.push({k:e+o,v:a})}for(_.sort((function(t,e){return e.v-t.v})),o=0;o<_.length;o++)e=_[o].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return"DGBEFHACIJK"!==i}})),F=y||!$||!j||!k,O=function(t){return function(e,a){return void 0===a?-1:void 0===e?1:void 0!==t?+t(e,a)||0:c(e)>c(a)?1:-1}};o({target:"Array",proto:!0,forced:F},{sort:function(t){void 0!==t&&r(t);var e=n(this);if(k)return void 0===t?g(e):g(e,t);var a,o,i=[],c=s(e);for(o=0;o<c;o++)o in e&&v(i,e[o]);d(i,O(t)),a=s(i),o=0;while(o<a)e[o]=i[o++];while(o<c)l(e,o++);return e}})},"5af3":function(t,e,a){"use strict";a("18d9")},"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,f=0,h=[];while(p>f)a=r[f++],o&&!(c?a in i:u(i,a))||d(h,t?[a,i[a]]:i[a]);return h}};t.exports={entries:p(!0),values:p(!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}},bf5b:function(t,e,a){"use strict";a("433e")},c6c2:function(t,e,a){var o={"./add.vue":["ca30"],"./components/approvalReject.vue":["cfaa","chunk-2d222cb9"],"./components/form.vue":["e2be"],"./components/updateForms.vue":["9531","chunk-28b7618e"],"./components/uploadFiles.vue":["0b9b","chunk-5f494878"],"./content.vue":["99f5","chunk-dcbbc23a"],"./info.vue":["8e92","chunk-ee047b5a"],"./update.vue":["f874","chunk-28b7618e","chunk-ab5a4f66"]};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);a("a4d3"),a("e01a"),a("4e82");var o=function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-box",attrs:{id:"addContent"}},[e("BaseTitle",{attrs:{title:t.$t("栏目内容管理")},scopedSlots:t._u([{key:"right",fn:function(){return[e("BackBtn",{attrs:{"back-funtion":t.prev}})]},proxy:!0}])}),e("el-form",{ref:"form",staticClass:"flexForm",attrs:{model:t.addForm,rules:t.rules,"label-position":"top"}},[e("div",{staticClass:"left"},[e("el-form",{ref:"searchForm",staticClass:"filter-form",attrs:{model:t.searchForm,rules:t.searchRules,"label-width":"top"}},[e("el-form-item",{attrs:{label:t.$t("站点"),prop:"site_id"}},[e("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 e("el-option",{key:t.id,attrs:{label:t.domain,value:t.id}})})),1)],1),e("el-form-item",{attrs:{label:t.$t("主栏目"),prop:"category_id"}},[e("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(a){return e("el-option-group",{key:a.id,attrs:{label:a.title}},t._l(a.category,(function(t){return e("el-option",{key:t.id,attrs:{label:0!=t.parent_id?"".concat(t.title):t.title,value:t.id,disabled:t.disabled}})})),1)})),1)],1),e("el-form-item",{attrs:{label:t.$t("副栏目")}},[e("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(a){return e("el-option-group",{key:a.id,attrs:{label:a.title}},t._l(a.category,(function(t){return e("el-option",{key:t.id,attrs:{label:t.title,value:t.id,disabled:t.disabled}})})),1)})),1)],1),e("el-form-item",[e("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-upload2"},on:{click:t.batchUpload}},[t._v(" "+t._s(t.$t("批量上传"))+" ")])],1)],1),e("SubTitle",{attrs:{title:t.$t("基本信息")}}),e("el-form-item",{attrs:{prop:"sub_content.title",label:"".concat(t.$t("标题"),":")}},[e("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),e("el-form-item",{attrs:{prop:"sub_content.sub_title",label:"".concat(t.$t("副标题"),":")}},[e("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),e("el-form-item",{attrs:{prop:"sub_content.description",label:"".concat(t.$t("简介"),":")}},[e("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),e("el-form-item",{attrs:{label:"".concat(t.$t("内容"),":")}},[e("div",[e("MyTinymce",{ref:"myTinymce",attrs:{"tinymce-html":t.content},on:{changeDescription:t.changeDescription}})],1)]),e("el-form-item",{attrs:{label:"".concat(t.$t("标签"),":")}},[e("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),e("div",{staticClass:"right"},[e("SubTitle",{attrs:{title:t.$t("SEO设置")}}),e("el-form-item",{attrs:{prop:"seo_title",label:"Title:"}},[e("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),e("el-form-item",{attrs:{prop:"seo_keyword",label:"Keyword:"}},[e("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),e("el-form-item",{attrs:{prop:"seo_description",label:"Description:"}},[e("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),e("SubTitle",{attrs:{title:t.$t("其他信息")}}),e("el-form-item",{attrs:{prop:"author",label:"".concat(t.$t("作者"),":")}},[e("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),e("el-form-item",{attrs:{label:"".concat(t.$t("模板"),":")}},[e("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 e("el-option",{key:t.id,attrs:{label:t.file,value:t.file}})})),1)],1),e("el-form-item",{attrs:{prop:"url",label:"".concat(t.$t("跳转链接"),":")}},[e("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),e("el-form-item",{attrs:{label:"".concat(t.$t("发布时间"),":"),prop:"publish_time"}},[e("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),e("el-form-item",{attrs:{prop:"hits",label:"".concat(t.$t("浏览量"),":")}},[e("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),e("el-form-item",{attrs:{prop:"sort",label:"".concat(t.$t("排序"),":")}},[e("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),e("el-form-item",{attrs:{prop:"status",label:"".concat(t.$t("状态"),":")}},[e("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),e("el-form-item",{attrs:{prop:"is_top",label:"".concat(t.$t("是否置顶"),":")}},[e("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),e("el-form-item",{attrs:{prop:"is_recommend",label:"".concat(t.$t("是否推荐"),":")}},[e("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),e("el-form-item",{attrs:{size:"small",label:"".concat(t.$t("缩略图"),":")}},[e("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openList("thumbnail")}}},[t.addForm.sub_content.thumbnail?e("img",{staticClass:"attachmentImg",attrs:{src:t.thumbnailImg}}):e("i",{staticClass:"el-icon-camera"}),t.addForm.sub_content.thumbnail?e("span",{staticClass:"img-actions attachmentImg"},[e("span",{on:{click:function(e){return e.stopPropagation(),t.handleRemove(1)}}},[e("i",{staticClass:"el-icon-delete"})])]):t._e()]),e("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),e("el-form-item",{attrs:{label:"".concat(t.$t("详情页banner"),":")}},[e("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openList("cover")}}},[t.addForm.sub_content.cover?e("img",{staticClass:"attachmentImg",attrs:{src:t.coverImg}}):e("i",{staticClass:"el-icon-camera"}),t.addForm.sub_content.cover?e("span",{staticClass:"img-actions attachmentImg"},[e("span",{on:{click:function(e){return e.stopPropagation(),t.handleRemove(2)}}},[e("i",{staticClass:"el-icon-delete"})])]):t._e()])])],1)]),e("div",{staticStyle:{width:"100%"}},[e("SubTitle",{attrs:{title:t.$t("附加信息")}}),e("PublicForm",{ref:"PublicForm",attrs:{"form-obj":t.formObj,"form-data":t.formData,rules:t.mainRules}})],1),e("br"),e("div",{staticClass:"flexCenter"},[e("el-button",{staticClass:"tianBlue",attrs:{type:"primary"},on:{click:function(e){return t.onSubmit(3)}}},[t._v(" "+t._s(t.$t("暂存"))+" ")]),e("el-button",{attrs:{loading:t.loading,type:"primary"},on:{click:function(e){return t.onSubmit()}}},[t._v(" "+t._s(t.$t("提交"))+" ")]),e("el-button",{attrs:{loading:t.loading,type:"primary"},on:{click:function(e){return t.onSubmit(2)}}},[t._v(" "+t._s(t.$t("保存并继续"))+" ")])],1),e("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}}},[e("el-form",{attrs:{"label-position":"top"}},[e("el-form-item",{attrs:{label:"".concat(t.$t("文件"),":")}},[e("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}},[e("el-button",{attrs:{size:"small",type:"primary",icon:"el-icon-upload2"}},[t._v(" "+t._s(t.$t("批量上传"))+" ")])],1)],1),e("el-form-item",[e("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("c14f"),l=a("1da1"),c=a("5530"),u=(a("99af"),a("4de4"),a("7db0"),a("a15b"),a("14d9"),a("a434"),a("e9f5"),a("910d"),a("f665"),a("7d54"),a("d3b7"),a("07ac"),a("3ca3"),a("159b"),a("ddb0"),a("7632")),d=a("816b"),m=a("12de"),p=a("e2be"),f=a("d28d"),h=a("37cb"),b=a("2f62"),_={name:"AddArticle",components:{PublicForm:p["default"]},inject:["reload"],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(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()},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"])().m((function e(){var a;return Object(s["a"])().w((function(e){while(1)switch(e.n){case 0:if(!t.searchForm.site_id.length){e.n=2;break}return e.n=1,d["a"].getModuleCate({lang:t.lang,site_id:t.searchForm.site_id});case 1:a=e.v,t.columnList=a.data,e.n=3;break;case 2:t.columnList=[];case 3:return e.a(2)}}),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}).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.$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};f["a"].tagList(e).then((function(e){t.tagData=e.data}))},getWebList:function(){var t=this;return Object(l["a"])(Object(s["a"])().m((function e(){var a;return Object(s["a"])().w((function(e){while(1)switch(e.n){case 0:return e.n=1,h["a"].websiteList();case 1:a=e.v,t.getTreeData(a.data);case 2:return e.a(2)}}),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(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 a=this.$refs.PublicForm.$refs.myTinymce;a&&a.forEach((function(e){t.formData[e.prop]=e.codeValue})),this.$refs.form.validate((function(a){if(a){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(a){0==a.code&&(t.$message.success(a.msg),2!=e?t.prev():t.reload()),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}})}}},g=_,v=(a("5af3"),a("268e"),a("2877")),y=Object(v["a"])(g,o,i,!1,null,"25f20a59",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}},dec8:function(t,e,a){},e2be:function(t,e,a){"use strict";a.r(e);a("a4d3"),a("e01a"),a("b0c0");var o=function(){var t=this,e=t._self._c;return e("el-form",{ref:"ruleForm",staticClass:"flexForm",attrs:{model:t.formData,"label-position":"top"}},[e("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(a,o){return e("div",{directives:[{name:"show",rawName:"v-show",value:!a.notShow,expression:"!formobj.notShow"}],key:o,staticClass:"form-item"},[e("el-form-item",{attrs:{label:a.label,prop:a.prop,rules:a.rules}},[a.input?e("el-input",{attrs:{size:"small",placeholder:a.placeholder},on:{input:function(e){return t.inputINPUT(e,o,a.prop)},change:function(e){return t.inputChange(e,o,a.prop)}},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}}):t._e(),a.textarea?e("el-input",{attrs:{size:"small",type:"textarea",placeholder:a.placeholder},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}}):t._e(),a.reference?e("el-select",{attrs:{filterable:"",size:"small",placeholder:a.placeholder,multiple:a.multiple},on:{change:function(e){return t.selectChange(e,o,a.prop)}},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}},t._l(a.options,(function(t,o){return e("el-option",{key:o,attrs:{label:t.hc_main_title,value:t[a.relation_file]}})})),1):t._e(),a.select?e("el-select",{attrs:{size:"small",placeholder:a.placeholder},on:{change:function(e){return t.selectChange(e,o,a.prop)}},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}},t._l(a.options,(function(t,a){return e("el-option",{key:a,attrs:{label:t.label,value:t.label}})})),1):t._e(),a.multiSelect?e("el-select",{attrs:{size:"small",multiple:"",placeholder:a.placeholder},on:{change:function(e){return t.selectChange(e,o,a.prop)}},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}},t._l(a.options,(function(t,a){return e("el-option",{key:a,attrs:{label:t.label,value:t.label+""}})})),1):t._e(),a.date?e("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd",type:"date",size:"small",placeholder:a.placeholder},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}}):t._e(),a.time?e("el-time-picker",{attrs:{"value-format":"HH:mm:ss",format:"HH:mm:ss",size:"small",placeholder:a.placeholder},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}}):t._e(),a.datetime?e("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",size:"small",placeholder:a.placeholder},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}}):t._e(),a.dateTimeRange?e("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(e){return t.chooseTime(e,a.prop)}},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}}):t._e(),a.switch?e("el-switch",{attrs:{size:"small","active-value":a.options[0].label,"inactive-value":a.options[1].label,"active-text":a.options[0].label,"inactive-text":a.options[1].label,"active-color":"var(--huocms-com-color-primary)","inactive-color":"rgba(0,0,0,0.2)"},on:{change:function(e){return t.formSwitchChange(e,o,a.prop)}},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}}):t._e(),a.radio?e("el-radio-group",{model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}},t._l(a.options,(function(t,a){return e("el-radio",{key:a,attrs:{label:t.label,value:t.value}})})),1):t._e(),a.checkbox?e("el-checkbox-group",{on:{change:function(e){return t.changeCheck(e,o,a.prop)}},model:{value:t.formData[a.prop],callback:function(e){t.$set(t.formData,a.prop,e)},expression:"formData[formobj.prop]"}},t._l(a.options,(function(t,a){return e("el-checkbox",{key:a,attrs:{label:t.label}})})),1):t._e(),a.image?e("div",{staticClass:"upload"},[e("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openAttList(a.prop,a)}}},[t.formData[a.prop]?e("img",{staticClass:"attachmentImg",attrs:{src:a.IMGURL}}):e("i",{staticClass:"el-icon-camera"})])]):t._e(),a.multiImage?e("div",{staticClass:"attachmentBtn"},[t.formData[a.prop]?e("div",{staticClass:"multiBox"},[e("draggable",{attrs:{list:a.list},on:{end:function(e){return t.handleEnd(a.prop,a.list)}}},t._l(a.list,(function(o,i){return e("div",{key:i,staticClass:"multiBoxItem"},[e("img",{staticClass:"attachmentImg",attrs:{src:o.url}}),e("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"}}),e("i",{staticClass:"el-icon-circle-close",attrs:{type:"text"},on:{click:function(e){return t.delMultiImg(a.prop,a,o.id,i)}}})],1)})),0)],1):t._e(),e("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openAttList(a.prop,a)}}},[e("i",{staticClass:"el-icon-camera"})])]):t._e(),a.video?e("div",{staticClass:"attachmentBtn"},[t.formData[a.prop]?e("span",[t._v(t._s(a.name))]):t._e(),e("div",{staticStyle:{display:"inline-block"},on:{click:function(e){return t.openAttList(a.prop,a)}}},[t.formData[a.prop]?e("el-button",{staticClass:"blue",attrs:{type:"primary",size:"mini"}},[t._v(" "+t._s(t.$t("替换附件"))+" ")]):e("div",{staticClass:"attachment_imgBox"},[e("i",{staticClass:"el-icon-camera"})])],1)]):t._e(),a.file?e("div",{staticClass:"attachmentBtn"},[t.formData[a.prop]?e("span",[t._v(t._s(a.name))]):t._e(),e("div",{staticStyle:{display:"inline-block"},on:{click:function(e){return t.openAttList(a.prop,a)}}},[t.formData[a.prop]?e("el-button",{staticClass:"blue",attrs:{type:"primary",size:"mini"}},[t._v(" "+t._s(t.$t("替换附件"))+" ")]):e("div",{staticClass:"attachment_imgBox"},[e("i",{staticClass:"el-icon-document"})])],1)]):t._e(),a.multiVideo?e("div",{staticClass:"attachmentBtn"},[t.formData[a.prop]?e("div",{staticClass:"multiBox"},[e("draggable",{attrs:{list:a.list},on:{end:function(e){return t.handleEnd(a.prop,a.list)}}},t._l(a.list,(function(o,i){return e("div",{key:i,staticClass:"multiBoxItem"},[e("i",{staticClass:"el-icon-circle-close",attrs:{type:"text"},on:{click:function(e){return t.delMultiImg(a.prop,a,o.id,i)}}}),e("i",{staticClass:"el-icon-video-camera-solid"}),e("p",{staticClass:"fileName"},[t._v(t._s(o.name))])])})),0)],1):t._e(),e("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openAttList(a.prop,a)}}},[e("i",{staticClass:"el-icon-camera"})])]):t._e(),a.multiFile?e("div",{staticClass:"attachmentBtn"},[t.formData[a.prop]?e("div",{staticClass:"multiBox"},[e("draggable",{attrs:{list:a.list},on:{end:function(e){return t.handleEnd(a.prop,a.list)}}},t._l(a.list,(function(o,i){return e("div",{key:i,staticClass:"multiBoxItem"},[e("i",{staticClass:"el-icon-circle-close",attrs:{type:"text"},on:{click:function(e){return t.delMultiImg(a.prop,a,o.id,i)}}}),e("i",{staticClass:"el-icon-tickets"}),e("p",{staticClass:"fileName"},[t._v(t._s(o.name))])])})),0)],1):t._e(),e("div",{staticClass:"attachment_imgBox",on:{click:function(e){return t.openAttList(a.prop,a)}}},[e("i",{staticClass:"el-icon-document"})])]):t._e(),a.richText?e("div",{ref:a.prop,refInFor:!0},[e("div",[e("MyTinymce",{ref:"myTinymce",refInFor:!0,attrs:{prop:a.prop,"tinymce-html":t.content},on:{onClick:function(e){return t.input(a.prop)}}})],1)]):t._e()],1)],1)}))],2)},i=[],r=a("c14f"),n=a("1da1"),s=(a("c740"),a("d81d"),a("14d9"),a("a434"),a("e9f5"),a("7d54"),a("ab43"),a("d3b7"),a("25f0"),a("159b"),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:{handleEnd:function(t,e){this.formData[t]=e.map((function(t){return t.id}))},changeDesc:function(t){return Object(n["a"])(Object(r["a"])().m((function e(){return Object(r["a"])().w((function(e){while(1)switch(e.n){case 0:return e.n=1,s["a"].attachmentUpdate(t);case 1:e.v;case 2:return e.a(2)}}),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}}},d=u,m=(a("e38e"),a("bf5b"),a("2877")),p=Object(m["a"])(d,o,i,!1,null,"2f22aac9",null);e["default"]=p.exports},e38e:function(t,e,a){"use strict";a("e8d0")},e8d0:function(t,e,a){}}]);
|