@qxs-bns/components-wc 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/subject/blank-fill.mjs +23 -48
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/list.mjs +57 -99
- package/es/subject/list.mjs.map +1 -1
- package/es/subject/scale.mjs +72 -143
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +38 -64
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/text-fill.mjs +13 -37
- package/es/subject/text-fill.mjs.map +1 -1
- package/lib/subject/blank-fill.cjs +10 -35
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/list.cjs +16 -58
- package/lib/subject/list.cjs.map +1 -1
- package/lib/subject/scale.cjs +71 -142
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +39 -65
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/text-fill.cjs +14 -38
- package/lib/subject/text-fill.cjs.map +1 -1
- package/package.json +1 -1
package/lib/subject/list.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.cjs","sources":["../../../../packages/components-wc/src/subject/list.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport Sortable from 'sortablejs'\nimport { safeCustomElement } from '../base/define'\nimport { uid } from '../base/uid'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\n// 导入子组件以确保它们被注册为 Custom Elements\nimport './action'\nimport './blank-fill'\nimport './layout'\nimport './text-fill'\nimport './scale'\nimport './page-end'\nimport './type'\n\n@safeCustomElement('qxs-subject-list')\nexport class QxsSubjectList extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 13px; }\n *, ::before, ::after { box-sizing: border-box; }\n .sort-mode-toggle { display: flex; justify-content: flex-end; margin-bottom: 12px; }\n .btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; font-size: 12px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266; cursor: pointer; transition: all 0.2s; }\n .btn:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .btn.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .btn.primary:hover { background: #3D61E3; border-color: #3D61E3; }\n .subject-list { display: flex; flex-direction: column; }\n .subject-content { flex: 1; min-width: 0; }\n .ghost { opacity: 0.5; background: #ecf5ff; }\n .chosen { box-shadow: 0 4px 16px rgba(64,158,255,.3); }\n .sort-list { display: flex; flex-direction: column; gap: 8px; }\n .sort-item { display: flex; align-items: center; padding: 12px 16px; background: #f8f9fa; border: 1px solid #e4e7ed; border-radius: 6px; cursor: grab; transition: all 0.3s ease; }\n .sort-item:hover { background: #ecf5ff; border-color: #c6e2ff; }\n .sort-item:active { cursor: grabbing; }\n .sort-item.sort-ghost { opacity: 0.5; background: #ecf5ff; border: 2px dashed #409eff; }\n .sort-item.sort-chosen { background: #ecf5ff; border-color: #409eff; box-shadow: 0 4px 16px rgba(64,158,255,.3); transform: scale(1.02); }\n .sort-handle { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 12px; color: #909399; flex-shrink: 0; }\n .sort-index { font-size: 13px; color: #606266; font-weight: 500; margin-right: 8px; min-width: 24px; flex-shrink: 0; }\n .sort-title { flex: 1; font-size: 14px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .sort-type { font-size: 12px; color: #909399; margin-left: 12px; padding: 2px 8px; background: #f0f0f0; border-radius: 4px; flex-shrink: 0; }\n `\n\n @property({ attribute: 'is-preview' }) 'is-preview' = false\n\n // use-model: enables two-way binding via model-value attribute + list-change event\n @property({ attribute: 'use-model' }) 'use-model': string | null = null\n @property({ attribute: 'model-value' })\n get 'model-value'(): string { return JSON.stringify(this._list) }\n\n set 'model-value'(v: string) {\n if (!v || v === this._modelValueAttr) { return }\n this._modelValueAttr = v\n try {\n const parsed = JSON.parse(v)\n if (Array.isArray(parsed)) {\n this._list = this._normalizeIncomingList(parsed)\n this.requestUpdate()\n }\n }\n catch { /* invalid JSON, ignore */ }\n }\n\n private get _useModel(): boolean {\n return this['use-model'] === 'true' || this['use-model'] === '' || this.hasAttribute('use-model')\n }\n\n private _modelValueAttr = ''\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: 'category-list' }) 'category-list': any[] = []\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-ai' }) 'show-ai' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n @property({ type: Boolean, attribute: 'show-jump' }) 'show-jump' = false\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-key' }) 'show-key' = false\n @property({ type: String, attribute: 'search-api' }) 'search-api' = ''\n @property({ type: Object, attribute: 'search-handler' }) 'search-handler'?: (query: string, answerType: number) => Promise<any[]>\n\n @property({ type: Array, attribute: 'subject-list' })\n get 'subject-list'() { return this._list }\n\n set 'subject-list'(v: any) {\n if (!v) {\n this._list = []\n return\n }\n if (typeof v === 'string') {\n try {\n v = JSON.parse(v)\n }\n catch {\n this._list = []\n this.requestUpdate()\n return\n }\n }\n if (!Array.isArray(v)) {\n this._list = []\n this.requestUpdate()\n return\n }\n this._list = this._normalizeIncomingList(v)\n this.requestUpdate()\n }\n\n attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null) {\n super.attributeChangedCallback(name, oldVal, newVal)\n if (name === 'subject-list' && newVal && !this._list.length) {\n if (newVal.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(newVal)\n if (Array.isArray(parsed)) {\n this._list = this._normalizeIncomingList(parsed)\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n }\n\n @state() private _list: any[] = []\n @state() private _sortMode = false\n private _sortable: Sortable | null = null\n\n private get _isPreviewValue(): boolean {\n const val = this['is-preview']\n return typeof val === 'string' ? val !== 'false' : !!val\n }\n\n private _initialDataProcessed = false\n\n connectedCallback() {\n super.connectedCallback()\n if (!this._initialDataProcessed) {\n this._initialDataProcessed = true\n Promise.resolve().then(() => {\n if (this._list.length === 0) {\n this._processAttributeList()\n }\n })\n }\n }\n\n private _processAttributeList() {\n const attr = this.getAttribute('subject-list')\n if (!attr || attr === '[]') { return }\n if (attr.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(attr)\n if (Array.isArray(parsed) && parsed.length > 0) {\n this._list = this._normalizeIncomingList(parsed)\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n\n private _normalizeAnswer(answer: any) {\n return {\n ...answer,\n title: String(answer?.title ?? answer?.answer ?? ''),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }\n }\n\n private _normalizeItem(item: any) {\n const answerType = item?.answerType || (!item?.richTextContent ? item?.examTypeEnum : item?.answerType)\n const answers = Array.isArray(item?.answers) ? item.answers.map((answer: any) => this._normalizeAnswer(answer)) : []\n return {\n ...item,\n customId: item?.customId || uid(),\n ...(answerType ? { answerType } : {}),\n ...(answers.length || Array.isArray(item?.answers) ? { answers } : {}),\n }\n }\n\n private _rebuildPageEndMarkers(items: any[]) {\n if (!items.length) { return items }\n if (items.some(item => item?.answerType === 'page_end')) { return items }\n if (!items.some(item => Number(item?.pageIndex) > 1)) { return items }\n\n let currentPageIndex = 1\n const rebuilt: any[] = []\n\n items.forEach((item) => {\n const pageIndex = Number(item?.pageIndex) || 1\n if (pageIndex > currentPageIndex) {\n if (rebuilt.length > 0) {\n while (currentPageIndex < pageIndex) {\n rebuilt.push({ customId: uid(), answerType: 'page_end' })\n currentPageIndex++\n }\n }\n else {\n currentPageIndex = pageIndex\n }\n }\n rebuilt.push(item)\n })\n\n return rebuilt\n }\n\n private _normalizeIncomingList(items: any[]) {\n const normalized = items.map((item: any) => this._normalizeItem(item))\n return this._rebuildPageEndMarkers(normalized)\n }\n\n firstUpdated() {\n this.updateComplete.then(() => this._initSortable())\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('_sortMode')) {\n this._sortable?.destroy()\n this._sortable = null\n this.updateComplete.then(() => this._initSortable())\n }\n // Reinitialize Sortable when list changes in sort mode\n if (changed.has('_list') && this._sortMode) {\n // Small delay to let Lit finish DOM updates\n setTimeout(() => {\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n this._initSortable()\n }, 50)\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._sortable?.destroy()\n this._sortable = null\n }\n\n private _initSortable() {\n if (!this._sortMode) { return }\n const el = this.renderRoot.querySelector<HTMLElement>('.sort-list')\n if (!el) { return }\n\n // Destroy existing instance first\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n\n // Small delay to ensure DOM is ready after previous destroy\n requestAnimationFrame(() => {\n const currentEl = this.renderRoot.querySelector<HTMLElement>('.sort-list')\n if (!currentEl || this._sortable) { return }\n\n this._sortable = Sortable.create(currentEl, {\n handle: '.sort-handle',\n animation: 200,\n ghostClass: 'sort-ghost',\n chosenClass: 'sort-chosen',\n onEnd: (evt) => {\n const { oldIndex, newIndex } = evt\n if (oldIndex === undefined || newIndex === undefined || oldIndex === newIndex) { return }\n const arr = [...this._list]\n const [item] = arr.splice(oldIndex, 1)\n arr.splice(newIndex, 0, item)\n this._list = arr\n this._emitListChange()\n },\n })\n })\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _emitListChange() {\n this._emit('change', this._list)\n if (this._useModel) {\n this._modelValueAttr = JSON.stringify(this._list)\n this._emit('list-change', this._list)\n }\n }\n\n private _withPageIndex(items: any[]) {\n const serialized: any[] = []\n let pageIndex = 1\n let pendingBoundary = false\n\n items.forEach((item) => {\n if (!item) { return }\n if (item.answerType === 'page_end') {\n if (serialized.length > 0) {\n pendingBoundary = true\n }\n return\n }\n if (pendingBoundary) {\n pageIndex += 1\n pendingBoundary = false\n }\n serialized.push({\n ...item,\n pageIndex,\n })\n })\n\n return serialized\n }\n\n async toJSON(): Promise<any[]> {\n const subjectEls = this.renderRoot.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-page-end, qxs-subject-rich-text',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return []\n }\n\n const results: any[] = []\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.toJSON === 'function') {\n try {\n const data = await el.toJSON()\n results.push(data)\n }\n catch (err: any) {\n if (err instanceof SubjectError) {\n errors.push(err)\n }\n else {\n errors.push(new SubjectError(err.message || '未知错误', 'UNKNOWN', 'unknown'))\n }\n }\n }\n }\n\n if (errors.length > 0) {\n throw errors\n }\n\n return this._withPageIndex(results)\n }\n\n async validate(): Promise<{ valid: boolean, errors: SubjectError[] }> {\n const subjectEls = this.renderRoot.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-page-end',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return { valid: true, errors: [] }\n }\n\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.validate === 'function') {\n const errs = el.validate()\n if (errs?.length) {\n errors.push(...errs)\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n }\n\n // ── public API ────────────────────────────────────────────────\n get currentList() { return this._list }\n\n addSubject(type: string, index?: number, examAnswerRelationType: number | null = null) {\n // 分页符只需要最少的必要字段\n if (type === 'page_end') {\n const pageEndItem = {\n customId: uid(),\n answerType: 'page_end',\n }\n const arr = [...this._list]\n if (typeof index === 'number' && index >= 0) {\n arr.splice(index + 1, 0, pageEndItem)\n }\n else {\n arr.push(pageEndItem)\n }\n this._list = arr\n this.requestUpdate()\n this._emitListChange()\n return\n }\n\n const item = {\n customId: uid(), answerType: type, title: '',\n answers: [], analysis: '', scaleQuestionList: [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n isKey: false, answerCheckType: 1,\n examAnswerRelationType: examAnswerRelationType ?? 0,\n }\n const arr = [...this._list]\n if (typeof index === 'number' && index >= 0) {\n arr.splice(index + 1, 0, item)\n }\n else { arr.push(item) }\n this._list = arr\n this.requestUpdate()\n this._emitListChange()\n }\n\n addExam(items: any[]) {\n const newItems = this._normalizeIncomingList(items).map((item: any) => ({\n ...item,\n isEdit: true,\n isSave: false,\n isRealCanDel: true,\n hasSet: false,\n }))\n this._list = [...this._list, ...newItems]\n this._emitListChange()\n }\n\n uploadExcel(list: any[]) {\n this._list = [\n ...this._list,\n ...this._normalizeIncomingList(list).map((item: any) => ({ ...item, isRealCanDel: true })),\n ]\n this._emitListChange()\n }\n\n setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const item = this._list.find((v: any) => v.customId === customId)\n if (item) {\n const ans = item.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (ans) { ans.answerRelations = answerRelations }\n }\n this.requestUpdate()\n this._emitListChange()\n }\n\n setTagList(tagList: any[], customId: string) {\n const item = this._list.find((v: any) => v.customId === customId)\n if (item) {\n item.tagInfos = Array.isArray(tagList) ? tagList : []\n item.memberTagInfo = Array.isArray(tagList) ? tagList : []\n this._list = [...this._list]\n this._emitListChange()\n return\n }\n this.requestUpdate()\n }\n\n // ── private helpers ───────────────────────────────────────────\n private _orderIndex(customId: string) {\n let n = 0; let out = 0\n this._list.forEach((v: any) => {\n n++; if (v.customId === customId) { out = n }\n })\n return out - 1\n }\n\n private _move(index: number, dir: 'up' | 'down') {\n const arr = [...this._list]\n if (dir === 'up' && index > 0) { [arr[index - 1], arr[index]] = [arr[index], arr[index - 1]] }\n else if (dir === 'down' && index < arr.length - 1) { [arr[index], arr[index + 1]] = [arr[index + 1], arr[index]] }\n this._list = arr\n this._emitListChange()\n }\n\n private _save(index: number, e: CustomEvent) {\n this._list = this._list.map((item, i) =>\n i === index ? { ...item, ...e.detail, isEdit: false, isSave: true } : item,\n )\n this._emitListChange()\n }\n\n private _deleteByCustomId(customId: string) {\n this._list = this._list.filter(item => item.customId !== customId)\n this._emitListChange()\n }\n\n private _delete(index: number) {\n const arr = [...this._list]\n arr.splice(index, 1)\n this._list = arr\n this._emitListChange()\n }\n\n private _setEdit(index: number, val: boolean) {\n this._list = this._list.map((item, i) => i === index ? { ...item, isEdit: val } : item)\n }\n\n private _pageEndTotal() {\n return this._list.filter(item => item.answerType === 'page_end').length + 1\n }\n\n private _pageEndIndex(index: number) {\n return this._list.slice(0, index + 1).filter(item => item.answerType === 'page_end').length\n }\n\n private _syncRelationAnswer(index: number, detail: any) {\n const item = this._list[index]\n if (!item || !Array.isArray(item.answers) || !detail?.answer) { return }\n const answers = [...item.answers]\n const currentAnswer = detail.answer\n let answerIndex = typeof detail.answerIndex === 'number' ? detail.answerIndex : -1\n\n if (answerIndex < 0 || answerIndex >= answers.length) {\n answerIndex = answers.findIndex((answer: any, currentIndex: number) => {\n return String(answer.customAnswerId || '') === String(currentAnswer.customAnswerId || '')\n || String(answer.answerId || '') === String(currentAnswer.answerId || '')\n || String(answer.orderIndex || currentIndex + 1) === String(currentAnswer.orderIndex || '')\n })\n }\n\n if (answerIndex < 0) { return }\n answers[answerIndex] = {\n ...answers[answerIndex],\n customAnswerId: currentAnswer.customAnswerId || answers[answerIndex].customAnswerId || currentAnswer.answerId,\n }\n this._list[index] = {\n ...item,\n answers,\n }\n this._list = [...this._list]\n }\n\n private _renderItem(item: any, index: number) {\n const common = {\n 'order-index': this._orderIndex(item.customId),\n '?is-edit': item.isEdit || false,\n '?is-set': item.hasSet || false,\n '?is-save': !item.isRealCanDel,\n '?show-action': !this._isPreviewValue,\n 'exam-answer-relation-type': item.examAnswerRelationType ?? 0,\n }\n const onMove = (e: CustomEvent) => this._move(index, e.detail as 'up' | 'down')\n const onDelete = () => this._deleteByCustomId(item.customId)\n const onSave = (e: CustomEvent) => this._save(index, e)\n const onEdit = () => this._setEdit(index, true)\n const onAdd = (e: CustomEvent) => this.addSubject(e.detail?.type ?? e.detail, index)\n\n if ([SubjectType.SINGLE, SubjectType.MULTIPLE, SubjectType.SORT].includes(item.answerType)) {\n return html`<qxs-subject-single\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .tag-list=${item.tagInfos || item.memberTagInfo || []}\n .category-list=${this['category-list']}\n .resource-list=${item.examResourceBOList || item.resourceList || []}\n .search-handler=${this['search-handler']}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit}\n .is-set=${!!item.hasSet}\n .is-save=${!item.isRealCanDel}\n .show-action=${!this._isPreviewValue}\n .show-add=${this['show-add']}\n .show-answer-setting=${this['show-answer-setting']}\n .show-key=${this['show-key']}\n .show-tag=${this['show-tag']}\n .show-category=${this['show-category']}\n .show-ai=${this['show-ai']}\n .show-resource=${this['show-resource']}\n .show-jump=${this['show-jump']}\n .is-key=${!!item.isKey}\n question-type=${String(item.answerType)}\n answer-check-type=${item.answerCheckType ?? 1}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n .least-answer-count=${Number(item.leastAnswerCount) || 0}\n exam-expand=${item.examExpand || ''}\n category-id=${item.categoryId || item.category?.categoryId || ''}\n ai-answer=${item.aiAnswer || ''}\n search-api=${this['search-api']}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @set-key=${(e: CustomEvent) => {\n this._list[index].isKey = e.detail.value\n this.requestUpdate()\n }}\n @title-select=${(e: CustomEvent) => this._emit('title-select', e.detail)}\n @choose-tag=${(e: CustomEvent) => this._emit('choose-tag', { ...e.detail, item: this._list[index] })}\n @tag-change=${(e: CustomEvent) => {\n this._list[index].tagInfos = e.detail.value\n this._list[index].memberTagInfo = e.detail.value\n this.requestUpdate()\n }}\n @category-change=${(e: CustomEvent) => {\n this._list[index].categoryId = e.detail.value\n this.requestUpdate()\n }}\n @jump=${(e: CustomEvent) => this._emit('jump', { ...e.detail, item: this._list[index] })}\n @set-relation=${(e: CustomEvent) => {\n this._syncRelationAnswer(index, e.detail)\n this._emit('set-relation', { ...e.detail, item: this._list[index] })\n }}\n ></qxs-subject-single>`\n }\n if (item.answerType === SubjectType.BLANK_FILL) {\n return html`<qxs-blank-fill\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .tag-list=${item.tagInfos || item.memberTagInfo || []}\n .category-list=${this['category-list']}\n .resource-list=${item.examResourceBOList || item.resourceList || []}\n .exam-answer-setting=${item.examAnswerSettingBO || item.examAnswerSettingVO || {}}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit} .is-set=${!!item.hasSet} .is-save=${!item.isRealCanDel} .show-action=${!this._isPreviewValue} .show-add=${this['show-add']}\n .show-answer-setting=${this['show-answer-setting']}\n .show-tag=${this['show-tag']}\n .show-category=${this['show-category']}\n .show-resource=${this['show-resource']}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n category-id=${item.categoryId || item.category?.categoryId || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @choose-tag=${(e: CustomEvent) => this._emit('choose-tag', { ...e.detail, item: this._list[index] })}\n @tag-change=${(e: CustomEvent) => {\n this._list[index].tagInfos = e.detail.value\n this._list[index].memberTagInfo = e.detail.value\n this.requestUpdate()\n }}\n @category-change=${(e: CustomEvent) => {\n this._list[index].categoryId = e.detail.value\n this.requestUpdate()\n }}\n ></qxs-blank-fill>`\n }\n if (item.answerType === SubjectType.TEXT_FILL) {\n return html`<qxs-text-fill\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .tag-list=${item.tagInfos || item.memberTagInfo || []}\n .category-list=${this['category-list']}\n .resource-list=${item.examResourceBOList || item.resourceList || []}\n .search-handler=${this['search-handler']}\n .exam-answer-setting=${item.examAnswerSettingBO || item.examAnswerSettingVO || {}}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit} .is-set=${!!item.hasSet} .is-save=${!item.isRealCanDel} .show-action=${!this._isPreviewValue} .show-add=${this['show-add']}\n .show-answer-setting=${this['show-answer-setting']}\n .show-tag=${this['show-tag']}\n .show-category=${this['show-category']}\n .show-resource=${this['show-resource']}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n category-id=${item.categoryId || item.category?.categoryId || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @choose-tag=${(e: CustomEvent) => this._emit('choose-tag', { ...e.detail, item: this._list[index] })}\n @tag-change=${(e: CustomEvent) => {\n this._list[index].tagInfos = e.detail.value\n this._list[index].memberTagInfo = e.detail.value\n this.requestUpdate()\n }}\n @category-change=${(e: CustomEvent) => {\n this._list[index].categoryId = e.detail.value\n this.requestUpdate()\n }}\n ></qxs-text-fill>`\n }\n if (item.answerType === SubjectType.SCALE) {\n return html`<qxs-scale\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .scale-questions=${item.scaleQuestionList || []}\n .tag-list=${item.tagInfos || item.memberTagInfo || []}\n .category-list=${this['category-list']}\n .resource-list=${item.examResourceBOList || item.resourceList || []}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit} .is-set=${!!item.hasSet} .is-save=${!item.isRealCanDel} .show-action=${!this._isPreviewValue} .show-add=${this['show-add']}\n .show-tag=${this['show-tag']}\n .show-category=${this['show-category']}\n .show-resource=${this['show-resource']}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n category-id=${item.categoryId || item.category?.categoryId || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @choose-tag=${(e: CustomEvent) => this._emit('choose-tag', { ...e.detail, item: this._list[index] })}\n @tag-change=${(e: CustomEvent) => {\n this._list[index].tagInfos = e.detail.value\n this._list[index].memberTagInfo = e.detail.value\n this.requestUpdate()\n }}\n @category-change=${(e: CustomEvent) => {\n this._list[index].categoryId = e.detail.value\n this.requestUpdate()\n }}\n ></qxs-scale>`\n }\n if (item.answerType === 'page_end') {\n return html`<qxs-page-end\n .current-page-index=${item.currentPageIndex || this._pageEndIndex(index)}\n .total-page=${item.totalPage || this._pageEndTotal()}\n .show-action=${!this._isPreviewValue}\n .show-add=${this['show-add']}\n custom-id=${item.customId || ''}\n @delete=${onDelete}\n @add=${onAdd}\n ></qxs-page-end>`\n }\n return html`<div style=\"color:#909399;padding:8px\">未知题型: ${item.answerType}</div>`\n }\n\n render() {\n return html`\n <div class=\"subject-list\">\n ${this._list.map((item, index) => this._renderItem(item, index))}\n </div>\n `\n }\n}\n\nexport function register() {}\n"],"names":["QxsSubjectList","LitElement","constructor","super","arguments","this","_modelValueAttr","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_list","_sortMode","_sortable","_initialDataProcessed","JSON","stringify","v","parsed","parse","Array","isArray","_normalizeIncomingList","requestUpdate","_useModel","hasAttribute","attributeChangedCallback","name","oldVal","newVal","length","includes","_isPreviewValue","val","connectedCallback","then","_processAttributeList","attr","getAttribute","_normalizeAnswer","answer","title","String","answerId","examAnswerId","_normalizeItem","item","answerType","richTextContent","examTypeEnum","answers","map","customId","uid","_rebuildPageEndMarkers","items","some","Number","pageIndex","currentPageIndex","rebuilt","forEach","push","normalized","firstUpdated","updateComplete","_initSortable","updated","changed","has","destroy","setTimeout","disconnectedCallback","renderRoot","querySelector","requestAnimationFrame","currentEl","Sortable","create","handle","animation","ghostClass","chosenClass","onEnd","evt","oldIndex","newIndex","arr","splice","_emitListChange","_emit","detail","dispatchEvent","CustomEvent","bubbles","composed","_withPageIndex","serialized","pendingBoundary","toJSON","subjectEls","querySelectorAll","results","errors","el","data","err","SubjectError","message","validate","valid","errs","currentList","addSubject","type","index","examAnswerRelationType","undefined","pageEndItem","analysis","scaleQuestionList","isEdit","isSave","isRealCanDel","hasSet","isKey","answerCheckType","addExam","newItems","uploadExcel","list","setAnswerRelation","answerRelations","customAnswerId","find","ans","c","setTagList","tagList","tagInfos","memberTagInfo","_orderIndex","n","out","_move","dir","_save","i","_deleteByCustomId","filter","_delete","_setEdit","_pageEndTotal","_pageEndIndex","slice","_syncRelationAnswer","currentAnswer","answerIndex","findIndex","currentIndex","orderIndex","_renderItem","common","onMove","onDelete","onSave","onEdit","onAdd","SubjectType","SINGLE","MULTIPLE","SORT","html","examResourceBOList","resourceList","examRichTextContent","leastAnswerCount","examExpand","categoryId","category","aiAnswer","examId","value","BLANK_FILL","examAnswerSettingBO","examAnswerSettingVO","TEXT_FILL","SCALE","totalPage","render","styles","css","__decorateClass","property","attribute","prototype","Object","Boolean","state","safeCustomElement"],"mappings":"ujBAkBaA,QAAAA,eAAN,cAA6BC,EAAAA,WAA7BC,WAAAA,GAAAC,SAAAC,WAyBkCC,KAAA,eAAe,EAGhBA,KAAA,aAA6B,KAqBnEA,KAAQC,gBAAkB,GAG1BD,KAAA,gBA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AMmF,QAASH,UAAW,cArE3B3M,QAAAA,eAqEyC4M,UAAA,WAAA,GACCH,EAAA,CAApDC,EAAAA,SAAS,CAAE/E,KAAMxE,OAAQwJ,UAAW,gBAtE1B3M,QAAAA,eAsE0C4M,UAAA,aAAA,GACIH,EAAA,CAAxDC,EAAAA,SAAS,CAAE/E,KAAMkF,OAAQF,UAAW,oBAvE1B3M,QAAAA,eAuE8C4M,UAAA,iBAAA,GAGrDH,EAAA,CADHC,EAAAA,SAAS,CAAE/E,KAAM9F,MAAO8K,UAAW,kBAzEzB3M,QAAAA,eA0EP4M,UAAA,eAAA,GA6CaH,EAAA,CAAhBM,EAAAA,SAvHU/M,QAAAA,eAuHM4M,UAAA,QAAA,GACAH,EAAA,CAAhBM,EAAAA,SAxHU/M,QAAAA,eAwHM4M,UAAA,YAAA,GAxHN5M,QAAAA,eAANyM,EAAA,CADNO,EAAAA,kBAAkB,qBACNhN,QAAAA"}
|
|
1
|
+
{"version":3,"file":"list.cjs","sources":["../../../../packages/components-wc/src/subject/list.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport Sortable from 'sortablejs'\nimport { safeCustomElement } from '../base/define'\nimport { uid } from '../base/uid'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\n// 导入子组件以确保它们被注册为 Custom Elements\nimport './action'\nimport './blank-fill'\nimport './layout'\nimport './text-fill'\nimport './scale'\nimport './page-end'\nimport './type'\n\n@safeCustomElement('qxs-subject-list')\nexport class QxsSubjectList extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 13px; }\n *, ::before, ::after { box-sizing: border-box; }\n .sort-mode-toggle { display: flex; justify-content: flex-end; margin-bottom: 12px; }\n .btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; font-size: 12px; border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266; cursor: pointer; transition: all 0.2s; }\n .btn:hover { color: #3D61E3; border-color: #3D61E3; background: #ecf5ff; }\n .btn.primary { background: #3D61E3; border-color: #3D61E3; color: #fff; }\n .btn.primary:hover { background: #3D61E3; border-color: #3D61E3; }\n .subject-list { display: flex; flex-direction: column; }\n .subject-content { flex: 1; min-width: 0; }\n .ghost { opacity: 0.5; background: #ecf5ff; }\n .chosen { box-shadow: 0 4px 16px rgba(64,158,255,.3); }\n .sort-list { display: flex; flex-direction: column; gap: 8px; }\n .sort-item { display: flex; align-items: center; padding: 12px 16px; background: #f8f9fa; border: 1px solid #e4e7ed; border-radius: 6px; cursor: grab; transition: all 0.3s ease; }\n .sort-item:hover { background: #ecf5ff; border-color: #c6e2ff; }\n .sort-item:active { cursor: grabbing; }\n .sort-item.sort-ghost { opacity: 0.5; background: #ecf5ff; border: 2px dashed #409eff; }\n .sort-item.sort-chosen { background: #ecf5ff; border-color: #409eff; box-shadow: 0 4px 16px rgba(64,158,255,.3); transform: scale(1.02); }\n .sort-handle { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 12px; color: #909399; flex-shrink: 0; }\n .sort-index { font-size: 13px; color: #606266; font-weight: 500; margin-right: 8px; min-width: 24px; flex-shrink: 0; }\n .sort-title { flex: 1; font-size: 14px; color: #303133; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .sort-type { font-size: 12px; color: #909399; margin-left: 12px; padding: 2px 8px; background: #f0f0f0; border-radius: 4px; flex-shrink: 0; }\n `\n\n @property({ attribute: 'is-preview' }) 'is-preview' = false\n\n // use-model: enables two-way binding via model-value attribute + list-change event\n @property({ attribute: 'use-model' }) 'use-model': string | null = null\n @property({ attribute: 'model-value' })\n get 'model-value'(): string { return JSON.stringify(this._list) }\n\n set 'model-value'(v: string) {\n if (!v || v === this._modelValueAttr) { return }\n this._modelValueAttr = v\n try {\n const parsed = JSON.parse(v)\n if (Array.isArray(parsed)) {\n this._list = this._normalizeIncomingList(parsed)\n this.requestUpdate()\n }\n }\n catch { /* invalid JSON, ignore */ }\n }\n\n private get _useModel(): boolean {\n return this['use-model'] === 'true' || this['use-model'] === '' || this.hasAttribute('use-model')\n }\n\n private _modelValueAttr = ''\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: 'category-list' }) 'category-list': any[] = []\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-ai' }) 'show-ai' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n @property({ type: Boolean, attribute: 'show-jump' }) 'show-jump' = false\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-key' }) 'show-key' = false\n @property({ type: String, attribute: 'search-api' }) 'search-api' = ''\n @property({ type: Object, attribute: 'search-handler' }) 'search-handler'?: (query: string, answerType: number) => Promise<any[]>\n\n @property({ type: Array, attribute: 'subject-list' })\n get 'subject-list'() { return this.currentList }\n\n set 'subject-list'(v: any) {\n if (!v) {\n this._list = []\n return\n }\n if (typeof v === 'string') {\n try {\n v = JSON.parse(v)\n }\n catch {\n this._list = []\n this.requestUpdate()\n return\n }\n }\n if (!Array.isArray(v)) {\n this._list = []\n this.requestUpdate()\n return\n }\n this._list = this._normalizeIncomingList(v)\n this.requestUpdate()\n }\n\n attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null) {\n super.attributeChangedCallback(name, oldVal, newVal)\n if (name === 'subject-list' && newVal && !this._list.length) {\n if (newVal.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(newVal)\n if (Array.isArray(parsed)) {\n this._list = this._normalizeIncomingList(parsed)\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n }\n\n @state() private _list: any[] = []\n @state() private _sortMode = false\n private _sortable: Sortable | null = null\n\n private get _isPreviewValue(): boolean {\n const val = this['is-preview']\n return typeof val === 'string' ? val !== 'false' : !!val\n }\n\n private _initialDataProcessed = false\n\n connectedCallback() {\n super.connectedCallback()\n if (!this._initialDataProcessed) {\n this._initialDataProcessed = true\n Promise.resolve().then(() => {\n if (this._list.length === 0) {\n this._processAttributeList()\n }\n })\n }\n }\n\n private _processAttributeList() {\n const attr = this.getAttribute('subject-list')\n if (!attr || attr === '[]') { return }\n if (attr.includes('[object Object]')) {\n return\n }\n try {\n const parsed = JSON.parse(attr)\n if (Array.isArray(parsed) && parsed.length > 0) {\n this._list = this._normalizeIncomingList(parsed)\n this.requestUpdate()\n }\n }\n catch {\n // Not valid JSON, ignore\n }\n }\n\n private _normalizeAnswer(answer: any) {\n return {\n ...answer,\n title: String(answer?.title ?? answer?.answer ?? ''),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }\n }\n\n private _normalizeScaleQuestionList(item: any) {\n const raw = Array.isArray(item?.scaleQuestionList)\n ? item.scaleQuestionList\n : Array.isArray(item?.scaleQuestions)\n ? item.scaleQuestions\n : Array.isArray(item?.['scale-question-list'])\n ? item['scale-question-list']\n : undefined\n\n if (raw === undefined) {\n return undefined\n }\n\n return raw\n .map((question: any) => String(question ?? '').trim())\n .filter(Boolean)\n }\n\n private _normalizeItem(item: any) {\n const normalizedItem = this._stripBusinessFields(item)\n const answerType = normalizedItem?.answerType || (!normalizedItem?.richTextContent ? normalizedItem?.examTypeEnum : normalizedItem?.answerType)\n const answers = Array.isArray(normalizedItem?.answers) ? normalizedItem.answers.map((answer: any) => this._normalizeAnswer(answer)) : []\n const scaleQuestionList = this._normalizeScaleQuestionList(normalizedItem)\n return {\n ...normalizedItem,\n customId: normalizedItem?.customId || uid(),\n ...(answerType ? { answerType } : {}),\n ...(answers.length || Array.isArray(normalizedItem?.answers) ? { answers } : {}),\n ...(scaleQuestionList !== undefined ? { scaleQuestionList } : {}),\n }\n }\n\n private _stripBusinessFields(item: any) {\n if (!item || typeof item !== 'object') { return item }\n const {\n memberTagInfo,\n tagInfos,\n categoryId,\n category,\n resourceList,\n examResourceBOList,\n aiAnswer,\n ...rest\n } = item\n return rest\n }\n\n private _exportQuestionItem(item: any) {\n return this._stripBusinessFields(item)\n }\n\n private _rebuildPageEndMarkers(items: any[]) {\n if (!items.length) { return items }\n if (items.some(item => item?.answerType === 'page_end')) { return items }\n if (!items.some(item => Number(item?.pageIndex) > 1)) { return items }\n\n let currentPageIndex = 1\n const rebuilt: any[] = []\n\n items.forEach((item) => {\n const pageIndex = Number(item?.pageIndex) || 1\n if (pageIndex > currentPageIndex) {\n if (rebuilt.length > 0) {\n while (currentPageIndex < pageIndex) {\n rebuilt.push({ customId: uid(), answerType: 'page_end' })\n currentPageIndex++\n }\n }\n else {\n currentPageIndex = pageIndex\n }\n }\n rebuilt.push(item)\n })\n\n return rebuilt\n }\n\n private _normalizeIncomingList(items: any[]) {\n const normalized = items.map((item: any) => this._normalizeItem(item))\n return this._rebuildPageEndMarkers(normalized)\n }\n\n firstUpdated() {\n this.updateComplete.then(() => this._initSortable())\n }\n\n updated(changed: Map<string, unknown>) {\n if (changed.has('_sortMode')) {\n this._sortable?.destroy()\n this._sortable = null\n this.updateComplete.then(() => this._initSortable())\n }\n // Reinitialize Sortable when list changes in sort mode\n if (changed.has('_list') && this._sortMode) {\n // Small delay to let Lit finish DOM updates\n setTimeout(() => {\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n this._initSortable()\n }, 50)\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this._sortable?.destroy()\n this._sortable = null\n }\n\n private _initSortable() {\n if (!this._sortMode) { return }\n const el = this.renderRoot.querySelector<HTMLElement>('.sort-list')\n if (!el) { return }\n\n // Destroy existing instance first\n if (this._sortable) {\n this._sortable.destroy()\n this._sortable = null\n }\n\n // Small delay to ensure DOM is ready after previous destroy\n requestAnimationFrame(() => {\n const currentEl = this.renderRoot.querySelector<HTMLElement>('.sort-list')\n if (!currentEl || this._sortable) { return }\n\n this._sortable = Sortable.create(currentEl, {\n handle: '.sort-handle',\n animation: 200,\n ghostClass: 'sort-ghost',\n chosenClass: 'sort-chosen',\n onEnd: (evt) => {\n const { oldIndex, newIndex } = evt\n if (oldIndex === undefined || newIndex === undefined || oldIndex === newIndex) { return }\n const arr = [...this._list]\n const [item] = arr.splice(oldIndex, 1)\n arr.splice(newIndex, 0, item)\n this._list = arr\n this._emitListChange()\n },\n })\n })\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _emitListChange() {\n const payload = this.currentList\n this._emit('change', payload)\n if (this._useModel) {\n this._modelValueAttr = JSON.stringify(payload)\n this._emit('list-change', payload)\n }\n }\n\n private _withPageIndex(items: any[]) {\n const serialized: any[] = []\n let pageIndex = 1\n let pendingBoundary = false\n\n items.forEach((item) => {\n if (!item) { return }\n if (item.answerType === 'page_end') {\n if (serialized.length > 0) {\n pendingBoundary = true\n }\n return\n }\n if (pendingBoundary) {\n pageIndex += 1\n pendingBoundary = false\n }\n serialized.push({\n ...item,\n pageIndex,\n })\n })\n\n return serialized\n }\n\n async toJSON(): Promise<any[]> {\n const subjectEls = this.renderRoot.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-page-end, qxs-subject-rich-text',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return []\n }\n\n const results: any[] = []\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.toJSON === 'function') {\n try {\n const data = await el.toJSON()\n results.push(data)\n }\n catch (err: any) {\n if (err instanceof SubjectError) {\n errors.push(err)\n }\n else {\n errors.push(new SubjectError(err.message || '未知错误', 'UNKNOWN', 'unknown'))\n }\n }\n }\n }\n\n if (errors.length > 0) {\n throw errors\n }\n\n return this._withPageIndex(results)\n }\n\n async validate(): Promise<{ valid: boolean, errors: SubjectError[] }> {\n const subjectEls = this.renderRoot.querySelectorAll<any>(\n 'qxs-subject-single, qxs-blank-fill, qxs-text-fill, qxs-scale, qxs-page-end',\n )\n if (!subjectEls || subjectEls.length === 0) {\n return { valid: true, errors: [] }\n }\n\n const errors: SubjectError[] = []\n\n for (const el of subjectEls) {\n if (typeof el.validate === 'function') {\n const errs = el.validate()\n if (errs?.length) {\n errors.push(...errs)\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n }\n\n // ── public API ────────────────────────────────────────────────\n get currentList() { return this._list.map(item => this._exportQuestionItem(item)) }\n\n addSubject(type: string, index?: number, examAnswerRelationType: number | null = null) {\n // 分页符只需要最少的必要字段\n if (type === 'page_end') {\n const pageEndItem = {\n customId: uid(),\n answerType: 'page_end',\n }\n const arr = [...this._list]\n if (typeof index === 'number' && index >= 0) {\n arr.splice(index + 1, 0, pageEndItem)\n }\n else {\n arr.push(pageEndItem)\n }\n this._list = arr\n this.requestUpdate()\n this._emitListChange()\n return\n }\n\n const item: any = {\n customId: uid(), answerType: type, title: '',\n answers: [], analysis: '', scaleQuestionList: [],\n isEdit: true, isSave: false, isRealCanDel: true, hasSet: false,\n }\n if (type === SubjectType.SCALE) {\n item.answers = Array.from({ length: 5 }, () => ({ title: '' }))\n }\n if (examAnswerRelationType !== null) {\n item.examAnswerRelationType = examAnswerRelationType\n }\n const arr = [...this._list]\n if (typeof index === 'number' && index >= 0) {\n arr.splice(index + 1, 0, item)\n }\n else { arr.push(item) }\n this._list = arr\n this.requestUpdate()\n this._emitListChange()\n }\n\n addExam(items: any[]) {\n const newItems = this._normalizeIncomingList(items).map((item: any) => ({\n ...item,\n isEdit: true,\n isSave: false,\n isRealCanDel: true,\n hasSet: false,\n }))\n this._list = [...this._list, ...newItems]\n this._emitListChange()\n }\n\n uploadExcel(list: any[]) {\n this._list = [\n ...this._list,\n ...this._normalizeIncomingList(list).map((item: any) => ({ ...item, isRealCanDel: true })),\n ]\n this._emitListChange()\n }\n\n setAnswerRelation(answerRelations: any, customId: string, customAnswerId: string) {\n const item = this._list.find((v: any) => v.customId === customId)\n if (item) {\n const ans = item.answers?.find((c: any) => c.customAnswerId === customAnswerId)\n if (ans) { ans.answerRelations = answerRelations }\n }\n this.requestUpdate()\n this._emitListChange()\n }\n\n setTagList(tagList: any[], customId: string) {\n void tagList\n void customId\n this.requestUpdate()\n }\n\n // ── private helpers ───────────────────────────────────────────\n private _orderIndex(customId: string) {\n let n = 0; let out = 0\n this._list.forEach((v: any) => {\n n++; if (v.customId === customId) { out = n }\n })\n return out - 1\n }\n\n private _move(index: number, dir: 'up' | 'down') {\n const arr = [...this._list]\n if (dir === 'up' && index > 0) { [arr[index - 1], arr[index]] = [arr[index], arr[index - 1]] }\n else if (dir === 'down' && index < arr.length - 1) { [arr[index], arr[index + 1]] = [arr[index + 1], arr[index]] }\n this._list = arr\n this._emitListChange()\n }\n\n private _normalizeLeastAnswerCount(answerType: string, value: unknown) {\n if (![SubjectType.MULTIPLE, SubjectType.SORT].includes(answerType as SubjectType)) {\n return undefined\n }\n if (value === '' || value === null || value === undefined) {\n return null\n }\n const count = Number(value)\n return Number.isFinite(count) && count > 0 ? count : null\n }\n\n private _normalizeSavedItem(item: any) {\n const next = { ...this._stripBusinessFields(item) }\n const leastAnswerCount = this._normalizeLeastAnswerCount(next.answerType, next.leastAnswerCount)\n if (leastAnswerCount === undefined) {\n delete next.leastAnswerCount\n }\n else {\n next.leastAnswerCount = leastAnswerCount\n }\n return next\n }\n\n private _save(index: number, e: CustomEvent) {\n this._list = this._list.map((item, i) =>\n i === index ? this._normalizeSavedItem({ ...item, ...e.detail, isEdit: false, isSave: true }) : item,\n )\n this._emitListChange()\n }\n\n private _deleteByCustomId(customId: string) {\n this._list = this._list.filter(item => item.customId !== customId)\n this._emitListChange()\n }\n\n private _delete(index: number) {\n const arr = [...this._list]\n arr.splice(index, 1)\n this._list = arr\n this._emitListChange()\n }\n\n private _setEdit(index: number, val: boolean) {\n this._list = this._list.map((item, i) => i === index ? { ...item, isEdit: val } : item)\n }\n\n private _pageEndTotal() {\n return this._list.filter(item => item.answerType === 'page_end').length + 1\n }\n\n private _pageEndIndex(index: number) {\n return this._list.slice(0, index + 1).filter(item => item.answerType === 'page_end').length\n }\n\n private _syncRelationAnswer(index: number, detail: any) {\n const item = this._list[index]\n if (!item || !Array.isArray(item.answers) || !detail?.answer) { return }\n const answers = [...item.answers]\n const currentAnswer = detail.answer\n let answerIndex = typeof detail.answerIndex === 'number' ? detail.answerIndex : -1\n\n if (answerIndex < 0 || answerIndex >= answers.length) {\n answerIndex = answers.findIndex((answer: any, currentIndex: number) => {\n return String(answer.customAnswerId || '') === String(currentAnswer.customAnswerId || '')\n || String(answer.answerId || '') === String(currentAnswer.answerId || '')\n || String(answer.orderIndex || currentIndex + 1) === String(currentAnswer.orderIndex || '')\n })\n }\n\n if (answerIndex < 0) { return }\n answers[answerIndex] = {\n ...answers[answerIndex],\n customAnswerId: currentAnswer.customAnswerId || answers[answerIndex].customAnswerId || currentAnswer.answerId,\n }\n this._list[index] = {\n ...item,\n answers,\n }\n this._list = [...this._list]\n }\n\n private _renderItem(item: any, index: number) {\n const common = {\n 'order-index': this._orderIndex(item.customId),\n '?is-edit': item.isEdit || false,\n '?is-set': item.hasSet || false,\n '?show-action': !this._isPreviewValue,\n 'exam-answer-relation-type': item.examAnswerRelationType ?? 0,\n }\n const onMove = (e: CustomEvent) => this._move(index, e.detail as 'up' | 'down')\n const onDelete = () => this._deleteByCustomId(item.customId)\n const onSave = (e: CustomEvent) => this._save(index, e)\n const onEdit = () => this._setEdit(index, true)\n const onAdd = (e: CustomEvent) => this.addSubject(e.detail?.type ?? e.detail, index)\n\n if ([SubjectType.SINGLE, SubjectType.MULTIPLE, SubjectType.SORT].includes(item.answerType)) {\n return html`<qxs-subject-single\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .category-list=${this['category-list']}\n .search-handler=${this['search-handler']}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit}\n .is-set=${!!item.hasSet}\n .lockAnswerKey=${!!(item.lockAnswerKey ?? item['lock-answer-key'])}\n .show-action=${!this._isPreviewValue}\n .show-add=${this['show-add']}\n .show-category=${this['show-category']}\n .show-ai=${this['show-ai']}\n .show-resource=${this['show-resource']}\n .show-jump=${this['show-jump']}\n question-type=${String(item.answerType)}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n .least-answer-count=${item.leastAnswerCount ?? null}\n exam-expand=${item.examExpand || ''}\n search-api=${this['search-api']}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n @title-select=${(e: CustomEvent) => this._emit('title-select', e.detail)}\n @jump=${(e: CustomEvent) => this._emit('jump', { ...e.detail, item: this._list[index] })}\n ></qxs-subject-single>`\n }\n if (item.answerType === SubjectType.BLANK_FILL) {\n return html`<qxs-blank-fill\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .category-list=${this['category-list']}\n .exam-answer-setting=${item.examAnswerSettingBO || item.examAnswerSettingVO || {}}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit} .is-set=${!!item.hasSet} .show-action=${!this._isPreviewValue} .show-add=${this['show-add']}\n .show-answer-setting=${this['show-answer-setting']}\n .show-category=${this['show-category']}\n .show-resource=${this['show-resource']}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-blank-fill>`\n }\n if (item.answerType === SubjectType.TEXT_FILL) {\n return html`<qxs-text-fill\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .category-list=${this['category-list']}\n .search-handler=${this['search-handler']}\n .exam-answer-setting=${item.examAnswerSettingBO || item.examAnswerSettingVO || {}}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit} .is-set=${!!item.hasSet} .show-action=${!this._isPreviewValue} .show-add=${this['show-add']}\n .show-answer-setting=${this['show-answer-setting']}\n .show-category=${this['show-category']}\n .show-resource=${this['show-resource']}\n exam-answer-relation-type=${item.examAnswerRelationType ?? 0}\n exam-expand=${item.examExpand || ''}\n rich-text-content=${item.examRichTextContent || ''}\n analysis=${item.analysis || ''}\n custom-id=${item.customId || ''}\n exam-id=${item.examId ?? 0}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-text-fill>`\n }\n if (item.answerType === SubjectType.SCALE) {\n const scaleQuestionList = Array.isArray(item.scaleQuestionList)\n ? item.scaleQuestionList\n : Array.isArray(item.scaleQuestions)\n ? item.scaleQuestions\n : []\n return html`<qxs-scale\n .title=${item.title || ''}\n .answer-list=${item.answers || []}\n .scale-question-list=${scaleQuestionList}\n .upload-image=${this['upload-image']}\n order-index=${common['order-index']}\n .is-edit=${!!item.isEdit} .is-set=${!!item.hasSet} .show-action=${!this._isPreviewValue} .show-add=${this['show-add']}\n rich-text-content=${item.examRichTextContent || ''}\n custom-id=${item.customId || ''}\n @move=${onMove} @delete=${onDelete} @save=${onSave} @edit=${onEdit} @add=${onAdd}\n ></qxs-scale>`\n }\n if (item.answerType === 'page_end') {\n return html`<qxs-page-end\n .current-page-index=${item.currentPageIndex || this._pageEndIndex(index)}\n .total-page=${item.totalPage || this._pageEndTotal()}\n .show-action=${!this._isPreviewValue}\n .show-add=${this['show-add']}\n custom-id=${item.customId || ''}\n @delete=${onDelete}\n @add=${onAdd}\n ></qxs-page-end>`\n }\n return html`<div style=\"color:#909399;padding:8px\">未知题型: ${item.answerType}</div>`\n }\n\n render() {\n return html`\n <div class=\"subject-list\">\n ${this._list.map((item, index) => this._renderItem(item, index))}\n </div>\n `\n }\n}\n\nexport function register() {}\n"],"names":["QxsSubjectList","LitElement","constructor","super","arguments","this","_modelValueAttr","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_list","_sortMode","_sortable","_initialDataProcessed","JSON","stringify","v","parsed","parse","Array","isArray","_normalizeIncomingList","requestUpdate","_useModel","hasAttribute","currentList","attributeChangedCallback","name","oldVal","newVal","length","includes","_isPreviewValue","val","connectedCallback","then","_processAttributeList","attr","getAttribute","_normalizeAnswer","answer","title","String","answerId","examAnswerId","_normalizeScaleQuestionList","item","raw","scaleQuestionList","scaleQuestions","map","question","trim","filter","Boolean","_normalizeItem","normalizedItem","_stripBusinessFields","answerType","richTextContent","examTypeEnum","answers","customId","uid","memberTagInfo","tagInfos","categoryId","category","resourceList","examResourceBOList","aiAnswer","rest","_exportQuestionItem","_rebuildPageEndMarkers","items","some","Number","pageIndex","currentPageIndex","rebuilt","forEach","push","normalized","firstUpdated","updateComplete","_initSortable","updated","changed","has","destroy","setTimeout","disconnectedCallback","renderRoot","querySelector","requestAnimationFrame","currentEl","Sortable","create","handle","animation","ghostClass","chosenClass","onEnd","evt","oldIndex","newIndex","arr","splice","_emitListChange","_emit","detail","dispatchEvent","CustomEvent","bubbles","composed","payload","_withPageIndex","serialized","pendingBoundary","toJSON","subjectEls","querySelectorAll","results","errors","el","data","err","SubjectError","message","validate","valid","errs","addSubject","type","index","examAnswerRelationType","undefined","pageEndItem","analysis","isEdit","isSave","isRealCanDel","hasSet","SubjectType","SCALE","from","addExam","newItems","uploadExcel","list","setAnswerRelation","answerRelations","customAnswerId","find","ans","c","setTagList","tagList","_orderIndex","n","out","_move","dir","_normalizeLeastAnswerCount","value","MULTIPLE","SORT","count","isFinite","_normalizeSavedItem","next","leastAnswerCount","_save","i","_deleteByCustomId","_delete","_setEdit","_pageEndTotal","_pageEndIndex","slice","_syncRelationAnswer","currentAnswer","answerIndex","findIndex","currentIndex","orderIndex","_renderItem","common","onMove","onDelete","onSave","onEdit","onAdd","SINGLE","html","lockAnswerKey","examRichTextContent","examExpand","examId","BLANK_FILL","examAnswerSettingBO","examAnswerSettingVO","TEXT_FILL","totalPage","render","styles","css","__decorateClass","property","attribute","prototype","Object","state","safeCustomElement"],"mappings":"ujBAkBaA,QAAAA,eAAN,cAA6BC,EAAAA,WAA7BC,WAAAA,GAAAC,SAAAC,WAyBkCC,KAAA,eAAe,EAGhBA,KAAA,aAA6B,KAqBnEA,KAAQC,gBAAkB,GAG1BD,KAAA,gBAAkDE,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAI8Bd,KAAA,iBAAyB,GAC5BA,KAAA,aAAa,EACRA,KAAA,kBAAkB,EACxBA,KAAA,YAAY,EACNA,KAAA,kBAAkB,EACtBA,KAAA,cAAc,EACfA,KAAA,aAAa,EACFA,KAAA,wBAAwB,EACnCA,KAAA,aAAa,EACZA,KAAA,cAAe,GAiD3DA,KAAQe,MAAe,GACvBf,KAAQgB,WAAY,EAC7BhB,KAAQiB,UAA6B,KAOrCjB,KAAQkB,uBAAwB,CAAA,CAlGhC,gBAAI,GAA0B,OAAOC,KAAKC,UAAUpB,KAAKe,MAAO,CAEhE,gBAAI,CAAcM,GAChB,GAAKA,GAAKA,IAAMrB,KAAKC,gBAArB,CACAD,KAAKC,gBAAkBoB,EACvB,IACE,MAAMC,EAASH,KAAKI,MAAMF,GACtBG,MAAMC,QAAQH,KAChBtB,KAAKe,MAAQf,KAAK0B,uBAAuBJ,GACzCtB,KAAK2B,gBAET,CAAA,MACmC,CATY,CAUjD,CAEA,aAAYC,GACV,MAA6B,SAAtB5B,KAAK,cAAiD,KAAtBA,KAAK,cAAuB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),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./types.cjs"),
|
|
1
|
+
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("./single.cjs"),r=require("./types.cjs"),o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=(t,e,s,i)=>{for(var r,n=i>1?void 0:i?a(e,s):e,l=t.length-1;l>=0;l--)(r=t[l])&&(n=(i?r(e,s,n):r(n))||n);return i&&n&&o(e,s,n),n};function l(){return{title:""}}function p(){return Array.from({length:5},l)}function d(t){const e={...t,title:String(t?.title??t?.answer??"")},s=t?.answerId??t?.examAnswerId;return void 0!==s&&(e.answerId=s),delete e.answer,delete e.examAnswerId,e}function c(t,e){const s={...d(t),orderIndex:e+1,answer:String(t?.title??t?.answer??"")};return s.title=String(s.title??""),void 0!==s.answerId&&(s.examAnswerId=s.answerId),void 0===s.answerId&&delete s.answerId,void 0===s.isCorrect&&delete s.isCorrect,s}const h=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>`,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="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.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=p(),this._scaleQuestions=[],this._rowTitle="",this._title="",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){this._answers=Array.isArray(t)?function(t){return Array.isArray(t)?t.slice(0,5).map(d):[]}(t):p(),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._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)}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:r.SubjectType.SCALE,orderIndex:this["order-index"]},o=this["is-edit"]?this._title:this.title||"",a=this["is-edit"]?this._answers:this["answer-list"],n=this._resolvedQuestions(),l=this["is-edit"]?this._richText:this["rich-text-content"]||"",p=this["is-edit"]?this._showRichText:!!this["rich-text-content"];if(!o)return void e(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",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 d={answerType:r.SubjectType.SCALE,examTypeEnum:r.SubjectType.SCALE,title:o,answers:a.map(c),scaleQuestionList:n,analysis:this.analysis||"",examRichTextContent:p?l:"",isSetCorrectAnswer:!1};this["custom-id"]&&(d.customId=this["custom-id"]),t(d)})}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:r.SubjectType.SCALE,orderIndex:this["order-index"]},s=this["is-edit"]?this._title:this.title||"",o=this["is-edit"]?this._answers:this["answer-list"],a=this._resolvedQuestions();return s||t.push(new i.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e)),o.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=Math.floor(100/((this._answers.length||1)+1));return t.html`
|
|
2
2
|
<div class="preview">
|
|
3
3
|
<span class="title">${this["order-index"]+1}.${this.title}(量表题)</span>
|
|
4
4
|
${this["rich-text-content"]?t.html`<div style="margin-top:8px" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
5
5
|
<table class="scale-table">
|
|
6
|
-
<thead
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th style="width:${e}%">问题 \ 选项</th>
|
|
9
|
+
${this._answers.map(s=>t.html`<th style="width:${e}%">${s.title}</th>`)}
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
10
12
|
<tbody>
|
|
11
13
|
${this._scaleQuestions.map(e=>t.html`
|
|
12
|
-
<tr
|
|
14
|
+
<tr>
|
|
15
|
+
<td>${e}</td>
|
|
16
|
+
${this._answers.map(()=>t.html`<td><input type="radio" disabled /></td>`)}
|
|
17
|
+
</tr>
|
|
13
18
|
`)}
|
|
14
19
|
</tbody>
|
|
15
20
|
</table>
|
|
16
|
-
${this.analysis?t.html`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
|
|
17
|
-
${this["show-category"]&&this._categoryId?t.html`<div class="section-row"><span class="value-text">分类:${this._categoryLabel()}</span></div>`:""}
|
|
18
|
-
${this["show-tag"]&&this._selectedTagList.length?t.html`
|
|
19
|
-
<div class="section-row">
|
|
20
|
-
<span class="value-text">标签/关键信息:</span>
|
|
21
|
-
<div class="tag-list" style="margin-top:6px">
|
|
22
|
-
${this._selectedTagList.map(e=>t.html`<span class="tag-item">${e.tagName}</span>`)}
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
`:""}
|
|
26
|
-
${this._renderResourceSection()}
|
|
27
|
-
</div>
|
|
28
|
-
`}_renderTagSection(){return this["show-tag"]?t.html`
|
|
29
|
-
<div class="flex-items-start section-row">
|
|
30
|
-
<div class="label"><span>标签:</span></div>
|
|
31
|
-
<div style="flex:1">
|
|
32
|
-
<div class="tag-list">
|
|
33
|
-
${this._selectedTagList.length?this._selectedTagList.map(e=>t.html`
|
|
34
|
-
<span class="tag-item">
|
|
35
|
-
${e.tagName}
|
|
36
|
-
${this["is-save"]?"":t.html`<span class="close" @click=${()=>this._removeTag(e.tagId)}>×</span>`}
|
|
37
|
-
</span>
|
|
38
|
-
`):t.html`<span class="tag-hint">暂无标签/关键信息</span>`}
|
|
39
|
-
</div>
|
|
40
|
-
${this["is-edit"]&&!this["is-save"]?t.html`<div style="margin-top:8px"><span class="el-link" @click=${()=>this._chooseTag()}>选择</span></div>`:""}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
`:""}_renderCategorySection(){return this["show-category"]?t.html`
|
|
44
|
-
<div class="flex-items-start section-row">
|
|
45
|
-
<div class="label"><span>分类:</span></div>
|
|
46
|
-
<div style="flex:1">
|
|
47
|
-
${this["is-edit"]?t.html`
|
|
48
|
-
<select class="el-select" .value=${String(this._categoryId)} ?disabled=${this["is-save"]}
|
|
49
|
-
@change=${t=>this._onCategoryChange(t.target.value)}>
|
|
50
|
-
<option value="">选择分类</option>
|
|
51
|
-
${this["category-list"].map(e=>t.html`
|
|
52
|
-
<option value=${String(e.categoryId)} ?selected=${String(e.categoryId)===String(this._categoryId)}>${e.title||e.categoryName}</option>
|
|
53
|
-
`)}
|
|
54
|
-
</select>
|
|
55
|
-
`:t.html`<span class="value-text">${this._categoryLabel()}</span>`}
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
`:""}_renderResourceSection(){if(!this["show-resource"])return"";const e=this._imageResources(),s=this._videoResource();return t.html`
|
|
59
|
-
<div class="flex-items-start section-row">
|
|
60
|
-
<div class="label"><span>资源:</span></div>
|
|
61
|
-
<div style="flex:1">
|
|
62
|
-
<div class="resource-summary">图片 ${e.length} 张${s?.url?",含视频资源":""}</div>
|
|
63
|
-
${e.length?t.html`
|
|
64
|
-
<div class="resource-thumbs">
|
|
65
|
-
${e.slice(0,4).map(e=>t.html`<img class="resource-thumb" src=${e} alt="resource" />`)}
|
|
66
|
-
</div>
|
|
67
|
-
`:""}
|
|
68
|
-
${s?.url?t.html`<div style="margin-top:8px"><a class="el-link" href=${s.url} target="_blank" rel="noreferrer">查看视频</a></div>`:""}
|
|
69
|
-
${e.length||s?.url?"":t.html`<div class="tag-hint">暂无资源</div>`}
|
|
70
|
-
</div>
|
|
71
21
|
</div>
|
|
72
22
|
`}_renderEdit(){return t.html`
|
|
73
23
|
<div class="flex-items-start">
|
|
74
24
|
<div class="label"><span>题目:</span></div>
|
|
75
25
|
<div style="flex:1">
|
|
76
26
|
<div class="el-input">
|
|
77
|
-
<textarea
|
|
27
|
+
<textarea
|
|
28
|
+
rows="2"
|
|
29
|
+
.value=${this._title}
|
|
78
30
|
maxlength=${this.TITLE_MAX}
|
|
79
31
|
@input=${t=>this._onTitleInput(t)}
|
|
80
|
-
placeholder="【量表题】请输入问题"
|
|
32
|
+
placeholder="【量表题】请输入问题"
|
|
33
|
+
></textarea>
|
|
81
34
|
<span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
|
|
82
35
|
</div>
|
|
83
36
|
</div>
|
|
84
37
|
</div>
|
|
85
38
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
${this._renderCategorySection()}
|
|
89
|
-
|
|
90
|
-
${this._renderResourceSection()}
|
|
39
|
+
<slot name="business-tag"></slot>
|
|
91
40
|
|
|
92
41
|
<div class="flex-items-start" style="margin-top:12px">
|
|
93
42
|
<div class="label"><span>行标题:</span></div>
|
|
94
43
|
<div class="flex" style="flex:1">
|
|
95
44
|
<div class="el-input" style="width:160px">
|
|
96
|
-
<textarea
|
|
45
|
+
<textarea
|
|
46
|
+
class="row-title-textarea"
|
|
47
|
+
.value=${this._rowTitle}
|
|
97
48
|
@input=${t=>{this._rowTitle=t.target.value}}
|
|
98
49
|
@keydown=${t=>{t.stopPropagation()}}
|
|
99
|
-
placeholder="请输入行标题"
|
|
50
|
+
placeholder="请输入行标题"
|
|
51
|
+
></textarea>
|
|
100
52
|
</div>
|
|
101
53
|
<div style="flex:1;margin-left:12px">
|
|
102
54
|
${this._answers.map((e,s)=>t.html`
|
|
103
55
|
<div class="answer-item">
|
|
104
56
|
<span class="label">${String.fromCharCode(65+s)}.</span>
|
|
105
57
|
<div class="input">
|
|
106
|
-
<input
|
|
58
|
+
<input
|
|
59
|
+
type="text"
|
|
60
|
+
.value=${e.title}
|
|
107
61
|
maxlength="10"
|
|
108
62
|
@input=${t=>{const e=t.target.value;this._answers=this._answers.map((t,i)=>i===s?{...t,title:e}:t)}}
|
|
109
|
-
placeholder="选项${s+1}"
|
|
63
|
+
placeholder="选项${s+1}"
|
|
64
|
+
/>
|
|
110
65
|
</div>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
66
|
+
<span
|
|
67
|
+
class="icon"
|
|
68
|
+
@click=${()=>{this._answers.length<5&&(this._answers=[...this._answers,{title:""}])}}
|
|
69
|
+
>${h}</span>
|
|
70
|
+
<span
|
|
71
|
+
class="icon ${this._answers.length<3?"disabled":""}"
|
|
72
|
+
@click=${()=>{this._answers.length>3&&(this._answers=this._answers.filter((t,e)=>e!==s))}}
|
|
73
|
+
>${x}</span>
|
|
115
74
|
</div>
|
|
116
75
|
`)}
|
|
117
76
|
</div>
|
|
118
77
|
</div>
|
|
119
78
|
</div>
|
|
120
79
|
|
|
121
|
-
<div class="flex-items-start" style="margin-top:12px">
|
|
122
|
-
<div class="label"><span>解析:</span></div>
|
|
123
|
-
<div style="flex:1">
|
|
124
|
-
<div class="el-input">
|
|
125
|
-
<textarea rows="2" .value=${this._analysis} ?disabled=${this["is-save"]}
|
|
126
|
-
@input=${t=>{this._analysis=t.target.value}}
|
|
127
|
-
placeholder="请输入题目解析"></textarea>
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
|
|
132
80
|
${this._showRichText?t.html`
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
81
|
+
<div class="flex-items-start" style="margin-top:12px">
|
|
82
|
+
<div class="label"><span>富文本:</span></div>
|
|
83
|
+
<div style="flex:1">
|
|
84
|
+
<qxs-blocksuite-editor
|
|
85
|
+
.content=${this._richText}
|
|
86
|
+
.upload-image=${this["upload-image"]}
|
|
87
|
+
?is-edit=${!0}
|
|
88
|
+
></qxs-blocksuite-editor>
|
|
89
|
+
${this["show-action"]?"":t.html`
|
|
90
|
+
<div class="flex-justify-end" style="margin-top:8px">
|
|
91
|
+
<span
|
|
92
|
+
class="el-link danger"
|
|
93
|
+
@click=${()=>{this._showRichText=!1,this._richText=""}}
|
|
94
|
+
>删除富文本</span>
|
|
95
|
+
</div>
|
|
96
|
+
`}
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
`:""}
|
|
100
|
+
`}render(){const e=this["is-edit"]?t.html`<div slot="edit">${this._renderEdit()}</div>`:t.html`<div slot="preview">${this._renderPreview()}</div>`;return t.html`
|
|
146
101
|
<qxs-subject-layout .show-edit=${this["is-edit"]}>
|
|
147
|
-
|
|
148
|
-
<div slot="edit">${this._renderEdit()}</div>
|
|
102
|
+
${e}
|
|
149
103
|
${this["show-action"]?t.html`
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
104
|
+
<qxs-subject-action
|
|
105
|
+
.is-edit=${this["is-edit"]}
|
|
106
|
+
.is-set=${this["is-set"]}
|
|
107
|
+
.show-add=${this["show-add"]}
|
|
108
|
+
.show-rich-text=${this._showRichText}
|
|
109
|
+
.show-other-option=${!1}
|
|
110
|
+
exam-answer-relation-type=${this["exam-answer-relation-type"]}
|
|
111
|
+
@delete=${()=>this._emit("delete")}
|
|
112
|
+
@save=${this._save}
|
|
113
|
+
@edit=${()=>this._emit("edit")}
|
|
114
|
+
@add=${t=>this._emit("add",t.detail)}
|
|
115
|
+
@on-show-rich-text=${()=>{this._showRichText=!this._showRichText,this._showRichText||(this._richText="")}}
|
|
116
|
+
></qxs-subject-action>
|
|
117
|
+
`:""}
|
|
164
118
|
</qxs-subject-layout>
|
|
165
119
|
`}},exports.QxsScale.styles=t.css`
|
|
166
120
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
@@ -173,7 +127,6 @@
|
|
|
173
127
|
.scale-table th { background: #f5f7fa; color: #909399; }
|
|
174
128
|
|
|
175
129
|
.flex { display: flex; }
|
|
176
|
-
.flex-items-center { display: flex; align-items: center; }
|
|
177
130
|
.flex-items-start { display: flex; align-items: flex-start; }
|
|
178
131
|
.flex-justify-end { display: flex; justify-content: flex-end; }
|
|
179
132
|
.label { min-width: 60px; font-size: 13px; color: #606266; }
|
|
@@ -194,7 +147,6 @@
|
|
|
194
147
|
}
|
|
195
148
|
|
|
196
149
|
.el-link { color: #3D61E3; cursor: pointer; font-size: 12px; }
|
|
197
|
-
.el-link:hover { color: #2D4CB8; }
|
|
198
150
|
.el-link.danger { color: #f56c6c; }
|
|
199
151
|
|
|
200
152
|
.answer-item { display: flex; align-items: center; margin-top: 6px; }
|
|
@@ -219,28 +171,5 @@
|
|
|
219
171
|
.answer-item .icon.disabled { color: #e4e7ed; border-color: #e4e7ed; cursor: not-allowed; }
|
|
220
172
|
|
|
221
173
|
.row-title-textarea { height: 200px; }
|
|
222
|
-
|
|
223
|
-
.value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }
|
|
224
|
-
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
|
|
225
|
-
.tag-item {
|
|
226
|
-
display: inline-flex; align-items: center; gap: 4px;
|
|
227
|
-
padding: 4px 8px; font-size: 12px; line-height: 1;
|
|
228
|
-
color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;
|
|
229
|
-
}
|
|
230
|
-
.tag-item .close { cursor: pointer; color: #909399; }
|
|
231
|
-
.tag-item .close:hover { color: #f56c6c; }
|
|
232
|
-
.tag-hint { font-size: 12px; color: #909399; }
|
|
233
|
-
.el-select {
|
|
234
|
-
width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;
|
|
235
|
-
padding: 0 8px; font-size: 13px; background: #fff; appearance: none;
|
|
236
|
-
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");
|
|
237
|
-
background-repeat: no-repeat; background-position: right 8px center;
|
|
238
|
-
}
|
|
239
|
-
.resource-summary { font-size: 12px; color: #606266; }
|
|
240
|
-
.resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
|
|
241
|
-
.resource-thumb {
|
|
242
|
-
width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
|
|
243
|
-
border: 1px solid #e4e7ed; background: #f5f7fa;
|
|
244
|
-
}
|
|
245
|
-
`,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:"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:Number,attribute:"exam-id"})],exports.QxsScale.prototype,"exam-id",2),l([e.property({type:String,attribute:"category-id"})],exports.QxsScale.prototype,"category-id",2),l([e.property({type:Array,attribute:"tag-list"})],exports.QxsScale.prototype,"tag-list",2),l([e.property({type:Array,attribute:"category-list"})],exports.QxsScale.prototype,"category-list",2),l([e.property({type:Array,attribute:"resource-list"})],exports.QxsScale.prototype,"resource-list",2),l([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsScale.prototype,"show-tag",2),l([e.property({type:Boolean,attribute:"show-category"})],exports.QxsScale.prototype,"show-category",2),l([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsScale.prototype,"show-resource",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-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.state()],exports.QxsScale.prototype,"_selectedTagList",2),l([e.state()],exports.QxsScale.prototype,"_categoryId",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);
|
|
174
|
+
`,n([e.property({type:Number,attribute:"order-index"})],exports.QxsScale.prototype,"order-index",2),n([e.property({type:String})],exports.QxsScale.prototype,"title",2),n([e.property({type:String,attribute:"custom-id"})],exports.QxsScale.prototype,"custom-id",2),n([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsScale.prototype,"is-edit",2),n([e.property({type:Boolean,attribute:"is-save"})],exports.QxsScale.prototype,"is-save",2),n([e.property({type:Boolean,attribute:"is-set"})],exports.QxsScale.prototype,"is-set",2),n([e.property({type:Boolean,attribute:"show-action"})],exports.QxsScale.prototype,"show-action",2),n([e.property({type:Boolean,attribute:"show-add"})],exports.QxsScale.prototype,"show-add",2),n([e.property({type:String})],exports.QxsScale.prototype,"analysis",2),n([e.property({type:String,attribute:"rich-text-content"})],exports.QxsScale.prototype,"rich-text-content",2),n([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsScale.prototype,"exam-answer-relation-type",2),n([e.property({type:Object,attribute:"upload-image"})],exports.QxsScale.prototype,"upload-image",2),n([e.property({type:Array,attribute:"answer-list"})],exports.QxsScale.prototype,"answer-list",1),n([e.property({type:Array,attribute:"scale-question-list"})],exports.QxsScale.prototype,"scale-question-list",1),n([e.property({type:Array,attribute:"scale-questions"})],exports.QxsScale.prototype,"scale-questions",1),n([e.state()],exports.QxsScale.prototype,"_answers",2),n([e.state()],exports.QxsScale.prototype,"_scaleQuestions",2),n([e.state()],exports.QxsScale.prototype,"_rowTitle",2),n([e.state()],exports.QxsScale.prototype,"_title",2),n([e.state()],exports.QxsScale.prototype,"_showRichText",2),n([e.state()],exports.QxsScale.prototype,"_richText",2),n([e.property({type:String,attribute:"model-value"})],exports.QxsScale.prototype,"model-value",2),n([e.property({type:Boolean,attribute:"use-model"})],exports.QxsScale.prototype,"use-model",2),exports.QxsScale=n([s.safeCustomElement("qxs-scale")],exports.QxsScale);
|
|
246
175
|
//# sourceMappingURL=scale.cjs.map
|