@qxs-bns/components-wc 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/editor/blocksuite-editor.mjs +312 -43
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/entry-subject.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/subject/blank-fill.mjs +34 -56
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/draft.mjs +2 -0
- package/es/subject/draft.mjs.map +1 -0
- package/es/subject/list.mjs +57 -99
- package/es/subject/list.mjs.map +1 -1
- package/es/subject/page-end.mjs +3 -3
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/pagination.mjs +2 -0
- package/es/subject/pagination.mjs.map +1 -0
- package/es/subject/runtime.mjs +2 -0
- package/es/subject/runtime.mjs.map +1 -0
- package/es/subject/scale.mjs +101 -152
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/single.mjs +89 -88
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/sort-controller.mjs +2 -0
- package/es/subject/sort-controller.mjs.map +1 -0
- package/es/subject/sortable.mjs +30 -0
- package/es/subject/sortable.mjs.map +1 -0
- package/es/subject/sorting-card.mjs +52 -0
- package/es/subject/sorting-card.mjs.map +1 -0
- package/es/subject/text-fill.mjs +24 -45
- package/es/subject/text-fill.mjs.map +1 -1
- package/es/subject/types.mjs +1 -1
- package/es/subject/types.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +304 -35
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/entry-subject.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/subject/blank-fill.cjs +24 -46
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/draft.cjs +2 -0
- package/lib/subject/draft.cjs.map +1 -0
- package/lib/subject/list.cjs +16 -58
- package/lib/subject/list.cjs.map +1 -1
- package/lib/subject/page-end.cjs +3 -3
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/pagination.cjs +2 -0
- package/lib/subject/pagination.cjs.map +1 -0
- package/lib/subject/runtime.cjs +2 -0
- package/lib/subject/runtime.cjs.map +1 -0
- package/lib/subject/scale.cjs +98 -149
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/single.cjs +89 -88
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/sort-controller.cjs +2 -0
- package/lib/subject/sort-controller.cjs.map +1 -0
- package/lib/subject/sortable.cjs +30 -0
- package/lib/subject/sortable.cjs.map +1 -0
- package/lib/subject/sorting-card.cjs +52 -0
- package/lib/subject/sorting-card.cjs.map +1 -0
- package/lib/subject/text-fill.cjs +24 -45
- package/lib/subject/text-fill.cjs.map +1 -1
- package/lib/subject/types.cjs +1 -1
- package/lib/subject/types.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import{css as i,html as o}from"lit";const t=i`
|
|
2
|
+
.sorting-card {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 12px;
|
|
6
|
+
padding: 12px 14px;
|
|
7
|
+
background: #fff;
|
|
8
|
+
border: 1px solid #e4e7ed;
|
|
9
|
+
border-radius: 10px;
|
|
10
|
+
transition: all 0.2s;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.sorting-card:hover {
|
|
14
|
+
border-color: #bfd1ff;
|
|
15
|
+
background: #f8fbff;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.sorting-handle {
|
|
19
|
+
color: #909399;
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
line-height: 1;
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.sorting-content {
|
|
26
|
+
flex: 1;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.sorting-title {
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
color: #303133;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
text-overflow: ellipsis;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.sorting-meta {
|
|
39
|
+
margin-top: 4px;
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
color: #909399;
|
|
42
|
+
}
|
|
43
|
+
`;function n(i,t){return o`
|
|
44
|
+
<div class="sorting-card">
|
|
45
|
+
<span class="sorting-handle">⋮⋮</span>
|
|
46
|
+
<div class="sorting-content">
|
|
47
|
+
<div class="sorting-title">${i}</div>
|
|
48
|
+
<div class="sorting-meta">${t}</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
`}export{n as renderSortingCard,t as sortingCardStyles};
|
|
52
|
+
//# sourceMappingURL=sorting-card.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sorting-card.mjs","sources":["../../../../packages/components-wc/src/subject/sorting-card.ts"],"sourcesContent":["import { css, html } from 'lit'\n\nexport const sortingCardStyles = css`\n .sorting-card {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 14px;\n background: #fff;\n border: 1px solid #e4e7ed;\n border-radius: 10px;\n transition: all 0.2s;\n }\n\n .sorting-card:hover {\n border-color: #bfd1ff;\n background: #f8fbff;\n }\n\n .sorting-handle {\n color: #909399;\n font-size: 16px;\n line-height: 1;\n user-select: none;\n }\n\n .sorting-content {\n flex: 1;\n min-width: 0;\n }\n\n .sorting-title {\n font-size: 13px;\n color: #303133;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .sorting-meta {\n margin-top: 4px;\n font-size: 12px;\n color: #909399;\n }\n`\n\nexport function renderSortingCard(title: string, meta: string) {\n return html`\n <div class=\"sorting-card\">\n <span class=\"sorting-handle\">⋮⋮</span>\n <div class=\"sorting-content\">\n <div class=\"sorting-title\">${title}</div>\n <div class=\"sorting-meta\">${meta}</div>\n </div>\n </div>\n `\n}\n"],"names":["sortingCardStyles","css","renderSortingCard","title","meta","html"],"mappings":"oCAEO,MAAMA,EAAoBC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4C1B,SAASC,EAAkBC,EAAeC,GAC/C,OAAOC,CAAA;;;;qCAI4BF;oCACDC;;;GAIpC"}
|
package/es/subject/text-fill.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{css as t,LitElement as e,html as s}from"lit";import{property as i,state as r}from"lit/decorators.js";import{safeCustomElement as
|
|
1
|
+
import{css as t,LitElement as e,html as s}from"lit";import{property as i,state as r}from"lit/decorators.js";import{safeCustomElement as o}from"../base/define.mjs";import{trimCommaSeparatedText as a,SubjectError as n,trimText as l}from"./single.mjs";import{sortingCardStyles as d,renderSortingCard as h}from"./sorting-card.mjs";import{SubjectType as c,SubjectTypeLabel as p}from"./types.mjs";var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,x=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?u(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&&g(e,s,o),o};const y=[{bg:"#ecf5ff",color:"#3D61E3",border:"#d9ecff"},{bg:"#f0f9eb",color:"#67c23a",border:"#c2e7b0"},{bg:"#fdf6ec",color:"#e6a23c",border:"#faecd8"},{bg:"#fef0f0",color:"#f56c6c",border:"#fde2e2"},{bg:"#f4f4f5",color:"#909399",border:"#e9e9eb"}];let w=class extends e{constructor(){super(...arguments),this._iconPlus=s`<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>`,this._iconRemove=s`<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>`,this["order-index"]=0,this.title="",this["custom-id"]="",this["is-edit"]=!1,this["is-save"]=!1,this["is-set"]=!1,this["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-analysis"]=!0,this["rich-text-content"]="",this.analysis="",this["exam-answer-relation-type"]=0,this["exam-expand"]="",this["exam-id"]=0,this["category-id"]="",this["exam-answer-setting"]={isInOrder:!1,isIgnoreCase:!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["answer-list"]=[],this["tag-list"]=[],this["category-list"]=[],this["resource-list"]=[],this["show-tag"]=!1,this["show-category"]=!1,this["show-resource"]=!1,this["model-value"]="",this["use-model"]=!1,this._answers=[{title:"",tag:"",showInput:!1}],this._title="",this._analysis="",this._isInOrder=!1,this._isIgnoreCase=!0,this._keywordCount=null,this._correct="",this._showRichText=!1,this._richText="",this._selectedTagList=[],this._categoryId="",this.TITLE_MAX=200}willUpdate(t){t.has("is-edit")&&this["is-edit"]&&this._syncProps(),!this["is-edit"]&&(t.has("title")||t.has("answer-list")||t.has("analysis")||t.has("exam-answer-setting")||t.has("rich-text-content")||t.has("exam-expand")||t.has("tag-list")||t.has("category-id"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"]),t.has("tag-list")&&(this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(t=>({...t})):[]),t.has("category-id")&&(this._categoryId=this["category-id"]?String(this["category-id"]):"")}_normalizeAnswerTitle(t){return a(t?.title??t?.answer??"")}_normalizedAnswerList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(Array.isArray(t)?t:[]).map(t=>({...t,answerId:t?.answerId??t?.examAnswerId,title:this._normalizeAnswerTitle(t)}))}_filledAnswers(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).filter(t=>this._normalizeAnswerTitle(t))}_readKeywordCount(t){return t&&void 0!==t.keywordCount&&null!==t.keywordCount&&""!==t.keywordCount?Number(t.keywordCount):null}_syncProps(){this._title=this.title||"",this._analysis=this.analysis||"",this["answer-list"]?.length?this._answers=this._normalizedAnswerList(this["answer-list"]).map(t=>({title:t.title||"",tag:"",showInput:!1,answerId:t.answerId,customAnswerId:t.customAnswerId})):this._answers=[{title:"",tag:"",showInput:!1}],this._isInOrder=!!this["exam-answer-setting"]?.isInOrder,this._isIgnoreCase=this["exam-answer-setting"]?.isIgnoreCase??!0,this._keywordCount=this._readKeywordCount(this["exam-answer-setting"]),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],this._correct=this["exam-expand"]||"",this._selectedTagList=Array.isArray(this["tag-list"])?this["tag-list"].map(t=>({...t})):[],this._categoryId=this["category-id"]?String(this["category-id"]):""}_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}))}_addTag(t){const e={...this._answers[t]};e.tag&&(e.title=e.title?[e.title,e.tag].join(","):e.tag,e.tag=""),e.showInput=!1,this._answers=this._answers.map((s,i)=>i===t?e:s)}_closeTag(t,e){const s={...this._answers[e]};s.title=s.title.split(",").filter(e=>e!==t).join(","),this._answers=this._answers.map((t,i)=>i===e?s:t)}_addAnswer(){this._answers=[...this._answers,{title:"",tag:"",showInput:!1}]}_deleteAnswer(t){this._answers.length<2||(this._answers=this._answers.filter((e,s)=>s!==t))}_onCategoryChange(t){this._categoryId=t,this._emit("category-change",{value:t,customId:this["custom-id"]||"",examId:this["exam-id"]||0})}_imageResources(){return(this["resource-list"]||[]).filter(t=>1===t.resourceType).map(t=>t.resource.middle||t.resource.url).filter(Boolean)}_videoResource(){return(this["resource-list"]||[]).find(t=>2===t.resourceType)?.resource||null}_categoryLabel(){const t=this["category-list"].find(t=>String(t.categoryId)===String(this._categoryId));return t?.title||t?.categoryName||this._categoryId||"未选择分类"}_validateState(t){const{row:e,title:s,answers:i,correct:r,keywordCount:o}=t;if(!s)return new n("题目标题不能为空!","EMPTY_TITLE","title",e);const a=this._filledAnswers(i);return!!r||null!==o||a.length>0?r?!o||o<1?new n("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e):a.length?o>a.length?new n("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e):null:new n("请设置关键词","NO_KEYWORDS","answers",e):new n("请输入问题正确答案!","NO_CORRECT_ANSWER","correct",e):null}async toJSON(){return new Promise((t,e)=>{const s={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},i=l(this["is-edit"]?this._title:this.title||""),r=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),o=l(this["is-edit"]?this._analysis:this.analysis||""),a=l(this["is-edit"]?this._correct:this["exam-expand"]||""),n=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),d=this["is-edit"]?this._isInOrder:this["exam-answer-setting"]?.isInOrder??!1,h=this["is-edit"]?this._isIgnoreCase:this["exam-answer-setting"]?.isIgnoreCase??!0,p=this["is-edit"]?this._showRichText:!!this["rich-text-content"],g=this["is-edit"]?this._richText:this["rich-text-content"]||"",u=this._validateState({row:s,title:i,answers:r,correct:a,keywordCount:n});if(u)return void e(u);const x={answerType:c.TEXT_FILL,examTypeEnum:c.TEXT_FILL,title:i,answers:this._filledAnswers(r).map((t,e)=>{const s=this._normalizeAnswerTitle(t),i={title:s,answer:s,orderIndex:e+1};return t.answerId&&(i.answerId=t.answerId,i.examAnswerId=t.answerId),t.customAnswerId&&(i.customAnswerId=t.customAnswerId),i}),analysis:o,isSetCorrectAnswer:!!a,isKey:this["is-key"],examExpand:a,examAnswerSettingBO:{isIgnoreCase:h,isInOrder:d,...null!==n?{keywordCount:n}:{}},examAnswerSettingVO:{isIgnoreCase:h,isInOrder:d,...null!==n?{keywordCount:n}:{}},examRichTextContent:p?g:""};this["custom-id"]&&(x.customId=this["custom-id"]),t(x)})}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={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},e=l(this["is-edit"]?this._title:this.title||""),s=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),i=l(this["is-edit"]?this._correct:this["exam-expand"]||""),r=this["is-edit"]?this._keywordCount:this._readKeywordCount(this["exam-answer-setting"]),o=this._validateState({row:t,title:e,answers:s,correct:i,keywordCount:r});return o?[o]:[]}_renderPreview(){const t=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),e=this["is-edit"]?this._correct:this["exam-expand"]||"";return s`
|
|
2
2
|
<div class="preview">
|
|
3
3
|
<span class="title">${this["order-index"]+1}.${this.title}(问答题)</span>
|
|
4
4
|
${this["rich-text-content"]?s`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
@@ -10,37 +10,14 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
10
10
|
${e?s`<div style="margin-top:8px;color:#a8abb2">正确答案:${e}</div>`:""}
|
|
11
11
|
${this.analysis?s`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
|
|
12
12
|
${this["show-category"]&&this._categoryId?s`<div class="section-row"><span class="value-text">分类:${this._categoryLabel()}</span></div>`:""}
|
|
13
|
-
${this["show-tag"]&&this._selectedTagList.length?s`
|
|
14
|
-
<div class="section-row">
|
|
15
|
-
<span class="value-text">标签/关键信息:</span>
|
|
16
|
-
<div class="tag-list" style="margin-top:6px">
|
|
17
|
-
${this._selectedTagList.map(t=>s`<span class="tag-item">${t.tagName}</span>`)}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
`:""}
|
|
21
13
|
${this._renderResourceSection()}
|
|
22
14
|
</div>
|
|
23
|
-
`}
|
|
24
|
-
<div class="flex-items-start section-row">
|
|
25
|
-
<div class="label"><span>标签:</span></div>
|
|
26
|
-
<div style="flex:1">
|
|
27
|
-
<div class="tag-list">
|
|
28
|
-
${this._selectedTagList.length?this._selectedTagList.map(t=>s`
|
|
29
|
-
<span class="tag-item">
|
|
30
|
-
${t.tagName}
|
|
31
|
-
${this["is-save"]?"":s`<span class="close" @click=${()=>this._removeTag(t.tagId)}>×</span>`}
|
|
32
|
-
</span>
|
|
33
|
-
`):s`<span class="tag-hint">暂无标签/关键信息</span>`}
|
|
34
|
-
</div>
|
|
35
|
-
${this["is-edit"]&&!this["is-save"]?s`<div style="margin-top:8px"><span class="el-link" @click=${()=>this._chooseTag()}>选择</span></div>`:""}
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
`:""}_renderCategorySection(){return this["show-category"]?s`
|
|
15
|
+
`}_renderSorting(){const t=l(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=`${this["order-index"]+1}. ${t}`;return h(e,p[c.TEXT_FILL]||c.TEXT_FILL)}_renderCategorySection(){return this["show-category"]?s`
|
|
39
16
|
<div class="flex-items-start section-row">
|
|
40
17
|
<div class="label"><span>分类:</span></div>
|
|
41
18
|
<div style="flex:1">
|
|
42
19
|
${this["is-edit"]?s`
|
|
43
|
-
<select class="el-select" .value=${String(this._categoryId)}
|
|
20
|
+
<select class="el-select" .value=${String(this._categoryId)}
|
|
44
21
|
@change=${t=>this._onCategoryChange(t.target.value)}>
|
|
45
22
|
<option value="">选择分类</option>
|
|
46
23
|
${this["category-list"].map(t=>s`
|
|
@@ -69,7 +46,7 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
69
46
|
<div class="label"><span>题目:</span></div>
|
|
70
47
|
<div style="flex:1">
|
|
71
48
|
<div class="el-input">
|
|
72
|
-
<textarea rows="2" .value=${this._title}
|
|
49
|
+
<textarea rows="2" .value=${this._title}
|
|
73
50
|
maxlength=${this.TITLE_MAX}
|
|
74
51
|
@input=${t=>this._onTitleInput(t)}
|
|
75
52
|
placeholder="【问答题】请输入问题"></textarea>
|
|
@@ -102,7 +79,7 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
102
79
|
</div>
|
|
103
80
|
</div>
|
|
104
81
|
|
|
105
|
-
|
|
82
|
+
<slot name="business-tag"></slot>
|
|
106
83
|
|
|
107
84
|
${this._renderCategorySection()}
|
|
108
85
|
|
|
@@ -112,7 +89,7 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
112
89
|
<div class="label"><span>答案:</span></div>
|
|
113
90
|
<div style="flex:1">
|
|
114
91
|
<div class="el-input">
|
|
115
|
-
<textarea rows="2" .value=${this._correct}
|
|
92
|
+
<textarea rows="2" .value=${this._correct}
|
|
116
93
|
maxlength="200"
|
|
117
94
|
@input=${t=>{this._correct=t.target.value}}
|
|
118
95
|
placeholder="请输入正确答案"></textarea>
|
|
@@ -127,13 +104,13 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
127
104
|
<div class="answer-item">
|
|
128
105
|
<span class="label">关键词${e+1}:</span>
|
|
129
106
|
<div class="answer-tags" style="display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px">
|
|
130
|
-
${t.title.split(",").filter(Boolean).map(t=>{const i=
|
|
107
|
+
${t.title.split(",").filter(Boolean).map(t=>{const i=y[e%y.length];return s`
|
|
131
108
|
<span style="display:inline-flex;align-items:center;background:${i.bg};color:${i.color};border:1px solid ${i.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px">
|
|
132
109
|
${t}
|
|
133
|
-
|
|
110
|
+
<span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(t,e)}>×</span>
|
|
134
111
|
</span>
|
|
135
112
|
`})}
|
|
136
|
-
${
|
|
113
|
+
${s`
|
|
137
114
|
${t.showInput?s`
|
|
138
115
|
<input type="text" style="width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px"
|
|
139
116
|
@keydown=${t=>{"Enter"===t.key&&this._addTag(e)}}
|
|
@@ -147,21 +124,24 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
147
124
|
`}
|
|
148
125
|
`}
|
|
149
126
|
</div>
|
|
150
|
-
<span class="icon
|
|
151
|
-
<span class="icon ${this
|
|
127
|
+
<span class="icon" @click=${()=>this._addAnswer()}>${this._iconPlus}</span>
|
|
128
|
+
<span class="icon ${this._answers.length<2?"disabled":""}" @click=${()=>this._deleteAnswer(e)}>${this._iconRemove}</span>
|
|
152
129
|
</div>
|
|
153
130
|
`)}
|
|
154
131
|
</div>
|
|
155
132
|
|
|
156
133
|
${this._showRichText?s`
|
|
157
134
|
<div class="flex-items-start" style="margin-top:12px">
|
|
158
|
-
<div class="label"><span
|
|
135
|
+
<div class="label"><span>副文本:</span></div>
|
|
159
136
|
<div style="flex:1">
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
137
|
+
<slot name="sub-text">
|
|
138
|
+
<qxs-blocksuite-editor
|
|
139
|
+
.content=${this._richText}
|
|
140
|
+
.upload-image=${this["upload-image"]}
|
|
141
|
+
?is-edit=${!0}
|
|
142
|
+
@input=${t=>{this._richText=t.target.getContent()}}
|
|
143
|
+
></qxs-blocksuite-editor>
|
|
144
|
+
</slot>
|
|
165
145
|
${this["show-action"]?"":s`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
|
|
166
146
|
</div>
|
|
167
147
|
</div>
|
|
@@ -179,10 +159,9 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
179
159
|
</div>
|
|
180
160
|
</div>
|
|
181
161
|
`:""}
|
|
182
|
-
`}render(){return s`
|
|
162
|
+
`}render(){if(this.sorting)return this._renderSorting();const t=this["is-edit"]?s`<div slot="edit">${this._renderEdit()}</div>`:s`<div slot="preview">${this._renderPreview()}</div>`;return s`
|
|
183
163
|
<qxs-subject-layout .show-edit=${this["is-edit"]}>
|
|
184
|
-
|
|
185
|
-
<div slot="edit">${this._renderEdit()}</div>
|
|
164
|
+
${t}
|
|
186
165
|
${this["show-action"]?s`
|
|
187
166
|
<qxs-subject-action
|
|
188
167
|
.is-edit=${this["is-edit"]}
|
|
@@ -199,7 +178,7 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
199
178
|
></qxs-subject-action>
|
|
200
179
|
`:""}
|
|
201
180
|
</qxs-subject-layout>
|
|
202
|
-
`}};
|
|
181
|
+
`}};w.styles=[d,t`
|
|
203
182
|
:host { display: block; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; color: #5a5a5a; }
|
|
204
183
|
*, ::before, ::after { box-sizing: border-box; }
|
|
205
184
|
|
|
@@ -270,5 +249,5 @@ import{css as t,LitElement as e,html as s}from"lit";import{property as i,state a
|
|
|
270
249
|
width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
|
|
271
250
|
border: 1px solid #e4e7ed; background: #f5f7fa;
|
|
272
251
|
}
|
|
273
|
-
|
|
252
|
+
`],x([i({type:Number,attribute:"order-index"})],w.prototype,"order-index",2),x([i({type:String})],w.prototype,"title",2),x([i({type:String,attribute:"custom-id"})],w.prototype,"custom-id",2),x([i({type:Boolean,attribute:"is-edit"})],w.prototype,"is-edit",2),x([i({type:Boolean,attribute:"is-save"})],w.prototype,"is-save",2),x([i({type:Boolean,attribute:"is-set"})],w.prototype,"is-set",2),x([i({type:Boolean,attribute:"is-key"})],w.prototype,"is-key",2),x([i({type:Boolean,attribute:"show-action"})],w.prototype,"show-action",2),x([i({type:Boolean,attribute:"show-add"})],w.prototype,"show-add",2),x([i({type:Boolean,reflect:!0})],w.prototype,"sorting",2),x([i({type:Boolean,attribute:"show-answer-setting"})],w.prototype,"show-answer-setting",2),x([i({type:Boolean,attribute:"show-analysis"})],w.prototype,"show-analysis",2),x([i({type:String,attribute:"rich-text-content"})],w.prototype,"rich-text-content",2),x([i({type:String})],w.prototype,"analysis",2),x([i({type:Number,attribute:"exam-answer-relation-type"})],w.prototype,"exam-answer-relation-type",2),x([i({type:String,attribute:"exam-expand"})],w.prototype,"exam-expand",2),x([i({type:Number,attribute:"exam-id"})],w.prototype,"exam-id",2),x([i({type:String,attribute:"category-id"})],w.prototype,"category-id",2),x([i({type:Object,attribute:"exam-answer-setting"})],w.prototype,"exam-answer-setting",2),x([i({type:Object,attribute:"upload-image"})],w.prototype,"upload-image",2),x([i({type:Array,attribute:"answer-list"})],w.prototype,"answer-list",2),x([i({type:Array,attribute:"tag-list"})],w.prototype,"tag-list",2),x([i({type:Array,attribute:"category-list"})],w.prototype,"category-list",2),x([i({type:Array,attribute:"resource-list"})],w.prototype,"resource-list",2),x([i({type:Boolean,attribute:"show-tag"})],w.prototype,"show-tag",2),x([i({type:Boolean,attribute:"show-category"})],w.prototype,"show-category",2),x([i({type:Boolean,attribute:"show-resource"})],w.prototype,"show-resource",2),x([i({type:Object,attribute:"search-handler"})],w.prototype,"search-handler",2),x([i({type:String,attribute:"model-value"})],w.prototype,"model-value",2),x([i({type:Boolean,attribute:"use-model"})],w.prototype,"use-model",2),x([r()],w.prototype,"_answers",2),x([r()],w.prototype,"_title",2),x([r()],w.prototype,"_analysis",2),x([r()],w.prototype,"_isInOrder",2),x([r()],w.prototype,"_isIgnoreCase",2),x([r()],w.prototype,"_keywordCount",2),x([r()],w.prototype,"_correct",2),x([r()],w.prototype,"_showRichText",2),x([r()],w.prototype,"_richText",2),x([r()],w.prototype,"_selectedTagList",2),x([r()],w.prototype,"_categoryId",2),w=x([o("qxs-text-fill")],w);export{w as QxsTextFill};
|
|
274
253
|
//# sourceMappingURL=text-fill.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-fill.mjs","sources":["../../../../packages/components-wc/src/subject/text-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem } from './single'\nimport { SubjectType } from './types'\n\ninterface TextAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n customAnswerId?: string | number\n}\n\ninterface TextAnswerSetting {\n isInOrder?: boolean\n isIgnoreCase?: boolean\n keywordCount?: number\n}\n\nconst TAG_COLORS = [\n { bg: '#ecf5ff', color: '#3D61E3', border: '#d9ecff' },\n { bg: '#f0f9eb', color: '#67c23a', border: '#c2e7b0' },\n { bg: '#fdf6ec', color: '#e6a23c', border: '#faecd8' },\n { bg: '#fef0f0', color: '#f56c6c', border: '#fde2e2' },\n { bg: '#f4f4f5', color: '#909399', border: '#e9e9eb' },\n]\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-text-fill')\nexport class QxsTextFill extends LitElement {\n private readonly _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>`\n private readonly _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\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n\n .flex { display: flex; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .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 .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\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 .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 .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'is-key' }) 'is-key' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: 'show-answer-setting' }) 'show-answer-setting' = false\n @property({ type: Boolean, attribute: 'show-analysis' }) 'show-analysis' = true\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': TextAnswerSetting = { 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 @property({ type: Object, attribute: 'search-handler' }) 'search-handler'?: (query: string, answerType: number) => Promise<any[]>\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _answers: TextAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _keywordCount: number | null = null\n @state() private _correct = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 200\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('exam-expand') || 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']\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return String(answer?.title ?? answer?.answer ?? '')\n }\n\n private _normalizedAnswerList(source: any[] = []) {\n return (Array.isArray(source) ? source : []).map((answer: any) => ({\n ...answer,\n answerId: answer?.answerId ?? answer?.examAnswerId,\n title: this._normalizeAnswerTitle(answer),\n }))\n }\n\n private _filledAnswers(source: any[] = []) {\n return source.filter(answer => this._normalizeAnswerTitle(answer))\n }\n\n private _readKeywordCount(setting?: TextAnswerSetting | null) {\n if (!setting || setting.keywordCount === undefined || setting.keywordCount === null || setting.keywordCount === '') {\n return null\n }\n return Number(setting.keywordCount)\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this._normalizedAnswerList(this['answer-list']).map((answer: any) => ({\n title: answer.title || '',\n tag: '',\n showInput: false,\n answerId: answer.answerId,\n customAnswerId: answer.customAnswerId,\n }))\n }\n else {\n this._answers = [{ title: '', tag: '', showInput: false }]\n }\n this._isInOrder = !!this['exam-answer-setting']?.isInOrder\n this._isIgnoreCase = this['exam-answer-setting']?.isIgnoreCase ?? true\n this._keywordCount = this._readKeywordCount(this['exam-answer-setting'])\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._correct = this['exam-expand'] || ''\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 _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 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 _addTag(index: number) {\n const answer = { ...this._answers[index] }\n if (answer.tag) {\n answer.title = answer.title ? [answer.title, answer.tag].join(',') : answer.tag\n answer.tag = ''\n }\n answer.showInput = false\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _closeTag(tag: string, index: number) {\n const answer = { ...this._answers[index] }\n answer.title = answer.title.split(',').filter(item => item !== tag).join(',')\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _addAnswer() {\n if (this['is-save']) { return }\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 2 || this['is-save']) { return }\n this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index)\n }\n\n private _removeTag(tagId: string | number) {\n this._selectedTagList = this._selectedTagList.filter(item => String(item.tagId) !== String(tagId))\n this._emit('tag-change', {\n value: this._selectedTagList,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _chooseTag() {\n this._emit('choose-tag', {\n value: this._selectedTagList,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n private _validateState(options: {\n row: any\n title: string\n answers: TextAnswer[]\n correct: string\n keywordCount: number | null\n }) {\n const { row, title, answers, correct, keywordCount } = options\n if (!title) {\n return new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row)\n }\n\n const filledAnswers = this._filledAnswers(answers)\n const shouldValidateAnswers = !!correct || keywordCount !== null || filledAnswers.length > 0\n\n if (!shouldValidateAnswers) { return null }\n if (!correct) {\n return new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row)\n }\n if (!keywordCount || keywordCount < 1) {\n return new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row)\n }\n if (!filledAnswers.length) {\n return new SubjectError('请设置关键词', 'NO_KEYWORDS', 'answers', row)\n }\n if (keywordCount > filledAnswers.length) {\n return new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row)\n }\n return null\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title || ''\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const analysis = this['is-edit'] ? this._analysis : this.analysis || ''\n const correct = this['is-edit'] ? this._correct : this['exam-expand'] || ''\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\n const isInOrder = this['is-edit'] ? this._isInOrder : (this['exam-answer-setting']?.isInOrder ?? false)\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : (this['exam-answer-setting']?.isIgnoreCase ?? true)\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const selectedTagList = this._selectedTagList || []\n\n const validationError = this._validateState({ row, title, answers, correct, keywordCount })\n if (validationError) {\n reject(validationError)\n return\n }\n\n const result: any = {\n answerType: SubjectType.TEXT_FILL,\n title,\n answers: this._filledAnswers(answers).map((answer: any) => ({\n title: this._normalizeAnswerTitle(answer),\n ...(answer.answerId ? { answerId: answer.answerId } : {}),\n ...(answer.customAnswerId ? { customAnswerId: answer.customAnswerId } : {}),\n })),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this['is-key'],\n examExpand: correct,\n examAnswerSettingBO: {\n isIgnoreCase,\n isInOrder,\n ...(keywordCount !== null ? { keywordCount } : {}),\n },\n examRichTextContent: showRichText ? richText : '',\n categoryId: this._categoryId || '',\n memberTagInfo: selectedTagList,\n tagInfos: selectedTagList,\n resourceList: this['resource-list'] || [],\n examResourceBOList: this['resource-list'] || [],\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n const title = this['is-edit'] ? this._title : this.title || ''\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const correct = this['is-edit'] ? this._correct : this['exam-expand'] || ''\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\n const validationError = this._validateState({ row, title, answers, correct, keywordCount })\n return validationError ? [validationError] : []\n }\n\n private _renderPreview() {\n const previewAnswers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const previewCorrect = this['is-edit'] ? this._correct : (this['exam-expand'] || '')\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${this.title}(问答题)</span>\n ${this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${this._filledAnswers(previewAnswers).length\n ? html`\n <div style=\"margin-top:8px;color:#a8abb2\">\n ${this._filledAnswers(previewAnswers).map((answer, index) => html`<span style=\"margin-right:10px\">关键词${index + 1}: ${this._normalizeAnswerTitle(answer)}</span>`)}\n </div>\n `\n : ''}\n ${previewCorrect ? html`<div style=\"margin-top:8px;color:#a8abb2\">正确答案:${previewCorrect}</div>` : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this['show-tag'] && this._selectedTagList.length\n ? html`\n <div class=\"section-row\">\n <span class=\"value-text\">标签/关键信息:</span>\n <div class=\"tag-list\" style=\"margin-top:6px\">\n ${this._selectedTagList.map(item => html`<span class=\"tag-item\">${item.tagName}</span>`)}\n </div>\n </div>\n `\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderTagSection() {\n if (!this['show-tag']) { return '' }\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>标签:</span></div>\n <div style=\"flex:1\">\n <div class=\"tag-list\">\n ${this._selectedTagList.length\n ? this._selectedTagList.map(item => html`\n <span class=\"tag-item\">\n ${item.tagName}\n ${!this['is-save'] ? html`<span class=\"close\" @click=${() => this._removeTag(item.tagId)}>×</span>` : ''}\n </span>\n `)\n : html`<span class=\"tag-hint\">暂无标签/关键信息</span>`}\n </div>\n ${this['is-edit'] && !this['is-save']\n ? html`<div style=\"margin-top:8px\"><span class=\"el-link\" @click=${() => this._chooseTag()}>选择</span></div>`\n : ''}\n </div>\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)} ?disabled=${this['is-save']}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title} ?disabled=${this['is-save']}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【问答题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <div style=\"flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px\">\n <span style=\"font-size:13px;color:#606266\">共答对</span>\n <input\n type=\"number\"\n style=\"width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px\"\n .value=${this._keywordCount === null ? '' : String(this._keywordCount)}\n min=\"1\"\n @change=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._keywordCount = value === '' ? null : Number(value)\n }} />\n <span style=\"font-size:13px;color:#606266\">个关键词,算是正确的</span>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n </div>\n\n ${this._renderTagSection()}\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\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 rows=\"2\" .value=${this._correct} ?disabled=${this['is-save']}\n maxlength=\"200\"\n @input=${(e: Event) => { this._correct = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入正确答案\"></textarea>\n <span class=\"char-counter\">${this._correct.length}/200</span>\n </div>\n </div>\n </div>\n\n <div class=\"answer-list\" style=\"margin-top:12px\">\n <span style=\"padding-left:60px;font-size:12px;color:#909399\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">关键词${index + 1}:</span>\n <div class=\"answer-tags\" style=\"display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px\">\n ${answer.title.split(',').filter(Boolean).map((tag) => {\n const color = TAG_COLORS[index % TAG_COLORS.length]\n return html`\n <span style=\"display:inline-flex;align-items:center;background:${color.bg};color:${color.color};border:1px solid ${color.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px\">\n ${tag}\n ${!this['is-save'] ? html`<span style=\"cursor:pointer;margin-left:4px;color:#909399\" @click=${() => this._closeTag(tag, index)}>×</span>` : ''}\n </span>\n `\n })}\n ${!this['is-save']\n ? html`\n ${answer.showInput\n ? html`\n <input type=\"text\" style=\"width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._addTag(index) }\n }}\n @input=${(e: Event) => { answer.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._addTag(index)} />\n <button class=\"el-link\" @click=${() => this._addTag(index)}>确认</button>\n `\n : html`\n <button class=\"link\" @click=${() => { this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? { ...item, showInput: true } : item); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('input[style*=\\\"width:80px\\\"]') as HTMLInputElement)?.focus() }) }}>\n ${answer.title ? '添加同义词' : '添加关键词'}\n </button>\n `}\n `\n : ''}\n </div>\n <span class=\"icon ${this['is-save'] ? 'disabled' : ''}\" @click=${() => this._addAnswer()}>${this._iconPlus}</span>\n <span class=\"icon ${this['is-save'] || this._answers.length < 2 ? 'disabled' : ''}\" @click=${() => this._deleteAnswer(index)}>${this._iconRemove}</span>\n </div>\n `)}\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <qxs-blocksuite-editor\n .content=${this._richText}\n .upload-image=${this['upload-image']}\n ?is-edit=${true}\n ></qxs-blocksuite-editor>\n ${!this['show-action']\n ? html`<div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>`\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 rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n return html`\n <qxs-subject-layout .show-edit=${this['is-edit']}>\n <div slot=\"preview\">${this._renderPreview()}</div>\n <div slot=\"edit\">${this._renderEdit()}</div>\n ${this['show-action']\n ? html`\n <qxs-subject-action\n .is-edit=${this['is-edit']}\n .is-set=${this['is-set']}\n .show-add=${this['show-add']}\n .show-rich-text=${this._showRichText}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["TAG_COLORS","bg","color","border","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","title","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","_normalizedAnswerList","source","length","undefined","answerId","examAnswerId","_filledAnswers","filter","_readKeywordCount","setting","keywordCount","Number","customAnswerId","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","index","join","currentIndex","_closeTag","split","_addAnswer","_deleteAnswer","_","_removeTag","tagId","customId","examId","_chooseTag","_onCategoryChange","_imageResources","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","_validateState","options","row","answers","correct","SubjectError","filledAnswers","toJSON","answerType","orderIndex","showRichText","richText","selectedTagList","validationError","SubjectType","TEXT_FILL","isSetCorrectAnswer","isKey","examExpand","examAnswerSettingBO","examRichTextContent","memberTagInfo","tagInfos","resourceList","examResourceBOList","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","_renderPreview","previewAnswers","previewCorrect","tagName","_renderResourceSection","_renderTagSection","_renderCategorySection","images","video","src","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","render","styles","css","__decorateClass","property","type","attribute","prototype","state","safeCustomElement"],"mappings":"ybAoBA,MAAMA,EAAa,CACjB,CAAEC,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,G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AAA,GACAJ,EAAA,CAAhBK,KA7HUvL,EA6HMsL,UAAA,WAAA,GACAJ,EAAA,CAAhBK,KA9HUvL,EA8HMsL,UAAA,gBAAA,GACAJ,EAAA,CAAhBK,KA/HUvL,EA+HMsL,UAAA,YAAA,GACAJ,EAAA,CAAhBK,KAhIUvL,EAgIMsL,UAAA,mBAAA,GACAJ,EAAA,CAAhBK,KAjIUvL,EAiIMsL,UAAA,cAAA,GAjINtL,EAANkL,EAAA,CADNM,EAAkB,kBACNxL"}
|
|
1
|
+
{"version":3,"file":"text-fill.mjs","sources":["../../../../packages/components-wc/src/subject/text-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 TextAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n customAnswerId?: string | number\n}\n\ninterface TextAnswerSetting {\n isInOrder?: boolean\n isIgnoreCase?: boolean\n keywordCount?: number\n}\n\nconst TAG_COLORS = [\n { bg: '#ecf5ff', color: '#3D61E3', border: '#d9ecff' },\n { bg: '#f0f9eb', color: '#67c23a', border: '#c2e7b0' },\n { bg: '#fdf6ec', color: '#e6a23c', border: '#faecd8' },\n { bg: '#fef0f0', color: '#f56c6c', border: '#fde2e2' },\n { bg: '#f4f4f5', color: '#909399', border: '#e9e9eb' },\n]\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-text-fill')\nexport class QxsTextFill extends LitElement {\n private readonly _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>`\n private readonly _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\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\n .flex { display: flex; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 60px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .answer-list { margin-top: 12px; }\n .answer-item { display: flex; align-items: center; margin-top: 6px; border-radius: 4px; }\n .answer-item .label { min-width: 60px; font-size: 13px; color: #909399; }\n .answer-item .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 .answer-item .link { color: #3D61E3; cursor: pointer; font-size: 12px; white-space: nowrap; background: none; border: none; padding: 0; margin: 0; font-family: inherit; }\n .answer-item .link:hover { color: #2D4CB8; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; background: none; border: none; padding: 0; margin: 0; font-family: inherit; line-height: 1; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.danger { color: #f56c6c; }\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 .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 .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, 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' = true\n @property({ type: String, attribute: 'rich-text-content' }) 'rich-text-content' = ''\n @property({ type: String }) analysis = ''\n @property({ type: Number, attribute: 'exam-answer-relation-type' }) 'exam-answer-relation-type' = 0\n @property({ type: String, attribute: 'exam-expand' }) 'exam-expand' = ''\n @property({ type: Number, attribute: 'exam-id' }) 'exam-id' = 0\n @property({ type: String, attribute: 'category-id' }) 'category-id' = ''\n @property({ type: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': TextAnswerSetting = { 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 @property({ type: Object, attribute: 'search-handler' }) 'search-handler'?: (query: string, answerType: number) => Promise<any[]>\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _answers: TextAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _keywordCount: number | null = null\n @state() private _correct = ''\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 200\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('exam-expand') || 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']\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 _normalizedAnswerList(source: any[] = []) {\n return (Array.isArray(source) ? source : []).map((answer: any) => ({\n ...answer,\n answerId: answer?.answerId ?? answer?.examAnswerId,\n title: this._normalizeAnswerTitle(answer),\n }))\n }\n\n private _filledAnswers(source: any[] = []) {\n return source.filter(answer => this._normalizeAnswerTitle(answer))\n }\n\n private _readKeywordCount(setting?: TextAnswerSetting | null) {\n if (!setting || setting.keywordCount === undefined || setting.keywordCount === null || setting.keywordCount === '') {\n return null\n }\n return Number(setting.keywordCount)\n }\n\n private _syncProps() {\n this._title = this.title || ''\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this._normalizedAnswerList(this['answer-list']).map((answer: any) => ({\n title: answer.title || '',\n tag: '',\n showInput: false,\n answerId: answer.answerId,\n customAnswerId: answer.customAnswerId,\n }))\n }\n else {\n this._answers = [{ title: '', tag: '', showInput: false }]\n }\n this._isInOrder = !!this['exam-answer-setting']?.isInOrder\n this._isIgnoreCase = this['exam-answer-setting']?.isIgnoreCase ?? true\n this._keywordCount = this._readKeywordCount(this['exam-answer-setting'])\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._correct = this['exam-expand'] || ''\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 _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 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 _addTag(index: number) {\n const answer = { ...this._answers[index] }\n if (answer.tag) {\n answer.title = answer.title ? [answer.title, answer.tag].join(',') : answer.tag\n answer.tag = ''\n }\n answer.showInput = false\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _closeTag(tag: string, index: number) {\n const answer = { ...this._answers[index] }\n answer.title = answer.title.split(',').filter(item => item !== tag).join(',')\n this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? answer : item)\n }\n\n private _addAnswer() {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n\n private _deleteAnswer(index: number) {\n if (this._answers.length < 2) { return }\n this._answers = this._answers.filter((_, currentIndex) => currentIndex !== index)\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 private _validateState(options: {\n row: any\n title: string\n answers: TextAnswer[]\n correct: string\n keywordCount: number | null\n }) {\n const { row, title, answers, correct, keywordCount } = options\n if (!title) {\n return new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row)\n }\n\n const filledAnswers = this._filledAnswers(answers)\n const shouldValidateAnswers = !!correct || keywordCount !== null || filledAnswers.length > 0\n\n if (!shouldValidateAnswers) { return null }\n if (!correct) {\n return new SubjectError('请输入问题正确答案!', 'NO_CORRECT_ANSWER', 'correct', row)\n }\n if (!keywordCount || keywordCount < 1) {\n return new SubjectError('请完善答题设置!', 'NO_KEYWORD_COUNT', 'keywordCount', row)\n }\n if (!filledAnswers.length) {\n return new SubjectError('请设置关键词', 'NO_KEYWORDS', 'answers', row)\n }\n if (keywordCount > filledAnswers.length) {\n return new SubjectError('关键词个数设置有误!', 'KEYWORD_COUNT_MISMATCH', 'answers', row)\n }\n return null\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const analysis = trimText(this['is-edit'] ? this._analysis : this.analysis || '')\n const correct = trimText(this['is-edit'] ? this._correct : this['exam-expand'] || '')\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\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 validationError = this._validateState({ row, title, answers, correct, keywordCount })\n if (validationError) {\n reject(validationError)\n return\n }\n\n const result: any = {\n answerType: SubjectType.TEXT_FILL,\n examTypeEnum: SubjectType.TEXT_FILL,\n title,\n answers: this._filledAnswers(answers).map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n if (answer.customAnswerId) {\n next.customAnswerId = answer.customAnswerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: !!correct,\n isKey: this['is-key'],\n examExpand: correct,\n examAnswerSettingBO: {\n isIgnoreCase,\n isInOrder,\n ...(keywordCount !== null ? { keywordCount } : {}),\n },\n examAnswerSettingVO: {\n isIgnoreCase,\n isInOrder,\n ...(keywordCount !== null ? { keywordCount } : {}),\n },\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 row = { customId: this['custom-id'] || undefined, answerType: 'text_fill', orderIndex: this['order-index'] }\n const title = trimText(this['is-edit'] ? this._title : this.title || '')\n const answers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const correct = trimText(this['is-edit'] ? this._correct : this['exam-expand'] || '')\n const keywordCount = this['is-edit'] ? this._keywordCount : this._readKeywordCount(this['exam-answer-setting'])\n const validationError = this._validateState({ row, title, answers, correct, keywordCount })\n return validationError ? [validationError] : []\n }\n\n private _renderPreview() {\n const previewAnswers = this['is-edit'] ? this._answers : this._normalizedAnswerList(this['answer-list'] || [])\n const previewCorrect = this['is-edit'] ? this._correct : (this['exam-expand'] || '')\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${this.title}(问答题)</span>\n ${this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${this._filledAnswers(previewAnswers).length\n ? html`\n <div style=\"margin-top:8px;color:#a8abb2\">\n ${this._filledAnswers(previewAnswers).map((answer, index) => html`<span style=\"margin-right:10px\">关键词${index + 1}: ${this._normalizeAnswerTitle(answer)}</span>`)}\n </div>\n `\n : ''}\n ${previewCorrect ? html`<div style=\"margin-top:8px;color:#a8abb2\">正确答案:${previewCorrect}</div>` : ''}\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 _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.TEXT_FILL] || SubjectType.TEXT_FILL)\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"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-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._title}\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-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <div style=\"flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px\">\n <span style=\"font-size:13px;color:#606266\">共答对</span>\n <input\n type=\"number\"\n style=\"width:60px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:13px\"\n .value=${this._keywordCount === null ? '' : String(this._keywordCount)}\n min=\"1\"\n @change=${(e: Event) => {\n const value = (e.target as HTMLInputElement).value\n this._keywordCount = value === '' ? null : Number(value)\n }} />\n <span style=\"font-size:13px;color:#606266\">个关键词,算是正确的</span>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label style=\"display:inline-flex;align-items:center;gap:4px;cursor:pointer;font-size:12px;color:#606266\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\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 rows=\"2\" .value=${this._correct}\n maxlength=\"200\"\n @input=${(e: Event) => { this._correct = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入正确答案\"></textarea>\n <span class=\"char-counter\">${this._correct.length}/200</span>\n </div>\n </div>\n </div>\n\n <div class=\"answer-list\" style=\"margin-top:12px\">\n <span style=\"padding-left:60px;font-size:12px;color:#909399\">*如遇包含特殊字符的关键词,需添加多个同义词,例:'CO₂'需添加同义词'CO2'</span>\n ${this._answers.map((answer, index) => html`\n <div class=\"answer-item\">\n <span class=\"label\">关键词${index + 1}:</span>\n <div class=\"answer-tags\" style=\"display:flex;flex-wrap:wrap;gap:5px;align-items:center;flex:1;max-width:360px\">\n ${answer.title.split(',').filter(Boolean).map((tag) => {\n const color = TAG_COLORS[index % TAG_COLORS.length]\n return html`\n <span style=\"display:inline-flex;align-items:center;background:${color.bg};color:${color.color};border:1px solid ${color.border};border-radius:3px;padding:2px 8px;font-size:12px;line-height:16px\">\n ${tag}\n <span style=\"cursor:pointer;margin-left:4px;color:#909399\" @click=${() => this._closeTag(tag, index)}>×</span>\n </span>\n `\n })}\n ${html`\n ${answer.showInput\n ? html`\n <input type=\"text\" style=\"width:80px;height:24px;border:1px solid #dcdfe6;border-radius:3px;padding:0 8px;font-size:12px\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._addTag(index) }\n }}\n @input=${(e: Event) => { answer.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._addTag(index)} />\n <button class=\"el-link\" @click=${() => this._addTag(index)}>确认</button>\n `\n : html`\n <button class=\"link\" @click=${() => { this._answers = this._answers.map((item, currentIndex) => currentIndex === index ? { ...item, showInput: true } : item); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('input[style*=\\\"width:80px\\\"]') as HTMLInputElement)?.focus() }) }}>\n ${answer.title ? '添加同义词' : '添加关键词'}\n </button>\n `}\n `}\n </div>\n <span class=\"icon\" @click=${() => this._addAnswer()}>${this._iconPlus}</span>\n <span class=\"icon ${this._answers.length < 2 ? 'disabled' : ''}\" @click=${() => this._deleteAnswer(index)}>${this._iconRemove}</span>\n </div>\n `)}\n </div>\n\n ${this._showRichText\n ? html`\n <div class=\"flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>副文本:</span></div>\n <div style=\"flex:1\">\n <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`<div class=\"flex-justify-end\" style=\"margin-top:8px\"><span class=\"el-link danger\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span></div>`\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 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._showRichText}\n exam-answer-relation-type=${this['exam-answer-relation-type']}\n @delete=${() => this._emit('delete')}\n @save=${this._save}\n @edit=${() => this._emit('edit')}\n @add=${(e: CustomEvent) => this._emit('add', e.detail)}\n @set-key=${(e: CustomEvent) => { this._emit('set-key', e.detail) }}\n @on-show-rich-text=${() => {\n this._showRichText = !this._showRichText\n if (!this._showRichText) {\n this._richText = ''\n }\n }}\n ></qxs-subject-action>\n `\n : ''}\n </qxs-subject-layout>\n `\n }\n}\n\nexport function register() {}\n"],"names":["TAG_COLORS","bg","color","border","QxsTextFill","LitElement","constructor","super","arguments","this","_iconPlus","html","_iconRemove","title","sorting","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_answers","tag","showInput","_title","_analysis","_isInOrder","_isIgnoreCase","_keywordCount","_correct","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","trimCommaSeparatedText","_normalizedAnswerList","source","length","undefined","answerId","examAnswerId","_filledAnswers","filter","_readKeywordCount","setting","keywordCount","Number","customAnswerId","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_onTitleInput","el","value","slice","_addTag","index","join","currentIndex","_closeTag","split","_addAnswer","_deleteAnswer","_","_onCategoryChange","customId","examId","_imageResources","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","_validateState","options","row","answers","correct","SubjectError","filledAnswers","toJSON","answerType","orderIndex","trimText","showRichText","richText","validationError","SubjectType","TEXT_FILL","examTypeEnum","next","isSetCorrectAnswer","isKey","examExpand","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","_renderPreview","previewAnswers","previewCorrect","_renderResourceSection","_renderSorting","orderText","renderSortingCard","SubjectTypeLabel","_renderCategorySection","images","video","src","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","getContent","render","content","styles","sortingCardStyles","css","__decorateClass","property","type","attribute","prototype","reflect","state","safeCustomElement"],"mappings":"ukBAqBA,MAAMA,EAAa,CACjB,CAAEC,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,WAC3C,CAAEF,GAAI,UAAWC,MAAO,UAAWC,OAAQ,YAiBtC,IAAMC,EAAN,cAA0BC,EAA1BC,WAAAA,GAAAC,SAAAC,WACLC,KAAiBC,UAAYC,CAAA,2NAC7BF,KAAiBG,YAAcD,CAAA,qLA2EuBF,KAAA,eAAgB,EAC1CA,KAAAI,MAAQ,GACgBJ,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACn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EAAS,CAAEC,KAAMtI,OAAQuI,UAAW,iBArH1BxL,EAqH2CyL,UAAA,cAAA,GACDJ,EAAA,CAApDC,EAAS,CAAEC,KAAMzF,QAAS0F,UAAW,eAtH3BxL,EAsH0CyL,UAAA,YAAA,GAEpCJ,EAAA,CAAhBM,KAxHU3L,EAwHMyL,UAAA,WAAA,GACAJ,EAAA,CAAhBM,KAzHU3L,EAyHMyL,UAAA,SAAA,GACAJ,EAAA,CAAhBM,KA1HU3L,EA0HMyL,UAAA,YAAA,GACAJ,EAAA,CAAhBM,KA3HU3L,EA2HMyL,UAAA,aAAA,GACAJ,EAAA,CAAhBM,KA5HU3L,EA4HMyL,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,KA7HU3L,EA6HMyL,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,KA9HU3L,EA8HMyL,UAAA,WAAA,GACAJ,EAAA,CAAhBM,KA/HU3L,EA+HMyL,UAAA,gBAAA,GACAJ,EAAA,CAAhBM,KAhIU3L,EAgIMyL,UAAA,YAAA,GACAJ,EAAA,CAAhBM,KAjIU3L,EAiIMyL,UAAA,mBAAA,GACAJ,EAAA,CAAhBM,KAlIU3L,EAkIMyL,UAAA,cAAA,GAlINzL,EAANqL,EAAA,CADNO,EAAkB,kBACN5L"}
|
package/es/subject/types.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var l=(l=>(l.SINGLE="single",l.MULTIPLE="multiple",l.BLANK_FILL="blank_fill",l.TEXT_FILL="text_fill",l.SORT="sort",l.SCALE="scale",l))(l||{});export{l as SubjectType};
|
|
1
|
+
var l=(l=>(l.SINGLE="single",l.MULTIPLE="multiple",l.BLANK_FILL="blank_fill",l.TEXT_FILL="text_fill",l.SORT="sort",l.SCALE="scale",l.PAGE_END="page_end",l))(l||{});const e={single:"单选题",multiple:"多选题",blank_fill:"填空题",text_fill:"问答题",sort:"排序题",scale:"量表题",page_end:"分页符"};export{l as SubjectType,e as SubjectTypeLabel};
|
|
2
2
|
//# sourceMappingURL=types.mjs.map
|
package/es/subject/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../../packages/components-wc/src/subject/types.ts"],"sourcesContent":["export enum SubjectType {\n SINGLE = 'single',\n MULTIPLE = 'multiple',\n BLANK_FILL = 'blank_fill',\n TEXT_FILL = 'text_fill',\n SORT = 'sort',\n SCALE = 'scale',\n}\n\nexport type AnswerType = 'single' | 'multiple' | 'blank_fill' | 'text_fill' | 'sort' | 'scale'\n\nexport const SubjectTypeLabel: Record<string, string> = {\n [SubjectType.SINGLE]: '单选题',\n [SubjectType.MULTIPLE]: '多选题',\n [SubjectType.BLANK_FILL]: '填空题',\n [SubjectType.TEXT_FILL]: '问答题',\n [SubjectType.SORT]: '排序题',\n [SubjectType.SCALE]: '量表题',\n}\n"],"names":["SubjectType"],"mappings":"IAAYA,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,WAAa,aACbA,EAAA,UAAY,YACZA,EAAA,KAAO,OACPA,EAAA,MAAQ,
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../../packages/components-wc/src/subject/types.ts"],"sourcesContent":["export enum SubjectType {\n SINGLE = 'single',\n MULTIPLE = 'multiple',\n BLANK_FILL = 'blank_fill',\n TEXT_FILL = 'text_fill',\n SORT = 'sort',\n SCALE = 'scale',\n PAGE_END = 'page_end',\n}\n\nexport type AnswerType = 'single' | 'multiple' | 'blank_fill' | 'text_fill' | 'sort' | 'scale'\nexport type SubjectItemType = AnswerType | 'page_end'\n\nexport const SubjectTypeLabel: Record<string, string> = {\n [SubjectType.SINGLE]: '单选题',\n [SubjectType.MULTIPLE]: '多选题',\n [SubjectType.BLANK_FILL]: '填空题',\n [SubjectType.TEXT_FILL]: '问答题',\n [SubjectType.SORT]: '排序题',\n [SubjectType.SCALE]: '量表题',\n [SubjectType.PAGE_END]: '分页符',\n}\n"],"names":["SubjectType","SubjectTypeLabel","single","multiple","blank_fill","text_fill","sort","scale","page_end"],"mappings":"IAAYA,GAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,SAAW,WACXA,EAAA,WAAa,aACbA,EAAA,UAAY,YACZA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,SAAW,WAPDA,IAAAA,GAAA,CAAA,GAaL,MAAMC,EAA2C,CACtDC,OAAsB,MACtBC,SAAwB,MACxBC,WAA0B,MAC1BC,UAAyB,MACzBC,KAAoB,MACpBC,MAAqB,MACrBC,SAAwB"}
|