You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sonic/resources/admin/js/562.19d46808.js

1 line
12 KiB
JavaScript

(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[562],{79174:function(e,t,r){var a=r(79644),n=r(61746);a({target:"Object",stat:!0},{hasOwn:n})},64346:function(e,t,r){"use strict";r.d(t,{Z:function(){return u}});var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-tree-select",{attrs:{allowClear:!0,treeData:e.categoryTreeData,treeDataSimpleMode:!0,placeholder:"请选择上级目录,默认为顶级目录",treeDefaultExpandAll:"","dropdown-style":{overflow:"auto"}},on:{change:e.handleChange},model:{value:e.categoryIdString,callback:function(t){e.categoryIdString=t},expression:"categoryIdString"}})},n=[],o=r(22373),i=r(23222),l=(r(12566),r(41479),r(31875),r(11074),r(18482),r(21082),r(79174),{name:"CategorySelectTree",props:{categoryId:{type:Number,required:!0,default:0},categories:{type:Array,required:!1,default:function(){return[]}},root:{type:Object,required:!1,default:function(){return{id:0,title:"根目录",value:"0",pId:-1}}}},computed:{categoryTreeData:function(){return[this.root].concat((0,i.Z)(this.convertDataToTree(this.categories)))},categoryIdString:{get:function(){return this.categoryId.toString()},set:function(e){this.$emit("update:categoryId",e?parseInt(e):0)}}},methods:{handleChange:function(){this.$emit("change")},convertDataToTree:function(e){var t={},r=[];e.forEach((function(e){return t[e.id]=(0,o.Z)((0,o.Z)({},e),{},{title:e.name,value:e.id.toString(),pId:e.parentId,children:[]})})),e.forEach((function(e){var a=t[e.id];e.parentId?t[e.parentId].children.push(a):r.push(a)}));var a=function e(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.forEach((function(t){t.hasPassword=!!t.password||r,t.hasPassword&&(t.title="".concat(t.title,"(加密)")),Object.hasOwn(t,"postCount")&&(t.title="".concat(t.title," - ").concat(t.postCount," 篇")),t.children&&t.children.length&&e(t.children,t.hasPassword)}))};return a(r),r}}}),s=l,c=r(70739),d=(0,c.Z)(s,a,n,!1,null,null,null),u=d.exports},47562:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return I}});var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("page-view",[r("a-row",{attrs:{gutter:12}},[r("a-col",{staticClass:"pb-3",attrs:{lg:8,md:8,sm:24,xl:8,xs:24}},[r("a-card",{attrs:{bodyStyle:{padding:"16px"},"head-style":{padding:"8px 16px!important"},title:e.title}},[r("a-form-model",{ref:"categoryForm",attrs:{model:e.form.model,rules:e.form.rules,layout:"horizontal"}},[r("a-form-model-item",{attrs:{help:"* 页面上所显示的名称",label:"名称:",prop:"name"}},[r("a-input",{ref:"nameInput",model:{value:e.form.model.name,callback:function(t){e.$set(e.form.model,"name",t)},expression:"form.model.name"}})],1),r("a-form-model-item",{attrs:{help:"* 一般为单个分类页面的标识,最好为英文",label:"别名:",prop:"slug"}},[r("a-input",{model:{value:e.form.model.slug,callback:function(t){e.$set(e.form.model,"slug",t)},expression:"form.model.slug"}})],1),r("a-form-model-item",{attrs:{label:"上级目录:",prop:"parentId"}},[r("category-select-tree",{attrs:{categories:e.list.data,"category-id":e.form.model.parentId},on:{"update:categoryId":function(t){return e.$set(e.form.model,"parentId",t)},"update:category-id":function(t){return e.$set(e.form.model,"parentId",t)}}})],1),r("a-form-model-item",{attrs:{help:"* 在分类页面可展示,需要主题支持",label:"封面图:",prop:"thumbnail"}},[r("AttachmentInput",{attrs:{title:"选择封面图"},model:{value:e.form.model.thumbnail,callback:function(t){e.$set(e.form.model,"thumbnail",t)},expression:"form.model.thumbnail"}})],1),r("a-form-model-item",{attrs:{help:"* 分类密码",label:"密码:",prop:"password"}},[r("a-input-password",{attrs:{autocomplete:"new-password"},model:{value:e.form.model.password,callback:function(t){e.$set(e.form.model,"password",t)},expression:"form.model.password"}})],1),r("a-form-model-item",{attrs:{help:"* 分类描述,需要主题支持",label:"描述:",prop:"description"}},[r("a-input",{attrs:{autoSize:{minRows:3},type:"textarea"},model:{value:e.form.model.descri