@qxs-bns/components-wc 0.0.24 → 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.
@@ -1,27 +1,56 @@
1
- import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as a}from"lit/decorators.js";import{safeCustomElement as l}from"../base/define.mjs";import{SubjectError as n}from"./single.mjs";import{SubjectType as r}from"./types.mjs";var o=Object.defineProperty,h=Object.getOwnPropertyDescriptor,p=(t,e,i,s)=>{for(var a,l=s>1?void 0:s?h(e,i):e,n=t.length-1;n>=0;n--)(a=t[n])&&(l=(s?a(e,i,l):a(l))||l);return s&&l&&o(e,i,l),l};const d=t`
1
+ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state as r}from"lit/decorators.js";import{safeCustomElement as a}from"../base/define.mjs";import{SubjectError as o}from"./single.mjs";import{SubjectType as l}from"./types.mjs";var n=Object.defineProperty,p=Object.getOwnPropertyDescriptor,h=(t,e,i,s)=>{for(var r,a=s>1?void 0:s?p(e,i):e,o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s?r(e,i,a):r(a))||a);return s&&a&&n(e,i,a),a};const d=t`
2
2
  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"
3
3
  stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
4
4
  <line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>
5
- </svg>`;let c=class extends i{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["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,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-answer-setting"]={isInOrder:!1,isIgnoreCase:!0},this["upload-image"]=async t=>new Promise((e,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.readAsDataURL(t)}),this["answer-list"]=[],this["model-value"]="",this["use-model"]=!1,this._title="",this._analysis="",this._answers=[{title:"",tag:"",showInput:!1}],this._isInOrder=!1,this._isIgnoreCase=!0,this._showRichText=!1,this._richText="",this.TITLE_MAX=400}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"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"].replaceAll(/<filter><\/filter>/g," ______"))}_normalizeAnswerTitle(t){return String(t?.title??t?.answer??"")}_syncProps(){if(this._title=(this.title||"").replaceAll(/<filter><\/filter>/g," ______"),this._analysis=this.analysis||"",this["answer-list"]?.length)this._answers=this["answer-list"].map(t=>({title:this._normalizeAnswerTitle(t),tag:"",showInput:!1}));else{const t=(this._title.match(/ ______/g)||[]).length||1;this._answers=Array.from({length:t},()=>({title:"",tag:"",showInput:!1}))}this["exam-answer-setting"]&&(this._isInOrder=!!this["exam-answer-setting"].isInOrder,this._isIgnoreCase=!!this["exam-answer-setting"].isIgnoreCase),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}))}_addBlank(){this._title+=" ______",this._answers=[...this._answers,{title:"",tag:"",showInput:!1}],this.requestUpdate(),this._emitModelUpdate()}_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;const i=(this._title.match(/ ______/g)||[]).length;if(i!==this._answers.length)if(i>this._answers.length)for(let t=this._answers.length;t<i;t++)this._answers=[...this._answers,{title:"",tag:"",showInput:!1}];else this._answers=this._answers.slice(0,i);this._emitModelUpdate()}_emitModelUpdate(){if(this["use-model"]){const t=this._title.replaceAll(/ ______/g,"<filter></filter>");this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:t}))}}_handleAddTag(t){t.showInput=!1,t.tag&&(t.title=t.title?[t.title,t.tag].join(","):t.tag,t.tag=""),this.requestUpdate()}_closeTag(t,e){if(t){const i=e.title.split(","),s=i.findIndex(e=>e===t);s>-1&&(i.splice(s,1),e.title=i.join(",")),this.requestUpdate()}}async toJSON(){return new Promise((t,e)=>{const i={customId:this["custom-id"]||void 0,answerType:"blank_fill",orderIndex:this["order-index"]},s=this["is-edit"]?this._title:this.title?.replaceAll(/<filter><\/filter>/g," ______")||"",a=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)})),l=this["is-edit"]?this._analysis:this.analysis||"",o=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"],d=this["is-edit"]?this._richText:this["rich-text-content"]||"";if(!s)return void e(new n("题目标题不能为空!","EMPTY_TITLE","title",i));if(a.length<1)return void e(new n("至少添加一个填空符!","NO_BLANK","answers",i));const c={answerType:r.BLANK_FILL,title:s.replaceAll(/ ______/g,"<filter></filter>"),answers:a.map(t=>({title:t.title,isCorrect:!0})),analysis:l,isSetCorrectAnswer:!0,isKey:this["is-key"],examAnswerSettingBO:{isIgnoreCase:h,isInOrder:o},examRichTextContent:p?d:""};this["custom-id"]&&(c.customId=this["custom-id"]),t(c)})}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:"blank_fill",orderIndex:this["order-index"]},i=this["is-edit"]?this._title:this.title?.replaceAll(/<filter><\/filter>/g," ______")||"",s=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)}));return i||t.push(new n("题目标题不能为空!","EMPTY_TITLE","title",e)),s.length<1&&t.push(new n("至少添加一个填空符!","NO_BLANK","answers",e)),t}_renderPreview(){const e=this.title.replaceAll(/<filter><\/filter>/g," ______"),i=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)}));return t`
5
+ </svg>`;let c=class extends i{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["is-key"]=!1,this["show-action"]=!0,this["show-add"]=!0,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,i)=>{const s=new FileReader;s.onload=t=>e(t.target?.result),s.onerror=i,s.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._title="",this._analysis="",this._answers=[{title:"",tag:"",showInput:!1}],this._isInOrder=!1,this._isIgnoreCase=!0,this._showRichText=!1,this._richText="",this._selectedTagList=[],this._categoryId="",this.TITLE_MAX=400}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("tag-list")||t.has("category-id"))&&this._syncProps(),t.has("model-value")&&this["use-model"]&&(this._title=this["model-value"].replaceAll(/<filter><\/filter>/g," ______")),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 String(t?.title??t?.answer??"")}_syncProps(){if(this._title=(this.title||"").replaceAll(/<filter><\/filter>/g," ______"),this._analysis=this.analysis||"",this["answer-list"]?.length)this._answers=this["answer-list"].map(t=>({title:this._normalizeAnswerTitle(t),tag:"",showInput:!1,answerId:t?.answerId??t?.examAnswerId}));else{const t=(this._title.match(/ ______/g)||[]).length||1;this._answers=Array.from({length:t},()=>({title:"",tag:"",showInput:!1}))}this["exam-answer-setting"]&&(this._isInOrder=!!this["exam-answer-setting"].isInOrder,this._isIgnoreCase=!!this["exam-answer-setting"].isIgnoreCase),this._richText=this["rich-text-content"]||"",this._showRichText=!!this["rich-text-content"],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}))}_addBlank(){this._title+=" ______",this._answers=[...this._answers,{title:"",tag:"",showInput:!1}],this.requestUpdate(),this._emitModelUpdate()}_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;const i=(this._title.match(/ ______/g)||[]).length;if(i!==this._answers.length)if(i>this._answers.length)for(let t=this._answers.length;t<i;t++)this._answers=[...this._answers,{title:"",tag:"",showInput:!1}];else this._answers=this._answers.slice(0,i);this._emitModelUpdate()}_emitModelUpdate(){if(this["use-model"]){const t=this._title.replaceAll(/ ______/g,"<filter></filter>");this.dispatchEvent(new CustomEvent("update:modelValue",{bubbles:!0,composed:!0,detail:t}))}}_handleAddTag(t){t.showInput=!1,t.tag&&(t.title=t.title?[t.title,t.tag].join(","):t.tag,t.tag=""),this.requestUpdate()}_closeTag(t,e){if(!t)return;const i=e.title.split(","),s=i.findIndex(e=>e===t);s>-1&&(i.splice(s,1),e.title=i.join(",")),this.requestUpdate()}_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||"未选择分类"}async toJSON(){return new Promise((t,e)=>{const i={customId:this["custom-id"]||void 0,answerType:"blank_fill",orderIndex:this["order-index"]},s=this["is-edit"]?this._title:this.title?.replaceAll(/<filter><\/filter>/g," ______")||"",r=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t),answerId:t?.answerId??t?.examAnswerId})),a=this["is-edit"]?this._analysis:this.analysis||"",n=this["is-edit"]?this._isInOrder:this["exam-answer-setting"]?.isInOrder??!1,p=this["is-edit"]?this._isIgnoreCase:this["exam-answer-setting"]?.isIgnoreCase??!0,h=this["is-edit"]?this._showRichText:!!this["rich-text-content"],d=this["is-edit"]?this._richText:this["rich-text-content"]||"",c=r.filter(t=>this._normalizeAnswerTitle(t));if(!s)return void e(new o("题目标题不能为空!","EMPTY_TITLE","title",i));if(r.length<1)return void e(new o("至少添加一个填空符!","NO_BLANK","answers",i));const g={answerType:l.BLANK_FILL,examTypeEnum:l.BLANK_FILL,title:s.replaceAll(/ ______/g,"<filter></filter>"),answers:c.map((t,e)=>{const i=this._normalizeAnswerTitle(t),s={title:i,answer:i,isCorrect:!0,orderIndex:e+1};return t.answerId&&(s.answerId=t.answerId,s.examAnswerId=t.answerId),s}),analysis:a,isSetCorrectAnswer:c.length>0,isKey:this["is-key"],examAnswerSettingBO:{isIgnoreCase:p,isInOrder:n},examAnswerSettingVO:{isIgnoreCase:p,isInOrder:n},examRichTextContent:h?d:""};this["custom-id"]&&(g.customId=this["custom-id"]),t(g)})}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:"blank_fill",orderIndex:this["order-index"]},i=this["is-edit"]?this._title:this.title?.replaceAll(/<filter><\/filter>/g," ______")||"",s=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)}));return i||t.push(new o("题目标题不能为空!","EMPTY_TITLE","title",e)),s.length<1&&t.push(new o("至少添加一个填空符!","NO_BLANK","answers",e)),t}_renderPreview(){const e=this.title.replaceAll(/<filter><\/filter>/g," ______"),i=this["is-edit"]?this._answers:(this["answer-list"]||[]).map(t=>({...t,title:this._normalizeAnswerTitle(t)}));return t`
6
6
  <div class="preview">
