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/271.b3cc41fe.js

1 line
5.8 KiB
JavaScript

"use strict";(self["webpackChunkhalo_admin"]=self["webpackChunkhalo_admin"]||[]).push([[271],{68271:function(e,t,a){a.r(t),a.d(t,{default:function(){return p}});var r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("page-view",[a("a-row",{attrs:{gutter:12}},[a("a-col",{staticClass:"pb-3",attrs:{lg:10,md:10,sm:24,xl:10,xs:24}},[a("a-card",{attrs:{bodyStyle:{padding:"16px"},title:e.title}},[a("a-form-model",{ref:"tagForm",attrs:{model:e.form.model,rules:e.form.rules,layout:"horizontal"}},[a("a-form-model-item",{attrs:{help:"* 页面上所显示的名称",label:"名称:",prop:"name"}},[a("a-input",{model:{value:e.form.model.name,callback:function(t){e.$set(e.form.model,"name",t)},expression:"form.model.name"}})],1),a("a-form-model-item",{attrs:{help:"* 一般为单个标签页面的标识,最好为英文",label:"别名:",prop:"slug"}},[a("a-input",{model:{value:e.form.model.slug,callback:function(t){e.$set(e.form.model,"slug",t)},expression:"form.model.slug"}})],1),a("a-form-model-item",{attrs:{label:"颜色:",prop:"color"}},[a("a-input",{scopedSlots:e._u([{key:"addonAfter",fn:function(){return[a("verte",{staticStyle:{cursor:"pointer"},attrs:{model:"hex",picker:"square"},model:{value:e.form.model.color,callback:function(t){e.$set(e.form.model,"color",t)},expression:"form.model.color"}})]},proxy:!0}]),model:{value:e.form.model.color,callback:function(t){e.$set(e.form.model,"color",t)},expression:"form.model.color"}})],1),a("a-form-model-item",{attrs:{help:"* 在标签页面可展示,需要主题支持",label:"封面图:",prop:"thumbnail"}},[a("AttachmentInput",{attrs:{title:"选择封面图"},model:{value:e.form.model.thumbnail,callback:function(t){e.$set(e.form.model,"thumbnail",t)},expression:"form.model.thumbnail"}})],1),a("a-form-model-item",[e.isUpdateMode?a("a-button-group",[a("ReactiveButton",{attrs:{errored:e.form.errored,loading:e.form.saving,erroredText:"更新失败",loadedText:"更新成功",text:"更新",type:"primary"},on:{callback:e.handleSavedCallback,click:e.handleCreateOrUpdateTag}}),a("a-button",{attrs:{type:"dashed"},on:{click:function(t){e.form.model={}}}},[e._v("返回添加")])],1):a("ReactiveButton",{attrs:{errored:e.form.errored,loading:e.form.saving,erroredText:"保存失败",loadedText:"保存成功",text:"保存",type:"primary"},on:{callback:e.handleSavedCallback,click:e.handleCreateOrUpdateTag}}),e.isUpdateMode?a("a-popconfirm",{attrs:{title:"你确定要删除【"+e.form.model.name+"】标签?",cancelText:"取消",okText:"确定"},on:{confirm:function(t){return e.handleDeleteTag(e.form.model.id)}}},[a("a-button",{staticClass:"float-right",attrs:{type:"danger"}},[e._v("删除")])],1):e._e()],1)],1)],1)],1),a("a-col",{staticClass:"pb-3",attrs:{lg:14,md:14,sm:24,xl:14,xs:24}},[a("a-card",{attrs:{bodyStyle:{padding:"16px"},title:"所有标签"},scopedSlots:e._u([{key:"extra",fn:function(){return[a("a",{staticClass:"p-0 m-0",attrs:{href:"javascript:void(0)"},on:{click:e.handleCleanup}},[e._v("清理未使用标签")])]},proxy:!0}])},[a("a-spin",{attrs:{spinning:e.list.loading}},[0===e.list.data.length?a("a-empty"):e._e(),e._l(e.list.data,(function(t){return a("post-tag",{key:t.id,staticStyle:{"margin-bottom":"8px",cursor:"pointer"},attrs:{tag:t},nativeOn:{click:function(a){return e.handleEdit(t)}}})}))],2)],1)],1)],1)],1)},o=[],n=a(54288),l=(a(70315),a(31875),a(90195),a(82395),a(29888),a(45107),a(96667)),i=a(36591),s=a(37750),d=a(43154),m={components:{PageView:l.B4,Verte:d.Z},data:function(){return{list:{data:[],loading:!1},form:{model:{color:"#cfd3d7"},saving:!1,errored:!1,rules:{name:[{required:!0,message:"* 标签名称不能为空",trigger:["change"]},{max:255,message:"* 标签名称的字符长度不能超过 255",trigger:["change"]}],slug:[{max:255,message:"* 标签别名的字符长度不能超过 255",trigger:["change"]}],thumbnail:[{max:1023,message:"* 封面图链接的字符长度不能超过 1023",trigger:["change"]}],color:[{max:7,pattern:s.aX,message:"仅支持 hex 颜色值"}]}}}},computed:{title:function(){return this.isUpdateMode?"修改标签":"<EFBFBD><EFBFBD>