@qxs-bns/components-wc 0.0.16 → 0.0.18
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 +4 -58
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/subject/list.mjs.map +1 -1
- package/es/subject/single.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +3 -57
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/subject/list.cjs.map +1 -1
- package/lib/subject/single.cjs.map +1 -1
- package/package.json +1 -1
package/es/subject/list.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.mjs","sources":["../../../../packages/components-wc/src/subject/list.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport Sortable from 'sortablejs'\nimport { safeCustomElement } from '../base/define'\nimport { uid } from '../base/uid'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\n// 导入子组件以确保它们被注册为 Custom Elements\nimport './action'\nimport './blank-fill'\nimport './layout'\nimport './single'\nimport './text-fill'\nimport './scale'\nimport './page-end'\nimport './type'\n\nconst TYPE_LABEL: Record<string, string> = {\n [SubjectType.SINGLE]: '单选题', [SubjectType.MULTIPLE]: '多选题', [SubjectType.SORT]: '排序题',\n [SubjectType.BLANK_FILL]: '填空题', [SubjectType.TEXT_FILL]: '问答题', [SubjectType.SCALE]: '量表题',\n}\n\n@safeCustomElement('qxs-subject-list')\nexport class QxsSubjectList extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 13px; }\n *, ::before, ::after { box-sizing: border-box; }\n .sort-mode-toggle { display: flex; justify-content: flex-end; margin-bottom: 12px; }\n .btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; font-size: 12px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266; cursor: pointer; transition: all 0.2s; }\n .btn:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .btn.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .btn.primary:hover { background: #3D61E3; border-color: #3D61E3; }\n .subject-list { display: flex; flex-direction: column; }\n .subject-content { flex: 1; min-width: 0; }\n .ghost { opacity: 0.5; background: #ecf5ff; }\n .chosen { box-shadow: 0 4px 16px rgba(64,158,255,.3); }\n .sort-list { display: flex; flex-direction: column; gap: 8px; }\n .sort-item { display: flex; align-items: center; padding: 12px 16px; background: #f8f9fa; border: 1px solid #e4e7ed; border-radius: 6px; cursor: grab; transition: all 0.3s ease; }\n .sort-item:hover { background: #ecf5ff; border-color: #c6e2ff; }\n .sort-item:active { cursor: grabbing; }\n .sort-item.sort-ghost { opacity: 0.5; background: #ecf5ff; border: 2px dashed #409eff; }\n .sort-item.sort-chosen { background: #ecf5ff; border-color: #409eff; box-shadow: 0 4px 16px rgba(64,158,255,.3); transform: scale(1.02); }\n .sort-handle { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 12px; color: #909399; flex-shrink: 0; }\n .sort-index { font-size: 13px; color: #606266; font-weight: 500; margin-right: 8px; min-width: 24px; flex-shrink: 0; }\n .sort-title { flex: 1; font-size: 14px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .sort-type { font-size: 12px; color: #909399; margin-left: 12px; padding: 2px 8px; background: #f0f0f0; border-radius: 4px; flex-shrink: 0; }\n `\n\n\n\n @property({ attribute: 'is-preview' }) isPreview = false\n\n // use-model: enables two-way binding via model-value attribute + list-change event\n @property({ attribute: 'use-model' }) useModelAttr: string | null = null\n @property({ attribute: 'model-value' })\n get modelValue(): string { return JSON.stringify(this._list) }\n set modelValue(v: string) {\n if (!v || v === this._modelValueAttr) { return }\n this._modelValueAttr = v\n try {\n const parsed = JSON.parse(v)\n if (Array.isArray(parsed)) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch { /* invalid JSON, ignore */ }\n }\n\n private get _useModel(): boolean {\n return this.useModelAttr === 'true' || this.useModelAttr === '' || this.hasAttribute('use-model')\n }\n\n private _modelValueAttr = ''\n\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 })\n get subjectList() { return this._list }\n\n set subjectList(v: any) {\n if (!v) {\n this._list = []\n return\n }\n if (typeof v === 'string') {\n try {\n v = JSON.parse(v)\n }\n catch {\n this._list = []\n this.requestUpdate()\n return\n }\n }\n if (!Array.isArray(v)) {\n this._list = []\n this.requestUpdate()\n return\n }\n this._list = v.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n\n attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null) {\n super.attributeChangedCallback(name, oldVal, newVal)\n if (name === 'subject-list' && newVal && !this._list.length) {\n if (newVal.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(newVal)\n if (Array.isArray(parsed)) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n }\n\n @state() private _list: any[] = []\n @state() private _sortMode = false\n private _sortable: Sortable | null = null\n\n private get _isPreviewValue(): boolean {\n const val = (this as any).isPreview\n return typeof val === 'string' ? val !== 'false' : !!val\n }\n\n private _initialDataProcessed = false\n\n connectedCallback() {\n super.connectedCallback()\n if (!this._initialDataProcessed) {\n this._initialDataProcessed = true\n Promise.resolve().then(() => {\n if (this._list.length === 0) {\n this._processAttributeList()\n }\n })\n }\n }\n\n private _processAttributeList() {\n const attr = this.getAttribute('subject-list')\n if (!attr || attr === '[]') { return }\n if (attr.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(attr)\n if (Array.isArray(parsed) && parsed.length > 0) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n\n firstUpdated() {\n this.updateComplete.then(() => this._initSortable())\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('_sortMode')) {\n this._sortable?.destroy()\n this._sortable = null\n this.updateComplete.then(() => this._initSortable())\n }\n // Reinitialize Sortable when list changes in sort mode\n if (changed.has('_list') && this._sortMode) {\n // Small delay to let Lit finish DOM updates\n setTimeout(() => {\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n this._initSortable()\n }, 50)\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._sortable?.destroy()\n this._sortable = null\n }\n\n private _initSortable() {\n if (!this._sortMode) { return }\n const el = this.querySelector<HTMLElement>('.sort-list')\n if (!el) { return }\n\n // Destroy existing instance first\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n\n // Small delay to ensure DOM is ready after previous destroy\n requestAnimationFrame(() => {\n const currentEl = this.querySelector<HTMLElement>('.sort-list')\n if (!currentEl || this._sortable) { return }\n\n this._sortable = Sortable.create(currentEl, {\n handle: '.sort-handle',\n animation: 200,\n ghostClass: 'sort-ghost',\n chosenClass: 'sort-chosen',\n onEnd: (evt) => {\n const { oldIndex, newIndex } = evt\n if (oldIndex === undefined || newIndex === undefined || oldIndex === newIndex) { return }\n const arr = [...this._list]\n const [item] = arr.splice(oldIndex, 1)\n arr.splice(newIndex, 0, item)\n this._list = arr\n this._emitListChange()\n },\n })\n })\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 _emitListChange() {\n this._emit('change', this._list)\n if (this._useModel) {\n this._modelValueAttr = JSON.stringify(this._list)\n this._emit('list-change', this._list)\n }\n }\n\n async toJSON(): Promise<any[]> {\n const subjectEls = this.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-subject-rich-text',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return []\n }\n\n const results: any[] = []\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.toJSON === 'function') {\n try {\n const data = await el.toJSON()\n results.push(data)\n }\n catch (err: any) {\n if (err instanceof SubjectError) {\n errors.push(err)\n }\n else {\n errors.push(new SubjectError(err.message || '未知错误', 'UNKNOWN', 'unknown'))\n }\n }\n }\n }\n\n if (errors.length > 0) {\n throw errors\n }\n\n return results\n }\n\n async validate(): Promise<{ valid: boolean, errors: SubjectError[] }> {\n const subjectEls = this.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return { valid: true, errors: [] }\n }\n\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.validate === 'function') {\n const errs = el.validate()\n if (errs?.length) {\n errors.push(...errs)\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n }\n\n // ── public API ────────────────────────────────────────────────\n get currentList() { return this._list }\n\n addSubject(type: string, index?: number, examAnswerRelationType: number | null = null) {\n const item = {\n customId: uid(), answerType: type, title: '',\n answers: [], analysis: '', scaleQuestionList: [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n isKey: false, answerCheckType: 1,\n examAnswerRelationType: examAnswerRelationType ?? 0,\n }\n const arr = [...this._list]\n if (typeof index === 'number' && index >= 0) {\n arr.splice(index + 1, 0, item)\n }\n else { arr.push(item) }\n this._list = arr\n this.requestUpdate()\n this._emitListChange()\n }\n\n addExam(items: any[]) {\n const newItems: any[] = []\n items.forEach((v: any) => {\n const item: any = {\n ...v,\n customId: v.customId || uid(),\n answers: v.answers?.map((c: any) => ({ ...c, title: c.answer, answerId: c.examAnswerId, isCorrect: c.isCorrect })) || [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n }\n if (!v.richTextContent) {\n item.answerType = v.examTypeEnum\n }\n newItems.push(item)\n })\n this._list = [...this._list, ...newItems]\n this._emitListChange()\n }\n\n uploadExcel(list: any[]) {\n this._list = [...this._list, ...list.map((i: any) => ({ ...i, customId: i.customId || uid(), isRealCanDel: true }))]\n this._emitListChange()\n }\n\n setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const item = this._list.find((v: any) => v.customId === customId)\n if (item) {\n const ans = item.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (ans) { ans.answerRelations = answerRelations }\n }\n this.requestUpdate()\n this._emitListChange()\n }\n\n // ── private helpers ───────────────────────────────────────────\n private _orderIndex(customId: string) {\n let n = 0; let out = 0\n this._list.forEach((v: any) => {\n n++; if (v.customId === customId) { out = n }\n })\n return out - 1\n }\n\n private _move(index: number, dir: 'up' | 'down') {\n const arr = [...this._list]\n if (dir === 'up' && index > 0) { [arr[index - 1], arr[index]] = [arr[index], arr[index - 1]] }\n else if (dir === 'down' && index < arr.length - 1) { [arr[index], arr[index + 1]] = [arr[index + 1], arr[index]] }\n this._list = arr\n this._emitListChange()\n }\n\n private _save(index: number, e: CustomEvent) {\n console.log('_save receive detail:', JSON.stringify(e.detail))\n this._list = this._list.map((item, i) =>\n i === index ? { ...item, ...e.detail, isEdit: false, isSave: true } : item,\n )\n console.log('_save after merge:', JSON.stringify(this._list[index]))\n this._emitListChange()\n }\n\n private _deleteByCustomId(customId: string) {\n this._list = this._list.filter(item => item.customId !== customId)\n this._emitListChange()\n }\n\n private _delete(index: number) {\n const arr = [...this._list]\n arr.splice(index, 1)\n this._list = arr\n this._emitListChange()\n }\n\n private _setEdit(index: number, val: boolean) {\n this._list = this._list.map((item, i) => i === index ? { ...item, isEdit: val } : item)\n }\n\n private _renderItem(item: any, index: number) {\n const common = {\n 'order-index': this._orderIndex(item.customId),\n '?is-edit': item.isEdit || false,\n '?is-set': item.hasSet || false,\n '?is-save': !item.isRealCanDel,\n '?show-action': !this._isPreviewValue,\n 'exam-answer-relation-type': item.examAnswerRelationType ?? 0,\n }\n const onMove = (e: CustomEvent) => this._move(index, e.detail as 'up' | 'down')\n const onDelete = () => this._deleteByCustomId(item.customId)\n const onSave = (e: CustomEvent) => this._save(index, e)\n const onEdit = () => this._setEdit(index, true)\n const onAdd = (e: CustomEvent) => this.addSubject(e.detail?.type ?? e.detail, index)\n\n if ([SubjectType.SINGLE, SubjectType.MULTIPLE, SubjectType.SORT].includes(item.answerType)) {\n return html`<qxs-subject-single\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit}\n ?is-set=${item.hasSet}\n ?is-save=${!item.isRealCanDel}\n ?show-action=${!this._isPreviewValue}\n ?is-key=${item.isKey}\n question-type=${String(item.answerType)}\n answer-check-type=${item.answerCheckType ?? 1}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n least-answer-count=${item.leastAnswerCount ?? 2}\n exam-expand=${item.examExpand || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @set-key=${(e: CustomEvent) => {\n this._list = this._list.map((item, i) =>\n i === index ? { ...item, isKey: e.detail.value } : item\n )\n this._emitListChange()\n }}\n @set-relation=${(e: CustomEvent) => this._emit('set-relation', e.detail)}\n ></qxs-subject-single>`\n }\n if (item.answerType === SubjectType.BLANK_FILL) {\n return html`<qxs-blank-fill\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .examAnswerSetting=${item.examAnswerSettingVO || {}}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-blank-fill>`\n }\n if (item.answerType === SubjectType.TEXT_FILL) {\n return html`<qxs-text-fill\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .examAnswerSetting=${item.examAnswerSettingVO || {}}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-text-fill>`\n }\n if (item.answerType === SubjectType.SCALE) {\n return html`<qxs-scale\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .scaleQuestions=${item.scaleQuestionList || []}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-scale>`\n }\n return html`<div style=\"color:#909399;padding:8px\">未知题型: ${item.answerType}</div>`\n }\n\n render() {\n return html`\n <div class=\"subject-list\">\n ${this._list.map((item, index) => this._renderItem(item, index))}\n </div>\n `\n }\n}\n\nexport function register() {}\n"],"names":["SubjectType","SINGLE","MULTIPLE","SORT","BLANK_FILL","TEXT_FILL","SCALE","QxsSubjectList","LitElement","constructor","super","arguments","this","isPreview","useModelAttr","_modelValueAttr","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_list","_sortMode","_sortable","_initialDataProcessed","modelValue","JSON","stringify","v","parsed","parse","Array","isArray","map","i","customId","uid","requestUpdate","_useModel","hasAttribute","subjectList","attributeChangedCallback","name","oldVal","newVal","length","includes","_isPreviewValue","val","connectedCallback","then","_processAttributeList","attr","getAttribute","firstUpdated","updateComplete","_initSortable","updated","changed","has","destroy","setTimeout","disconnectedCallback","querySelector","requestAnimationFrame","currentEl","Sortable","create","handle","animation","ghostClass","chosenClass","onEnd","evt","oldIndex","newIndex","arr","item","splice","_emitListChange","_emit","detail","dispatchEvent","CustomEvent","bubbles","composed","toJSON","subjectEls","querySelectorAll","results","errors","el","data","push","err","SubjectError","message","validate","valid","errs","currentList","addSubject","type","index","examAnswerRelationType","undefined","answerType","title","answers","analysis","scaleQuestionList","isEdit","isSave","isRealCanDel","hasSet","isKey","answerCheckType","addExam","items","newItems","forEach","c","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","uploadExcel","list","setAnswerRelation","answerRelations","customAnswerId","find","ans","_orderIndex","n","out","_move","dir","_save","_deleteByCustomId","filter","_delete","_setEdit","_renderItem","common","onMove","onDelete","onSave","onEdit","onAdd","html","String","examRichTextContent","leastAnswerCount","examExpand","examId","value","examAnswerSettingVO","render","styles","css","__decorateClass","property","attribute","prototype","Object","state","safeCustomElement"],"mappings":"o2BAoBGA,EAAYC,OAAiBD,EAAYE,SAAmBF,EAAYG,KACxEH,EAAYI,WAAqBJ,EAAYK,UAAoBL,EAAYM,MAIzE,IAAMC,EAAN,cAA6BC,EAA7BC,WAAAA,GAAAC,SAAAC,WA2BkCC,KAAAC,WAAY,EAGbD,KAAAE,aAA8B,KAoBpEF,KAAQG,gBAAkB,GAG1BH,KAAAI,YAA+CC,SACtC,IAAIC,QAAQ,CAACC,EAASC,K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/subject/list.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport Sortable from 'sortablejs'\nimport { safeCustomElement } from '../base/define'\nimport { uid } from '../base/uid'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\n// 导入子组件以确保它们被注册为 Custom Elements\nimport './action'\nimport './blank-fill'\nimport './layout'\nimport './text-fill'\nimport './scale'\nimport './page-end'\nimport './type'\n\nconst TYPE_LABEL: Record<string, string> = {\n [SubjectType.SINGLE]: '单选题', [SubjectType.MULTIPLE]: '多选题', [SubjectType.SORT]: '排序题',\n [SubjectType.BLANK_FILL]: '填空题', [SubjectType.TEXT_FILL]: '问答题', [SubjectType.SCALE]: '量表题',\n}\n\n@safeCustomElement('qxs-subject-list')\nexport class QxsSubjectList extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 13px; }\n *, ::before, ::after { box-sizing: border-box; }\n .sort-mode-toggle { display: flex; justify-content: flex-end; margin-bottom: 12px; }\n .btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; font-size: 12px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266; cursor: pointer; transition: all 0.2s; }\n .btn:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .btn.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .btn.primary:hover { background: #3D61E3; border-color: #3D61E3; }\n .subject-list { display: flex; flex-direction: column; }\n .subject-content { flex: 1; min-width: 0; }\n .ghost { opacity: 0.5; background: #ecf5ff; }\n .chosen { box-shadow: 0 4px 16px rgba(64,158,255,.3); }\n .sort-list { display: flex; flex-direction: column; gap: 8px; }\n .sort-item { display: flex; align-items: center; padding: 12px 16px; background: #f8f9fa; border: 1px solid #e4e7ed; border-radius: 6px; cursor: grab; transition: all 0.3s ease; }\n .sort-item:hover { background: #ecf5ff; border-color: #c6e2ff; }\n .sort-item:active { cursor: grabbing; }\n .sort-item.sort-ghost { opacity: 0.5; background: #ecf5ff; border: 2px dashed #409eff; }\n .sort-item.sort-chosen { background: #ecf5ff; border-color: #409eff; box-shadow: 0 4px 16px rgba(64,158,255,.3); transform: scale(1.02); }\n .sort-handle { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 12px; color: #909399; flex-shrink: 0; }\n .sort-index { font-size: 13px; color: #606266; font-weight: 500; margin-right: 8px; min-width: 24px; flex-shrink: 0; }\n .sort-title { flex: 1; font-size: 14px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .sort-type { font-size: 12px; color: #909399; margin-left: 12px; padding: 2px 8px; background: #f0f0f0; border-radius: 4px; flex-shrink: 0; }\n `\n\n @property({ attribute: 'is-preview' }) isPreview = false\n\n // use-model: enables two-way binding via model-value attribute + list-change event\n @property({ attribute: 'use-model' }) useModelAttr: string | null = null\n @property({ attribute: 'model-value' })\n get modelValue(): string { return JSON.stringify(this._list) }\n\n set modelValue(v: string) {\n if (!v || v === this._modelValueAttr) { return }\n this._modelValueAttr = v\n try {\n const parsed = JSON.parse(v)\n if (Array.isArray(parsed)) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch { /* invalid JSON, ignore */ }\n }\n\n private get _useModel(): boolean {\n return this.useModelAttr === 'true' || this.useModelAttr === '' || this.hasAttribute('use-model')\n }\n\n private _modelValueAttr = ''\n\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 })\n get subjectList() { return this._list }\n\n set subjectList(v: any) {\n if (!v) {\n this._list = []\n return\n }\n if (typeof v === 'string') {\n try {\n v = JSON.parse(v)\n }\n catch {\n this._list = []\n this.requestUpdate()\n return\n }\n }\n if (!Array.isArray(v)) {\n this._list = []\n this.requestUpdate()\n return\n }\n this._list = v.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n\n attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null) {\n super.attributeChangedCallback(name, oldVal, newVal)\n if (name === 'subject-list' && newVal && !this._list.length) {\n if (newVal.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(newVal)\n if (Array.isArray(parsed)) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n }\n\n @state() private _list: any[] = []\n @state() private _sortMode = false\n private _sortable: Sortable | null = null\n\n private get _isPreviewValue(): boolean {\n const val = (this as any).isPreview\n return typeof val === 'string' ? val !== 'false' : !!val\n }\n\n private _initialDataProcessed = false\n\n connectedCallback() {\n super.connectedCallback()\n if (!this._initialDataProcessed) {\n this._initialDataProcessed = true\n Promise.resolve().then(() => {\n if (this._list.length === 0) {\n this._processAttributeList()\n }\n })\n }\n }\n\n private _processAttributeList() {\n const attr = this.getAttribute('subject-list')\n if (!attr || attr === '[]') { return }\n if (attr.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(attr)\n if (Array.isArray(parsed) && parsed.length > 0) {\n this._list = parsed.map((i: any) => ({ ...i, customId: i.customId || uid() }))\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n\n firstUpdated() {\n this.updateComplete.then(() => this._initSortable())\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('_sortMode')) {\n this._sortable?.destroy()\n this._sortable = null\n this.updateComplete.then(() => this._initSortable())\n }\n // Reinitialize Sortable when list changes in sort mode\n if (changed.has('_list') && this._sortMode) {\n // Small delay to let Lit finish DOM updates\n setTimeout(() => {\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n this._initSortable()\n }, 50)\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._sortable?.destroy()\n this._sortable = null\n }\n\n private _initSortable() {\n if (!this._sortMode) { return }\n const el = this.querySelector<HTMLElement>('.sort-list')\n if (!el) { return }\n\n // Destroy existing instance first\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n\n // Small delay to ensure DOM is ready after previous destroy\n requestAnimationFrame(() => {\n const currentEl = this.querySelector<HTMLElement>('.sort-list')\n if (!currentEl || this._sortable) { return }\n\n this._sortable = Sortable.create(currentEl, {\n handle: '.sort-handle',\n animation: 200,\n ghostClass: 'sort-ghost',\n chosenClass: 'sort-chosen',\n onEnd: (evt) => {\n const { oldIndex, newIndex } = evt\n if (oldIndex === undefined || newIndex === undefined || oldIndex === newIndex) { return }\n const arr = [...this._list]\n const [item] = arr.splice(oldIndex, 1)\n arr.splice(newIndex, 0, item)\n this._list = arr\n this._emitListChange()\n },\n })\n })\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 _emitListChange() {\n this._emit('change', this._list)\n if (this._useModel) {\n this._modelValueAttr = JSON.stringify(this._list)\n this._emit('list-change', this._list)\n }\n }\n\n async toJSON(): Promise<any[]> {\n const subjectEls = this.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-subject-rich-text',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return []\n }\n\n const results: any[] = []\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.toJSON === 'function') {\n try {\n const data = await el.toJSON()\n results.push(data)\n }\n catch (err: any) {\n if (err instanceof SubjectError) {\n errors.push(err)\n }\n else {\n errors.push(new SubjectError(err.message || '未知错误', 'UNKNOWN', 'unknown'))\n }\n }\n }\n }\n\n if (errors.length > 0) {\n throw errors\n }\n\n return results\n }\n\n async validate(): Promise<{ valid: boolean, errors: SubjectError[] }> {\n const subjectEls = this.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return { valid: true, errors: [] }\n }\n\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.validate === 'function') {\n const errs = el.validate()\n if (errs?.length) {\n errors.push(...errs)\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n }\n\n // ── public API ────────────────────────────────────────────────\n get currentList() { return this._list }\n\n addSubject(type: string, index?: number, examAnswerRelationType: number | null = null) {\n const item = {\n customId: uid(), answerType: type, title: '',\n answers: [], analysis: '', scaleQuestionList: [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n isKey: false, answerCheckType: 1,\n examAnswerRelationType: examAnswerRelationType ?? 0,\n }\n const arr = [...this._list]\n if (typeof index === 'number' && index >= 0) {\n arr.splice(index + 1, 0, item)\n }\n else { arr.push(item) }\n this._list = arr\n this.requestUpdate()\n this._emitListChange()\n }\n\n addExam(items: any[]) {\n const newItems: any[] = []\n items.forEach((v: any) => {\n const item: any = {\n ...v,\n customId: v.customId || uid(),\n answers: v.answers?.map((c: any) => ({ ...c, title: c.answer, answerId: c.examAnswerId, isCorrect: c.isCorrect })) || [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n }\n if (!v.richTextContent) {\n item.answerType = v.examTypeEnum\n }\n newItems.push(item)\n })\n this._list = [...this._list, ...newItems]\n this._emitListChange()\n }\n\n uploadExcel(list: any[]) {\n this._list = [...this._list, ...list.map((i: any) => ({ ...i, customId: i.customId || uid(), isRealCanDel: true }))]\n this._emitListChange()\n }\n\n setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const item = this._list.find((v: any) => v.customId === customId)\n if (item) {\n const ans = item.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (ans) { ans.answerRelations = answerRelations }\n }\n this.requestUpdate()\n this._emitListChange()\n }\n\n // ── private helpers ───────────────────────────────────────────\n private _orderIndex(customId: string) {\n let n = 0; let out = 0\n this._list.forEach((v: any) => {\n n++; if (v.customId === customId) { out = n }\n })\n return out - 1\n }\n\n private _move(index: number, dir: 'up' | 'down') {\n const arr = [...this._list]\n if (dir === 'up' && index > 0) { [arr[index - 1], arr[index]] = [arr[index], arr[index - 1]] }\n else if (dir === 'down' && index < arr.length - 1) { [arr[index], arr[index + 1]] = [arr[index + 1], arr[index]] }\n this._list = arr\n this._emitListChange()\n }\n\n private _save(index: number, e: CustomEvent) {\n this._list = this._list.map((item, i) =>\n i === index ? { ...item, ...e.detail, isEdit: false, isSave: true } : item,\n )\n this._emitListChange()\n }\n\n private _deleteByCustomId(customId: string) {\n this._list = this._list.filter(item => item.customId !== customId)\n this._emitListChange()\n }\n\n private _delete(index: number) {\n const arr = [...this._list]\n arr.splice(index, 1)\n this._list = arr\n this._emitListChange()\n }\n\n private _setEdit(index: number, val: boolean) {\n this._list = this._list.map((item, i) => i === index ? { ...item, isEdit: val } : item)\n }\n\n private _renderItem(item: any, index: number) {\n const common = {\n 'order-index': this._orderIndex(item.customId),\n '?is-edit': item.isEdit || false,\n '?is-set': item.hasSet || false,\n '?is-save': !item.isRealCanDel,\n '?show-action': !this._isPreviewValue,\n 'exam-answer-relation-type': item.examAnswerRelationType ?? 0,\n }\n const onMove = (e: CustomEvent) => this._move(index, e.detail as 'up' | 'down')\n const onDelete = () => this._deleteByCustomId(item.customId)\n const onSave = (e: CustomEvent) => this._save(index, e)\n const onEdit = () => this._setEdit(index, true)\n const onAdd = (e: CustomEvent) => this.addSubject(e.detail?.type ?? e.detail, index)\n\n if ([SubjectType.SINGLE, SubjectType.MULTIPLE, SubjectType.SORT].includes(item.answerType)) {\n return html`<qxs-subject-single\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit}\n ?is-set=${item.hasSet}\n ?is-save=${!item.isRealCanDel}\n ?show-action=${!this._isPreviewValue}\n ?is-key=${item.isKey}\n question-type=${String(item.answerType)}\n answer-check-type=${item.answerCheckType ?? 1}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n least-answer-count=${item.leastAnswerCount ?? 2}\n exam-expand=${item.examExpand || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @set-key=${(e: CustomEvent) => {\n this._list = this._list.map((item, i) =>\n i === index ? { ...item, isKey: e.detail.value } : item,\n )\n this._emitListChange()\n }}\n @set-relation=${(e: CustomEvent) => this._emit('set-relation', e.detail)}\n ></qxs-subject-single>`\n }\n if (item.answerType === SubjectType.BLANK_FILL) {\n return html`<qxs-blank-fill\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .examAnswerSetting=${item.examAnswerSettingVO || {}}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-blank-fill>`\n }\n if (item.answerType === SubjectType.TEXT_FILL) {\n return html`<qxs-text-fill\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .examAnswerSetting=${item.examAnswerSettingVO || {}}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-text-fill>`\n }\n if (item.answerType === SubjectType.SCALE) {\n return html`<qxs-scale\n .title=${item.title || ''}\n .answerList=${item.answers || []}\n .scaleQuestions=${item.scaleQuestionList || []}\n .uploadImage=${this.uploadImage}\n order-index=${common['order-index']}\n ?is-edit=${item.isEdit} ?is-set=${item.hasSet} ?is-save=${!item.isRealCanDel} ?show-action=${!this._isPreviewValue}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-scale>`\n }\n return html`<div style=\"color:#909399;padding:8px\">未知题型: ${item.answerType}</div>`\n }\n\n render() {\n return html`\n <div class=\"subject-list\">\n ${this._list.map((item, index) => this._renderItem(item, index))}\n </div>\n `\n }\n}\n\nexport function register() {}\n"],"names":["SubjectType","SINGLE","MULTIPLE","SORT","BLANK_FILL","TEXT_FILL","SCALE","QxsSubjectList","LitElement","constructor","super","arguments","this","isPreview","useModelAttr","_modelValueAttr","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_list","_sortMode","_sortable","_initialDataProcessed","modelValue","JSON","stringify","v","parsed","parse","Array","isArray","map","i","customId","uid","requestUpdate","_useModel","hasAttribute","subjectList","attributeChangedCallback","name","oldVal","newVal","length","includes","_isPreviewValue","val","connectedCallback","then","_processAttributeList","attr","getAttribute","firstUpdated","updateComplete","_initSortable","updated","changed","has","destroy","setTimeout","disconnectedCallback","querySelector","requestAnimationFrame","currentEl","Sortable","create","handle","animation","ghostClass","chosenClass","onEnd","evt","oldIndex","newIndex","arr","item","splice","_emitListChange","_emit","detail","dispatchEvent","CustomEvent","bubbles","composed","toJSON","subjectEls","querySelectorAll","results","errors","el","data","push","err","SubjectError","message","validate","valid","errs","currentList","addSubject","type","index","examAnswerRelationType","undefined","answerType","title","answers","analysis","scaleQuestionList","isEdit","isSave","isRealCanDel","hasSet","isKey","answerCheckType","addExam","items","newItems","forEach","c","answer","answerId","examAnswerId","isCorrect","richTextContent","examTypeEnum","uploadExcel","list","setAnswerRelation","answerRelations","customAnswerId","find","ans","_orderIndex","n","out","_move","dir","_save","_deleteByCustomId","filter","_delete","_setEdit","_renderItem","common","onMove","onDelete","onSave","onEdit","onAdd","html","String","examRichTextContent","leastAnswerCount","examExpand","examId","value","examAnswerSettingVO","render","styles","css","__decorateClass","property","attribute","prototype","Object","state","safeCustomElement"],"mappings":"o2BAmBGA,EAAYC,OAAiBD,EAAYE,SAAmBF,EAAYG,KACxEH,EAAYI,WAAqBJ,EAAYK,UAAoBL,EAAYM,MAIzE,IAAMC,EAAN,cAA6BC,EAA7BC,WAAAA,GAAAC,SAAAC,WAyBkCC,KAAAC,WAAY,EAGbD,KAAAE,aAA8B,KAqBpEF,KAAQG,gBAAkB,GAG1BH,KAAAI,YAA+CC,SACtC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAkDhBjB,KAAQkB,MAAe,GACvBlB,KAAQmB,WAAY,EAC7BnB,KAAQoB,UAA6B,KAOrCpB,KAAQqB,uBAAwB,CAAA,CAtFhC,cAAIC,GAAuB,OAAOC,KAAKC,UAAUxB,KAAKkB,MAAO,CAE7D,cAAII,CAAWG,GACb,GAAKA,GAAKA,IAAMzB,KAAKG,gBAArB,CACAH,KAAKG,gBAAkBsB,EACvB,IACE,MAAMC,EAASH,KAAKI,MAAMF,GACtBG,MAAMC,QAAQH,KAChB1B,KAAKkB,MAAQQ,EAAOI,IAAKC,IAAA,IAAiBA,EAAGC,SAAUD,EAAEC,UAAYC,OACrEjC,KAAKkC,gBAET,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MY,IAAI,CAAC4C,EAAM0B,IAAUpG,KAAK8I,YAAYpE,EAAM0B;;KAG/D,GA9dWzG,EACJmK,OAASC,CAAA;;;;;;;;;;;;;;;;;;;;;;KAwBuBC,EAAA,CAAtCC,EAAS,CAAEC,UAAW,gBAzBZvK,EAyB4BwK,UAAA,YAAA,GAGDH,EAAA,CAArCC,EAAS,CAAEC,UAAW,eA5BZvK,EA4B2BwK,UAAA,eAAA,GAElCH,EAAA,CADHC,EAAS,CAAEC,UAAW,iBA7BZvK,EA8BPwK,UAAA,aAAA,GAsBJH,EAAA,CADCC,EAAS,CAAE9D,KAAMiE,UAnDPzK,EAoDXwK,UAAA,cAAA,GAUIH,EAAA,CADHC,EAAS,CAAE9D,KAAMvE,SA7DPjC,EA8DPwK,UAAA,cAAA,GA6CaH,EAAA,CAAhBK,KA3GU1K,EA2GMwK,UAAA,QAAA,GACAH,EAAA,CAAhBK,KA5GU1K,EA4GMwK,UAAA,YAAA,GA5GNxK,EAANqK,EAAA,CADNM,EAAkB,qBACN3K"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.mjs","sources":["../../../../packages/components-wc/src/subject/single.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { uid } from '../base/uid'\nimport { SubjectType } from './types'\nimport type { AnswerType } from './types'\n\nexport interface SubjectErrorOptions {\n message: string\n code?: string\n field?: string\n row?: any\n}\n\nexport class SubjectError extends Error {\n constructor(\n message: string,\n public code: string = 'VALIDATION_ERROR',\n public field?: string,\n public row?: any,\n ) {\n super(message)\n this.name = 'SubjectError'\n }\n\n static from(options: SubjectErrorOptions): SubjectError {\n return new SubjectError(options.message, options.code, options.field, options.row)\n }\n}\n\ninterface Answer {\n title: string\n isCorrect: boolean\n customAnswerId?: string\n answerId?: string\n resultItem?: string\n orderIndex?: number\n answerRelations?: any[]\n relationType?: number | null\n}\n\nconst iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\nconst iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\nconst iconClose = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/></svg>`\nconst iconArrow = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"/></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-subject-single')\nexport class QxsSubjectSingle 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 .title .key-badge {\n display: inline-block;\n margin-left: 8px;\n padding: 1px 6px;\n font-size: 11px;\n color: #fff;\n background: #f56c6c;\n border-radius: 3px;\n vertical-align: middle;\n }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview-answer { display: flex; flex-direction: column; margin-top: 12px; }\n .preview-answer .radio { margin-top: 8px; padding-left: 8px; display: flex; align-items: center; gap: 6px; }\n .preview-answer .order { color: #909399; }\n .preview-answer .correct { color: #67c23a; }\n .preview-answer .result-info { color: #909399; }\n\n .flex { display: flex; }\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: 60px; 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 .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 360px; position: relative; display: block; }\n .answer-item .input input {\n height: 32px; padding: 0 50px 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n .answer-item .input input:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .answer-item .input .char-counter {\n position: absolute; right: 8px; top: 50%; transform: translateY(-50%);\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-item .correct { margin: 0 10px; color: #909399; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }\n .answer-item .correct:hover { color: #3D61E3; }\n .answer-item .correct.is-correct { color: #67c23a; }\n .answer-item .correct input { width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .answer-item .link { margin-left: 8px; color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; }\n .answer-item .link:hover { color: #2D4CB8; }\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 .el-select.sort-select {\n width: 360px; height: auto; min-height: 32px; appearance: auto;\n }\n\n .sort-badge { font-weight: bold; color: #3D61E3; margin-left: 10px; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n /* Multi-select with tags (Element Plus style) */\n .multi-select-wrapper { position: relative; }\n .multi-select {\n width: 240px; height: 28px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 30px 0 8px; font-size: 13px; background: #fff; cursor: pointer;\n display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;\n transition: border-color .2s; position: relative; overflow: hidden;\n }\n .multi-select:hover { border-color: #c0c4cc; }\n .multi-select.focused { border-color: #3D61E3; }\n .multi-select.disabled { background: #f5f7fa; cursor: not-allowed; }\n .multi-select .placeholder { color: #c0c4cc; font-size: 13px; padding: 4px 0; }\n .multi-select .arrow {\n position: absolute; right: 8px; top: 50%; transform: translateY(-50%);\n color: #c0c4cc; display: inline-flex; transition: transform .2s;\n }\n .multi-select.focused .arrow { transform: translateY(-50%) rotate(180deg); color: #3D61E3; }\n .multi-select .tag {\n display: inline-flex; align-items: center; gap: 2px;\n background: #f0f2f5; border-radius: 3px; padding: 0 6px; height: 20px;\n font-size: 12px; color: #606266; line-height: 20px;\n }\n .multi-select .tag .tag-close {\n display: inline-flex; cursor: pointer; color: #909399; margin-left: 2px; line-height: 1;\n }\n .multi-select .tag .tag-close:hover { color: #3D61E3; }\n .multi-select-dropdown {\n position: absolute; z-index: 100; background: #fff; left: 0; top: 100%; margin-top: 4px;\n border: 1px solid #e4e7ed; border-radius: 3px;\n box-shadow: 0 4px 12px rgba(0,0,0,.12); min-width: 240px; max-height: 140px; overflow-y: auto;\n }\n .multi-select-option {\n padding: 4px 12px; font-size: 13px; color: #606266; cursor: pointer;\n transition: background .2s;\n }\n .multi-select-option:hover { background: #f5f7fa; }\n .multi-select-option.selected { color: #3D61E3; font-weight: 500; }\n\n .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; }\n .modal { background: #fff; border-radius: 6px; width: 520px; max-width: 90vw; box-shadow: 0 12px 32px rgba(0,0,0,.12); display: flex; flex-direction: column; }\n .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }\n .modal-title { font-size: 14px; font-weight: 600; color: #303133; }\n .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }\n .modal-close:hover { color: #3D61E3; }\n .modal-body { padding: 20px; }\n .modal-body textarea { min-height: 120px; }\n .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }\n .modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }\n .modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }\n .modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\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-analysis' }) showAnalysis = true\n @property({ attribute: 'question-type', reflect: true }) type: AnswerType = 'single'\n @property({ type: Number, attribute: 'answer-check-type' }) answerCheckType = 1\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'least-answer-count' }) leastAnswerCount = 2\n @property({ type: String, attribute: 'exam-expand' }) examExpand = ''\n @property({ type: String, attribute: 'custom-id' }) customId = ''\n @property({ type: Number, attribute: 'exam-id' }) examId = 0\n @property({ type: Object }) 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' })\n get answerList() { return this._answers }\n\n set answerList(v: any) {\n const arr = Array.isArray(v) ? v : []\n this._answers = arr.length\n ? arr.map((a: any) => ({ ...a }))\n : [\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n ]\n this.requestUpdate('answerList')\n }\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\n\n @state() private _answers: Answer[] = [\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n ]\n\n @property({ type: String }) title = ''\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _richText = ''\n @state() private _showRichText = false\n @state() private _leastAnswerCount = 2\n @state() private _answerCheckType = 1\n @state() private _isKey = false\n @state() private _orderList: string[] = []\n @state() private _resultDialogOpen = false\n @state() private _resultDialogIndex = 0\n @state() private _resultDialogValue = ''\n @state() private _sortDropdownOpen = false\n\n private readonly TITLE_MAX = 200\n private readonly ANSWER_MAX = 100\n\n connectedCallback() {\n super.connectedCallback()\n document.addEventListener('click', this._handleDocumentClick)\n this._syncExternalProps()\n if (this.richTextContent) {\n this._richText = this.richTextContent\n this._showRichText = true\n }\n }\n\n firstUpdated() {\n this._syncExternalProps()\n if (this.richTextContent) {\n this._richText = this.richTextContent\n this._showRichText = true\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n document.removeEventListener('click', this._handleDocumentClick)\n }\n\n private _handleDocumentClick = (e: MouseEvent) => {\n const path = e.composedPath()\n const wrapper = this.shadowRoot?.querySelector('.multi-select-wrapper')\n if (wrapper && !path.includes(wrapper)) {\n this._sortDropdownOpen = false\n this.requestUpdate()\n }\n }\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n if (changed.has('title') || changed.has('answerList') || changed.has('analysis') || changed.has('leastAnswerCount') || changed.has('answerCheckType') || changed.has('isKey')) {\n this._syncExternalProps()\n }\n if (changed.has('examExpand') || changed.has('answerList')) { this._syncExamExpand() }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue\n }\n }\n\n private _syncExternalProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._leastAnswerCount = this.leastAnswerCount || 2\n this._answerCheckType = this.answerCheckType || 1\n this._isKey = this.isKey\n if (this.richTextContent) { this._richText = this.richTextContent; this._showRichText = true }\n if (this.answerList?.length) {\n this._answers = this.answerList.map((a: any) => ({\n ...a,\n title: a.title || '',\n isCorrect: !!a.isCorrect,\n }))\n }\n }\n\n private _syncProps() {\n this._title = (this as any).title || ''\n this._analysis = this.analysis || ''\n this._leastAnswerCount = this.leastAnswerCount || 2\n this._answerCheckType = this.answerCheckType || 1\n this._isKey = this.isKey\n if (this.richTextContent) { this._richText = this.richTextContent; this._showRichText = true }\n if (this.answerList?.length) {\n this._answers = this.answerList.map((a: any) => ({\n ...a,\n title: a.title || '',\n isCorrect: !!a.isCorrect,\n }))\n }\n this._syncExamExpand()\n }\n\n private _syncExamExpand() {\n if (!this.examExpand || !this.answerList?.length) { return }\n const ids = this.examExpand.split(',')\n this._orderList = ids.map((id) => {\n const answer = (this.answerList as any[]).find(a => a.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean)\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 _label(i: number) { return String.fromCharCode(65 + i) }\n\n private get _titlePlaceholder() {\n return this.type === 'single' ? '单选题' : this.type === 'multiple' ? '多选题' : '排序题'\n }\n\n private _setCorrect(item: Answer, val: boolean) {\n if (this.type === 'single') {\n this._answers.forEach((a) => { a.isCorrect = false })\n item.isCorrect = val\n }\n else {\n item.isCorrect = val\n }\n this.requestUpdate()\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 // 双向绑定:通知外部更新\n if (this.useModel) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _onAnswerInput(e: Event, idx: number) {\n const el = e.target as HTMLInputElement\n if (el.value.length > this.ANSWER_MAX) { el.value = el.value.slice(0, this.ANSWER_MAX) }\n this._answers[idx].title = el.value\n this.requestUpdate()\n }\n\n private _addAnswer() {\n if (this.isSave) { return }\n this._answers = [...this._answers, { title: '', isCorrect: false, customAnswerId: uid() }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 3 || this.isSave) { return }\n this._answers = this._answers.filter((_, i) => i !== index)\n }\n\n private _toggleSortItem(letter: string) {\n const idx = this._orderList.indexOf(letter)\n if (idx >= 0) {\n this._orderList = this._orderList.filter(l => l !== letter)\n }\n else {\n this._orderList = [...this._orderList, letter]\n }\n this.requestUpdate()\n }\n\n private _removeSortItem(letter: string) {\n this._orderList = this._orderList.filter(l => l !== letter)\n this.requestUpdate()\n }\n\n private _getSortOrder(index: number): number | null {\n const pos = this._orderList.indexOf(this._label(index))\n return pos >= 0 ? pos + 1 : null\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: this.type, orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : (this as any).title || ''\n const answers = this.isEdit ? this._answers : this.answerList || []\n const answerCheckType = this.isEdit ? this._answerCheckType : this.answerCheckType || 1\n const leastAnswerCount = this.isEdit ? this._leastAnswerCount : this.leastAnswerCount || 2\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const examExpand = this.isEdit\n ? this._orderList.map((l: string) => l.charCodeAt(0) - 65 + 1).join(',')\n : ((this as any).examExpand || '')\n const showRichText = this.isEdit ? this._showRichText : !!(this.richTextContent)\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n const orderList = this.isEdit ? this._orderList : (() => {\n const expand = (this as any).examExpand\n if (!expand) return []\n return expand.split(',').map((id: string) => {\n const answer = (this.answerList as any[])?.find(a => a.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean)\n })()\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (!answerCheckType) {\n reject(new SubjectError('请选择答题设置', 'NO_ANSWER_CHECK_TYPE', 'answerCheckType', row))\n return\n }\n\n let msg = ''\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n\n if (this.type === 'multiple' || this.type === 'single') {\n answers.forEach((v: any, i: number) => {\n if (!v.title?.trim()) { msg += `选项${String.fromCharCode(65 + i)}未填写。` }\n if (v.isCorrect) { isSetCorrectAnswer = true; correctAnswerCount++ }\n })\n }\n else if (this.type === 'sort') {\n if (orderList.length) { isSetCorrectAnswer = true }\n if (isSetCorrectAnswer && orderList.length < leastAnswerCount) {\n reject(new SubjectError(`排序题至少需要设置${leastAnswerCount}项排序答案`, 'SORT_COUNT_INVALID', 'orderList', row))\n return\n }\n }\n\n if (msg) {\n reject(new SubjectError(msg, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n\n const uniqueAnswer = new Set(answers.map((a: any) => a.title))\n if (uniqueAnswer.size !== answers.length) {\n reject(new SubjectError('选项不能重复', 'DUPLICATE_ANSWERS', 'answers', row))\n return\n }\n\n if (this.type === 'multiple') {\n if (correctAnswerCount === 1) {\n reject(new SubjectError('请至少设置两个支持选项', 'CORRECT_COUNT_INVALID', 'answers', row))\n return\n }\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount) {\n reject(new SubjectError('至少选几项与支持选项数不符', 'LEAST_ANSWER_COUNT_INVALID', 'answers', row))\n return\n }\n }\n\n if (answerCheckType === 2 || answerCheckType === 3) {\n if (!isSetCorrectAnswer) {\n reject(new SubjectError('请设置支持选项', 'NO_CORRECT_ANSWER', 'answers', row))\n return\n }\n }\n\n console.log('toJSON this.type:', this.type, typeof this.type)\n const result: any = {\n answerType: String(this.type),\n title,\n answers: answers.filter((a: any) => a.title).map((a: any, i: number) => ({ ...a, orderIndex: i + 1 })),\n examExpand,\n analysis,\n isSetCorrectAnswer,\n leastAnswerCount,\n examRichTextContent: showRichText ? richText : '',\n examAnswerRelationType: this.examAnswerRelationType,\n isKey: this._isKey,\n answerCheckType,\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\n })\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this.customId || undefined, answerType: this.type, orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : (this as any).title || ''\n const answers = this.isEdit ? this._answers : this.answerList || []\n const answerCheckType = this.isEdit ? this._answerCheckType : this.answerCheckType || 1\n const leastAnswerCount = this.isEdit ? this._leastAnswerCount : this.leastAnswerCount || 2\n const orderList = this.isEdit ? this._orderList : (() => {\n const expand = (this as any).examExpand\n if (!expand) return []\n return expand.split(',').map((id: string) => {\n const answer = (this.answerList as any[])?.find(a => a.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean)\n })()\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (!answerCheckType) {\n errors.push(new SubjectError('请选择答题设置', 'NO_ANSWER_CHECK_TYPE', 'answerCheckType', row))\n }\n\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n\n if (this.type === 'multiple' || this.type === 'single') {\n answers.forEach((v: any, i: number) => {\n if (!v.title?.trim()) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n if (v.isCorrect) { isSetCorrectAnswer = true; correctAnswerCount++ }\n })\n }\n else if (this.type === 'sort') {\n if (orderList.length) { isSetCorrectAnswer = true }\n if (isSetCorrectAnswer && orderList.length < leastAnswerCount) {\n errors.push(new SubjectError(`排序题至少需要设置${leastAnswerCount}项排序答案`, 'SORT_COUNT_INVALID', 'orderList', row))\n }\n }\n\n const uniqueAnswer = new Set(answers.map((a: any) => a.title))\n if (uniqueAnswer.size !== answers.length && answers.length > 0) {\n errors.push(new SubjectError('选项不能重复', 'DUPLICATE_ANSWERS', 'answers', row))\n }\n\n if (this.type === 'multiple') {\n if (correctAnswerCount === 1 && answers.length > 0) {\n errors.push(new SubjectError('请至少设置两个支持选项', 'CORRECT_COUNT_INVALID', 'answers', row))\n }\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount) {\n errors.push(new SubjectError('至少选几项与支持选项数不符', 'LEAST_ANSWER_COUNT_INVALID', 'answers', row))\n }\n }\n\n if (answerCheckType === 2 || answerCheckType === 3) {\n if (!isSetCorrectAnswer) {\n errors.push(new SubjectError('请设置支持选项', 'NO_CORRECT_ANSWER', 'answers', row))\n }\n }\n\n return errors\n }\n\n private _openResultDialog(idx: number) {\n this._resultDialogIndex = idx\n this._resultDialogValue = this._answers[idx].resultItem || ''\n this._resultDialogOpen = true\n }\n\n private _saveResultDialog() {\n this._answers[this._resultDialogIndex].resultItem = this._resultDialogValue\n this._resultDialogOpen = false\n this.requestUpdate()\n }\n\n private _renderResultDialog() {\n if (!this._resultDialogOpen) { return '' }\n const letter = this._label(this._resultDialogIndex)\n return html`\n <div class=\"modal-backdrop\" @click=${() => { this._resultDialogOpen = false }}>\n <div class=\"modal\" @click=${(e: Event) => e.stopPropagation()}>\n <div class=\"modal-header\">\n <span class=\"modal-title\">编辑结果项 — 选项 ${letter}</span>\n <button class=\"modal-close\" @click=${() => { this._resultDialogOpen = false }}>✕</button>\n </div>\n <div class=\"modal-body\">\n <textarea rows=\"5\" .value=${this._resultDialogValue}\n @input=${(e: Event) => { this._resultDialogValue = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入该选项的结果项内容\"></textarea>\n </div>\n <div class=\"modal-footer\">\n <button @click=${() => { this._resultDialogOpen = false }}>取消</button>\n <button class=\"primary\" @click=${() => this._saveResultDialog()}>保存</button>\n </div>\n </div>\n </div>\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 private _renderPreview() {\n const typeSuffix = this.type === 'single'\n ? '(单选题)'\n : `(${this._titlePlaceholder}${this.leastAnswerCount ? `至少选${this.leastAnswerCount}项${this.type === 'sort' ? '并排序' : ''}` : ''})`\n const answers = this.answerList as Answer[]\n return html`\n <div class=\"preview\">\n <div><span class=\"title\">${this.orderIndex + 1}.${(this as any).title || ''}${typeSuffix}${this._isKey ? html`<span class=\"key-badge\">核心题</span>` : ''}</span></div>\n ${this.richTextContent ? html`<div class=\"rich-text\" .innerHTML=${this.richTextContent}></div>` : ''}\n <div class=\"preview-answer\">\n ${answers.map((a, i) => html`\n <label class=\"radio\">\n <input type=\"${this.type === 'sort' ? 'checkbox' : 'radio'}\" .checked=${!!a.isCorrect} disabled />\n <span class=\"order\">${this._label(i)}.</span> ${a.title}\n ${this.type !== 'sort' && a.isCorrect ? html`<span class=\"correct\">(支持选项)</span>` : ''}\n ${this.type !== 'sort' && this.examAnswerRelationType === 1 ? html`<span class=\"result-info\">${a.resultItem ? '(已设置结果项)' : '(未设置结果项)'}</span>` : ''}\n ${this.type !== 'sort' && this.examAnswerRelationType === 2 ? html`<span class=\"result-info\">${a.answerRelations?.length ? '(已设置关联)' : '(未设置关联)'}</span>` : ''}\n </label>\n `)}\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this.isSave}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【${this._titlePlaceholder}】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n ${['multiple', 'sort'].includes(this.type)\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>设置:</span></div>\n <select class=\"el-select\" .value=${String(this._leastAnswerCount)} ?disabled=${this.isSave}\n @change=${(e: Event) => { this._leastAnswerCount = Number((e.target as HTMLSelectElement).value) }}>\n ${Array.from({ length: Math.max(0, this._answers.length - 1) }, (_, i) => i + 2).map(n => html`\n <option value=${n} ?selected=${this._leastAnswerCount === n}>至少选择${n}项</option>\n `)}\n </select>\n </div>\n `\n : ''}\n\n <div class=\"answer-list\">\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${this._label(i)}.</span>\n <div class=\"input\">\n <input type=\"text\" .value=${a.title} ?disabled=${this.isSave}\n maxlength=${this.ANSWER_MAX}\n @input=${(e: Event) => this._onAnswerInput(e, i)}\n placeholder=\"选项${this._label(i)}\" />\n <span class=\"char-counter\">${a.title.length}/${this.ANSWER_MAX}</span>\n </div>\n\n ${this.type === 'sort' && this._getSortOrder(i) !== null\n ? html`<span class=\"sort-badge\">第${this._getSortOrder(i)}位</span>`\n : ''}\n\n ${['single', 'multiple'].includes(this.type)\n ? html`\n <label class=\"correct ${a.isCorrect ? 'is-correct' : ''}\">\n <input type=\"checkbox\" .checked=${a.isCorrect} ?disabled=${this.isSave}\n @change=${(e: Event) => this._setCorrect(a, (e.target as HTMLInputElement).checked)} />\n 支持选项\n </label>\n `\n : ''}\n\n <span class=\"icon ${this.isSave ? 'disabled' : ''}\"\n @click=${() => this._addAnswer()}>\n ${iconPlus}\n </span>\n <span class=\"icon ${this.isSave || this._answers.length < 3 ? 'disabled' : ''}\"\n @click=${() => this._deleteAnswer(i)}>\n ${iconRemove}\n </span>\n\n ${this.examAnswerRelationType === 1 && this.type !== 'sort'\n ? html`\n <span class=\"link\" @click=${() => this._openResultDialog(i)}>${a.resultItem ? '编辑结果' : '添加结果'}</span>\n `\n : ''}\n ${this.examAnswerRelationType === 2 && this.type !== 'sort'\n ? html`\n <span class=\"link\">关联检查</span>\n `\n : ''}\n </div>\n `)}\n </div>\n\n ${this.type === 'sort'\n ? html`\n <div class=\"flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>排序答案:</span></div>\n <div style=\"flex:1\">\n <div class=\"multi-select-wrapper\">\n <div class=\"multi-select ${this._sortDropdownOpen ? 'focused' : ''} ${this.isSave ? 'disabled' : ''}\"\n @click=${() => { if (!this.isSave) { this._sortDropdownOpen = !this._sortDropdownOpen; this.requestUpdate() } }}>\n ${this._orderList.length > 0\n ? this._orderList.map(l => html`\n <span class=\"tag\">\n ${l}\n <span class=\"tag-close\" @click=${(e: Event) => { e.stopPropagation(); this._removeSortItem(l) }}>✕</span>\n </span>\n `)\n : html`<span class=\"placeholder\">请按顺序选择排序答案</span>`\n }\n <span class=\"arrow\">${iconArrow}</span>\n </div>\n ${this._sortDropdownOpen\n ? html`\n <div class=\"multi-select-dropdown\">\n ${this._answers.map((_, i) => html`\n <div class=\"multi-select-option ${this._orderList.includes(this._label(i)) ? 'selected' : ''}\"\n @click=${() => { this._toggleSortItem(this._label(i)); this.requestUpdate() }}>\n ${this._label(i)}\n </div>\n `)}\n </div>\n `\n : ''}\n </div>\n </div>\n </div>\n `\n : ''}\n\n ${this._showRichText\n ? html`\n <div class=\"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 @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n <div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>\n </div>\n </div>\n `\n : ''}\n\n ${this.showAnalysis\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\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 `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout ?show-edit=${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 ?is-edit=${this.isEdit}\n ?is-set=${this.isSet}\n ?is-key=${this._isKey}\n ?show-other-option=${this.type === 'multiple' || this.type === 'single'}\n answer-check-type=${this._answerCheckType}\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._isKey = e.detail.value; this._emit('set-key', e.detail) }}\n @set-answer-setting=${(e: CustomEvent) => { this._answerCheckType = e.detail.value }}\n @on-show-rich-text=${() => { this._showRichText = true }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n ${this._renderResultDialog()}\n `\n }\n}\n\nexport function register() {}\n"],"names":["SubjectError","Error","constructor","message","code","arguments","length","undefined","field","row","super","this","name","from","options","iconPlus","html","iconRemove","iconArrow","QxsSubjectSingle","LitElement","orderIndex","isEdit","isSave","isSet","isKey","showAction","showAnalysis","type","answerCheckType","examAnswerRelationType","richTextContent","analysis","leastAnswerCount","examExpand","customId","examId","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","modelValue","useModel","_answers","title","isCorrect","_title","_analysis","_richText","_showRichText","_leastAnswerCount","_answerCheckType","_isKey","_orderList","_resultDialogOpen","_resultDialogIndex","_resultDialogValue","_sortDropdownOpen","TITLE_MAX","ANSWER_MAX","_handleDocumentClick","path","composedPath","wrapper","shadowRoot","querySelector","includes","requestUpdate","answerList","v","arr","Array","isArray","map","a","connectedCallback","document","addEventListener","_syncExternalProps","firstUpdated","disconnectedCallback","removeEventListener","willUpdate","changed","has","_syncProps","_syncExamExpand","ids","split","id","answer","find","answerId","toString","String","fromCharCode","filter","Boolean","_emit","detail","dispatchEvent","CustomEvent","bubbles","composed","_label","i","_titlePlaceholder","_setCorrect","item","val","forEach","_onTitleInput","el","value","slice","_onAnswerInput","idx","_addAnswer","customAnswerId","uid","_deleteAnswer","index","_","_toggleSortItem","letter","indexOf","l","_removeSortItem","_getSortOrder","pos","toJSON","answerType","answers","charCodeAt","join","showRichText","richText","orderList","expand","msg","isSetCorrectAnswer","correctAnswerCount","trim","Set","size","examRichTextContent","validate","errors","push","_openResultDialog","resultItem","_saveResultDialog","_renderResultDialog","stopPropagation","_save","stopImmediatePropagation","data","err","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","_renderPreview","typeSuffix","answerRelations","_renderEdit","Number","Math","max","n","checked","getContent","render","styles","css","__decorateClass","property","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"2lBAcO,MAAMA,UAAqBC,MAChCC,WAAAA,CACEC,GAIA,IAHOC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAe,mBACfG,yCACAC,EAAAJ,UAAAC,OAAA,EAAAD,kBAAAE,EAEPG,MAAMP,GAJCQ,KAAAP,KAAAA,EACAO,KAAAH,MAAAA,EACAG,KAAAF,IAAAA,EAGPE,KAAKC,KAAO,cACd,CAEA,WAAOC,CAAKC,GACV,OAAO,IAAId,EAAac,EAAQX,QAASW,EAAQV,KAAMU,EAAQN,MAAOM,EAAQL,IAChF,EAcF,MAAMM,EAAWC,CAAA,2NACXC,EAAaD,CAAA,qLACDA,CAAA,yNAClB,MAAME,EAAYF,CAAA,kLA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CAAhBK,KAnNU9L,EAmNM4L,UAAA,qBAAA,GACAH,EAAA,CAAhBK,KApNU9L,EAoNM4L,UAAA,oBAAA,GApNN5L,EAANyL,EAAA,CADNM,EAAkB,uBACN/L"}
|
|
1
|
+
{"version":3,"file":"single.mjs","sources":["../../../../packages/components-wc/src/subject/single.ts"],"sourcesContent":["import type { AnswerType } from './types'\nimport { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { uid } from '../base/uid'\nimport { SubjectType } from './types'\n\nexport interface SubjectErrorOptions {\n message: string\n code?: string\n field?: string\n row?: any\n}\n\nexport class SubjectError extends Error {\n constructor(\n message: string,\n public code: string = 'VALIDATION_ERROR',\n public field?: string,\n public row?: any,\n ) {\n super(message)\n this.name = 'SubjectError'\n }\n\n static from(options: SubjectErrorOptions): SubjectError {\n return new SubjectError(options.message, options.code, options.field, options.row)\n }\n}\n\ninterface Answer {\n title: string\n isCorrect: boolean\n customAnswerId?: string\n answerId?: string\n resultItem?: string\n orderIndex?: number\n answerRelations?: any[]\n relationType?: number | null\n}\n\nconst iconPlus = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\nconst iconRemove = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/></svg>`\nconst iconClose = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"/><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"/></svg>`\nconst iconArrow = html`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"/></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-subject-single')\nexport class QxsSubjectSingle 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 .title .key-badge {\n display: inline-block;\n margin-left: 8px;\n padding: 1px 6px;\n font-size: 11px;\n color: #fff;\n background: #f56c6c;\n border-radius: 3px;\n vertical-align: middle;\n }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview-answer { display: flex; flex-direction: column; margin-top: 12px; }\n .preview-answer .radio { margin-top: 8px; padding-left: 8px; display: flex; align-items: center; gap: 6px; }\n .preview-answer .order { color: #909399; }\n .preview-answer .correct { color: #67c23a; }\n .preview-answer .result-info { color: #909399; }\n\n .flex { display: flex; }\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: 60px; 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 .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 360px; position: relative; display: block; }\n .answer-item .input input {\n height: 32px; padding: 0 50px 0 8px;\n font-size: 13px; line-height: 32px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n transition: border-color .2s; box-sizing: border-box;\n }\n .answer-item .input input:focus { border-color: #3D61E3; outline: none; }\n .answer-item .input input:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .answer-item .input .char-counter {\n position: absolute; right: 8px; top: 50%; transform: translateY(-50%);\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-item .correct { margin: 0 10px; color: #909399; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }\n .answer-item .correct:hover { color: #3D61E3; }\n .answer-item .correct.is-correct { color: #67c23a; }\n .answer-item .correct input { width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3; }\n\n .answer-item .icon {\n margin-left: 6px; cursor: pointer; display: inline-flex;\n align-items: center; justify-content: center;\n width: 24px; height: 24px; border-radius: 4px;\n border: 1px solid #dcdfe6; background: #fff; color: #909399;\n transition: all 0.2s;\n }\n .answer-item .icon:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }\n\n .answer-item .link { margin-left: 8px; color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; }\n .answer-item .link:hover { color: #2D4CB8; }\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 .el-select.sort-select {\n width: 360px; height: auto; min-height: 32px; appearance: auto;\n }\n\n .sort-badge { font-weight: bold; color: #3D61E3; margin-left: 10px; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\n\n /* Multi-select with tags (Element Plus style) */\n .multi-select-wrapper { position: relative; }\n .multi-select {\n width: 240px; height: 28px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 30px 0 8px; font-size: 13px; background: #fff; cursor: pointer;\n display: flex; flex-wrap: nowrap; align-items: center; gap: 4px;\n transition: border-color .2s; position: relative; overflow: hidden;\n }\n .multi-select:hover { border-color: #c0c4cc; }\n .multi-select.focused { border-color: #3D61E3; }\n .multi-select.disabled { background: #f5f7fa; cursor: not-allowed; }\n .multi-select .placeholder { color: #c0c4cc; font-size: 13px; padding: 4px 0; }\n .multi-select .arrow {\n position: absolute; right: 8px; top: 50%; transform: translateY(-50%);\n color: #c0c4cc; display: inline-flex; transition: transform .2s;\n }\n .multi-select.focused .arrow { transform: translateY(-50%) rotate(180deg); color: #3D61E3; }\n .multi-select .tag {\n display: inline-flex; align-items: center; gap: 2px;\n background: #f0f2f5; border-radius: 3px; padding: 0 6px; height: 20px;\n font-size: 12px; color: #606266; line-height: 20px;\n }\n .multi-select .tag .tag-close {\n display: inline-flex; cursor: pointer; color: #909399; margin-left: 2px; line-height: 1;\n }\n .multi-select .tag .tag-close:hover { color: #3D61E3; }\n .multi-select-dropdown {\n position: absolute; z-index: 100; background: #fff; left: 0; top: 100%; margin-top: 4px;\n border: 1px solid #e4e7ed; border-radius: 3px;\n box-shadow: 0 4px 12px rgba(0,0,0,.12); min-width: 240px; max-height: 140px; overflow-y: auto;\n }\n .multi-select-option {\n padding: 4px 12px; font-size: 13px; color: #606266; cursor: pointer;\n transition: background .2s;\n }\n .multi-select-option:hover { background: #f5f7fa; }\n .multi-select-option.selected { color: #3D61E3; font-weight: 500; }\n\n .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; }\n .modal { background: #fff; border-radius: 6px; width: 520px; max-width: 90vw; box-shadow: 0 12px 32px rgba(0,0,0,.12); display: flex; flex-direction: column; }\n .modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid #e4e7ed; }\n .modal-title { font-size: 14px; font-weight: 600; color: #303133; }\n .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #909399; padding: 0; line-height: 1; }\n .modal-close:hover { color: #3D61E3; }\n .modal-body { padding: 20px; }\n .modal-body textarea { min-height: 120px; }\n .modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e4e7ed; }\n .modal-footer button { padding: 6px 16px; font-size: 12px; border-radius: 3px; cursor: pointer; border: 1px solid #dcdfe6; background: #fff; color: #606266; }\n .modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }\n .modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }\n `\n\n @property({ type: Number, attribute: 'order-index' }) orderIndex = 0\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-analysis' }) showAnalysis = true\n @property({ attribute: 'question-type', reflect: true }) type: AnswerType = 'single'\n @property({ type: Number, attribute: 'answer-check-type' }) answerCheckType = 1\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) examAnswerRelationType = 0\n @property({ type: String, attribute: 'rich-text-content' }) richTextContent = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'least-answer-count' }) leastAnswerCount = 2\n @property({ type: String, attribute: 'exam-expand' }) examExpand = ''\n @property({ type: String, attribute: 'custom-id' }) customId = ''\n @property({ type: Number, attribute: 'exam-id' }) examId = 0\n @property({ type: Object }) 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' })\n get answerList() { return this._answers }\n\n set answerList(v: any) {\n const arr = Array.isArray(v) ? v : []\n this._answers = arr.length\n ? arr.map((a: any) => ({ ...a }))\n : [\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n ]\n this.requestUpdate('answerList')\n }\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) modelValue = ''\n @property({ type: Boolean, attribute: 'use-model' }) useModel = false\n\n @state() private _answers: Answer[] = [\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n { title: '', isCorrect: false }, { title: '', isCorrect: false },\n ]\n\n @property({ type: String }) title = ''\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _richText = ''\n @state() private _showRichText = false\n @state() private _leastAnswerCount = 2\n @state() private _answerCheckType = 1\n @state() private _isKey = false\n @state() private _orderList: string[] = []\n @state() private _resultDialogOpen = false\n @state() private _resultDialogIndex = 0\n @state() private _resultDialogValue = ''\n @state() private _sortDropdownOpen = false\n\n private readonly TITLE_MAX = 200\n private readonly ANSWER_MAX = 100\n\n connectedCallback() {\n super.connectedCallback()\n document.addEventListener('click', this._handleDocumentClick)\n this._syncExternalProps()\n if (this.richTextContent) {\n this._richText = this.richTextContent\n this._showRichText = true\n }\n }\n\n firstUpdated() {\n this._syncExternalProps()\n if (this.richTextContent) {\n this._richText = this.richTextContent\n this._showRichText = true\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n document.removeEventListener('click', this._handleDocumentClick)\n }\n\n private _handleDocumentClick = (e: MouseEvent) => {\n const path = e.composedPath()\n const wrapper = this.shadowRoot?.querySelector('.multi-select-wrapper')\n if (wrapper && !path.includes(wrapper)) {\n this._sortDropdownOpen = false\n this.requestUpdate()\n }\n }\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('isEdit') && this.isEdit) { this._syncProps() }\n if (changed.has('title') || changed.has('answerList') || changed.has('analysis') || changed.has('leastAnswerCount') || changed.has('answerCheckType') || changed.has('isKey')) {\n this._syncExternalProps()\n }\n if (changed.has('examExpand') || changed.has('answerList')) { this._syncExamExpand() }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('modelValue') && this.useModel) {\n this._title = this.modelValue\n }\n }\n\n private _syncExternalProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._leastAnswerCount = this.leastAnswerCount || 2\n this._answerCheckType = this.answerCheckType || 1\n this._isKey = this.isKey\n if (this.richTextContent) { this._richText = this.richTextContent; this._showRichText = true }\n if (this.answerList?.length) {\n this._answers = this.answerList.map((a: any) => ({\n ...a,\n title: a.title || '',\n isCorrect: !!a.isCorrect,\n }))\n }\n }\n\n private _syncProps() {\n this._title = (this as any).title || ''\n this._analysis = this.analysis || ''\n this._leastAnswerCount = this.leastAnswerCount || 2\n this._answerCheckType = this.answerCheckType || 1\n this._isKey = this.isKey\n if (this.richTextContent) { this._richText = this.richTextContent; this._showRichText = true }\n if (this.answerList?.length) {\n this._answers = this.answerList.map((a: any) => ({\n ...a,\n title: a.title || '',\n isCorrect: !!a.isCorrect,\n }))\n }\n this._syncExamExpand()\n }\n\n private _syncExamExpand() {\n if (!this.examExpand || !this.answerList?.length) { return }\n const ids = this.examExpand.split(',')\n this._orderList = ids.map((id) => {\n const answer = (this.answerList as any[]).find(a => a.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean)\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 _label(i: number) { return String.fromCharCode(65 + i) }\n\n private get _titlePlaceholder() {\n return this.type === 'single' ? '单选题' : this.type === 'multiple' ? '多选题' : '排序题'\n }\n\n private _setCorrect(item: Answer, val: boolean) {\n if (this.type === 'single') {\n this._answers.forEach((a) => { a.isCorrect = false })\n item.isCorrect = val\n }\n else {\n item.isCorrect = val\n }\n this.requestUpdate()\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 // 双向绑定:通知外部更新\n if (this.useModel) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _onAnswerInput(e: Event, idx: number) {\n const el = e.target as HTMLInputElement\n if (el.value.length > this.ANSWER_MAX) { el.value = el.value.slice(0, this.ANSWER_MAX) }\n this._answers[idx].title = el.value\n this.requestUpdate()\n }\n\n private _addAnswer() {\n if (this.isSave) { return }\n this._answers = [...this._answers, { title: '', isCorrect: false, customAnswerId: uid() }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 3 || this.isSave) { return }\n this._answers = this._answers.filter((_, i) => i !== index)\n }\n\n private _toggleSortItem(letter: string) {\n const idx = this._orderList.indexOf(letter)\n if (idx >= 0) {\n this._orderList = this._orderList.filter(l => l !== letter)\n }\n else {\n this._orderList = [...this._orderList, letter]\n }\n this.requestUpdate()\n }\n\n private _removeSortItem(letter: string) {\n this._orderList = this._orderList.filter(l => l !== letter)\n this.requestUpdate()\n }\n\n private _getSortOrder(index: number): number | null {\n const pos = this._orderList.indexOf(this._label(index))\n return pos >= 0 ? pos + 1 : null\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this.customId || undefined, answerType: this.type, orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : (this as any).title || ''\n const answers = this.isEdit ? this._answers : this.answerList || []\n const answerCheckType = this.isEdit ? this._answerCheckType : this.answerCheckType || 1\n const leastAnswerCount = this.isEdit ? this._leastAnswerCount : this.leastAnswerCount || 2\n const analysis = this.isEdit ? this._analysis : this.analysis || ''\n const examExpand = this.isEdit\n ? this._orderList.map((l: string) => l.charCodeAt(0) - 65 + 1).join(',')\n : ((this as any).examExpand || '')\n const showRichText = this.isEdit ? this._showRichText : !!(this.richTextContent)\n const richText = this.isEdit ? this._richText : this.richTextContent || ''\n const orderList = this.isEdit\n ? this._orderList\n : (() => {\n const expand = (this as any).examExpand\n if (!expand) { return [] }\n return expand.split(',').map((id: string) => {\n const answer = (this.answerList as any[])?.find(a => a.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean)\n })()\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (!answerCheckType) {\n reject(new SubjectError('请选择答题设置', 'NO_ANSWER_CHECK_TYPE', 'answerCheckType', row))\n return\n }\n\n let msg = ''\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n\n if (this.type === 'multiple' || this.type === 'single') {\n answers.forEach((v: any, i: number) => {\n if (!v.title?.trim()) { msg += `选项${String.fromCharCode(65 + i)}未填写。` }\n if (v.isCorrect) { isSetCorrectAnswer = true; correctAnswerCount++ }\n })\n }\n else if (this.type === 'sort') {\n if (orderList.length) { isSetCorrectAnswer = true }\n if (isSetCorrectAnswer && orderList.length < leastAnswerCount) {\n reject(new SubjectError(`排序题至少需要设置${leastAnswerCount}项排序答案`, 'SORT_COUNT_INVALID', 'orderList', row))\n return\n }\n }\n\n if (msg) {\n reject(new SubjectError(msg, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n\n const uniqueAnswer = new Set(answers.map((a: any) => a.title))\n if (uniqueAnswer.size !== answers.length) {\n reject(new SubjectError('选项不能重复', 'DUPLICATE_ANSWERS', 'answers', row))\n return\n }\n\n if (this.type === 'multiple') {\n if (correctAnswerCount === 1) {\n reject(new SubjectError('请至少设置两个支持选项', 'CORRECT_COUNT_INVALID', 'answers', row))\n return\n }\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount) {\n reject(new SubjectError('至少选几项与支持选项数不符', 'LEAST_ANSWER_COUNT_INVALID', 'answers', row))\n return\n }\n }\n\n if (answerCheckType === 2 || answerCheckType === 3) {\n if (!isSetCorrectAnswer) {\n reject(new SubjectError('请设置支持选项', 'NO_CORRECT_ANSWER', 'answers', row))\n return\n }\n }\n\n const result: any = {\n answerType: String(this.type),\n title,\n answers: answers.filter((a: any) => a.title).map((a: any, i: number) => ({ ...a, orderIndex: i + 1 })),\n examExpand,\n analysis,\n isSetCorrectAnswer,\n leastAnswerCount,\n examRichTextContent: showRichText ? richText : '',\n examAnswerRelationType: this.examAnswerRelationType,\n isKey: this._isKey,\n answerCheckType,\n }\n if (this.customId) { result.customId = this.customId }\n resolve(result)\n })\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this.customId || undefined, answerType: this.type, orderIndex: this.orderIndex }\n\n const title = this.isEdit ? this._title : (this as any).title || ''\n const answers = this.isEdit ? this._answers : this.answerList || []\n const answerCheckType = this.isEdit ? this._answerCheckType : this.answerCheckType || 1\n const leastAnswerCount = this.isEdit ? this._leastAnswerCount : this.leastAnswerCount || 2\n const orderList = this.isEdit\n ? this._orderList\n : (() => {\n const expand = (this as any).examExpand\n if (!expand) { return [] }\n return expand.split(',').map((id: string) => {\n const answer = (this.answerList as any[])?.find(a => a.answerId?.toString() === id)\n return answer ? String.fromCharCode(65 + answer.orderIndex - 1) : id\n }).filter(Boolean)\n })()\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (!answerCheckType) {\n errors.push(new SubjectError('请选择答题设置', 'NO_ANSWER_CHECK_TYPE', 'answerCheckType', row))\n }\n\n let isSetCorrectAnswer = false\n let correctAnswerCount = 0\n\n if (this.type === 'multiple' || this.type === 'single') {\n answers.forEach((v: any, i: number) => {\n if (!v.title?.trim()) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n if (v.isCorrect) { isSetCorrectAnswer = true; correctAnswerCount++ }\n })\n }\n else if (this.type === 'sort') {\n if (orderList.length) { isSetCorrectAnswer = true }\n if (isSetCorrectAnswer && orderList.length < leastAnswerCount) {\n errors.push(new SubjectError(`排序题至少需要设置${leastAnswerCount}项排序答案`, 'SORT_COUNT_INVALID', 'orderList', row))\n }\n }\n\n const uniqueAnswer = new Set(answers.map((a: any) => a.title))\n if (uniqueAnswer.size !== answers.length && answers.length > 0) {\n errors.push(new SubjectError('选项不能重复', 'DUPLICATE_ANSWERS', 'answers', row))\n }\n\n if (this.type === 'multiple') {\n if (correctAnswerCount === 1 && answers.length > 0) {\n errors.push(new SubjectError('请至少设置两个支持选项', 'CORRECT_COUNT_INVALID', 'answers', row))\n }\n if (isSetCorrectAnswer && correctAnswerCount < leastAnswerCount) {\n errors.push(new SubjectError('至少选几项与支持选项数不符', 'LEAST_ANSWER_COUNT_INVALID', 'answers', row))\n }\n }\n\n if (answerCheckType === 2 || answerCheckType === 3) {\n if (!isSetCorrectAnswer) {\n errors.push(new SubjectError('请设置支持选项', 'NO_CORRECT_ANSWER', 'answers', row))\n }\n }\n\n return errors\n }\n\n private _openResultDialog(idx: number) {\n this._resultDialogIndex = idx\n this._resultDialogValue = this._answers[idx].resultItem || ''\n this._resultDialogOpen = true\n }\n\n private _saveResultDialog() {\n this._answers[this._resultDialogIndex].resultItem = this._resultDialogValue\n this._resultDialogOpen = false\n this.requestUpdate()\n }\n\n private _renderResultDialog() {\n if (!this._resultDialogOpen) { return '' }\n const letter = this._label(this._resultDialogIndex)\n return html`\n <div class=\"modal-backdrop\" @click=${() => { this._resultDialogOpen = false }}>\n <div class=\"modal\" @click=${(e: Event) => e.stopPropagation()}>\n <div class=\"modal-header\">\n <span class=\"modal-title\">编辑结果项 — 选项 ${letter}</span>\n <button class=\"modal-close\" @click=${() => { this._resultDialogOpen = false }}>✕</button>\n </div>\n <div class=\"modal-body\">\n <textarea rows=\"5\" .value=${this._resultDialogValue}\n @input=${(e: Event) => { this._resultDialogValue = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入该选项的结果项内容\"></textarea>\n </div>\n <div class=\"modal-footer\">\n <button @click=${() => { this._resultDialogOpen = false }}>取消</button>\n <button class=\"primary\" @click=${() => this._saveResultDialog()}>保存</button>\n </div>\n </div>\n </div>\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 private _renderPreview() {\n const typeSuffix = this.type === 'single'\n ? '(单选题)'\n : `(${this._titlePlaceholder}${this.leastAnswerCount ? `至少选${this.leastAnswerCount}项${this.type === 'sort' ? '并排序' : ''}` : ''})`\n const answers = this.answerList as Answer[]\n return html`\n <div class=\"preview\">\n <div><span class=\"title\">${this.orderIndex + 1}.${(this as any).title || ''}${typeSuffix}${this._isKey ? html`<span class=\"key-badge\">核心题</span>` : ''}</span></div>\n ${this.richTextContent ? html`<div class=\"rich-text\" .innerHTML=${this.richTextContent}></div>` : ''}\n <div class=\"preview-answer\">\n ${answers.map((a, i) => html`\n <label class=\"radio\">\n <input type=\"${this.type === 'sort' ? 'checkbox' : 'radio'}\" .checked=${!!a.isCorrect} disabled />\n <span class=\"order\">${this._label(i)}.</span> ${a.title}\n ${this.type !== 'sort' && a.isCorrect ? html`<span class=\"correct\">(支持选项)</span>` : ''}\n ${this.type !== 'sort' && this.examAnswerRelationType === 1 ? html`<span class=\"result-info\">${a.resultItem ? '(已设置结果项)' : '(未设置结果项)'}</span>` : ''}\n ${this.type !== 'sort' && this.examAnswerRelationType === 2 ? html`<span class=\"result-info\">${a.answerRelations?.length ? '(已设置关联)' : '(未设置关联)'}</span>` : ''}\n </label>\n `)}\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this.isSave}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【${this._titlePlaceholder}】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n ${['multiple', 'sort'].includes(this.type)\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>设置:</span></div>\n <select class=\"el-select\" .value=${String(this._leastAnswerCount)} ?disabled=${this.isSave}\n @change=${(e: Event) => { this._leastAnswerCount = Number((e.target as HTMLSelectElement).value) }}>\n ${Array.from({ length: Math.max(0, this._answers.length - 1) }, (_, i) => i + 2).map(n => html`\n <option value=${n} ?selected=${this._leastAnswerCount === n}>至少选择${n}项</option>\n `)}\n </select>\n </div>\n `\n : ''}\n\n <div class=\"answer-list\">\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${this._label(i)}.</span>\n <div class=\"input\">\n <input type=\"text\" .value=${a.title} ?disabled=${this.isSave}\n maxlength=${this.ANSWER_MAX}\n @input=${(e: Event) => this._onAnswerInput(e, i)}\n placeholder=\"选项${this._label(i)}\" />\n <span class=\"char-counter\">${a.title.length}/${this.ANSWER_MAX}</span>\n </div>\n\n ${this.type === 'sort' && this._getSortOrder(i) !== null\n ? html`<span class=\"sort-badge\">第${this._getSortOrder(i)}位</span>`\n : ''}\n\n ${['single', 'multiple'].includes(this.type)\n ? html`\n <label class=\"correct ${a.isCorrect ? 'is-correct' : ''}\">\n <input type=\"checkbox\" .checked=${a.isCorrect} ?disabled=${this.isSave}\n @change=${(e: Event) => this._setCorrect(a, (e.target as HTMLInputElement).checked)} />\n 支持选项\n </label>\n `\n : ''}\n\n <span class=\"icon ${this.isSave ? 'disabled' : ''}\"\n @click=${() => this._addAnswer()}>\n ${iconPlus}\n </span>\n <span class=\"icon ${this.isSave || this._answers.length < 3 ? 'disabled' : ''}\"\n @click=${() => this._deleteAnswer(i)}>\n ${iconRemove}\n </span>\n\n ${this.examAnswerRelationType === 1 && this.type !== 'sort'\n ? html`\n <span class=\"link\" @click=${() => this._openResultDialog(i)}>${a.resultItem ? '编辑结果' : '添加结果'}</span>\n `\n : ''}\n ${this.examAnswerRelationType === 2 && this.type !== 'sort'\n ? html`\n <span class=\"link\">关联检查</span>\n `\n : ''}\n </div>\n `)}\n </div>\n\n ${this.type === 'sort'\n ? html`\n <div class=\"flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>排序答案:</span></div>\n <div style=\"flex:1\">\n <div class=\"multi-select-wrapper\">\n <div class=\"multi-select ${this._sortDropdownOpen ? 'focused' : ''} ${this.isSave ? 'disabled' : ''}\"\n @click=${() => { if (!this.isSave) { this._sortDropdownOpen = !this._sortDropdownOpen; this.requestUpdate() } }}>\n ${this._orderList.length > 0\n ? this._orderList.map(l => html`\n <span class=\"tag\">\n ${l}\n <span class=\"tag-close\" @click=${(e: Event) => { e.stopPropagation(); this._removeSortItem(l) }}>✕</span>\n </span>\n `)\n : html`<span class=\"placeholder\">请按顺序选择排序答案</span>`\n }\n <span class=\"arrow\">${iconArrow}</span>\n </div>\n ${this._sortDropdownOpen\n ? html`\n <div class=\"multi-select-dropdown\">\n ${this._answers.map((_, i) => html`\n <div class=\"multi-select-option ${this._orderList.includes(this._label(i)) ? 'selected' : ''}\"\n @click=${() => { this._toggleSortItem(this._label(i)); this.requestUpdate() }}>\n ${this._label(i)}\n </div>\n `)}\n </div>\n `\n : ''}\n </div>\n </div>\n </div>\n `\n : ''}\n\n ${this._showRichText\n ? html`\n <div class=\"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 @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n <div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>\n </div>\n </div>\n `\n : ''}\n\n ${this.showAnalysis\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\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 `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout ?show-edit=${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 ?is-edit=${this.isEdit}\n ?is-set=${this.isSet}\n ?is-key=${this._isKey}\n ?show-other-option=${this.type === 'multiple' || this.type === 'single'}\n answer-check-type=${this._answerCheckType}\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._isKey = e.detail.value; this._emit('set-key', e.detail) }}\n @set-answer-setting=${(e: CustomEvent) => { this._answerCheckType = e.detail.value }}\n @on-show-rich-text=${() => { this._showRichText = true }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n ${this._renderResultDialog()}\n `\n }\n}\n\nexport function register() {}\n"],"names":["SubjectError","Error","constructor","message","code","arguments","length","undefined","field","row","super","this","name","from","options","iconPlus","html","iconRemove","iconArrow","QxsSubjectSingle","LitElement","orderIndex","isEdit","isSave","isSet","isKey","showAction","showAnalysis","type","answerCheckType","examAnswerRelationType","richTextContent","analysis","leastAnswerCount","examExpand","customId","examId","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","modelValue","useModel","_answers","title","isCorrect","_title","_analysis","_richText","_showRichText","_leastAnswerCount","_answerCheckType","_isKey","_orderList","_resultDialogOpen","_resultDialogIndex","_resultDialogValue","_sortDropdownOpen","TITLE_MAX","ANSWER_MAX","_handleDocumentClick","path","composedPath","wrapper","shadowRoot","querySelector","includes","requestUpdate","answerList","v","arr","Array","isArray","map","a","connectedCallback","document","addEventListener","_syncExternalProps","firstUpdated","disconnectedCallback","removeEventListener","willUpdate","changed","has","_syncProps","_syncExamExpand","ids","split","id","answer","find","answerId","toString","String","fromCharCode","filter","Boolean","_emit","detail","dispatchEvent","CustomEvent","bubbles","composed","_label","i","_titlePlaceholder","_setCorrect","item","val","forEach","_onTitleInput","el","value","slice","_onAnswerInput","idx","_addAnswer","customAnswerId","uid","_deleteAnswer","index","_","_toggleSortItem","letter","indexOf","l","_removeSortItem","_getSortOrder","pos","toJSON","answerType","answers","charCodeAt","join","showRichText","richText","orderList","expand","msg","isSetCorrectAnswer","correctAnswerCount","trim","Set","size","examRichTextContent","validate","errors","push","_openResultDialog","resultItem","_saveResultDialog","_renderResultDialog","stopPropagation","_save","stopImmediatePropagation","data","err","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","_renderPreview","typeSuffix","answerRelations","_renderEdit","Number","Math","max","n","checked","getContent","render","styles","css","__decorateClass","property","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"2lBAcO,MAAMA,UAAqBC,MAChCC,WAAAA,CACEC,GAIA,IAHOC,EAAAC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAe,mBACfG,yCACAC,EAAAJ,UAAAC,OAAA,EAAAD,kBAAAE,EAEPG,MAAMP,GAJCQ,KAAAP,KAAAA,EACAO,KAAAH,MAAAA,EACAG,KAAAF,IAAAA,EAGPE,KAAKC,KAAO,cACd,CAEA,WAAOC,CAAKC,GACV,OAAO,IAAId,EAAac,EAAQX,QAASW,EAAQV,KAAMU,EAAQN,MAAOM,EAAQL,IAChF,EAcF,MAAMM,EAAWC,CAAA,2NACXC,EAAaD,CAAA,qLACDA,CAAA,yNAClB,MAAME,EAAYF,CAAA,kLAgBX,IAAMG,EAAN,cAA+BC,EAA/BlB,WAAAA,GAAAQ,SAAAL,WAuJiDM,KAAAU,WAAa,EAChBV,KAAAW,QAAS,EACTX,KAAAY,QAAS,EACVZ,KAAAa,OAAQ,EACRb,KAAAc,OAAQ,EACHd,KAAAe,YAAa,EACXf,KAAAgB,cAAe,EACfhB,KAAAiB,KAAmB,SAChBjB,KAAAkB,gBAAkB,EACVlB,KAAAmB,uBAAyB,EACjCnB,KAAAoB,gBAAkB,GAClDpB,KAAAqB,SAAW,GACsBrB,KAAAsB,iBAAmB,EAC1BtB,KAAAuB,WAAa,GACfvB,KAAAwB,SAAW,GACbxB,KAAAyB,OAAS,EAC/BzB,KAAA0B,YAA+CC,SAClE,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC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