@qxs-bns/components-wc 0.0.29 → 0.0.30

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.
@@ -1 +1 @@
1
- {"version":3,"file":"blank-fill.cjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem, trimCommaSeparatedText, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface BlankAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n}\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = [sortingCardStyles, 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 .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .el-select:focus { border-color: #3D61E3; outline: none; }\n .el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `]\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'is-key' }) 'is-key' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'hide-add-rich-text' }) 'hide-add-rich-text' = false\n @property({ type: Boolean, attribute: 'show-rich-text' }) 'show-rich-text' = false\n @property({ type: Boolean, attribute: 'show-delete-action' }) 'show-delete-action' = true\n @property({ type: Boolean, attribute: 'show-save-action' }) 'show-save-action' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = false\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('exam-answer-setting') || changed.has('rich-text-content') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value'].replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return trimCommaSeparatedText(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this['answer-list'].map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n tag: '',\n showInput: false,\n answerId: a?.answerId ?? a?.examAnswerId,\n }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this['exam-answer-setting']) {\n this._isInOrder = !!this['exam-answer-setting'].isInOrder\n this._isIgnoreCase = !!this['exam-answer-setting'].isIgnoreCase\n }\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n private _emitModelUpdate() {\n if (this['use-model']) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (!tag) { return }\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) {\n tags.splice(idx, 1)\n item.title = tags.join(',')\n }\n this.requestUpdate()\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit']\n ? this._answers\n : (this['answer-list'] || []).map((answer: any) => ({\n ...answer,\n title: this._normalizeAnswerTitle(answer),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }))\n const analysis = trimText(this['is-edit'] ? this._analysis : this.analysis || '')\n const isInOrder = this['is-edit'] ? this._isInOrder : this['exam-answer-setting']?.isInOrder ?? false\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : this['exam-answer-setting']?.isIgnoreCase ?? true\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const filledAnswers = answers.filter((answer: any) => this._normalizeAnswerTitle(answer))\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n examTypeEnum: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: filledAnswers.map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n isCorrect: true,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: filledAnswers.length > 0,\n isKey: this['is-key'],\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examAnswerSettingVO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${displayTitle}(填空题)</span>\n ${this['show-rich-text'] && this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`<span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>`\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = `${this['order-index'] + 1}. ${title}`\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.BLANK_FILL] || SubjectType.BLANK_FILL)\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【填空题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex flex-justify-end\">\n <span class=\"el-link\" @click=${() => this._addBlank()}>插入填空符</span>\n </div>\n\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n <span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>\n </span>\n `)}\n ${html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `}\n </div>\n </div>\n `)}\n\n ${this['show-rich-text'] && this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>副文本:</span></div>\n <div style=\"flex:1\">\n <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\n ${!this['show-action']\n ? html`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this['show-rich-text'] && this._showRichText}\n .hide-add-rich-text=${!this['show-rich-text'] || this['hide-add-rich-text']}\n .show-delete-action=${this['show-delete-action']}\n .show-save-action=${this['show-save-action']}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n <slot name=\"action\"></slot>\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","title","sorting","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","trimCommaSeparatedText","length","a","answerId","examAnswerId","blankCount","match","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","modelValue","_handleAddTag","join","_closeTag","tags","split","idx","findIndex","t","splice","_onCategoryChange","customId","examId","_imageResources","filter","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","toJSON","row","answerType","orderIndex","trimText","answers","showRichText","richText","filledAnswers","SubjectError","SubjectType","BLANK_FILL","examTypeEnum","index","next","isCorrect","isSetCorrectAnswer","isKey","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","some","_renderResourceSection","_renderCategorySection","images","video","src","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","getContent","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gXAcA,MAAMA,EAAWC,EAAAA,IAAA;;;;UAoBJC,QAAAA,aAAN,cAA2BC,EAAAA,WAA3BC,WAAAA,GAAAC,SAAAC,WA2GiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACHA,KAAA,uBAAuB,EAC3BA,KAAA,mBAAmB,EACfA,KAAA,uBAAuB,EACzBA,KAAA,qBAAqB,EACrCA,KAAAE,SAAU,EACSF,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,qBAAsB,GACtDA,KAAAG,SAAW,GAC6BH,KAAA,6BAA8B,EAC5CA,KAAA,eAAgB,GACpBA,KAAA,WAAY,EACRA,KAAA,eAAgB,GAEtEA,KAAA,uBAAuE,CAAEI,WAAW,EAAOC,cAAc,GAGzGL,KAAA,gBAAkDM,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAM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AAhBO,EAAAA,SAjKUzL,QAAAA,aAiKMuL,UAAA,cAAA,GAjKNvL,QAAAA,aAANkL,EAAA,CADNQ,EAAAA,kBAAkB,mBACN1L,QAAAA"}
1
+ {"version":3,"file":"blank-fill.cjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem, trimCommaSeparatedText, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { joinSubjectTitle, resolveSubjectPrefix } from './title-prefix'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface BlankAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n}\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = [sortingCardStyles, 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 .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .el-select:focus { border-color: #3D61E3; outline: none; }\n .el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `]\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String, attribute: 'subject-prefix' }) 'subject-prefix'?: string\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'is-key' }) 'is-key' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'hide-add-rich-text' }) 'hide-add-rich-text' = false\n @property({ type: Boolean, attribute: 'show-rich-text' }) 'show-rich-text' = false\n @property({ type: Boolean, attribute: 'show-delete-action' }) 'show-delete-action' = true\n @property({ type: Boolean, attribute: 'show-save-action' }) 'show-save-action' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = false\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('exam-answer-setting') || changed.has('rich-text-content') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value'].replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return trimCommaSeparatedText(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this['answer-list'].map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n tag: '',\n showInput: false,\n answerId: a?.answerId ?? a?.examAnswerId,\n }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this['exam-answer-setting']) {\n this._isInOrder = !!this['exam-answer-setting'].isInOrder\n this._isIgnoreCase = !!this['exam-answer-setting'].isIgnoreCase\n }\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n private _emitModelUpdate() {\n if (this['use-model']) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (!tag) { return }\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) {\n tags.splice(idx, 1)\n item.title = tags.join(',')\n }\n this.requestUpdate()\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit']\n ? this._answers\n : (this['answer-list'] || []).map((answer: any) => ({\n ...answer,\n title: this._normalizeAnswerTitle(answer),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }))\n const analysis = trimText(this['is-edit'] ? this._analysis : this.analysis || '')\n const isInOrder = this['is-edit'] ? this._isInOrder : this['exam-answer-setting']?.isInOrder ?? false\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : this['exam-answer-setting']?.isIgnoreCase ?? true\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const filledAnswers = answers.filter((answer: any) => this._normalizeAnswerTitle(answer))\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n examTypeEnum: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: filledAnswers.map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n isCorrect: true,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: filledAnswers.length > 0,\n isKey: this['is-key'],\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examAnswerSettingVO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || '')\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n const previewTitle = joinSubjectTitle(\n resolveSubjectPrefix(this['subject-prefix'], `${this['order-index'] + 1}.`),\n displayTitle,\n )\n return html`\n <div class=\"preview\">\n <span class=\"title\">${previewTitle}(填空题)</span>\n ${this['show-rich-text'] && this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`<span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>`\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = joinSubjectTitle(\n resolveSubjectPrefix(this['subject-prefix'], `${this['order-index'] + 1}. `),\n title,\n )\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.BLANK_FILL] || SubjectType.BLANK_FILL)\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【填空题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex flex-justify-end\">\n <span class=\"el-link\" @click=${() => this._addBlank()}>插入填空符</span>\n </div>\n\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n <span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>\n </span>\n `)}\n ${html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `}\n </div>\n </div>\n `)}\n\n ${this['show-rich-text'] && this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>副文本:</span></div>\n <div style=\"flex:1\">\n <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\n ${!this['show-action']\n ? html`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this['show-rich-text'] && this._showRichText}\n .hide-add-rich-text=${!this['show-rich-text'] || this['hide-add-rich-text']}\n .show-delete-action=${this['show-delete-action']}\n .show-save-action=${this['show-save-action']}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n <slot name=\"action\"></slot>\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","title","sorting","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","trimCommaSeparatedText","length","a","answerId","examAnswerId","blankCount","match","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","modelValue","_handleAddTag","join","_closeTag","tags","split","idx","findIndex","t","splice","_onCategoryChange","customId","examId","_imageResources","filter","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","toJSON","row","answerType","orderIndex","trimText","answers","showRichText","richText","filledAnswers","SubjectError","SubjectType","BLANK_FILL","examTypeEnum","index","next","isCorrect","isSetCorrectAnswer","isKey","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","previewTitle","joinSubjectTitle","resolveSubjectPrefix","some","_renderResourceSection","_renderCategorySection","images","video","src","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","getContent","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gZAeA,MAAMA,EAAWC,EAAAA,IAAA;;;;UAoBJC,QAAAA,aAAN,cAA2BC,EAAAA,WAA3BC,WAAAA,GAAAC,SAAAC,WA2GiDC,KAAA,eAAgB,EAE1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACHA,KAAA,uBAAuB,EAC3BA,KAAA,mBAAmB,EACfA,KAAA,uBAAuB,EACzBA,KAAA,qBAAqB,EACrCA,KAAAE,SAAU,EACSF,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,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AAhBO,EAAAA,SA3JU5L,QAAAA,aA2JM0L,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SA5JU5L,QAAAA,aA4JM0L,UAAA,WAAA,GACAL,EAAA,CAAhBO,EAAAA,SA7JU5L,QAAAA,aA6JM0L,UAAA,aAAA,GACAL,EAAA,CAAhBO,EAAAA,SA9JU5L,QAAAA,aA8JM0L,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SA/JU5L,QAAAA,aA+JM0L,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SAhKU5L,QAAAA,aAgKM0L,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SAjKU5L,QAAAA,aAiKM0L,UAAA,mBAAA,GACAL,EAAA,CAAhBO,EAAAA,SAlKU5L,QAAAA,aAkKM0L,UAAA,cAAA,GAlKN1L,QAAAA,aAANqL,EAAA,CADNQ,EAAAA,kBAAkB,mBACN7L,QAAAA"}
@@ -1,6 +1,6 @@
1
- "use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./sorting-card.cjs"),o=require("./types.cjs"),a=Object.defineProperty,n=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?n(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&a(e,s,o),o};function p(){return{title:""}}function h(){return Array.from({length:5},p)}function c(t){const e={...t,title:i.trimText(t?.title??t?.answer??"")},s=t?.answerId??t?.examAnswerId;return void 0!==s&&(e.answerId=s),delete e.answer,delete e.examAnswerId,delete e.isCorrect,e}function d(t,e){const s={...c(t),orderIndex:e+1,answer:i.trimText(t?.title??t?.answer??"")};return s.title=i.trimText(s.title??""),void 0!==s.answerId&&(s.examAnswerId=s.answerId),void 0===s.answerId&&delete s.answerId,delete s.isCorrect,s}const x=t.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>`,u=t.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>`;exports.QxsScale=class extends t.LitElement{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["hide-add-rich-text"]=!1,this["show-rich-text"]=!1,this["show-delete-action"]=!0,this["show-save-action"]=!0,this.sorting=!1,this["show-analysis"]=!1,this.analysis="",this["rich-text-content"]="",this["exam-answer-relation-type"]=0,this["upload-image"]=async t=>new Promise((e,s)=>{const i=new FileReader;i.onload=t=>e(t.target?.result),i.onerror=s,i.readAsDataURL(t)}),this._answers=h(),this._scaleQuestions=[],this._rowTitle="",this._title="",this._analysis="",this._showRichText=!1,this._richText="",this["model-value"]="",this["use-model"]=!1,this.TITLE_MAX=200}get"answer-list"(){return this._answers}set"answer-list"(t){const e=function(t){return Array.isArray(t)?t.map(c):[]}(t);this._answers=e.length?e:h(),this.requestUpdate("answer-list")}get"scale-question-list"(){return this._scaleQuestions}set"scale-question-list"(t){this._scaleQuestions=function(t){return Array.isArray(t)?t.map(t=>String(t??"").trim()).filter(Boolean):[]}(t),this.requestUpdate("scale-question-list")}get"scale-questions"(){return this._scaleQuestions}set"scale-questions"(t){this["scale-question-list"]=t,this.requestUpdate("scale-questions")}willUpdate(t){const e=t.has("title")||t.has("answer-list")||t.has("rich-text-content")||t.has("scale-question-list")||t.has("scale-questions");(t.has("is-edit")&&this["is-edit"]||!this["is-edit"]&&e)&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._rowTitle=this._scaleQuestions.join("\n"),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"]}_emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??null}))}_onTitleInput(t){const e=t.target;e.value.length>this.TITLE_MAX&&(e.value=e.value.slice(0,this.TITLE_MAX)),this._title=e.value,this["use-model"]&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_resolvedQuestions(){const t=this["is-edit"]?this._rowTitle:this._scaleQuestions.join("\n");return t.split("\n").map(t=>t.trim()).filter(Boolean)}_resolvedAnswers(){const t=this["is-edit"]?this._answers:this["answer-list"];return Array.isArray(t)?t.map(c):[]}_createAnswerCountError(t){return new i.SubjectError("量表题选项数量必须在 3-5 个之间!","ANSWER_COUNT_INVALID","answers",t)}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:o.SubjectType.SCALE,orderIndex:this["order-index"]},r=i.trimText(this["is-edit"]?this._title:this.title||""),a=this._resolvedAnswers(),n=this._resolvedQuestions(),l=this["is-edit"]?this._richText:this["rich-text-content"]||"",p=this["show-rich-text"]&&(this["is-edit"]?this._showRichText:!!this["rich-text-content"]);if(!r)return void e(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",s));if(a.length<3||a.length>5)return void e(this._createAnswerCountError(s));for(let t=0;t<a.length;t++)if(!a[t].title)return void e(new i.SubjectError(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",s));if(0===n.length)return void e(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",s));const h={answerType:o.SubjectType.SCALE,examTypeEnum:o.SubjectType.SCALE,title:r,answers:a.map(d),scaleQuestionList:n,analysis:i.trimText(this["is-edit"]?this._analysis:this.analysis||""),examRichTextContent:p?l:"",isSetCorrectAnswer:!1};this["custom-id"]&&(h.customId=this["custom-id"]),this["exam-answer-relation-type"]&&(h.examAnswerRelationType=this["exam-answer-relation-type"]),t(h)})}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){!function(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}(t.message)}}validate(){const t=[],e={customId:this["custom-id"]||void 0,answerType:o.SubjectType.SCALE,orderIndex:this["order-index"]},s=i.trimText(this["is-edit"]?this._title:this.title||""),r=this._resolvedAnswers(),a=this._resolvedQuestions();return s||t.push(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e)),r.length<3||r.length>5?(t.push(this._createAnswerCountError(e)),t):(r.forEach((s,r)=>{s.title||t.push(new i.SubjectError(`选项${String.fromCharCode(65+r)}未填写`,"ANSWER_EMPTY","answers",e))}),0===a.length&&t.push(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e)),t)}_renderPreview(){const e=this._resolvedAnswers(),s=this._resolvedQuestions(),i=Math.floor(100/((e.length||1)+1));return t.html`
1
+ "use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./sorting-card.cjs"),o=require("./title-prefix.cjs"),a=require("./types.cjs"),n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?l(e,s):e,a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&n(e,s,o),o};function h(){return{title:""}}function c(){return Array.from({length:5},h)}function d(t){const e={...t,title:i.trimText(t?.title??t?.answer??"")},s=t?.answerId??t?.examAnswerId;return void 0!==s&&(e.answerId=s),delete e.answer,delete e.examAnswerId,delete e.isCorrect,e}function x(t,e){const s={...d(t),orderIndex:e+1,answer:i.trimText(t?.title??t?.answer??"")};return s.title=i.trimText(s.title??""),void 0!==s.answerId&&(s.examAnswerId=s.answerId),void 0===s.answerId&&delete s.answerId,delete s.isCorrect,s}const u=t.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>`,y=t.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>`;exports.QxsScale=class extends t.LitElement{constructor(){super(...arguments),this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["show-action"]=!0,this["show-add"]=!0,this["hide-add-rich-text"]=!1,this["show-rich-text"]=!1,this["show-delete-action"]=!0,this["show-save-action"]=!0,this.sorting=!1,this["show-analysis"]=!1,this.analysis="",this["rich-text-content"]="",this["exam-answer-relation-type"]=0,this["upload-image"]=async t=>new Promise((e,s)=>{const i=new FileReader;i.onload=t=>e(t.target?.result),i.onerror=s,i.readAsDataURL(t)}),this._answers=c(),this._scaleQuestions=[],this._rowTitle="",this._title="",this._analysis="",this._showRichText=!1,this._richText="",this["model-value"]="",this["use-model"]=!1,this.TITLE_MAX=200}get"answer-list"(){return this._answers}set"answer-list"(t){const e=function(t){return Array.isArray(t)?t.map(d):[]}(t);this._answers=e.length?e:c(),this.requestUpdate("answer-list")}get"scale-question-list"(){return this._scaleQuestions}set"scale-question-list"(t){this._scaleQuestions=function(t){return Array.isArray(t)?t.map(t=>String(t??"").trim()).filter(Boolean):[]}(t),this.requestUpdate("scale-question-list")}get"scale-questions"(){return this._scaleQuestions}set"scale-questions"(t){this["scale-question-list"]=t,this.requestUpdate("scale-questions")}willUpdate(t){const e=t.has("title")||t.has("answer-list")||t.has("rich-text-content")||t.has("scale-question-list")||t.has("scale-questions");(t.has("is-edit")&&this["is-edit"]||!this["is-edit"]&&e)&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"])}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this._rowTitle=this._scaleQuestions.join("\n"),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"]}_emit(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e??null}))}_onTitleInput(t){const e=t.target;e.value.length>this.TITLE_MAX&&(e.value=e.value.slice(0,this.TITLE_MAX)),this._title=e.value,this["use-model"]&&this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:this._title}))}_resolvedQuestions(){const t=this["is-edit"]?this._rowTitle:this._scaleQuestions.join("\n");return t.split("\n").map(t=>t.trim()).filter(Boolean)}_resolvedAnswers(){const t=this["is-edit"]?this._answers:this["answer-list"];return Array.isArray(t)?t.map(d):[]}_createAnswerCountError(t){return new i.SubjectError("量表题选项数量必须在 3-5 个之间!","ANSWER_COUNT_INVALID","answers",t)}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:a.SubjectType.SCALE,orderIndex:this["order-index"]},r=i.trimText(this["is-edit"]?this._title:this.title||""),o=this._resolvedAnswers(),n=this._resolvedQuestions(),l=this["is-edit"]?this._richText:this["rich-text-content"]||"",p=this["show-rich-text"]&&(this["is-edit"]?this._showRichText:!!this["rich-text-content"]);if(!r)return void e(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",s));if(o.length<3||o.length>5)return void e(this._createAnswerCountError(s));for(let t=0;t<o.length;t++)if(!o[t].title)return void e(new i.SubjectError(`选项${String.fromCharCode(65+t)}未填写。`,"ANSWER_EMPTY","answers",s));if(0===n.length)return void e(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",s));const h={answerType:a.SubjectType.SCALE,examTypeEnum:a.SubjectType.SCALE,title:r,answers:o.map(x),scaleQuestionList:n,analysis:i.trimText(this["is-edit"]?this._analysis:this.analysis||""),examRichTextContent:p?l:"",isSetCorrectAnswer:!1};this["custom-id"]&&(h.customId=this["custom-id"]),this["exam-answer-relation-type"]&&(h.examAnswerRelationType=this["exam-answer-relation-type"]),t(h)})}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){!function(t){const e=document.createElement("div");e.textContent=t,Object.assign(e.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"4px",fontSize:"13px",color:"#fff",background:"#f56c6c",zIndex:"99999",boxShadow:"0 4px 12px rgba(0,0,0,.15)",transition:"opacity .3s",opacity:"1"}),document.body.appendChild(e),setTimeout(()=>{e.style.opacity="0",setTimeout(()=>e.remove(),300)},2500)}(t.message)}}validate(){const t=[],e={customId:this["custom-id"]||void 0,answerType:a.SubjectType.SCALE,orderIndex:this["order-index"]},s=i.trimText(this["is-edit"]?this._title:this.title||""),r=this._resolvedAnswers(),o=this._resolvedQuestions();return s||t.push(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e)),r.length<3||r.length>5?(t.push(this._createAnswerCountError(e)),t):(r.forEach((s,r)=>{s.title||t.push(new i.SubjectError(`选项${String.fromCharCode(65+r)}未填写`,"ANSWER_EMPTY","answers",e))}),0===o.length&&t.push(new i.SubjectError("行标题不能为空!","EMPTY_ROW_TITLE","rowTitle",e)),t)}_renderPreview(){const e=this._resolvedAnswers(),s=this._resolvedQuestions(),i=Math.floor(100/((e.length||1)+1)),r=o.joinSubjectTitle(o.resolveSubjectPrefix(this["subject-prefix"],`${this["order-index"]+1}.`),this.title);return t.html`
2
2
  <div class="preview">
3
- <span class="title">${this["order-index"]+1}.${this.title}(量表题)</span>
3
+ <span class="title">${r}(量表题)</span>
4
4
  ${this["show-rich-text"]&&this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
5
5
  <div class="scale-table-wrap">
6
6
  <table class="scale-table">
@@ -68,11 +68,11 @@
68
68
  <span
69
69
  class="icon"
70
70
  @click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}
71
- >${x}</span>
71
+ >${u}</span>
72
72
  <span
73
73
  class="icon ${this._answers.length<3?"disabled":""}"
74
74
  @click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==s))}}
