123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743 |
- !(function () {
- function t(e) {
- return (
- (t =
- 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
- ? function (t) {
- return typeof t
- }
- : function (t) {
- return t &&
- 'function' == typeof Symbol &&
- t.constructor === Symbol &&
- t !== Symbol.prototype
- ? 'symbol'
- : typeof t
- }),
- t(e)
- )
- }
- function e(t) {
- return (
- (function (t) {
- if (Array.isArray(t)) return r(t)
- })(t) ||
- (function (t) {
- if (
- ('undefined' != typeof Symbol && null != t[Symbol.iterator]) ||
- null != t['@@iterator']
- )
- return Array.from(t)
- })(t) ||
- (function (t, e) {
- if (!t) return
- if ('string' == typeof t) return r(t, e)
- var n = Object.prototype.toString.call(t).slice(8, -1)
- 'Object' === n && t.constructor && (n = t.constructor.name)
- if ('Map' === n || 'Set' === n) return Array.from(t)
- if (
- 'Arguments' === n ||
- /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)
- )
- return r(t, e)
- })(t) ||
- (function () {
- throw new TypeError(
- 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
- )
- })()
- )
- }
- function r(t, e) {
- ;(null == e || e > t.length) && (e = t.length)
- for (var r = 0, n = new Array(e); r < e; r++) n[r] = t[r]
- return n
- }
- function n() {
- 'use strict'
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ n =
- function () {
- return e
- }
- var e = {},
- r = Object.prototype,
- i = r.hasOwnProperty,
- o = 'function' == typeof Symbol ? Symbol : {},
- a = o.iterator || '@@iterator',
- u = o.asyncIterator || '@@asyncIterator',
- s = o.toStringTag || '@@toStringTag'
- function c(t, e, r) {
- return (
- Object.defineProperty(t, e, {
- value: r,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }),
- t[e]
- )
- }
- try {
- c({}, '')
- } catch (M) {
- c = function (t, e, r) {
- return (t[e] = r)
- }
- }
- function l(t, e, r, n) {
- var i = e && e.prototype instanceof p ? e : p,
- o = Object.create(i.prototype),
- a = new O(n || [])
- return (
- (o._invoke = (function (t, e, r) {
- var n = 'suspendedStart'
- return function (i, o) {
- if ('executing' === n)
- throw new Error('Generator is already running')
- if ('completed' === n) {
- if ('throw' === i) throw o
- return E()
- }
- for (r.method = i, r.arg = o; ; ) {
- var a = r.delegate
- if (a) {
- var u = w(a, r)
- if (u) {
- if (u === d) continue
- return u
- }
- }
- if ('next' === r.method) r.sent = r._sent = r.arg
- else if ('throw' === r.method) {
- if ('suspendedStart' === n) throw ((n = 'completed'), r.arg)
- r.dispatchException(r.arg)
- } else 'return' === r.method && r.abrupt('return', r.arg)
- n = 'executing'
- var s = f(t, e, r)
- if ('normal' === s.type) {
- if (
- ((n = r.done ? 'completed' : 'suspendedYield'), s.arg === d)
- )
- continue
- return { value: s.arg, done: r.done }
- }
- 'throw' === s.type &&
- ((n = 'completed'), (r.method = 'throw'), (r.arg = s.arg))
- }
- }
- })(t, r, a)),
- o
- )
- }
- function f(t, e, r) {
- try {
- return { type: 'normal', arg: t.call(e, r) }
- } catch (M) {
- return { type: 'throw', arg: M }
- }
- }
- e.wrap = l
- var d = {}
- function p() {}
- function m() {}
- function h() {}
- var y = {}
- c(y, a, function () {
- return this
- })
- var b = Object.getPrototypeOf,
- g = b && b(b(k([])))
- g && g !== r && i.call(g, a) && (y = g)
- var v = (h.prototype = p.prototype = Object.create(y))
- function _(t) {
- ;['next', 'throw', 'return'].forEach(function (e) {
- c(t, e, function (t) {
- return this._invoke(e, t)
- })
- })
- }
- function x(e, r) {
- function n(o, a, u, s) {
- var c = f(e[o], e, a)
- if ('throw' !== c.type) {
- var l = c.arg,
- d = l.value
- return d && 'object' == t(d) && i.call(d, '__await')
- ? r.resolve(d.__await).then(
- function (t) {
- n('next', t, u, s)
- },
- function (t) {
- n('throw', t, u, s)
- }
- )
- : r.resolve(d).then(
- function (t) {
- ;(l.value = t), u(l)
- },
- function (t) {
- return n('throw', t, u, s)
- }
- )
- }
- s(c.arg)
- }
- var o
- this._invoke = function (t, e) {
- function i() {
- return new r(function (r, i) {
- n(t, e, r, i)
- })
- }
- return (o = o ? o.then(i, i) : i())
- }
- }
- function w(t, e) {
- var r = t.iterator[e.method]
- if (void 0 === r) {
- if (((e.delegate = null), 'throw' === e.method)) {
- if (
- t.iterator.return &&
- ((e.method = 'return'),
- (e.arg = void 0),
- w(t, e),
- 'throw' === e.method)
- )
- return d
- ;(e.method = 'throw'),
- (e.arg = new TypeError(
- "The iterator does not provide a 'throw' method"
- ))
- }
- return d
- }
- var n = f(r, t.iterator, e.arg)
- if ('throw' === n.type)
- return (e.method = 'throw'), (e.arg = n.arg), (e.delegate = null), d
- var i = n.arg
- return i
- ? i.done
- ? ((e[t.resultName] = i.value),
- (e.next = t.nextLoc),
- 'return' !== e.method && ((e.method = 'next'), (e.arg = void 0)),
- (e.delegate = null),
- d)
- : i
- : ((e.method = 'throw'),
- (e.arg = new TypeError('iterator result is not an object')),
- (e.delegate = null),
- d)
- }
- function j(t) {
- var e = { tryLoc: t[0] }
- 1 in t && (e.catchLoc = t[1]),
- 2 in t && ((e.finallyLoc = t[2]), (e.afterLoc = t[3])),
- this.tryEntries.push(e)
- }
- function S(t) {
- var e = t.completion || {}
- ;(e.type = 'normal'), delete e.arg, (t.completion = e)
- }
- function O(t) {
- ;(this.tryEntries = [{ tryLoc: 'root' }]),
- t.forEach(j, this),
- this.reset(!0)
- }
- function k(t) {
- if (t) {
- var e = t[a]
- if (e) return e.call(t)
- if ('function' == typeof t.next) return t
- if (!isNaN(t.length)) {
- var r = -1,
- n = function e() {
- for (; ++r < t.length; )
- if (i.call(t, r)) return (e.value = t[r]), (e.done = !1), e
- return (e.value = void 0), (e.done = !0), e
- }
- return (n.next = n)
- }
- }
- return { next: E }
- }
- function E() {
- return { value: void 0, done: !0 }
- }
- return (
- (m.prototype = h),
- c(v, 'constructor', h),
- c(h, 'constructor', m),
- (m.displayName = c(h, s, 'GeneratorFunction')),
- (e.isGeneratorFunction = function (t) {
- var e = 'function' == typeof t && t.constructor
- return (
- !!e && (e === m || 'GeneratorFunction' === (e.displayName || e.name))
- )
- }),
- (e.mark = function (t) {
- return (
- Object.setPrototypeOf
- ? Object.setPrototypeOf(t, h)
- : ((t.__proto__ = h), c(t, s, 'GeneratorFunction')),
- (t.prototype = Object.create(v)),
- t
- )
- }),
- (e.awrap = function (t) {
- return { __await: t }
- }),
- _(x.prototype),
- c(x.prototype, u, function () {
- return this
- }),
- (e.AsyncIterator = x),
- (e.async = function (t, r, n, i, o) {
- void 0 === o && (o = Promise)
- var a = new x(l(t, r, n, i), o)
- return e.isGeneratorFunction(r)
- ? a
- : a.next().then(function (t) {
- return t.done ? t.value : a.next()
- })
- }),
- _(v),
- c(v, s, 'Generator'),
- c(v, a, function () {
- return this
- }),
- c(v, 'toString', function () {
- return '[object Generator]'
- }),
- (e.keys = function (t) {
- var e = []
- for (var r in t) e.push(r)
- return (
- e.reverse(),
- function r() {
- for (; e.length; ) {
- var n = e.pop()
- if (n in t) return (r.value = n), (r.done = !1), r
- }
- return (r.done = !0), r
- }
- )
- }),
- (e.values = k),
- (O.prototype = {
- constructor: O,
- reset: function (t) {
- if (
- ((this.prev = 0),
- (this.next = 0),
- (this.sent = this._sent = void 0),
- (this.done = !1),
- (this.delegate = null),
- (this.method = 'next'),
- (this.arg = void 0),
- this.tryEntries.forEach(S),
- !t)
- )
- for (var e in this)
- 't' === e.charAt(0) &&
- i.call(this, e) &&
- !isNaN(+e.slice(1)) &&
- (this[e] = void 0)
- },
- stop: function () {
- this.done = !0
- var t = this.tryEntries[0].completion
- if ('throw' === t.type) throw t.arg
- return this.rval
- },
- dispatchException: function (t) {
- if (this.done) throw t
- var e = this
- function r(r, n) {
- return (
- (a.type = 'throw'),
- (a.arg = t),
- (e.next = r),
- n && ((e.method = 'next'), (e.arg = void 0)),
- !!n
- )
- }
- for (var n = this.tryEntries.length - 1; n >= 0; --n) {
- var o = this.tryEntries[n],
- a = o.completion
- if ('root' === o.tryLoc) return r('end')
- if (o.tryLoc <= this.prev) {
- var u = i.call(o, 'catchLoc'),
- s = i.call(o, 'finallyLoc')
- if (u && s) {
- if (this.prev < o.catchLoc) return r(o.catchLoc, !0)
- if (this.prev < o.finallyLoc) return r(o.finallyLoc)
- } else if (u) {
- if (this.prev < o.catchLoc) return r(o.catchLoc, !0)
- } else {
- if (!s)
- throw new Error('try statement without catch or finally')
- if (this.prev < o.finallyLoc) return r(o.finallyLoc)
- }
- }
- }
- },
- abrupt: function (t, e) {
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
- var n = this.tryEntries[r]
- if (
- n.tryLoc <= this.prev &&
- i.call(n, 'finallyLoc') &&
- this.prev < n.finallyLoc
- ) {
- var o = n
- break
- }
- }
- o &&
- ('break' === t || 'continue' === t) &&
- o.tryLoc <= e &&
- e <= o.finallyLoc &&
- (o = null)
- var a = o ? o.completion : {}
- return (
- (a.type = t),
- (a.arg = e),
- o
- ? ((this.method = 'next'), (this.next = o.finallyLoc), d)
- : this.complete(a)
- )
- },
- complete: function (t, e) {
- if ('throw' === t.type) throw t.arg
- return (
- 'break' === t.type || 'continue' === t.type
- ? (this.next = t.arg)
- : 'return' === t.type
- ? ((this.rval = this.arg = t.arg),
- (this.method = 'return'),
- (this.next = 'end'))
- : 'normal' === t.type && e && (this.next = e),
- d
- )
- },
- finish: function (t) {
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
- var r = this.tryEntries[e]
- if (r.finallyLoc === t)
- return this.complete(r.completion, r.afterLoc), S(r), d
- }
- },
- catch: function (t) {
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
- var r = this.tryEntries[e]
- if (r.tryLoc === t) {
- var n = r.completion
- if ('throw' === n.type) {
- var i = n.arg
- S(r)
- }
- return i
- }
- }
- throw new Error('illegal catch attempt')
- },
- delegateYield: function (t, e, r) {
- return (
- (this.delegate = { iterator: k(t), resultName: e, nextLoc: r }),
- 'next' === this.method && (this.arg = void 0),
- d
- )
- }
- }),
- e
- )
- }
- function i(t, e, r, n, i, o, a) {
- try {
- var u = t[o](a),
- s = u.value
- } catch (c) {
- return void r(c)
- }
- u.done ? e(s) : Promise.resolve(s).then(n, i)
- }
- function o(t) {
- return function () {
- var e = this,
- r = arguments
- return new Promise(function (n, o) {
- var a = t.apply(e, r)
- function u(t) {
- i(a, n, o, u, s, 'next', t)
- }
- function s(t) {
- i(a, n, o, u, s, 'throw', t)
- }
- u(void 0)
- })
- }
- }
- function a(t, e) {
- var r = Object.keys(t)
- if (Object.getOwnPropertySymbols) {
- var n = Object.getOwnPropertySymbols(t)
- e &&
- (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })),
- r.push.apply(r, n)
- }
- return r
- }
- function u(t) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {}
- e % 2
- ? a(Object(r), !0).forEach(function (e) {
- s(t, e, r[e])
- })
- : Object.getOwnPropertyDescriptors
- ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r))
- : a(Object(r)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return t
- }
- function s(t, e, r) {
- return (
- e in t
- ? Object.defineProperty(t, e, {
- value: r,
- enumerable: !0,
- configurable: !0,
- writable: !0
- })
- : (t[e] = r),
- t
- )
- }
- var c = document.createElement('style')
- ;(c.innerHTML =
- '._timer_16ax5_1{overflow:hidden;padding:0 14px}._tips_16ax5_5{margin:12px 0;padding:15px 12px;background:#ffffff;border-radius:10px}._tips_16ax5_5 ._tipsTitle_16ax5_11{font-size:18px;font-weight:500;color:#333;line-height:25px}._tips_16ax5_5 ._tipsTime_16ax5_17{padding-top:4px;font-size:14px;color:#ff9e5a;line-height:22px}._tips_16ax5_5 ._tipsTime_16ax5_17 span{font-weight:600}._timerContainer_16ax5_26{background:#ffffff;border-radius:10px;padding:0 5px 9px}._timerContainer_16ax5_26 .van-col{margin-bottom:5px}._tag_16ax5_34{height:28px;background:#eff6f5;border-radius:4px;font-size:14px;font-weight:500;color:#2dc7aa;display:flex;align-items:center;justify-content:center}._active_16ax5_45{background:#2dc7aa;color:#fff}._select_16ax5_49{color:#fff!important;background:#ffb752}._setting_ioswx_1 .el-dialog{--el-dialog-width: 485px !important}._setting_ioswx_1 .el-dialog__header,._setting_ioswx_1 .el-dialog__body{padding:0}._setting_ioswx_1 .el-radio-button__inner{border:var(--el-border);border-radius:var(--el-border-radius-base)!important;width:100%;padding:11px 19px!important}._setting_ioswx_1 .el-radio-button__original-radio:checked+.el-radio-button__inner{background-color:#e9fff8;color:var(--el-color-primary);box-shadow:none}._setting_ioswx_1 .el-checkbox__inner{overflow:hidden;border-radius:9999px}\n'),
- document.head.appendChild(c),
- System.register(
- [
- './index-legacy.568e8c08.js',
- './index-legacy.5524926d.js',
- './toolsValidate-legacy.b90c63da.js',
- './isSameOrBefore-legacy.83f0dfb0.js',
- './index2-legacy.439446f2.js',
- './index2-legacy.fc68754b.js',
- './index2-legacy.ef013f4d.js'
- ],
- function (t) {
- 'use strict'
- var r,
- i,
- a,
- s,
- c,
- l,
- f,
- d,
- p,
- m,
- h,
- y,
- b,
- g,
- v,
- _,
- x,
- w,
- j,
- S,
- O,
- k,
- E,
- M
- return {
- setters: [
- function (t) {
- r = t.C
- },
- function (t) {
- ;(i = t.d),
- (a = t.a_),
- (s = t.c),
- (c = t.a),
- (l = t.b2),
- (f = t.b3),
- (d = t.N),
- (p = t.b),
- (m = t.b0),
- (h = t.aZ),
- (y = t.F),
- (b = t.aX),
- (g = t.aY),
- (v = t.aw),
- (_ = t.M),
- (x = t.aN)
- },
- function (t) {
- w = t.v
- },
- function (t) {
- ;(j = t.c), (S = t.i)
- },
- function (t) {
- ;(O = t.E), (k = t.a)
- },
- function (t) {
- ;(E = t.E), (M = t.a)
- },
- function () {}
- ],
- execute: function () {
- var L = '_timer_16ax5_1',
- T = '_tips_16ax5_5',
- N = '_tipsTitle_16ax5_11',
- P = '_tipsTime_16ax5_17',
- C = '_timerContainer_16ax5_26',
- I = '_tag_16ax5_34',
- F = '_active_16ax5_45',
- H = '_select_16ax5_49'
- a.extend(j), a.extend(S)
- var V = i({
- name: 'practice-timer',
- props: {
- timerObject: { type: Object, default: {} },
- onClose: { type: Function, default: function () {} },
- onChoice: { type: Function, default: function (t) {} },
- courseMinutes: { type: Number, default: 25 },
- freeMinutes: { type: Number, default: 5 },
- startSetting: { type: String, default: '08:00' },
- endSetting: { type: String, default: '18:00' }
- },
- data: function () {
- return {
- timerList: [],
- list: [],
- weekList: [
- '周一',
- '周二',
- '周三',
- '周四',
- '周五',
- '周六',
- '周日'
- ],
- weekType: [
- 'monday',
- 'tuesday',
- 'wednesday',
- 'thursday',
- 'friday',
- 'saturday',
- 'sunday'
- ]
- }
- },
- mounted: function () {
- ;(this.list = this.timerInit(
- this.startSetting,
- this.endSetting,
- this.courseMinutes + this.freeMinutes || 30
- )),
- console.log(this.endSetting)
- },
- methods: {
- timerInit: function (t, e, r) {
- for (
- var n = a(t, 'HH:mm'), i = a(e, 'HH:mm'), o = [];
- n.add(r, 'minute').isSameOrBefore(a(i));
- ) {
- var s = {
- startTime: n.format('HH:mm'),
- endTime: n.add(r, 'minute').format('HH:mm'),
- status: !1
- }
- o.push(s), (n = n.add(r, 'minute'))
- }
- var c = []
- return (
- o.forEach(function (t) {
- for (var e = [], r = 0; r < 7; r++) e.push(u({}, t))
- c.push(e)
- }),
- this._initData(c)
- )
- },
- _initData: function (t) {
- var e = this.weekType,
- r = this.timerObject
- return (
- t.forEach(function (t) {
- t.forEach(function (t, n) {
- var i = r[e[n]],
- o = a(t.startTime, 'HH:mm').format('HH:mm:ss')
- ;(null == i
- ? void 0
- : i.some(function (t) {
- return t.startTime === o
- })) && (t.status = !0)
- })
- }),
- t
- )
- },
- btnStatus: function (t, e) {
- return 'row' === e
- ? this.list.every(function (e) {
- return e[t].status
- })
- : 'col' == e
- ? this.list[t].every(function (t) {
- return t.status
- })
- : void 0
- },
- choice: function (t, e, r) {
- 'row' === e &&
- this.list.forEach(function (e, n) {
- var i = !r
- e[t].status = i
- }),
- 'col' == e &&
- this.list[t].forEach(function (t, e) {
- var n = !r
- t.status = n
- })
- },
- onSubmit: function () {
- var t = this,
- e = this.list,
- r = {
- monday: [],
- tuesday: [],
- wednesday: [],
- thursday: [],
- friday: [],
- saturday: [],
- sunday: []
- },
- n = this.weekType,
- i = !1
- e.forEach(function (e, o) {
- e.forEach(function (e, o) {
- e.status &&
- ((i = !0),
- r[n[o]].push({
- startTime: a(e.startTime, 'HH:mm').format(
- 'HH:mm:ss'
- ),
- endTime: a(e.endTime, 'HH:mm')
- .subtract(t.freeMinutes, 'minute')
- .format('HH:mm:ss')
- }))
- })
- }),
- this.onChoice && this.onChoice(r, i)
- }
- },
- render: function () {
- var t = this
- return s('div', { class: L }, [
- s('div', { class: T }, [
- s('div', { class: N }, [c('请选择陪练开始时间')]),
- s('div', { class: P }, [
- c('陪练课单课时时长为 '),
- s('span', null, [this.courseMinutes]),
- c(' 分钟')
- ])
- ]),
- s('div', { class: [C, 'mb12'] }, [
- s(
- l,
- { gutter: 5 },
- {
- default: function () {
- return [
- s(f, { span: 3, class: [I] }, null),
- t.weekList.map(function (t) {
- return s(
- f,
- { span: 3 },
- {
- default: function () {
- return [s('span', { class: I }, [t])]
- }
- }
- )
- })
- ]
- }
- }
- ),
- s(
- l,
- { gutter: 5, class: 'pt-1' },
- {
- default: function () {
- return [
- s(f, { span: 3, class: [I] }, null),
- t.weekList.map(function (e, r) {
- return s(
- f,
- { span: 3 },
- {
- default: function () {
- return [
- s(
- 'span',
- {
- class: [
- I,
- 'cursor-pointer',
- t.btnStatus(r, 'row') && F
- ],
- onClick: function () {
- return t.choice(
- r,
- 'row',
- t.btnStatus(r, 'row')
- )
- }
- },
- [c('全选')]
- )
- ]
- }
- }
- )
- })
- ]
- }
- }
- ),
- s('div', { class: 'h-72 overflow-auto' }, [
- this.list.map(function (e, r) {
- return s(
- l,
- { gutter: 5, class: 'pt-1' },
- {
- default: function () {
- return [
- s(
- f,
- { span: 3 },
- {
- default: function () {
- return [
- s(
- 'span',
- {
- class: [
- I,
- 'cursor-pointer',
- t.btnStatus(r, 'col') && F
- ],
- onClick: function () {
- return t.choice(
- r,
- 'col',
- t.btnStatus(r, 'col')
- )
- }
- },
- [c('全选')]
- )
- ]
- }
- }
- ),
- e.map(function (t) {
- return s(
- f,
- { span: 3 },
- {
- default: function () {
- return [
- s(
- 'span',
- {
- class: [
- I,
- 'cursor-pointer',
- t.status && H
- ],
- style: { color: '#333333' },
- onClick: function () {
- return (t.status = !t.status)
- }
- },
- [t.startTime]
- )
- ]
- }
- }
- )
- })
- ]
- }
- }
- )
- })
- ])
- ]),
- s('div', { class: 'text-center pt-3 pb-5' }, [
- s(
- d,
- {
- class: '!w-40 !h-[38px]',
- onClick: function () {
- t.onClose()
- }
- },
- {
- default: function () {
- return [c('取消')]
- }
- }
- ),
- s(
- d,
- {
- type: 'primary',
- class: '!w-40 !h-[38px]',
- onClick: this.onSubmit
- },
- {
- default: function () {
- return [c('保存设置')]
- }
- }
- )
- ])
- ])
- }
- }),
- A = '_setting_ioswx_1'
- function D(t) {
- return (
- 'function' == typeof t ||
- ('[object Object]' === Object.prototype.toString.call(t) &&
- !v(t))
- )
- }
- t(
- 'default',
- i({
- name: 'practice-setting',
- data: function () {
- return {
- subjectList: [],
- chargeTypeArr: { 0: '否', 1: '是' },
- classTimeStatus: !1,
- subjectStatus: !1,
- timerStatus: !1,
- timeSetting: {
- courseMinutes: 25,
- freeMinutes: 5,
- startSetting: '08:00',
- endSetting: '18:00'
- },
- timerObject: {},
- form: {
- enableFlag: 1,
- courseMinutes: null,
- freeMinutes: 0,
- subjectIdTemp: '',
- subjectId: [],
- subjectPrice: [],
- skipHolidayFlag: 1,
- setting: '未设置'
- },
- minutes: [],
- rate: 0
- }
- },
- mounted: function () {
- var t = this
- return o(
- n().mark(function e() {
- var r, i, o, a, s, c, l
- return n().wrap(
- function (e) {
- for (;;)
- switch ((e.prev = e.next)) {
- case 0:
- return (
- (e.prev = 0),
- (e.next = 3),
- p.get(
- '/api-website/sysConfig/queryByParamNameList',
- {
- params: {
- paramNames:
- 'practice_times_setting,practice_service_fee,course_start_setting,course_end_setting'
- }
- }
- )
- )
- case 3:
- return (
- (r = e.sent),
- (r.data || []).forEach(function (e) {
- if (
- 'practice_times_setting' === e.paramName
- ) {
- var r = e.paramValue
- ? JSON.parse(e.paramValue)
- : [],
- n = []
- r.forEach(function (t) {
- n.push(
- u(
- u({}, t),
- {},
- { name: t.courseMinutes }
- )
- )
- }),
- (t.minutes = [].concat(n))
- }
- 'practice_service_fee' === e.paramName &&
- (t.rate = e.paramValue),
- 'course_start_setting' === e.paramName &&
- (t.timeSetting.startSetting =
- e.paramValue),
- 'course_end_setting' === e.paramName &&
- (t.timeSetting.endSetting =
- e.paramValue)
- }),
- (e.next = 8),
- p.post('/api-website/teacher/querySubject')
- )
- case 8:
- return (
- (i = e.sent),
- (t.subjectList = i.data || []),
- (e.next = 12),
- p.post(
- '/api-website/teacherFreeTime/getDetail',
- { data: { defaultFlag: 1 } }
- )
- )
- case 12:
- ;(o = e.sent),
- (a = o.data) &&
- ((t.timeSetting.courseMinutes =
- a.courseMinutes),
- (t.timeSetting.freeMinutes = a.freeMinutes),
- (t.timerObject = {
- monday: a.monday
- ? JSON.parse(a.monday)
- : [],
- tuesday: a.tuesday
- ? JSON.parse(a.tuesday)
- : [],
- wednesday: a.wednesday
- ? JSON.parse(a.wednesday)
- : [],
- thursday: a.thursday
- ? JSON.parse(a.thursday)
- : [],
- friday: a.friday
- ? JSON.parse(a.friday)
- : [],
- saturday: a.saturday
- ? JSON.parse(a.saturday)
- : [],
- sunday: a.sunday
- ? JSON.parse(a.sunday)
- : []
- }),
- (s = []),
- (c = []),
- (a.subjectPrice || []).forEach(function (
- t
- ) {
- s.push(t.subjectId),
- c.push({
- subjectId: t.subjectId,
- subjectPrice: t.subjectPrice,
- subjectName: t.subjectName
- })
- }),
- (l = t.timerObject),
- (t.form = {
- enableFlag: a.enableFlag ? 1 : 0,
- courseMinutes: a.courseMinutes,
- freeMinutes: a.freeMinutes,
- subjectIdTemp: s.join(','),
- subjectId: s,
- subjectPrice: c,
- skipHolidayFlag: a.skipHolidayFlag
- ? 1
- : 0,
- setting:
- l.monday.length > 0 ||
- l.tuesday.length > 0 ||
- l.wednesday.length > 0 ||
- l.thursday.length > 0 ||
- l.friday.length > 0 ||
- l.saturday.length > 0 ||
- l.sunday.length > 0
- ? '已设置'
- : '未设置'
- })),
- (e.next = 19)
- break
- case 17:
- ;(e.prev = 17), (e.t0 = e.catch(0))
- case 19:
- case 'end':
- return e.stop()
- }
- },
- e,
- null,
- [[0, 17]]
- )
- })
- )()
- },
- methods: {
- onSelect: function (t) {
- this.form.courseMinutes !== t.courseMinutes &&
- ((this.timerObject = {}), (this.form.setting = '未设置')),
- (this.form.courseMinutes = t.courseMinutes),
- (this.form.freeMinutes = t.freeMinutes)
- },
- onTimer: function () {
- var t = this
- return o(
- n().mark(function e() {
- var r
- return n().wrap(
- function (e) {
- for (;;)
- switch ((e.prev = e.next)) {
- case 0:
- if (
- ((e.prev = 0), (r = t.form).courseMinutes)
- ) {
- e.next = 5
- break
- }
- return (
- m.error('请选择单课时时长'),
- e.abrupt('return')
- )
- case 5:
- ;(t.timeSetting.courseMinutes = Number(
- r.courseMinutes
- )),
- (t.timeSetting.freeMinutes = Number(
- r.freeMinutes
- )),
- (t.timerStatus = !0),
- (e.next = 12)
- break
- case 10:
- ;(e.prev = 10), (e.t0 = e.catch(0))
- case 12:
- case 'end':
- return e.stop()
- }
- },
- e,
- null,
- [[0, 10]]
- )
- })
- )()
- },
- onChoiceTimer: function (t, e) {
- ;(this.form.setting = e ? '已设置' : ''),
- (this.timerObject = t),
- (this.timerStatus = !1)
- },
- onChoice: function (t) {
- var r = t || []
- ;(this.form.subjectId = r),
- (this.form.subjectIdTemp = r.join(',') || '')
- var n = e(this.form.subjectPrice)
- r.forEach(function (t) {
- ;-1 ===
- n.findIndex(function (e) {
- return e.subjectId === t
- }) &&
- n.push({
- subjectId: t,
- subjectPrice: null,
- subjectName: ''
- })
- })
- var i = []
- n.forEach(function (t) {
- r.some(function (e) {
- return e === t.subjectId
- }) && i.push(t)
- }),
- (this.form.subjectPrice = i),
- (this.subjectStatus = !1)
- },
- getSubjectName: function (t) {
- var e = this.subjectList.find(function (e) {
- return e.id === t
- })
- return e ? e.name : ''
- },
- onFormatter: function (t) {
- t.target.value = w(t.target.value)
- },
- onSubmit: function () {
- var t = this
- return o(
- n().mark(function e() {
- return n().wrap(function (e) {
- for (;;)
- switch ((e.prev = e.next)) {
- case 0:
- t.$refs.form.validate(
- (function () {
- var e = o(
- n().mark(function e(r) {
- var i
- return n().wrap(
- function (e) {
- for (;;)
- switch ((e.prev = e.next)) {
- case 0:
- if (!r) {
- e.next = 15
- break
- }
- return (
- (e.prev = 1),
- (i =
- t.form).subjectPrice.forEach(
- function (e) {
- e.subjectName =
- t.getSubjectName(
- e.subjectId
- )
- }
- ),
- (i.setting =
- '未设置' === i.setting
- ? ''
- : i.setting),
- (e.next = 7),
- p.post(
- '/api-website/teacherFreeTime/upSet',
- {
- data: u(
- u({}, i),
- t.timerObject
- )
- }
- )
- )
- case 7:
- m.success('设置成功'),
- setTimeout(function () {
- postMessage({
- api: 'back',
- content: {}
- })
- }, 500),
- (e.next = 13)
- break
- case 11:
- ;(e.prev = 11),
- (e.t0 = e.catch(1))
- case 13:
- e.next = 17
- break
- case 15:
- return (
- t.$nextTick(function () {
- document
- .getElementsByClassName(
- 'is-error'
- )[0]
- .scrollIntoView({
- block: 'center',
- behavior: 'smooth'
- })
- }),
- e.abrupt('return', !1)
- )
- case 17:
- case 'end':
- return e.stop()
- }
- },
- e,
- null,
- [[1, 11]]
- )
- })
- )
- return function (t) {
- return e.apply(this, arguments)
- }
- })()
- )
- case 1:
- case 'end':
- return e.stop()
- }
- }, e)
- })
- )()
- }
- },
- render: function () {
- var t,
- e,
- n,
- i = this
- return s('div', { class: A }, [
- s(
- 'div',
- {
- class:
- 'text-base text-[#666] leading-none px-6 py-5 border-b border-b-[#E5E5E5]'
- },
- [c('陪练课设置')]
- ),
- null !== (t = h.user.data) && void 0 !== t && t.entryFlag
- ? s(y, null, [
- s(
- b,
- {
- labelPosition: 'left',
- labelWidth: '180px',
- size: 'large',
- model: this.form,
- ref: 'form',
- class: 'px-44 py-5'
- },
- {
- default: function () {
- return [
- s(
- g,
- {
- label: '是否开启陪练',
- prop: 'enableFlag',
- rules: [
- {
- required: !0,
- message: '请选择是否开启陪练'
- }
- ]
- },
- {
- default: function () {
- return [
- s(
- O,
- {
- class: 'w-full',
- modelValue: i.form.enableFlag,
- 'onUpdate:modelValue': function (
- t
- ) {
- return (i.form.enableFlag = t)
- }
- },
- {
- default: function () {
- return [
- s(
- O.Option,
- { value: 1, label: '是' },
- {
- default: function () {
- return [c('是')]
- }
- }
- ),
- s(
- O.Option,
- { value: 0, label: '否' },
- {
- default: function () {
- return [c('否')]
- }
- }
- )
- ]
- }
- }
- )
- ]
- }
- }
- ),
- s(
- g,
- {
- label: '可教授声部',
- prop: 'subjectId',
- rules: [
- {
- required: !0,
- message: '请选择可教授声部',
- trigger: 'change'
- }
- ]
- },
- {
- default: function () {
- return [
- s(
- O,
- {
- multiple: !0,
- filterable: !0,
- placeholder: '请选择可教授声部',
- class: 'w-full',
- multipleLimit: 5,
- modelValue: i.form.subjectId,
- 'onUpdate:modelValue': function (
- t
- ) {
- return (i.form.subjectId = t)
- },
- onChange: i.onChoice
- },
- D(
- (e = i.subjectList.map(function (
- t
- ) {
- return s(
- k,
- {
- key: t.id,
- value: t.id,
- label: t.name
- },
- null
- )
- }))
- )
- ? e
- : {
- default: function () {
- return [e]
- }
- }
- )
- ]
- }
- }
- ),
- s(
- g,
- {
- label: '单课时长',
- prop: 'courseMinutes',
- rules: [
- {
- required: !0,
- message: '请选择单课时长',
- trigger: 'change'
- }
- ]
- },
- {
- default: function () {
- return [
- s(
- O,
- {
- class: 'w-full',
- placeholder: '请选择单课时时长',
- modelValue: i.form.courseMinutes,
- 'onUpdate:modelValue': function (
- t
- ) {
- return (i.form.courseMinutes =
- t)
- }
- },
- D(
- (n = i.minutes.map(function (t) {
- return s(
- k,
- {
- key: t.courseMinutes,
- value: t.courseMinutes
- },
- {
- default: function () {
- return [t.name]
- }
- }
- )
- }))
- )
- ? n
- : {
- default: function () {
- return [n]
- }
- }
- )
- ]
- }
- }
- ),
- i.form.subjectPrice.map(function (t, e) {
- return s(
- g,
- {
- label: ''.concat(
- i.getSubjectName(t.subjectId),
- '陪练价格'
- ),
- prop: 'subjectPrice.'.concat(
- e,
- '.subjectPrice'
- ),
- rules: [
- {
- required: !0,
- message: '请选择声部陪练价格'
- }
- ]
- },
- {
- default: function () {
- return [
- s(
- _,
- {
- onKeyup: i.onFormatter,
- type: 'text',
- placeholder: '请输入陪练价格',
- modelValue: t.subjectPrice,
- 'onUpdate:modelValue':
- function (e) {
- return (t.subjectPrice = e)
- }
- },
- {
- append: function () {
- return s(
- 'span',
- {
- class:
- 'text-base text-[#333]'
- },
- [c('元')]
- )
- }
- }
- )
- ]
- }
- }
- )
- }),
- s(
- g,
- { label: '是否跳过节假日' },
- {
- default: function () {
- return [
- s(
- E,
- {
- modelValue:
- i.form.skipHolidayFlag,
- 'onUpdate:modelValue': function (
- t
- ) {
- return (i.form.skipHolidayFlag =
- t)
- }
- },
- {
- default: function () {
- return [
- s(
- M,
- {
- label: 1,
- class: 'mr-3 w-24'
- },
- {
- default: function () {
- return [c('是')]
- }
- }
- ),
- s(
- M,
- { label: 0, class: 'w-24' },
- {
- default: function () {
- return [c('否')]
- }
- }
- )
- ]
- }
- }
- )
- ]
- }
- }
- ),
- s(
- g,
- { label: '陪练时间段' },
- {
- default: function () {
- return [
- s(
- 'div',
- {
- onClick: i.onTimer,
- class: 'w-full'
- },
- [
- s(
- _,
- {
- readonly: !0,
- class: 'cursor-pointer',
- modelValue: i.form.setting,
- 'onUpdate:modelValue':
- function (t) {
- return (i.form.setting =
- t)
- },
- placeholder:
- '请选择陪练时间段',
- suffixIcon: 'ArrowDown'
- },
- null
- )
- ]
- )
- ]
- }
- }
- )
- ]
- }
- }
- ),
- s(
- 'div',
- {
- class:
- 'border-t border-t-[#E5E5E5] text-center pt-6 pb-7'
- },
- [
- s(
- d,
- {
- class: '!w-40 !h-[38px]',
- onClick: function () {
- ;(i.form = {
- enableFlag: 1,
- courseMinutes: null,
- freeMinutes: 0,
- subjectIdTemp: '',
- subjectId: [],
- subjectPrice: [],
- skipHolidayFlag: 1,
- setting: '未设置'
- }),
- i.$refs.form.resetFields()
- }
- },
- {
- default: function () {
- return [c('重置')]
- }
- }
- ),
- s(
- d,
- {
- type: 'primary',
- class: '!w-40 !h-[38px]',
- onClick: this.onSubmit
- },
- {
- default: function () {
- return [c('保存设置')]
- }
- }
- )
- ]
- )
- ])
- : s(
- r,
- {
- type: 'teacherCert',
- message:
- '您还未完成达人认证,认证后才可设置陪练课哦~',
- buttonVisibility: !0,
- buttonText: '去认证',
- onDetail: function () {
- i.$router.push('/teacherAuth')
- }
- },
- null
- ),
- s(
- x,
- {
- modelValue: this.timerStatus,
- 'onUpdate:modelValue': function (t) {
- return (i.timerStatus = t)
- },
- showClose: !0
- },
- {
- default: function () {
- return [
- s(
- V,
- {
- onChoice: i.onChoiceTimer,
- onClose: function () {
- i.timerStatus = !1
- },
- timerObject: i.timerObject,
- courseMinutes: Number(
- i.timeSetting.courseMinutes
- ),
- freeMinutes: Number(i.timeSetting.freeMinutes),
- startSetting: i.timeSetting.startSetting,
- endSetting: i.timeSetting.endSetting
- },
- null
- )
- ]
- }
- }
- )
- ])
- }
- })
- )
- }
- }
- }
- )
- })()
|