7
7
  <span class="title">${this["order-index"]+1}.${e}(填空题)</span>
8
8
  ${this["rich-text-content"]?t`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
9
9
  ${i.some(t=>t.title)?t`
10
10
  <div class="content flex flex-wrap">
11
11
  <span>正确答案:</span>
12
- ${i.map((e,i)=>e.title?t`
13
- <span style="margin-right:10px">填空${i+1}: ${e.title}</span>
14
- `:"")}
12
+ ${i.map((e,i)=>e.title?t`<span style="margin-right:10px">填空${i+1}: ${e.title}</span>`:"")}
15
13
  </div>
16
14
  `:""}
17
15
  ${this.analysis?t`<div style="color:#909399;font-size:12px;margin-top:8px">解析: ${this.analysis}</div>`:""}
16
+ ${this["show-category"]&&this._categoryId?t`<div class="section-row"><span class="value-text">分类:${this._categoryLabel()}</span></div>`:""}
17
+ ${this._renderResourceSection()}
18
+ </div>
19
+ `}_renderCategorySection(){return this["show-category"]?t`
20
+ <div class="flex flex-items-start section-row">
21
+ <div class="label"><span>分类:</span></div>
22
+ <div style="flex:1">
23
+ ${this["is-edit"]?t`
24
+ <select class="el-select" .value=${String(this._categoryId)}
25
+ @change=${t=>this._onCategoryChange(t.target.value)}>
26
+ <option value="">选择分类</option>
27
+ ${this["category-list"].map(e=>t`
28
+ <option value=${String(e.categoryId)} ?selected=${String(e.categoryId)===String(this._categoryId)}>${e.title||e.categoryName}</option>
29
+ `)}
30
+ </select>
31
+ `:t`<span class="value-text">${this._categoryLabel()}</span>`}
32
+ </div>
33
+ </div>
34
+ `:""}_renderResourceSection(){if(!this["show-resource"])return"";const e=this._imageResources(),i=this._videoResource();return t`
35
+ <div class="flex flex-items-start section-row">
36
+ <div class="label"><span>资源:</span></div>
37
+ <div style="flex:1">
38
+ <div class="resource-summary">图片 ${e.length} 张${i?.url?",含视频资源":""}</div>
39
+ ${e.length?t`
40
+ <div class="resource-thumbs">
41
+ ${e.slice(0,4).map(e=>t`<img class="resource-thumb" src=${e} alt="resource" />`)}
42
+ </div>
43
+ `:""}
44
+ ${i?.url?t`<div style="margin-top:8px"><a class="el-link" href=${i.url} target="_blank" rel="noreferrer">查看视频</a></div>`:""}
45
+ ${e.length||i?.url?"":t`<div class="tag-hint">暂无资源</div>`}
46
+ </div>
18
47
  </div>
19
48
  `}_renderEdit(){return t`
20
49
  <div class="flex flex-items-start">
21
50
  <div class="label"><span>题目:</span></div>
22
51
  <div style="flex:1">
23
52
  <div class="el-input">
24
- <textarea rows="3" .value=${this._title} ?disabled=${this["is-save"]}
53
+ <textarea rows="3" .value=${this._title}
25
54
  maxlength=${this.TITLE_MAX}
26
55
  @input=${t=>this._onTitleInput(t)}
27
56
  placeholder="【填空题】请输入问题"></textarea>
@@ -31,25 +60,28 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
31
60
  </div>
32
61
 
33
62
  <div class="flex flex-justify-end">
34
- <span class="el-link ${this["is-save"]?"is-disabled":""}"
35
- @click=${()=>{this["is-save"]||this._addBlank()}}>插入填空符</span>
63
+ <span class="el-link" @click=${()=>this._addBlank()}>插入填空符</span>
36
64
  </div>
37
65
 
38
- ${this["show-answer-setting"]?t`
39
- <div class="flex flex-items-center" style="margin-top:12px">
40
- <div class="label"><span>答题设置:</span></div>
41
- <label class="el-checkbox">
42
- <input type="checkbox" .checked=${this._isInOrder}
43
- @change=${t=>{this._isInOrder=t.target.checked}} />
44
- 答案不分顺序
45
- </label>
46
- <label class="el-checkbox">
47
- <input type="checkbox" .checked=${this._isIgnoreCase}
48
- @change=${t=>{this._isIgnoreCase=t.target.checked}} />
49
- 忽略大小写
50
- </label>
51
- </div>
52
- `:""}
66
+ <div class="flex flex-items-center" style="margin-top:12px">
67
+ <div class="label"><span>答题设置:</span></div>
68
+ <label class="el-checkbox">
69
+ <input type="checkbox" .checked=${this._isInOrder}
70
+ @change=${t=>{this._isInOrder=t.target.checked}} />
71
+ 答案不分顺序
72
+ </label>
73
+ <label class="el-checkbox">
74
+ <input type="checkbox" .checked=${this._isIgnoreCase}
75
+ @change=${t=>{this._isIgnoreCase=t.target.checked}} />
76
+ 忽略大小写
77
+ </label>
78
+ </div>
79
+
80
+ <slot name="business-tag"></slot>
81
+
82
+ ${this._renderCategorySection()}
83
+
84
+ ${this._renderResourceSection()}
53
85
 
54
86
  ${this._answers.map((e,i)=>t`
55
87
  <div class="answer-item" style="margin-top:12px">
@@ -58,10 +90,10 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
58
90
  ${e.title.split(",").filter(Boolean).map(i=>t`
59
91
  <span class="el-tag">
60
92
  ${i}
61
- ${this["is-save"]?"":t`<span class="el-tag__close" @click=${()=>this._closeTag(i,e)}>×</span>`}
93
+ <span class="el-tag__close" @click=${()=>this._closeTag(i,e)}>×</span>
62
94
  </span>
63
95
  `)}
64
- ${this["is-save"]?"":t`
96
+ ${t`
65
97
  ${e.showInput?t`
66
98
  <input type="text" class="el-input--small"
67
99
  @keydown=${t=>{"Enter"===t.key&&this._handleAddTag(e)}}
@@ -108,10 +140,9 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
108
140
  </div>
109
141
  </div>
110
142
  `:""}
111
- `}render(){return t`
143
+ `}render(){const e=this["is-edit"]?t`<div slot="edit">${this._renderEdit()}</div>`:t`<div slot="preview">${this._renderPreview()}</div>`;return t`
112
144
  <qxs-subject-layout .show-edit=${this["is-edit"]}>
113
- <div slot="preview">${this._renderPreview()}</div>
114
- <div slot="edit">${this._renderEdit()}</div>
145
+ ${e}
115
146
  ${this["show-action"]?t`
116
147
  <qxs-subject-action
117
148
  .is-edit=${this["is-edit"]}
@@ -159,7 +190,6 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
159
190
  font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
160
191
  }
161
192
 
162
- /* Tag style */
163
193
  .el-tag {
164
194
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
165
195
  font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;
@@ -172,7 +202,6 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
172
202
  }
173
203
  .el-tag .el-tag__close:hover { background: #909399; color: #fff; }
174
204
 
175
- /* Button small style */
176
205
  .el-button--small {
177
206
  display: inline-flex; align-items: center; gap: 4px;
178
207
  height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;
@@ -181,12 +210,10 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
181
210
  }
182
211
  .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }
183
212
 
184
- /* Link style */
185
213
  .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }
186
214
  .el-link:hover { color: #2D4CB8; }
187
215
  .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }
188
216
 
189
- /* Input small for tag */
190
217
  .el-input--small { width: 80px; }
191
218
  .el-input--small input {
192
219
  height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;
@@ -194,7 +221,6 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
194
221
  }
195
222
  .el-input--small input:focus { border-color: #3D61E3; outline: none; }
196
223
 
197
- /* Checkbox style */
198
224
  .el-checkbox {
199
225
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
200
226
  font-size: 13px; color: #606266; user-select: none; margin-right: 16px;
@@ -206,5 +232,33 @@ import{html as t,css as e,LitElement as i}from"lit";import{property as s,state a
206
232
  .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
207
233
  .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }
208
234
  .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
209
- `,p([s({type:Number,attribute:"order-index"})],c.prototype,"order-index",2),p([s({type:String})],c.prototype,"title",2),p([s({type:String,attribute:"custom-id"})],c.prototype,"custom-id",2),p([s({type:Boolean,attribute:"is-edit"})],c.prototype,"is-edit",2),p([s({type:Boolean,attribute:"is-save"})],c.prototype,"is-save",2),p([s({type:Boolean,attribute:"is-set"})],c.prototype,"is-set",2),p([s({type:Boolean,attribute:"is-key"})],c.prototype,"is-key",2),p([s({type:Boolean,attribute:"show-action"})],c.prototype,"show-action",2),p([s({type:Boolean,attribute:"show-add"})],c.prototype,"show-add",2),p([s({type:Boolean,attribute:"show-answer-setting"})],c.prototype,"show-answer-setting",2),p([s({type:Boolean,attribute:"show-analysis"})],c.prototype,"show-analysis",2),p([s({type:String,attribute:"rich-text-content"})],c.prototype,"rich-text-content",2),p([s({type:String})],c.prototype,"analysis",2),p([s({type:Number,attribute:"exam-answer-relation-type"})],c.prototype,"exam-answer-relation-type",2),p([s({type:String,attribute:"exam-expand"})],c.prototype,"exam-expand",2),p([s({type:Object,attribute:"exam-answer-setting"})],c.prototype,"exam-answer-setting",2),p([s({type:Object,attribute:"upload-image"})],c.prototype,"upload-image",2),p([s({type:Array,attribute:"answer-list"})],c.prototype,"answer-list",2),p([s({type:String,attribute:"model-value"})],c.prototype,"model-value",2),p([s({type:Boolean,attribute:"use-model"})],c.prototype,"use-model",2),p([a()],c.prototype,"_title",2),p([a()],c.prototype,"_analysis",2),p([a()],c.prototype,"_answers",2),p([a()],c.prototype,"_isInOrder",2),p([a()],c.prototype,"_isIgnoreCase",2),p([a()],c.prototype,"_showRichText",2),p([a()],c.prototype,"_richText",2),c=p([l("qxs-blank-fill")],c);export{c as QxsBlankFill};
235
+
236
+ .section-row { margin-top: 12px; }
237
+ .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }
238
+ .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
239
+ .tag-item {
240
+ display: inline-flex; align-items: center; gap: 4px;
241
+ padding: 4px 8px; font-size: 12px; line-height: 1;
242
+ color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;
243
+ }
244
+ .tag-item .close { cursor: pointer; color: #909399; }
245
+ .tag-item .close:hover { color: #f56c6c; }
246
+ .tag-hint { font-size: 12px; color: #909399; }
247
+
248
+ .el-select {
249
+ width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;
250
+ padding: 0 8px; font-size: 13px; background: #fff; appearance: none;
251
+ 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");
252
+ background-repeat: no-repeat; background-position: right 8px center;
253
+ }
254
+ .el-select:focus { border-color: #3D61E3; outline: none; }
255
+ .el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }
256
+
257
+ .resource-summary { font-size: 12px; color: #606266; }
258
+ .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
259
+ .resource-thumb {
260
+ width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
261
+ border: 1px solid #e4e7ed; background: #f5f7fa;
262
+ }
263
+ `,h([s({type:Number,attribute:"order-index"})],c.prototype,"order-index",2),h([s({type:String})],c.prototype,"title",2),h([s({type:String,attribute:"custom-id"})],c.prototype,"custom-id",2),h([s({type:Boolean,attribute:"is-edit"})],c.prototype,"is-edit",2),h([s({type:Boolean,attribute:"is-save"})],c.prototype,"is-save",2),h([s({type:Boolean,attribute:"is-set"})],c.prototype,"is-set",2),h([s({type:Boolean,attribute:"is-key"})],c.prototype,"is-key",2),h([s({type:Boolean,attribute:"show-action"})],c.prototype,"show-action",2),h([s({type:Boolean,attribute:"show-add"})],c.prototype,"show-add",2),h([s({type:Boolean,attribute:"show-answer-setting"})],c.prototype,"show-answer-setting",2),h([s({type:Boolean,attribute:"show-analysis"})],c.prototype,"show-analysis",2),h([s({type:String,attribute:"rich-text-content"})],c.prototype,"rich-text-content",2),h([s({type:String})],c.prototype,"analysis",2),h([s({type:Number,attribute:"exam-answer-relation-type"})],c.prototype,"exam-answer-relation-type",2),h([s({type:String,attribute:"exam-expand"})],c.prototype,"exam-expand",2),h([s({type:Number,attribute:"exam-id"})],c.prototype,"exam-id",2),h([s({type:String,attribute:"category-id"})],c.prototype,"category-id",2),h([s({type:Object,attribute:"exam-answer-setting"})],c.prototype,"exam-answer-setting",2),h([s({type:Object,attribute:"upload-image"})],c.prototype,"upload-image",2),h([s({type:Array,attribute:"answer-list"})],c.prototype,"answer-list",2),h([s({type:Array,attribute:"tag-list"})],c.prototype,"tag-list",2),h([s({type:Array,attribute:"category-list"})],c.prototype,"category-list",2),h([s({type:Array,attribute:"resource-list"})],c.prototype,"resource-list",2),h([s({type:Boolean,attribute:"show-tag"})],c.prototype,"show-tag",2),h([s({type:Boolean,attribute:"show-category"})],c.prototype,"show-category",2),h([s({type:Boolean,attribute:"show-resource"})],c.prototype,"show-resource",2),h([s({type:String,attribute:"model-value"})],c.prototype,"model-value",2),h([s({type:Boolean,attribute:"use-model"})],c.prototype,"use-model",2),h([r()],c.prototype,"_title",2),h([r()],c.prototype,"_analysis",2),h([r()],c.prototype,"_answers",2),h([r()],c.prototype,"_isInOrder",2),h([r()],c.prototype,"_isIgnoreCase",2),h([r()],c.prototype,"_showRichText",2),h([r()],c.prototype,"_richText",2),h([r()],c.prototype,"_selectedTagList",2),h([r()],c.prototype,"_categoryId",2),c=h([a("qxs-blank-fill")],c);export{c as QxsBlankFill};
210
264
  //# sourceMappingURL=blank-fill.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"blank-fill.mjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { SubjectError } from './single'\nimport { SubjectType } from './types'\n\ninterface BlankAnswer { title: string, tag: string, showInput: boolean }\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n /* Tag style */\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n /* Button small style */\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n /* Link style */\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n /* Input small for tag */\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n /* Checkbox style */\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n `\n\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: Object, attribute: 'exam-answer-setting' })\n 'exam-answer-setting': { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) 'answer-list': any[] = []\n\n // 双向绑定支持\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('exam-answer-setting') || changed.has('rich-text-content'))) {\n this._syncProps()\n }\n // 当外部 modelValue 变化时同步内部状态\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value'].replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return String(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this['answer-list'].map((a: any) => ({ title: this._normalizeAnswerTitle(a), tag: '', showInput: false }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length || 1\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this['exam-answer-setting']) {\n this._isInOrder = !!this['exam-answer-setting'].isInOrder\n this._isIgnoreCase = !!this['exam-answer-setting'].isIgnoreCase\n }\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n // 双向绑定:通知外部更新\n private _emitModelUpdate() {\n if (this['use-model']) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (tag) {\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) { tags.splice(idx, 1); item.title = tags.join(',') }\n this.requestUpdate()\n }\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n const analysis = this['is-edit'] ? this._analysis : this.analysis || ''\n const isInOrder = this['is-edit'] ? this._isInOrder : this['exam-answer-setting']?.isInOrder ?? false\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : this['exam-answer-setting']?.isIgnoreCase ?? true\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: answers.map((a: any) => ({ title: a.title, isCorrect: true })),\n analysis,\n isSetCorrectAnswer: true,\n isKey: this['is-key'],\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${displayTitle}(填空题)</span>\n ${this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`\n <span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>\n `\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title} ?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 flex-justify-end\">\n <span class=\"el-link ${this['is-save'] ? 'is-disabled' : ''}\"\n @click=${() => {\n if (!this['is-save']) { this._addBlank() }\n }}>插入填空符</span>\n </div>\n\n ${this['show-answer-setting']\n ? html`\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n `\n : ''}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n ${!this['is-save'] ? html`<span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>` : ''}\n </span>\n `)}\n ${!this['is-save']\n ? html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `\n : ''}\n </div>\n </div>\n `)}\n\n ${this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <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`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n 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":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","title","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","_normalizeAnswerTitle","answer","String","length","map","a","blankCount","match","Array","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","modelValue","_handleAddTag","item","join","_closeTag","tags","split","idx","findIndex","t","splice","toJSON","row","customId","answerType","orderIndex","answers","showRichText","richText","SubjectError","SubjectType","BLANK_FILL","isCorrect","isSetCorrectAnswer","isKey","examAnswerSettingBO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","some","_renderEdit","checked","filter","Boolean","key","updateComplete","then","shadowRoot","querySelector","focus","render","styles","css","__decorateClass","property","type","Number","attribute","prototype","state","safeCustomElement"],"mappings":"ybAQA,MAAMA,EAAWC,CAAA;;;;UAoBV,IAAMC,EAAN,cAA2BC,EAA3BC,WAAAA,GAAAC,SAAAC,WAiFiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACFA,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,qBAAsB,GACtDA,KAAAE,SAAW,GAC6BF,KAAA,6BAA8B,EAC5CA,KAAA,eAAgB,GAEtEA,KAAA,uBAAuE,CAAEG,WAAW,EAAOC,cAAc,GAGzGJ,KAAA,gBAAkDK,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAI4BjB,KAAA,eAAuB,GAGtBA,KAAA,eAAgB,GACjBA,KAAA,cAAc,EAE1DA,KAAQkB,OAAS,GACjBlB,KAAQmB,UAAY,GACpBnB,KAAQoB,SAA0B,CAAC,CAAEnB,MAAO,GAAIoB,IAAK,GAAIC,WAAW,IACpEtB,KAAQuB,YAAa,EACrBvB,KAAQwB,eAAgB,EACxBxB,KAAQyB,eAAgB,EACxBzB,KAAQ0B,UAAY,GAE7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,sBAAA,GAGAL,EAAA,CADCC,EAAS,CAAEC,KAAM5C,OAAQ8C,UAAW,kBAnG1BhJ,EAoGXiJ,UAAA,eAAA,GASqDL,EAAA,CAApDC,EAAS,CAAEC,KAAMhG,MAAOkG,UAAW,iBA7GzBhJ,EA6G0CiJ,UAAA,cAAA,GAGCL,EAAA,CAArDC,EAAS,CAAEC,KAAMtG,OAAQwG,UAAW,iBAhH1BhJ,EAgH2CiJ,UAAA,cAAA,GACDL,EAAA,CAApDC,EAAS,CAAEC,KAAMZ,QAASc,UAAW,eAjH3BhJ,EAiH0CiJ,UAAA,YAAA,GAEpCL,EAAA,CAAhBM,KAnHUlJ,EAmHMiJ,UAAA,SAAA,GACAL,EAAA,CAAhBM,KApHUlJ,EAoHMiJ,UAAA,YAAA,GACAL,EAAA,CAAhBM,KArHUlJ,EAqHMiJ,UAAA,WAAA,GACAL,EAAA,CAAhBM,KAtHUlJ,EAsHMiJ,UAAA,aAAA,GACAL,EAAA,CAAhBM,KAvHUlJ,EAuHMiJ,UAAA,gBAAA,GACAL,EAAA,CAAhBM,KAxHUlJ,EAwHMiJ,UAAA,gBAAA,GACAL,EAAA,CAAhBM,KAzHUlJ,EAyHMiJ,UAAA,YAAA,GAzHNjJ,EAAN4I,EAAA,CADNO,EAAkB,mBACNnJ"}
1
+ {"version":3,"file":"blank-fill.mjs","sources":["../../../../packages/components-wc/src/subject/blank-fill.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport { safeCustomElement } from '../base/define'\nimport { type Category, type Resource, SubjectError, type TagItem } from './single'\nimport { SubjectType } from './types'\n\ninterface BlankAnswer {\n title: string\n tag: string\n showInput: boolean\n answerId?: string | number\n}\n\nconst iconPlus = html`\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"12\" y1=\"5\" x2=\"12\" y2=\"19\"/><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"/>\n </svg>`\n\nfunction showToast(msg: string) {\n const el = document.createElement('div')\n el.textContent = msg\n Object.assign(el.style, {\n position: 'fixed', top: '20px', left: '50%', transform: 'translateX(-50%)',\n padding: '10px 20px', borderRadius: '4px', fontSize: '13px', color: '#fff',\n background: '#f56c6c', zIndex: '99999', boxShadow: '0 4px 12px rgba(0,0,0,.15)',\n transition: 'opacity .3s', opacity: '1',\n })\n document.body.appendChild(el)\n setTimeout(() => { el.style.opacity = '0'; setTimeout(() => el.remove(), 300) }, 2500)\n}\n\n@safeCustomElement('qxs-blank-fill')\nexport class QxsBlankFill extends LitElement {\n static styles = css`\n :host { display: block; font-family: system-ui, -apple-system, \"PingFang SC\", \"Microsoft YaHei\", sans-serif; font-size: 12px; color: #5a5a5a; }\n *, ::before, ::after { box-sizing: border-box; }\n\n .preview { padding: 12px 0; }\n .preview .title { font-size: 14px; color: #303133; }\n .preview .rich-text { margin-top: 8px; }\n .preview .rich-text img { max-width: 100%; }\n .preview .content { color: #a8abb2; margin-top: 10px; }\n\n .flex { display: flex; }\n .flex-wrap { flex-wrap: wrap; }\n .flex-items-center { display: flex; align-items: center; }\n .flex-items-start { display: flex; align-items: flex-start; }\n .flex-justify-end { display: flex; justify-content: flex-end; }\n .label { min-width: 70px; font-size: 13px; color: #606266; }\n\n textarea {\n border: 1px solid #dcdfe6; border-radius: 3px; padding: 5px 11px;\n font-size: 13px; font-family: inherit; width: 100%; resize: none; transition: border-color .2s;\n line-height: 1.5; display: block; box-sizing: border-box;\n }\n textarea:focus { border-color: #3D61E3; outline: none; }\n textarea:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n .el-input { position: relative; display: block; }\n .el-input textarea { padding-bottom: 24px; }\n .el-input .char-counter {\n position: absolute; right: 12px; bottom: 8px;\n font-size: 12px; color: #909399; line-height: 1; pointer-events: none;\n }\n\n .el-tag {\n display: inline-flex; align-items: center; height: 24px; padding: 0 9px;\n font-size: 12px; line-height: 1; color: #3D61E3; background: #ecf5ff;\n border: 1px solid #d9ecff; border-radius: 4px; white-space: nowrap;\n }\n .el-tag .el-tag__close {\n display: inline-flex; align-items: center; justify-content: center;\n margin-left: 4px; width: 16px; height: 16px; border-radius: 50%;\n font-size: 12px; color: #909399; cursor: pointer; transition: all .2s;\n }\n .el-tag .el-tag__close:hover { background: #909399; color: #fff; }\n\n .el-button--small {\n display: inline-flex; align-items: center; gap: 4px;\n height: 24px; padding: 0 10px; font-size: 12px; line-height: 1;\n border: 1px solid #dcdfe6; border-radius: 3px; background: #fff; color: #606266;\n cursor: pointer; transition: all .2s; white-space: nowrap;\n }\n .el-button--small:hover { color: #3D61E3; border-color: #c6e2ff; background-color: #ecf5ff; }\n\n .el-link { color: #3D61E3; cursor: pointer; font-size: 12px; text-decoration: none; }\n .el-link:hover { color: #2D4CB8; }\n .el-link.is-disabled { color: #c0c4cc; cursor: not-allowed; }\n\n .el-input--small { width: 80px; }\n .el-input--small input {\n height: 24px; padding: 0 8px; font-size: 12px; line-height: 24px;\n border: 1px solid #dcdfe6; border-radius: 3px; width: 100%;\n }\n .el-input--small input:focus { border-color: #3D61E3; outline: none; }\n\n .el-checkbox {\n display: inline-flex; align-items: center; gap: 6px; cursor: pointer;\n font-size: 13px; color: #606266; user-select: none; margin-right: 16px;\n }\n .el-checkbox input[type=\"checkbox\"] {\n width: 14px; height: 14px; cursor: pointer; accent-color: #3D61E3;\n }\n\n .answer-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .answer-item .label { min-width: 70px; padding-top: 0; color: #909399; }\n .answer-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }\n\n .section-row { margin-top: 12px; }\n .value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }\n .tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }\n .tag-item {\n display: inline-flex; align-items: center; gap: 4px;\n padding: 4px 8px; font-size: 12px; line-height: 1;\n color: #3D61E3; background: #ecf5ff; border: 1px solid #d9ecff; border-radius: 4px;\n }\n .tag-item .close { cursor: pointer; color: #909399; }\n .tag-item .close:hover { color: #f56c6c; }\n .tag-hint { font-size: 12px; color: #909399; }\n\n .el-select {\n width: 150px; height: 32px; border: 1px solid #dcdfe6; border-radius: 3px;\n padding: 0 8px; font-size: 13px; background: #fff; appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c0c4cc' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 8px center;\n }\n .el-select:focus { border-color: #3D61E3; outline: none; }\n .el-select:disabled { background: #f5f7fa; color: #c0c4cc; cursor: not-allowed; }\n\n .resource-summary { font-size: 12px; color: #606266; }\n .resource-thumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }\n .resource-thumb {\n width: 72px; height: 72px; object-fit: cover; border-radius: 6px;\n border: 1px solid #e4e7ed; background: #f5f7fa;\n }\n `\n\n @property({ type: Number, attribute: 'order-index' }) 'order-index' = 0\n @property({ type: String }) title = ''\n @property({ type: String, attribute: 'custom-id' }) 'custom-id' = ''\n @property({ type: Boolean, attribute: 'is-edit' }) 'is-edit' = false\n @property({ type: Boolean, attribute: 'is-save' }) 'is-save' = false\n @property({ type: Boolean, attribute: 'is-set' }) 'is-set' = false\n @property({ type: Boolean, attribute: 'is-key' }) 'is-key' = false\n @property({ type: Boolean, attribute: 'show-action' }) 'show-action' = true\n @property({ type: Boolean, attribute: 'show-add' }) 'show-add' = true\n @property({ type: Boolean, attribute: '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': { isInOrder: boolean, isIgnoreCase: boolean } = { isInOrder: false, isIgnoreCase: true }\n\n @property({ type: Object, attribute: 'upload-image' })\n 'upload-image': (file: File) => Promise<string> = async (file: File) => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = e => resolve(e.target?.result as string)\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n }\n\n @property({ type: Array, attribute: 'answer-list' }) 'answer-list': any[] = []\n @property({ type: Array, attribute: 'tag-list' }) 'tag-list': TagItem[] = []\n @property({ type: Array, attribute: 'category-list' }) 'category-list': Category[] = []\n @property({ type: Array, attribute: 'resource-list' }) 'resource-list': Resource[] = []\n @property({ type: Boolean, attribute: 'show-tag' }) 'show-tag' = false\n @property({ type: Boolean, attribute: 'show-category' }) 'show-category' = false\n @property({ type: Boolean, attribute: 'show-resource' }) 'show-resource' = false\n\n @property({ type: String, attribute: 'model-value' }) 'model-value' = ''\n @property({ type: Boolean, attribute: 'use-model' }) 'use-model' = false\n\n @state() private _title = ''\n @state() private _analysis = ''\n @state() private _answers: BlankAnswer[] = [{ title: '', tag: '', showInput: false }]\n @state() private _isInOrder = false\n @state() private _isIgnoreCase = true\n @state() private _showRichText = false\n @state() private _richText = ''\n @state() private _selectedTagList: TagItem[] = []\n @state() private _categoryId = ''\n\n private readonly TITLE_MAX = 400\n\n willUpdate(changed: Map<string, unknown>) {\n if (changed.has('is-edit') && this['is-edit']) { this._syncProps() }\n if (!this['is-edit'] && (changed.has('title') || changed.has('answer-list') || changed.has('analysis') || changed.has('exam-answer-setting') || changed.has('rich-text-content') || changed.has('tag-list') || changed.has('category-id'))) {\n this._syncProps()\n }\n if (changed.has('model-value') && this['use-model']) {\n this._title = this['model-value'].replaceAll(/<filter><\\/filter>/g, ' ______')\n }\n if (changed.has('tag-list')) {\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n }\n if (changed.has('category-id')) {\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n }\n\n private _normalizeAnswerTitle(answer: any) {\n return String(answer?.title ?? answer?.answer ?? '')\n }\n\n private _syncProps() {\n this._title = (this.title || '').replaceAll(/<filter><\\/filter>/g, ' ______')\n this._analysis = this.analysis || ''\n if (this['answer-list']?.length) {\n this._answers = this['answer-list'].map((a: any) => ({\n title: this._normalizeAnswerTitle(a),\n tag: '',\n showInput: false,\n answerId: a?.answerId ?? a?.examAnswerId,\n }))\n }\n else {\n const blankCount = (this._title.match(/ ______/g) || []).length || 1\n this._answers = Array.from({ length: blankCount }, () => ({ title: '', tag: '', showInput: false }))\n }\n if (this['exam-answer-setting']) {\n this._isInOrder = !!this['exam-answer-setting'].isInOrder\n this._isIgnoreCase = !!this['exam-answer-setting'].isIgnoreCase\n }\n this._richText = this['rich-text-content'] || ''\n this._showRichText = !!this['rich-text-content']\n this._selectedTagList = Array.isArray(this['tag-list']) ? this['tag-list'].map(item => ({ ...item })) : []\n this._categoryId = this['category-id'] ? String(this['category-id']) : ''\n }\n\n private _emit(name: string, detail?: unknown) {\n this.dispatchEvent(new CustomEvent(name, { bubbles: true, composed: true, detail: detail ?? null }))\n }\n\n private _addBlank() {\n this._title += ' ______'\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n this.requestUpdate()\n this._emitModelUpdate()\n }\n\n private _onTitleInput(e: Event) {\n const el = e.target as HTMLTextAreaElement\n if (el.value.length > this.TITLE_MAX) { el.value = el.value.slice(0, this.TITLE_MAX) }\n this._title = el.value\n const blankCount = (this._title.match(/ ______/g) || []).length\n if (blankCount !== this._answers.length) {\n if (blankCount > this._answers.length) {\n for (let i = this._answers.length; i < blankCount; i++) {\n this._answers = [...this._answers, { title: '', tag: '', showInput: false }]\n }\n }\n else {\n this._answers = this._answers.slice(0, blankCount)\n }\n }\n this._emitModelUpdate()\n }\n\n private _emitModelUpdate() {\n if (this['use-model']) {\n const modelValue = this._title.replaceAll(/ ______/g, '<filter></filter>')\n this.dispatchEvent(new CustomEvent('update:modelValue', {\n bubbles: true,\n composed: true,\n detail: modelValue,\n }))\n }\n }\n\n private _handleAddTag(item: BlankAnswer) {\n item.showInput = false\n if (item.tag) {\n item.title = item.title ? [item.title, item.tag].join(',') : item.tag\n item.tag = ''\n }\n this.requestUpdate()\n }\n\n private _closeTag(tag: string, item: BlankAnswer) {\n if (!tag) { return }\n const tags = item.title.split(',')\n const idx = tags.findIndex((t: string) => t === tag)\n if (idx > -1) {\n tags.splice(idx, 1)\n item.title = tags.join(',')\n }\n this.requestUpdate()\n }\n\n private _onCategoryChange(value: string) {\n this._categoryId = value\n this._emit('category-change', {\n value,\n customId: this['custom-id'] || '',\n examId: this['exam-id'] || 0,\n })\n }\n\n private _imageResources() {\n return (this['resource-list'] || [])\n .filter(item => item.resourceType === 1)\n .map(item => item.resource.middle || item.resource.url)\n .filter(Boolean) as string[]\n }\n\n private _videoResource() {\n return (this['resource-list'] || []).find(item => item.resourceType === 2)?.resource || null\n }\n\n private _categoryLabel() {\n const matched = this['category-list'].find((item: any) => String(item.categoryId) === String(this._categoryId))\n return matched?.title || matched?.categoryName || this._categoryId || '未选择分类'\n }\n\n async toJSON(): Promise<any> {\n return new Promise((resolve, reject) => {\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this['is-edit']\n ? this._answers\n : (this['answer-list'] || []).map((answer: any) => ({\n ...answer,\n title: this._normalizeAnswerTitle(answer),\n answerId: answer?.answerId ?? answer?.examAnswerId,\n }))\n const analysis = this['is-edit'] ? this._analysis : this.analysis || ''\n const isInOrder = this['is-edit'] ? this._isInOrder : this['exam-answer-setting']?.isInOrder ?? false\n const isIgnoreCase = this['is-edit'] ? this._isIgnoreCase : this['exam-answer-setting']?.isIgnoreCase ?? true\n const showRichText = this['is-edit'] ? this._showRichText : !!this['rich-text-content']\n const richText = this['is-edit'] ? this._richText : this['rich-text-content'] || ''\n const filledAnswers = answers.filter((answer: any) => this._normalizeAnswerTitle(answer))\n\n if (!title) {\n reject(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n return\n }\n if (answers.length < 1) {\n reject(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n return\n }\n\n const result: any = {\n answerType: SubjectType.BLANK_FILL,\n examTypeEnum: SubjectType.BLANK_FILL,\n title: title.replaceAll(/ ______/g, '<filter></filter>'),\n answers: filledAnswers.map((answer: any, index: number) => {\n const title = this._normalizeAnswerTitle(answer)\n const next: any = {\n title,\n answer: title,\n isCorrect: true,\n orderIndex: index + 1,\n }\n if (answer.answerId) {\n next.answerId = answer.answerId\n next.examAnswerId = answer.answerId\n }\n return next\n }),\n analysis,\n isSetCorrectAnswer: filledAnswers.length > 0,\n isKey: this['is-key'],\n examAnswerSettingBO: { isIgnoreCase, isInOrder },\n examAnswerSettingVO: { isIgnoreCase, isInOrder },\n examRichTextContent: showRichText ? richText : '',\n }\n if (this['custom-id']) { result.customId = this['custom-id'] }\n resolve(result)\n })\n }\n\n private async _save(e?: Event) {\n e?.stopImmediatePropagation()\n try {\n const data = await this.toJSON()\n this._emit('save', data)\n }\n catch (err: any) {\n showToast(err.message)\n }\n }\n\n validate(): SubjectError[] {\n const errors: SubjectError[] = []\n const row = { customId: this['custom-id'] || undefined, answerType: 'blank_fill', orderIndex: this['order-index'] }\n\n const title = this['is-edit'] ? this._title : this.title?.replaceAll(/<filter><\\/filter>/g, ' ______') || ''\n const answers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n\n if (!title) {\n errors.push(new SubjectError('题目标题不能为空!', 'EMPTY_TITLE', 'title', row))\n }\n if (answers.length < 1) {\n errors.push(new SubjectError('至少添加一个填空符!', 'NO_BLANK', 'answers', row))\n }\n\n return errors\n }\n\n private _renderPreview() {\n const displayTitle = this.title.replaceAll(/<filter><\\/filter>/g, ' ______')\n const previewAnswers = this['is-edit'] ? this._answers : (this['answer-list'] || []).map((answer: any) => ({ ...answer, title: this._normalizeAnswerTitle(answer) }))\n return html`\n <div class=\"preview\">\n <span class=\"title\">${this['order-index'] + 1}.${displayTitle}(填空题)</span>\n ${this['rich-text-content'] ? html`<div class=\"rich-text\" .innerHTML=${this['rich-text-content']}></div>` : ''}\n ${previewAnswers.some(a => a.title)\n ? html`\n <div class=\"content flex flex-wrap\">\n <span>正确答案:</span>\n ${previewAnswers.map((a, i) => a.title\n ? html`<span style=\"margin-right:10px\">填空${i + 1}: ${a.title}</span>`\n : '')}\n </div>\n `\n : ''}\n ${this.analysis ? html`<div style=\"color:#909399;font-size:12px;margin-top:8px\">解析: ${this.analysis}</div>` : ''}\n ${this['show-category'] && this._categoryId\n ? html`<div class=\"section-row\"><span class=\"value-text\">分类:${this._categoryLabel()}</span></div>`\n : ''}\n ${this._renderResourceSection()}\n </div>\n `\n }\n\n private _renderCategorySection() {\n if (!this['show-category']) { return '' }\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>分类:</span></div>\n <div style=\"flex:1\">\n ${this['is-edit']\n ? html`\n <select class=\"el-select\" .value=${String(this._categoryId)}\n @change=${(e: Event) => this._onCategoryChange((e.target as HTMLSelectElement).value)}>\n <option value=\"\">选择分类</option>\n ${this['category-list'].map((item: any) => html`\n <option value=${String(item.categoryId)} ?selected=${String(item.categoryId) === String(this._categoryId)}>${item.title || item.categoryName}</option>\n `)}\n </select>\n `\n : html`<span class=\"value-text\">${this._categoryLabel()}</span>`}\n </div>\n </div>\n `\n }\n\n private _renderResourceSection() {\n if (!this['show-resource']) { return '' }\n const images = this._imageResources()\n const video = this._videoResource()\n return html`\n <div class=\"flex flex-items-start section-row\">\n <div class=\"label\"><span>资源:</span></div>\n <div style=\"flex:1\">\n <div class=\"resource-summary\">图片 ${images.length} 张${video?.url ? ',含视频资源' : ''}</div>\n ${images.length\n ? html`\n <div class=\"resource-thumbs\">\n ${images.slice(0, 4).map(src => html`<img class=\"resource-thumb\" src=${src} alt=\"resource\" />`)}\n </div>\n `\n : ''}\n ${video?.url ? html`<div style=\"margin-top:8px\"><a class=\"el-link\" href=${video.url} target=\"_blank\" rel=\"noreferrer\">查看视频</a></div>` : ''}\n ${!images.length && !video?.url ? html`<div class=\"tag-hint\">暂无资源</div>` : ''}\n </div>\n </div>\n `\n }\n\n private _renderEdit() {\n return html`\n <div class=\"flex flex-items-start\">\n <div class=\"label\"><span>题目:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"3\" .value=${this._title}\n maxlength=${this.TITLE_MAX}\n @input=${(e: Event) => this._onTitleInput(e)}\n placeholder=\"【填空题】请输入问题\"></textarea>\n <span class=\"char-counter\">${this._title.length}/${this.TITLE_MAX}</span>\n </div>\n </div>\n </div>\n\n <div class=\"flex flex-justify-end\">\n <span class=\"el-link\" @click=${() => this._addBlank()}>插入填空符</span>\n </div>\n\n <div class=\"flex flex-items-center\" style=\"margin-top:12px\">\n <div class=\"label\"><span>答题设置:</span></div>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isInOrder}\n @change=${(e: Event) => { this._isInOrder = (e.target as HTMLInputElement).checked }} />\n 答案不分顺序\n </label>\n <label class=\"el-checkbox\">\n <input type=\"checkbox\" .checked=${this._isIgnoreCase}\n @change=${(e: Event) => { this._isIgnoreCase = (e.target as HTMLInputElement).checked }} />\n 忽略大小写\n </label>\n </div>\n\n <slot name=\"business-tag\"></slot>\n\n ${this._renderCategorySection()}\n\n ${this._renderResourceSection()}\n\n ${this._answers.map((a, i) => html`\n <div class=\"answer-item\" style=\"margin-top:12px\">\n <div class=\"label\"><span>第${i + 1}空答案:</span></div>\n <div class=\"answer-tags\">\n ${a.title.split(',').filter(Boolean).map(tag => html`\n <span class=\"el-tag\">\n ${tag}\n <span class=\"el-tag__close\" @click=${() => this._closeTag(tag, a)}>×</span>\n </span>\n `)}\n ${html`\n ${a.showInput\n ? html`\n <input type=\"text\" class=\"el-input--small\"\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') { this._handleAddTag(a) }\n }}\n @input=${(e: Event) => { a.tag = (e.target as HTMLInputElement).value }}\n @blur=${() => this._handleAddTag(a)} />\n `\n : html`\n <span class=\"el-button--small\" @click=${() => { a.showInput = true; this.requestUpdate(); this.updateComplete.then(() => { (this.shadowRoot?.querySelector('.el-input--small') as HTMLInputElement)?.focus() }) }}>\n ${iconPlus}\n <span>${a.title ? '添加同义词' : '添加答案'}</span>\n </span>\n `}\n `}\n </div>\n </div>\n `)}\n\n ${this._showRichText\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>富文本:</span></div>\n <div style=\"flex:1\">\n <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`\n <div class=\"flex flex-justify-end\" style=\"margin-top:8px\">\n <span class=\"el-link\" style=\"color:#f56c6c\" @click=${() => { this._showRichText = false; this._richText = '' }}>删除富文本</span>\n </div>\n `\n : ''}\n </div>\n </div>\n `\n : ''}\n\n ${this['show-analysis']\n ? html`\n <div class=\"flex flex-items-start\" style=\"margin-top:12px\">\n <div class=\"label\"><span>解析:</span></div>\n <div style=\"flex:1\">\n <div class=\"el-input\">\n <textarea rows=\"2\" .value=${this._analysis}\n @input=${(e: Event) => { this._analysis = (e.target as HTMLTextAreaElement).value }}\n placeholder=\"请输入题目解析\"></textarea>\n </div>\n </div>\n </div>\n `\n : ''}\n `\n }\n\n render() {\n 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":["iconPlus","html","QxsBlankFill","LitElement","constructor","super","arguments","this","title","analysis","isInOrder","isIgnoreCase","async","Promise","resolve","reject","reader","FileReader","onload","e","target","result","onerror","readAsDataURL","file","_title","_analysis","_answers","tag","showInput","_isInOrder","_isIgnoreCase","_showRichText","_richText","_selectedTagList","_categoryId","TITLE_MAX","willUpdate","changed","has","_syncProps","replaceAll","Array","isArray","map","item","String","_normalizeAnswerTitle","answer","length","a","answerId","examAnswerId","blankCount","match","from","_emit","name","detail","dispatchEvent","CustomEvent","bubbles","composed","_addBlank","requestUpdate","_emitModelUpdate","_onTitleInput","el","value","slice","i","modelValue","_handleAddTag","join","_closeTag","tags","split","idx","findIndex","t","splice","_onCategoryChange","customId","examId","_imageResources","filter","resourceType","resource","middle","url","Boolean","_videoResource","find","_categoryLabel","matched","categoryId","categoryName","toJSON","row","answerType","orderIndex","answers","showRichText","richText","filledAnswers","SubjectError","SubjectType","BLANK_FILL","examTypeEnum","index","next","isCorrect","isSetCorrectAnswer","isKey","examAnswerSettingBO","examAnswerSettingVO","examRichTextContent","_save","stopImmediatePropagation","data","err","msg","document","createElement","textContent","Object","assign","style","position","top","left","transform","padding","borderRadius","fontSize","color","background","zIndex","boxShadow","transition","opacity","body","appendChild","setTimeout","remove","showToast","message","validate","errors","push","_renderPreview","displayTitle","previewAnswers","some","_renderResourceSection","_renderCategorySection","images","video","src","_renderEdit","checked","key","updateComplete","then","shadowRoot","querySelector","focus","render","content","styles","css","__decorateClass","property","type","Number","attribute","prototype","state","safeCustomElement"],"mappings":"ybAaA,MAAMA,EAAWC,CAAA;;;;UAoBV,IAAMC,EAAN,cAA2BC,EAA3BC,WAAAA,GAAAC,SAAAC,WAwGiDC,KAAA,eAAgB,EAC1CA,KAAAC,MAAQ,GACgBD,KAAA,aAAc,GACfA,KAAA,YAAY,EACZA,KAAA,YAAY,EACbA,KAAA,WAAW,EACXA,KAAA,WAAW,EACNA,KAAA,gBAAgB,EACnBA,KAAA,aAAa,EACFA,KAAA,wBAAwB,EAC9BA,KAAA,kBAAkB,EACfA,KAAA,qBAAsB,GACtDA,KAAAE,SAAW,GAC6BF,KAAA,6BAA8B,EAC5CA,KAAA,eAAgB,GACpBA,KAAA,WAAY,EACRA,KAAA,eAAgB,GAEtEA,KAAA,uBAAuE,CAAEG,WAAW,EAAOC,cAAc,GAGzGJ,KAAA,gBAAkDK,SACzC,IAAIC,QAAQ,CAACC,EAASC,KAC3B,MAAMC,EAAS,IAAIC,WACnBD,EAAOE,OAASC,GAAKL,EAAQK,EAAEC,QAAQC,QACvCL,EAAOM,QAAUP,EACjBC,EAAOO,cAAcC,KAI4BjB,KAAA,eAAuB,GAC1BA,KAAA,YAAwB,GACnBA,KAAA,iBAA8B,GAC9BA,KAAA,iBAA8B,GACjCA,KAAA,aAAa,EACRA,KAAA,kBAAkB,EAClBA,KAAA,kBAAkB,EAErBA,KAAA,eAAgB,GACjBA,KAAA,cAAc,EAE1DA,KAAQkB,OAAS,GACjBlB,KAAQmB,UAAY,GACpBnB,KAAQoB,SAA0B,CAAC,CAAEnB,MAAO,GAAIoB,IAAK,GAAIC,WAAW,IACpEtB,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