75
- >${u}</span>
75
+ >${y}</span>
76
76
  </div>
77
77
  `)}
78
78
  </div>
@@ -118,7 +118,7 @@
118
118
  </div>
119
119
  </div>
120
120
  `:""}
121
- `}_renderSorting(){const t=i.trimText(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=`${this["order-index"]+1}. ${t}`;return r.renderSortingCard(e,o.SubjectTypeLabel[o.SubjectType.SCALE]||o.SubjectType.SCALE)}render(){if(this.sorting)return this._renderSorting();const e=this["is-edit"]?t.html`<div slot="edit">${this._renderEdit()}</div>`:t.html`<div slot="preview">${this._renderPreview()}</div>`;return t.html`
121
+ `}_renderSorting(){const t=i.trimText(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=o.joinSubjectTitle(o.resolveSubjectPrefix(this["subject-prefix"],`${this["order-index"]+1}. `),t);return r.renderSortingCard(e,a.SubjectTypeLabel[a.SubjectType.SCALE]||a.SubjectType.SCALE)}render(){if(this.sorting)return this._renderSorting();const e=this["is-edit"]?t.html`<div slot="edit">${this._renderEdit()}</div>`:t.html`<div slot="preview">${this._renderPreview()}</div>`;return t.html`
122
122
  <qxs-subject-layout .show-edit=${this["is-edit"]}>
