(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-14e20d16"],{"263f":function(e,t,r){"use strict";r.d(t,"e",(function(){return l})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return a})),r.d(t,"f",(function(){return i})),r.d(t,"c",(function(){return n})),r.d(t,"g",(function(){return c})),r.d(t,"j",(function(){return u})),r.d(t,"i",(function(){return m})),r.d(t,"k",(function(){return f})),r.d(t,"h",(function(){return p})),r.d(t,"l",(function(){return d})),r.d(t,"a",(function(){return b}));var o=r("6b2d");const l=e=>o.a.get("/user.labelGroup/list",{params:e}),s=e=>o.a.post("/user.labelGroup/create",e),a=e=>o.a.get("/user.labelGroup/detail",{params:e}),i=e=>o.a.post("/user.labelGroup/update",e),n=e=>o.a.get("/user.labelGroup/del",{params:e}),c=e=>o.a.post("/user.labelItem/create",e),u=e=>o.a.get("/user.labelItem/list",{params:e}),m=e=>o.a.get("/user.labelItem/detail",{params:e}),f=e=>o.a.post("/user.labelItem/update",e),p=e=>o.a.get("/user.labelItem/del",{params:e}),d=e=>o.a.post("/settings.user.userLabel/setConfig",e),b=e=>o.a.get("/settings.user.userLabel/getConfig",{params:e})},"529f":function(e,t,r){"use strict";r.r(t);var o=r("263f"),l=r("b3ad"),s=(r("b6c4"),{data:()=>({form:{name:"",group_id:null,color_type:0,color:"",color1:"",color2:"",sort:""},typeList:[],showSelect:!0,showTitle:""}),components:{MaterialSelect:l.a},methods:{submitForm(e){this.$refs[e].validate(e=>{if(!e)return!1;this.addLabel()})},getAllTypes(){Object(o.e)().then(e=>{this.typeList=e.data})},addLabel(){var e="";0==this.form.color_type&&(e=this.form.color),1==this.form.color_type&&(e=this.form.color1+","+this.form.color2),Object(o.g)({group_id:this.form.group_id,name:this.form.name,color_type:this.form.color_type,color:e,sort:this.form.sort}).then(e=>{1==e.code?(this.$message.success("创建成功!"),setTimeout(()=>this.$router.go(-1),500)):this.$message.error(e.msg)})}},mounted(){this.getAllTypes()},created(){const e=this.$route.query;this.showTitle=e.gid,null!=this.showTitle&&(this.form.group_id=parseInt(this.showTitle),this.showSelect=!1)}}),a=r("2877"),i=Object(a.a)(s,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("div",{staticClass:"ls-card m-t-16"},[r("div",{staticClass:"card-title"},[e._v("新建标签")]),r("div",{staticClass:"card-content m-t-24"},[r("el-form",{ref:"form",attrs:{model:e.form,"label-width":"100px"}},[r("el-form-item",{attrs:{required:"",prop:"name",label:"标签名称"}},[r("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),r("el-form-item",{attrs:{required:"",prop:"group_id",label:"标签类型"}},[r("el-select",{attrs:{disabled:0==e.showSelect,placeholder:"请选择"},model:{value:e.form.group_id,callback:function(t){e.$set(e.form,"group_id",t)},expression:"form.group_id"}},e._l(e.typeList,(function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),r("el-form-item",{attrs:{prop:"color_type",label:"标签颜色类型"}},[r("el-radio-group",{model:{value:e.form.color_type,callback:function(t){e.$set(e.form,"color_type",t)},expression:"form.color_type"}},[r("el-radio",{attrs:{label:0}},[e._v("单色")]),r("el-radio",{attrs:{label:1}},[e._v("渐变")])],1)],1),r("el-form-item",{attrs:{prop:"color",label:"标签颜色"}},[r("div",{staticStyle:{display:"flex","flex-direction":"column","align-items":"flex-start"}},[0==e.form.color_type?r("el-color-picker",{model:{value:e.form.color,callback:function(t){e.$set(e.form,"color",t)},expression:"form.color"}}):e._e(),1==e.form.color_type?r("div",{staticStyle:{display:"flex","align-items":"flex-start"}},[r("span",[e._v("从")]),r("el-color-picker",{staticStyle:{margin:"0 10px"},model:{value:e.form.color1,callback:function(t){e.$set(e.form,"color1",t)},expression:"form.color1"}}),r("span",[e._v("到")]),r("el-color-picker",{staticStyle:{margin:"0 10px"},model:{value:e.form.color2,callback:function(t){e.$set(e.form,"color2",t)},expression:"form.color2"}}),r("span",[e._v("渐变")])],1):e._e(),r("el-link",{attrs:{href:"https://uigradients.com/",target:"_blank"}},[e._v("推荐色彩库")])],1)]),r("el-form-item",{attrs:{required:"",prop:"sort",label:"标签排序"}},[r("el-input",{model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1)],1)],1)]),r("div",{staticClass:"bg-white ls-fixed-footer"},[r("div",{staticClass:"row-center flex",staticStyle:{height:"100%"}},[r("el-button",{attrs:{size:"small"},on:{click:function(t){return e.$router.go(-1)}}},[e._v("取消")]),r("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(t){return e.submitForm("form")}}},[e._v("新建")])],1)])])}),[],!1,null,null,null);t.default=i.exports}}]);