39 lines
26 KiB
JavaScript
39 lines
26 KiB
JavaScript
(self["webpackChunkwordhelper"]=self["webpackChunkwordhelper"]||[]).push([[211],{1576:function(e){!function(t,n){e.exports=n()}(0,function(){"use strict";var e=1e3,t=6e4,n=36e5,a="millisecond",r="second",i="minute",s="hour",l="day",o="week",u="month",c="quarter",d="year",f="date",v="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},y=function(e,t,n){var a=String(e);return!a||a.length>=t?e:""+Array(t+1-a.length).join(n)+e},g={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),a=Math.floor(n/60),r=n%60;return(t<=0?"+":"-")+y(a,2,"0")+":"+y(r,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var a=12*(n.year()-t.year())+(n.month()-t.month()),r=t.clone().add(a,u),i=n-r<0,s=t.clone().add(a+(i?-1:1),u);return+(-(a+(n-r)/(i?r-s:s-r))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:d,w:o,d:l,D:f,h:s,m:i,s:r,ms:a,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},k="en",x={};x[k]=m;var b="$isDayjsObject",w=function(e){return e instanceof A||!(!e||!e[b])},_=function e(t,n,a){var r;if(!t)return k;if("string"==typeof t){var i=t.toLowerCase();x[i]&&(r=i),n&&(x[i]=n,r=i);var s=t.split("-");if(!r&&s.length>1)return e(s[0])}else{var l=t.name;x[l]=t,r=l}return!a&&r&&(k=r),r||!a&&k},$=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new A(n)},R=g;R.l=_,R.i=w,R.w=function(e,t){return $(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var A=function(){function m(e){this.$L=_(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[b]=!0}var y=m.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(R.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var a=t.match(h);if(a){var r=a[2]-1||0,i=(a[7]||"0").substring(0,3);return n?new Date(Date.UTC(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,i)):new Date(a[1],r,a[3]||1,a[4]||0,a[5]||0,a[6]||0,i)}}return new Date(t)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return R},y.isValid=function(){return!(this.$d.toString()===v)},y.isSame=function(e,t){var n=$(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return $(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<$(e)},y.$g=function(e,t,n){return R.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,a=!!R.u(t)||t,c=R.p(e),v=function(e,t){var r=R.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return a?r:r.endOf(l)},h=function(e,t){return R.w(n.toDate()[e].apply(n.toDate("s"),(a?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},p=this.$W,m=this.$M,y=this.$D,g="set"+(this.$u?"UTC":"");switch(c){case d:return a?v(1,0):v(31,11);case u:return a?v(1,m):v(0,m+1);case o:var k=this.$locale().weekStart||0,x=(p<k?p+7:p)-k;return v(a?y-x:y+(6-x),m);case l:case f:return h(g+"Hours",0);case s:return h(g+"Minutes",1);case i:return h(g+"Seconds",2);case r:return h(g+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var n,o=R.p(e),c="set"+(this.$u?"UTC":""),v=(n={},n[l]=c+"Date",n[f]=c+"Date",n[u]=c+"Month",n[d]=c+"FullYear",n[s]=c+"Hours",n[i]=c+"Minutes",n[r]=c+"Seconds",n[a]=c+"Milliseconds",n)[o],h=o===l?this.$D+(t-this.$W):t;if(o===u||o===d){var p=this.clone().set(f,1);p.$d[v](h),p.init(),this.$d=p.set(f,Math.min(this.$D,p.daysInMonth())).$d}else v&&this.$d[v](h);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[R.p(e)]()},y.add=function(a,c){var f,v=this;a=Number(a);var h=R.p(c),p=function(e){var t=$(v);return R.w(t.date(t.date()+Math.round(e*a)),v)};if(h===u)return this.set(u,this.$M+a);if(h===d)return this.set(d,this.$y+a);if(h===l)return p(1);if(h===o)return p(7);var m=(f={},f[i]=t,f[s]=n,f[r]=e,f)[h]||1,y=this.$d.getTime()+a*m;return R.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||v;var a=e||"YYYY-MM-DDTHH:mm:ssZ",r=R.z(this),i=this.$H,s=this.$m,l=this.$M,o=n.weekdays,u=n.months,c=n.meridiem,d=function(e,n,r,i){return e&&(e[n]||e(t,a))||r[n].slice(0,i)},f=function(e){return R.s(i%12||12,e,"0")},h=c||function(e,t,n){var a=e<12?"AM":"PM";return n?a.toLowerCase():a};return a.replace(p,function(e,a){return a||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return R.s(t.$y,4,"0");case"M":return l+1;case"MM":return R.s(l+1,2,"0");case"MMM":return d(n.monthsShort,l,u,3);case"MMMM":return d(u,l);case"D":return t.$D;case"DD":return R.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return d(n.weekdaysMin,t.$W,o,2);case"ddd":return d(n.weekdaysShort,t.$W,o,3);case"dddd":return o[t.$W];case"H":return String(i);case"HH":return R.s(i,2,"0");case"h":return f(1);case"hh":return f(2);case"a":return h(i,s,!0);case"A":return h(i,s,!1);case"m":return String(s);case"mm":return R.s(s,2,"0");case"s":return String(t.$s);case"ss":return R.s(t.$s,2,"0");case"SSS":return R.s(t.$ms,3,"0");case"Z":return r}return null}(e)||r.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(a,f,v){var h,p=this,m=R.p(f),y=$(a),g=(y.utcOffset()-this.utcOffset())*t,k=this-y,x=function(){return R.m(p,y)};switch(m){case d:h=x()/12;break;case u:h=x();break;case c:h=x()/3;break;case o:h=(k-g)/6048e5;break;case l:h=(k-g)/864e5;break;case s:h=k/n;break;case i:h=k/t;break;case r:h=k/e;break;default:h=k}return v?h:R.a(h)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return x[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),a=_(e,t,!0);return a&&(n.$L=a),n},y.clone=function(){return R.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},m}(),C=A.prototype;return $.prototype=C,[["$ms",a],["$s",r],["$m",i],["$H",s],["$W",l],["$M",u],["$y",d],["$D",f]].forEach(function(e){C[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),$.extend=function(e,t){return e.$i||(e(t,A,$),e.$i=!0),$},$.locale=_,$.isDayjs=w,$.unix=function(e){return $(1e3*e)},$.en=x[k],$.Ls=x,$.p={},$})},19629:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});var a=n(45525);
|
||
/**
|
||
* @license lucide-vue-next v0.562.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r=(0,a.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},55727:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});var a=n(45525);
|
||
/**
|
||
* @license lucide-vue-next v0.562.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r=(0,a.A)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},62784:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});var a=n(45525);
|
||
/**
|
||
* @license lucide-vue-next v0.562.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r=(0,a.A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},71168:function(e,t,n){"use strict";n.d(t,{A:function(){return C}});var a=n(56768),r=n(90144),i=n(79882),s=n(88733),l=n(37901),o=n(86866),u=n(91462),c=n(36921),d=n(29767),f=n(77727);const v=(0,f.D)("n-popconfirm");var h=n(84279),p=n(73921),m=n(82813),y=n(25216),g=n(52126),k=n(25972),x=n(54880);const b={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},w=(0,g.Y)(b);var _=(0,a.pM)({name:"NPopconfirmPanel",props:b,setup(e){const{localeRef:t}=(0,m.A)("Popconfirm"),{inlineThemeDisabled:n}=(0,s.Ay)(),{mergedClsPrefixRef:i,mergedThemeRef:l,props:o}=(0,a.WQ)(v),u=(0,a.EW)(()=>{const{common:{cubicBezierEaseInOut:e},self:{fontSize:t,iconSize:n,iconColor:a}}=l.value;return{"--n-bezier":e,"--n-font-size":t,"--n-icon-size":n,"--n-icon-color":a}}),c=n?(0,y.R)("popconfirm-panel",void 0,u,o):void 0;return Object.assign(Object.assign({},(0,m.A)("Popconfirm")),{mergedClsPrefix:i,cssVars:n?void 0:u,localizedPositiveText:(0,a.EW)(()=>e.positiveText||t.value.positiveText),localizedNegativeText:(0,a.EW)(()=>e.negativeText||t.value.negativeText),positiveButtonProps:(0,r.lW)(o,"positiveButtonProps"),negativeButtonProps:(0,r.lW)(o,"negativeButtonProps"),handlePositiveClick(t){e.onPositiveClick(t)},handleNegativeClick(t){e.onNegativeClick(t)},themeClass:null===c||void 0===c?void 0:c.themeClass,onRender:null===c||void 0===c?void 0:c.onRender})},render(){var e;const{mergedClsPrefix:t,showIcon:n,$slots:r}=this,i=(0,k.Nj)(r.action,()=>null===this.negativeText&&null===this.positiveText?[]:[null!==this.negativeText&&(0,a.h)(x.Ay,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),null!==this.positiveText&&(0,a.h)(x.Ay,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return null===(e=this.onRender)||void 0===e||e.call(this),(0,a.h)("div",{class:[`${t}-popconfirm__panel`,this.themeClass],style:this.cssVars},(0,k.iQ)(r.default,e=>n||e?(0,a.h)("div",{class:`${t}-popconfirm__body`},n?(0,a.h)("div",{class:`${t}-popconfirm__icon`},(0,k.Nj)(r.icon,()=>[(0,a.h)(h.A,{clsPrefix:t},{default:()=>(0,a.h)(p.A,null)})])):null,e):null),i?(0,a.h)("div",{class:[`${t}-popconfirm__action`]},i):null)}}),$=n(34350),R=(0,$.cB)("popconfirm",[(0,$.cE)("body","\n font-size: var(--n-font-size);\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n position: relative;\n ",[(0,$.cE)("icon","\n display: flex;\n font-size: var(--n-icon-size);\n color: var(--n-icon-color);\n transition: color .3s var(--n-bezier);\n margin: 0 8px 0 0;\n ")]),(0,$.cE)("action","\n display: flex;\n justify-content: flex-end;\n ",[(0,$.c)("&:not(:first-child)","margin-top: 8px"),(0,$.cB)("button",[(0,$.c)("&:not(:last-child)","margin-right: 8px;")])])]);const A=Object.assign(Object.assign(Object.assign({},i.A.props),c.vY),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function});var C=(0,a.pM)({name:"Popconfirm",props:A,slots:Object,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=(0,s.Ay)(),n=(0,i.A)("Popconfirm","-popconfirm",R,d.A,e,t),o=(0,r.KR)(null);function u(t){var n;if(!(null===(n=o.value)||void 0===n?void 0:n.getMergedShow()))return;const{onPositiveClick:a,"onUpdate:show":r}=e;Promise.resolve(!a||a(t)).then(e=>{var t;!1!==e&&(null===(t=o.value)||void 0===t||t.setShow(!1),r&&(0,l.T)(r,!1))})}function c(t){var n;if(!(null===(n=o.value)||void 0===n?void 0:n.getMergedShow()))return;const{onNegativeClick:a,"onUpdate:show":r}=e;Promise.resolve(!a||a(t)).then(e=>{var t;!1!==e&&(null===(t=o.value)||void 0===t||t.setShow(!1),r&&(0,l.T)(r,!1))})}(0,a.Gt)(v,{mergedThemeRef:n,mergedClsPrefixRef:t,props:e});const f={setShow(e){var t;null===(t=o.value)||void 0===t||t.setShow(e)},syncPosition(){var e;null===(e=o.value)||void 0===e||e.syncPosition()},mergedTheme:n,popoverInstRef:o,handlePositiveClick:u,handleNegativeClick:c};return f},render(){const{$slots:e,$props:t,mergedTheme:n}=this;return(0,a.h)(c.Ay,Object.assign({},(0,o.c)(t,w),{theme:n.peers.Popover,themeOverrides:n.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.trigger,default:()=>{const n=(0,u.a)(t,w);return(0,a.h)(_,Object.assign({},n,{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}})},91733:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});var a=n(45525);
|
||
/**
|
||
* @license lucide-vue-next v0.562.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r=(0,a.A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},92211:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return oe}});n(44114),n(18111),n(22489),n(61701),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var a=n(56768),r=n(90144),i=n(45130),s=n(24232),l=n(98728),o=n(97387),u=n(93913),c=n(59856),d=n(54880),f=n(43585),v=n(68042),h=n(9845),p=n(42517),m=n(92720),y=n(71168),g=n(8508),k=n(58911),x=n(52384),b=n(64498),w=n(19605),_=n(35720),$=n(57273),R=n(18169),A=n(19629),C=n(91733),M=n(55727),S=n(45525);
|
||
/**
|
||
* @license lucide-vue-next v0.562.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/
|
||
const F=(0,S.A)("import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);var z=n(96530),D=n(62784),j=n(1576),P=n.n(j);const O={class:"page-container max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},T={class:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-8",initial:{opacity:0,y:-20},enter:{opacity:1,y:0}},L={class:"flex items-center gap-3 mb-2"},W={class:"flex flex-col sm:flex-row items-start sm:items-center gap-4"},I={class:"flex items-center gap-2 w-full sm:w-auto"},K={class:"flex items-center gap-2 bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-sm border border-gray-100 dark:border-gray-700"},N={key:0,class:"flex justify-center py-12"},E={key:1,class:"flex flex-col items-center justify-center py-16 text-center"},Y={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},B={class:"flex items-start justify-between gap-2"},H={class:"flex-1 min-w-0"},q=["title"],U={class:"flex-1 flex flex-col gap-4"},X={class:"text-gray-500 dark:text-gray-400 text-sm line-clamp-2 h-10"},V={class:"flex items-center justify-between mt-auto pt-4 border-t border-gray-50 dark:border-gray-800"},J={class:"flex items-center gap-4 text-xs text-gray-400"},Q={class:"flex items-center gap-1"},Z={class:"flex items-center gap-1"},G={key:3,class:"flex justify-center mt-8"},ee={key:1,class:"text-gray-400 text-sm"},te={class:"flex justify-end gap-3"},ne={class:"space-y-4"},ae={class:"mt-1 text-xs text-gray-500 text-right"},re={class:"flex justify-end gap-3"};var ie={__name:"ListsView",setup(e){const t=(0,l.rd)(),n=(0,o.J)(),S=(0,r.KR)([]),j=(0,r.KR)(!1),ie=(0,r.KR)(1),se=(0,r.KR)(!0),le=(0,r.KR)(!1),oe=(0,r.KR)(!1),ue=(0,r.KR)(""),ce=(0,r.KR)(!1),de=(0,r.KR)("create"),fe=(0,r.KR)(!1),ve=(0,r.KR)(null),he=(0,r.Kh)({id:null,name:"",note:""}),pe=(0,r.KR)(!1),me=(0,r.KR)(!1),ye=(0,r.KR)(!1),ge=(0,r.KR)([]),ke=(0,r.Kh)({listId:null,wordIds:[]}),xe={name:{required:!0,message:"请输入词单名称",trigger:["blur","input"]}},be=e=>P()(e).format("YYYY-MM-DD"),we=async(e=!1)=>{if(!j.value){j.value=!0;try{const t=await _.A.get("https://newfront.xn--xhq44jb2fzpc.com/word_helper/word_list/list",{params:{page:ie.value,limit:9,own:le.value,search:ue.value}}),n=t.data.data||t.data,a=n.list||[],r=n.pagination||{};oe.value=!!n.admin,S.value=e?[...S.value,...a]:a,se.value=ie.value<(r.total_pages||0)}catch(t){console.error(t),n.error("加载词单失败")}finally{j.value=!1}}},_e=()=>{se.value&&(ie.value++,we(!0))},$e=()=>{ie.value=1,S.value=[],se.value=!0,we()};(0,a.wB)(le,()=>{ie.value=1,S.value=[],se.value=!0,we()});const Re=e=>{t.push({name:"list_detail",query:{list_id:e}})},Ae=()=>{de.value="create",he.id=null,he.name="",he.note="",ce.value=!0},Ce=e=>{de.value="edit",he.id=e.id,he.name=e.name,he.note=e.note,ce.value=!0},Me=e=>{e.preventDefault(),ve.value?.validate(async e=>{if(!e){fe.value=!0;try{const e={name:he.name,note:he.note};"edit"===de.value&&(e.list_id=he.id),await _.A.post("https://newfront.xn--xhq44jb2fzpc.com/word_helper/word_list/adjust",e),n.success("create"===de.value?"创建成功":"更新成功"),ce.value=!1,ie.value=1,we()}catch(t){console.error(t),n.error("操作失败")}finally{fe.value=!1}}})},Se=async e=>{try{await _.A.post("https://newfront.xn--xhq44jb2fzpc.com/word_helper/word_list/del",{list_id:e.id}),n.success("删除成功"),1===S.value.length&&ie.value>1&&ie.value--,ie.value=1,we()}catch(t){console.error(t),n.error("删除失败")}},Fe=e=>{ke.listId=e.id,ke.wordIds=[],ge.value=[],pe.value=!0},ze=async e=>{if(!e){const e=new Set(ke.wordIds);return void(ge.value=ge.value.filter(t=>e.has(t.value)))}ye.value=!0;try{const t=await _.A.post("https://newfront.xn--xhq44jb2fzpc.com/word_helper/search",{keyword:e,page:1,limit:5}),n=t.data.data||t.data,a=(n.list||[]).map(e=>({label:e.word+(e.translations&&e.translations[0]?` (${e.translations[0].meaning})`:""),value:e.id})),r=new Set(ke.wordIds),i=ge.value.filter(e=>r.has(e.value)),s=[...i,...a],l=new Map;s.forEach(e=>l.set(e.value,e)),ge.value=Array.from(l.values())}catch(t){console.error("Search failed:",t)}finally{ye.value=!1}},De=async()=>{if(0!==ke.wordIds.length)if(ke.wordIds.length>50)n.warning("一次最多只能导入50个单词");else{me.value=!0;try{const e=await _.A.post("https://newfront.xn--xhq44jb2fzpc.com/word_helper/word_list/add_word",{list_id:ke.listId,word_id:ke.wordIds}),t=e.data.data||e.data;n.success(`导入成功,新增 ${t.added_count} 个单词`),pe.value=!1,we()}catch(e){console.error("Import failed:",e),n.error(e.response?.data?.message||"导入失败")}finally{me.value=!1}}else n.warning("请至少选择一个单词")};return(0,a.sV)(()=>{document.title="我的词单 - Word Helper",we()}),(e,t)=>{const n=(0,a.gN)("motion");return(0,a.uX)(),(0,a.CE)("div",O,[(0,a.bo)(((0,a.uX)(),(0,a.CE)("div",T,[(0,a.Lk)("div",null,[(0,a.Lk)("div",L,[(0,a.bF)((0,r.R1)($.A),{class:"w-8 h-8 text-primary"}),t[11]||(t[11]=(0,a.Lk)("h1",{class:"text-3xl font-bold text-gray-900 dark:text-white"},"我的词单",-1))]),t[12]||(t[12]=(0,a.Lk)("p",{class:"text-gray-500 dark:text-gray-400"},"管理您的自建词汇集合。您最多可以创建10个词单。",-1))]),(0,a.Lk)("div",W,[(0,a.Lk)("div",I,[(0,a.bF)((0,r.R1)(u.A),{value:ue.value,"onUpdate:value":t[0]||(t[0]=e=>ue.value=e),placeholder:"输入词单名...",onKeyup:(0,i.jR)($e,["enter"]),clearable:"",onClear:$e},{prefix:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(c._),{component:(0,r.R1)(R.A)},null,8,["component"])]),_:1},8,["value"]),(0,a.bF)((0,r.R1)(d.Ay),{onClick:$e},{default:(0,a.k6)(()=>[...t[13]||(t[13]=[(0,a.eW)("搜索",-1)])]),_:1})]),(0,a.Lk)("div",K,[t[14]||(t[14]=(0,a.Lk)("span",{class:"text-sm text-gray-600 dark:text-gray-300"},"仅自建",-1)),(0,a.bF)((0,r.R1)(f.A),{value:le.value,"onUpdate:value":t[1]||(t[1]=e=>le.value=e),size:"small"},null,8,["value"])]),(0,a.bF)((0,r.R1)(d.Ay),{type:"primary",size:"medium",onClick:Ae},{icon:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(c._),null,{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(A.A))]),_:1})]),default:(0,a.k6)(()=>[t[15]||(t[15]=(0,a.eW)(" 创建词单 ",-1))]),_:1})])])),[[n]]),j.value&&!S.value.length?((0,a.uX)(),(0,a.CE)("div",N,[(0,a.bF)((0,r.R1)(v.A),{size:"large"})])):S.value.length?((0,a.uX)(),(0,a.CE)("div",Y,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(S.value,(e,l)=>(0,a.bo)(((0,a.uX)(),(0,a.Wv)((0,r.R1)(p.Ay),{key:e.id,class:"group cursor-pointer hover:shadow-lg transition-all duration-300 border-gray-100 dark:border-gray-800",bordered:!0,size:"medium","content-style":"display: flex; flex-direction: column; height: 100%;",initial:{opacity:0,y:20},enter:{opacity:1,y:0,transition:{delay:50*l}},onClick:t=>Re(e.id)},{header:(0,a.k6)(()=>[(0,a.Lk)("div",B,[(0,a.Lk)("div",H,[(0,a.Lk)("h3",{class:"text-lg font-bold text-gray-900 dark:text-white truncate",title:e.name},(0,s.v_)(e.name),9,q)]),(0,a.bF)((0,r.R1)(m.Ay),{type:e.official?"success":"info",size:"small",round:"",bordered:!1,class:"flex-shrink-0"},{default:(0,a.k6)(()=>[(0,a.eW)((0,s.v_)(e.official?"官方":"自建"),1)]),_:2},1032,["type"])])]),default:(0,a.k6)(()=>[(0,a.Lk)("div",U,[(0,a.Lk)("p",X,(0,s.v_)(e.note||"暂无备注"),1),(0,a.Lk)("div",V,[(0,a.Lk)("div",J,[(0,a.Lk)("span",Q,[(0,a.bF)((0,r.R1)(c._),null,{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(C.A),{size:"14"})]),_:1}),(0,a.eW)(" "+(0,s.v_)(e.word_count)+" 词 ",1)]),(0,a.Lk)("span",Z,[(0,a.bF)((0,r.R1)(c._),null,{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(M.A),{size:"14"})]),_:1}),(0,a.eW)(" "+(0,s.v_)(be(e.created_at)),1)])]),!e.official||oe.value?((0,a.uX)(),(0,a.CE)("div",{key:0,class:"flex items-center gap-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",onClick:t[3]||(t[3]=(0,i.D$)(()=>{},["stop"]))},[(0,a.bF)((0,r.R1)(d.Ay),{quaternary:"",circle:"",size:"small",type:"success",onClick:t=>Fe(e),title:"导入单词"},{icon:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(c._),null,{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(F),{size:"16"})]),_:1})]),_:1},8,["onClick"]),(0,a.bF)((0,r.R1)(d.Ay),{quaternary:"",circle:"",size:"small",type:"primary",onClick:t=>Ce(e),title:"编辑词单"},{icon:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(c._),null,{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(z.A),{size:"16"})]),_:1})]),_:1},8,["onClick"]),(0,a.bF)((0,r.R1)(y.A),{onPositiveClick:t=>Se(e),"negative-text":"取消","positive-text":"确定"},{trigger:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(d.Ay),{quaternary:"",circle:"",size:"small",type:"error",title:"删除词单"},{icon:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(c._),null,{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(D.A),{size:"16"})]),_:1})]),_:1})]),default:(0,a.k6)(()=>[t[18]||(t[18]=(0,a.eW)(" 确认删除该词单吗? ",-1))]),_:1},8,["onPositiveClick"])])):(0,a.Q3)("",!0)])])]),_:2},1032,["enter","onClick"])),[[n]])),128))])):((0,a.uX)(),(0,a.CE)("div",E,[(0,a.bF)((0,r.R1)(h.A),{description:"暂无词单数据",size:"large"},{extra:(0,a.k6)(()=>[le.value?((0,a.uX)(),(0,a.Wv)((0,r.R1)(d.Ay),{key:0,size:"small",onClick:t[2]||(t[2]=e=>le.value=!1)},{default:(0,a.k6)(()=>[...t[16]||(t[16]=[(0,a.eW)(" 查看所有词单 ",-1)])]),_:1})):((0,a.uX)(),(0,a.Wv)((0,r.R1)(d.Ay),{key:1,type:"primary",size:"medium",onClick:Ae},{default:(0,a.k6)(()=>[...t[17]||(t[17]=[(0,a.eW)(" 创建第一个词单 ",-1)])]),_:1}))]),_:1})])),S.value.length>0?((0,a.uX)(),(0,a.CE)("div",G,[se.value?((0,a.uX)(),(0,a.Wv)((0,r.R1)(d.Ay),{key:0,loading:j.value,ghost:"",type:"primary",onClick:_e},{default:(0,a.k6)(()=>[...t[19]||(t[19]=[(0,a.eW)(" 加载更多 ",-1)])]),_:1},8,["loading"])):((0,a.uX)(),(0,a.CE)("span",ee,"没有更多了"))])):(0,a.Q3)("",!0),(0,a.bF)((0,r.R1)(g.A),{show:ce.value,"onUpdate:show":t[7]||(t[7]=e=>ce.value=e),preset:"card",title:"create"===de.value?"创建新词单":"编辑词单",class:"w-full max-w-md"},{footer:(0,a.k6)(()=>[(0,a.Lk)("div",te,[(0,a.bF)((0,r.R1)(d.Ay),{onClick:t[6]||(t[6]=e=>ce.value=!1)},{default:(0,a.k6)(()=>[...t[20]||(t[20]=[(0,a.eW)("取消",-1)])]),_:1}),(0,a.bF)((0,r.R1)(d.Ay),{type:"primary",loading:fe.value,onClick:Me},{default:(0,a.k6)(()=>[...t[21]||(t[21]=[(0,a.eW)(" 确定 ",-1)])]),_:1},8,["loading"])])]),default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(k.A),{ref_key:"formRef",ref:ve,model:he,rules:xe,"label-placement":"left","label-width":"80","require-mark-placement":"right-hanging"},{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(x.Ay),{label:"名称",path:"name"},{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(u.A),{value:he.name,"onUpdate:value":t[4]||(t[4]=e=>he.name=e),placeholder:"请输入词单名称"},null,8,["value"])]),_:1}),(0,a.bF)((0,r.R1)(x.Ay),{label:"备注",path:"note"},{default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(u.A),{value:he.note,"onUpdate:value":t[5]||(t[5]=e=>he.note=e),type:"textarea",placeholder:"请输入备注信息(可选)",autosize:{minRows:3,maxRows:5}},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["show","title"]),(0,a.bF)((0,r.R1)(g.A),{show:pe.value,"onUpdate:show":t[10]||(t[10]=e=>pe.value=e),preset:"card",title:"导入单词",class:"w-full max-w-lg"},{footer:(0,a.k6)(()=>[(0,a.Lk)("div",re,[(0,a.bF)((0,r.R1)(d.Ay),{onClick:t[9]||(t[9]=e=>pe.value=!1)},{default:(0,a.k6)(()=>[...t[24]||(t[24]=[(0,a.eW)("取消",-1)])]),_:1}),(0,a.bF)((0,r.R1)(d.Ay),{type:"primary",loading:me.value,onClick:De},{default:(0,a.k6)(()=>[...t[25]||(t[25]=[(0,a.eW)(" 开始导入 ",-1)])]),_:1},8,["loading"])])]),default:(0,a.k6)(()=>[(0,a.bF)((0,r.R1)(b.A),{type:"info",class:"mb-6","show-icon":""},{default:(0,a.k6)(()=>[...t[22]||(t[22]=[(0,a.eW)(" 一次性最多导入50个单词,已存在的单词将不会被再次导入。 ",-1)])]),_:1}),(0,a.Lk)("div",ne,[(0,a.Lk)("div",null,[t[23]||(t[23]=(0,a.Lk)("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"选择单词 (最多50个)",-1)),(0,a.bF)((0,r.R1)(w.A),{value:ke.wordIds,"onUpdate:value":t[8]||(t[8]=e=>ke.wordIds=e),multiple:"",filterable:"",remote:"",placeholder:"输入单词搜索并选择...",options:ge.value,loading:ye.value,onSearch:ze,"max-tag-count":10,clearable:""},null,8,["value","options","loading"]),(0,a.Lk)("div",ae," 已选: "+(0,s.v_)(ke.wordIds.length)+" / 50 ",1)])])]),_:1},8,["show"])])}}},se=n(71241);const le=(0,se.A)(ie,[["__scopeId","data-v-1b91623e"]]);var oe=le},96530:function(e,t,n){"use strict";n.d(t,{A:function(){return r}});var a=n(45525);
|
||
/**
|
||
* @license lucide-vue-next v0.562.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const r=(0,a.A)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]])}}]);
|
||
//# sourceMappingURL=211.b427f4b2.js.map
|