123
123
  ${e}
124
124
  ${this["show-action"]?t.html`
@@ -215,5 +215,5 @@
215
215
  .answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
216
216
 
217
217
  .row-title-textarea { height: 200px; }
218
- `],l([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"order-index",2),l([e.property({type:String})],exports.QxsScale.prototype,"title",2),l([e.property({type:String,attribute:"custom-id"})],exports.QxsScale.prototype,"custom-id",2),l([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"is-edit",2),l([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"is-save",2),l([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"is-set",2),l([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"show-action",2),l([e.property({type:Boolean,attribute:"show-add"})],exports.QxsScale.prototype,"show-add",2),l([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsScale.prototype,"hide-add-rich-text",2),l([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsScale.prototype,"show-rich-text",2),l([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsScale.prototype,"show-delete-action",2),l([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsScale.prototype,"show-save-action",2),l([e.property({type:Boolean,reflect:!0})],exports.QxsScale.prototype,"sorting",2),l([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsScale.prototype,"show-analysis",2),l([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),l([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"rich-text-content",2),l([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"exam-answer-relation-type",2),l([e.property({type:Object,attribute:"upload-image"})],exports.QxsScale.prototype,"upload-image",2),l([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answer-list",1),l([e.property({type:Array,attribute:"scale-question-list"})],exports.QxsScale.prototype,"scale-question-list",1),l([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scale-questions",1),l([e.state()],exports.QxsScale.prototype,"_answers",2),l([e.state()],exports.QxsScale.prototype,"_scaleQuestions",2),l([e.state()],exports.QxsScale.prototype,"_rowTitle",2),l([e.state()],exports.QxsScale.prototype,"_title",2),l([e.state()],exports.QxsScale.prototype,"_analysis",2),l([e.state()],exports.QxsScale.prototype,"_showRichText",2),l([e.state()],exports.QxsScale.prototype,"_richText",2),l([e.property({type:String,attribute:"model-value"})],exports.QxsScale.prototype,"model-value",2),l([e.property({type:Boolean,attribute:"use-model"})],exports.QxsScale.prototype,"use-model",2),exports.QxsScale=l([s.safeCustomElement("qxs-scale")],exports.QxsScale);
218
+ `],p([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"order-index",2),p([e.property({type:String,attribute:"subject-prefix"})],exports.QxsScale.prototype,"subject-prefix",2),p([e.property({type:String})],exports.QxsScale.prototype,"title",2),p([e.property({type:String,attribute:"custom-id"})],exports.QxsScale.prototype,"custom-id",2),p([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"is-edit",2),p([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"is-save",2),p([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"is-set",2),p([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"show-action",2),p([e.property({type:Boolean,attribute:"show-add"})],exports.QxsScale.prototype,"show-add",2),p([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsScale.prototype,"hide-add-rich-text",2),p([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsScale.prototype,"show-rich-text",2),p([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsScale.prototype,"show-delete-action",2),p([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsScale.prototype,"show-save-action",2),p([e.property({type:Boolean,reflect:!0})],exports.QxsScale.prototype,"sorting",2),p([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsScale.prototype,"show-analysis",2),p([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),p([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"rich-text-content",2),p([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"exam-answer-relation-type",2),p([e.property({type:Object,attribute:"upload-image"})],exports.QxsScale.prototype,"upload-image",2),p([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answer-list",1),p([e.property({type:Array,attribute:"scale-question-list"})],exports.QxsScale.prototype,"scale-question-list",1),p([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scale-questions",1),p([e.state()],exports.QxsScale.prototype,"_answers",2),p([e.state()],exports.QxsScale.prototype,"_scaleQuestions",2),p([e.state()],exports.QxsScale.prototype,"_rowTitle",2),p([e.state()],exports.QxsScale.prototype,"_title",2),p([e.state()],exports.QxsScale.prototype,"_analysis",2),p([e.state()],exports.QxsScale.prototype,"_showRichText",2),p([e.state()],exports.QxsScale.prototype,"_richText",2),p([e.property({type:String,attribute:"model-value"})],exports.QxsScale.prototype,"model-value",2),p([e.property({type:Boolean,attribute:"use-model"})],exports.QxsScale.prototype,"use-model",2),exports.QxsScale=p([s.safeCustomElement("qxs-scale")],exports.QxsScale);
219
219
  //# sourceMappingURL=scale.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"scale.cjs","sources":["../../../../packages/components-wc/src/subject/scale.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { SubjectError, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface ScaleAnswer {\n title: string\n answerId?: string | number\n orderIndex?: number\n isCorrect?: boolean\n [key: string]: any\n}\n\nfunction createEmptyScaleAnswer(): ScaleAnswer {\n return { title: '' }\n}\n\nfunction createDefaultScaleAnswers(): ScaleAnswer[] {\n return Array.from({ length: 5 }, createEmptyScaleAnswer)\n}\n\nfunction normalizeScaleAnswer(answer: any): ScaleAnswer {\n const next: ScaleAnswer = {\n ...answer,\n title: trimText(answer?.title ?? answer?.answer ?? ''),\n }\n const answerId = answer?.answerId ?? answer?.examAnswerId\n if (answerId !== undefined) {\n next.answerId = answerId\n }\n delete next.answer\n delete next.examAnswerId\n delete next.isCorrect\n return next\n}\n\nfunction normalizeScaleAnswers(value: any): ScaleAnswer[] {\n return Array.isArray(value) ? value.map(normalizeScaleAnswer) : []\n}\n\nfunction normalizeScaleQuestionList(value: any): string[] {\n if (!Array.isArray(value)) {\n return []\n }\n return value\n .map(item => String(item ?? '').trim())\n .filter(Boolean)\n}\n\nfunction splitScaleQuestionLines(value: string): string[] {\n return value\n .split('\\n')\n .map(item => item.trim())\n .filter(Boolean)\n}\n\nfunction serializeScaleAnswer(answer: any, index: number): ScaleAnswer {\n const next: ScaleAnswer = {\n ...normalizeScaleAnswer(answer),\n orderIndex: index + 1,\n answer: trimText(answer?.title ?? answer?.answer ?? ''),\n }\n next.title = trimText(next.title ?? '')\n if (next.answerId !== undefined) {\n next.examAnswerId = next.answerId\n }\n if (next.answerId === undefined) {\n delete next.answerId\n }\n delete next.isCorrect\n return next\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>`\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(() => {\n el.style.opacity = '0'\n setTimeout(() => el.remove(), 300)\n }, 2500)\n}\n\n@safeCustomElement('qxs-scale')\nexport class QxsScale extends LitElement {\n static styles = [sortingCardStyles, 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 .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\n .scale-table-wrap {\n margin-top: 12px;\n background: #fff;\n overflow: hidden;\n }\n .scale-table { width: 100%; border-collapse: collapse; font-size: 12px; }\n .scale-table th, .scale-table td { border: 1px solid #e4e7ed; padding: 8px 6px; text-align: center; }\n .scale-table th { background: #f5f7fa; color: #909399; }\n .scale-table td:first-child,\n .scale-table th:first-child {\n background: #fbfcff;\n color: #606266;\n font-weight: 600;\n }\n .scale-table input[type=\"radio\"] {\n accent-color: #3D61E3;\n }\n\n .flex { display: flex; }\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, input[type=\"text\"] {\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; white-space: pre-wrap;\n }\n textarea:focus, input[type=\"text\"]:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled, input[type=\"text\"]:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }\n .el-link.danger { color: #f56c6c; }\n\n .answer-item { display: flex; align-items: center; margin-top: 6px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 200px; }\n .answer-item .input input {\n height: 32px; padding: 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\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 .row-title-textarea { height: 200px; }\n `]\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'hide-add-rich-text' }) 'hide-add-rich-text' = false\n @property({ type: Boolean, attribute: 'show-rich-text' }) 'show-rich-text' = false\n @property({ type: Boolean, attribute: 'show-delete-action' }) 'show-delete-action' = true\n @property({ type: Boolean, attribute: 'show-save-action' }) 'show-save-action' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = false\n @property({ type: String }) analysis = ''\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' })\n get 'answer-list'() { return this._answers }\n\n set 'answer-list'(value: any) {\n const answers = normalizeScaleAnswers(value)\n this._answers = answers.length ? answers : createDefaultScaleAnswers()\n this.requestUpdate('answer-list')\n }\n\n @property({ type: Array, attribute: 'scale-question-list' })\n get 'scale-question-list'() { return this._scaleQuestions }\n\n set 'scale-question-list'(value: any) {\n this._scaleQuestions = normalizeScaleQuestionList(value)\n this.requestUpdate('scale-question-list')\n }\n\n @property({ type: Array, attribute: 'scale-questions' })\n get 'scale-questions'() { return this._scaleQuestions }\n\n set 'scale-questions'(value: any) {\n this['scale-question-list'] = value\n this.requestUpdate('scale-questions')\n }\n\n @state() private _answers: ScaleAnswer[] = createDefaultScaleAnswers()\n @state() private _scaleQuestions: string[] = []\n @state() private _rowTitle = ''\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n const shouldSyncProps = changed.has('title')\n || changed.has('answer-list')\n || changed.has('rich-text-content')\n || changed.has('scale-question-list')\n || changed.has('scale-questions')\n\n if ((changed.has('is-edit') && this['is-edit']) || (!this['is-edit'] && shouldSyncProps)) {\n this._syncProps()\n }\n\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value']\n }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._rowTitle = this._scaleQuestions.join('\\n')\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\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 _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) {\n el.value = el.value.slice(0, this.TITLE_MAX)\n }\n this._title = el.value\n if (this['use-model']) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _resolvedQuestions(): string[] {\n const rowTitle = this['is-edit'] ? this._rowTitle : this._scaleQuestions.join('\\n')\n return splitScaleQuestionLines(rowTitle)\n }\n\n private _resolvedAnswers(): ScaleAnswer[] {\n const answers = this['is-edit'] ? this._answers : this['answer-list']\n return Array.isArray(answers) ? answers.map(normalizeScaleAnswer) : []\n }\n\n private _createAnswerCountError(row: Record<string, unknown>) {\n return new SubjectError('量表题选项数量必须在 3-5 个之间!', 'ANSWER_COUNT_INVALID', 'answers', row)\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = {\n customId: this['custom-id'] || undefined,\n answerType: SubjectType.SCALE,\n orderIndex: this['order-index'],\n }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this._resolvedAnswers()\n const questions = this._resolvedQuestions()\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const showRichText = this['show-rich-text'] && (this['is-edit'] ? this._showRichText : !!this['rich-text-content'])\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n\n if (answers.length < 3 || answers.length > 5) {\n reject(this._createAnswerCountError(row))\n return\n }\n\n for (let i = 0; i < answers.length; i++) {\n if (!answers[i].title) {\n reject(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写。`, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n }\n\n if (questions.length === 0) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.SCALE,\n examTypeEnum: SubjectType.SCALE,\n title,\n answers: answers.map(serializeScaleAnswer),\n scaleQuestionList: questions,\n analysis: trimText(this['is-edit'] ? this._analysis : this.analysis || ''),\n examRichTextContent: showRichText ? richText : '',\n isSetCorrectAnswer: false,\n }\n\n if (this['custom-id']) {\n result.customId = this['custom-id']\n }\n if (this['exam-answer-relation-type']) {\n result.examAnswerRelationType = this['exam-answer-relation-type']\n }\n\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = {\n customId: this['custom-id'] || undefined,\n answerType: SubjectType.SCALE,\n orderIndex: this['order-index'],\n }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this._resolvedAnswers()\n const questions = this._resolvedQuestions()\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n\n if (answers.length < 3 || answers.length > 5) {\n errors.push(this._createAnswerCountError(row))\n return errors\n }\n\n answers.forEach((answer: ScaleAnswer, index: number) => {\n if (!answer.title) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + index)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n })\n\n if (questions.length === 0) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const answers = this._resolvedAnswers()\n const questions = this._resolvedQuestions()\n const colWidth = Math.floor(100 / ((answers.length || 1) + 1))\n\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${this.title}(量表题)</span>\n ${this['show-rich-text'] && this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n <div class=\"scale-table-wrap\">\n <table class=\"scale-table\">\n <thead>\n <tr>\n <th style=\"width:${colWidth}%\">问题 \\ 选项</th>\n ${answers.map(answer => html`<th style=\"width:${colWidth}%\">${answer.title}</th>`)}\n </tr>\n </thead>\n <tbody>\n ${questions.map(question => html`\n <tr>\n <td>${question}</td>\n ${answers.map(() => html`<td><input type=\"radio\" disabled /></td>`)}\n </tr>\n `)}\n </tbody>\n </table>\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\n rows=\"2\"\n .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【量表题】请输入问题\"\n ></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>行标题:</span></div>\n <div class=\"flex\" style=\"flex:1\">\n <div class=\"el-input\" style=\"width:160px\">\n <textarea\n class=\"row-title-textarea\"\n .value=${this._rowTitle}\n @input=${(e: Event) => { this._rowTitle = (e.target as HTMLTextAreaElement).value }}\n @keydown=${(e: KeyboardEvent) => { e.stopPropagation() }}\n placeholder=\"请输入行标题\"\n ></textarea>\n </div>\n <div style=\"flex:1;margin-left:12px\">\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${String.fromCharCode(65 + index)}.</span>\n <div class=\"input\">\n <input\n type=\"text\"\n .value=${answer.title}\n maxlength=\"10\"\n @input=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._answers = this._answers.map((item, currentIndex) =>\n currentIndex === index ? { ...item, title: value } : item,\n )\n }}\n placeholder=\"选项${index + 1}\"\n />\n </div>\n <span\n class=\"icon\"\n @click=${() => {\n if (this._answers.length < 5) {\n this._answers = [...this._answers, createEmptyScaleAnswer()]\n }\n }}\n >${iconPlus}</span>\n <span\n class=\"icon ${this._answers.length < 3 ? 'disabled' : ''}\"\n @click=${() => {\n if (this._answers.length > 3) {\n this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index)\n }\n }}\n >${iconRemove}</span>\n </div>\n `)}\n </div>\n </div>\n </div>\n\n ${this['show-rich-text'] && 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 <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\n ${!this['show-action']\n ? html`\n <div class=\"flex-justify-end\" style=\"margin-top:8px\">\n <span\n class=\"el-link danger\"\n @click=${() => {\n this._showRichText = false\n this._richText = ''\n }}\n >删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\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 <div class=\"el-input\">\n <textarea\n rows=\"2\"\n .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"\n ></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = `${this['order-index'] + 1}. ${title}`\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.SCALE] || SubjectType.SCALE)\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this['show-rich-text'] && this._showRichText}\n .hide-add-rich-text=${!this['show-rich-text'] || this['hide-add-rich-text']}\n .show-delete-action=${this['show-delete-action']}\n .show-save-action=${this['show-save-action']}\n .show-other-option=${false}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n <slot name=\"action\"></slot>\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["createEmptyScaleAnswer","title","createDefaultScaleAnswers","Array","from","length","normalizeScaleAnswer","answer","next","trimText","answerId","examAnswerId","isCorrect","serializeScaleAnswer","index","orderIndex","iconPlus","html","iconRemove","QxsScale","LitElement","constructor","super","arguments","this","sorting","analysis","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","_scaleQuestions","_rowTitle","_title","_analysis","_showRichText","_richText","TITLE_MAX","value","answers","isArray","map","normalizeScaleAnswers","requestUpdate","item","String","trim","filter","Boolean","normalizeScaleQuestionList","willUpdate","changed","shouldSyncProps","has","_syncProps","join","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","slice","_resolvedQuestions","rowTitle","split","_resolvedAnswers","_createAnswerCountError","row","SubjectError","toJSON","customId","answerType","SubjectType","SCALE","questions","richText","showRichText","i","fromCharCode","examTypeEnum","scaleQuestionList","examRichTextContent","isSetCorrectAnswer","examAnswerRelationType","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","forEach","_renderPreview","colWidth","Math","floor","question","_renderEdit","stopPropagation","currentIndex","_","getContent","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gXAeA,SAASA,IACP,MAAO,CAAEC,MAAO,GAClB,CAEA,SAASC,IACP,OAAOC,MAAMC,KAAK,CAAEC,OAAQ,GAAKL,EACnC,CAEA,SAASM,EAAqBC,GAC5B,MAAMC,EAAoB,IACrBD,EACHN,MAAOQ,EAAAA,SAASF,GAAQN,OAASM,GAAQA,QAAU,KAE/CG,EAAWH,GAAQG,UAAYH,GAAQI,aAO7C,YANiB,IAAbD,IACFF,EAAKE,SAAWA,UAEXF,EAAKD,cACLC,EAAKG,oBACLH,EAAKI,UACLJ,CACT,CAsBA,SAASK,EAAqBN,EAAaO,GACzC,MAAMN,EAAoB,IACrBF,EAAqBC,GACxBQ,WAAYD,EAAQ,EACpBP,OAAQE,EAAAA,SAASF,GAAQN,OAASM,GAAQA,QAAU,KAUtD,OARAC,EAAKP,MAAQQ,EAAAA,SAASD,EAAKP,OAAS,SACd,IAAlBO,EAAKE,WACPF,EAAKG,aAAeH,EAAKE,eAEL,IAAlBF,EAAKE,iBACAF,EAAKE,gBAEPF,EAAKI,UACLJ,CACT,CAEA,MAAMQ,EAAWC,EAAAA,IAAA,2NACXC,EAAaD,EAAAA,IAAA,qLAmBNE,QAAAA,SAAN,cAAuBC,EAAAA,WAAvBC,WAAAA,GAAAC,SAAAC,WA6EiDC,KAAA,eAAgB,EAC1CA,KAAAvB,MAAQ,GACgBuB,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACHA,KAAA,uBAAuB,EAC3BA,KAAA,m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HC,EAAAA,SAAS,CAAEC,KAAMtJ,MAAOwJ,UAAW,qBAzHzBxI,QAAAA,SA0HPyI,UAAA,kBAAA,GAOaL,EAAA,CAAhBO,EAAAA,SAjIU3I,QAAAA,SAiIMyI,UAAA,WAAA,GACAL,EAAA,CAAhBO,EAAAA,SAlIU3I,QAAAA,SAkIMyI,UAAA,kBAAA,GACAL,EAAA,CAAhBO,EAAAA,SAnIU3I,QAAAA,SAmIMyI,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SApIU3I,QAAAA,SAoIMyI,UAAA,SAAA,GACAL,EAAA,CAAhBO,EAAAA,SArIU3I,QAAAA,SAqIMyI,UAAA,YAAA,GACAL,EAAA,CAAhBO,EAAAA,SAtIU3I,QAAAA,SAsIMyI,UAAA,gBAAA,GACAL,EAAA,CAAhBO,EAAAA,SAvIU3I,QAAAA,SAuIMyI,UAAA,YAAA,GAEqCL,EAAA,CAArDC,EAAAA,SAAS,CAAEC,KAAMlG,OAAQoG,UAAW,iBAzI1BxI,QAAAA,SAyI2CyI,UAAA,cAAA,GACDL,EAAA,CAApDC,EAAAA,SAAS,CAAEC,KAAM/F,QAASiG,UAAW,eA1I3BxI,QAAAA,SA0I0CyI,UAAA,YAAA,GA1I1CzI,QAAAA,SAANoI,EAAA,CADNQ,EAAAA,kBAAkB,cACN5I,QAAAA"}
1
+ {"version":3,"file":"scale.cjs","sources":["../../../../packages/components-wc/src/subject/scale.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { SubjectError, trimText } from './single'\nimport { renderSortingCard, sortingCardStyles } from './sorting-card'\nimport { joinSubjectTitle, resolveSubjectPrefix } from './title-prefix'\nimport { SubjectType, SubjectTypeLabel } from './types'\n\ninterface ScaleAnswer {\n title: string\n answerId?: string | number\n orderIndex?: number\n isCorrect?: boolean\n [key: string]: any\n}\n\nfunction createEmptyScaleAnswer(): ScaleAnswer {\n return { title: '' }\n}\n\nfunction createDefaultScaleAnswers(): ScaleAnswer[] {\n return Array.from({ length: 5 }, createEmptyScaleAnswer)\n}\n\nfunction normalizeScaleAnswer(answer: any): ScaleAnswer {\n const next: ScaleAnswer = {\n ...answer,\n title: trimText(answer?.title ?? answer?.answer ?? ''),\n }\n const answerId = answer?.answerId ?? answer?.examAnswerId\n if (answerId !== undefined) {\n next.answerId = answerId\n }\n delete next.answer\n delete next.examAnswerId\n delete next.isCorrect\n return next\n}\n\nfunction normalizeScaleAnswers(value: any): ScaleAnswer[] {\n return Array.isArray(value) ? value.map(normalizeScaleAnswer) : []\n}\n\nfunction normalizeScaleQuestionList(value: any): string[] {\n if (!Array.isArray(value)) {\n return []\n }\n return value\n .map(item => String(item ?? '').trim())\n .filter(Boolean)\n}\n\nfunction splitScaleQuestionLines(value: string): string[] {\n return value\n .split('\\n')\n .map(item => item.trim())\n .filter(Boolean)\n}\n\nfunction serializeScaleAnswer(answer: any, index: number): ScaleAnswer {\n const next: ScaleAnswer = {\n ...normalizeScaleAnswer(answer),\n orderIndex: index + 1,\n answer: trimText(answer?.title ?? answer?.answer ?? ''),\n }\n next.title = trimText(next.title ?? '')\n if (next.answerId !== undefined) {\n next.examAnswerId = next.answerId\n }\n if (next.answerId === undefined) {\n delete next.answerId\n }\n delete next.isCorrect\n return next\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>`\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(() => {\n el.style.opacity = '0'\n setTimeout(() => el.remove(), 300)\n }, 2500)\n}\n\n@safeCustomElement('qxs-scale')\nexport class QxsScale extends LitElement {\n static styles = [sortingCardStyles, 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 .rich-text img[data-align=\"left\"] { display: block !important; margin: 0 auto 0 0 !important; }\n .preview .rich-text img[data-align=\"center\"] { display: block !important; margin: 0 auto !important; }\n .preview .rich-text img[data-align=\"right\"] { display: block !important; margin: 0 0 0 auto !important; }\n .scale-table-wrap {\n margin-top: 12px;\n background: #fff;\n overflow: hidden;\n }\n .scale-table { width: 100%; border-collapse: collapse; font-size: 12px; }\n .scale-table th, .scale-table td { border: 1px solid #e4e7ed; padding: 8px 6px; text-align: center; }\n .scale-table th { background: #f5f7fa; color: #909399; }\n .scale-table td:first-child,\n .scale-table th:first-child {\n background: #fbfcff;\n color: #606266;\n font-weight: 600;\n }\n .scale-table input[type=\"radio\"] {\n accent-color: #3D61E3;\n }\n\n .flex { display: flex; }\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, input[type=\"text\"] {\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; white-space: pre-wrap;\n }\n textarea:focus, input[type=\"text\"]:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled, input[type=\"text\"]:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }\n .el-link.danger { color: #f56c6c; }\n\n .answer-item { display: flex; align-items: center; margin-top: 6px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .input { flex: 1; max-width: 200px; }\n .answer-item .input input {\n height: 32px; padding: 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\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 .row-title-textarea { height: 200px; }\n `]\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String, attribute: 'subject-prefix' }) 'subject-prefix'?: string\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'hide-add-rich-text' }) 'hide-add-rich-text' = false\n @property({ type: Boolean, attribute: 'show-rich-text' }) 'show-rich-text' = false\n @property({ type: Boolean, attribute: 'show-delete-action' }) 'show-delete-action' = true\n @property({ type: Boolean, attribute: 'show-save-action' }) 'show-save-action' = true\n @property({ type: Boolean, reflect: true }) sorting = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = false\n @property({ type: String }) analysis = ''\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' })\n get 'answer-list'() { return this._answers }\n\n set 'answer-list'(value: any) {\n const answers = normalizeScaleAnswers(value)\n this._answers = answers.length ? answers : createDefaultScaleAnswers()\n this.requestUpdate('answer-list')\n }\n\n @property({ type: Array, attribute: 'scale-question-list' })\n get 'scale-question-list'() { return this._scaleQuestions }\n\n set 'scale-question-list'(value: any) {\n this._scaleQuestions = normalizeScaleQuestionList(value)\n this.requestUpdate('scale-question-list')\n }\n\n @property({ type: Array, attribute: 'scale-questions' })\n get 'scale-questions'() { return this._scaleQuestions }\n\n set 'scale-questions'(value: any) {\n this['scale-question-list'] = value\n this.requestUpdate('scale-questions')\n }\n\n @state() private _answers: ScaleAnswer[] = createDefaultScaleAnswers()\n @state() private _scaleQuestions: string[] = []\n @state() private _rowTitle = ''\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n private readonly TITLE_MAX = 200\n\n willUpdate(changed: Map<string, unknown>) {\n const shouldSyncProps = changed.has('title')\n || changed.has('answer-list')\n || changed.has('rich-text-content')\n || changed.has('scale-question-list')\n || changed.has('scale-questions')\n\n if ((changed.has('is-edit') && this['is-edit']) || (!this['is-edit'] && shouldSyncProps)) {\n this._syncProps()\n }\n\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value']\n }\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n this._rowTitle = this._scaleQuestions.join('\\n')\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\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 _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) {\n el.value = el.value.slice(0, this.TITLE_MAX)\n }\n this._title = el.value\n if (this['use-model']) {\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: this._title,\n }))\n }\n }\n\n private _resolvedQuestions(): string[] {\n const rowTitle = this['is-edit'] ? this._rowTitle : this._scaleQuestions.join('\\n')\n return splitScaleQuestionLines(rowTitle)\n }\n\n private _resolvedAnswers(): ScaleAnswer[] {\n const answers = this['is-edit'] ? this._answers : this['answer-list']\n return Array.isArray(answers) ? answers.map(normalizeScaleAnswer) : []\n }\n\n private _createAnswerCountError(row: Record<string, unknown>) {\n return new SubjectError('量表题选项数量必须在 3-5 个之间!', 'ANSWER_COUNT_INVALID', 'answers', row)\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = {\n customId: this['custom-id'] || undefined,\n answerType: SubjectType.SCALE,\n orderIndex: this['order-index'],\n }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this._resolvedAnswers()\n const questions = this._resolvedQuestions()\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const showRichText = this['show-rich-text'] && (this['is-edit'] ? this._showRichText : !!this['rich-text-content'])\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n\n if (answers.length < 3 || answers.length > 5) {\n reject(this._createAnswerCountError(row))\n return\n }\n\n for (let i = 0; i < answers.length; i++) {\n if (!answers[i].title) {\n reject(new SubjectError(`选项${String.fromCharCode(65 + i)}未填写。`, 'ANSWER_EMPTY', 'answers', row))\n return\n }\n }\n\n if (questions.length === 0) {\n reject(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.SCALE,\n examTypeEnum: SubjectType.SCALE,\n title,\n answers: answers.map(serializeScaleAnswer),\n scaleQuestionList: questions,\n analysis: trimText(this['is-edit'] ? this._analysis : this.analysis || ''),\n examRichTextContent: showRichText ? richText : '',\n isSetCorrectAnswer: false,\n }\n\n if (this['custom-id']) {\n result.customId = this['custom-id']\n }\n if (this['exam-answer-relation-type']) {\n result.examAnswerRelationType = this['exam-answer-relation-type']\n }\n\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = {\n customId: this['custom-id'] || undefined,\n answerType: SubjectType.SCALE,\n orderIndex: this['order-index'],\n }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this._resolvedAnswers()\n const questions = this._resolvedQuestions()\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n\n if (answers.length < 3 || answers.length > 5) {\n errors.push(this._createAnswerCountError(row))\n return errors\n }\n\n answers.forEach((answer: ScaleAnswer, index: number) => {\n if (!answer.title) {\n errors.push(new SubjectError(`选项${String.fromCharCode(65 + index)}未填写`, 'ANSWER_EMPTY', 'answers', row))\n }\n })\n\n if (questions.length === 0) {\n errors.push(new SubjectError('行标题不能为空!', 'EMPTY_ROW_TITLE', 'rowTitle', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const answers = this._resolvedAnswers()\n const questions = this._resolvedQuestions()\n const colWidth = Math.floor(100 / ((answers.length || 1) + 1))\n const previewTitle = joinSubjectTitle(\n resolveSubjectPrefix(this['subject-prefix'], `${this['order-index'] + 1}.`),\n this.title,\n )\n\n return html`\n <div class=\"preview\">\n <span class=\"title\">${previewTitle}(量表题)</span>\n ${this['show-rich-text'] && this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n <div class=\"scale-table-wrap\">\n <table class=\"scale-table\">\n <thead>\n <tr>\n <th style=\"width:${colWidth}%\">问题 \\ 选项</th>\n ${answers.map(answer => html`<th style=\"width:${colWidth}%\">${answer.title}</th>`)}\n </tr>\n </thead>\n <tbody>\n ${questions.map(question => html`\n <tr>\n <td>${question}</td>\n ${answers.map(() => html`<td><input type=\"radio\" disabled /></td>`)}\n </tr>\n `)}\n </tbody>\n </table>\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\n rows=\"2\"\n .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【量表题】请输入问题\"\n ></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>行标题:</span></div>\n <div class=\"flex\" style=\"flex:1\">\n <div class=\"el-input\" style=\"width:160px\">\n <textarea\n class=\"row-title-textarea\"\n .value=${this._rowTitle}\n @input=${(e: Event) => { this._rowTitle = (e.target as HTMLTextAreaElement).value }}\n @keydown=${(e: KeyboardEvent) => { e.stopPropagation() }}\n placeholder=\"请输入行标题\"\n ></textarea>\n </div>\n <div style=\"flex:1;margin-left:12px\">\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">${String.fromCharCode(65 + index)}.</span>\n <div class=\"input\">\n <input\n type=\"text\"\n .value=${answer.title}\n maxlength=\"10\"\n @input=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._answers = this._answers.map((item, currentIndex) =>\n currentIndex === index ? { ...item, title: value } : item,\n )\n }}\n placeholder=\"选项${index + 1}\"\n />\n </div>\n <span\n class=\"icon\"\n @click=${() => {\n if (this._answers.length < 5) {\n this._answers = [...this._answers, createEmptyScaleAnswer()]\n }\n }}\n >${iconPlus}</span>\n <span\n class=\"icon ${this._answers.length < 3 ? 'disabled' : ''}\"\n @click=${() => {\n if (this._answers.length > 3) {\n this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index)\n }\n }}\n >${iconRemove}</span>\n </div>\n `)}\n </div>\n </div>\n </div>\n\n ${this['show-rich-text'] && 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 <slot name=\"sub-text\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n @input=${(e: CustomEvent) => { this._richText = (e.target as any).getContent() }}\n ></qxs-blocksuite-editor>\n </slot>\n ${!this['show-action']\n ? html`\n <div class=\"flex-justify-end\" style=\"margin-top:8px\">\n <span\n class=\"el-link danger\"\n @click=${() => {\n this._showRichText = false\n this._richText = ''\n }}\n >删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\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 <div class=\"el-input\">\n <textarea\n rows=\"2\"\n .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"\n ></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n private _renderSorting() {\n const title = trimText(this['is-edit'] ? this._title : this.title || '') || '未命名题目'\n const orderText = joinSubjectTitle(\n resolveSubjectPrefix(this['subject-prefix'], `${this['order-index'] + 1}. `),\n title,\n )\n return renderSortingCard(orderText, SubjectTypeLabel[SubjectType.SCALE] || SubjectType.SCALE)\n }\n\n render() {\n if (this.sorting) {\n return this._renderSorting()\n }\n\n const content = this['is-edit']\n ? html`<div slot=\"edit\">${this._renderEdit()}</div>`\n : html`<div slot=\"preview\">${this._renderPreview()}</div>`\n\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n ${content}\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this['show-rich-text'] && this._showRichText}\n .hide-add-rich-text=${!this['show-rich-text'] || this['hide-add-rich-text']}\n .show-delete-action=${this['show-delete-action']}\n .show-save-action=${this['show-save-action']}\n .show-other-option=${false}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n <slot name=\"action\"></slot>\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["createEmptyScaleAnswer","title","createDefaultScaleAnswers","Array","from","length","normalizeScaleAnswer","answer","next","trimText","answerId","examAnswerId","isCorrect","serializeScaleAnswer","index","orderIndex","iconPlus","html","iconRemove","QxsScale","LitElement","constructor","super","arguments","this","sorting","analysis","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","_scaleQuestions","_rowTitle","_title","_analysis","_showRichText","_richText","TITLE_MAX","value","answers","isArray","map","normalizeScaleAnswers","requestUpdate","item","String","trim","filter","Boolean","normalizeScaleQuestionList","willUpdate","changed","shouldSyncProps","has","_syncProps","join","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","slice","_resolvedQuestions","rowTitle","split","_resolvedAnswers","_createAnswerCountError","row","SubjectError","toJSON","customId","answerType","SubjectType","SCALE","questions","richText","showRichText","i","fromCharCode","examTypeEnum","scaleQuestionList","examRichTextContent","isSetCorrectAnswer","examAnswerRelationType","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","forEach","_renderPreview","colWidth","Math","floor","previewTitle","joinSubjectTitle","resolveSubjectPrefix","question","_renderEdit","stopPropagation","currentIndex","_","getContent","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","Number","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"gZAgBA,SAASA,IACP,MAAO,CAAEC,MAAO,GAClB,CAEA,SAASC,IACP,OAAOC,MAAMC,KAAK,CAAEC,OAAQ,GAAKL,EACnC,CAEA,SAASM,EAAqBC,GAC5B,MAAMC,EAAoB,IACrBD,EACHN,MAAOQ,EAAAA,SAASF,GAAQN,OAASM,GAAQA,QAAU,KAE/CG,EAAWH,GAAQG,UAAYH,GAAQI,aAO7C,YANiB,IAAbD,IACFF,EAAKE,SAAWA,UAEXF,EAAKD,cACLC,EAAKG,oBACLH,EAAKI,UACLJ,CACT,CAsBA,SAASK,EAAqBN,EAAaO,GACzC,MAAMN,EAAoB,IACrBF,EAAqBC,GACxBQ,WAAYD,EAAQ,EACpBP,OAAQE,EAAAA,SAASF,GAAQN,OAASM,GAA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