@qxs-bns/components-wc 0.0.23 → 0.0.25
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/es/editor/blocksuite-editor.mjs +14 -14
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/subject/action.mjs +18 -18
- package/es/subject/action.mjs.map +1 -1
- package/es/subject/blank-fill.mjs +128 -49
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/layout.mjs +3 -3
- package/es/subject/layout.mjs.map +1 -1
- package/es/subject/list.mjs +80 -46
- package/es/subject/list.mjs.map +1 -1
- package/es/subject/page-end.mjs +8 -8
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/scale.mjs +110 -29
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +48 -48
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/text-fill.mjs +139 -98
- package/es/subject/text-fill.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +4 -4
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/subject/action.cjs +18 -18
- package/lib/subject/action.cjs.map +1 -1
- package/lib/subject/blank-fill.cjs +123 -44
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/layout.cjs +2 -2
- package/lib/subject/layout.cjs.map +1 -1
- package/lib/subject/list.cjs +83 -49
- package/lib/subject/list.cjs.map +1 -1
- package/lib/subject/page-end.cjs +8 -8
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/scale.cjs +103 -22
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +48 -48
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/text-fill.cjs +128 -87
- package/lib/subject/text-fill.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blank-fill.mjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\ninterface BlankAnswer { title: string, tag: string, showInput: boolean }\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n /* Tag style */\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n /* Button small style */\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n /* Link style */\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n /* Input small for tag */\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n /* Checkbox style */\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) customId = ''\n @property({ type: Boolean, attribute: 'is-edit' }) isEdit = false\n @property({ type: Boolean, attribute: 'is-save' }) isSave = false\n @property({ type: Boolean, attribute: 'is-set' }) isSet = false\n @property({ type: Boolean, attribute: 'is-key' }) isKey = false\n @property({ type: Boolean, attribute: 'show-action' }) showAction = true\n @property({ type: Boolean, attribute: 'show-add' }) showAdd = true\n @property({ type: Boolean, attribute: 'show-answer-setting' }) showAnswerSetting = false\n @property({ type: Boolean, attribute: 'show-analysis' }) showAnalysis = true\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n @property({ type: String, attribute: 'exam-expand' }) examExpand = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n examAnswerSetting: { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n @property({ type: Object })\n uploadImage: (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = (e) => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) answerList: any[] = []\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n if (!this.isEdit && (changed.has('title') || changed.has('answerList') || changed.has('analysis') || changed.has('examAnswerSetting') || changed.has('richTextContent'))) {\n this._syncProps()\n }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue.replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return String(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this.answerList?.length) {\n this._answers = this.answerList.map((a: any) => ({ title: this._normalizeAnswerTitle(a), tag: '', showInput: false }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length || 1\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this.examAnswerSetting) {\n this._isInOrder = !!this.examAnswerSetting.isInOrder\n this._isIgnoreCase = !!this.examAnswerSetting.isIgnoreCase\n }\n this._richText = this.richTextContent || ''\n this._showRichText = !!this.richTextContent\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n // 双向绑定:通知外部更新\n private _emitModelUpdate() {\n if (this.useModel) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (tag) {\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) { tags.splice(idx, 1); item.title = tags.join(',') }\n this.requestUpdate()\n }\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: 'blank_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this.isEdit ? this._answers : (this.answerList || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const isInOrder = this.isEdit ? this._isInOrder : this.examAnswerSetting?.isInOrder ?? false\n const isIgnoreCase = this.isEdit ? this._isIgnoreCase : this.examAnswerSetting?.isIgnoreCase ?? true\n const showRichText = this.isEdit ? this._showRichText : !!this.richTextContent\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: answers.map((a: any) => ({ title: a.title, isCorrect: true })),\n analysis,\n isSetCorrectAnswer: true,\n isKey: this.isKey,\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this.customId || undefined, answerType: 'blank_fill', orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this.isEdit ? this._answers : (this.answerList || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this.isEdit ? this._answers : (this.answerList || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this.orderIndex + 1}.${displayTitle}(填空题)</span>\n ${this.richTextContent ? html`<div class=\"rich-text\" .innerHTML=${this.richTextContent}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`\n <span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>\n `\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title} ?disabled=${this.isSave}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【填空题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex flex-justify-end\">\n <span class=\"el-link ${this.isSave ? 'is-disabled' : ''}\"\n @click=${() => {\n if (!this.isSave) { this._addBlank() }\n }}>插入填空符</span>\n </div>\n\n ${this.showAnswerSetting\n ? html`\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n `\n : ''}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n ${!this.isSave ? html`<span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>` : ''}\n </span>\n `)}\n ${!this.isSave\n ? html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `\n : ''}\n </div>\n </div>\n `)}\n\n ${this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .uploadImage=${this.uploadImage}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this.showAction\n ? html`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this.showAnalysis\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout .showEdit=${this.isEdit}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this.showAction\n ? html`\n <qxs-subject-action\n .isEdit=${this.isEdit}\n .isSet=${this.isSet}\n .showAdd=${this.showAdd}\n .showRichText=${this._showRichText}\n exam-answer-relation-type=${this.examAnswerRelationType}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","orderIndex","title","customId","isEdit","isSave","isSet","isKey","showAction","showAdd","showAnswerSetting","showAnalysis","richTextContent","analysis","examAnswerRelationType","examExpand","examAnswerSetting","isInOrder","isIgnoreCase","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","answerList","modelValue","useModel","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","_normalizeAnswerTitle","answer","String","length","map","a","blankCount","match","Array","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","_handleAddTag","item","join","_closeTag","tags","split","idx","findIndex","t","splice","toJSON","row","answerType","answers","showRichText","richText","SubjectError","SubjectType","BLANK_FILL","isCorrect","isSetCorrectAnswer","examAnswerSettingBO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","some","_renderEdit","checked","filter","Boolean","key","updateComplete","then","shadowRoot","querySelector","focus","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","state","safeCustomElement"],"mappings":"ybAQA,MAAMA,EAAWC,CAAA;;;;UAoBV,IAAMC,EAAN,cAA2BC,EAA3BC,WAAAA,GAAAC,SAAAC,WAiFiDC,KAAAC,WAAa,EACvCD,KAAAE,MAAQ,GACgBF,KAAAG,SAAW,GACZH,KAAAI,QAAS,EACTJ,KAAAK,QAAS,EACVL,KAAAM,OAAQ,EACRN,KAAAO,OAAQ,EACHP,KAAAQ,YAAa,EAChBR,KAAAS,SAAU,EACCT,KAAAU,mBAAoB,EAC1BV,KAAAW,cAAe,EACZ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hK,EAsHM+J,UAAA,gBAAA,GACAL,EAAA,CAAhBM,KAvHUhK,EAuHM+J,UAAA,gBAAA,GACAL,EAAA,CAAhBM,KAxHUhK,EAwHM+J,UAAA,YAAA,GAxHN/J,EAAN0J,EAAA,CADNO,EAAkB,mBACNjK"}
|
|
1
|
+
{"version":3,"file":"blank-fill.mjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem } from './single'\nimport { SubjectType } from './types'\n\ninterface BlankAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n}\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .el-select:focus { border-color: #3D61E3; outline: none; }\n .el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'is-key' }) 'is-key' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = true\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('exam-answer-setting') || changed.has('rich-text-content') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value'].replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return String(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this['answer-list'].map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n tag: '',\n showInput: false,\n answerId: a?.answerId ?? a?.examAnswerId,\n }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length || 1\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this['exam-answer-setting']) {\n this._isInOrder = !!this['exam-answer-setting'].isInOrder\n this._isIgnoreCase = !!this['exam-answer-setting'].isIgnoreCase\n }\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n private _emitModelUpdate() {\n if (this['use-model']) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (!tag) { return }\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) {\n tags.splice(idx, 1)\n item.title = tags.join(',')\n }\n this.requestUpdate()\n }\n\n private _removeTag(tagId: string | number) {\n this._selectedTagList = this._selectedTagList.filter(item => String(item.tagId) !== String(tagId))\n this._emit('tag-change', {\n value: this._selectedTagList,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _chooseTag() {\n this._emit('choose-tag', {\n value: this._selectedTagList,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this['is-edit']\n ? this._answers\n : (this['answer-list'] || []).map((answer: any) => ({\n ...answer,\n title: this._normalizeAnswerTitle(answer),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }))\n const analysis = this['is-edit'] ? this._analysis : this.analysis || ''\n const isInOrder = this['is-edit'] ? this._isInOrder : this['exam-answer-setting']?.isInOrder ?? false\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : this['exam-answer-setting']?.isIgnoreCase ?? true\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const selectedTagList = this._selectedTagList || []\n const filledAnswers = answers.filter((answer: any) => this._normalizeAnswerTitle(answer))\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: filledAnswers.map((answer: any) => ({\n title: this._normalizeAnswerTitle(answer),\n isCorrect: true,\n ...(answer.answerId ? { answerId: answer.answerId } : {}),\n })),\n analysis,\n isSetCorrectAnswer: filledAnswers.length > 0,\n isKey: this['is-key'],\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n categoryId: this._categoryId || '',\n memberTagInfo: selectedTagList,\n tagInfos: selectedTagList,\n resourceList: this['resource-list'] || [],\n examResourceBOList: this['resource-list'] || [],\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${displayTitle}(填空题)</span>\n ${this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`<span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>`\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this['show-tag'] && this._selectedTagList.length\n ? html`\n <div class=\"section-row\">\n <span class=\"value-text\">标签/关键信息:</span>\n <div class=\"tag-list\" style=\"margin-top:6px\">\n ${this._selectedTagList.map(item => html`<span class=\"tag-item\">${item.tagName}</span>`)}\n </div>\n </div>\n `\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderTagSection() {\n if (!this['show-tag']) { return '' }\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>标签:</span></div>\n <div style=\"flex:1\">\n <div class=\"tag-list\">\n ${this._selectedTagList.length\n ? this._selectedTagList.map(item => html`\n <span class=\"tag-item\">\n ${item.tagName}\n ${!this['is-save'] ? html`<span class=\"close\" @click=${() => this._removeTag(item.tagId)}>×</span>` : ''}\n </span>\n `)\n : html`<span class=\"tag-hint\">暂无标签/关键信息</span>`}\n </div>\n ${this['is-edit'] && !this['is-save']\n ? html`<div style=\"margin-top:8px\"><span class=\"el-link\" @click=${() => this._chooseTag()}>选择</span></div>`\n : ''}\n </div>\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)} ?disabled=${this['is-save']}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title} ?disabled=${this['is-save']}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【填空题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex flex-justify-end\">\n <span class=\"el-link ${this['is-save'] ? 'is-disabled' : ''}\"\n @click=${() => {\n if (!this['is-save']) { this._addBlank() }\n }}>插入填空符</span>\n </div>\n\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n\n ${this._renderTagSection()}\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n ${!this['is-save'] ? html`<span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>` : ''}\n </span>\n `)}\n ${!this['is-save']\n ? html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `\n : ''}\n </div>\n </div>\n `)}\n\n ${this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this['show-action']\n ? html`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this._showRichText}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","title","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","length","a","answerId","examAnswerId","blankCount","match","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","modelValue","_handleAddTag","join","_closeTag","tags","split","idx","findIndex","t","splice","_removeTag","tagId","filter","customId","examId","_chooseTag","_onCategoryChange","_imageResources","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","toJSON","row","answerType","orderIndex","answers","showRichText","richText","selectedTagList","filledAnswers","SubjectError","SubjectType","BLANK_FILL","isCorrect","isSetCorrectAnswer","isKey","examAnswerSettingBO","examRichTextContent","memberTagInfo","tagInfos","resourceList","examResourceBOList","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","some","tagName","_renderResourceSection","_renderTagSection","_renderCategorySection","images","video","src","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","state","safeCustomElement"],"mappings":"ybAaA,MAAMA,EAAWC,CAAA;;;;UAoBV,IAAMC,EAAN,cAA2BC,EAA3BC,WAAAA,GAAAC,SAAAC,WAwGiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACFA,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,qBAAsB,GACtDA,KAAAE,SAAW,GAC6BF,KAAA,6BAA8B,EAC5CA,KAAA,eAAgB,GACpBA,KAAA,WAAY,EACRA,KAAA,eAAgB,GAEtEA,KAAA,uBAAuE,CAAEG,WAAW,EAAOC,cAAc,GAGzGJ,KAAA,gBAAkDK,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,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BM,KApJUpL,EAoJMmL,UAAA,aAAA,GACAL,EAAA,CAAhBM,KArJUpL,EAqJMmL,UAAA,gBAAA,GACAL,EAAA,CAAhBM,KAtJUpL,EAsJMmL,UAAA,gBAAA,GACAL,EAAA,CAAhBM,KAvJUpL,EAuJMmL,UAAA,YAAA,GACAL,EAAA,CAAhBM,KAxJUpL,EAwJMmL,UAAA,mBAAA,GACAL,EAAA,CAAhBM,KAzJUpL,EAyJMmL,UAAA,cAAA,GAzJNnL,EAAN8K,EAAA,CADNO,EAAkB,mBACNrL"}
|
package/es/subject/layout.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{css as t,LitElement as
|
|
1
|
+
import{css as t,LitElement as e,html as o}from"lit";import{property as s}from"lit/decorators.js";import{safeCustomElement as i}from"../base/define.mjs";var r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,d=(t,e,o,s)=>{for(var i,d=s>1?void 0:s?a(e,o):e,l=t.length-1;l>=0;l--)(i=t[l])&&(d=(s?i(e,o,d):i(d))||d);return s&&d&&r(e,o,d),d};let l=class extends e{constructor(){super(...arguments),this["show-edit"]=!1}render(){return this["show-edit"]?o`
|
|
2
2
|
<div class="layout">
|
|
3
3
|
<div class="edit">
|
|
4
4
|
<slot name="edit"></slot>
|
|
5
5
|
<slot></slot>
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
8
|
-
`:
|
|
8
|
+
`:o`
|
|
9
9
|
<div class="layout">
|
|
10
10
|
<div class="preview">
|
|
11
11
|
<slot name="preview"></slot>
|
|
@@ -17,5 +17,5 @@ import{css as t,LitElement as o,html as e}from"lit";import{property as s}from"li
|
|
|
17
17
|
.layout { }
|
|
18
18
|
.preview { padding: 12px 10px 10px; }
|
|
19
19
|
.edit { position: relative; padding: 12px 10px 10px; background-color: #fff; border-radius: 6px; }
|
|
20
|
-
`,d([s({type:Boolean,attribute:"show-edit"})],l.prototype,"
|
|
20
|
+
`,d([s({type:Boolean,attribute:"show-edit"})],l.prototype,"show-edit",2),l=d([i("qxs-subject-layout")],l);export{l as QxsSubjectLayout};
|
|
21
21
|
//# sourceMappingURL=layout.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.mjs","sources":["../../../../packages/components-wc/src/subject/layout.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\n@safeCustomElement('qxs-subject-layout')\nexport class QxsSubjectLayout extends LitElement {\n static styles = css`\n :host { display: block; width: 100%; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n .layout { }\n .preview { padding: 12px 10px 10px; }\n .edit { position: relative; padding: 12px 10px 10px; background-color: #fff; border-radius: 6px; }\n `\n\n @property({ type: Boolean, attribute: 'show-edit' })
|
|
1
|
+
{"version":3,"file":"layout.mjs","sources":["../../../../packages/components-wc/src/subject/layout.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\n\n@safeCustomElement('qxs-subject-layout')\nexport class QxsSubjectLayout extends LitElement {\n static styles = css`\n :host { display: block; width: 100%; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n .layout { }\n .preview { padding: 12px 10px 10px; }\n .edit { position: relative; padding: 12px 10px 10px; background-color: #fff; border-radius: 6px; }\n `\n\n @property({ type: Boolean, attribute: 'show-edit' }) 'show-edit' = false\n\n render() {\n if (this['show-edit']) {\n return html`\n <div class=\"layout\">\n <div class=\"edit\">\n <slot name=\"edit\"></slot>\n <slot></slot>\n </div>\n </div>\n `\n }\n return html`\n <div class=\"layout\">\n <div class=\"preview\">\n <slot name=\"preview\"></slot>\n <slot></slot>\n </div>\n </div>\n `\n }\n}\n\nexport function register() {}\n"],"names":["QxsSubjectLayout","LitElement","constructor","super","arguments","this","render","html","styles","css","__decorateClass","property","type","Boolean","attribute","prototype","safeCustomElement"],"mappings":"wVAKO,IAAMA,EAAN,cAA+BC,EAA/BC,WAAAA,GAAAC,SAAAC,WAQgDC,KAAA,cAAc,CAAA,CAEnEC,MAAAA,GACE,OAAID,KAAK,aACAE,CAAA;;;;;;;QASFA,CAAA;;;;;;;KAQT,GA7BWP,EACJQ,OAASC,CAAA;;;;;IAOqCC,EAAA,CAApDC,EAAS,CAAEC,KAAMC,QAASC,UAAW,eAR3Bd,EAQ0Ce,UAAA,YAAA,GAR1Cf,EAANU,EAAA,CADNM,EAAkB,uBACNhB"}
|
package/es/subject/list.mjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import{css as t,LitElement as e,html as s}from"lit";import{property as i,state as
|
|
1
|
+
import{css as t,LitElement as e,html as s}from"lit";import{property as i,state as a}from"lit/decorators.js";import r from"sortablejs";import{safeCustomElement as o}from"../base/define.mjs";import{uid as n}from"../base/uid.mjs";import{SubjectError as l}from"./single.mjs";import{SubjectType as h}from"./types.mjs";import"./action.mjs";import"./blank-fill.mjs";import"./layout.mjs";import"./text-fill.mjs";import"./scale.mjs";import"./page-end.mjs";import"./type.mjs";var d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p=(t,e,s,i)=>{for(var a,r=i>1?void 0:i?c(e,s):e,o=t.length-1;o>=0;o--)(a=t[o])&&(r=(i?a(e,s,r):a(r))||r);return i&&r&&d(e,s,r),r};let u=class extends e{constructor(){super(...arguments),this["is-preview"]=!1,this["use-model"]=null,this._modelValueAttr="",this["upload-image"]=async t=>new Promise((e,s)=>{const i=new FileReader;i.onload=t=>e(t.target?.result),i.onerror=s,i.readAsDataURL(t)}),this["category-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-ai"]=!1,this["show-resource"]=!1,this["show-jump"]=!1,this["show-add"]=!0,this["show-answer-setting"]=!1,this["show-key"]=!1,this["search-api"]="",this._list=[],this._sortMode=!1,this._sortable=null,this._initialDataProcessed=!1}get"model-value"(){return JSON.stringify(this._list)}set"model-value"(t){if(t&&t!==this._modelValueAttr){this._modelValueAttr=t;try{const e=JSON.parse(t);Array.isArray(e)&&(this._list=this._normalizeIncomingList(e),this.requestUpdate())}catch{}}}get _useModel(){return"true"===this["use-model"]||""===this["use-model"]||this.hasAttribute("use-model")}get"subject-list"(){return this._list}set"subject-list"(t){if(t){if("string"==typeof t)try{t=JSON.parse(t)}catch{return this._list=[],void this.requestUpdate()}if(!Array.isArray(t))return this._list=[],void this.requestUpdate();this._list=this._normalizeIncomingList(t),this.requestUpdate()}else this._list=[]}attributeChangedCallback(t,e,s){if(super.attributeChangedCallback(t,e,s),"subject-list"===t&&s&&!this._list.length){if(s.includes("[object Object]"))return;try{const t=JSON.parse(s);Array.isArray(t)&&(this._list=this._normalizeIncomingList(t),this.requestUpdate())}catch{}}}get _isPreviewValue(){const t=this["is-preview"];return"string"==typeof t?"false"!==t:!!t}connectedCallback(){super.connectedCallback(),this._initialDataProcessed||(this._initialDataProcessed=!0,Promise.resolve().then(()=>{0===this._list.length&&this._processAttributeList()}))}_processAttributeList(){const t=this.getAttribute("subject-list");if(t&&"[]"!==t&&!t.includes("[object Object]"))try{const e=JSON.parse(t);Array.isArray(e)&&e.length>0&&(this._list=this._normalizeIncomingList(e),this.requestUpdate())}catch{}}_normalizeAnswer(t){return{...t,title:String(t?.title??t?.answer??""),answerId:t?.answerId??t?.examAnswerId}}_normalizeItem(t){const e=t?.answerType||(t?.richTextContent?t?.answerType:t?.examTypeEnum),s=Array.isArray(t?.answers)?t.answers.map(t=>this._normalizeAnswer(t)):[];return{...t,customId:t?.customId||n(),...e?{answerType:e}:{},...s.length||Array.isArray(t?.answers)?{answers:s}:{}}}_rebuildPageEndMarkers(t){if(!t.length)return t;if(t.some(t=>"page_end"===t?.answerType))return t;if(!t.some(t=>Number(t?.pageIndex)>1))return t;let e=1;const s=[];return t.forEach(t=>{const i=Number(t?.pageIndex)||1;if(i>e)if(s.length>0)for(;e<i;)s.push({customId:n(),answerType:"page_end"}),e++;else e=i;s.push(t)}),s}_normalizeIncomingList(t){const e=t.map(t=>this._normalizeItem(t));return this._rebuildPageEndMarkers(e)}firstUpdated(){this.updateComplete.then(()=>this._initSortable())}updated(t){t.has("_sortMode")&&(this._sortable?.destroy(),this._sortable=null,this.updateComplete.then(()=>this._initSortable())),t.has("_list")&&this._sortMode&&setTimeout(()=>{this._sortable&&(this._sortable.destroy(),this._sortable=null),this._initSortable()},50)}disconnectedCallback(){super.disconnectedCallback(),this._sortable?.destroy(),this._sortable=null}_initSortable(){if(!this._sortMode)return;this.renderRoot.querySelector(".sort-list")&&(this._sortable&&(this._sortable.destroy(),this._sortable=null),requestAnimationFrame(()=>{const t=this.renderRoot.querySelector(".sort-list");t&&!this._sortable&&(this._sortable=r.create(t,{handle:".sort-handle",animation:200,ghostClass:"sort-ghost",chosenClass:"sort-chosen",onEnd:t=>{const{oldIndex:e,newIndex:s}=t;if(void 0===e||void 0===s||e===s)return;const i=[...this._list],[a]=i.splice(e,1);i.splice(s,0,a),this._list=i,this._emitListChange()}}))}))}_emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??null}))}_emitListChange(){this._emit("change",this._list),this._useModel&&(this._modelValueAttr=JSON.stringify(this._list),this._emit("list-change",this._list))}_withPageIndex(t){const e=[];let s=1,i=!1;return t.forEach(t=>{t&&("page_end"!==t.answerType?(i&&(s+=1,i=!1),e.push({...t,pageIndex:s})):e.length>0&&(i=!0))}),e}async toJSON(){const t=this.renderRoot.querySelectorAll("qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-page-end, qxs-subject-rich-text");if(!t||0===t.length)return[];const e=[],s=[];for(const i of t)if("function"==typeof i.toJSON)try{const t=await i.toJSON();e.push(t)}catch(t){t instanceof l?s.push(t):s.push(new l(t.message||"未知错误","UNKNOWN","unknown"))}if(s.length>0)throw s;return this._withPageIndex(e)}async validate(){const t=this.renderRoot.querySelectorAll("qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-page-end");if(!t||0===t.length)return{valid:!0,errors:[]};const e=[];for(const s of t)if("function"==typeof s.validate){const t=s.validate();t?.length&&e.push(...t)}return{valid:0===e.length,errors:e}}get currentList(){return this._list}addSubject(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("page_end"===t){const t={customId:n(),answerType:"page_end"},s=[...this._list];return"number"==typeof e&&e>=0?s.splice(e+1,0,t):s.push(t),this._list=s,this.requestUpdate(),void this._emitListChange()}const i={customId:n(),answerType:t,title:"",answers:[],analysis:"",scaleQuestionList:[],isEdit:!0,isSave:!1,isRealCanDel:!0,hasSet:!1,isKey:!1,answerCheckType:1,examAnswerRelationType:s??0},a=[...this._list];"number"==typeof e&&e>=0?a.splice(e+1,0,i):a.push(i),this._list=a,this.requestUpdate(),this._emitListChange()}addExam(t){const e=this._normalizeIncomingList(t).map(t=>({...t,isEdit:!0,isSave:!1,isRealCanDel:!0,hasSet:!1}));this._list=[...this._list,...e],this._emitListChange()}uploadExcel(t){this._list=[...this._list,...this._normalizeIncomingList(t).map(t=>({...t,isRealCanDel:!0}))],this._emitListChange()}setAnswerRelation(t,e,s){const i=this._list.find(t=>t.customId===e);if(i){const e=i.answers?.find(t=>t.customAnswerId===s);e&&(e.answerRelations=t)}this.requestUpdate(),this._emitListChange()}setTagList(t,e){const s=this._list.find(t=>t.customId===e);if(s)return s.tagInfos=Array.isArray(t)?t:[],s.memberTagInfo=Array.isArray(t)?t:[],this._list=[...this._list],void this._emitListChange();this.requestUpdate()}_orderIndex(t){let e=0,s=0;return this._list.forEach(i=>{e++,i.customId===t&&(s=e)}),s-1}_move(t,e){const s=[...this._list];"up"===e&&t>0?[s[t-1],s[t]]=[s[t],s[t-1]]:"down"===e&&t<s.length-1&&([s[t],s[t+1]]=[s[t+1],s[t]]),this._list=s,this._emitListChange()}_save(t,e){this._list=this._list.map((s,i)=>i===t?{...s,...e.detail,isEdit:!1,isSave:!0}:s),this._emitListChange()}_deleteByCustomId(t){this._list=this._list.filter(e=>e.customId!==t),this._emitListChange()}_delete(t){const e=[...this._list];e.splice(t,1),this._list=e,this._emitListChange()}_setEdit(t,e){this._list=this._list.map((s,i)=>i===t?{...s,isEdit:e}:s)}_pageEndTotal(){return this._list.filter(t=>"page_end"===t.answerType).length+1}_pageEndIndex(t){return this._list.slice(0,t+1).filter(t=>"page_end"===t.answerType).length}_syncRelationAnswer(t,e){const s=this._list[t];if(!s||!Array.isArray(s.answers)||!e?.answer)return;const i=[...s.answers],a=e.answer;let r="number"==typeof e.answerIndex?e.answerIndex:-1;(r<0||r>=i.length)&&(r=i.findIndex((t,e)=>String(t.customAnswerId||"")===String(a.customAnswerId||"")||String(t.answerId||"")===String(a.answerId||"")||String(t.orderIndex||e+1)===String(a.orderIndex||""))),r<0||(i[r]={...i[r],customAnswerId:a.customAnswerId||i[r].customAnswerId||a.answerId},this._list[t]={...s,answers:i},this._list=[...this._list])}_renderItem(t,e){const i=this._orderIndex(t.customId),a=(t.isEdit,t.hasSet,t.isRealCanDel,this._isPreviewValue,t.examAnswerRelationType,t=>this._move(e,t.detail)),r=()=>this._deleteByCustomId(t.customId),o=t=>this._save(e,t),n=()=>this._setEdit(e,!0),l=t=>this.addSubject(t.detail?.type??t.detail,e);return[h.SINGLE,h.MULTIPLE,h.SORT].includes(t.answerType)?s`<qxs-subject-single
|
|
2
2
|
.title=${t.title||""}
|
|
3
|
-
.
|
|
4
|
-
.
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
8
|
-
.
|
|
3
|
+
.answer-list=${t.answers||[]}
|
|
4
|
+
.tag-list=${t.tagInfos||t.memberTagInfo||[]}
|
|
5
|
+
.category-list=${this["category-list"]}
|
|
6
|
+
.resource-list=${t.examResourceBOList||t.resourceList||[]}
|
|
7
|
+
.search-handler=${this["search-handler"]}
|
|
8
|
+
.upload-image=${this["upload-image"]}
|
|
9
9
|
order-index=${i}
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
.
|
|
13
|
-
.
|
|
14
|
-
.
|
|
15
|
-
.
|
|
16
|
-
.
|
|
17
|
-
.
|
|
18
|
-
.
|
|
19
|
-
.
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
.
|
|
10
|
+
.is-edit=${!!t.isEdit}
|
|
11
|
+
.is-set=${!!t.hasSet}
|
|
12
|
+
.is-save=${!t.isRealCanDel}
|
|
13
|
+
.show-action=${!this._isPreviewValue}
|
|
14
|
+
.show-add=${this["show-add"]}
|
|
15
|
+
.show-answer-setting=${this["show-answer-setting"]}
|
|
16
|
+
.show-key=${this["show-key"]}
|
|
17
|
+
.show-tag=${this["show-tag"]}
|
|
18
|
+
.show-category=${this["show-category"]}
|
|
19
|
+
.show-ai=${this["show-ai"]}
|
|
20
|
+
.show-resource=${this["show-resource"]}
|
|
21
|
+
.show-jump=${this["show-jump"]}
|
|
22
|
+
.is-key=${!!t.isKey}
|
|
23
23
|
question-type=${String(t.answerType)}
|
|
24
24
|
answer-check-type=${t.answerCheckType??1}
|
|
25
25
|
exam-answer-relation-type=${t.examAnswerRelationType??0}
|
|
26
26
|
rich-text-content=${t.examRichTextContent||""}
|
|
27
27
|
analysis=${t.analysis||""}
|
|
28
|
-
.
|
|
28
|
+
.least-answer-count=${Number(t.leastAnswerCount)||0}
|
|
29
29
|
exam-expand=${t.examExpand||""}
|
|
30
30
|
category-id=${t.categoryId||t.category?.categoryId||""}
|
|
31
31
|
ai-answer=${t.aiAnswer||""}
|
|
32
|
-
search-api=${this
|
|
32
|
+
search-api=${this["search-api"]}
|
|
33
33
|
custom-id=${t.customId||""}
|
|
34
34
|
exam-id=${t.examId??0}
|
|
35
|
-
@move=${
|
|
35
|
+
@move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
|
|
36
36
|
@set-key=${t=>{this._list[e].isKey=t.detail.value,this.requestUpdate()}}
|
|
37
37
|
@title-select=${t=>this._emit("title-select",t.detail)}
|
|
38
38
|
@choose-tag=${t=>this._emit("choose-tag",{...t.detail,item:this._list[e]})}
|
|
@@ -42,51 +42,85 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
42
42
|
@set-relation=${t=>{this._syncRelationAnswer(e,t.detail),this._emit("set-relation",{...t.detail,item:this._list[e]})}}
|
|
43
43
|
></qxs-subject-single>`:t.answerType===h.BLANK_FILL?s`<qxs-blank-fill
|
|
44
44
|
.title=${t.title||""}
|
|
45
|
-
.
|
|
46
|
-
.
|
|
47
|
-
.
|
|
45
|
+
.answer-list=${t.answers||[]}
|
|
46
|
+
.tag-list=${t.tagInfos||t.memberTagInfo||[]}
|
|
47
|
+
.category-list=${this["category-list"]}
|
|
48
|
+
.resource-list=${t.examResourceBOList||t.resourceList||[]}
|
|
49
|
+
.exam-answer-setting=${t.examAnswerSettingBO||t.examAnswerSettingVO||{}}
|
|
50
|
+
.upload-image=${this["upload-image"]}
|
|
48
51
|
order-index=${i}
|
|
49
|
-
.
|
|
50
|
-
.
|
|
52
|
+
.is-edit=${!!t.isEdit} .is-set=${!!t.hasSet} .is-save=${!t.isRealCanDel} .show-action=${!this._isPreviewValue} .show-add=${this["show-add"]}
|
|
53
|
+
.show-answer-setting=${this["show-answer-setting"]}
|
|
54
|
+
.show-tag=${this["show-tag"]}
|
|
55
|
+
.show-category=${this["show-category"]}
|
|
56
|
+
.show-resource=${this["show-resource"]}
|
|
51
57
|
exam-answer-relation-type=${t.examAnswerRelationType??0}
|
|
52
58
|
exam-expand=${t.examExpand||""}
|
|
53
59
|
rich-text-content=${t.examRichTextContent||""}
|
|
54
60
|
analysis=${t.analysis||""}
|
|
61
|
+
category-id=${t.categoryId||t.category?.categoryId||""}
|
|
55
62
|
custom-id=${t.customId||""}
|
|
56
|
-
|
|
63
|
+
exam-id=${t.examId??0}
|
|
64
|
+
@move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
|
|
65
|
+
@choose-tag=${t=>this._emit("choose-tag",{...t.detail,item:this._list[e]})}
|
|
66
|
+
@tag-change=${t=>{this._list[e].tagInfos=t.detail.value,this._list[e].memberTagInfo=t.detail.value,this.requestUpdate()}}
|
|
67
|
+
@category-change=${t=>{this._list[e].categoryId=t.detail.value,this.requestUpdate()}}
|
|
57
68
|
></qxs-blank-fill>`:t.answerType===h.TEXT_FILL?s`<qxs-text-fill
|
|
58
69
|
.title=${t.title||""}
|
|
59
|
-
.
|
|
60
|
-
.
|
|
61
|
-
.
|
|
70
|
+
.answer-list=${t.answers||[]}
|
|
71
|
+
.tag-list=${t.tagInfos||t.memberTagInfo||[]}
|
|
72
|
+
.category-list=${this["category-list"]}
|
|
73
|
+
.resource-list=${t.examResourceBOList||t.resourceList||[]}
|
|
74
|
+
.search-handler=${this["search-handler"]}
|
|
75
|
+
.exam-answer-setting=${t.examAnswerSettingBO||t.examAnswerSettingVO||{}}
|
|
76
|
+
.upload-image=${this["upload-image"]}
|
|
62
77
|
order-index=${i}
|
|
63
|
-
.
|
|
64
|
-
.
|
|
78
|
+
.is-edit=${!!t.isEdit} .is-set=${!!t.hasSet} .is-save=${!t.isRealCanDel} .show-action=${!this._isPreviewValue} .show-add=${this["show-add"]}
|
|
79
|
+
.show-answer-setting=${this["show-answer-setting"]}
|
|
80
|
+
.show-tag=${this["show-tag"]}
|
|
81
|
+
.show-category=${this["show-category"]}
|
|
82
|
+
.show-resource=${this["show-resource"]}
|
|
65
83
|
exam-answer-relation-type=${t.examAnswerRelationType??0}
|
|
66
84
|
exam-expand=${t.examExpand||""}
|
|
67
85
|
rich-text-content=${t.examRichTextContent||""}
|
|
68
86
|
analysis=${t.analysis||""}
|
|
87
|
+
category-id=${t.categoryId||t.category?.categoryId||""}
|
|
69
88
|
custom-id=${t.customId||""}
|
|
70
|
-
|
|
89
|
+
exam-id=${t.examId??0}
|
|
90
|
+
@move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
|
|
91
|
+
@choose-tag=${t=>this._emit("choose-tag",{...t.detail,item:this._list[e]})}
|
|
92
|
+
@tag-change=${t=>{this._list[e].tagInfos=t.detail.value,this._list[e].memberTagInfo=t.detail.value,this.requestUpdate()}}
|
|
93
|
+
@category-change=${t=>{this._list[e].categoryId=t.detail.value,this.requestUpdate()}}
|
|
71
94
|
></qxs-text-fill>`:t.answerType===h.SCALE?s`<qxs-scale
|
|
72
95
|
.title=${t.title||""}
|
|
73
|
-
.
|
|
74
|
-
.
|
|
75
|
-
.
|
|
96
|
+
.answer-list=${t.answers||[]}
|
|
97
|
+
.scale-questions=${t.scaleQuestionList||[]}
|
|
98
|
+
.tag-list=${t.tagInfos||t.memberTagInfo||[]}
|
|
99
|
+
.category-list=${this["category-list"]}
|
|
100
|
+
.resource-list=${t.examResourceBOList||t.resourceList||[]}
|
|
101
|
+
.upload-image=${this["upload-image"]}
|
|
76
102
|
order-index=${i}
|
|
77
|
-
.
|
|
103
|
+
.is-edit=${!!t.isEdit} .is-set=${!!t.hasSet} .is-save=${!t.isRealCanDel} .show-action=${!this._isPreviewValue} .show-add=${this["show-add"]}
|
|
104
|
+
.show-tag=${this["show-tag"]}
|
|
105
|
+
.show-category=${this["show-category"]}
|
|
106
|
+
.show-resource=${this["show-resource"]}
|
|
78
107
|
exam-answer-relation-type=${t.examAnswerRelationType??0}
|
|
79
108
|
rich-text-content=${t.examRichTextContent||""}
|
|
80
109
|
analysis=${t.analysis||""}
|
|
110
|
+
category-id=${t.categoryId||t.category?.categoryId||""}
|
|
81
111
|
custom-id=${t.customId||""}
|
|
82
|
-
|
|
112
|
+
exam-id=${t.examId??0}
|
|
113
|
+
@move=${a} @delete=${r} @save=${o} @edit=${n} @add=${l}
|
|
114
|
+
@choose-tag=${t=>this._emit("choose-tag",{...t.detail,item:this._list[e]})}
|
|
115
|
+
@tag-change=${t=>{this._list[e].tagInfos=t.detail.value,this._list[e].memberTagInfo=t.detail.value,this.requestUpdate()}}
|
|
116
|
+
@category-change=${t=>{this._list[e].categoryId=t.detail.value,this.requestUpdate()}}
|
|
83
117
|
></qxs-scale>`:"page_end"===t.answerType?s`<qxs-page-end
|
|
84
|
-
current-page-index=${t.currentPageIndex||this._pageEndIndex(e)}
|
|
85
|
-
total-page=${t.totalPage||this._pageEndTotal()}
|
|
86
|
-
.
|
|
87
|
-
.
|
|
118
|
+
.current-page-index=${t.currentPageIndex||this._pageEndIndex(e)}
|
|
119
|
+
.total-page=${t.totalPage||this._pageEndTotal()}
|
|
120
|
+
.show-action=${!this._isPreviewValue}
|
|
121
|
+
.show-add=${this["show-add"]}
|
|
88
122
|
custom-id=${t.customId||""}
|
|
89
|
-
@delete=${
|
|
123
|
+
@delete=${r}
|
|
90
124
|
@add=${l}
|
|
91
125
|
></qxs-page-end>`:s`<div style="color:#909399;padding:8px">未知题型: ${t.answerType}</div>`}render(){return s`
|
|
92
126
|
<div class="subject-list">
|
|
@@ -114,5 +148,5 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
114
148
|
.sort-index { font-size: 13px; color: #606266; font-weight: 500; margin-right: 8px; min-width: 24px; flex-shrink: 0; }
|
|
115
149
|
.sort-title { flex: 1; font-size: 14px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
116
150
|
.sort-type { font-size: 12px; color: #909399; margin-left: 12px; padding: 2px 8px; background: #f0f0f0; border-radius: 4px; flex-shrink: 0; }
|
|
117
|
-
`,p([i({attribute:"is-preview"})],u.prototype,"
|
|
151
|
+
`,p([i({attribute:"is-preview"})],u.prototype,"is-preview",2),p([i({attribute:"use-model"})],u.prototype,"use-model",2),p([i({attribute:"model-value"})],u.prototype,"model-value",1),p([i({type:Object,attribute:"upload-image"})],u.prototype,"upload-image",2),p([i({type:Array,attribute:"category-list"})],u.prototype,"category-list",2),p([i({type:Boolean,attribute:"show-tag"})],u.prototype,"show-tag",2),p([i({type:Boolean,attribute:"show-category"})],u.prototype,"show-category",2),p([i({type:Boolean,attribute:"show-ai"})],u.prototype,"show-ai",2),p([i({type:Boolean,attribute:"show-resource"})],u.prototype,"show-resource",2),p([i({type:Boolean,attribute:"show-jump"})],u.prototype,"show-jump",2),p([i({type:Boolean,attribute:"show-add"})],u.prototype,"show-add",2),p([i({type:Boolean,attribute:"show-answer-setting"})],u.prototype,"show-answer-setting",2),p([i({type:Boolean,attribute:"show-key"})],u.prototype,"show-key",2),p([i({type:String,attribute:"search-api"})],u.prototype,"search-api",2),p([i({type:Object,attribute:"search-handler"})],u.prototype,"search-handler",2),p([i({type:Array,attribute:"subject-list"})],u.prototype,"subject-list",1),p([a()],u.prototype,"_list",2),p([a()],u.prototype,"_sortMode",2),u=p([o("qxs-subject-list")],u);export{u as QxsSubjectList};
|
|
118
152
|
//# sourceMappingURL=list.mjs.map
|