@palerock/exam-qa 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.DS_Store +0 -0
- package/dist/index.html +1 -1
- package/dist/static/css/{app.e9d3316bdc94e42d6bba9c83c827b80f.css → app.7c745682d2779707e1bcbf833c15026e.css} +2 -2
- package/dist/static/css/app.7c745682d2779707e1bcbf833c15026e.css.map +1 -0
- package/dist/static/js/{app.37f220b243a383aea601.js → app.ba4cb15965c3df3c10eb.js} +2 -2
- package/dist/static/js/{app.37f220b243a383aea601.js.map → app.ba4cb15965c3df3c10eb.js.map} +1 -1
- package/dist/static/js/manifest.3ad1d5771e9b13dbdad2.js.map +1 -1
- package/lib-json/MULESOFT-DEV1.json +431 -427
- package/package.json +1 -1
- package/dist/static/css/app.e9d3316bdc94e42d6bba9c83c827b80f.css.map +0 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
webpackJsonp([1],{"+c27":function(t,e){},"/E+L":function(t,e){},"/h4W":function(t,e){},"4rJS":function(t,e){},"6Zvi":function(t,e){},"8NIx":function(t,e){},"97dx":function(t,e){},JKiR:function(t,e){},NAlg:function(t,e){},NHnr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("7+uW"),s=n("E1O6"),a=n.n(s),o=n("jAqF"),r=n.n(o),c=n("Tg6C"),u=n.n(c),l=n("Sg1L"),h=n.n(l),m=n("s1qc"),d=n.n(m),p=n("GiJQ"),v=n.n(p),g={name:"App",data:function(){return{direction:"slide-right",lastBackPressTime:0,backPressInterval:2e3,immersed:20,navHeight:46,isImmersed:!1}},mounted:function(){this.initPlusReady(),this.initGlobalBackManager()},beforeDestroy:function(){this.removeBackButtonListener(),this.cleanupImmersiveStyles(),this.cleanupGlobalBackManager()},methods:{initGlobalBackManager:function(){var t=this;window.GlobalBackManager={interceptors:[],addInterceptor:function(e){t.addBackInterceptor(e)},removeInterceptor:function(e){t.removeBackInterceptor(e)},goBack:function(){t.handleGlobalBack()}},this.$root.globalBack=function(){t.handleGlobalBack()},console.log("全局返回管理器初始化完成")},addBackInterceptor:function(t){"function"==typeof t&&window.GlobalBackManager.interceptors.push(t)},removeBackInterceptor:function(t){var e=window.GlobalBackManager.interceptors.indexOf(t);e>-1&&window.GlobalBackManager.interceptors.splice(e,1)},handleGlobalBack:function(){var t=v()(u.a.mark(function t(){var e,n,i,s,a,o,r;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=d()(window.GlobalBackManager.interceptors).reverse(),n=!0,i=!1,s=void 0,t.prev=4,a=h()(e);case 6:if(n=(o=a.next()).done){t.next=23;break}return r=o.value,t.prev=8,t.next=11,r();case 11:if(!t.sent){t.next=15;break}return console.log("返回操作被拦截"),t.abrupt("return");case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(8),console.error("返回拦截器执行错误:",t.t0);case 20:n=!0,t.next=6;break;case 23:t.next=29;break;case 25:t.prev=25,t.t1=t.catch(4),i=!0,s=t.t1;case 29:t.prev=29,t.prev=30,n||null==a.return||a.return();case 32:if(t.prev=32,!i){t.next=35;break}throw s;case 35:return t.finish(32);case 36:return t.finish(29);case 37:this.executeDefaultBack();case 38:case"end":return t.stop()}},t,this,[[4,25,29,37],[8,17],[30,,32,36]])}));return function(){return t.apply(this,arguments)}}(),executeDefaultBack:function(){"/"!==this.$route.path?this.hasOpenDialog()?this.closeTopDialog():this.$router.back():this.handleHomePageBack()},initPlusReady:function(){var t=this,e=function(){t.setupImmersiveStatusBar(),t.addBackButtonListener()};window.plus?e():document.addEventListener("plusready",e,!1),this.detectImmersiveMode()},detectImmersiveMode:function(){this.immersed=20;var t=/Html5Plus\/.+\s\(.*(Immersed\/(\d+\.?\d*).*)\)/gi.exec(navigator.userAgent);t&&t.length>=3?(this.immersed=r()(t[2]),this.isImmersed=!0,console.log("检测到沉浸式状态栏,高度:",this.immersed)):(this.isImmersed=!1,this.immersed=0,console.log("非沉浸式状态栏模式")),window.app=window.app||{},window.app.immersed=this.immersed,window.app.navHeight=this.navHeight,window.app.isImmersed=this.isImmersed,this.applyImmersiveStyles()},setupImmersiveStatusBar:function(){if("undefined"!=typeof plus)try{var t=plus.navigator.getStatusBarHeight();t>0&&(this.immersed=t,this.isImmersed=!0,window.app=window.app||{},window.app.immersed=this.immersed,window.app.navHeight=this.navHeight,window.app.isImmersed=this.isImmersed),this.applyImmersiveStyles(),console.log("沉浸式状态栏设置完成,高度:",this.immersed)}catch(t){console.warn("设置沉浸式状态栏失败:",t)}},applyImmersiveStyles:function(){this.isImmersed&&this.immersed>0&&this.injectImmersiveStyles()},injectImmersiveStyles:function(){var t=document.getElementById("immersive-style");t&&t.remove();var e=document.createElement("style");e.id="immersive-style",e.innerHTML=".van-nav-bar { padding-top: "+this.immersed+"px !important; height: "+(this.navHeight+this.immersed)+'px !important; }.van-nav-bar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: '+this.immersed+"px; background: var(--primary-gradient); z-index: -1; }.van-nav-bar__title { margin-top: 0 !important; }.van-nav-bar__left, .van-nav-bar__right { margin-top: 0 !important; }#app { padding-top: "+(this.navHeight+this.immersed)+"px !important; }.appView { min-height: calc(100vh - "+(this.navHeight+this.immersed)+"px) !important; }.question-container { padding-top: "+(this.immersed+60)+"px !important; }.page-container { padding-top: "+(this.immersed+60)+"px !important; }.category-container { padding-top: "+(this.immersed+60)+'px !important; }.van-nav-bar[class*="fixed"] { position: fixed !important; top: 0 !important; z-index: 1000 !important; }body { --immersed-height: '+this.immersed+"px; --nav-total-height: "+(this.navHeight+this.immersed)+"px; }body.immersive-mode #app { /* 为沉浸式模式提供额外样式钩子 */ }",document.head.appendChild(e),document.body.classList.add("immersive-mode"),console.log("沉浸式样式已注入")},cleanupImmersiveStyles:function(){var t=document.getElementById("immersive-style");t&&t.remove(),document.body.classList.remove("immersive-mode"),document.documentElement.style.removeProperty("--immersed-height"),document.documentElement.style.removeProperty("--nav-total-height"),window.app&&(delete window.app.immersed,delete window.app.navHeight,delete window.app.isImmersed)},cleanupGlobalBackManager:function(){window.GlobalBackManager&&(window.GlobalBackManager.interceptors=[],delete window.GlobalBackManager),this.$root.globalBack&&delete this.$root.globalBack,console.log("全局返回管理器已清理")},addBackButtonListener:function(){"undefined"!=typeof plus&&plus.key.addEventListener("backbutton",this.onBackButton,!1)},removeBackButtonListener:function(){"undefined"!=typeof plus&&plus.key.removeEventListener("backbutton",this.onBackButton)},onBackButton:function(){this.handleGlobalBack()},handleHomePageBack:function(){var t=(new Date).getTime();t-this.lastBackPressTime<this.backPressInterval?plus.runtime.quit():(this.lastBackPressTime=t,this.showExitTip())},showExitTip:function(){this.$toast?this.$toast("再按一次退出应用"):void 0!==this.$Toast?this.$Toast("再按一次退出应用"):"undefined"!=typeof plus&&plus.nativeUI?plus.nativeUI.toast("再按一次退出应用"):alert("再按一次退出应用")},hasOpenDialog:function(){var t=document.querySelectorAll(".van-overlay, .van-popup, .van-dialog, .van-action-sheet, .van-picker");return a()(t).some(function(t){var e=window.getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility})},closeTopDialog:function(){for(var t=document.querySelectorAll(".van-overlay, .van-popup .van-popup--center, .van-dialog, .van-action-sheet, .van-picker"),e=t.length-1;e>=0;e--){var n=t[e],i=window.getComputedStyle(n);if("none"!==i.display&&"hidden"!==i.visibility){var s=n.querySelector(".van-popup__close-icon, .van-dialog__confirm, .van-picker__cancel");return s?void s.click():n.classList.contains("van-overlay")?void n.click():void(n.style.display="none")}}}},watch:{$route:function(t,e){var n=function(t){return"/"===t?1:t.startsWith("/category/")?2:"/exam"===t?3:1},i=n(t.path),s=n(e.path);this.direction=i>s?"slide-left":i<s?"slide-right":"slide-left"}}},f={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("transition",{attrs:{name:this.direction}},[e("router-view",{staticClass:"appView"})],1)],1)},staticRenderFns:[]};var w=n("VU/8")(g,f,!1,function(t){n("WkQV")},null,null).exports,C=n("/ocq"),y=(n("FO5P"),n("woHG")),b=(n("RgoE"),n("0KWt")),k=(n("1E9F"),n("2Ux5")),x=n("L8Ge"),_=n.n(x),q=n("pDAi"),I=n.n(q),T=n("rXUV"),S=n.n(T),L=n("0VsM"),D=n.n(L),P=n("4vMe"),B=n.n(P),E=n("6Cj1"),M=n.n(E),N=n("6qwz"),O=n.n(N),H=n("/xtf"),$=n.n(H),A=n("0VlM"),R=n.n(A),X=(n("k3b4"),n("+2ln")),Y=(n("3ab0"),n("bHMa")),z=(n("cZ0s"),n("fIxc")),G=(n("RIEG"),n("zjGD")),Q=(n("YP+l"),n("EA31")),W=(n("sgvh"),n("zc1Q")),U=(n("mMXg"),n("qYlo")),Z=(n("3Lne"),n("SSsa")),j=(n("MY4N"),n("0zAV")),F=(n("OWWB"),n("1fWZ")),V=(n("i0mo"),n("Hkar")),K=(n("XmAh"),n("il3B")),J=(n("nOaS"),n("pIDD")),tt=n("7U2N"),et=n.n(tt),nt=n("IG2y"),it=n.n(nt),st=n("49HJ"),at=n.n(st),ot=n("Yo5Z"),rt=n.n(ot),ct=n("ckt0"),ut=n.n(ct);function lt(t,e){var n=M()(t);if(B.a){var i=B()(t);e&&(i=i.filter(function(e){return D()(t,e).enumerable})),n.push.apply(n,i)}return n}var ht={getHashCode:function(t){return this.getStrHashCode(this.getMessage(t).concat(this.getPropertyNames(t)).join(""))},getPropertyNames:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return n<=0?"":!t||["string","number","boolean","function"].includes(ut()(t))||t instanceof Date?"":this.flat(rt()(t).map(function(t){var i=at()(t,2),s=i[0],a=i[1];return[s,e.getPropertyNames(a,n--)]})).filter(function(t){return null!=t&&""!==t})},getMessage:function(t,e){var n=this;return null==e&&(e=10),e<=0?"":!t||["string","number","boolean","function"].includes(ut()(t))||t instanceof Date?[null!=t?t.toString():""]:this.flat(M()(t).map(function(i){return n.getMessage(t[i],e--)})).filter(function(t){return null!=t&&""!==t})},getStrHashCode:function(t){var e,n,i=0;if(0===t.length)return i;for(e=0,n=t.length;e<n;e++)i=(i<<5)-i+t.charCodeAt(e),i|=0;return i+""},flat:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=[],i=!1;return t.forEach(function(t){it()(t)?(i=!0,n.push.apply(n,d()(t))):n.push(t)}),i&&e>0?this.flat(n,e--):n},fromEntries:function(t){var e={};return t.forEach(function(t){t instanceof Array&&(e[t[0]]=t[1])}),e},storage:{getItem:function(t){var e=localStorage.getItem("__exam_s0_"+t),n=null;try{n=JSON.parse(e)}catch(e){console.log("No valid item for key [".concat(t,"] to get in storage."))}return n},setItem:function(t,e){var n=null;try{n=$()(e),localStorage.setItem("__exam_s0_"+t,n)}catch(e){console.log("Not valid item for key [".concat(t,"] to set."))}},removeItem:function(t){localStorage.removeItem("__exam_s0_"+t)}},groupArray:function(t,e){var n=this,i=t.map(function(t){return{hashCode:n.getHashCode(t),item:t}});e instanceof Array||(e=[e]);var s={};return i.map(function(t){return{hashCode:t.hashCode,checkItem:Object.fromEntries(e.map(function(e){return[e,(t.item||{})[e]]}))}}).map(function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lt(n,!0).forEach(function(e){R()(t,e,n[e])}):S.a?I()(t,S()(n)):lt(n).forEach(function(e){_()(t,e,D()(n,e))})}return t}({},t,{checkedHashCode:n.getHashCode(t.checkItem)})}).forEach(function(t){var e=s[t.checkedHashCode];e||(e=[]),e.push(i.find(function(e){return e.hashCode===t.hashCode}).item),s[t.checkedHashCode]=e}),et()(s)},duplicateRemoval:function(t){var e=t.map(function(t){return{item:t}});return this.groupArray(e,"item").map(function(t){return t[0].item})},randomSort:function(t){return t.sort(function(){return Math.random()-.5})}},mt=n("Kr0U"),dt=n.n(mt),pt=n("EEoX"),vt=n.n(pt),gt=n("5WHX"),ft=n.n(gt),wt=n("mnGM"),Ct=n.n(wt),yt=n("6DPD"),bt=n.n(yt),kt=n("OdJd"),xt=n.n(kt),_t=new(n("YwQ6").a)("_qa_db");_t.version(1).stores({config:"key, value, createDate, modifyDate",question:"hashCode, describe, type, createDate, modifyDate",bank:"hashCode, title, *questions, createDate, modifyDate",historyRecord:"relatedQuestion, rightTimes, errorTimes, maxTime, minTime, totalTime, createDate, modifyDate"}),_t.version(2).stores({bank:"hashCode, title, *questions, category, createDate, modifyDate"}),_t.version(3).stores({question:"hashCode, describe, type, createDate, modifyDate, analysis"});var qt=_t.config,It=_t.question,Tt=_t.bank,St=_t.historyRecord;function Lt(t,e){var n=M()(t);if(B.a){var i=B()(t);e&&(i=i.filter(function(e){return D()(t,e).enumerable})),n.push.apply(n,i)}return n}function Dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lt(n,!0).forEach(function(e){R()(t,e,n[e])}):S.a?I()(t,S()(n)):Lt(n).forEach(function(e){_()(t,e,D()(n,e))})}return t}var Pt=function(){function t(e,n){bt()(this,t),this.db=e,this.defaultEntry=n||{},this.db.hook("creating",function(t,e){e.createDate=Ct()(),e.modifyDate=Ct()()}),this.db.hook("updating",function(t,e,n){return t.modifiedDate=Ct()(),n.createdDate||(t.createdDate=Ct()()),console.log(Dt({},t)),t})}return xt()(t,[{key:"upsert",value:function(){var t=v()(u.a.mark(function t(e){var n=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e instanceof Array)){t.next=2;break}return t.abrupt("return",this.db.bulkPut(e.map(function(t){return Dt({},n.defaultEntry,{},t)})));case 2:return t.abrupt("return",this.db.put(Dt({},this.defaultEntry,{},e)));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"query",value:function(t){return this.db.where(t)}},{key:"queryByHashCode",value:function(t){return this.query("hashCode").equals(t).first()}},{key:"delete",value:function(){var t=v()(u.a.mark(function t(e){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e instanceof Array)){t.next=2;break}return t.abrupt("return",this.db.bulkDelete(e));case 2:return t.abrupt("return",this.db.delete(e));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()}]),t}(),Bt=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,qt,{value:null}))}return ft()(e,t),e}(Pt),Et=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,It,{describe:"",type:"option"}))}return ft()(e,t),e}(Pt),Mt=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,Tt,{title:"",questions:[]}))}return ft()(e,t),e}(Pt),Nt=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,St,{rightTimes:0,errorTimes:0,maxTime:0,minTime:0,totalTime:0}))}return ft()(e,t),xt()(e,[{key:"queryByHashCode",value:function(t){return this.query("relatedQuestion").equals(t).first()}},{key:"queryMany",value:function(t){return this.query("relatedQuestion").anyOf(t).toArray()}}]),e}(Pt),Ot=(new Bt,new Et),Ht=new Mt,$t=new Nt,At="1.1.5";function Rt(t,e){var n=M()(t);if(B.a){var i=B()(t);e&&(i=i.filter(function(e){return D()(t,e).enumerable})),n.push.apply(n,i)}return n}function Xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rt(n,!0).forEach(function(e){R()(t,e,n[e])}):S.a?I()(t,S()(n)):Rt(n).forEach(function(e){_()(t,e,D()(n,e))})}return t}i.a.use(J.a),i.a.use(K.a),i.a.use(j.a).use(F.a).use(V.a),i.a.use(Z.a),i.a.use(U.a),i.a.use(Q.a).use(W.a),i.a.use(z.a).use(G.a),i.a.use(Y.a),i.a.use(X.a);var Yt="https://unpkg.com/@palerock/exam-qa@latest/lib-json",zt={name:"HomeIndex",data:function(){return{isShowImporter:!1,isFromOnline:!1,onlineLibs:[],onlineSelects:[],questionLib:"",categories:[],loadingOnlineLibs:!1,loadingProgress:"准备加载题库...",totalLibsCount:0,loadedLibsCount:0,loadingError:null}},computed:{selectedLibs:function(){var t=this,e=this.onlineLibs.filter(function(e){return t.onlineSelects.includes(e.hashCode)}).map(function(t){return Xt({},t)});return e.forEach(function(t){delete t.hashCode}),e}},methods:{goToCategory:function(t){this.$router.push({name:"CategoryPage",params:{category:t}})},selectLib:function(t){this.onlineSelects.includes(t.hashCode)?this.onlineSelects=this.onlineSelects.filter(function(e){return e!==t.hashCode}):this.onlineSelects=[].concat(d()(this.onlineSelects),[t.hashCode]),this.questionLib=$()(this.selectedLibs)},showImporter:function(){this.isShowImporter=!0,this.isFromOnline=!1},importFromExist:function(){var t=v()(u.a.mark(function t(){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.isFromOnline=!0,this.loadingError=null,t.next=4,this.loadOnlineLibs();case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),loadOnlineLibs:function(){var t=v()(u.a.mark(function t(){var e;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.loadingOnlineLibs=!0,this.loadingProgress="正在获取题库列表...",this.totalLibsCount=0,this.loadedLibsCount=0,t.prev=4,t.next=7,this.fetchOnlineLib();case 7:e=t.sent,this.onlineLibs=e.filter(function(t){return t&&t.data}).map(function(t){return Xt({},t.data,{hashCode:t.data.hashCode||ht.getHashCode(t.data.title+t.data.category)})}),this.loadingProgress="成功加载 ".concat(this.onlineLibs.length," 个题库"),this.loadingError=null,t.next=18;break;case 13:t.prev=13,t.t0=t.catch(4),console.error("获取在线题库失败:",t.t0),this.loadingError="加载失败,请检查网络连接后重试",this.loadingProgress="";case 18:return t.prev=18,this.loadingOnlineLibs=!1,t.finish(18);case 21:case"end":return t.stop()}},t,this,[[4,13,18,21]])}));return function(){return t.apply(this,arguments)}}(),retryLoadOnlineLibs:function(){this.loadOnlineLibs()},fetchOnlineLib:function(){var t=v()(u.a.mark(function t(){var e,n,i,s,a=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.loadingProgress="正在获取题库列表...",t.next=4,this.$http.get(Yt+"/map.json");case 4:if(t.t0=t.sent.data,t.t0){t.next=7;break}t.t0=[];case 7:if(0!==(e=t.t0).length){t.next=11;break}return this.loadingProgress="未找到可用题库",t.abrupt("return",[]);case 11:return this.totalLibsCount=e.length,this.loadedLibsCount=0,this.loadingProgress="准备并发加载 ".concat(e.length," 个题库..."),n=e.map(function(t,e){return a.$http.get(Yt+"/"+t).then(function(t){return a.loadedLibsCount++,a.loadingProgress="正在并发加载题库 (".concat(a.loadedLibsCount,"/").concat(a.totalLibsCount,")"),t}).catch(function(e){return a.loadedLibsCount++,console.warn("加载题库 ".concat(t," 失败:"),e),a.loadingProgress="正在并发加载题库 (".concat(a.loadedLibsCount,"/").concat(a.totalLibsCount,") - 部分失败"),null})}),t.next=17,O.a.all(n);case 17:return i=t.sent,s=i.filter(function(t){return null!==t}),this.loadingProgress="加载完成! 成功: ".concat(s.length,", 失败: ").concat(e.length-s.length),t.abrupt("return",s);case 23:throw t.prev=23,t.t1=t.catch(0),console.error("获取在线题库列表失败:",t.t1),this.loadingProgress="加载失败,请重试",t.t1;case 28:case"end":return t.stop()}},t,this,[[0,23]])}));return function(){return t.apply(this,arguments)}}(),importLib:function(){var t=v()(u.a.mark(function t(){var e,n,i,s,a=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e=JSON.parse(this.questionLib),n=0,!(e instanceof Array)){t.next=10;break}return t.next=6,O.a.all(e.map(function(){var t=v()(u.a.mark(function t(e){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.importSingleLib(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()));case 6:i=t.sent,n=i.filter(function(t){return t}).length,t.next=14;break;case 10:return t.next=12,this.importSingleLib(e);case 12:s=t.sent,n=s?1:0;case 14:n>0?this.$toast.success("成功导入 ".concat(n," 个题库!")):this.$toast.fail("未找到有效的题库数据"),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(0),console.error("导入题库失败:",t.t0),this.$toast.fail("题库格式错误:".concat(ht.getMessage(t.t0)));case 21:return t.next=23,this.initCategories();case 23:this.isShowImporter=!1,this.questionLib="";case 25:case"end":return t.stop()}},t,this,[[0,17]])}));return function(){return t.apply(this,arguments)}}(),importSingleLib:function(){var t=v()(u.a.mark(function t(e){var n;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.questions&&0!==e.questions.length){t.next=2;break}return t.abrupt("return",!1);case 2:return e.questions.forEach(function(t){t.hashCode=t.hashCode||ht.getHashCode(t)}),(n=Xt({},e,{questions:e.questions.map(function(t){return t.hashCode})})).hashCode=e.hashCode||ht.getHashCode(n),t.next=7,Ot.upsert(e.questions).then(function(){return Ht.upsert([n])});case 7:return t.abrupt("return",!0);case 8:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),initCategories:function(){var t=v()(u.a.mark(function t(){var e=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ht.query("hashCode").notEqual("").toArray().then(function(t){t=t.map(function(t){return t.category=t.category||"default",t}),e.categories=t.reduce(function(t,e){return t.includes(e.category)||t.push(e.category),t},[])});case 2:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}()},mounted:function(){this.initCategories()}},Gt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home-index"},[t._m(0),t._v(" "),n("transition",{attrs:{name:"slide-up",mode:"out-in"}},[n("van-grid",{staticClass:"category-grid",attrs:{"column-num":2,gutter:16}},[n("van-grid-item",{staticClass:"grid-item-enhanced import-item",attrs:{icon:"plus",clickable:""},on:{click:t.showImporter}},[n("div",{staticClass:"grid-text",attrs:{slot:"text"},slot:"text"},[n("span",{staticClass:"grid-title"},[t._v("开始答题")]),t._v(" "),n("span",{staticClass:"grid-subtitle"},[t._v("导入题库")])])]),t._v(" "),t._l(t.categories,function(e,i){return n("van-grid-item",{key:e,staticClass:"grid-item-enhanced category-item",style:{"animation-delay":.1*i+"s"},attrs:{icon:"notes-o",clickable:""},on:{click:function(n){return t.goToCategory(e)}}},[n("div",{staticClass:"grid-text",attrs:{slot:"text"},slot:"text"},[n("span",{staticClass:"grid-title"},[t._v(t._s(e))]),t._v(" "),n("span",{staticClass:"grid-subtitle"},[t._v("题库分类")])])])})],2)],1),t._v(" "),n("van-popup",{staticClass:"import-popup",attrs:{round:""},on:{"click-overlay":function(e){t.isShowImporter=!1}},model:{value:t.isShowImporter,callback:function(e){t.isShowImporter=e},expression:"isShowImporter"}},[n("div",{staticClass:"exam-import-box theme-card"},[n("div",{staticClass:"popup-header"},[n("h3",[t._v("导入题库")]),t._v(" "),n("van-icon",{staticClass:"close-icon",attrs:{name:"cross"},on:{click:function(e){t.isShowImporter=!1}}})],1),t._v(" "),t.isFromOnline?n("div",{staticClass:"online-libs-container"},[t.loadingOnlineLibs?n("div",{staticClass:"loading-container"},[n("div",{staticClass:"loading-spinner"}),t._v(" "),n("p",[t._v(t._s(t.loadingProgress))]),t._v(" "),t.totalLibsCount>0?n("div",{staticClass:"progress-bar"},[n("div",{staticClass:"progress-fill",style:{width:t.loadedLibsCount/t.totalLibsCount*100+"%"}})]):t._e()]):t.loadingError?n("div",{staticClass:"loading-container error-state"},[n("van-icon",{attrs:{name:"warning-o",size:"32",color:"var(--error-color)"}}),t._v(" "),n("p",{staticClass:"error-message"},[t._v(t._s(t.loadingError))]),t._v(" "),n("van-button",{attrs:{type:"primary",size:"small",round:""},on:{click:t.retryLoadOnlineLibs}},[t._v("\n 重试加载\n ")])],1):t.onlineLibs&&0!==t.onlineLibs.length?n("van-checkbox-group",{model:{value:t.onlineSelects,callback:function(e){t.onlineSelects=e},expression:"onlineSelects"}},[n("van-cell-group",{staticClass:"lib-cell-group"},t._l(t.onlineLibs,function(e,i){return n("van-cell",{key:i,staticClass:"lib-cell",attrs:{clickable:""},on:{click:function(n){return t.selectLib(e)}}},[n("template",{slot:"title"},[n("div",{staticClass:"lib-info"},[n("span",{staticClass:"lib-title"},[t._v(t._s(e.title))]),t._v(" "),n("span",{staticClass:"lib-category"},[t._v(t._s(e.category||"default"))])])]),t._v(" "),n("van-checkbox",{attrs:{slot:"right-icon",name:e.hashCode},slot:"right-icon"})],2)}),1)],1):n("div",{staticClass:"loading-container"},[n("div",{staticClass:"loading-spinner"}),t._v(" "),n("p",[t._v("准备加载题库...")])])],1):t._e(),t._v(" "),t.isFromOnline?t._e():n("div",{staticClass:"manual-import"},[n("van-cell-group",{staticClass:"import-field-group"},[n("van-field",{staticClass:"import-field",attrs:{label:"题库内容",type:"textarea",placeholder:"请输入JSON格式的题库数据",rows:"8"},model:{value:t.questionLib,callback:function(e){t.questionLib=e},expression:"questionLib"}})],1)],1),t._v(" "),n("div",{staticClass:"popup-actions"},[n("van-button",{staticClass:"theme-button action-button",attrs:{type:"info",size:"large",block:"",round:""},on:{click:t.importLib}},[n("van-icon",{attrs:{name:"plus"}}),t._v("\n 导入题库\n ")],1),t._v(" "),n("van-button",{staticClass:"theme-button action-button",attrs:{type:"primary",size:"large",block:"",round:""},on:{click:t.importFromExist}},[n("van-icon",{attrs:{name:"cloud-o"}}),t._v("\n 获取在线题库\n ")],1)],1)])])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"welcome-section"},[e("div",{staticClass:"welcome-card theme-card"},[e("div",{staticClass:"welcome-content"},[e("h2",{staticClass:"gradient-text welcome-title"},[this._v("欢迎使用答题神器")]),this._v(" "),e("p",[this._v("智能题库管理,轻松备考复习")])])])])}]};var Qt=n("VU/8")(zt,Gt,!1,function(t){n("6Zvi")},"data-v-2eda658d",null).exports;i.a.use(Z.a);var Wt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("van-button",{attrs:{type:"default"}},[t._v("默认按钮")]),t._v(" "),n("van-button",{attrs:{type:"primary"}},[t._v("主要按钮")]),t._v(" "),n("van-button",{attrs:{type:"info"}},[t._v("信息按钮")]),t._v(" "),n("van-button",{attrs:{type:"warning"}},[t._v("警告按钮")]),t._v(" "),n("van-button",{attrs:{type:"danger"}},[t._v("危险按钮")])],1)},staticRenderFns:[]};n("VU/8")({name:"HelloWorld",data:function(){return{msg:"Welcome to Your Vue.js App"}}},Wt,!1,null,null,null).exports;i.a.use(y.a).use(b.a).use(k.a);var Ut={name:"HomePage",data:function(){return{activeTabIndex:0,pages:[{title:"主页",label:"Home",api:Qt,icon:"home-o"}]}},computed:{activePage:function(){return this.pages[this.activeTabIndex]||{}},version:function(){return At}}},Zt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home-page"},[n("van-nav-bar",{attrs:{title:t.activePage.label,fixed:""}}),t._v(" "),n("div",{staticClass:"is-relation page-container"},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[n(t.activePage.api,{key:t.activeTabIndex,tag:"component"})],1),t._v(" "),n("p",{staticClass:"version-text text-align-center is-absolute"},[t._v(t._s(t.version))])],1)],1)},staticRenderFns:[]};var jt=n("VU/8")(Ut,Zt,!1,function(t){n("/h4W")},"data-v-08264cc4",null).exports,Ft=(n("I4j4"),n("7fQT")),Vt=(n("le1z"),n("hZxG")),Kt=(n("HZGa"),n("pykS")),Jt=(n("ZuV/"),n("37Xn")),te=(n("JRZP"),n("LK01"));function ee(t,e){var n=M()(t);if(B.a){var i=B()(t);e&&(i=i.filter(function(e){return D()(t,e).enumerable})),n.push.apply(n,i)}return n}function ne(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ee(n,!0).forEach(function(e){R()(t,e,n[e])}):S.a?I()(t,S()(n)):ee(n).forEach(function(e){_()(t,e,D()(n,e))})}return t}i.a.use(Jt.a).use(te.a),i.a.use(K.a),i.a.use(z.a).use(G.a),i.a.use(Kt.a),i.a.use(Vt.a),i.a.use(F.a).use(V.a),i.a.use(X.a);var ie={required:!0,score:1,usingScore:!1,type:"option",describe:"Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?",answerOptions:[{api:"A",describe:"Yes",isRight:!0},{api:"B",describe:"No"}]},se={title:"试题测试",questions:[ie]};i.a.use(y.a).use(Ft.a).use(Z.a);var ae={name:"DoExamPage",data:function(){var t;return t={answers:[],questionNum:0,isShowResult:!1,letterIndex:d()("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),examInfo:{},hasSubmit:!1,examHashCode:0,historyExams:[],showAcButtons:!1,backInterceptor:null,transitionName:"question-slide-right",previousQuestionNum:0,panStartScrollTop:null,showImagePreview:!1,previewImageSrc:"",previewImageAlt:"",zoomLevel:1,translateX:0,translateY:0,initialDistance:0,initialZoom:1,lastTouchX:0,lastTouchY:0,isDragging:!1,isZooming:!1,imageNaturalWidth:0,imageNaturalHeight:0,containerWidth:0,containerHeight:0,isMouseDragging:!1,mouseStartX:0,mouseStartY:0,lastClickTime:0,doubleClickDelay:300,lastTouchTime:0},R()(t,"lastTouchX",0),R()(t,"lastTouchY",0),R()(t,"doubleTapDelay",300),R()(t,"doubleTapDistance",50),R()(t,"touchMoved",!1),t},computed:{totalNum:function(){return this.questions.length},questions:function(){var t=this;return(this.examInfo.questions||[]).filter(function(e){return t.isReviewError?t.historyErrorHashCodes.includes(e.hashCode):!t.neverDo||!t.doneHashCodes.includes(e.hashCode)}).map(function(e,n){return ne({},e,{active:n===t.questionNum})})},questionsInfo:function(){var t=this;return this.questions.map(function(e,n){return t.answers[n]||(t.answers[n]={results:[{}],single:{},multi:{apis:[]}}),ne({},e,{answer:t.answers[n]||{},orderNum:n+1,isMulti:e.answerOptions.filter(function(t){return t.isRight}).length>1})})},historyErrorHashCodes:function(){return this.historyExams.filter(function(t){return t.errorTimes>0}).map(function(t){return t.hashCode})},doneHashCodes:function(){return this.historyExams.filter(function(t){return t.errorTimes+t.rightTimes>0}).map(function(t){return t.hashCode})},imageStyle:function(){var t="zoom-in";return this.zoomLevel>1&&(t=this.isDragging||this.isMouseDragging?"grabbing":"grab"),{transform:"translate(".concat(this.translateX,"px, ").concat(this.translateY,"px) scale(").concat(this.zoomLevel,")"),transformOrigin:"center center",transition:this.isDragging||this.isZooming||this.isMouseDragging?"none":"transform 0.3s ease",cursor:t,userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}}},methods:{handleBack:function(){window.GlobalBackManager?window.GlobalBackManager.goBack():this.originalHandleBack()},originalHandleBack:function(){var t=this;this.shouldConfirmExit()?K.a.confirm({title:"确认退出",message:"当次答题没有保存,是否确认退出?",confirmButtonText:"确认退出",cancelButtonText:"继续答题",confirmButtonColor:"var(--warning-color)",className:"custom-warning-dialog",closeOnClickOverlay:!0}).then(function(){t.$router.back()}).catch(function(){}):this.$router.back()},shouldConfirmExit:function(){var t=this;return!this.hasSubmit&&this.questionsInfo.filter(function(e){return t.isQuestionAnswered(e)}).length>0},getQuestionNavClass:function(t,e){var n={};return n["exam-current"]=this.questionNum===e,this.isShowResult||t.answer.isChecked&&this.isPractice?t.answer.isPass?n["exam-right"]=!0:t.answer.isMistake&&(n["exam-error"]=!0):this.isQuestionAnswered(t)&&(n["exam-answered"]=!0),n},registerBackInterceptor:function(){var t=this;window.GlobalBackManager&&(this.backInterceptor=function(){return t.showImagePreview?(t.closeImagePreview(),!0):!!t.shouldConfirmExit()&&(K.a.confirm({title:"确认退出",message:"当次答题没有保存,是否确认退出?",confirmButtonText:"确认退出",cancelButtonText:"继续答题",confirmButtonColor:"var(--warning-color)",className:"custom-warning-dialog",closeOnClickOverlay:!0}).then(function(){t.unregisterBackInterceptor(),t.$router.back()}).catch(function(){}),!0)},window.GlobalBackManager.addInterceptor(this.backInterceptor),console.log("答题页面返回拦截器已注册"))},unregisterBackInterceptor:function(){window.GlobalBackManager&&this.backInterceptor&&(window.GlobalBackManager.removeInterceptor(this.backInterceptor),this.backInterceptor=null,console.log("答题页面返回拦截器已移除"))},isQuestionAnswered:function(t){return!(!t||!t.answer)&&(t.isMulti?t.answer.multi&&t.answer.multi.apis&&t.answer.multi.apis.length>0:t.answer.single&&t.answer.single.api)},getQuestionTitle:function(t){return t&&t.describe?["(".concat(this.questionNum+1,"/").concat(this.totalNum,")"),t.describe].join(" ").split("\n"):["(".concat(this.questionNum+1,"/").concat(this.totalNum,")"),"加载中..."]},getQuestionDesc:function(t){if(!t)return"加载中...";var e="";t.required||(e+="(可选)"),"option"===t.type&&(t.isMulti?e+="多选题":e+="单选题");var n=this.historyExams.find(function(e){return e.hashCode===t.hashCode});if(n){this.isReviewError&&n.errorTimes&&(e+=" (做错次数: ".concat(n.errorTimes,")"));var i=n.errorTimes+n.rightTimes;i>0&&(e+="(历史正确率:".concat((n.rightTimes/i*100).toFixed(0),"%)"))}return e},setAnswer:function(t,e){this.answers=d()(this.answers).map(function(n,i){return i===t&&(n.results=e.map(function(t){return{api:t}}),n.single.api=e[0],n.multi.apis=e),n})},toggleAnswer:function(t,e){var n=this.answers[t].multi.apis;n.includes(e)?n=n.filter(function(t){return t!==e}):(n.push(e),n=d()(n)),this.setAnswer(t,n)},checkResult:function(t){var e=this;this.answers=d()(this.answers).map(function(n,i){if(t!==i&&null!=t)return n;console.log(d()(e.questions),i);var s=e.questions[i];if(!s)return n;var a=s.answerOptions.filter(function(t){return t.isRight}).map(function(t){return t.api});return n.results.forEach(function(t){t.isMistake=!a.includes(t.api)}),n.isAnswered=n.results.filter(function(t){return t.api}).length>0,!n.isChecked&&n.isAnswered&&(n.isMistake=n.results.length!==a.length||!!n.results.find(function(t){return t.isMistake}),n.isPass=n.isAnswered&&!n.isMistake,n.isChecked=!0),n})},turnTo:function(t){var e=this.$refs.root;e&&(e.scrollTop=0),t>this.questionNum?this.transitionName="question-slide-left":this.transitionName="question-slide-right",this.previousQuestionNum=this.questionNum,this.questionNum=t},confirmSubmit:function(){var t=this,e=this.questionsInfo.filter(function(e){return t.isQuestionAnswered(e)}).length,n=this.totalNum,i=Math.round(e/n*100),s='\n <div class="submit-dialog-content">\n <div class="stats-row">\n <span class="stat-text">已答 <strong class="primary">'.concat(e,'</strong></span>\n <span class="stat-text">未答 <strong class="secondary">').concat(n-e,'</strong></span>\n <span class="stat-text">完成 <strong class="success">').concat(i,'%</strong></span>\n </div>\n <div class="progress-bar-container">\n <div class="progress-bar" style="width: ').concat(i,'%;"></div>\n </div>\n </div>\n ');K.a.confirm({title:"📋 提交答案",message:s,confirmButtonText:"确认提交",cancelButtonText:"继续答题",confirmButtonColor:"var(--primary-color)",className:"custom-submit-dialog",closeOnClickOverlay:!0}).then(function(){t.submit()}).catch(function(t){console.log(t)})},submit:function(){var t=this;this.checkResult();var e=this.questionsInfo.filter(function(e){return t.isQuestionAnswered(e)}).length;if(e<this.totalNum&&this.requireAllDone){var n='\n <div class="simple-dialog-content">\n <div class="simple-message">\n 还有 <strong class="warning">'.concat(this.totalNum-e,"</strong> 道题未答完\n </div>\n </div>\n ");K.a.alert({title:"提醒",message:n,confirmButtonText:"继续答题",className:"custom-warning-dialog",closeOnClickOverlay:!0})}else{var i=this.questionsInfo.filter(function(t){return t.answer.isPass}).length,s=(this.questionsInfo.filter(function(t){return t.answer.isMistake}).length,Math.round(i/this.totalNum*100));this.questionsInfo.filter(function(t){return t.answer.isChecked}).forEach(function(t){$t.queryByHashCode(t.hashCode).then(function(e){e||(e={relatedQuestion:t.hashCode,errorTimes:0}),t.answer.isPass?(isNaN(e.rightTimes)&&(e.rightTimes=0),e.rightTimes++):(isNaN(e.errorTimes)&&(e.errorTimes=0),e.errorTimes++),console.log(e),$t.upsert(e).then(function(){console.log("做题信息已保存")})})}),this.isShowResult=!0;var a="";s>=90?("🎉","太棒了!",a="custom-success-dialog"):s>=80?("👏","很好!",a="custom-success-dialog"):s>=70?("👍","不错!",a="custom-warning-dialog"):s>=60?("💪","继续努力!",a="custom-warning-dialog"):("📚","多多练习!",a="custom-error-dialog");var o='\n <div class="result-dialog-content">\n <div class="result-score '.concat(s>=70?"success":s>=60?"warning":"error",'">').concat(s,'%</div>\n <div class="result-summary">正确 ').concat(i,"/").concat(this.totalNum," 题</div>\n </div>\n ");K.a.alert({title:"📊 答题结果",message:o,confirmButtonText:"确定",className:a,closeOnClickOverlay:!0}),this.hasSubmit=!0}},adaptExamConfig:function(){var t=ne({},se,{},this.examConfig);t.questions=t.questions.map(function(t){return ne({},ie,{},t,{hashCode:t.hashCode,answerOptions:t.answerOptions?t.answerOptions.map(function(t){return ne({},t,{api:ht.getHashCode(t)+""})}):[]})}).filter(function(t){if(!t.describe||0===t.answerOptions.length)return console.log("错误的题目(无描述或无答案).",t),!1;var e=ht.groupArray(t.answerOptions,"isRight");if(1===e.length&&!e[0][0].isRight)return console.log("错误的题目(无正确答案).",t),!1;var n=ht.groupArray(t.answerOptions,"describe").map(function(t){if(t.length>1){var e=ne({},t[0]);return ht.groupArray(t,"isRight").length!==t.length&&(e.invalid=!0),e}return t[0]});return n.find(function(t){return t.invalid})?(console.log("错误的题目(答案中有重复描述且对错不一).",t),!1):(t.answerOptions=ht.randomSort(n),!0)}),t.questions=ht.randomSort(t.questions),this.examInfo=t,this.examHashCode=this.examConfig.hashCode,this.loadHistoryExamInfo()},getOptionColor:function(t,e){return this.isShowResult||this.isPractice&&t.answer.isChecked?t.answer.results.map(function(t){return t.api}).includes(e.api)&&e.isRight?"#44af11":"#cd0000":"#1989fa"},loadHistoryExamInfo:function(){var t=this;$t.queryMany(this.examConfig.questions.map(function(t){return t.hashCode})).then(function(e){t.historyExams=e.map(function(t){return ne({},t,{hashCode:t.relatedQuestion})})})},onTouchStart:function(t){var e=this.$refs.root;e&&(this.panStartScrollTop=e.scrollTop,console.log("touch开始,scrollTop:",this.panStartScrollTop))},swipe:function(t){switch(t.direction){case"Left":this.questionNum<this.totalNum-1&&this.turnTo(this.questionNum+1);break;case"Right":this.questionNum>0&&this.turnTo(this.questionNum-1);break;case"Up":this.showAcButtons=!1;break;case"Down":var e=this.$refs.root;if(e){var n=e.scrollTop;console.log("swipe Down触发,开始scrollTop:",this.panStartScrollTop,"结束scrollTop:",n),null!==this.panStartScrollTop&&this.panStartScrollTop<=5&&n<=5?(console.log("满足条件,显示目录弹窗"),this.showAcButtons=!0):console.log("不满足条件,不显示目录弹窗")}}},handleImageClick:function(t){var e=this;"img"===t.target.tagName.toLowerCase()&&(t.stopPropagation(),this.showImagePreview=!0,this.previewImageSrc=t.target.src,this.previewImageAlt=t.target.alt||"图片",navigator.vibrate&&navigator.vibrate(50),document.addEventListener("keydown",this.handleKeyDown),this.$nextTick(function(){e.adjustImagePreviewControlsPosition(),console.log("图片预览打开后DOM检查:");var t=e.$el.querySelector(".image-preview-overlay"),n=e.$el.querySelector(".image-preview-content"),i=e.$el.querySelector(".preview-image");console.log("overlay元素:",t),console.log("container元素:",n),console.log("img元素:",i),n&&(console.log("container计算样式:",window.getComputedStyle(n)),console.log("container位置信息:",n.getBoundingClientRect())),i&&(console.log("img计算样式:",window.getComputedStyle(i)),console.log("img位置信息:",i.getBoundingClientRect()))}))},adjustImagePreviewControlsPosition:function(){var t=this.$el.querySelector(".image-preview-controls-bar");if(t){var e=20,n=0;if(window.app&&window.app.immersed)n=window.app.immersed;else{var i=getComputedStyle(document.documentElement).getPropertyValue("--immersed-height").trim();i&&(n=r()(i.replace("px",""))||0)}window.innerWidth<=768&&(e=10);var s=e+n;t.style.top="".concat(s,"px")}},handleKeyDown:function(t){"Escape"===t.key&&this.showImagePreview&&this.closeImagePreview()},closeImagePreview:function(){this.showImagePreview=!1,this.previewImageSrc="",this.previewImageAlt="",this.resetImageTransform(),document.removeEventListener("keydown",this.handleKeyDown)},resetImageTransform:function(){this.zoomLevel=1,this.translateX=0,this.translateY=0,this.isDragging=!1,this.isZooming=!1,this.isMouseDragging=!1,this.mouseStartX=0,this.mouseStartY=0,this.lastClickTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.touchMoved=!1},onImageLoad:function(){this.$refs.previewImage&&(this.imageNaturalWidth=this.$refs.previewImage.naturalWidth,this.imageNaturalHeight=this.$refs.previewImage.naturalHeight,this.$refs.imageContainer&&(this.containerWidth=this.$refs.imageContainer.clientWidth,this.containerHeight=this.$refs.imageContainer.clientHeight))},zoomIn:function(){this.zoomLevel=Math.min(1.2*this.zoomLevel,5),this.constrainImagePosition()},zoomOut:function(){this.zoomLevel=Math.max(this.zoomLevel/1.2,.1),this.constrainImagePosition()},resetZoom:function(){this.zoomLevel=1,this.translateX=0,this.translateY=0},handleWheel:function(t){t.preventDefault();var e=t.deltaY>0?.9:1.1,n=Math.min(Math.max(this.zoomLevel*e,.1),5),i=this.$refs.imageContainer.getBoundingClientRect(),s=t.clientX-i.left-i.width/2,a=t.clientY-i.top-i.height/2,o=n/this.zoomLevel;this.translateX=this.translateX+s*(1-o),this.translateY=this.translateY+a*(1-o),this.zoomLevel=n,this.constrainImagePosition()},handleImageSwipe:function(t){if(t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),this.zoomLevel>1){switch(t.direction){case"Left":this.translateX-=50;break;case"Right":this.translateX+=50;break;case"Up":this.translateY+=50;break;case"Down":this.translateY-=50}this.constrainImagePosition()}},handleImageTouchStart:function(t){if(t.preventDefault(),t.stopPropagation(),1===t.touches.length){var e=Ct()(),n=t.touches[0],i=e-this.lastTouchTime,s=Math.abs(n.clientX-this.lastTouchX),a=Math.abs(n.clientY-this.lastTouchY),o=Math.sqrt(s*s+a*a);if(i<this.doubleTapDelay&&o<this.doubleTapDistance)return void this.handleTouchDoubleTap(t);this.lastTouchTime=e,this.lastTouchX=n.clientX,this.lastTouchY=n.clientY,this.touchMoved=!1,this.isDragging=!0,this.lastTouchX=n.clientX,this.lastTouchY=n.clientY,this.$refs.imageContainer&&this.$refs.imageContainer.classList.add("dragging")}else if(2===t.touches.length){this.isZooming=!0,this.isDragging=!1;var r=t.touches[0],c=t.touches[1];this.initialDistance=this.getDistance(r,c),this.initialZoom=this.zoomLevel,this.$refs.imageContainer&&this.$refs.imageContainer.classList.remove("dragging")}},handleTouchDoubleTap:function(t){1===this.zoomLevel?this.zoomToPoint(2,t.touches[0]):this.resetZoom()},handleImageTouchMove:function(t){if(t.preventDefault(),t.stopPropagation(),1===t.touches.length&&this.isDragging){var e=t.touches[0].clientX-this.lastTouchX,n=t.touches[0].clientY-this.lastTouchY;Math.sqrt(e*e+n*n)>5&&(this.touchMoved=!0),this.translateX+=e,this.translateY+=n,this.lastTouchX=t.touches[0].clientX,this.lastTouchY=t.touches[0].clientY,this.constrainImagePosition()}else if(2===t.touches.length&&this.isZooming){this.touchMoved=!0;var i=t.touches[0],s=t.touches[1],a=this.getDistance(i,s)/this.initialDistance;this.zoomLevel=Math.min(Math.max(this.initialZoom*a,.1),5),this.constrainImagePosition()}},handleImageTouchEnd:function(t){if(t.preventDefault(),t.stopPropagation(),t.touches.length<2&&(this.isZooming=!1),0===t.touches.length){if(this.checkBackgroundClick(t))return void this.closeImagePreview();this.isDragging=!1,this.$refs.imageContainer&&this.$refs.imageContainer.classList.remove("dragging")}},checkBackgroundClick:function(t){return!this.touchMoved&&("IMG"!==t.target.tagName&&!(!t.target.classList.contains("image-preview-content")&&!t.target.classList.contains("image-preview-overlay")))},getDistance:function(t,e){var n=t.clientX-e.clientX,i=t.clientY-e.clientY;return Math.sqrt(n*n+i*i)},constrainImagePosition:function(){if(this.$refs.previewImage&&this.$refs.imageContainer){var t,e,n=this.$refs.previewImage,i=this.$refs.imageContainer,s=(n.getBoundingClientRect(),i.getBoundingClientRect()),a=n.offsetWidth*this.zoomLevel,o=n.offsetHeight*this.zoomLevel;t=a<=s.width?(s.width-a)/2:(a-s.width)/2,e=o<=s.height?(s.height-o)/2:(o-s.height)/2;this.translateX,this.translateY;this.translateX=Math.max(-t,Math.min(t,this.translateX)),this.translateY=Math.max(-e,Math.min(e,this.translateY))}},handleBackgroundClick:function(t){(t.target.classList.contains("image-preview-overlay")||t.target.classList.contains("image-preview-content"))&&this.closeImagePreview()},handleContainerClick:function(t){},handlePreviewImageClick:function(t){t.stopPropagation()},handlePreviewImageDoubleClick:function(t){t.stopPropagation(),t.preventDefault(),1===this.zoomLevel?this.zoomToPoint(2,t):this.resetZoom()},handleDoubleClick:function(t){t.stopPropagation(),t.preventDefault(),t.target!==this.$refs.previewImage&&this.handlePreviewImageDoubleClick(t)},zoomToPoint:function(t,e){if(this.$refs.imageContainer){var n=this.$refs.imageContainer.getBoundingClientRect(),i=e.clientX,s=e.clientY,a=i-n.left-n.width/2,o=s-n.top-n.height/2,r=t/this.zoomLevel;this.translateX=this.translateX-a*(r-1),this.translateY=this.translateY-o*(r-1),this.zoomLevel=t,this.constrainImagePosition()}},handleMouseDown:function(t){console.log("=== 鼠标按下事件触发 ===",{button:t.button,clientX:t.clientX,clientY:t.clientY,target:t.target.tagName}),0===t.button&&(t.preventDefault(),t.stopPropagation(),this.isMouseDragging=!0,this.mouseStartX=t.clientX,this.mouseStartY=t.clientY,console.log("开始拖拽状态:",{isMouseDragging:this.isMouseDragging,startX:this.mouseStartX,startY:this.mouseStartY}),this.$refs.imageContainer&&this.$refs.imageContainer.classList.add("dragging"))},handleMouseMove:function(t){if(this.isMouseDragging){t.preventDefault(),t.stopPropagation();var e=t.clientX-this.mouseStartX,n=t.clientY-this.mouseStartY;console.log("=== 鼠标移动事件触发 ===",{isMouseDragging:this.isMouseDragging,deltaX:e,deltaY:n,currentTranslateX:this.translateX,currentTranslateY:this.translateY,zoomLevel:this.zoomLevel}),this.translateX+=e,this.translateY+=n,console.log("拖动后位置:",{newTranslateX:this.translateX,newTranslateY:this.translateY}),this.constrainImagePosition(),this.mouseStartX=t.clientX,this.mouseStartY=t.clientY}},handleMouseUp:function(t){this.isMouseDragging&&(t.preventDefault(),t.stopPropagation(),this.isMouseDragging=!1,this.$refs.imageContainer&&this.$refs.imageContainer.classList.remove("dragging"))},handleMouseLeave:function(t){this.isMouseDragging&&this.handleMouseUp(t)}},props:{examConfig:{type:Object,default:function(){return se}},isReviewError:{type:Boolean,default:!1},neverDo:{type:Boolean,default:!1},isNew:{type:Boolean,default:!1},requireAllDone:{type:Boolean,default:!1},isPractice:{type:Boolean,default:!0}},watch:{examConfig:function(){this.adaptExamConfig()}},mounted:function(){this.adaptExamConfig(),console.log("开始答题");try{plus.device.setWakelock(!0),console.log("打开屏幕常亮")}catch(t){}this.registerBackInterceptor()},destroyed:function(){console.log("结束答题");try{plus.device.setWakelock(!1),console.log("关闭屏幕常亮")}catch(t){}this.unregisterBackInterceptor(),document.removeEventListener("keydown",this.handleKeyDown)}},oe={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"finger",rawName:"v-finger:swipe",value:t.swipe,expression:"swipe",arg:"swipe"}],ref:"root",staticClass:"exam-root",on:{touchstart:t.onTouchStart}},[n("van-nav-bar",{staticClass:"exam-nav-bar",attrs:{title:t.examInfo.title,fixed:"","left-arrow":"","right-text":"目录"},on:{"click-left":t.handleBack,"click-right":function(e){t.showAcButtons=!t.showAcButtons}}}),t._v(" "),n("transition",{attrs:{name:"fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showAcButtons,expression:"showAcButtons"}],staticClass:"ac-qn-backdrop",on:{click:function(e){e.stopPropagation(),t.showAcButtons=!1}}},[n("div",{staticClass:"exam-p-around-small ac-qn theme-card",on:{click:function(t){t.stopPropagation()}}},[n("div",{staticClass:"qn-header"},[n("h3",[t._v("题目导航")]),t._v(" "),n("span",{staticClass:"qn-progress"},[t._v(t._s(t.questionNum+1)+" / "+t._s(t.totalNum))])]),t._v(" "),n("van-row",{staticClass:"question-nav-grid"},t._l(t.questionsInfo,function(e,i){return n("van-col",{key:i,attrs:{span:"4"}},[n("div",{staticClass:"exam-circle exam-done theme-button",class:t.getQuestionNavClass(e,i),on:{click:function(e){return t.turnTo(i)}}},[t._v("\n "+t._s(i+1)+"\n ")])])}),1)],1)])]),t._v(" "),n("div",{staticClass:"question-container"},[n("transition",{attrs:{name:t.transitionName,mode:"out-in"}},[t.questionsInfo[t.questionNum]?n("div",{key:t.questionNum,staticClass:"question-item"},[n("div",{staticClass:"question-card theme-card"},[n("div",{staticClass:"question-header",on:{click:t.handleImageClick}},[t._l(t.getQuestionTitle(t.questionsInfo[t.questionNum]),function(e){return n("div",{staticClass:"question-title",domProps:{innerHTML:t._s(e)}})}),t._v(" "),n("div",{staticClass:"question-desc"},[t._v(t._s(t.getQuestionDesc(t.questionsInfo[t.questionNum])))])],2),t._v(" "),t.questionsInfo[t.questionNum].isMulti?n("div",{staticClass:"options-container"},[n("van-checkbox-group",{on:{click:function(t){t.stopPropagation()}},model:{value:t.questionsInfo[t.questionNum].answer.multi.apis,callback:function(e){t.$set(t.questionsInfo[t.questionNum].answer.multi,"apis",e)},expression:"questionsInfo[questionNum].answer.multi.apis"}},[n("div",{staticClass:"option-list"},t._l(t.questionsInfo[t.questionNum].answerOptions,function(e,i){return n("div",{key:i,staticClass:"option-item theme-card",class:{"option-selected":t.questionsInfo[t.questionNum].answer.multi.apis.includes(e.api),"option-correct":e.isRight&&(t.isShowResult||t.questionsInfo[t.questionNum].answer.isChecked&&t.isPractice),"option-incorrect":!e.isRight&&(t.isShowResult||!e.isRight&&t.questionsInfo[t.questionNum].answer.isAnswered&&t.isPractice)&&t.questionsInfo[t.questionNum].answer.multi.apis.includes(e.api)},on:{click:function(n){return t.toggleAnswer(t.questionNum,e.api)}}},[n("div",{staticClass:"option-content"},[n("div",{staticClass:"option-label"},[t._v(t._s(t.letterIndex[i]))]),t._v(" "),n("div",{staticClass:"option-text",domProps:{innerHTML:t._s(e.describe)},on:{click:t.handleImageClick}}),t._v(" "),n("van-checkbox",{staticClass:"option-checkbox",attrs:{name:e.api,"checked-color":t.getOptionColor(t.questionsInfo[t.questionNum],e)}})],1)])}),0)])],1):t._e(),t._v(" "),t.questionsInfo[t.questionNum].isMulti?t._e():n("div",{staticClass:"options-container"},[n("van-radio-group",{model:{value:t.questionsInfo[t.questionNum].answer.single.api,callback:function(e){t.$set(t.questionsInfo[t.questionNum].answer.single,"api",e)},expression:"questionsInfo[questionNum].answer.single.api"}},[n("div",{staticClass:"option-list"},t._l(t.questionsInfo[t.questionNum].answerOptions,function(e,i){return n("div",{key:i,staticClass:"option-item theme-card",class:{"option-selected":t.questionsInfo[t.questionNum].answer.single.api===e.api,"option-correct":e.isRight&&(t.isShowResult||t.questionsInfo[t.questionNum].answer.isChecked&&t.isPractice),"option-incorrect":!e.isRight&&(t.isShowResult||!e.isRight&&t.questionsInfo[t.questionNum].answer.isAnswered&&t.isPractice)&&t.questionsInfo[t.questionNum].answer.single.api===e.api},on:{click:function(n){return t.setAnswer(t.questionNum,[e.api])}}},[n("div",{staticClass:"option-content"},[n("div",{staticClass:"option-label"},[t._v(t._s(t.letterIndex[i]))]),t._v(" "),n("div",{staticClass:"option-text",domProps:{innerHTML:t._s(e.describe)},on:{click:t.handleImageClick}}),t._v(" "),n("van-radio",{staticClass:"option-radio",attrs:{name:e.api,"checked-color":t.getOptionColor(t.questionsInfo[t.questionNum],e)}})],1)])}),0)])],1),t._v(" "),t.isShowResult||!t.isPractice||t.questionsInfo[t.questionNum].answer.isChecked?n("div",{staticClass:"question-analysis"},[n("div",{staticClass:"analysis-header"},[n("van-icon",{attrs:{name:"info-o"}}),t._v(" "),n("span",[t._v("题目解析")])],1),t._v(" "),n("div",{staticClass:"analysis-content",domProps:{innerHTML:t._s(t.questionsInfo[t.questionNum].analysis||"暂无解析")},on:{click:t.handleImageClick}})]):t._e()])]):n("div",{staticClass:"loading-item"},[n("div",{staticClass:"question-card theme-card"},[n("div",{staticClass:"question-header"},[n("div",{staticClass:"question-title"},[t._v("加载中...")]),t._v(" "),n("div",{staticClass:"question-desc"},[t._v("正在加载题目数据")])])])])])],1),t._v(" "),t.questionsInfo[t.questionNum]?n("div",{staticClass:"ac-buttons theme-card"},[n("div",{staticClass:"button-row"},[t.questionNum>0?n("van-button",{staticClass:"nav-button theme-button",attrs:{round:""},on:{click:function(e){return t.turnTo(t.questionNum-1)}}},[n("van-icon",{attrs:{name:"arrow-left"}}),t._v("\n 上一题\n ")],1):t._e(),t._v(" "),t.questionNum<t.totalNum-1?n("van-button",{staticClass:"nav-button theme-button",attrs:{type:"info",round:""},on:{click:function(e){return t.turnTo(t.questionNum+1)}}},[t._v("\n 下一题\n "),n("van-icon",{attrs:{name:"arrow"}})],1):t._e()],1),t._v(" "),n("div",{staticClass:"button-row"},[t.isPractice&&!t.questionsInfo[t.questionNum].answer.isChecked?n("van-button",{staticClass:"action-button theme-button",attrs:{type:"warning",round:"",block:""},on:{click:function(e){return t.checkResult(t.questionNum)}}},[n("van-icon",{attrs:{name:"eye-o"}}),t._v("\n 检查答案\n ")],1):t._e(),t._v(" "),t.hasSubmit?t._e():n("van-button",{staticClass:"submit-button theme-button pulse",attrs:{type:"primary",round:"",block:""},on:{click:t.confirmSubmit}},[n("van-icon",{attrs:{name:"success"}}),t._v("\n 提交答案\n ")],1)],1)]):t._e(),t._v(" "),t.showImagePreview?n("div",{staticClass:"image-preview-overlay",on:{click:t.handleBackgroundClick}},[n("div",{staticClass:"image-preview-controls-bar",on:{click:function(t){t.stopPropagation()}}},[n("van-icon",{staticClass:"control-icon",attrs:{name:"minus"},on:{click:t.zoomOut}}),t._v(" "),n("span",{staticClass:"zoom-text"},[t._v(t._s(Math.round(100*t.zoomLevel))+"%")]),t._v(" "),n("van-icon",{staticClass:"control-icon",attrs:{name:"plus"},on:{click:t.zoomIn}}),t._v(" "),n("van-icon",{staticClass:"control-icon",attrs:{name:"replay",title:"重置"},on:{click:t.resetZoom}}),t._v(" "),n("van-icon",{staticClass:"control-icon close-icon",attrs:{name:"cross"},on:{click:t.closeImagePreview}})],1),t._v(" "),n("div",{ref:"imageContainer",staticClass:"image-preview-content",on:{click:t.handleContainerClick,dblclick:t.handleDoubleClick,mousedown:t.handleMouseDown,mousemove:t.handleMouseMove,mouseup:t.handleMouseUp,mouseleave:t.handleMouseLeave,touchstart:t.handleImageTouchStart,touchmove:t.handleImageTouchMove,touchend:t.handleImageTouchEnd,wheel:t.handleWheel}},[n("img",{ref:"previewImage",staticClass:"preview-image",style:t.imageStyle,attrs:{src:t.previewImageSrc,alt:t.previewImageAlt},on:{load:t.onImageLoad,dragstart:function(t){t.preventDefault()},dblclick:function(e){return e.stopPropagation(),t.handlePreviewImageDoubleClick(e)}}})])]):t._e()],1)},staticRenderFns:[]};var re=n("VU/8")(ae,oe,!1,function(t){n("PC7f")},"data-v-6760d575",null).exports,ce=n("crjn"),ue=n.n(ce);function le(t,e){var n=M()(t);if(B.a){var i=B()(t);e&&(i=i.filter(function(e){return D()(t,e).enumerable})),n.push.apply(n,i)}return n}function he(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?le(n,!0).forEach(function(e){R()(t,e,n[e])}):S.a?I()(t,S()(n)):le(n).forEach(function(e){_()(t,e,D()(n,e))})}return t}i.a.use(y.a),i.a.use(Q.a).use(W.a),i.a.use(U.a),i.a.use(Z.a),i.a.use(K.a),i.a.use(Y.a),i.a.use(X.a);var me={name:"CategoryPage",data:function(){return{examList:[],isShowOption:!1,optionInfo:{hashCode:""},currentExam:{},historyRecords:[]}},computed:{categoryName:function(){return this.$route.params.category||"default"},categoryTitle:function(){return"default"===this.categoryName?"默认分类":this.categoryName}},methods:{handleBack:function(){window.GlobalBackManager?window.GlobalBackManager.goBack():this.$router.back()},loadCategoryExams:function(){var t=v()(u.a.mark(function t(){var e,n,i,s;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.categoryName,t.prev=1,t.next=4,Ht.query("hashCode").notEqual("").toArray();case 4:return n=t.sent,(i=n.filter(function(t){return(t.category||"default")===e})).sort(function(t,e){return t.title.split("").reduce(function(t,e){return t+e.charCodeAt(0)},0)-e.title.split("").reduce(function(t,e){return t+e.charCodeAt(0)},0)}),s=i.map(function(t){return $t.query("relatedQuestion").anyOf(t.questions).sortBy("createDate").then(function(e){var n=Object.fromEntries(e.map(function(t){return[t.relatedQuestion,he({},t,{times:t.errorTimes})]})),i=!!et()(n).find(function(t){return t.times>0});return he({},t,{errorMap:n,hasHistoryError:i})})}),t.next=10,O.a.all(s);case 10:this.examList=t.sent,t.next=17;break;case 13:t.prev=13,t.t0=t.catch(1),console.error("加载分类题库失败:",t.t0),this.examList=[];case 17:case"end":return t.stop()}},t,this,[[1,13]])}));return function(){return t.apply(this,arguments)}}(),showOption:function(){var t=v()(u.a.mark(function t(e){var n;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.hasHistoryError){t.next=17;break}return this.optionInfo.hashCode=e.hashCode,this.currentExam=e,t.prev=3,t.next=6,$t.queryMany(e.questions||[]);case 6:n=t.sent,this.historyRecords=n,t.next=14;break;case 10:t.prev=10,t.t0=t.catch(3),console.error("加载历史记录失败:",t.t0),this.historyRecords=[];case 14:this.isShowOption=!0,t.next=18;break;case 17:this.doExam(e.hashCode);case 18:case"end":return t.stop()}},t,this,[[3,10]])}));return function(e){return t.apply(this,arguments)}}(),getTotalCounts:function(){return this.currentExam.questions?this.currentExam.questions.length:0},getErrorCounts:function(){return this.currentExam.questions&&this.historyRecords.length?this.historyRecords.filter(function(t){return t.errorTimes>0}).length:0},getUndoneCounts:function(){if(!this.currentExam.questions||!this.historyRecords.length)return this.getTotalCounts();var t=this.historyRecords.filter(function(t){return(t.errorTimes||0)+(t.rightTimes||0)>0}).length;return this.getTotalCounts()-t},doExam:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.isShowOption=!1,Ht.query("hashCode").equals(t).first().then(function(t){return O.a.all([t].concat(d()(t.questions.map(function(t){return Ot.query("hashCode").equals(t).first()}))))}).then(function(t){var s=ue()(t),a=s[0],o=s.slice(1);a.questions=o,a?e.$router.push({name:"DoExamPage",params:{examConfig:a,isReviewError:n,neverDo:i}}):K.a.alert({message:"该题库已失效!"})})},clearHistory:function(t){var e=this;this.isShowOption=!1,Ht.queryByHashCode(t).then(function(t){return t=t||{},$t.delete(t.questions||[])}).then(function(){console.log("remove the history."),e.loadCategoryExams()})}},mounted:function(){var t=v()(u.a.mark(function t(){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.loadCategoryExams();case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),watch:{"$route.params.category":{handler:function(){this.loadCategoryExams()},immediate:!1}}},de={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"category-page"},[n("van-nav-bar",{staticClass:"category-nav-bar",attrs:{title:t.categoryTitle,fixed:"","left-arrow":""},on:{"click-left":t.handleBack}}),t._v(" "),n("div",{staticClass:"category-container"},[n("div",{staticClass:"category-header"},[n("h2",{staticClass:"gradient-text"},[t._v(t._s(t.categoryName))]),t._v(" "),n("p",{staticClass:"category-desc"},[t._v("共 "+t._s(t.examList.length)+" 个题库")])]),t._v(" "),n("transition",{attrs:{name:"slide-up"}},[t.examList.length>0?n("van-grid",{staticClass:"exam-grid",attrs:{"column-num":1,gutter:12}},t._l(t.examList,function(e,i){return n("van-grid-item",{key:e.hashCode,staticClass:"exam-item-card",style:{"animation-delay":.05*i+"s"},attrs:{clickable:""},on:{click:function(n){return t.showOption(e)}}},[n("div",{staticClass:"exam-card-content"},[n("div",{staticClass:"exam-icon"},[n("van-icon",{attrs:{name:"notes-o",size:"24",color:e.hasHistoryError?"var(--warning-color)":"var(--primary-color)"}})],1),t._v(" "),n("div",{staticClass:"exam-info"},[n("h3",{staticClass:"exam-title"},[t._v(t._s(e.title))]),t._v(" "),n("p",{staticClass:"exam-meta"},[t._v("题目数量: "+t._s(e.questions?e.questions.length:0))]),t._v(" "),e.hasHistoryError?n("div",{staticClass:"exam-status"},[n("van-tag",{attrs:{type:"warning",size:"mini"}},[t._v("有错题")])],1):t._e()]),t._v(" "),n("div",{staticClass:"exam-arrow"},[n("van-icon",{attrs:{name:"arrow"}})],1)])])}),1):n("div",{staticClass:"empty-state"},[n("div",{staticClass:"empty-icon"},[n("van-icon",{attrs:{name:"warning-o",size:"48",color:"var(--text-light)"}})],1),t._v(" "),n("p",{staticClass:"empty-text"},[t._v("该分类下暂无题库")]),t._v(" "),n("van-button",{attrs:{type:"primary",round:""},on:{click:function(e){return t.$router.push("/")}}},[t._v("\n 返回首页\n ")])],1)],1)],1),t._v(" "),n("van-popup",{staticClass:"option-popup",attrs:{position:"bottom",round:""},on:{"click-overlay":function(e){t.isShowOption=!1}},model:{value:t.isShowOption,callback:function(e){t.isShowOption=e},expression:"isShowOption"}},[n("div",{staticClass:"exam-options"},[n("div",{staticClass:"popup-header"},[n("div",{staticClass:"header-info"},[n("h3",[t._v("选择答题模式")]),t._v(" "),n("p",{staticClass:"exam-title"},[t._v(t._s(t.currentExam.title))])]),t._v(" "),n("van-icon",{staticClass:"close-icon",attrs:{name:"cross"},on:{click:function(e){t.isShowOption=!1}}})],1),t._v(" "),n("div",{staticClass:"option-grid"},[n("div",{staticClass:"option-item",class:{disabled:0===t.getUndoneCounts()},on:{click:function(e){t.getUndoneCounts()>0&&t.doExam(t.optionInfo.hashCode,!1,!0)}}},[n("div",{staticClass:"option-icon new"},[n("van-icon",{attrs:{name:"edit"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("未做题")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v(t._s(t.getUndoneCounts())+"题")])])]),t._v(" "),n("div",{staticClass:"option-item primary",class:{disabled:0===t.getTotalCounts()},on:{click:function(e){t.getTotalCounts()>0&&t.doExam(t.optionInfo.hashCode)}}},[n("div",{staticClass:"option-icon"},[n("van-icon",{attrs:{name:"replay"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("重新测试")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v(t._s(t.getTotalCounts())+"题")])])]),t._v(" "),n("div",{staticClass:"option-item warning",class:{disabled:0===t.getErrorCounts()},on:{click:function(e){t.getErrorCounts()>0&&t.doExam(t.optionInfo.hashCode,!0)}}},[n("div",{staticClass:"option-icon"},[n("van-icon",{attrs:{name:"question-o"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("复习错题")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v(t._s(t.getErrorCounts())+"题")])])]),t._v(" "),n("div",{staticClass:"option-item danger",on:{click:function(e){return t.clearHistory(t.optionInfo.hashCode)}}},[n("div",{staticClass:"option-icon"},[n("van-icon",{attrs:{name:"delete-o"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("清空记录")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v("重置")])])])])])])],1)},staticRenderFns:[]};var pe=n("VU/8")(me,de,!1,function(t){n("a1wf")},"data-v-c5d00de0",null).exports;i.a.use(C.a);var ve=new C.a({routes:[{path:"/",name:"HomePage",component:jt},{path:"/category/:category",name:"CategoryPage",component:pe,props:!0},{path:"/exam",name:"DoExamPage",component:re,props:!0}]}),ge=(n("ZsCP"),n("TXXm"),n("eqfM"),n("/QYm")),fe=n("mtWM"),we=n.n(fe),Ce=n("hU7x"),ye=n.n(Ce),be=n("7oBh"),ke=n.n(be),xe=n("vhKK"),_e=n.n(xe);if(i.a.use(_e.a,{AlloyFinger:ke.a}),i.a.use(ge.a),i.a.prototype.$http=we.a,i.a.prototype.$http.jsonp=ye.a,Object.fromEntries||(Object.fromEntries=ht.fromEntries),!Array.prototype.flat)try{_()(Array.prototype,"flat",{value:function(t){return ht.flat(this,t)},enumerable:!1})}catch(t){Array.prototype.flat=function(t){return ht.flat(this,t)}}i.a.config.productionTip=!1,new i.a({el:"#app",router:ve,components:{App:w},template:"<App/>"})},PC7f:function(t,e){},RUOb:function(t,e){},TXXm:function(t,e){},WkQV:function(t,e){},ZsCP:function(t,e){},a1wf:function(t,e){},eh36:function(t,e){},hW8u:function(t,e){},"hy4/":function(t,e){},juSK:function(t,e){},nLpc:function(t,e){},nOtf:function(t,e){},nsZj:function(t,e){},px3J:function(t,e){},sKgQ:function(t,e){}},["NHnr"]);
|
2
|
-
//# sourceMappingURL=app.
|
1
|
+
webpackJsonp([1],{"+c27":function(t,e){},"/E+L":function(t,e){},"/h4W":function(t,e){},"4rJS":function(t,e){},"6Zvi":function(t,e){},"8NIx":function(t,e){},"97dx":function(t,e){},JKiR:function(t,e){},NAlg:function(t,e){},NHnr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n("7+uW"),s=n("E1O6"),a=n.n(s),o=n("jAqF"),r=n.n(o),c=n("Tg6C"),u=n.n(c),l=n("Sg1L"),h=n.n(l),m=n("s1qc"),d=n.n(m),p=n("GiJQ"),v=n.n(p),f={name:"App",data:function(){return{direction:"slide-right",lastBackPressTime:0,backPressInterval:2e3,immersed:20,navHeight:46,isImmersed:!1}},mounted:function(){this.initPlusReady(),this.initGlobalBackManager()},beforeDestroy:function(){this.removeBackButtonListener(),this.cleanupImmersiveStyles(),this.cleanupGlobalBackManager()},methods:{initGlobalBackManager:function(){var t=this;window.GlobalBackManager={interceptors:[],addInterceptor:function(e){t.addBackInterceptor(e)},removeInterceptor:function(e){t.removeBackInterceptor(e)},goBack:function(){t.handleGlobalBack()}},this.$root.globalBack=function(){t.handleGlobalBack()},console.log("全局返回管理器初始化完成")},addBackInterceptor:function(t){"function"==typeof t&&window.GlobalBackManager.interceptors.push(t)},removeBackInterceptor:function(t){var e=window.GlobalBackManager.interceptors.indexOf(t);e>-1&&window.GlobalBackManager.interceptors.splice(e,1)},handleGlobalBack:function(){var t=v()(u.a.mark(function t(){var e,n,i,s,a,o,r;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=d()(window.GlobalBackManager.interceptors).reverse(),n=!0,i=!1,s=void 0,t.prev=4,a=h()(e);case 6:if(n=(o=a.next()).done){t.next=23;break}return r=o.value,t.prev=8,t.next=11,r();case 11:if(!t.sent){t.next=15;break}return console.log("返回操作被拦截"),t.abrupt("return");case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(8),console.error("返回拦截器执行错误:",t.t0);case 20:n=!0,t.next=6;break;case 23:t.next=29;break;case 25:t.prev=25,t.t1=t.catch(4),i=!0,s=t.t1;case 29:t.prev=29,t.prev=30,n||null==a.return||a.return();case 32:if(t.prev=32,!i){t.next=35;break}throw s;case 35:return t.finish(32);case 36:return t.finish(29);case 37:this.executeDefaultBack();case 38:case"end":return t.stop()}},t,this,[[4,25,29,37],[8,17],[30,,32,36]])}));return function(){return t.apply(this,arguments)}}(),executeDefaultBack:function(){"/"!==this.$route.path?this.hasOpenDialog()?this.closeTopDialog():this.$router.back():this.handleHomePageBack()},initPlusReady:function(){var t=this,e=function(){t.setupImmersiveStatusBar(),t.addBackButtonListener()};window.plus?e():document.addEventListener("plusready",e,!1),this.detectImmersiveMode()},detectImmersiveMode:function(){this.immersed=20;var t=/Html5Plus\/.+\s\(.*(Immersed\/(\d+\.?\d*).*)\)/gi.exec(navigator.userAgent);t&&t.length>=3?(this.immersed=r()(t[2]),this.isImmersed=!0,console.log("检测到沉浸式状态栏,高度:",this.immersed)):(this.isImmersed=!1,this.immersed=0,console.log("非沉浸式状态栏模式")),window.app=window.app||{},window.app.immersed=this.immersed,window.app.navHeight=this.navHeight,window.app.isImmersed=this.isImmersed,this.applyImmersiveStyles()},setupImmersiveStatusBar:function(){if("undefined"!=typeof plus)try{var t=plus.navigator.getStatusBarHeight();t>0&&(this.immersed=t,this.isImmersed=!0,window.app=window.app||{},window.app.immersed=this.immersed,window.app.navHeight=this.navHeight,window.app.isImmersed=this.isImmersed),this.applyImmersiveStyles(),console.log("沉浸式状态栏设置完成,高度:",this.immersed)}catch(t){console.warn("设置沉浸式状态栏失败:",t)}},applyImmersiveStyles:function(){this.isImmersed&&this.immersed>0&&this.injectImmersiveStyles()},injectImmersiveStyles:function(){var t=document.getElementById("immersive-style");t&&t.remove();var e=document.createElement("style");e.id="immersive-style",e.innerHTML=".van-nav-bar { padding-top: "+this.immersed+"px !important; height: "+(this.navHeight+this.immersed)+'px !important; }.van-nav-bar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: '+this.immersed+"px; background: var(--primary-gradient); z-index: -1; }.van-nav-bar__title { margin-top: 0 !important; }.van-nav-bar__left, .van-nav-bar__right { margin-top: 0 !important; }#app { padding-top: "+(this.navHeight+this.immersed)+"px !important; }.appView { min-height: calc(100vh - "+(this.navHeight+this.immersed)+"px) !important; }.question-container { padding-top: "+(this.immersed+60)+"px !important; }.page-container { padding-top: "+(this.immersed+60)+"px !important; }.category-container { padding-top: "+(this.immersed+60)+'px !important; }.van-nav-bar[class*="fixed"] { position: fixed !important; top: 0 !important; z-index: 1000 !important; }body { --immersed-height: '+this.immersed+"px; --nav-total-height: "+(this.navHeight+this.immersed)+"px; }body.immersive-mode #app { /* 为沉浸式模式提供额外样式钩子 */ }",document.head.appendChild(e),document.body.classList.add("immersive-mode"),console.log("沉浸式样式已注入")},cleanupImmersiveStyles:function(){var t=document.getElementById("immersive-style");t&&t.remove(),document.body.classList.remove("immersive-mode"),document.documentElement.style.removeProperty("--immersed-height"),document.documentElement.style.removeProperty("--nav-total-height"),window.app&&(delete window.app.immersed,delete window.app.navHeight,delete window.app.isImmersed)},cleanupGlobalBackManager:function(){window.GlobalBackManager&&(window.GlobalBackManager.interceptors=[],delete window.GlobalBackManager),this.$root.globalBack&&delete this.$root.globalBack,console.log("全局返回管理器已清理")},addBackButtonListener:function(){"undefined"!=typeof plus&&plus.key.addEventListener("backbutton",this.onBackButton,!1)},removeBackButtonListener:function(){"undefined"!=typeof plus&&plus.key.removeEventListener("backbutton",this.onBackButton)},onBackButton:function(){this.handleGlobalBack()},handleHomePageBack:function(){var t=(new Date).getTime();t-this.lastBackPressTime<this.backPressInterval?plus.runtime.quit():(this.lastBackPressTime=t,this.showExitTip())},showExitTip:function(){this.$toast?this.$toast("再按一次退出应用"):void 0!==this.$Toast?this.$Toast("再按一次退出应用"):"undefined"!=typeof plus&&plus.nativeUI?plus.nativeUI.toast("再按一次退出应用"):alert("再按一次退出应用")},hasOpenDialog:function(){var t=document.querySelectorAll(".van-overlay, .van-popup, .van-dialog, .van-action-sheet, .van-picker");return a()(t).some(function(t){var e=window.getComputedStyle(t);return"none"!==e.display&&"hidden"!==e.visibility})},closeTopDialog:function(){for(var t=document.querySelectorAll(".van-overlay, .van-popup .van-popup--center, .van-dialog, .van-action-sheet, .van-picker"),e=t.length-1;e>=0;e--){var n=t[e],i=window.getComputedStyle(n);if("none"!==i.display&&"hidden"!==i.visibility){var s=n.querySelector(".van-popup__close-icon, .van-dialog__confirm, .van-picker__cancel");return s?void s.click():n.classList.contains("van-overlay")?void n.click():void(n.style.display="none")}}}},watch:{$route:function(t,e){var n=function(t){return"/"===t?1:t.startsWith("/category/")?2:"/exam"===t?3:1},i=n(t.path),s=n(e.path);this.direction=i>s?"slide-left":i<s?"slide-right":"slide-left"}}},g={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"app"}},[e("transition",{attrs:{name:this.direction}},[e("router-view",{staticClass:"appView"})],1)],1)},staticRenderFns:[]};var w=n("VU/8")(f,g,!1,function(t){n("WkQV")},null,null).exports,C=n("/ocq"),y=(n("FO5P"),n("woHG")),b=(n("RgoE"),n("0KWt")),k=(n("1E9F"),n("2Ux5")),x=n("L8Ge"),_=n.n(x),q=n("pDAi"),I=n.n(q),T=n("rXUV"),D=n.n(T),S=n("0VsM"),P=n.n(S),L=n("4vMe"),E=n.n(L),B=n("6Cj1"),M=n.n(B),N=n("6qwz"),O=n.n(N),H=n("/xtf"),$=n.n(H),A=n("0VlM"),R=n.n(A),X=(n("k3b4"),n("+2ln")),Y=(n("3ab0"),n("bHMa")),z=(n("cZ0s"),n("fIxc")),G=(n("RIEG"),n("zjGD")),Q=(n("YP+l"),n("EA31")),W=(n("sgvh"),n("zc1Q")),U=(n("mMXg"),n("qYlo")),Z=(n("3Lne"),n("SSsa")),j=(n("MY4N"),n("0zAV")),F=(n("OWWB"),n("1fWZ")),V=(n("i0mo"),n("Hkar")),K=(n("XmAh"),n("il3B")),J=(n("nOaS"),n("pIDD")),tt=n("7U2N"),et=n.n(tt),nt=n("IG2y"),it=n.n(nt),st=n("49HJ"),at=n.n(st),ot=n("Yo5Z"),rt=n.n(ot),ct=n("ckt0"),ut=n.n(ct);function lt(t,e){var n=M()(t);if(E.a){var i=E()(t);e&&(i=i.filter(function(e){return P()(t,e).enumerable})),n.push.apply(n,i)}return n}var ht={getHashCode:function(t){return this.getStrHashCode(this.getMessage(t).concat(this.getPropertyNames(t)).join(""))},getPropertyNames:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return n<=0?"":!t||["string","number","boolean","function"].includes(ut()(t))||t instanceof Date?"":this.flat(rt()(t).map(function(t){var i=at()(t,2),s=i[0],a=i[1];return[s,e.getPropertyNames(a,n--)]})).filter(function(t){return null!=t&&""!==t})},getMessage:function(t,e){var n=this;return null==e&&(e=10),e<=0?"":!t||["string","number","boolean","function"].includes(ut()(t))||t instanceof Date?[null!=t?t.toString():""]:this.flat(M()(t).map(function(i){return n.getMessage(t[i],e--)})).filter(function(t){return null!=t&&""!==t})},getStrHashCode:function(t){var e,n,i=0;if(0===t.length)return i;for(e=0,n=t.length;e<n;e++)i=(i<<5)-i+t.charCodeAt(e),i|=0;return i+""},flat:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=[],i=!1;return t.forEach(function(t){it()(t)?(i=!0,n.push.apply(n,d()(t))):n.push(t)}),i&&e>0?this.flat(n,e--):n},fromEntries:function(t){var e={};return t.forEach(function(t){t instanceof Array&&(e[t[0]]=t[1])}),e},storage:{getItem:function(t){var e=localStorage.getItem("__exam_s0_"+t),n=null;try{n=JSON.parse(e)}catch(e){console.log("No valid item for key [".concat(t,"] to get in storage."))}return n},setItem:function(t,e){var n=null;try{n=$()(e),localStorage.setItem("__exam_s0_"+t,n)}catch(e){console.log("Not valid item for key [".concat(t,"] to set."))}},removeItem:function(t){localStorage.removeItem("__exam_s0_"+t)}},groupArray:function(t,e){var n=this,i=t.map(function(t){return{hashCode:n.getHashCode(t),item:t}});e instanceof Array||(e=[e]);var s={};return i.map(function(t){return{hashCode:t.hashCode,checkItem:Object.fromEntries(e.map(function(e){return[e,(t.item||{})[e]]}))}}).map(function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lt(n,!0).forEach(function(e){R()(t,e,n[e])}):D.a?I()(t,D()(n)):lt(n).forEach(function(e){_()(t,e,P()(n,e))})}return t}({},t,{checkedHashCode:n.getHashCode(t.checkItem)})}).forEach(function(t){var e=s[t.checkedHashCode];e||(e=[]),e.push(i.find(function(e){return e.hashCode===t.hashCode}).item),s[t.checkedHashCode]=e}),et()(s)},duplicateRemoval:function(t){var e=t.map(function(t){return{item:t}});return this.groupArray(e,"item").map(function(t){return t[0].item})},randomSort:function(t){return t.sort(function(){return Math.random()-.5})}},mt=n("Kr0U"),dt=n.n(mt),pt=n("EEoX"),vt=n.n(pt),ft=n("5WHX"),gt=n.n(ft),wt=n("mnGM"),Ct=n.n(wt),yt=n("6DPD"),bt=n.n(yt),kt=n("OdJd"),xt=n.n(kt),_t=new(n("YwQ6").a)("_qa_db");_t.version(1).stores({config:"key, value, createDate, modifyDate",question:"hashCode, describe, type, createDate, modifyDate",bank:"hashCode, title, *questions, createDate, modifyDate",historyRecord:"relatedQuestion, rightTimes, errorTimes, maxTime, minTime, totalTime, createDate, modifyDate"}),_t.version(2).stores({bank:"hashCode, title, *questions, category, createDate, modifyDate"}),_t.version(3).stores({question:"hashCode, describe, type, createDate, modifyDate, analysis"});var qt=_t.config,It=_t.question,Tt=_t.bank,Dt=_t.historyRecord;function St(t,e){var n=M()(t);if(E.a){var i=E()(t);e&&(i=i.filter(function(e){return P()(t,e).enumerable})),n.push.apply(n,i)}return n}function Pt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(n,!0).forEach(function(e){R()(t,e,n[e])}):D.a?I()(t,D()(n)):St(n).forEach(function(e){_()(t,e,P()(n,e))})}return t}var Lt=function(){function t(e,n){bt()(this,t),this.db=e,this.defaultEntry=n||{},this.db.hook("creating",function(t,e){e.createDate=Ct()(),e.modifyDate=Ct()()}),this.db.hook("updating",function(t,e,n){return t.modifiedDate=Ct()(),n.createdDate||(t.createdDate=Ct()()),console.log(Pt({},t)),t})}return xt()(t,[{key:"upsert",value:function(){var t=v()(u.a.mark(function t(e){var n=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e instanceof Array)){t.next=2;break}return t.abrupt("return",this.db.bulkPut(e.map(function(t){return Pt({},n.defaultEntry,{},t)})));case 2:return t.abrupt("return",this.db.put(Pt({},this.defaultEntry,{},e)));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"query",value:function(t){return this.db.where(t)}},{key:"queryByHashCode",value:function(t){return this.query("hashCode").equals(t).first()}},{key:"delete",value:function(){var t=v()(u.a.mark(function t(e){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e instanceof Array)){t.next=2;break}return t.abrupt("return",this.db.bulkDelete(e));case 2:return t.abrupt("return",this.db.delete(e));case 3:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()}]),t}(),Et=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,qt,{value:null}))}return gt()(e,t),e}(Lt),Bt=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,It,{describe:"",type:"option"}))}return gt()(e,t),e}(Lt),Mt=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,Tt,{title:"",questions:[]}))}return gt()(e,t),e}(Lt),Nt=function(t){function e(){return bt()(this,e),dt()(this,vt()(e).call(this,Dt,{rightTimes:0,errorTimes:0,maxTime:0,minTime:0,totalTime:0}))}return gt()(e,t),xt()(e,[{key:"queryByHashCode",value:function(t){return this.query("relatedQuestion").equals(t).first()}},{key:"queryMany",value:function(t){return this.query("relatedQuestion").anyOf(t).toArray()}}]),e}(Lt),Ot=(new Et,new Bt),Ht=new Mt,$t=new Nt,At="1.1.6";function Rt(t,e){var n=M()(t);if(E.a){var i=E()(t);e&&(i=i.filter(function(e){return P()(t,e).enumerable})),n.push.apply(n,i)}return n}function Xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rt(n,!0).forEach(function(e){R()(t,e,n[e])}):D.a?I()(t,D()(n)):Rt(n).forEach(function(e){_()(t,e,P()(n,e))})}return t}i.a.use(J.a),i.a.use(K.a),i.a.use(j.a).use(F.a).use(V.a),i.a.use(Z.a),i.a.use(U.a),i.a.use(Q.a).use(W.a),i.a.use(z.a).use(G.a),i.a.use(Y.a),i.a.use(X.a);var Yt="https://unpkg.com/@palerock/exam-qa@latest/lib-json",zt={name:"HomeIndex",data:function(){return{isShowImporter:!1,isFromOnline:!1,onlineLibs:[],onlineSelects:[],questionLib:"",categories:[],loadingOnlineLibs:!1,loadingProgress:"准备加载题库...",totalLibsCount:0,loadedLibsCount:0,loadingError:null}},computed:{selectedLibs:function(){var t=this,e=this.onlineLibs.filter(function(e){return t.onlineSelects.includes(e.hashCode)}).map(function(t){return Xt({},t)});return e.forEach(function(t){delete t.hashCode}),e}},methods:{goToCategory:function(t){this.$router.push({name:"CategoryPage",params:{category:t}})},selectLib:function(t){this.onlineSelects.includes(t.hashCode)?this.onlineSelects=this.onlineSelects.filter(function(e){return e!==t.hashCode}):this.onlineSelects=[].concat(d()(this.onlineSelects),[t.hashCode]),this.questionLib=$()(this.selectedLibs)},showImporter:function(){this.isShowImporter=!0,this.isFromOnline=!1},importFromExist:function(){var t=v()(u.a.mark(function t(){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.isFromOnline=!0,this.loadingError=null,t.next=4,this.loadOnlineLibs();case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),loadOnlineLibs:function(){var t=v()(u.a.mark(function t(){var e;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.loadingOnlineLibs=!0,this.loadingProgress="正在获取题库列表...",this.totalLibsCount=0,this.loadedLibsCount=0,t.prev=4,t.next=7,this.fetchOnlineLib();case 7:e=t.sent,this.onlineLibs=e.filter(function(t){return t&&t.data}).map(function(t){return Xt({},t.data,{hashCode:t.data.hashCode||ht.getHashCode(t.data.title+t.data.category)})}),this.loadingProgress="成功加载 ".concat(this.onlineLibs.length," 个题库"),this.loadingError=null,t.next=18;break;case 13:t.prev=13,t.t0=t.catch(4),console.error("获取在线题库失败:",t.t0),this.loadingError="加载失败,请检查网络连接后重试",this.loadingProgress="";case 18:return t.prev=18,this.loadingOnlineLibs=!1,t.finish(18);case 21:case"end":return t.stop()}},t,this,[[4,13,18,21]])}));return function(){return t.apply(this,arguments)}}(),retryLoadOnlineLibs:function(){this.loadOnlineLibs()},fetchOnlineLib:function(){var t=v()(u.a.mark(function t(){var e,n,i,s,a=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.loadingProgress="正在获取题库列表...",t.next=4,this.$http.get(Yt+"/map.json");case 4:if(t.t0=t.sent.data,t.t0){t.next=7;break}t.t0=[];case 7:if(0!==(e=t.t0).length){t.next=11;break}return this.loadingProgress="未找到可用题库",t.abrupt("return",[]);case 11:return this.totalLibsCount=e.length,this.loadedLibsCount=0,this.loadingProgress="准备并发加载 ".concat(e.length," 个题库..."),n=e.map(function(t,e){return a.$http.get(Yt+"/"+t).then(function(t){return a.loadedLibsCount++,a.loadingProgress="正在并发加载题库 (".concat(a.loadedLibsCount,"/").concat(a.totalLibsCount,")"),t}).catch(function(e){return a.loadedLibsCount++,console.warn("加载题库 ".concat(t," 失败:"),e),a.loadingProgress="正在并发加载题库 (".concat(a.loadedLibsCount,"/").concat(a.totalLibsCount,") - 部分失败"),null})}),t.next=17,O.a.all(n);case 17:return i=t.sent,s=i.filter(function(t){return null!==t}),this.loadingProgress="加载完成! 成功: ".concat(s.length,", 失败: ").concat(e.length-s.length),t.abrupt("return",s);case 23:throw t.prev=23,t.t1=t.catch(0),console.error("获取在线题库列表失败:",t.t1),this.loadingProgress="加载失败,请重试",t.t1;case 28:case"end":return t.stop()}},t,this,[[0,23]])}));return function(){return t.apply(this,arguments)}}(),importLib:function(){var t=v()(u.a.mark(function t(){var e,n,i,s,a=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e=JSON.parse(this.questionLib),n=0,!(e instanceof Array)){t.next=10;break}return t.next=6,O.a.all(e.map(function(){var t=v()(u.a.mark(function t(e){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.importSingleLib(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()));case 6:i=t.sent,n=i.filter(function(t){return t}).length,t.next=14;break;case 10:return t.next=12,this.importSingleLib(e);case 12:s=t.sent,n=s?1:0;case 14:n>0?this.$toast.success("成功导入 ".concat(n," 个题库!")):this.$toast.fail("未找到有效的题库数据"),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(0),console.error("导入题库失败:",t.t0),this.$toast.fail("题库格式错误:".concat(ht.getMessage(t.t0)));case 21:return t.next=23,this.initCategories();case 23:this.isShowImporter=!1,this.questionLib="";case 25:case"end":return t.stop()}},t,this,[[0,17]])}));return function(){return t.apply(this,arguments)}}(),importSingleLib:function(){var t=v()(u.a.mark(function t(e){var n;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.questions&&0!==e.questions.length){t.next=2;break}return t.abrupt("return",!1);case 2:return e.questions.forEach(function(t){t.hashCode=t.hashCode||ht.getHashCode(t)}),(n=Xt({},e,{questions:e.questions.map(function(t){return t.hashCode})})).hashCode=e.hashCode||ht.getHashCode(n),t.next=7,Ot.upsert(e.questions).then(function(){return Ht.upsert([n])});case 7:return t.abrupt("return",!0);case 8:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),initCategories:function(){var t=v()(u.a.mark(function t(){var e=this;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ht.query("hashCode").notEqual("").toArray().then(function(t){t=t.map(function(t){return t.category=t.category||"default",t}),e.categories=t.reduce(function(t,e){return t.includes(e.category)||t.push(e.category),t},[])});case 2:case"end":return t.stop()}},t)}));return function(){return t.apply(this,arguments)}}()},mounted:function(){this.initCategories()}},Gt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home-index"},[t._m(0),t._v(" "),n("transition",{attrs:{name:"slide-up",mode:"out-in"}},[n("van-grid",{staticClass:"category-grid",attrs:{"column-num":2,gutter:16}},[n("van-grid-item",{staticClass:"grid-item-enhanced import-item",attrs:{icon:"plus",clickable:""},on:{click:t.showImporter}},[n("div",{staticClass:"grid-text",attrs:{slot:"text"},slot:"text"},[n("span",{staticClass:"grid-title"},[t._v("开始答题")]),t._v(" "),n("span",{staticClass:"grid-subtitle"},[t._v("导入题库")])])]),t._v(" "),t._l(t.categories,function(e,i){return n("van-grid-item",{key:e,staticClass:"grid-item-enhanced category-item",style:{"animation-delay":.1*i+"s"},attrs:{icon:"notes-o",clickable:""},on:{click:function(n){return t.goToCategory(e)}}},[n("div",{staticClass:"grid-text",attrs:{slot:"text"},slot:"text"},[n("span",{staticClass:"grid-title"},[t._v(t._s(e))]),t._v(" "),n("span",{staticClass:"grid-subtitle"},[t._v("题库分类")])])])})],2)],1),t._v(" "),n("van-popup",{staticClass:"import-popup",attrs:{round:""},on:{"click-overlay":function(e){t.isShowImporter=!1}},model:{value:t.isShowImporter,callback:function(e){t.isShowImporter=e},expression:"isShowImporter"}},[n("div",{staticClass:"exam-import-box theme-card"},[n("div",{staticClass:"popup-header"},[n("h3",[t._v("导入题库")]),t._v(" "),n("van-icon",{staticClass:"close-icon",attrs:{name:"cross"},on:{click:function(e){t.isShowImporter=!1}}})],1),t._v(" "),t.isFromOnline?n("div",{staticClass:"online-libs-container"},[t.loadingOnlineLibs?n("div",{staticClass:"loading-container"},[n("div",{staticClass:"loading-spinner"}),t._v(" "),n("p",[t._v(t._s(t.loadingProgress))]),t._v(" "),t.totalLibsCount>0?n("div",{staticClass:"progress-bar"},[n("div",{staticClass:"progress-fill",style:{width:t.loadedLibsCount/t.totalLibsCount*100+"%"}})]):t._e()]):t.loadingError?n("div",{staticClass:"loading-container error-state"},[n("van-icon",{attrs:{name:"warning-o",size:"32",color:"var(--error-color)"}}),t._v(" "),n("p",{staticClass:"error-message"},[t._v(t._s(t.loadingError))]),t._v(" "),n("van-button",{attrs:{type:"primary",size:"small",round:""},on:{click:t.retryLoadOnlineLibs}},[t._v("\n 重试加载\n ")])],1):t.onlineLibs&&0!==t.onlineLibs.length?n("van-checkbox-group",{model:{value:t.onlineSelects,callback:function(e){t.onlineSelects=e},expression:"onlineSelects"}},[n("van-cell-group",{staticClass:"lib-cell-group"},t._l(t.onlineLibs,function(e,i){return n("van-cell",{key:i,staticClass:"lib-cell",attrs:{clickable:""},on:{click:function(n){return t.selectLib(e)}}},[n("template",{slot:"title"},[n("div",{staticClass:"lib-info"},[n("span",{staticClass:"lib-title"},[t._v(t._s(e.title))]),t._v(" "),n("span",{staticClass:"lib-category"},[t._v(t._s(e.category||"default"))])])]),t._v(" "),n("van-checkbox",{attrs:{slot:"right-icon",name:e.hashCode},slot:"right-icon"})],2)}),1)],1):n("div",{staticClass:"loading-container"},[n("div",{staticClass:"loading-spinner"}),t._v(" "),n("p",[t._v("准备加载题库...")])])],1):t._e(),t._v(" "),t.isFromOnline?t._e():n("div",{staticClass:"manual-import"},[n("van-cell-group",{staticClass:"import-field-group"},[n("van-field",{staticClass:"import-field",attrs:{label:"题库内容",type:"textarea",placeholder:"请输入JSON格式的题库数据",rows:"8"},model:{value:t.questionLib,callback:function(e){t.questionLib=e},expression:"questionLib"}})],1)],1),t._v(" "),n("div",{staticClass:"popup-actions"},[n("van-button",{staticClass:"theme-button action-button",attrs:{type:"info",size:"large",block:"",round:""},on:{click:t.importLib}},[n("van-icon",{attrs:{name:"plus"}}),t._v("\n 导入题库\n ")],1),t._v(" "),n("van-button",{staticClass:"theme-button action-button",attrs:{type:"primary",size:"large",block:"",round:""},on:{click:t.importFromExist}},[n("van-icon",{attrs:{name:"cloud-o"}}),t._v("\n 获取在线题库\n ")],1)],1)])])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"welcome-section"},[e("div",{staticClass:"welcome-card theme-card"},[e("div",{staticClass:"welcome-content"},[e("h2",{staticClass:"gradient-text welcome-title"},[this._v("欢迎使用答题神器")]),this._v(" "),e("p",[this._v("智能题库管理,轻松备考复习")])])])])}]};var Qt=n("VU/8")(zt,Gt,!1,function(t){n("6Zvi")},"data-v-2eda658d",null).exports;i.a.use(Z.a);var Wt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("van-button",{attrs:{type:"default"}},[t._v("默认按钮")]),t._v(" "),n("van-button",{attrs:{type:"primary"}},[t._v("主要按钮")]),t._v(" "),n("van-button",{attrs:{type:"info"}},[t._v("信息按钮")]),t._v(" "),n("van-button",{attrs:{type:"warning"}},[t._v("警告按钮")]),t._v(" "),n("van-button",{attrs:{type:"danger"}},[t._v("危险按钮")])],1)},staticRenderFns:[]};n("VU/8")({name:"HelloWorld",data:function(){return{msg:"Welcome to Your Vue.js App"}}},Wt,!1,null,null,null).exports;i.a.use(y.a).use(b.a).use(k.a);var Ut={name:"HomePage",data:function(){return{activeTabIndex:0,pages:[{title:"主页",label:"Home",api:Qt,icon:"home-o"}]}},computed:{activePage:function(){return this.pages[this.activeTabIndex]||{}},version:function(){return At}}},Zt={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home-page"},[n("van-nav-bar",{attrs:{title:t.activePage.label,fixed:""}}),t._v(" "),n("div",{staticClass:"is-relation page-container"},[n("transition",{attrs:{name:"fade",mode:"out-in"}},[n(t.activePage.api,{key:t.activeTabIndex,tag:"component"})],1),t._v(" "),n("p",{staticClass:"version-text text-align-center is-absolute"},[t._v(t._s(t.version))])],1)],1)},staticRenderFns:[]};var jt=n("VU/8")(Ut,Zt,!1,function(t){n("/h4W")},"data-v-08264cc4",null).exports,Ft=(n("I4j4"),n("7fQT")),Vt=(n("le1z"),n("hZxG")),Kt=(n("HZGa"),n("pykS")),Jt=(n("ZuV/"),n("37Xn")),te=(n("JRZP"),n("LK01"));function ee(t,e){var n=M()(t);if(E.a){var i=E()(t);e&&(i=i.filter(function(e){return P()(t,e).enumerable})),n.push.apply(n,i)}return n}function ne(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ee(n,!0).forEach(function(e){R()(t,e,n[e])}):D.a?I()(t,D()(n)):ee(n).forEach(function(e){_()(t,e,P()(n,e))})}return t}i.a.use(Jt.a).use(te.a),i.a.use(K.a),i.a.use(z.a).use(G.a),i.a.use(Kt.a),i.a.use(Vt.a),i.a.use(F.a).use(V.a),i.a.use(X.a);var ie={required:!0,score:1,usingScore:!1,type:"option",describe:"Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?Do you love me?",answerOptions:[{api:"A",describe:"Yes",isRight:!0},{api:"B",describe:"No"}]},se={title:"试题测试",questions:[ie]};i.a.use(y.a).use(Ft.a).use(Z.a);var ae={name:"DoExamPage",data:function(){var t;return t={answers:[],questionNum:0,isShowResult:!1,letterIndex:d()("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),examInfo:{},hasSubmit:!1,examHashCode:0,historyExams:[],showAcButtons:!1,backInterceptor:null,transitionName:"question-slide-right",previousQuestionNum:0,panStartScrollTop:null,showImagePreview:!1,previewImageSrc:"",previewImageAlt:"",zoomLevel:1,translateX:0,translateY:0,initialDistance:0,initialZoom:1,lastTouchX:0,lastTouchY:0,isDragging:!1,isZooming:!1,imageNaturalWidth:0,imageNaturalHeight:0,containerWidth:0,containerHeight:0,isMouseDragging:!1,mouseStartX:0,mouseStartY:0,lastClickTime:0,doubleClickDelay:300,lastTouchTime:0},R()(t,"lastTouchX",0),R()(t,"lastTouchY",0),R()(t,"doubleTapDelay",300),R()(t,"doubleTapDistance",50),R()(t,"touchMoved",!1),t},computed:{totalNum:function(){return this.questions.length},questions:function(){var t=this;return(this.examInfo.questions||[]).filter(function(e){return t.isReviewError?t.historyErrorHashCodes.includes(e.hashCode):!t.neverDo||!t.doneHashCodes.includes(e.hashCode)}).map(function(e,n){return ne({},e,{active:n===t.questionNum})})},questionsInfo:function(){var t=this;return this.questions.map(function(e,n){return t.answers[n]||(t.answers[n]={results:[{}],single:{},multi:{apis:[]}}),ne({},e,{answer:t.answers[n]||{},orderNum:n+1,isMulti:e.answerOptions.filter(function(t){return t.isRight}).length>1})})},historyErrorHashCodes:function(){return this.historyExams.filter(function(t){return t.errorTimes>0}).map(function(t){return t.hashCode})},doneHashCodes:function(){return this.historyExams.filter(function(t){return t.errorTimes+t.rightTimes>0}).map(function(t){return t.hashCode})},imageStyle:function(){var t="zoom-in";return this.zoomLevel>1&&(t=this.isDragging||this.isMouseDragging?"grabbing":"grab"),{transform:"translate(".concat(this.translateX,"px, ").concat(this.translateY,"px) scale(").concat(this.zoomLevel,")"),transformOrigin:"center center",transition:this.isDragging||this.isZooming||this.isMouseDragging?"none":"transform 0.3s ease",cursor:t,userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}}},methods:{handleBack:function(){window.GlobalBackManager?window.GlobalBackManager.goBack():this.originalHandleBack()},originalHandleBack:function(){var t=this;this.shouldConfirmExit()?K.a.confirm({title:"确认退出",message:"当次答题没有保存,是否确认退出?",confirmButtonText:"确认退出",cancelButtonText:"继续答题",confirmButtonColor:"var(--warning-color)",className:"custom-warning-dialog",closeOnClickOverlay:!0}).then(function(){t.$router.back()}).catch(function(){}):this.$router.back()},shouldConfirmExit:function(){var t=this;return!this.hasSubmit&&this.questionsInfo.filter(function(e){return t.isQuestionAnswered(e)}).length>0},getQuestionNavClass:function(t,e){var n={};return n["exam-current"]=this.questionNum===e,this.isShowResult||t.answer.isChecked&&this.isPractice?t.answer.isPass?n["exam-right"]=!0:t.answer.isMistake&&(n["exam-error"]=!0):this.isQuestionAnswered(t)&&(n["exam-answered"]=!0),n},registerBackInterceptor:function(){var t=this;window.GlobalBackManager&&(this.backInterceptor=function(){return t.showImagePreview?(t.closeImagePreview(),!0):!!t.shouldConfirmExit()&&(K.a.confirm({title:"确认退出",message:"当次答题没有保存,是否确认退出?",confirmButtonText:"确认退出",cancelButtonText:"继续答题",confirmButtonColor:"var(--warning-color)",className:"custom-warning-dialog",closeOnClickOverlay:!0}).then(function(){t.unregisterBackInterceptor(),t.$router.back()}).catch(function(){}),!0)},window.GlobalBackManager.addInterceptor(this.backInterceptor),console.log("答题页面返回拦截器已注册"))},unregisterBackInterceptor:function(){window.GlobalBackManager&&this.backInterceptor&&(window.GlobalBackManager.removeInterceptor(this.backInterceptor),this.backInterceptor=null,console.log("答题页面返回拦截器已移除"))},isQuestionAnswered:function(t){return!(!t||!t.answer)&&(t.isMulti?t.answer.multi&&t.answer.multi.apis&&t.answer.multi.apis.length>0:t.answer.single&&t.answer.single.api)},getQuestionTitle:function(t){return t&&t.describe?["(".concat(this.questionNum+1,"/").concat(this.totalNum,")"),t.describe].join(" ").split("\n"):["(".concat(this.questionNum+1,"/").concat(this.totalNum,")"),"加载中..."]},getQuestionDesc:function(t){if(!t)return"加载中...";var e="";t.required||(e+="(可选)"),"option"===t.type&&(t.isMulti?e+="多选题":e+="单选题");var n=this.historyExams.find(function(e){return e.hashCode===t.hashCode});if(n){this.isReviewError&&n.errorTimes&&(e+=" (做错次数: ".concat(n.errorTimes,")"));var i=n.errorTimes+n.rightTimes;i>0&&(e+="(历史正确率:".concat((n.rightTimes/i*100).toFixed(0),"%)"))}return e},setAnswer:function(t,e){this.answers=d()(this.answers).map(function(n,i){return i===t&&(n.results=e.map(function(t){return{api:t}}),n.single.api=e[0],n.multi.apis=e),n})},toggleAnswer:function(t,e){var n=this.answers[t].multi.apis;n.includes(e)?n=n.filter(function(t){return t!==e}):(n.push(e),n=d()(n)),this.setAnswer(t,n)},checkResult:function(t){var e=this;this.answers=d()(this.answers).map(function(n,i){if(t!==i&&null!=t)return n;console.log(d()(e.questions),i);var s=e.questions[i];if(!s)return n;var a=s.answerOptions.filter(function(t){return t.isRight}).map(function(t){return t.api});return n.results.forEach(function(t){t.isMistake=!a.includes(t.api)}),n.isAnswered=n.results.filter(function(t){return t.api}).length>0,!n.isChecked&&n.isAnswered&&(n.isMistake=n.results.length!==a.length||!!n.results.find(function(t){return t.isMistake}),n.isPass=n.isAnswered&&!n.isMistake,n.isChecked=!0),n})},turnTo:function(t){var e=this.$refs.root;e&&(e.scrollTop=0),t>this.questionNum?this.transitionName="question-slide-left":this.transitionName="question-slide-right",this.previousQuestionNum=this.questionNum,this.questionNum=t},confirmSubmit:function(){var t=this,e=this.questionsInfo.filter(function(e){return t.isQuestionAnswered(e)}).length,n=this.totalNum,i=Math.round(e/n*100),s='\n <div class="submit-dialog-content">\n <div class="stats-row">\n <span class="stat-text">已答 <strong class="primary">'.concat(e,'</strong></span>\n <span class="stat-text">未答 <strong class="secondary">').concat(n-e,'</strong></span>\n <span class="stat-text">完成 <strong class="success">').concat(i,'%</strong></span>\n </div>\n <div class="progress-bar-container">\n <div class="progress-bar" style="width: ').concat(i,'%;"></div>\n </div>\n </div>\n ');K.a.confirm({title:"📋 提交答案",message:s,confirmButtonText:"确认提交",cancelButtonText:"继续答题",confirmButtonColor:"var(--primary-color)",className:"custom-submit-dialog",closeOnClickOverlay:!0}).then(function(){t.submit()}).catch(function(t){console.log(t)})},submit:function(){var t=this;this.checkResult();var e=this.questionsInfo.filter(function(e){return t.isQuestionAnswered(e)}).length;if(e<this.totalNum&&this.requireAllDone){var n='\n <div class="simple-dialog-content">\n <div class="simple-message">\n 还有 <strong class="warning">'.concat(this.totalNum-e,"</strong> 道题未答完\n </div>\n </div>\n ");K.a.alert({title:"提醒",message:n,confirmButtonText:"继续答题",className:"custom-warning-dialog",closeOnClickOverlay:!0})}else{var i=this.questionsInfo.filter(function(t){return t.answer.isPass}).length,s=(this.questionsInfo.filter(function(t){return t.answer.isMistake}).length,Math.round(i/this.totalNum*100));this.questionsInfo.filter(function(t){return t.answer.isChecked}).forEach(function(t){$t.queryByHashCode(t.hashCode).then(function(e){e||(e={relatedQuestion:t.hashCode,errorTimes:0}),t.answer.isPass?(isNaN(e.rightTimes)&&(e.rightTimes=0),e.rightTimes++):(isNaN(e.errorTimes)&&(e.errorTimes=0),e.errorTimes++),console.log(e),$t.upsert(e).then(function(){console.log("做题信息已保存")})})}),this.isShowResult=!0;var a="";s>=90?("🎉","太棒了!",a="custom-success-dialog"):s>=80?("👏","很好!",a="custom-success-dialog"):s>=70?("👍","不错!",a="custom-warning-dialog"):s>=60?("💪","继续努力!",a="custom-warning-dialog"):("📚","多多练习!",a="custom-error-dialog");var o='\n <div class="result-dialog-content">\n <div class="result-score '.concat(s>=70?"success":s>=60?"warning":"error",'">').concat(s,'%</div>\n <div class="result-summary">正确 ').concat(i,"/").concat(this.totalNum," 题</div>\n </div>\n ");K.a.alert({title:"📊 答题结果",message:o,confirmButtonText:"确定",className:a,closeOnClickOverlay:!0}),this.hasSubmit=!0}},adaptExamConfig:function(){var t=ne({},se,{},this.examConfig);t.questions=t.questions.map(function(t){return ne({},ie,{},t,{hashCode:t.hashCode,answerOptions:t.answerOptions?t.answerOptions.map(function(t){return ne({},t,{api:ht.getHashCode(t)+""})}):[]})}).filter(function(t){if(!t.describe||0===t.answerOptions.length)return console.log("错误的题目(无描述或无答案).",t),!1;var e=ht.groupArray(t.answerOptions,"isRight");if(1===e.length&&!e[0][0].isRight)return console.log("错误的题目(无正确答案).",t),!1;var n=ht.groupArray(t.answerOptions,"describe").map(function(t){if(t.length>1){var e=ne({},t[0]);return ht.groupArray(t,"isRight").length!==t.length&&(e.invalid=!0),e}return t[0]});return n.find(function(t){return t.invalid})?(console.log("错误的题目(答案中有重复描述且对错不一).",t),!1):(t.answerOptions=ht.randomSort(n),!0)}),t.questions=ht.randomSort(t.questions),this.examInfo=t,this.examHashCode=this.examConfig.hashCode,this.loadHistoryExamInfo()},getOptionColor:function(t,e){return this.isShowResult||this.isPractice&&t.answer.isChecked?t.answer.results.map(function(t){return t.api}).includes(e.api)&&e.isRight?"#44af11":"#cd0000":"#1989fa"},loadHistoryExamInfo:function(){var t=this;$t.queryMany(this.examConfig.questions.map(function(t){return t.hashCode})).then(function(e){t.historyExams=e.map(function(t){return ne({},t,{hashCode:t.relatedQuestion})})})},onTouchStart:function(t){var e=this.$refs.root;e&&(this.panStartScrollTop=e.scrollTop,console.log("touch开始,scrollTop:",this.panStartScrollTop))},swipe:function(t){switch(t.direction){case"Left":this.questionNum<this.totalNum-1&&this.turnTo(this.questionNum+1);break;case"Right":this.questionNum>0&&this.turnTo(this.questionNum-1);break;case"Up":this.showAcButtons=!1;break;case"Down":var e=this.$refs.root;if(e){var n=e.scrollTop;console.log("swipe Down触发,开始scrollTop:",this.panStartScrollTop,"结束scrollTop:",n),null!==this.panStartScrollTop&&this.panStartScrollTop<=5&&n<=5?(console.log("满足条件,显示目录弹窗"),this.showAcButtons=!0):console.log("不满足条件,不显示目录弹窗")}}},handleImageClick:function(t){var e=this;"img"===t.target.tagName.toLowerCase()&&(t.stopPropagation(),this.showImagePreview=!0,this.previewImageSrc=t.target.src,this.previewImageAlt=t.target.alt||"图片",navigator.vibrate&&navigator.vibrate(50),document.addEventListener("keydown",this.handleKeyDown),this.$nextTick(function(){e.adjustImagePreviewControlsPosition(),console.log("图片预览打开后DOM检查:");var t=e.$el.querySelector(".image-preview-overlay"),n=e.$el.querySelector(".image-preview-content"),i=e.$el.querySelector(".preview-image");console.log("overlay元素:",t),console.log("container元素:",n),console.log("img元素:",i),n&&(console.log("container计算样式:",window.getComputedStyle(n)),console.log("container位置信息:",n.getBoundingClientRect())),i&&(console.log("img计算样式:",window.getComputedStyle(i)),console.log("img位置信息:",i.getBoundingClientRect()))}))},adjustImagePreviewControlsPosition:function(){var t=this.$el.querySelector(".image-preview-controls-bar");if(t){var e=20,n=0;if(window.app&&window.app.immersed)n=window.app.immersed;else{var i=getComputedStyle(document.documentElement).getPropertyValue("--immersed-height").trim();i&&(n=r()(i.replace("px",""))||0)}window.innerWidth<=768&&(e=10);var s=e+n;t.style.top="".concat(s,"px")}},handleKeyDown:function(t){"Escape"===t.key&&this.showImagePreview&&this.closeImagePreview()},closeImagePreview:function(){this.showImagePreview=!1,this.previewImageSrc="",this.previewImageAlt="",this.resetImageTransform(),document.removeEventListener("keydown",this.handleKeyDown)},resetImageTransform:function(){this.zoomLevel=1,this.translateX=0,this.translateY=0,this.isDragging=!1,this.isZooming=!1,this.isMouseDragging=!1,this.mouseStartX=0,this.mouseStartY=0,this.lastClickTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.touchMoved=!1},onImageLoad:function(){this.$refs.previewImage&&(this.imageNaturalWidth=this.$refs.previewImage.naturalWidth,this.imageNaturalHeight=this.$refs.previewImage.naturalHeight,this.$refs.imageContainer&&(this.containerWidth=this.$refs.imageContainer.clientWidth,this.containerHeight=this.$refs.imageContainer.clientHeight))},zoomIn:function(){this.zoomLevel=Math.min(1.2*this.zoomLevel,5),this.constrainImagePosition()},zoomOut:function(){this.zoomLevel=Math.max(this.zoomLevel/1.2,.1),this.constrainImagePosition()},resetZoom:function(){this.zoomLevel=1,this.translateX=0,this.translateY=0},handleWheel:function(t){t.preventDefault();var e=t.deltaY>0?.9:1.1,n=Math.min(Math.max(this.zoomLevel*e,.1),5),i=this.$refs.imageContainer.getBoundingClientRect(),s=t.clientX-i.left-i.width/2,a=t.clientY-i.top-i.height/2,o=n/this.zoomLevel;this.translateX=this.translateX+s*(1-o),this.translateY=this.translateY+a*(1-o),this.zoomLevel=n,this.constrainImagePosition()},handleImageSwipe:function(t){if(t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),this.zoomLevel>1){switch(t.direction){case"Left":this.translateX-=50;break;case"Right":this.translateX+=50;break;case"Up":this.translateY+=50;break;case"Down":this.translateY-=50}this.constrainImagePosition()}},handleImageTouchStart:function(t){if(t.preventDefault(),t.stopPropagation(),1===t.touches.length){var e=Ct()(),n=t.touches[0],i=e-this.lastTouchTime,s=Math.abs(n.clientX-this.lastTouchX),a=Math.abs(n.clientY-this.lastTouchY),o=Math.sqrt(s*s+a*a);if(i<this.doubleTapDelay&&o<this.doubleTapDistance)return void this.handleTouchDoubleTap(t);this.lastTouchTime=e,this.lastTouchX=n.clientX,this.lastTouchY=n.clientY,this.touchMoved=!1,this.isDragging=!0,this.lastTouchX=n.clientX,this.lastTouchY=n.clientY,this.$refs.imageContainer&&this.$refs.imageContainer.classList.add("dragging")}else if(2===t.touches.length){this.isZooming=!0,this.isDragging=!1;var r=t.touches[0],c=t.touches[1];this.initialDistance=this.getDistance(r,c),this.initialZoom=this.zoomLevel,this.$refs.imageContainer&&this.$refs.imageContainer.classList.remove("dragging")}},handleTouchDoubleTap:function(t){1===this.zoomLevel?this.zoomToPoint(2,t.touches[0]):this.resetZoom()},handleImageTouchMove:function(t){if(t.preventDefault(),t.stopPropagation(),1===t.touches.length&&this.isDragging){var e=t.touches[0].clientX-this.lastTouchX,n=t.touches[0].clientY-this.lastTouchY;Math.sqrt(e*e+n*n)>5&&(this.touchMoved=!0),this.translateX+=e,this.translateY+=n,this.lastTouchX=t.touches[0].clientX,this.lastTouchY=t.touches[0].clientY,this.constrainImagePosition()}else if(2===t.touches.length&&this.isZooming){this.touchMoved=!0;var i=t.touches[0],s=t.touches[1],a=this.getDistance(i,s)/this.initialDistance;this.zoomLevel=Math.min(Math.max(this.initialZoom*a,.1),5),this.constrainImagePosition()}},handleImageTouchEnd:function(t){if(t.preventDefault(),t.stopPropagation(),t.touches.length<2&&(this.isZooming=!1),0===t.touches.length){if(this.checkBackgroundClick(t))return void this.closeImagePreview();this.isDragging=!1,this.$refs.imageContainer&&this.$refs.imageContainer.classList.remove("dragging")}},checkBackgroundClick:function(t){return!this.touchMoved&&("IMG"!==t.target.tagName&&!(!t.target.classList.contains("image-preview-content")&&!t.target.classList.contains("image-preview-overlay")))},getDistance:function(t,e){var n=t.clientX-e.clientX,i=t.clientY-e.clientY;return Math.sqrt(n*n+i*i)},constrainImagePosition:function(){if(this.$refs.previewImage&&this.$refs.imageContainer){var t,e,n=this.$refs.previewImage,i=this.$refs.imageContainer,s=(n.getBoundingClientRect(),i.getBoundingClientRect()),a=n.offsetWidth*this.zoomLevel,o=n.offsetHeight*this.zoomLevel;t=a<=s.width?(s.width-a)/2:(a-s.width)/2,e=o<=s.height?(s.height-o)/2:(o-s.height)/2;this.translateX,this.translateY;this.translateX=Math.max(-t,Math.min(t,this.translateX)),this.translateY=Math.max(-e,Math.min(e,this.translateY))}},handleBackgroundClick:function(t){(t.target.classList.contains("image-preview-overlay")||t.target.classList.contains("image-preview-content"))&&this.closeImagePreview()},handleContainerClick:function(t){},handlePreviewImageClick:function(t){t.stopPropagation()},handlePreviewImageDoubleClick:function(t){t.stopPropagation(),t.preventDefault(),1===this.zoomLevel?this.zoomToPoint(2,t):this.resetZoom()},handleDoubleClick:function(t){t.stopPropagation(),t.preventDefault(),t.target!==this.$refs.previewImage&&this.handlePreviewImageDoubleClick(t)},zoomToPoint:function(t,e){if(this.$refs.imageContainer){var n=this.$refs.imageContainer.getBoundingClientRect(),i=e.clientX,s=e.clientY,a=i-n.left-n.width/2,o=s-n.top-n.height/2,r=t/this.zoomLevel;this.translateX=this.translateX-a*(r-1),this.translateY=this.translateY-o*(r-1),this.zoomLevel=t,this.constrainImagePosition()}},handleMouseDown:function(t){console.log("=== 鼠标按下事件触发 ===",{button:t.button,clientX:t.clientX,clientY:t.clientY,target:t.target.tagName}),0===t.button&&(t.preventDefault(),t.stopPropagation(),this.isMouseDragging=!0,this.mouseStartX=t.clientX,this.mouseStartY=t.clientY,console.log("开始拖拽状态:",{isMouseDragging:this.isMouseDragging,startX:this.mouseStartX,startY:this.mouseStartY}),this.$refs.imageContainer&&this.$refs.imageContainer.classList.add("dragging"))},handleMouseMove:function(t){if(this.isMouseDragging){t.preventDefault(),t.stopPropagation();var e=t.clientX-this.mouseStartX,n=t.clientY-this.mouseStartY;console.log("=== 鼠标移动事件触发 ===",{isMouseDragging:this.isMouseDragging,deltaX:e,deltaY:n,currentTranslateX:this.translateX,currentTranslateY:this.translateY,zoomLevel:this.zoomLevel}),this.translateX+=e,this.translateY+=n,console.log("拖动后位置:",{newTranslateX:this.translateX,newTranslateY:this.translateY}),this.constrainImagePosition(),this.mouseStartX=t.clientX,this.mouseStartY=t.clientY}},handleMouseUp:function(t){this.isMouseDragging&&(t.preventDefault(),t.stopPropagation(),this.isMouseDragging=!1,this.$refs.imageContainer&&this.$refs.imageContainer.classList.remove("dragging"))},handleMouseLeave:function(t){this.isMouseDragging&&this.handleMouseUp(t)}},props:{examConfig:{type:Object,default:function(){return se}},isReviewError:{type:Boolean,default:!1},neverDo:{type:Boolean,default:!1},isNew:{type:Boolean,default:!1},requireAllDone:{type:Boolean,default:!1},isPractice:{type:Boolean,default:!0}},watch:{examConfig:function(){this.adaptExamConfig()}},mounted:function(){this.adaptExamConfig(),console.log("开始答题");try{plus.device.setWakelock(!0),console.log("打开屏幕常亮")}catch(t){}this.registerBackInterceptor()},destroyed:function(){console.log("结束答题");try{plus.device.setWakelock(!1),console.log("关闭屏幕常亮")}catch(t){}this.unregisterBackInterceptor(),document.removeEventListener("keydown",this.handleKeyDown)}},oe={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"finger",rawName:"v-finger:swipe",value:t.swipe,expression:"swipe",arg:"swipe"}],ref:"root",staticClass:"exam-root",on:{touchstart:t.onTouchStart}},[n("van-nav-bar",{staticClass:"exam-nav-bar",attrs:{title:t.examInfo.title,fixed:"","left-arrow":"","right-text":"目录"},on:{"click-left":t.handleBack,"click-right":function(e){t.showAcButtons=!t.showAcButtons}}}),t._v(" "),n("transition",{attrs:{name:"fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.showAcButtons,expression:"showAcButtons"}],staticClass:"ac-qn-backdrop",on:{click:function(e){e.stopPropagation(),t.showAcButtons=!1}}},[n("div",{staticClass:"exam-p-around-small ac-qn theme-card",on:{click:function(t){t.stopPropagation()}}},[n("div",{staticClass:"qn-header"},[n("h3",[t._v("题目导航")]),t._v(" "),n("span",{staticClass:"qn-progress"},[t._v(t._s(t.questionNum+1)+" / "+t._s(t.totalNum))])]),t._v(" "),n("van-row",{staticClass:"question-nav-grid"},t._l(t.questionsInfo,function(e,i){return n("van-col",{key:i,attrs:{span:"4"}},[n("div",{staticClass:"exam-circle exam-done theme-button",class:t.getQuestionNavClass(e,i),on:{click:function(e){return t.turnTo(i)}}},[t._v("\n "+t._s(i+1)+"\n ")])])}),1)],1)])]),t._v(" "),n("div",{staticClass:"question-container"},[n("transition",{attrs:{name:t.transitionName,mode:"out-in"}},[t.questionsInfo[t.questionNum]?n("div",{key:t.questionNum,staticClass:"question-item"},[n("div",{staticClass:"question-card theme-card"},[n("div",{staticClass:"question-header",on:{click:t.handleImageClick}},[t._l(t.getQuestionTitle(t.questionsInfo[t.questionNum]),function(e){return n("div",{staticClass:"question-title",domProps:{innerHTML:t._s(e)}})}),t._v(" "),n("div",{staticClass:"question-desc"},[t._v(t._s(t.getQuestionDesc(t.questionsInfo[t.questionNum])))])],2),t._v(" "),t.questionsInfo[t.questionNum].isMulti?n("div",{staticClass:"options-container"},[n("van-checkbox-group",{on:{click:function(t){t.stopPropagation()}},model:{value:t.questionsInfo[t.questionNum].answer.multi.apis,callback:function(e){t.$set(t.questionsInfo[t.questionNum].answer.multi,"apis",e)},expression:"questionsInfo[questionNum].answer.multi.apis"}},[n("div",{staticClass:"option-list"},t._l(t.questionsInfo[t.questionNum].answerOptions,function(e,i){return n("div",{key:i,staticClass:"option-item theme-card",class:{"option-selected":t.questionsInfo[t.questionNum].answer.multi.apis.includes(e.api),"option-correct":e.isRight&&(t.isShowResult||t.questionsInfo[t.questionNum].answer.isChecked&&t.isPractice),"option-incorrect":!e.isRight&&(t.isShowResult||!e.isRight&&t.questionsInfo[t.questionNum].answer.isAnswered&&t.isPractice)&&t.questionsInfo[t.questionNum].answer.multi.apis.includes(e.api)},on:{click:function(n){return t.toggleAnswer(t.questionNum,e.api)}}},[n("div",{staticClass:"option-content"},[n("div",{staticClass:"option-label"},[t._v(t._s(t.letterIndex[i]))]),t._v(" "),n("div",{staticClass:"option-text",domProps:{innerHTML:t._s(e.describe)},on:{click:t.handleImageClick}}),t._v(" "),n("van-checkbox",{staticClass:"option-checkbox",attrs:{name:e.api,"checked-color":t.getOptionColor(t.questionsInfo[t.questionNum],e)}})],1)])}),0)])],1):t._e(),t._v(" "),t.questionsInfo[t.questionNum].isMulti?t._e():n("div",{staticClass:"options-container"},[n("van-radio-group",{model:{value:t.questionsInfo[t.questionNum].answer.single.api,callback:function(e){t.$set(t.questionsInfo[t.questionNum].answer.single,"api",e)},expression:"questionsInfo[questionNum].answer.single.api"}},[n("div",{staticClass:"option-list"},t._l(t.questionsInfo[t.questionNum].answerOptions,function(e,i){return n("div",{key:i,staticClass:"option-item theme-card",class:{"option-selected":t.questionsInfo[t.questionNum].answer.single.api===e.api,"option-correct":e.isRight&&(t.isShowResult||t.questionsInfo[t.questionNum].answer.isChecked&&t.isPractice),"option-incorrect":!e.isRight&&(t.isShowResult||!e.isRight&&t.questionsInfo[t.questionNum].answer.isAnswered&&t.isPractice)&&t.questionsInfo[t.questionNum].answer.single.api===e.api},on:{click:function(n){return t.setAnswer(t.questionNum,[e.api])}}},[n("div",{staticClass:"option-content"},[n("div",{staticClass:"option-label"},[t._v(t._s(t.letterIndex[i]))]),t._v(" "),n("div",{staticClass:"option-text",domProps:{innerHTML:t._s(e.describe)},on:{click:t.handleImageClick}}),t._v(" "),n("van-radio",{staticClass:"option-radio",attrs:{name:e.api,"checked-color":t.getOptionColor(t.questionsInfo[t.questionNum],e)}})],1)])}),0)])],1),t._v(" "),t.isShowResult||!t.isPractice||t.questionsInfo[t.questionNum].answer.isChecked?n("div",{staticClass:"question-analysis"},[n("div",{staticClass:"analysis-header"},[n("van-icon",{attrs:{name:"info-o"}}),t._v(" "),n("span",[t._v("题目解析")])],1),t._v(" "),n("div",{staticClass:"analysis-content",domProps:{innerHTML:t._s(t.questionsInfo[t.questionNum].analysis||"暂无解析")},on:{click:t.handleImageClick}})]):t._e()])]):n("div",{staticClass:"loading-item"},[n("div",{staticClass:"question-card theme-card"},[n("div",{staticClass:"question-header"},[n("div",{staticClass:"question-title"},[t._v("加载中...")]),t._v(" "),n("div",{staticClass:"question-desc"},[t._v("正在加载题目数据")])])])])])],1),t._v(" "),t.questionsInfo[t.questionNum]?n("div",{staticClass:"ac-buttons theme-card"},[n("div",{staticClass:"button-row"},[t.questionNum>0?n("van-button",{staticClass:"nav-button theme-button",attrs:{round:""},on:{click:function(e){return t.turnTo(t.questionNum-1)}}},[n("van-icon",{attrs:{name:"arrow-left"}}),t._v("\n 上一题\n ")],1):t._e(),t._v(" "),t.questionNum<t.totalNum-1?n("van-button",{staticClass:"nav-button theme-button",attrs:{type:"info",round:""},on:{click:function(e){return t.turnTo(t.questionNum+1)}}},[t._v("\n 下一题\n "),n("van-icon",{attrs:{name:"arrow"}})],1):t._e()],1),t._v(" "),n("div",{staticClass:"button-row"},[t.isPractice&&!t.questionsInfo[t.questionNum].answer.isChecked?n("van-button",{staticClass:"action-button theme-button",attrs:{type:"warning",round:"",block:""},on:{click:function(e){return t.checkResult(t.questionNum)}}},[n("van-icon",{attrs:{name:"eye-o"}}),t._v("\n 检查答案\n ")],1):t._e(),t._v(" "),t.hasSubmit?t._e():n("van-button",{staticClass:"submit-button theme-button pulse",attrs:{type:"primary",round:"",block:""},on:{click:t.confirmSubmit}},[n("van-icon",{attrs:{name:"success"}}),t._v("\n 提交答案\n ")],1)],1)]):t._e(),t._v(" "),t.showImagePreview?n("div",{staticClass:"image-preview-overlay",on:{click:t.handleBackgroundClick}},[n("div",{staticClass:"image-preview-controls-bar",on:{click:function(t){t.stopPropagation()}}},[n("van-icon",{staticClass:"control-icon",attrs:{name:"minus"},on:{click:t.zoomOut}}),t._v(" "),n("span",{staticClass:"zoom-text"},[t._v(t._s(Math.round(100*t.zoomLevel))+"%")]),t._v(" "),n("van-icon",{staticClass:"control-icon",attrs:{name:"plus"},on:{click:t.zoomIn}}),t._v(" "),n("van-icon",{staticClass:"control-icon",attrs:{name:"replay",title:"重置"},on:{click:t.resetZoom}}),t._v(" "),n("van-icon",{staticClass:"control-icon close-icon",attrs:{name:"cross"},on:{click:t.closeImagePreview}})],1),t._v(" "),n("div",{ref:"imageContainer",staticClass:"image-preview-content",on:{click:t.handleContainerClick,dblclick:t.handleDoubleClick,mousedown:t.handleMouseDown,mousemove:t.handleMouseMove,mouseup:t.handleMouseUp,mouseleave:t.handleMouseLeave,touchstart:t.handleImageTouchStart,touchmove:t.handleImageTouchMove,touchend:t.handleImageTouchEnd,wheel:t.handleWheel}},[n("img",{ref:"previewImage",staticClass:"preview-image",style:t.imageStyle,attrs:{src:t.previewImageSrc,alt:t.previewImageAlt},on:{load:t.onImageLoad,dragstart:function(t){t.preventDefault()},dblclick:function(e){return e.stopPropagation(),t.handlePreviewImageDoubleClick(e)}}})])]):t._e()],1)},staticRenderFns:[]};var re=n("VU/8")(ae,oe,!1,function(t){n("PC7f")},"data-v-6760d575",null).exports,ce=n("crjn"),ue=n.n(ce);function le(t,e){var n=M()(t);if(E.a){var i=E()(t);e&&(i=i.filter(function(e){return P()(t,e).enumerable})),n.push.apply(n,i)}return n}function he(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?le(n,!0).forEach(function(e){R()(t,e,n[e])}):D.a?I()(t,D()(n)):le(n).forEach(function(e){_()(t,e,P()(n,e))})}return t}i.a.use(y.a),i.a.use(Q.a).use(W.a),i.a.use(U.a),i.a.use(Z.a),i.a.use(K.a),i.a.use(Y.a),i.a.use(X.a);var me={name:"CategoryPage",data:function(){return{examList:[],isShowOption:!1,optionInfo:{hashCode:""},currentExam:{},historyRecords:[],longPressTimer:null,longPressThreshold:500,isLongPressed:!1,isShowDeleteConfirm:!1,examToDelete:null}},computed:{categoryName:function(){return this.$route.params.category||"default"},categoryTitle:function(){return"default"===this.categoryName?"默认分类":this.categoryName}},methods:{handleBack:function(){window.GlobalBackManager?window.GlobalBackManager.goBack():this.$router.back()},loadCategoryExams:function(){var t=v()(u.a.mark(function t(){var e,n,i,s;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.categoryName,t.prev=1,t.next=4,Ht.query("hashCode").notEqual("").toArray();case 4:return n=t.sent,(i=n.filter(function(t){return(t.category||"default")===e})).sort(function(t,e){return t.title.split("").reduce(function(t,e){return t+e.charCodeAt(0)},0)-e.title.split("").reduce(function(t,e){return t+e.charCodeAt(0)},0)}),s=i.map(function(t){return $t.query("relatedQuestion").anyOf(t.questions).sortBy("createDate").then(function(e){var n=Object.fromEntries(e.map(function(t){return[t.relatedQuestion,he({},t,{times:t.errorTimes})]})),i=!!et()(n).find(function(t){return t.times>0});return he({},t,{errorMap:n,hasHistoryError:i})})}),t.next=10,O.a.all(s);case 10:this.examList=t.sent,t.next=17;break;case 13:t.prev=13,t.t0=t.catch(1),console.error("加载分类题库失败:",t.t0),this.examList=[];case 17:case"end":return t.stop()}},t,this,[[1,13]])}));return function(){return t.apply(this,arguments)}}(),showOption:function(){var t=v()(u.a.mark(function t(e){var n;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isLongPressed){t.next=3;break}return this.isLongPressed=!1,t.abrupt("return");case 3:if(!e.hasHistoryError){t.next=20;break}return this.optionInfo.hashCode=e.hashCode,this.currentExam=e,t.prev=6,t.next=9,$t.queryMany(e.questions||[]);case 9:n=t.sent,this.historyRecords=n,t.next=17;break;case 13:t.prev=13,t.t0=t.catch(6),console.error("加载历史记录失败:",t.t0),this.historyRecords=[];case 17:this.isShowOption=!0,t.next=21;break;case 20:this.doExam(e.hashCode);case 21:case"end":return t.stop()}},t,this,[[6,13]])}));return function(e){return t.apply(this,arguments)}}(),getTotalCounts:function(){return this.currentExam.questions?this.currentExam.questions.length:0},getErrorCounts:function(){return this.currentExam.questions&&this.historyRecords.length?this.historyRecords.filter(function(t){return t.errorTimes>0}).length:0},getUndoneCounts:function(){if(!this.currentExam.questions||!this.historyRecords.length)return this.getTotalCounts();var t=this.historyRecords.filter(function(t){return(t.errorTimes||0)+(t.rightTimes||0)>0}).length;return this.getTotalCounts()-t},doExam:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.isShowOption=!1,Ht.query("hashCode").equals(t).first().then(function(t){return O.a.all([t].concat(d()(t.questions.map(function(t){return Ot.query("hashCode").equals(t).first()}))))}).then(function(t){var s=ue()(t),a=s[0],o=s.slice(1);a.questions=o,a?e.$router.push({name:"DoExamPage",params:{examConfig:a,isReviewError:n,neverDo:i}}):K.a.alert({message:"该题库已失效!"})})},clearHistory:function(t){var e=this;this.isShowOption=!1,Ht.queryByHashCode(t).then(function(t){return t=t||{},$t.delete(t.questions||[])}).then(function(){console.log("remove the history."),e.loadCategoryExams()})},onTouchStart:function(t,e){var n=this;e.preventDefault(),this.isLongPressed=!1,this.longPressTimer=setTimeout(function(){n.isLongPressed=!0,n.examToDelete=t,n.isShowDeleteConfirm=!0,navigator.vibrate&&navigator.vibrate(50)},this.longPressThreshold)},onTouchEnd:function(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)},confirmDeleteExam:function(){var t=v()(u.a.mark(function t(){var e,n,i;return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.examToDelete){t.next=2;break}return t.abrupt("return");case 2:return this.isShowDeleteConfirm=!1,t.prev=3,e=this.examToDelete,n=this.categoryName,t.next=8,$t.delete(e.questions||[]);case 8:return t.next=10,Ht.delete(e.hashCode);case 10:if(!(e.questions&&e.questions.length>0)){t.next=13;break}return t.next=13,Ot.delete(e.questions);case 13:return t.next=15,Ht.query("hashCode").notEqual("").toArray();case 15:if(i=t.sent,0!==i.filter(function(t){return(t.category||"default")===n}).length){t.next=22;break}this.$toast.success("题库删除成功,该分类已为空"),this.$router.push("/"),t.next=25;break;case 22:return this.$toast.success("题库删除成功"),t.next=25,this.loadCategoryExams();case 25:t.next=31;break;case 27:t.prev=27,t.t0=t.catch(3),console.error("删除题库失败:",t.t0),this.$toast.fail("删除题库失败,请重试");case 31:return t.prev=31,this.examToDelete=null,t.finish(31);case 34:case"end":return t.stop()}},t,this,[[3,27,31,34]])}));return function(){return t.apply(this,arguments)}}()},mounted:function(){var t=v()(u.a.mark(function t(){return u.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.loadCategoryExams();case 2:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),beforeDestroy:function(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)},watch:{"$route.params.category":{handler:function(){this.loadCategoryExams()},immediate:!1}}},de={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"category-page"},[n("van-nav-bar",{staticClass:"category-nav-bar",attrs:{title:t.categoryTitle,fixed:"","left-arrow":""},on:{"click-left":t.handleBack}}),t._v(" "),n("div",{staticClass:"category-container"},[n("div",{staticClass:"category-header"},[n("h2",{staticClass:"gradient-text"},[t._v(t._s(t.categoryName))]),t._v(" "),n("p",{staticClass:"category-desc"},[t._v("共 "+t._s(t.examList.length)+" 个题库")])]),t._v(" "),n("transition",{attrs:{name:"slide-up"}},[t.examList.length>0?n("van-grid",{staticClass:"exam-grid",attrs:{"column-num":1,gutter:12}},t._l(t.examList,function(e,i){return n("van-grid-item",{key:e.hashCode,staticClass:"exam-item-card",style:{"animation-delay":.05*i+"s"},attrs:{clickable:""},on:{click:function(n){return t.showOption(e)},touchstart:function(n){return t.onTouchStart(e,n)},touchend:t.onTouchEnd,touchcancel:t.onTouchEnd}},[n("div",{staticClass:"exam-card-content"},[n("div",{staticClass:"exam-icon"},[n("van-icon",{attrs:{name:"notes-o",size:"24",color:e.hasHistoryError?"var(--warning-color)":"var(--primary-color)"}})],1),t._v(" "),n("div",{staticClass:"exam-info"},[n("h3",{staticClass:"exam-title"},[t._v(t._s(e.title))]),t._v(" "),n("p",{staticClass:"exam-meta"},[t._v("题目数量: "+t._s(e.questions?e.questions.length:0))]),t._v(" "),e.hasHistoryError?n("div",{staticClass:"exam-status"},[n("van-tag",{attrs:{type:"warning",size:"mini"}},[t._v("有错题")])],1):t._e()]),t._v(" "),n("div",{staticClass:"exam-arrow"},[n("van-icon",{attrs:{name:"arrow"}})],1)])])}),1):n("div",{staticClass:"empty-state"},[n("div",{staticClass:"empty-icon"},[n("van-icon",{attrs:{name:"warning-o",size:"48",color:"var(--text-light)"}})],1),t._v(" "),n("p",{staticClass:"empty-text"},[t._v("该分类下暂无题库")]),t._v(" "),n("van-button",{attrs:{type:"primary",round:""},on:{click:function(e){return t.$router.push("/")}}},[t._v("\n 返回首页\n ")])],1)],1)],1),t._v(" "),n("van-popup",{staticClass:"option-popup",attrs:{position:"bottom",round:""},on:{"click-overlay":function(e){t.isShowOption=!1}},model:{value:t.isShowOption,callback:function(e){t.isShowOption=e},expression:"isShowOption"}},[n("div",{staticClass:"exam-options"},[n("div",{staticClass:"popup-header"},[n("div",{staticClass:"header-info"},[n("h3",[t._v("选择答题模式")]),t._v(" "),n("p",{staticClass:"exam-title"},[t._v(t._s(t.currentExam.title))])]),t._v(" "),n("van-icon",{staticClass:"close-icon",attrs:{name:"cross"},on:{click:function(e){t.isShowOption=!1}}})],1),t._v(" "),n("div",{staticClass:"option-grid"},[n("div",{staticClass:"option-item",class:{disabled:0===t.getUndoneCounts()},on:{click:function(e){t.getUndoneCounts()>0&&t.doExam(t.optionInfo.hashCode,!1,!0)}}},[n("div",{staticClass:"option-icon new"},[n("van-icon",{attrs:{name:"edit"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("未做题")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v(t._s(t.getUndoneCounts())+"题")])])]),t._v(" "),n("div",{staticClass:"option-item primary",class:{disabled:0===t.getTotalCounts()},on:{click:function(e){t.getTotalCounts()>0&&t.doExam(t.optionInfo.hashCode)}}},[n("div",{staticClass:"option-icon"},[n("van-icon",{attrs:{name:"replay"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("重新测试")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v(t._s(t.getTotalCounts())+"题")])])]),t._v(" "),n("div",{staticClass:"option-item warning",class:{disabled:0===t.getErrorCounts()},on:{click:function(e){t.getErrorCounts()>0&&t.doExam(t.optionInfo.hashCode,!0)}}},[n("div",{staticClass:"option-icon"},[n("van-icon",{attrs:{name:"question-o"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("复习错题")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v(t._s(t.getErrorCounts())+"题")])])]),t._v(" "),n("div",{staticClass:"option-item danger",on:{click:function(e){return t.clearHistory(t.optionInfo.hashCode)}}},[n("div",{staticClass:"option-icon"},[n("van-icon",{attrs:{name:"delete-o"}})],1),t._v(" "),n("div",{staticClass:"option-info"},[n("span",{staticClass:"option-title"},[t._v("清空记录")]),t._v(" "),n("span",{staticClass:"option-count"},[t._v("重置")])])])])])]),t._v(" "),n("van-popup",{staticClass:"delete-confirm-popup",attrs:{position:"center",round:""},on:{"click-overlay":function(e){t.isShowDeleteConfirm=!1}},model:{value:t.isShowDeleteConfirm,callback:function(e){t.isShowDeleteConfirm=e},expression:"isShowDeleteConfirm"}},[n("div",{staticClass:"delete-confirm-content"},[n("div",{staticClass:"delete-icon"},[n("van-icon",{attrs:{name:"warning-o",size:"48",color:"var(--error-color)"}})],1),t._v(" "),n("h3",{staticClass:"delete-title"},[t._v("确认删除题库")]),t._v(" "),n("p",{staticClass:"delete-message"},[t._v("\n 确定要删除题库 "),n("strong",[t._v(t._s(t.examToDelete&&t.examToDelete.title))]),t._v(" 吗?\n ")]),t._v(" "),n("p",{staticClass:"delete-warning"},[t._v("此操作不可恢复,相关的答题记录也将被删除。")]),t._v(" "),n("div",{staticClass:"delete-actions"},[n("van-button",{staticClass:"cancel-button",attrs:{type:"default",size:"large"},on:{click:function(e){t.isShowDeleteConfirm=!1}}},[t._v("\n 取消\n ")]),t._v(" "),n("van-button",{staticClass:"confirm-button",attrs:{type:"danger",size:"large"},on:{click:t.confirmDeleteExam}},[t._v("\n 确认删除\n ")])],1)])])],1)},staticRenderFns:[]};var pe=n("VU/8")(me,de,!1,function(t){n("rEOH")},"data-v-2728c4db",null).exports;i.a.use(C.a);var ve=new C.a({routes:[{path:"/",name:"HomePage",component:jt},{path:"/category/:category",name:"CategoryPage",component:pe,props:!0},{path:"/exam",name:"DoExamPage",component:re,props:!0}]}),fe=(n("ZsCP"),n("TXXm"),n("eqfM"),n("/QYm")),ge=n("mtWM"),we=n.n(ge),Ce=n("hU7x"),ye=n.n(Ce),be=n("7oBh"),ke=n.n(be),xe=n("vhKK"),_e=n.n(xe);if(i.a.use(_e.a,{AlloyFinger:ke.a}),i.a.use(fe.a),i.a.prototype.$http=we.a,i.a.prototype.$http.jsonp=ye.a,Object.fromEntries||(Object.fromEntries=ht.fromEntries),!Array.prototype.flat)try{_()(Array.prototype,"flat",{value:function(t){return ht.flat(this,t)},enumerable:!1})}catch(t){Array.prototype.flat=function(t){return ht.flat(this,t)}}i.a.config.productionTip=!1,new i.a({el:"#app",router:ve,components:{App:w},template:"<App/>"})},PC7f:function(t,e){},RUOb:function(t,e){},TXXm:function(t,e){},WkQV:function(t,e){},ZsCP:function(t,e){},eh36:function(t,e){},hW8u:function(t,e){},"hy4/":function(t,e){},juSK:function(t,e){},nLpc:function(t,e){},nOtf:function(t,e){},nsZj:function(t,e){},px3J:function(t,e){},rEOH:function(t,e){},sKgQ:function(t,e){}},["NHnr"]);
|
2
|
+
//# sourceMappingURL=app.ba4cb15965c3df3c10eb.js.map
|