@qxs-bns/components-wc 0.0.30 → 0.0.32
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 +166 -357
- package/es/editor/blocksuite-editor.mjs.map +1 -1
- package/es/editor/toolbar.mjs +2 -0
- package/es/editor/toolbar.mjs.map +1 -0
- package/es/subject/action.mjs +7 -8
- package/es/subject/action.mjs.map +1 -1
- package/es/subject/blank-fill.mjs +243 -132
- package/es/subject/blank-fill.mjs.map +1 -1
- package/es/subject/layout.mjs +5 -5
- package/es/subject/layout.mjs.map +1 -1
- package/es/subject/page-end.mjs +1 -1
- package/es/subject/page-end.mjs.map +1 -1
- package/es/subject/scale.mjs +165 -126
- package/es/subject/scale.mjs.map +1 -1
- package/es/subject/shared-methods.mjs +2 -0
- package/es/subject/shared-methods.mjs.map +1 -0
- package/es/subject/shared-styles.mjs +75 -0
- package/es/subject/shared-styles.mjs.map +1 -0
- package/es/subject/single.mjs +243 -187
- package/es/subject/single.mjs.map +1 -1
- package/es/subject/sortable.mjs +7 -7
- package/es/subject/sortable.mjs.map +1 -1
- package/es/subject/text-fill.mjs +273 -138
- package/es/subject/text-fill.mjs.map +1 -1
- package/lib/editor/blocksuite-editor.cjs +166 -357
- package/lib/editor/blocksuite-editor.cjs.map +1 -1
- package/lib/editor/toolbar.cjs +2 -0
- package/lib/editor/toolbar.cjs.map +1 -0
- package/lib/subject/action.cjs +33 -34
- package/lib/subject/action.cjs.map +1 -1
- package/lib/subject/blank-fill.cjs +247 -136
- package/lib/subject/blank-fill.cjs.map +1 -1
- package/lib/subject/layout.cjs +3 -3
- package/lib/subject/layout.cjs.map +1 -1
- package/lib/subject/page-end.cjs +2 -2
- package/lib/subject/page-end.cjs.map +1 -1
- package/lib/subject/scale.cjs +165 -126
- package/lib/subject/scale.cjs.map +1 -1
- package/lib/subject/shared-methods.cjs +2 -0
- package/lib/subject/shared-methods.cjs.map +1 -0
- package/lib/subject/shared-styles.cjs +75 -0
- package/lib/subject/shared-styles.cjs.map +1 -0
- package/lib/subject/single.cjs +243 -187
- package/lib/subject/single.cjs.map +1 -1
- package/lib/subject/sortable.cjs +1 -1
- package/lib/subject/sortable.cjs.map +1 -1
- package/lib/subject/text-fill.cjs +273 -138
- package/lib/subject/text-fill.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("
|
|
1
|
+
"use strict";var t=require("lit"),e=require("lit/decorators.js"),s=require("../base/define.cjs"),i=require("../editor/toolbar.cjs"),r=require("./shared-methods.cjs"),o=require("./shared-styles.cjs"),a=require("./single.cjs"),n=require("./sorting-card.cjs"),l=require("./types.cjs"),p=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?d(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&&p(e,s,o),o};const c=[{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"}];exports.QxsTextFill=class extends t.LitElement{constructor(){super(...arguments),this._iconPlus=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>`,this._iconRemove=t.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"/></svg>`,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["hide-add-rich-text"]=!1,this["show-rich-text"]=!1,this["show-delete-action"]=!0,this["show-save-action"]=!0,this.sorting=!1,this["show-answer-setting"]=!1,this["show-analysis"]=!1,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.trimCommaSeparatedText(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))}_previewKeywordItems(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this._filledAnswers(t).flatMap(t=>this._normalizeAnswerTitle(t).split(",").map(t=>t.trim()).filter(Boolean))}_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){r.emitSubjectEvent(this,t,e)}_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"]&&r.emitSubjectModelValue(this,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 r.getSubjectImageResources(this["resource-list"]||[])}_videoResource(){return r.getSubjectVideoResource(this["resource-list"]||[])}_categoryLabel(){return r.resolveSubjectCategoryLabel(this["category-list"],this._categoryId)}_validateState(t){const{row:e,title:s,answers:i,correct:r,keywordCount:o}=t;if(!s)return new a.SubjectError("题目标题不能为空!","EMPTY_TITLE","title",e);const n=this._filledAnswers(i);return!!r||null!==o||n.length>0?r?!o||o<1?new a.SubjectError("请完善答题设置!","NO_KEYWORD_COUNT","keywordCount",e):n.length?o>n.length?new a.SubjectError("关键词个数设置有误!","KEYWORD_COUNT_MISMATCH","answers",e):null:new a.SubjectError("请设置关键词","NO_KEYWORDS","answers",e):new a.SubjectError("请输入问题正确答案!","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=a.trimText(this["is-edit"]?this._title:this.title||""),r=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),o=a.trimText(this["is-edit"]?this._analysis:this.analysis||""),n=a.trimText(this["is-edit"]?this._correct:this["exam-expand"]||""),p=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,c=this["is-edit"]?this._showRichText:!!this["rich-text-content"],x=this["is-edit"]?this._richText:this["rich-text-content"]||"",w=this._validateState({row:s,title:i,answers:r,correct:n,keywordCount:p});if(w)return void e(w);const u={answerType:l.SubjectType.TEXT_FILL,examTypeEnum:l.SubjectType.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:!!n,isKey:this["is-key"],examExpand:n,examAnswerSettingBO:{isIgnoreCase:h,isInOrder:d,...null!==p?{keywordCount:p}:{}},examAnswerSettingVO:{isIgnoreCase:h,isInOrder:d,...null!==p?{keywordCount:p}:{}},examRichTextContent:c?x:""};this["custom-id"]&&(u.customId=this["custom-id"]),t(u)})}async _save(t){t?.stopImmediatePropagation();try{const t=await this.toJSON();this._emit("save",t)}catch(t){r.showSubjectToast(t.message)}}validate(){const t={customId:this["custom-id"]||void 0,answerType:"text_fill",orderIndex:this["order-index"]},e=a.trimText(this["is-edit"]?this._title:this.title||""),s=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),i=a.trimText(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 e=this["is-edit"]?this._answers:this._normalizedAnswerList(this["answer-list"]||[]),s=this["is-edit"]?this._correct:this["exam-expand"]||"",i=r.buildSubjectPreviewTitle(this["subject-prefix"],this["order-index"],this.title),o=this._previewKeywordItems(e);return t.html`
|
|
2
2
|
<div class="preview">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<div class="preview-header">
|
|
4
|
+
<div class="preview-title-row">
|
|
5
|
+
<span class="title">${i}</span>
|
|
6
|
+
<span class="preview-type">问答题</span>
|
|
7
|
+
</div>
|
|
8
|
+
${this["show-rich-text"]&&this["rich-text-content"]?t.html`<div class="rich-text" .innerHTML=${this["rich-text-content"]}></div>`:""}
|
|
9
|
+
</div>
|
|
10
|
+
${o.length?t.html`
|
|
11
|
+
<div class="preview-keyword-list">
|
|
12
|
+
${o.map(e=>t.html`
|
|
13
|
+
<span class="preview-answer-key">${e}</span>
|
|
14
|
+
`)}
|
|
8
15
|
</div>
|
|
9
16
|
`:""}
|
|
10
|
-
${s?t.html`<div
|
|
11
|
-
${this.analysis?t.html`<div
|
|
17
|
+
${s?t.html`<div class="preview-answer-body">${s}</div>`:""}
|
|
18
|
+
${this.analysis?t.html`<div class="preview-analysis">${this.analysis}</div>`:""}
|
|
12
19
|
${this["show-category"]&&this._categoryId?t.html`<div class="section-row"><span class="value-text">分类:${this._categoryLabel()}</span></div>`:""}
|
|
13
20
|
${this._renderResourceSection()}
|
|
14
21
|
</div>
|
|
15
|
-
`}_renderSorting(){const t=
|
|
22
|
+
`}_renderSorting(){const t=a.trimText(this["is-edit"]?this._title:this.title||"")||"未命名题目",e=r.buildSubjectSortingTitle(this["subject-prefix"],this["order-index"],t);return n.renderSortingCard(e,l.SubjectTypeLabel[l.SubjectType.TEXT_FILL]||l.SubjectType.TEXT_FILL)}_renderCategorySection(){return this["show-category"]?t.html`
|
|
16
23
|
<div class="flex-items-start section-row">
|
|
17
24
|
<div class="label"><span>分类:</span></div>
|
|
18
25
|
<div style="flex:1">
|
|
@@ -42,123 +49,133 @@
|
|
|
42
49
|
</div>
|
|
43
50
|
</div>
|
|
44
51
|
`}_renderEdit(){return t.html`
|
|
45
|
-
<div class="
|
|
46
|
-
<div class="
|
|
47
|
-
|
|
48
|
-
<div class="
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
<div class="edit-form">
|
|
53
|
+
<div class="edit-row">
|
|
54
|
+
<div class="label"><span>题目:</span></div>
|
|
55
|
+
<div class="row-body">
|
|
56
|
+
<div class="el-input">
|
|
57
|
+
<textarea rows="2" .value=${this._title}
|
|
58
|
+
maxlength=${this.TITLE_MAX}
|
|
59
|
+
@input=${t=>this._onTitleInput(t)}
|
|
60
|
+
placeholder="【问答题】请输入问题"></textarea>
|
|
61
|
+
<span class="char-counter">${this._title.length}/${this.TITLE_MAX}</span>
|
|
62
|
+
</div>
|
|
54
63
|
</div>
|
|
55
64
|
</div>
|
|
56
|
-
</div>
|
|
57
65
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
<div class="edit-row section-row">
|
|
67
|
+
<div class="label"><span>答题设置:</span></div>
|
|
68
|
+
<div class="row-body edit-inline">
|
|
69
|
+
<span class="setting-copy">共答对</span>
|
|
70
|
+
<input
|
|
71
|
+
type="number"
|
|
72
|
+
class="setting-number"
|
|
73
|
+
.value=${null===this._keywordCount?"":String(this._keywordCount)}
|
|
74
|
+
min="1"
|
|
75
|
+
@change=${t=>{const e=t.target.value;this._keywordCount=""===e?null:Number(e)}} />
|
|
76
|
+
<span class="setting-copy">个关键词,算是正确的</span>
|
|
77
|
+
<label class="setting-toggle">
|
|
78
|
+
<input type="checkbox" .checked=${this._isInOrder}
|
|
79
|
+
@change=${t=>{this._isInOrder=t.target.checked}} />
|
|
80
|
+
答案不分顺序
|
|
81
|
+
</label>
|
|
82
|
+
<label class="setting-toggle">
|
|
83
|
+
<input type="checkbox" .checked=${this._isIgnoreCase}
|
|
84
|
+
@change=${t=>{this._isIgnoreCase=t.target.checked}} />
|
|
85
|
+
忽略大小写
|
|
86
|
+
</label>
|
|
87
|
+
</div>
|
|
79
88
|
</div>
|
|
80
|
-
</div>
|
|
81
89
|
|
|
82
|
-
|
|
90
|
+
<slot name="business-tag"></slot>
|
|
83
91
|
|
|
84
|
-
|
|
92
|
+
${this._renderCategorySection()}
|
|
85
93
|
|
|
86
|
-
|
|
94
|
+
${this._renderResourceSection()}
|
|
87
95
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
<div class="edit-row section-row">
|
|
97
|
+
<div class="label"><span>答案:</span></div>
|
|
98
|
+
<div class="row-body">
|
|
99
|
+
<div class="el-input">
|
|
100
|
+
<textarea rows="2" .value=${this._correct}
|
|
101
|
+
maxlength="200"
|
|
102
|
+
@input=${t=>{this._correct=t.target.value}}
|
|
103
|
+
placeholder="请输入正确答案"></textarea>
|
|
104
|
+
<span class="char-counter">${this._correct.length}/200</span>
|
|
105
|
+
</div>
|
|
97
106
|
</div>
|
|
98
107
|
</div>
|
|
99
|
-
</div>
|
|
100
108
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
109
|
+
<div class="edit-row section-row keyword-section-row">
|
|
110
|
+
<div class="label"><span>关键词:</span></div>
|
|
111
|
+
<div class="row-body">
|
|
112
|
+
<div class="keyword-section">
|
|
113
|
+
<div class="edit-note">如遇特殊字符关键词,请补充同义词,例如 “CO₂” 同时补充 “CO2”。</div>
|
|
114
|
+
<div class="answer-list">
|
|
115
|
+
${this._answers.map((e,s)=>t.html`
|
|
116
|
+
<div class="answer-item">
|
|
117
|
+
<span class="answer-item-label">关键词${s+1}:</span>
|
|
118
|
+
<div class="answer-tags">
|
|
119
|
+
${e.title.split(",").filter(Boolean).map(e=>{const i=c[s%c.length];return t.html`
|
|
120
|
+
<span style="display:inline-flex;align-items:center;background:${i.bg};color:${i.color};border:1px solid ${i.border};border-radius:6px;padding:2px 8px;font-size:12px;line-height:16px">
|
|
121
|
+
${e}
|
|
122
|
+
<span style="cursor:pointer;margin-left:4px;color:#909399" @click=${()=>this._closeTag(e,s)}>×</span>
|
|
123
|
+
</span>
|
|
124
|
+
`})}
|
|
125
|
+
${t.html`
|
|
126
|
+
${e.showInput?t.html`
|
|
127
|
+
<input type="text" class="keyword-input"
|
|
128
|
+
@keydown=${t=>{"Enter"===t.key&&this._addTag(s)}}
|
|
129
|
+
@input=${t=>{e.tag=t.target.value}}
|
|
130
|
+
@blur=${()=>this._addTag(s)} />
|
|
131
|
+
<button class="el-link" @click=${()=>this._addTag(s)}>确认</button>
|
|
132
|
+
`:t.html`
|
|
133
|
+
<button class="link" @click=${()=>{this._answers=this._answers.map((t,e)=>e===s?{...t,showInput:!0}:t),this.updateComplete.then(()=>{this.shadowRoot?.querySelector(".keyword-input")?.focus()})}}>
|
|
134
|
+
${e.title?"添加同义词":"添加关键词"}
|
|
135
|
+
</button>
|
|
136
|
+
`}
|
|
137
|
+
`}
|
|
138
|
+
</div>
|
|
139
|
+
<span class="icon" @click=${()=>this._addAnswer()}>${this._iconPlus}</span>
|
|
140
|
+
<span class="icon ${this._answers.length<2?"disabled":""}" @click=${()=>this._deleteAnswer(s)}>${this._iconRemove}</span>
|
|
141
|
+
</div>
|
|
142
|
+
`)}
|
|
143
|
+
</div>
|
|
126
144
|
</div>
|
|
127
|
-
<span class="icon" @click=${()=>this._addAnswer()}>${this._iconPlus}</span>
|
|
128
|
-
<span class="icon ${this._answers.length<2?"disabled":""}" @click=${()=>this._deleteAnswer(s)}>${this._iconRemove}</span>
|
|
129
145
|
</div>
|
|
130
|
-
|
|
131
|
-
</div>
|
|
146
|
+
</div>
|
|
132
147
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
${this["show-rich-text"]&&this._showRichText?t.html`
|
|
149
|
+
<div class="edit-row section-row">
|
|
150
|
+
<div class="label"><span>副文本:</span></div>
|
|
151
|
+
<div class="row-body">
|
|
152
|
+
<slot name="sub-text">
|
|
153
|
+
<qxs-blocksuite-editor
|
|
154
|
+
.content=${this._richText}
|
|
155
|
+
.toolbar=${i.SUB_TEXT_EDITOR_TOOLBAR}
|
|
156
|
+
.upload-image=${this["upload-image"]}
|
|
157
|
+
?is-edit=${!0}
|
|
158
|
+
@input=${t=>{this._richText=t.target.getContent()}}
|
|
159
|
+
></qxs-blocksuite-editor>
|
|
160
|
+
</slot>
|
|
161
|
+
${this["show-action"]?"":t.html`<div class="flex-justify-end" style="margin-top:8px"><span class="el-link danger" @click=${()=>{this._showRichText=!1,this._richText=""}}>删除富文本</span></div>`}
|
|
162
|
+
</div>
|
|
146
163
|
</div>
|
|
147
|
-
|
|
148
|
-
`:""}
|
|
164
|
+
`:""}
|
|
149
165
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
166
|
+
${this["show-analysis"]?t.html`
|
|
167
|
+
<div class="edit-row section-row">
|
|
168
|
+
<div class="label"><span>解析:</span></div>
|
|
169
|
+
<div class="row-body">
|
|
170
|
+
<div class="el-input">
|
|
171
|
+
<textarea rows="2" .value=${this._analysis}
|
|
172
|
+
@input=${t=>{this._analysis=t.target.value}}
|
|
173
|
+
placeholder="请输入题目解析"></textarea>
|
|
174
|
+
</div>
|
|
158
175
|
</div>
|
|
159
176
|
</div>
|
|
160
|
-
|
|
161
|
-
|
|
177
|
+
`:""}
|
|
178
|
+
</div>
|
|
162
179
|
`}render(){if(this.sorting)return this._renderSorting();const e=this["is-edit"]?t.html`<div slot="edit">${this._renderEdit()}</div>`:t.html`<div slot="preview">${this._renderPreview()}</div>`;return t.html`
|
|
163
180
|
<qxs-subject-layout .show-edit=${this["is-edit"]}>
|
|
164
181
|
${e}
|
|
@@ -182,41 +199,114 @@
|
|
|
182
199
|
`:""}
|
|
183
200
|
<slot name="action"></slot>
|
|
184
201
|
</qxs-subject-layout>
|
|
185
|
-
`}},exports.QxsTextFill.styles=[
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
.preview
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
202
|
+
`}},exports.QxsTextFill.styles=[n.sortingCardStyles,o.subjectHostStyles,o.subjectControlResetStyles,o.subjectPreviewBaseStyles,o.subjectFormBaseStyles,o.subjectTextareaStyles,t.css`
|
|
203
|
+
.preview-keyword-list {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-wrap: wrap;
|
|
206
|
+
gap: 8px;
|
|
207
|
+
margin-top: 16px;
|
|
208
|
+
}
|
|
209
|
+
.preview-answer-key {
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
padding: 2px 10px;
|
|
213
|
+
border-radius: 999px;
|
|
214
|
+
background: #f3f6fb;
|
|
215
|
+
font-size: 12px;
|
|
216
|
+
line-height: 1.6;
|
|
217
|
+
font-weight: 500;
|
|
218
|
+
color: #6b7280;
|
|
219
|
+
}
|
|
220
|
+
.preview-answer-body {
|
|
221
|
+
position: relative;
|
|
222
|
+
margin-top: 16px;
|
|
223
|
+
padding-left: 16px;
|
|
224
|
+
font-size: 14px;
|
|
225
|
+
line-height: 1.85;
|
|
226
|
+
font-weight: 600;
|
|
227
|
+
color: #3c4758;
|
|
228
|
+
white-space: pre-wrap;
|
|
229
|
+
}
|
|
230
|
+
.preview-answer-body::before {
|
|
231
|
+
content: '';
|
|
232
|
+
position: absolute;
|
|
233
|
+
left: 0;
|
|
234
|
+
top: 0.72em;
|
|
235
|
+
width: 6px;
|
|
236
|
+
height: 6px;
|
|
237
|
+
border-radius: 999px;
|
|
238
|
+
background: #c9d5ff;
|
|
239
|
+
}
|
|
240
|
+
.preview-analysis {
|
|
241
|
+
margin-top: 20px;
|
|
242
|
+
padding-left: 10px;
|
|
243
|
+
border-left: 2px solid #e5eaf3;
|
|
244
|
+
font-size: 13px;
|
|
245
|
+
line-height: 1.8;
|
|
246
|
+
color: #6b7280;
|
|
247
|
+
}
|
|
196
248
|
|
|
197
249
|
.flex { display: flex; }
|
|
198
250
|
.flex-items-center { display: flex; align-items: center; }
|
|
199
251
|
.flex-items-start { display: flex; align-items: flex-start; }
|
|
200
252
|
.flex-justify-end { display: flex; justify-content: flex-end; }
|
|
201
|
-
.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
253
|
+
.edit-inline {
|
|
254
|
+
display: flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
flex-wrap: wrap;
|
|
257
|
+
gap: 8px 14px;
|
|
258
|
+
min-height: 32px;
|
|
259
|
+
}
|
|
260
|
+
.setting-copy {
|
|
261
|
+
font-size: 13px;
|
|
262
|
+
color: #606266;
|
|
263
|
+
}
|
|
264
|
+
.setting-number {
|
|
265
|
+
width: 68px;
|
|
266
|
+
height: 32px;
|
|
267
|
+
border: 1px solid #dcdfe6;
|
|
268
|
+
border-radius: 6px;
|
|
269
|
+
padding: 0 10px;
|
|
270
|
+
font-size: 13px;
|
|
271
|
+
line-height: 32px;
|
|
272
|
+
font-family: inherit;
|
|
273
|
+
}
|
|
274
|
+
.setting-number:focus {
|
|
275
|
+
border-color: #3D61E3;
|
|
276
|
+
outline: none;
|
|
277
|
+
}
|
|
278
|
+
.setting-toggle {
|
|
279
|
+
display: inline-flex;
|
|
280
|
+
align-items: center;
|
|
281
|
+
gap: 4px;
|
|
282
|
+
cursor: pointer;
|
|
283
|
+
font-size: 12px;
|
|
284
|
+
color: #606266;
|
|
285
|
+
user-select: none;
|
|
207
286
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
position: absolute; right: 12px; bottom: 8px;
|
|
214
|
-
font-size: 12px; color: #909399; line-height: 1; pointer-events: none;
|
|
287
|
+
.edit-note {
|
|
288
|
+
margin-bottom: 8px;
|
|
289
|
+
font-size: 12px;
|
|
290
|
+
line-height: 1.6;
|
|
291
|
+
color: #909399;
|
|
215
292
|
}
|
|
216
293
|
|
|
217
|
-
.answer-list {
|
|
218
|
-
.answer-item {
|
|
219
|
-
|
|
294
|
+
.answer-list { display: flex; flex-direction: column; gap: 10px; }
|
|
295
|
+
.answer-item {
|
|
296
|
+
display: grid;
|
|
297
|
+
grid-template-columns: 76px minmax(0, 1fr) auto auto;
|
|
298
|
+
gap: 8px;
|
|
299
|
+
align-items: center;
|
|
300
|
+
border-radius: 4px;
|
|
301
|
+
}
|
|
302
|
+
.answer-item-label {
|
|
303
|
+
min-width: 0;
|
|
304
|
+
font-size: 13px;
|
|
305
|
+
line-height: 1.5;
|
|
306
|
+
font-weight: 600;
|
|
307
|
+
color: #6b7280;
|
|
308
|
+
letter-spacing: 0;
|
|
309
|
+
}
|
|
220
310
|
.answer-item .icon {
|
|
221
311
|
margin-left: 6px; cursor: pointer; display: inline-flex;
|
|
222
312
|
align-items: center; justify-content: center;
|
|
@@ -233,7 +323,6 @@
|
|
|
233
323
|
.el-link:hover { color: #2D4CB8; }
|
|
234
324
|
.el-link.danger { color: #f56c6c; }
|
|
235
325
|
|
|
236
|
-
.section-row { margin-top: 12px; }
|
|
237
326
|
.value-text { font-size: 13px; color: #606266; white-space: pre-wrap; }
|
|
238
327
|
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 32px; }
|
|
239
328
|
.tag-item {
|
|
@@ -245,7 +334,7 @@
|
|
|
245
334
|
.tag-item .close:hover { color: #f56c6c; }
|
|
246
335
|
.tag-hint { font-size: 12px; color: #909399; }
|
|
247
336
|
.el-select {
|
|
248
|
-
width: 150px; height:
|
|
337
|
+
width: 150px; height: 34px; border: 1px solid #dcdfe6; border-radius: 6px;
|
|
249
338
|
padding: 0 8px; font-size: 13px; background: #fff; appearance: none;
|
|
250
339
|
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");
|
|
251
340
|
background-repeat: no-repeat; background-position: right 8px center;
|
|
@@ -256,5 +345,51 @@
|
|
|
256
345
|
width: 72px; height: 72px; object-fit: cover; border-radius: 6px;
|
|
257
346
|
border: 1px solid #e4e7ed; background: #f5f7fa;
|
|
258
347
|
}
|
|
259
|
-
|
|
348
|
+
.answer-tags {
|
|
349
|
+
display: flex;
|
|
350
|
+
flex-wrap: wrap;
|
|
351
|
+
gap: 6px;
|
|
352
|
+
align-items: center;
|
|
353
|
+
flex: 1;
|
|
354
|
+
max-width: 420px;
|
|
355
|
+
min-height: 28px;
|
|
356
|
+
}
|
|
357
|
+
.keyword-section { display: flex; flex-direction: column; gap: 10px; }
|
|
358
|
+
.keyword-section-row > .label { padding-top: 0; }
|
|
359
|
+
.keyword-input {
|
|
360
|
+
width: 88px;
|
|
361
|
+
height: 28px;
|
|
362
|
+
border: 1px solid #dcdfe6;
|
|
363
|
+
border-radius: 6px;
|
|
364
|
+
padding: 0 8px;
|
|
365
|
+
font-size: 12px;
|
|
366
|
+
font-family: inherit;
|
|
367
|
+
}
|
|
368
|
+
.keyword-input:focus {
|
|
369
|
+
border-color: #3D61E3;
|
|
370
|
+
outline: none;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
@media (max-width: 720px) {
|
|
374
|
+
.edit-row,
|
|
375
|
+
.section-row {
|
|
376
|
+
flex-direction: column;
|
|
377
|
+
gap: 8px;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.edit-row > .label,
|
|
381
|
+
.section-row > .label {
|
|
382
|
+
min-width: 0;
|
|
383
|
+
padding-top: 0;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.answer-item-label {
|
|
387
|
+
min-width: 0;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.answer-tags {
|
|
391
|
+
max-width: none;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
`],h([e.property({type:Number,attribute:"order-index"})],exports.QxsTextFill.prototype,"order-index",2),h([e.property({type:String,attribute:"subject-prefix"})],exports.QxsTextFill.prototype,"subject-prefix",2),h([e.property({type:String})],exports.QxsTextFill.prototype,"title",2),h([e.property({type:String,attribute:"custom-id"})],exports.QxsTextFill.prototype,"custom-id",2),h([e.property({type:Boolean,attribute:"is-edit"})],exports.QxsTextFill.prototype,"is-edit",2),h([e.property({type:Boolean,attribute:"is-save"})],exports.QxsTextFill.prototype,"is-save",2),h([e.property({type:Boolean,attribute:"is-set"})],exports.QxsTextFill.prototype,"is-set",2),h([e.property({type:Boolean,attribute:"is-key"})],exports.QxsTextFill.prototype,"is-key",2),h([e.property({type:Boolean,attribute:"show-action"})],exports.QxsTextFill.prototype,"show-action",2),h([e.property({type:Boolean,attribute:"show-add"})],exports.QxsTextFill.prototype,"show-add",2),h([e.property({type:Boolean,attribute:"hide-add-rich-text"})],exports.QxsTextFill.prototype,"hide-add-rich-text",2),h([e.property({type:Boolean,attribute:"show-rich-text"})],exports.QxsTextFill.prototype,"show-rich-text",2),h([e.property({type:Boolean,attribute:"show-delete-action"})],exports.QxsTextFill.prototype,"show-delete-action",2),h([e.property({type:Boolean,attribute:"show-save-action"})],exports.QxsTextFill.prototype,"show-save-action",2),h([e.property({type:Boolean,reflect:!0})],exports.QxsTextFill.prototype,"sorting",2),h([e.property({type:Boolean,attribute:"show-answer-setting"})],exports.QxsTextFill.prototype,"show-answer-setting",2),h([e.property({type:Boolean,attribute:"show-analysis"})],exports.QxsTextFill.prototype,"show-analysis",2),h([e.property({type:String,attribute:"rich-text-content"})],exports.QxsTextFill.prototype,"rich-text-content",2),h([e.property({type:String})],exports.QxsTextFill.prototype,"analysis",2),h([e.property({type:Number,attribute:"exam-answer-relation-type"})],exports.QxsTextFill.prototype,"exam-answer-relation-type",2),h([e.property({type:String,attribute:"exam-expand"})],exports.QxsTextFill.prototype,"exam-expand",2),h([e.property({type:Number,attribute:"exam-id"})],exports.QxsTextFill.prototype,"exam-id",2),h([e.property({type:String,attribute:"category-id"})],exports.QxsTextFill.prototype,"category-id",2),h([e.property({type:Object,attribute:"exam-answer-setting"})],exports.QxsTextFill.prototype,"exam-answer-setting",2),h([e.property({type:Object,attribute:"upload-image"})],exports.QxsTextFill.prototype,"upload-image",2),h([e.property({type:Array,attribute:"answer-list"})],exports.QxsTextFill.prototype,"answer-list",2),h([e.property({type:Array,attribute:"tag-list"})],exports.QxsTextFill.prototype,"tag-list",2),h([e.property({type:Array,attribute:"category-list"})],exports.QxsTextFill.prototype,"category-list",2),h([e.property({type:Array,attribute:"resource-list"})],exports.QxsTextFill.prototype,"resource-list",2),h([e.property({type:Boolean,attribute:"show-tag"})],exports.QxsTextFill.prototype,"show-tag",2),h([e.property({type:Boolean,attribute:"show-category"})],exports.QxsTextFill.prototype,"show-category",2),h([e.property({type:Boolean,attribute:"show-resource"})],exports.QxsTextFill.prototype,"show-resource",2),h([e.property({type:Object,attribute:"search-handler"})],exports.QxsTextFill.prototype,"search-handler",2),h([e.property({type:String,attribute:"model-value"})],exports.QxsTextFill.prototype,"model-value",2),h([e.property({type:Boolean,attribute:"use-model"})],exports.QxsTextFill.prototype,"use-model",2),h([e.state()],exports.QxsTextFill.prototype,"_answers",2),h([e.state()],exports.QxsTextFill.prototype,"_title",2),h([e.state()],exports.QxsTextFill.prototype,"_analysis",2),h([e.state()],exports.QxsTextFill.prototype,"_isInOrder",2),h([e.state()],exports.QxsTextFill.prototype,"_isIgnoreCase",2),h([e.state()],exports.QxsTextFill.prototype,"_keywordCount",2),h([e.state()],exports.QxsTextFill.prototype,"_correct",2),h([e.state()],exports.QxsTextFill.prototype,"_showRichText",2),h([e.state()],exports.QxsTextFill.prototype,"_richText",2),h([e.state()],exports.QxsTextFill.prototype,"_selectedTagList",2),h([e.state()],exports.QxsTextFill.prototype,"_categoryId",2),exports.QxsTextFill=h([s.safeCustomElement("qxs-text-fill")],exports.QxsTextFill);
|
|
260
395
|
//# sourceMappingURL=text-fill.cjs.map
|