select-tag-legacy.60962399.js 5.8 KB

1
  1. !function(){var e=["exquisiteFlag","defaultValue"];function t(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,a=function(){};return{s:a,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,l=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw l}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var i=document.createElement("style");i.innerHTML="._select_ku3kj_1{padding:0 .42667rem;height:100%;display:flex;flex-direction:column}._select_ku3kj_1>div{flex:1;overflow:hidden;overflow-y:auto}._select_ku3kj_1>footer{padding:.26667rem 0;display:flex;justify-content:space-between}._title_ku3kj_17{font-size:.48rem;font-weight:700;color:#000;padding-top:.50667rem;text-align:center}._tit_ku3kj_17{color:#333;line-height:.58667rem;font-size:.42667rem;margin:.26667rem 0 .53333rem}._childContent_ku3kj_31{display:flex;flex-wrap:wrap;text-align:center}._childContent_ku3kj_31 ._item_ku3kj_36{display:block;margin-right:.13333rem;margin-bottom:.26667rem;min-width:2.13333rem;height:.85333rem}._childContent_ku3kj_31 ._item_ku3kj_36:nth-child(4n + 0){margin-right:0}._radio-group_ku3kj_46{display:flex;margin-top:.37333rem}._radio-group_ku3kj_46 ._radio_ku3kj_46:first-child .van-radio__label{margin-left:0}._radio_ku3kj_46{box-sizing:border-box}._radio_ku3kj_46 .van-radio__icon,._radio_ku3kj_46 .van-checkbox__icon{display:none}._radio_ku3kj_46 .van-checkbox__label{margin-left:0}._radio_ku3kj_46 .van-tag--large{font-size:.37333rem;text-align:center;display:flex;align-items:center;justify-content:center}._radio_ku3kj_46 .van-tag{box-sizing:border-box}._btn_ku3kj_73{width:4.37333rem}\n",document.head.appendChild(i),System.register(["./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.bbc2b10e.js","./index-legacy.a85d660d.js","./index-legacy.5e551733.js","./index-legacy.4e5c868b.js","./index-legacy.6e10cd37.js","./index-legacy.af745e4d.js"],(function(n){"use strict";var i,a,l,o,u,c,d,f,s,_,p,m,g,k,y;return{setters:[function(e){i=e.d,a=e.j,l=e.A,o=e.g,u=e.y,c=e.U,d=e.a3,f=e.a8,s=e.T,_=e.B},function(e){p=e.c},function(e){m=e.T},function(e){g=e.C},function(){},function(e){k=e.c},function(e){y=e.C}],execute:function(){var v={select:"_select_ku3kj_1",title:"_title_ku3kj_17",tit:"_tit_ku3kj_17",childContent:"_childContent_ku3kj_31",item:"_item_ku3kj_36","radio-group":"_radio-group_ku3kj_46",radio:"_radio_ku3kj_46",btn:"_btn_ku3kj_73"},h=i({name:"SelectTagChild",props:{child:{type:Array,default:function(){return[]}},onSelect:{type:Function,default:function(){}},rowSingle:{type:Boolean,default:!1},needAllButton:{type:Boolean,default:!0}},setup:function(e,t){var n=e.child,r=e.onSelect,i=e.needAllButton,o=e.rowSingle,u=t.attrs;return function(){var e=u.selected;return a(y,{class:k(v.childContent,v["radio-group"]),modelValue:e,"onUpdate:modelValue":function(e){r(e)}},{default:function(){return[i&&a(g,{name:0,class:v.radio,onClick:function(){return r([])}},{default:function(){return[a(m,{class:k(v.item,"van-ellipsis"),type:"primary",plain:0!==e.length,round:!0,size:"large"},{default:function(){return[l("全部")]}})]}}),n.map((function(t){return a(g,{key:t.id,name:t.id,class:v.radio,onClick:function(){o&&r([t.id])}},{default:function(){return[a(m,{class:k(v.item,"van-ellipsis"),plain:!e.includes(t.id),type:"primary",round:!0,size:"large"},{default:function(){return[t.name]}})]}})}))]}})}}});n("S",i({name:"SelectTag",props:{defaultValue:{type:String,default:""},rowSingle:{type:Boolean,default:!1},exquisiteFlag:{type:Boolean,default:!1},needAllButton:{type:Boolean,default:!0}},emits:["cancel","confirm"],setup:function(n,i){n.exquisiteFlag;var m=n.defaultValue,g=r(n,e),k=i.emit,y=i.expose,j="STUDENT"===o.platformType?"/api-student":"/api-teacher",b=p(u(j+"/MusicTag/tree"),null),x=(b.isLoading,b.state),S=function(){w.value=[],k("cancel")};(m||"").split(",").map((function(e){return Number(e)}));var w=c([]),C={};return d(x,(function(){if(x.value){var e,n=t(x.value&&x.value.data||[]);try{for(n.s();!(e=n.n()).done;){var r=e.value;C[r.id]=r.name}}catch(i){n.e(i)}finally{n.f()}}})),y({resetTags:S}),function(){var e=x.value&&x.value.data||[];return a("div",{class:v.select},[a("h4",{class:v.title},[l("全部标签")]),a("div",{class:v.content},[e.length>0&&a("div",{class:v.list},[a(h,f({selected:w.value||[],child:e||[],onSelect:function(e){w.value.length>=3?s("最多只能选3个标签"):setTimeout((function(){e.forEach((function(e){w.value.includes(e)||w.value.push(e)}))}),100)}},g),null)])]),a("footer",{class:"van-safe-area-bottom van-hairline--top"},[a(_,{class:v.btn,round:!0,onClick:S},{default:function(){return[l("重置")]}}),a(_,{class:v.btn,type:"primary",round:!0,onClick:function(){return k("confirm",w.value,C)}},{default:function(){return[l("确认")]}})])])}}}))}}}))}();