@qxs-bns/components-wc 0.0.13 → 0.0.14
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 +3 -3
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/subject/list.mjs +7 -7
- package/es/subject/list.mjs.map +1 -1
- package/es/subject/single.mjs +50 -50
- package/es/subject/single.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +2 -2
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/subject/list.cjs +2 -2
- package/lib/subject/list.cjs.map +1 -1
- package/lib/subject/single.cjs +3 -3
- package/lib/subject/single.cjs.map +1 -1
- package/package.json +1 -1
package/lib/subject/list.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.cjs","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 './rich-text'\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 @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._emit('change', this._list)\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 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, qxs-subject-rich-text',\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._emit('change', this._list)\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._emit('change', this._list)\n }\n\n uploadExcel(list: any[]) {\n this._list = [...this._list, ...list.map((i: any) => ({ ...i, customId: i.customId || uid(), isRealCanDel: true }))]\n this._emit('change', this._list)\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._emit('change', this._list)\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._emit('change', this._list)\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._emit('change', this._list)\n }\n\n private _deleteByCustomId(customId: string) {\n this._list = this._list.filter(item => item.customId !== customId)\n this._emit('change', this._list)\n }\n\n private _delete(index: number) {\n const arr = [...this._list]\n arr.splice(index, 1)\n this._list = arr\n this._emit('change', this._list)\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 type=${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-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","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_list","_sortMode","_sortable","_initialDataProcessed","subjectList","v","JSON","parse","requestUpdate","Array","isArray","map","i","customId","uid","attributeChangedCallback","name","oldVal","newVal","length","includes","parsed","_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","_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","examRichTextContent","leastAnswerCount","examExpand","examId","examAnswerSettingVO","render","styles","css","__decorateClass","property","attribute","prototype","Object","state","safeCustomElement"],"mappings":"oyBAqBGA,EAAAA,YAAYC,OAAiBD,EAAAA,YAAYE,SAAmBF,EAAAA,YAAYG,KACxEH,EAAAA,YAAYI,WAAqBJ,EAAAA,YAAYK,UAAoBL,EAAAA,YAAYM,MAInEC,QAAAA,eAAN,cAA6BC,EAAAA,WAA7BC,WAAAA,GAAAC,SAAAC,WA2BkCC,KAAAC,WAAY,EAGnDD,KAAAE,YAA+CC,SACtC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAkDhBf,KAAQgB,MAAe,GACvBhB,KAAQiB,WAAY,EAC7BjB,KAAQkB,UAA6B,KAOrClB,KAAQmB,uBAAwB,CAAA,CAtDhC,eAAIC,GAAgB,OAAOpB,KAAKgB,KAAM,CAEtC,eAAII,CAAYC,GACd,GAAKA,EAAL,CAIA,GAAiB,iBAANA,EACT,IACEA,EAAIC,KAAKC,MAAMF,EACjB,CAAA,MAIE,OAFArB,KAAKgB,MAAQ,QACbhB,KAAKwB,eAEP,CAEF,IAAKC,MAAMC,QAAQL,GAGjB,OAFArB,KAAKgB,MAAQ,QACbhB,KAAKwB,gBAGPxB,KAAKgB,MAAQK,EAAEM,IAAKC,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AAhBK,EAAAA,SAtFUjK,QAAAA,eAsFM+J,UAAA,YAAA,GAtFN/J,QAAAA,eAAN4J,EAAA,CADNM,EAAAA,kBAAkB,qBACNlK,QAAAA"}
|
|
1
|
+
{"version":3,"file":"list.cjs","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 @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._emit('change', this._list)\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 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._emit('change', this._list)\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._emit('change', this._list)\n }\n\n uploadExcel(list: any[]) {\n this._list = [...this._list, ...list.map((i: any) => ({ ...i, customId: i.customId || uid(), isRealCanDel: true }))]\n this._emit('change', this._list)\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._emit('change', this._list)\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._emit('change', this._list)\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._emit('change', this._list)\n }\n\n private _deleteByCustomId(customId: string) {\n this._list = this._list.filter(item => item.customId !== customId)\n this._emit('change', this._list)\n }\n\n private _delete(index: number) {\n const arr = [...this._list]\n arr.splice(index, 1)\n this._list = arr\n this._emit('change', this._list)\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-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","uploadImage","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_list","_sortMode","_sortable","_initialDataProcessed","subjectList","v","JSON","parse","requestUpdate","Array","isArray","map","i","customId","uid","attributeChangedCallback","name","oldVal","newVal","length","includes","parsed","_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","_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","examAnswerSettingVO","render","styles","css","__decorateClass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;0BACZ9B,EAAKgC,mBAAqB;uBAC7BpG,KAAKE;sBACNsI;mBACHpE,EAAKiC,kBAAkBjC,EAAKoC,oBAAoBpC,EAAKmC,8BAA8BvG,KAAKsC;oCACvE8B,EAAK0B,wBAA0B;4BACvC1B,EAAK4E,qBAAuB;mBACrC5E,EAAK+B,UAAY;oBAChB/B,EAAKvC,UAAY;gBACrB4G,aAAkBC,WAAkBC,WAAgBC,UAAeC;qBAGxEC,EAAAA,IAAA,gDAAoD1E,EAAK4B,kBAClE,CAEAqD,MAAAA,GACE,OAAOP,EAAAA,IAAA;;UAED9I,KAAKgB,MAAMW,IAAI,CAACyC,EAAMyB,IAAU7F,KAAKuI,YAAYnE,EAAMyB;;KAG/D,GA5bWlG,QAAAA,eACJ2J,OAASC,EAAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;KA0BuBC,EAAA,CAAtCC,EAAAA,SAAS,CAAEC,UAAW,gBA3BZ/J,QAAAA,eA2B4BgK,UAAA,YAAA,GAGvCH,EAAA,CADCC,EAAAA,SAAS,CAAE7D,KAAMgE,UA7BPjK,QAAAA,eA8BXgK,UAAA,cAAA,GAUIH,EAAA,CADHC,EAAAA,SAAS,CAAE7D,KAAMnE,SAvCP9B,QAAAA,eAwCPgK,UAAA,cAAA,GA6CaH,EAAA,CAAhBK,EAAAA,SArFUlK,QAAAA,eAqFMgK,UAAA,QAAA,GACAH,EAAA,CAAhBK,EAAAA,SAtFUlK,QAAAA,eAsFMgK,UAAA,YAAA,GAtFNhK,QAAAA,eAAN6J,EAAA,CADNM,EAAAA,kBAAkB,qBACNnK,QAAAA"}
|
package/lib/subject/single.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("lit"),t=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),s=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),i=require("../base/define.cjs"),r=require("../base/uid.cjs"),o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(e,t,s,i)=>{for(var r,l=i>1?void 0:i?n(t,s):t,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(i?r(t,s,l):r(l))||l);return i&&l&&o(t,s,l),l};class a extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"VALIDATION_ERROR",s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;super(e),this.code=t,this.field=s,this.row=i,this.name="SubjectError"}static from(e){return new a(e.message,e.code,e.field,e.row)}}const p=e.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>`,d=e.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>`;e.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>`;const c=e.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>`;exports.QxsSubjectSingle=class extends e.LitElement{constructor(){super(...arguments),this.orderIndex=0,this.isEdit=!1,this.isSave=!1,this.isSet=!1,this.isKey=!1,this.showAction=!0,this.showAnalysis=!0,this.type="single",this.answerCheckType=1,this.examAnswerRelationType=0,this.richTextContent="",this.analysis="",this.leastAnswerCount=2,this.examExpand="",this.customId="",this.examId=0,this.uploadImage=async e=>new Promise((t,s)=>{const i=new FileReader;i.onload=e=>t(e.target?.result),i.onerror=s,i.readAsDataURL(e)}),this.modelValue="",this.useModel=!1,this._answers=[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this._title="",this._analysis="",this._richText="",this._showRichText=!1,this._leastAnswerCount=2,this._answerCheckType=1,this._orderList=[],this._resultDialogOpen=!1,this._resultDialogIndex=0,this._resultDialogValue="",this._sortDropdownOpen=!1,this.TITLE_MAX=200,this.ANSWER_MAX=100,this._handleDocumentClick=e=>{const t=e.composedPath(),s=this.shadowRoot?.querySelector(".multi-select-wrapper");s&&!t.includes(s)&&(this._sortDropdownOpen=!1,this.requestUpdate())}}get answerList(){return this._answers}set answerList(e){const t=Array.isArray(e)?e:[];this._answers=t.length?t.map(e=>({...e})):[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.requestUpdate("answerList")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick)}willUpdate(e){e.has("isEdit")&&this.isEdit&&this._syncProps(),(e.has("examExpand")||e.has("answerList"))&&this._syncExamExpand(),e.has("modelValue")&&this.useModel&&(this._title=this.modelValue)}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=this.leastAnswerCount||2,this._answerCheckType=this.answerCheckType||1,this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0),this.answerList?.length&&(this._answers=this.answerList.map(e=>({...e,title:e.title||"",isCorrect:!!e.isCorrect}))),this._syncExamExpand()}_syncExamExpand(){if(!this.examExpand||!this.answerList?.length)return;const e=this.examExpand.split(",");this._orderList=e.map(e=>{const t=this.answerList.find(t=>t.answerId?.toString()===e);return t?String.fromCharCode(65+t.orderIndex-1):e}).filter(Boolean)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}_label(e){return String.fromCharCode(65+e)}get _titlePlaceholder(){return"single"===this.type?"单选题":"multiple"===this.type?"多选题":"排序题"}_setCorrect(e,t){"single"===this.type?(this._answers.forEach(e=>{e.isCorrect=!1}),e.isCorrect=t):e.isCorrect=t,this.requestUpdate()}_onTitleInput(e){const t=e.target;t.value.length>this.TITLE_MAX&&(t.value=t.value.slice(0,this.TITLE_MAX)),this._title=t.value,this.useModel&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_onAnswerInput(e,t){const s=e.target;s.value.length>this.ANSWER_MAX&&(s.value=s.value.slice(0,this.ANSWER_MAX)),this._answers[t].title=s.value,this.requestUpdate()}_addAnswer(){this.isSave||(this._answers=[...this._answers,{title:"",isCorrect:!1,customAnswerId:r.uid()}])}_deleteAnswer(e){this._answers.length<3||this.isSave||(this._answers=this._answers.filter((t,s)=>s!==e))}_toggleSortItem(e){const t=this._orderList.indexOf(e);this._orderList=t>=0?this._orderList.filter(t=>t!==e):[...this._orderList,e],this.requestUpdate()}_removeSortItem(e){this._orderList=this._orderList.filter(t=>t!==e),this.requestUpdate()}_getSortOrder(e){const t=this._orderList.indexOf(this._label(e));return t>=0?t+1:null}async toJSON(){return new Promise((e,t)=>{const s={customId:this.customId||void 0,answerType:this.type,orderIndex:this.orderIndex},i=this.isEdit?this._title:this.title||"",r=this.isEdit?this._answers:this.answerList||[],o=this.isEdit?this._answerCheckType:this.answerCheckType||1,n=this.isEdit?this._leastAnswerCount:this.leastAnswerCount||2,l=this.isEdit?this._analysis:this.analysis||"",p=this.isEdit?this._orderList.map(e=>e.charCodeAt(0)-65+1).join(","):this.examExpand||"",d=this.isEdit?this._showRichText:!!this.richTextContent,c=this.isEdit?this._richText:this.richTextContent||"",h=this.isEdit?this._orderList:(()=>{const e=this.examExpand;return e?e.split(",").map(e=>{const t=this.answerList?.find(t=>t.answerId?.toString()===e);return t?String.fromCharCode(65+t.orderIndex-1):e}).filter(Boolean):[]})();if(!i)return void t(new a("题目标题不能为空!","EMPTY_TITLE","title",s));if(!o)return void t(new a("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",s));let u="",x=!1,m=0;if("multiple"===this.type||"single"===this.type)r.forEach((e,t)=>{e.title?.trim()||(u+=`选项${String.fromCharCode(65+t)}未填写。`),e.isCorrect&&(x=!0,m++)});else if("sort"===this.type&&(h.length&&(x=!0),x&&h.length<n))return void t(new a(`排序题至少需要设置${n}项排序答案`,"SORT_COUNT_INVALID","orderList",s));if(u)return void t(new a(u,"ANSWER_EMPTY","answers",s));if(new Set(r.map(e=>e.title)).size!==r.length)return void t(new a("选项不能重复","DUPLICATE_ANSWERS","answers",s));if("multiple"===this.type){if(1===m)return void t(new a("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",s));if(x&&m<n)return void t(new a("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",s))}if((2===o||3===o)&&!x)return void t(new a("请设置支持选项","NO_CORRECT_ANSWER","answers",s));const g={answerType:this.type,title:i,answers:r.filter(e=>e.title).map((e,t)=>({...e,orderIndex:t+1})),examExpand:p,analysis:l,isSetCorrectAnswer:x,leastAnswerCount:n,examRichTextContent:d?c:"",examAnswerRelationType:this.examAnswerRelationType,isKey:this.isKey,answerCheckType:o};this.customId&&(g.customId=this.customId),e(g)})}validate(){const e=[],t={customId:this.customId||void 0,answerType:this.type,orderIndex:this.orderIndex},s=this.isEdit?this._title:this.title||"",i=this.isEdit?this._answers:this.answerList||[],r=this.isEdit?this._answerCheckType:this.answerCheckType||1,o=this.isEdit?this._leastAnswerCount:this.leastAnswerCount||2,n=this.isEdit?this._orderList:(()=>{const e=this.examExpand;return e?e.split(",").map(e=>{const t=this.answerList?.find(t=>t.answerId?.toString()===e);return t?String.fromCharCode(65+t.orderIndex-1):e}).filter(Boolean):[]})();s||e.push(new a("题目标题不能为空!","EMPTY_TITLE","title",t)),r||e.push(new a("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",t));let l=!1,p=0;"multiple"===this.type||"single"===this.type?i.forEach((s,i)=>{s.title?.trim()||e.push(new a(`选项${String.fromCharCode(65+i)}未填写`,"ANSWER_EMPTY","answers",t)),s.isCorrect&&(l=!0,p++)}):"sort"===this.type&&(n.length&&(l=!0),l&&n.length<o&&e.push(new a(`排序题至少需要设置${o}项排序答案`,"SORT_COUNT_INVALID","orderList",t)));return new Set(i.map(e=>e.title)).size!==i.length&&i.length>0&&e.push(new a("选项不能重复","DUPLICATE_ANSWERS","answers",t)),"multiple"===this.type&&(1===p&&i.length>0&&e.push(new a("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",t)),l&&p<o&&e.push(new a("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",t))),2!==r&&3!==r||l||e.push(new a("请设置支持选项","NO_CORRECT_ANSWER","answers",t)),e}_openResultDialog(e){this._resultDialogIndex=e,this._resultDialogValue=this._answers[e].resultItem||"",this._resultDialogOpen=!0}_saveResultDialog(){this._answers[this._resultDialogIndex].resultItem=this._resultDialogValue,this._resultDialogOpen=!1,this.requestUpdate()}_renderResultDialog(){if(!this._resultDialogOpen)return"";const t=this._label(this._resultDialogIndex);return e.html`
|
|
1
|
+
"use strict";var e=require("lit"),t=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.cjs"),s=require("../node_modules/.pnpm/@lit_reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.cjs"),i=require("../base/define.cjs"),r=require("../base/uid.cjs"),o=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(e,t,s,i)=>{for(var r,l=i>1?void 0:i?n(t,s):t,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(i?r(t,s,l):r(l))||l);return i&&l&&o(t,s,l),l};class a extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"VALIDATION_ERROR",s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;super(e),this.code=t,this.field=s,this.row=i,this.name="SubjectError"}static from(e){return new a(e.message,e.code,e.field,e.row)}}const p=e.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>`,h=e.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>`;e.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>`;const c=e.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>`;exports.QxsSubjectSingle=class extends e.LitElement{constructor(){super(...arguments),this.orderIndex=0,this.isEdit=!1,this.isSave=!1,this.isSet=!1,this.isKey=!1,this.showAction=!0,this.showAnalysis=!0,this.type="single",this.answerCheckType=1,this.examAnswerRelationType=0,this.richTextContent="",this.analysis="",this.leastAnswerCount=2,this.examExpand="",this.customId="",this.examId=0,this.uploadImage=async e=>new Promise((t,s)=>{const i=new FileReader;i.onload=e=>t(e.target?.result),i.onerror=s,i.readAsDataURL(e)}),this.modelValue="",this.useModel=!1,this._answers=[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.title="",this._title="",this._analysis="",this._richText="",this._showRichText=!1,this._leastAnswerCount=2,this._answerCheckType=1,this._orderList=[],this._resultDialogOpen=!1,this._resultDialogIndex=0,this._resultDialogValue="",this._sortDropdownOpen=!1,this.TITLE_MAX=200,this.ANSWER_MAX=100,this._handleDocumentClick=e=>{const t=e.composedPath(),s=this.shadowRoot?.querySelector(".multi-select-wrapper");s&&!t.includes(s)&&(this._sortDropdownOpen=!1,this.requestUpdate())}}get answerList(){return this._answers}set answerList(e){const t=Array.isArray(e)?e:[];this._answers=t.length?t.map(e=>({...e})):[{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1},{title:"",isCorrect:!1}],this.requestUpdate("answerList")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleDocumentClick),this._syncExternalProps(),this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0)}firstUpdated(){this._syncExternalProps(),this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleDocumentClick)}willUpdate(e){e.has("isEdit")&&this.isEdit&&this._syncProps(),(e.has("title")||e.has("answerList")||e.has("analysis")||e.has("leastAnswerCount")||e.has("answerCheckType"))&&this._syncExternalProps(),(e.has("examExpand")||e.has("answerList"))&&this._syncExamExpand(),e.has("modelValue")&&this.useModel&&(this._title=this.modelValue)}_syncExternalProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=this.leastAnswerCount||2,this._answerCheckType=this.answerCheckType||1,this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0),this.answerList?.length&&(this._answers=this.answerList.map(e=>({...e,title:e.title||"",isCorrect:!!e.isCorrect})))}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._leastAnswerCount=this.leastAnswerCount||2,this._answerCheckType=this.answerCheckType||1,this.richTextContent&&(this._richText=this.richTextContent,this._showRichText=!0),this.answerList?.length&&(this._answers=this.answerList.map(e=>({...e,title:e.title||"",isCorrect:!!e.isCorrect}))),this._syncExamExpand()}_syncExamExpand(){if(!this.examExpand||!this.answerList?.length)return;const e=this.examExpand.split(",");this._orderList=e.map(e=>{const t=this.answerList.find(t=>t.answerId?.toString()===e);return t?String.fromCharCode(65+t.orderIndex-1):e}).filter(Boolean)}_emit(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t??null}))}_label(e){return String.fromCharCode(65+e)}get _titlePlaceholder(){return"single"===this.type?"单选题":"multiple"===this.type?"多选题":"排序题"}_setCorrect(e,t){"single"===this.type?(this._answers.forEach(e=>{e.isCorrect=!1}),e.isCorrect=t):e.isCorrect=t,this.requestUpdate()}_onTitleInput(e){const t=e.target;t.value.length>this.TITLE_MAX&&(t.value=t.value.slice(0,this.TITLE_MAX)),this._title=t.value,this.useModel&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_onAnswerInput(e,t){const s=e.target;s.value.length>this.ANSWER_MAX&&(s.value=s.value.slice(0,this.ANSWER_MAX)),this._answers[t].title=s.value,this.requestUpdate()}_addAnswer(){this.isSave||(this._answers=[...this._answers,{title:"",isCorrect:!1,customAnswerId:r.uid()}])}_deleteAnswer(e){this._answers.length<3||this.isSave||(this._answers=this._answers.filter((t,s)=>s!==e))}_toggleSortItem(e){const t=this._orderList.indexOf(e);this._orderList=t>=0?this._orderList.filter(t=>t!==e):[...this._orderList,e],this.requestUpdate()}_removeSortItem(e){this._orderList=this._orderList.filter(t=>t!==e),this.requestUpdate()}_getSortOrder(e){const t=this._orderList.indexOf(this._label(e));return t>=0?t+1:null}async toJSON(){return new Promise((e,t)=>{const s={customId:this.customId||void 0,answerType:this.type,orderIndex:this.orderIndex},i=this.isEdit?this._title:this.title||"",r=this.isEdit?this._answers:this.answerList||[],o=this.isEdit?this._answerCheckType:this.answerCheckType||1,n=this.isEdit?this._leastAnswerCount:this.leastAnswerCount||2,l=this.isEdit?this._analysis:this.analysis||"",p=this.isEdit?this._orderList.map(e=>e.charCodeAt(0)-65+1).join(","):this.examExpand||"",h=this.isEdit?this._showRichText:!!this.richTextContent,c=this.isEdit?this._richText:this.richTextContent||"",d=this.isEdit?this._orderList:(()=>{const e=this.examExpand;return e?e.split(",").map(e=>{const t=this.answerList?.find(t=>t.answerId?.toString()===e);return t?String.fromCharCode(65+t.orderIndex-1):e}).filter(Boolean):[]})();if(!i)return void t(new a("题目标题不能为空!","EMPTY_TITLE","title",s));if(!o)return void t(new a("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",s));let u="",x=!1,m=0;if("multiple"===this.type||"single"===this.type)r.forEach((e,t)=>{e.title?.trim()||(u+=`选项${String.fromCharCode(65+t)}未填写。`),e.isCorrect&&(x=!0,m++)});else if("sort"===this.type&&(d.length&&(x=!0),x&&d.length<n))return void t(new a(`排序题至少需要设置${n}项排序答案`,"SORT_COUNT_INVALID","orderList",s));if(u)return void t(new a(u,"ANSWER_EMPTY","answers",s));if(new Set(r.map(e=>e.title)).size!==r.length)return void t(new a("选项不能重复","DUPLICATE_ANSWERS","answers",s));if("multiple"===this.type){if(1===m)return void t(new a("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",s));if(x&&m<n)return void t(new a("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",s))}if((2===o||3===o)&&!x)return void t(new a("请设置支持选项","NO_CORRECT_ANSWER","answers",s));const w={answerType:String(this.type),title:i,answers:r.filter(e=>e.title).map((e,t)=>({...e,orderIndex:t+1})),examExpand:p,analysis:l,isSetCorrectAnswer:x,leastAnswerCount:n,examRichTextContent:h?c:"",examAnswerRelationType:this.examAnswerRelationType,isKey:this.isKey,answerCheckType:o};this.customId&&(w.customId=this.customId),e(w)})}validate(){const e=[],t={customId:this.customId||void 0,answerType:this.type,orderIndex:this.orderIndex},s=this.isEdit?this._title:this.title||"",i=this.isEdit?this._answers:this.answerList||[],r=this.isEdit?this._answerCheckType:this.answerCheckType||1,o=this.isEdit?this._leastAnswerCount:this.leastAnswerCount||2,n=this.isEdit?this._orderList:(()=>{const e=this.examExpand;return e?e.split(",").map(e=>{const t=this.answerList?.find(t=>t.answerId?.toString()===e);return t?String.fromCharCode(65+t.orderIndex-1):e}).filter(Boolean):[]})();s||e.push(new a("题目标题不能为空!","EMPTY_TITLE","title",t)),r||e.push(new a("请选择答题设置","NO_ANSWER_CHECK_TYPE","answerCheckType",t));let l=!1,p=0;"multiple"===this.type||"single"===this.type?i.forEach((s,i)=>{s.title?.trim()||e.push(new a(`选项${String.fromCharCode(65+i)}未填写`,"ANSWER_EMPTY","answers",t)),s.isCorrect&&(l=!0,p++)}):"sort"===this.type&&(n.length&&(l=!0),l&&n.length<o&&e.push(new a(`排序题至少需要设置${o}项排序答案`,"SORT_COUNT_INVALID","orderList",t)));return new Set(i.map(e=>e.title)).size!==i.length&&i.length>0&&e.push(new a("选项不能重复","DUPLICATE_ANSWERS","answers",t)),"multiple"===this.type&&(1===p&&i.length>0&&e.push(new a("请至少设置两个支持选项","CORRECT_COUNT_INVALID","answers",t)),l&&p<o&&e.push(new a("至少选几项与支持选项数不符","LEAST_ANSWER_COUNT_INVALID","answers",t))),2!==r&&3!==r||l||e.push(new a("请设置支持选项","NO_CORRECT_ANSWER","answers",t)),e}_openResultDialog(e){this._resultDialogIndex=e,this._resultDialogValue=this._answers[e].resultItem||"",this._resultDialogOpen=!0}_saveResultDialog(){this._answers[this._resultDialogIndex].resultItem=this._resultDialogValue,this._resultDialogOpen=!1,this.requestUpdate()}_renderResultDialog(){if(!this._resultDialogOpen)return"";const t=this._label(this._resultDialogIndex);return e.html`
|
|
2
2
|
<div class="modal-backdrop" @click=${()=>{this._resultDialogOpen=!1}}>
|
|
3
3
|
<div class="modal" @click=${e=>e.stopPropagation()}>
|
|
4
4
|
<div class="modal-header">
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</span>
|
|
87
87
|
<span class="icon ${this.isSave||this._answers.length<3?"disabled":""}"
|
|
88
88
|
@click=${()=>this._deleteAnswer(s)}>
|
|
89
|
-
${
|
|
89
|
+
${h}
|
|
90
90
|
</span>
|
|
91
91
|
|
|
92
92
|
${1===this.examAnswerRelationType&&"sort"!==this.type?e.html`
|
|
@@ -315,5 +315,5 @@
|
|
|
315
315
|
.modal-footer button:hover { color: #3D61E3; border-color: #a0cfff; }
|
|
316
316
|
.modal-footer button.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }
|
|
317
317
|
.modal-footer button.primary:hover { background: #2D4CB8; border-color: #2D4CB8; }
|
|
318
|
-
`,l([t.property({type:Number,attribute:"order-index"})],exports.QxsSubjectSingle.prototype,"orderIndex",2),l([t.property({type:Boolean,attribute:"is-edit"})],exports.QxsSubjectSingle.prototype,"isEdit",2),l([t.property({type:Boolean,attribute:"is-save"})],exports.QxsSubjectSingle.prototype,"isSave",2),l([t.property({type:Boolean,attribute:"is-set"})],exports.QxsSubjectSingle.prototype,"isSet",2),l([t.property({type:Boolean,attribute:"is-key"})],exports.QxsSubjectSingle.prototype,"isKey",2),l([t.property({type:Boolean,attribute:"show-action"})],exports.QxsSubjectSingle.prototype,"showAction",2),l([t.property({type:Boolean,attribute:"show-analysis"})],exports.QxsSubjectSingle.prototype,"showAnalysis",2),l([t.property({type
|
|
318
|
+
`,l([t.property({type:Number,attribute:"order-index"})],exports.QxsSubjectSingle.prototype,"orderIndex",2),l([t.property({type:Boolean,attribute:"is-edit"})],exports.QxsSubjectSingle.prototype,"isEdit",2),l([t.property({type:Boolean,attribute:"is-save"})],exports.QxsSubjectSingle.prototype,"isSave",2),l([t.property({type:Boolean,attribute:"is-set"})],exports.QxsSubjectSingle.prototype,"isSet",2),l([t.property({type:Boolean,attribute:"is-key"})],exports.QxsSubjectSingle.prototype,"isKey",2),l([t.property({type:Boolean,attribute:"show-action"})],exports.QxsSubjectSingle.prototype,"showAction",2),l([t.property({type:Boolean,attribute:"show-analysis"})],exports.QxsSubjectSingle.prototype,"showAnalysis",2),l([t.property({attribute:"question-type",reflect:!0})],exports.QxsSubjectSingle.prototype,"type",2),l([t.property({type:Number,attribute:"answer-check-type"})],exports.QxsSubjectSingle.prototype,"answerCheckType",2),l([t.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsSubjectSingle.prototype,"examAnswerRelationType",2),l([t.property({type:String,attribute:"rich-text-content"})],exports.QxsSubjectSingle.prototype,"richTextContent",2),l([t.property({type:String})],exports.QxsSubjectSingle.prototype,"analysis",2),l([t.property({type:Number,attribute:"least-answer-count"})],exports.QxsSubjectSingle.prototype,"leastAnswerCount",2),l([t.property({type:String,attribute:"exam-expand"})],exports.QxsSubjectSingle.prototype,"examExpand",2),l([t.property({type:String,attribute:"custom-id"})],exports.QxsSubjectSingle.prototype,"customId",2),l([t.property({type:Number,attribute:"exam-id"})],exports.QxsSubjectSingle.prototype,"examId",2),l([t.property({type:Object})],exports.QxsSubjectSingle.prototype,"uploadImage",2),l([t.property({type:Array,attribute:"answer-list"})],exports.QxsSubjectSingle.prototype,"answerList",1),l([t.property({type:String,attribute:"model-value"})],exports.QxsSubjectSingle.prototype,"modelValue",2),l([t.property({type:Boolean,attribute:"use-model"})],exports.QxsSubjectSingle.prototype,"useModel",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_answers",2),l([t.property({type:String})],exports.QxsSubjectSingle.prototype,"title",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_title",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_analysis",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_richText",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_showRichText",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_leastAnswerCount",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_answerCheckType",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_orderList",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_resultDialogOpen",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_resultDialogIndex",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_resultDialogValue",2),l([s.state()],exports.QxsSubjectSingle.prototype,"_sortDropdownOpen",2),exports.QxsSubjectSingle=l([i.safeCustomElement("qxs-subject-single")],exports.QxsSubjectSingle),exports.SubjectError=a;
|
|
319
319
|
//# sourceMappingURL=single.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.cjs","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 .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({ type: String }) 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 @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 _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 }\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('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 _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 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 const result: any = {\n answerType: 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}</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'}\" 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._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","_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","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","state","safeCustomElement"],"mappings":"4gBAcO,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,EAAAA,IAAA,2NACXC,EAAaD,EAAAA,IAAA,qLACDA,EAAAA,IAAA,yNAClB,MAAME,EAAYF,EAAAA,IAAA,kLAgBLG,QAAAA,iBAAN,cAA+BC,EAAAA,WAA/BlB,WAAAA,GAAAQ,SAAAL,WA6IiDM,KAAAU,WAAa,EAChBV,KAAAW,QAAS,EACTX,KAAAY,QAAS,EACVZ,KAAAa,OAAQ,EACRb,KAAAc,OAAQ,EACHd,KAAAe,YAAa,EACXf,KAAAgB,cAAe,EAC5ChB,KAAAiB,KAAmB,SACajB,KAAAkB,gBAAkB,EACVlB,KAAAmB,uBAAyB,EACjCnB,KAAAoB,gBAAkB,GAClDpB,KAAAqB,SAAW,GACsBrB,KAAAsB,iBAAmB,EAC1BtB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EAAAA,SAhMU1L,QAAAA,iBAgMMyL,UAAA,gBAAA,GACAH,EAAA,CAAhBI,EAAAA,SAjMU1L,QAAAA,iBAiMMyL,UAAA,oBAAA,GACAH,EAAA,CAAhBI,EAAAA,SAlMU1L,QAAAA,iBAkMMyL,UAAA,mBAAA,GACAH,EAAA,CAAhBI,EAAAA,SAnMU1L,QAAAA,iBAmMMyL,UAAA,aAAA,GACAH,EAAA,CAAhBI,EAAAA,SApMU1L,QAAAA,iBAoMMyL,UAAA,oBAAA,GACAH,EAAA,CAAhBI,EAAAA,SArMU1L,QAAAA,iBAqMMyL,UAAA,qBAAA,GACAH,EAAA,CAAhBI,EAAAA,SAtMU1L,QAAAA,iBAsMMyL,UAAA,qBAAA,GACAH,EAAA,CAAhBI,EAAAA,SAvMU1L,QAAAA,iBAuMMyL,UAAA,oBAAA,GAvMNzL,QAAAA,iBAANsL,EAAA,CADNK,EAAAA,kBAAkB,uBACN3L,QAAAA"}
|
|
1
|
+
{"version":3,"file":"single.cjs","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 .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 _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')) {\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 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 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}</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'}\" 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._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","_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":"4gBAcO,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,EAAAA,IAAA,2NACXC,EAAaD,EAAAA,IAAA,qLACDA,EAAAA,IAAA,yNAClB,MAAME,EAAYF,EAAAA,IAAA,kLAgBLG,QAAAA,iBAAN,cAA+BC,EAAAA,WAA/BlB,WAAAA,GAAAQ,SAAAL,WA6IiDM,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,KAA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CAAhBK,EAAAA,SAtMU7L,QAAAA,iBAsMM2L,UAAA,oBAAA,GACAH,EAAA,CAAhBK,EAAAA,SAvMU7L,QAAAA,iBAuMM2L,UAAA,qBAAA,GACAH,EAAA,CAAhBK,EAAAA,SAxMU7L,QAAAA,iBAwMM2L,UAAA,qBAAA,GACAH,EAAA,CAAhBK,EAAAA,SAzMU7L,QAAAA,iBAyMM2L,UAAA,oBAAA,GAzMN3L,QAAAA,iBAANwL,EAAA,CADNM,EAAAA,kBAAkB,uBACN9L,QAAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qxs-bns/components-wc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.14",
|
|
5
5
|
"description": "QXS Business Components - Web Components (framework agnostic)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://qxs-bns.pages.dev/guide/components-wc/",
|